v1.4.0: adjusted the empowered strike talent to grant bonus on-hit power

This commit is contained in:
Evan Debenham
2022-09-06 20:57:42 -04:00
parent 1d250aa7d5
commit 34769da55f
15 changed files with 77 additions and 30 deletions

View File

@@ -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

View File

@@ -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){

View File

@@ -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);
}
}

View File

@@ -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 );
}

View File

@@ -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));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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));
}
}

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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;
}