v2.0.0: fixed corrupting enemies not counting as a duel win

This commit is contained in:
Evan Debenham
2023-01-29 15:45:48 -05:00
parent 3a799c142a
commit 05209247e0
@@ -51,7 +51,7 @@ import com.watabou.utils.PathFinder;
public class Challenge extends ArmorAbility { public class Challenge extends ArmorAbility {
{ {
baseChargeUse = 35; baseChargeUse = 5;
} }
@Override @Override
@@ -229,9 +229,9 @@ public class Challenge extends ArmorAbility {
} }
} }
if (other == null){ if (other == null
detach(); || target.alignment == other.alignment
} else if (Dungeon.level.distance(target.pos, other.pos) > 5){ || Dungeon.level.distance(target.pos, other.pos) > 5) {
detach(); detach();
} }
} }
@@ -243,10 +243,9 @@ public class Challenge extends ArmorAbility {
@Override @Override
public void detach() { public void detach() {
super.detach(); super.detach();
if (!target.isAlive()) { if (target != Dungeon.hero){
if (target.alignment != Dungeon.hero.alignment){ if (!target.isAlive() || target.alignment == Dungeon.hero.alignment){
Sample.INSTANCE.play(Assets.Sounds.BOSS); Sample.INSTANCE.play(Assets.Sounds.BOSS);
GameScene.flash(0x80FFFFFF);
if (Dungeon.hero.hasTalent(Talent.INVIGORATING_VICTORY)){ if (Dungeon.hero.hasTalent(Talent.INVIGORATING_VICTORY)){
DuelParticipant heroBuff = Dungeon.hero.buff(DuelParticipant.class); DuelParticipant heroBuff = Dungeon.hero.buff(DuelParticipant.class);
@@ -275,12 +274,14 @@ public class Challenge extends ArmorAbility {
ch.buff(DuelParticipant.class).detach(); ch.buff(DuelParticipant.class).detach();
} }
} }
} else if (target != Dungeon.hero){ } else {
GameScene.flash(0x80FFFFFF); if (Dungeon.hero.isAlive()) {
} GameScene.flash(0x80FFFFFF);
if (target == Dungeon.hero && Dungeon.hero.hasTalent(Talent.ELIMINATION_MATCH) && target.isAlive()){ if (Dungeon.hero.hasTalent(Talent.ELIMINATION_MATCH)){
Buff.affect(target, EliminationMatchTracker.class, 3); Buff.affect(target, EliminationMatchTracker.class, 3);
}
}
} }
} }