v0.9.3: standardized knockback effects to always work on dead chars

This commit is contained in:
Evan Debenham 2021-04-28 20:01:18 -04:00
parent 8d526cb50e
commit 9a52b49467
3 changed files with 18 additions and 18 deletions

View File

@ -331,24 +331,22 @@ public class Combo extends Buff implements ActionIndicator.Action {
switch (moveBeingUsed) {
case CLOBBER:
hit( enemy );
if (enemy.isAlive()) {
//trace a ballistica to our target (which will also extend past them
Ballistica trajectory = new Ballistica(target.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, ensuring they don't fall into a pit
int dist = 2;
if (count >= 7 && hero.pointsInTalent(Talent.ENHANCED_COMBO) >= 1){
dist ++;
Buff.prolong(enemy, Vertigo.class, 3);
} else if (!enemy.flying) {
while (dist > trajectory.dist ||
(dist > 0 && Dungeon.level.pit[trajectory.path.get(dist)])) {
dist--;
}
//trace a ballistica to our target (which will also extend past them
Ballistica trajectory = new Ballistica(target.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, ensuring they don't fall into a pit
int dist = 2;
if (enemy.isAlive() && count >= 7 && hero.pointsInTalent(Talent.ENHANCED_COMBO) >= 1){
dist ++;
Buff.prolong(enemy, Vertigo.class, 3);
} else if (!enemy.flying) {
while (dist > trajectory.dist ||
(dist > 0 && Dungeon.level.pit[trajectory.path.get(dist)])) {
dist--;
}
WandOfBlastWave.throwChar(enemy, trajectory, dist, true, false);
}
WandOfBlastWave.throwChar(enemy, trajectory, dist, true, false);
break;
case PARRY:
hit( enemy );

View File

@ -88,7 +88,9 @@ public class WandOfBlastWave extends DamageWand {
Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT);
int strength = 1 + Math.round(buffedLvl() / 2f);
throwChar(ch, trajectory, strength, false);
} else if (ch == Dungeon.hero){
}
if (ch == Dungeon.hero){
Dungeon.fail( getClass() );
GLog.n( Messages.get( this, "ondeath") );
}

View File

@ -134,7 +134,7 @@ public class Chasm implements Hero.Doom {
public static void mobFall( Mob mob ) {
if (mob.isAlive()) mob.die( Chasm.class );
((MobSprite)mob.sprite).fall();
if (mob.sprite != null) ((MobSprite)mob.sprite).fall();
}
public static class Falling extends Buff {