diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 0c3f35bde..c6c5dcabf 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -622,7 +622,7 @@ actors.hero.talent.ally_warp.title=ally warp actors.hero.talent.ally_warp.desc=_+1:_ The Mage can tap an ally to instantly swap places with them, with a _2 tile range_.\n\n_+2:_ The Mage can tap an ally to instantly swap places with them, with a _4 tile range_.\n\n_+3:_ The Mage can tap an ally to instantly swap places with them, with a _6 tile range_.\n\nThe Mage cannot swap places with immobile allies. actors.hero.talent.empowered_strike.title=empowered strike -actors.hero.talent.empowered_strike.desc=_+1:_ The Battlemage's first melee strike with his staff after zapping with it deals _+25% damage_.\n\n_+2:_ The Battlemage's first melee strike with his staff after zapping with it deals _+50% damage_.\n\n_+3:_ The Battlemage's first melee strike with his staff after zapping with it deals _+75% damage_. +actors.hero.talent.empowered_strike.desc=_+1:_ The Battlemage's first melee strike with his staff after zapping with it deals _+16% damage_ and the staff's bonus effect gets _+33% power_.\n\n_+2:_ The Battlemage's first melee strike with his staff after zapping with it deals _+33% damage_ and the staff's bonus effect gets _+67% power_.\n\n_+3:_ The Battlemage's first melee strike with his staff after zapping with it deals _+50% damage_ and the staff's bonus effect gets _+100% power_. actors.hero.talent.mystical_charge.title=mystical charge actors.hero.talent.mystical_charge.desc=_+1:_ Striking with his staff grants the Battlemage _0.5 turns_ worth of artifact recharging.\n\n_+2:_ Striking with his staff grants the Battlemage _1 turn_ worth of artifact recharging.\n\n_+3:_ Striking with his staff grants the Battlemage _1.5 turns_ worth of artifact recharging. actors.hero.talent.excess_charge.title=excess charge diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index ccae7e270..1a37e132f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -125,6 +125,14 @@ public abstract class Wand extends Item { public abstract void onHit( MagesStaff staff, Char attacker, Char defender, int damage); + //not affected by enchantment proc chance changers + public static float procChanceMultiplier( Char attacker ){ + if (attacker.buff(Talent.EmpoweredStrikeTracker.class) != null){ + return 1f + ((Hero)attacker).pointsInTalent(Talent.EMPOWERED_STRIKE)/3f; + } + return 1f; + } + public boolean tryToZap( Hero owner, int target ){ if (owner.buff(MagicImmune.class) != null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index 49dadbe8a..78f14c787 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Effects; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; @@ -188,7 +190,7 @@ public class WandOfBlastWave extends DamageWand { private static class BlastWaveOnHit extends Elastic{ @Override protected float procChanceMultiplier(Char attacker) { - return 1f; //not affected by enchantment proc chance changers + return Wand.procChanceMultiplier(attacker); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java index 4e82c2a2e..48ea0ac7f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java @@ -91,12 +91,17 @@ public class WandOfCorrosion extends Wand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { + int level = Math.max( 0, buffedLvl() ); + // lvl 0 - 33% // lvl 1 - 50% // lvl 2 - 60% - if (Random.Int( buffedLvl() + 3 ) >= 2) { + float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker); + if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); - Buff.affect( defender, Ooze.class ).set( Ooze.DURATION ); + Buff.affect( defender, Ooze.class ).set( Ooze.DURATION * powerMulti ); CellEmitter.center(defender.pos).burst( CorrosionParticle.SPLASH, 5 ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 560bcf50a..635586d3c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -235,11 +235,17 @@ public class WandOfCorruption extends Wand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { + int level = Math.max( 0, buffedLvl() ); + // lvl 0 - 25% // lvl 1 - 40% // lvl 2 - 50% - if (Random.Int( buffedLvl() + 4 ) >= 3){ - Buff.prolong( defender, Amok.class, 4+ buffedLvl()*2); + float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker); + if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + + Buff.prolong( defender, Amok.class, Math.round((4+level*2) * powerMulti)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index d99e2c5c9..cab023b4f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -151,7 +151,7 @@ public class WandOfFireblast extends DamageWand { private static class FireBlastOnHit extends Blazing { @Override protected float procChanceMultiplier(Char attacker) { - return 1f; //not affected by enchantment proc chance changers + return Wand.procChanceMultiplier(attacker); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java index c1a02baaf..7a18aea01 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java @@ -122,15 +122,29 @@ public class WandOfFrost extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { Chill chill = defender.buff(Chill.class); - if (chill != null && Random.IntRange(2, (int)Chill.DURATION) <= chill.cooldown()){ - //need to delay this through an actor so that the freezing isn't broken by taking damage from the staff hit. - new FlavourBuff(){ - {actPriority = VFX_PRIO;} - public boolean act() { - Buff.affect(target, Frost.class, Frost.DURATION); - return super.act(); - } - }.attachTo(defender); + + if (chill != null) { + + //1/9 at 2 turns of chill, scaling to 9/9 at 10 turns + float procChance = ((int)Math.floor(chill.cooldown()) - 1)/9f; + procChance *= procChanceMultiplier(attacker); + + if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + + //need to delay this through an actor so that the freezing isn't broken by taking damage from the staff hit. + new FlavourBuff() { + { + actPriority = VFX_PRIO; + } + + public boolean act() { + Buff.affect(target, Frost.class, Math.round(Frost.DURATION * powerMulti)); + return super.act(); + } + }.attachTo(defender); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index 63b3e03f9..923969def 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -105,7 +105,7 @@ public class WandOfLightning extends DamageWand { private static class LightningOnHit extends Shocking { @Override protected float procChanceMultiplier(Char attacker) { - return 1f; //not affected by enchantment proc chance changers + return Wand.procChanceMultiplier(attacker); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java index 5dfecdf83..fa56973ff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java @@ -196,7 +196,7 @@ public class WandOfLivingEarth extends DamageWand { } } - int armor = Math.round(damage*0.33f); + int armor = Math.round(damage*0.33f*procChanceMultiplier(attacker)); if (guardian != null){ guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java index c083e4ab2..e2d3799a6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java @@ -82,7 +82,7 @@ public class WandOfMagicMissile extends DamageWand { SpellSprite.show(attacker, SpellSprite.CHARGE); for (Wand.Charger c : attacker.buffs(Wand.Charger.class)){ if (c.wand() != this){ - c.gainCharge(0.5f); + c.gainCharge(0.5f * procChanceMultiplier(attacker)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java index 166da1322..dfb36b1aa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java @@ -147,7 +147,7 @@ public class WandOfPrismaticLight extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { //cripples enemy - Buff.prolong( defender, Cripple.class, 1f+staff.buffedLvl()); + Buff.prolong( defender, Cripple.class, Math.round((1+staff.buffedLvl())*procChanceMultiplier(attacker))); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 3b5d29c5d..df31f1b4c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -239,6 +239,7 @@ public class WandOfRegrowth extends Wand { // lvl 1 - 21% // lvl 2 - 25% int healing = Math.round(damage * (level + 2f) / (level + 6f) / 2f); + healing = Math.round(healing * procChanceMultiplier(attacker)); Buff.affect(attacker, Sungrass.Health.class).boost(healing); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index 49d96ba53..d4458a17b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -143,7 +143,7 @@ public class WandOfTransfusion extends Wand { if (defender.buff(Charm.class) != null && defender.buff(Charm.class).object == attacker.id()){ //grants a free use of the staff and shields self freeCharge = true; - Buff.affect(attacker, Barrier.class).setShield(2*(5 + buffedLvl())); + Buff.affect(attacker, Barrier.class).setShield(Math.round((2*(5 + buffedLvl()))*procChanceMultiplier(attacker))); GLog.p( Messages.get(this, "charged") ); attacker.sprite.emitter().burst(BloodParticle.BURST, 20); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index 54dd18d8c..8bb2a3203 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -164,16 +164,19 @@ public class WandOfWarding extends Wand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { - int level = Math.max( 0, staff.buffedLvl() ); // lvl 0 - 20% // lvl 1 - 33% // lvl 2 - 43% - if (Random.Int( level + 5 ) >= 4) { + float procChance = (level+1f)/(level+5f) * procChanceMultiplier(attacker); + if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + for (Char ch : Actor.chars()){ if (ch instanceof Ward){ - ((Ward) ch).wandHeal(staff.buffedLvl()); + ((Ward) ch).wandHeal(staff.buffedLvl(), powerMulti); ch.sprite.emitter().burst(MagicMissile.WardParticle.UP, ((Ward) ch).tier); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java index 7c16ece98..5fae1a2a3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.ArcaneResin; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -151,11 +152,6 @@ public class MagesStaff extends MeleeWeapon { @Override public int proc(Char attacker, Char defender, int damage) { - if (attacker.buff(Talent.EmpoweredStrikeTracker.class) != null){ - attacker.buff(Talent.EmpoweredStrikeTracker.class).detach(); - damage = Math.round( damage * (1f + Dungeon.hero.pointsInTalent(Talent.EMPOWERED_STRIKE)/4f)); - } - if (wand.curCharges >= wand.maxCharges && attacker instanceof Hero && Random.Int(5) < ((Hero) attacker).pointsInTalent(Talent.EXCESS_CHARGE)){ Buff.affect(attacker, Barrier.class).setShield(buffedLvl()*2); } @@ -169,12 +165,24 @@ public class MagesStaff extends MeleeWeapon { } } + Talent.EmpoweredStrikeTracker empoweredStrike = attacker.buff(Talent.EmpoweredStrikeTracker.class); + if (empoweredStrike != null){ + damage = Math.round( damage * (1f + Dungeon.hero.pointsInTalent(Talent.EMPOWERED_STRIKE)/6f)); + } + if (wand != null && attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) { if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.5f; ScrollOfRecharging.charge((Hero)attacker); wand.onHit(this, attacker, defender, damage); } + + if (empoweredStrike != null){ + empoweredStrike.detach(); + if (!(defender instanceof Mob) || !((Mob) defender).surprisedBy(attacker)){ + Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG, 0.75f, 1.2f); + } + } return super.proc(attacker, defender, damage); } @@ -184,7 +192,7 @@ public class MagesStaff extends MeleeWeapon { if (owner instanceof Hero && wand instanceof WandOfDisintegration && ((Hero)owner).subClass == HeroSubClass.BATTLEMAGE){ - reach++; + reach += Math.round(Wand.procChanceMultiplier(owner)); } return reach; }