v0.3.5: Grim Trap bugfixes
This commit is contained in:
parent
b465f05070
commit
4beb089f3a
|
@ -65,6 +65,7 @@ public class GrimTrap extends Trap {
|
||||||
|
|
||||||
if (target != null){
|
if (target != null){
|
||||||
final Char finalTarget = target;
|
final Char finalTarget = target;
|
||||||
|
final GrimTrap trap = this;
|
||||||
MagicMissile.shadow(target.sprite.parent, pos, target.pos, new Callback() {
|
MagicMissile.shadow(target.sprite.parent, pos, target.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void call() {
|
public void call() {
|
||||||
|
@ -72,21 +73,22 @@ public class GrimTrap extends Trap {
|
||||||
if (finalTarget == Dungeon.hero) {
|
if (finalTarget == Dungeon.hero) {
|
||||||
//almost kill the player
|
//almost kill the player
|
||||||
if (((float)finalTarget.HP/finalTarget.HT) >= 0.9f){
|
if (((float)finalTarget.HP/finalTarget.HT) >= 0.9f){
|
||||||
finalTarget.damage((finalTarget.HP-1), this);
|
finalTarget.damage((finalTarget.HP-1), trap);
|
||||||
//kill 'em
|
//kill 'em
|
||||||
} else {
|
} else {
|
||||||
finalTarget.damage(finalTarget.HP, this);
|
finalTarget.damage(finalTarget.HP, trap);
|
||||||
}
|
}
|
||||||
Sample.INSTANCE.play(Assets.SND_CURSED);
|
Sample.INSTANCE.play(Assets.SND_CURSED);
|
||||||
if (!finalTarget.isAlive()) {
|
if (!finalTarget.isAlive()) {
|
||||||
Dungeon.fail( getClass() );
|
Dungeon.fail( GrimTrap.class );
|
||||||
GLog.n( Messages.get(this, "ondeath") );
|
GLog.n( Messages.get(GrimTrap.class, "ondeath") );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
finalTarget.damage(finalTarget.HP, this);
|
finalTarget.damage(finalTarget.HP, this);
|
||||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||||
}
|
}
|
||||||
finalTarget.sprite.emitter().burst(ShadowParticle.UP, 10);
|
finalTarget.sprite.emitter().burst(ShadowParticle.UP, 10);
|
||||||
|
if (!finalTarget.isAlive()) finalTarget.next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user