v2.0.0: fixed secondary wep abilities using primary wep's attack range
This commit is contained in:
@@ -187,10 +187,12 @@ public class Pickaxe extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = this;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -77,10 +77,12 @@ public class Greataxe extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = this;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -74,10 +74,12 @@ public class Mace extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = wep;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -74,11 +74,13 @@ public class RunicBlade extends MeleeWeapon {
|
||||
|
||||
//we apply here because of projecting
|
||||
RunicSlashTracker tracker = Buff.affect(hero, RunicSlashTracker.class);
|
||||
hero.belongings.abilityWeapon = this;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||
tracker.detach();
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -76,10 +76,12 @@ public class Sai extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = wep;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -75,10 +75,13 @@ public class Spear extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = wep;
|
||||
if (!hero.canAttack(enemy) || Dungeon.level.adjacent(hero.pos, enemy.pos)){
|
||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||
hero.belongings.abilityWeapon = null;
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -77,10 +77,12 @@ public class Sword extends MeleeWeapon {
|
||||
return;
|
||||
}
|
||||
|
||||
hero.belongings.abilityWeapon = wep;
|
||||
if (!hero.canAttack(enemy)){
|
||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
hero.belongings.abilityWeapon = null;
|
||||
|
||||
hero.sprite.attack(enemy.pos, new Callback() {
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,6 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user