v2.0.0: implemented the dragon kick ability

This commit is contained in:
Evan Debenham
2023-02-27 16:53:33 -05:00
parent 6acf20336e
commit 4243fbde8d
2 changed files with 59 additions and 3 deletions

View File

@@ -283,7 +283,7 @@ actors.buffs.monkenergy$monkability$dash.name=dash
actors.buffs.monkenergy$monkability$dash.prompt=Choose a Location
actors.buffs.monkenergy$monkability$dash.desc=An instant dash up to 3 tiles away. This ability can go over hazards, but not through enemies or walls.
actors.buffs.monkenergy$monkability$dragonkick.name=dragon kick
actors.buffs.monkenergy$monkability$dragonkick.desc=A devastating kick that deals %1$d-%2$d damage and ignores armor. The kick also knocks the target away and paralyzes them for 5 turns.
actors.buffs.monkenergy$monkability$dragonkick.desc=A devastating kick that deals %1$d-%2$d damage and ignores armor. The kick knocks the target away and paralyzes them for each tile they travel.
actors.buffs.monkenergy$monkability$meditate.name=meditate
actors.buffs.monkenergy$monkability$meditate.desc=The Monk focuses energy into her body for 5 turns. This clears most negative effects and grants her 10 turns of wand and artifact recharging.

View File

@@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RipperDemon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogDzewa;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
@@ -262,8 +263,8 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
public void call() {
hero.attack(enemy, 1, 0, Char.INFINITE_ACCURACY);
Invisibility.dispel();
hero.next();
tracker.detach();
Buff.affect(hero, MonkEnergy.class).abilityUsed(Flurry.this);
if (hero.buff(JustHitTracker.class) != null) {
hero.buff(JustHitTracker.class).detach();
@@ -272,6 +273,7 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
});
} else {
Invisibility.dispel();
hero.next();
tracker.detach();
Buff.affect(hero, MonkEnergy.class).abilityUsed(Flurry.this);
if (hero.buff(JustHitTracker.class) != null) {
@@ -396,9 +398,63 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
return 3;
}
@Override
public String desc() {
//3x hero unarmed damage
return Messages.get(this, "desc", 3, 3*(Dungeon.hero.STR()-8));
}
@Override
public String targetingPrompt() {
return Messages.get(MeleeWeapon.class, "prompt");
}
@Override
public void doAbility(Hero hero, Integer target) {
//TODO
if (target == null || target == -1){
return;
}
Char enemy = Actor.findChar(target);
if (enemy == null || enemy == hero || hero.isCharmedBy(enemy) || !Dungeon.level.heroFOV[target]) {
GLog.w(Messages.get(MeleeWeapon.class, "ability_no_target"));
return;
}
UnarmedAbilityTracker tracker = Buff.affect(hero, UnarmedAbilityTracker.class);
if (!hero.canAttack(enemy)){
GLog.w(Messages.get(MeleeWeapon.class, "ability_bad_position"));
tracker.detach();
return;
}
hero.sprite.attack(enemy.pos, new Callback() {
@Override
public void call() {
AttackIndicator.target(enemy);
if (hero.attack(enemy, 4f, 0, Char.INFINITE_ACCURACY)){
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
}
if (enemy.isAlive()){
int oldPos = enemy.pos;
//trace a ballistica to our target (which will also extend past them
Ballistica trajectory = new Ballistica(hero.pos, enemy.pos, Ballistica.STOP_TARGET);
//trim it to just be the part that goes past them
trajectory = new Ballistica(trajectory.collisionPos, trajectory.path.get(trajectory.path.size() - 1), Ballistica.PROJECTILE);
//knock them back along that ballistica
WandOfBlastWave.throwChar(enemy, trajectory, 6, true, false, hero.getClass());
if (trajectory.dist > 0) {
Buff.affect(enemy, Paralysis.class, Math.min( 6, trajectory.dist));
}
}
Invisibility.dispel();
hero.spendAndNext(hero.attackDelay());
tracker.detach();
Buff.affect(hero, MonkEnergy.class).abilityUsed(DragonKick.this);
}
});
}
}