v2.0.0: fixed whip ability always using primary weapon's range

This commit is contained in:
Evan Debenham
2023-01-28 16:22:38 -05:00
committed by Evan Debenham
parent 43debd921e
commit 3154fb26f0

View File

@@ -57,6 +57,8 @@ public class Whip extends MeleeWeapon {
ArrayList<Char> targets = new ArrayList<>();
//temporarily set whip as ability weapon before the attack, as we want to use its range
hero.belongings.abilityWeapon = this;
for (Char ch : Actor.chars()){
if (ch.alignment == Char.Alignment.ENEMY
&& !hero.isCharmedBy(ch)
@@ -65,6 +67,7 @@ public class Whip extends MeleeWeapon {
targets.add(ch);
}
}
hero.belongings.abilityWeapon = null;
if (targets.isEmpty()) {
GLog.w(Messages.get(this, "ability_no_target"));