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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = this;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -77,10 +77,12 @@ public class Greataxe extends MeleeWeapon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = this;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -74,10 +74,12 @@ public class Mace extends MeleeWeapon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = wep;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -74,11 +74,13 @@ public class RunicBlade extends MeleeWeapon {
|
|||||||
|
|
||||||
//we apply here because of projecting
|
//we apply here because of projecting
|
||||||
RunicSlashTracker tracker = Buff.affect(hero, RunicSlashTracker.class);
|
RunicSlashTracker tracker = Buff.affect(hero, RunicSlashTracker.class);
|
||||||
|
hero.belongings.abilityWeapon = this;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(this, "ability_bad_position"));
|
GLog.w(Messages.get(this, "ability_bad_position"));
|
||||||
tracker.detach();
|
tracker.detach();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -76,10 +76,12 @@ public class Sai extends MeleeWeapon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = wep;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3
@@ -75,10 +75,13 @@ public class Spear extends MeleeWeapon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = wep;
|
||||||
if (!hero.canAttack(enemy) || Dungeon.level.adjacent(hero.pos, enemy.pos)){
|
if (!hero.canAttack(enemy) || Dungeon.level.adjacent(hero.pos, enemy.pos)){
|
||||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -77,10 +77,12 @@ public class Sword extends MeleeWeapon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hero.belongings.abilityWeapon = wep;
|
||||||
if (!hero.canAttack(enemy)){
|
if (!hero.canAttack(enemy)){
|
||||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hero.belongings.abilityWeapon = null;
|
||||||
|
|
||||||
hero.sprite.attack(enemy.pos, new Callback() {
|
hero.sprite.attack(enemy.pos, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
-1
@@ -57,7 +57,6 @@ public class Whip extends MeleeWeapon {
|
|||||||
|
|
||||||
ArrayList<Char> targets = new ArrayList<>();
|
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;
|
hero.belongings.abilityWeapon = this;
|
||||||
for (Char ch : Actor.chars()){
|
for (Char ch : Actor.chars()){
|
||||||
if (ch.alignment == Char.Alignment.ENEMY
|
if (ch.alignment == Char.Alignment.ENEMY
|
||||||
|
|||||||
Reference in New Issue
Block a user