v0.9.3: implemented the redesigned heroic leap ability

This commit is contained in:
Evan Debenham 2021-04-28 21:09:07 -04:00
parent 1792974051
commit 9e525a6f02
5 changed files with 56 additions and 24 deletions

View File

@ -334,7 +334,7 @@ actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed,
##abilities
actors.hero.abilities.warrior.heroicleap.name=heroic leap
actors.hero.abilities.warrior.heroicleap.desc=The Warrior performs a heroic leap towards a targeted location, slamming down to stun all neighbouring enemies.
actors.hero.abilities.warrior.heroicleap.desc=The Warrior performs a heroic leap towards a targeted location, slamming down to stun all neighbouring enemies. Consumes 35 charge.
actors.hero.abilities.warrior.heroicleap.prompt=Choose direction to leap
actors.hero.abilities.warrior.warrior2.name=???
actors.hero.abilities.warrior.warrior2.desc=I haven't decided on this ability yet.
@ -461,14 +461,14 @@ actors.hero.talent.lethal_defense.desc=_+1:_ When the Gladiator kills an enemy w
actors.hero.talent.enhanced_combo.title=enhanced combo
actors.hero.talent.enhanced_combo.desc=_+1:_ When the Gladiator's combo is 7 or higher, Clobber's knockback range increases to 3, it inflicts vertigo, and it can knock enemies into pits.\n\n_+2:_ In addition to the benefits of +1, when the Gladiator's combo is 9 or higher Parry works on multiple attacks.\n\n_+3:_ In addition to the benefits of +1 and +2, the Gladiator can leap up to combo/3 tiles when using Slam, Crush, or Fury.
actors.hero.talent.heroic_leap_1.title=TODO NAME
actors.hero.talent.heroic_leap_1.desc=TODO DESC
actors.hero.talent.heroic_leap_2.title=TODO NAME
actors.hero.talent.heroic_leap_2.desc=TODO DESC
actors.hero.talent.heroic_leap_3.title=TODO NAME
actors.hero.talent.heroic_leap_3.desc=TODO DESC
actors.hero.talent.body_slam.title=body slam
actors.hero.talent.body_slam.desc=_+1:_ When the Warrior lands after jumping, all adjacent enemies take _25%_ of his damage blocking power in damage.\n\n_+2:_ When the Warrior lands after jumping, all adjacent enemies take _50%_ of his damage blocking power in damage.\n\n_+3:_ When the Warrior lands after jumping, all adjacent enemies take _75%_ of his damage blocking power in damage.\n\n_+4:_ When the Warrior lands after jumping, all adjacent enemies take _100%_ of his damage blocking power in damage.
actors.hero.talent.impact_wave.title=impact wave
actors.hero.talent.impact_wave.desc=_+1:_ When the Warrior lands after jumping, all adjacent enemies are knocked _2 tiles_ back.\n\n_+2:_ When the Warrior lands after jumping, all adjacent enemies are knocked _4 tiles_ back.\n\n_+3:_ When the Warrior lands after jumping, all adjacent enemies are knocked _6 tiles_ back.\n\n_+4:_ When the Warrior lands after jumping, all adjacent enemies are knocked _8 tiles_ back.
actors.hero.talent.double_jump.title=double jump
actors.hero.talent.double_jump.desc=_+1:_ If the Warrior performs a second leap within 5 turns, that leap has a _24% reduced_ charge cost.\n\n_+2:_ If the Warrior performs a second leap within 5 turns, that leap has a _42% reduced_ charge cost.\n\n_+3:_ If the Warrior performs a second leap within 5 turns, that leap has a _56% reduced_ charge cost.\n\n_+4:_ If the Warrior performs a second leap within 5 turns, that leap has a _67% reduced_ charge cost.
actors.hero.talent.heroic_leap_4.title=TODO NAME
actors.hero.talent.heroic_leap_4.desc=TODO DESC
actors.hero.talent.heroic_leap_4.desc=_+1:_ \n\n_+2:_ \n\n_+3:_ \n\n_+4:_
actors.hero.talent.warrior_2_1.title=TODO NAME
actors.hero.talent.warrior_2_1.desc=TODO DESC

View File

@ -79,7 +79,7 @@ public enum Talent {
//Gladiator T3
CLEAVE(14, 3), LETHAL_DEFENSE(15, 3), ENHANCED_COMBO(16, 3),
//Heroic Leap T4
HEROIC_LEAP_1(17, 4), HEROIC_LEAP_2(18, 4), HEROIC_LEAP_3(19, 4), HEROIC_LEAP_4(20, 4),
BODY_SLAM(17, 4), IMPACT_WAVE(18, 4), DOUBLE_JUMP(19, 4), HEROIC_LEAP_4(20, 4),
//??? T4
WARRIOR_2_1(21, 4), WARRIOR_2_2(22, 4), WARRIOR_2_3(23, 4), WARRIOR_2_4(24, 4),
//??? T4

View File

@ -55,6 +55,10 @@ public abstract class ArmorAbility implements Bundlable {
return null;
}
public float chargeUse( Hero hero ){
return 35;
}
protected abstract void activate( ClassArmor armor, Hero hero, Integer target );
public String name(){

View File

@ -25,14 +25,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
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.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
@ -43,25 +42,35 @@ import com.watabou.utils.PathFinder;
public class HeroicLeap extends ArmorAbility {
private static int LEAP_TIME = 1;
private static int SHOCK_TIME = 5;
@Override
protected String targetingPrompt() {
return Messages.get(this, "prompt");
}
@Override
public float chargeUse( Hero hero ) {
float chargeUse = 35;
if (hero.buff(DoubleJumpTracker.class) != null){
//reduced charge by 24%/42%/56%/67%
chargeUse *= Math.pow(0.76, hero.pointsInTalent(Talent.DOUBLE_JUMP));
}
return chargeUse;
}
@Override
public void activate( ClassArmor armor, Hero hero, Integer target ) {
if (target != null && target != hero.pos) {
if (target != null) {
Ballistica route = new Ballistica(hero.pos, target, Ballistica.PROJECTILE);
int cell = route.collisionPos;
//can't occupy the same cell as another char, so move back one.
if (Actor.findChar( cell ) != null && cell != hero.pos)
cell = route.path.get(route.dist-1);
if (Actor.findChar( cell ) != null && cell != hero.pos) {
cell = route.path.get(route.dist - 1);
}
armor.charge -= 35;
armor.charge -= chargeUse( hero );
armor.updateQuickslot();
final int dest = cell;
@ -74,25 +83,44 @@ public class HeroicLeap extends ArmorAbility {
Dungeon.observe();
GameScene.updateFog();
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
Char mob = Actor.findChar(hero.pos + PathFinder.NEIGHBOURS8[i]);
for (int i : PathFinder.NEIGHBOURS8) {
Char mob = Actor.findChar(hero.pos + i);
if (mob != null && mob != hero && mob.alignment != Char.Alignment.ALLY) {
Buff.prolong(mob, Paralysis.class, SHOCK_TIME);
if (hero.hasTalent(Talent.BODY_SLAM)){
int damage = hero.drRoll();
damage = Math.round(damage*0.25f*hero.pointsInTalent(Talent.BODY_SLAM));
mob.damage(damage, hero);
}
if (mob.pos == hero.pos + i && hero.hasTalent(Talent.IMPACT_WAVE)){
Ballistica trajectory = new Ballistica(mob.pos, mob.pos + i, Ballistica.MAGIC_BOLT);
int strength = 2*hero.pointsInTalent(Talent.IMPACT_WAVE);
WandOfBlastWave.throwChar(mob, trajectory, strength, true);
}
}
}
CellEmitter.center(dest).burst(Speck.factory(Speck.DUST), 10);
WandOfBlastWave.BlastWave.blast(dest);
Camera.main.shake(2, 0.5f);
Invisibility.dispel();
hero.spendAndNext(LEAP_TIME);
if (hero.buff(DoubleJumpTracker.class) != null){
hero.buff(DoubleJumpTracker.class).detach();
} else {
if (hero.hasTalent(Talent.DOUBLE_JUMP)) {
Buff.affect(hero, DoubleJumpTracker.class, 5);
}
}
}
});
}
}
public static class DoubleJumpTracker extends FlavourBuff{};
@Override
public Talent[] talents() {
return new Talent[]{Talent.HEROIC_LEAP_1, Talent.HEROIC_LEAP_2, Talent.HEROIC_LEAP_3, Talent.HEROIC_LEAP_4};
return new Talent[]{Talent.BODY_SLAM, Talent.IMPACT_WAVE, Talent.DOUBLE_JUMP, Talent.HEROIC_LEAP_4};
}
}

View File

@ -152,7 +152,7 @@ abstract public class ClassArmor extends Armor {
@Override
public String status() {
return Messages.format( "%.0f%%", charge );
return Messages.format( "%.0f%%", Math.floor(charge) );
}
@Override
@ -167,7 +167,7 @@ abstract public class ClassArmor extends Armor {
GameScene.show(new WndChooseAbility(null, this, hero));
} else if (!isEquipped( hero )) {
GLog.w( Messages.get(this, "not_equipped") );
} else if (charge < 35) {
} else if (charge < hero.armorAbility.chargeUse(hero)) {
GLog.w( Messages.get(this, "low_charge") );
} else {
hero.armorAbility.use(this, hero);