v2.0.0: fixed weapon abilities targeting after hit instead of before

This commit is contained in:
Evan Debenham
2023-01-30 11:46:17 -05:00
parent a48ff15b80
commit d372178632
8 changed files with 8 additions and 8 deletions

View File

@@ -206,6 +206,7 @@ public class Pickaxe extends MeleeWeapon {
damageMulti = 2f;
}
beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, damageMulti, 0, Char.INFINITE_ACCURACY)) {
if (enemy.isAlive()) {
Buff.affect(enemy, Vulnerable.class, 3f);
@@ -214,7 +215,6 @@ public class Pickaxe extends MeleeWeapon {
}
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
afterAbilityUsed(hero);

View File

@@ -88,13 +88,13 @@ public class Greataxe extends MeleeWeapon {
@Override
public void call() {
beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, 1.35f, 0, Char.INFINITE_ACCURACY)){
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
if (!enemy.isAlive()){
onAbilityKill(hero);
}
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
afterAbilityUsed(hero);

View File

@@ -85,6 +85,7 @@ public class Mace extends MeleeWeapon {
@Override
public void call() {
wep.beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, dmgMulti, 0, 0.25f)) {
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
if (enemy.isAlive()){
@@ -93,7 +94,6 @@ public class Mace extends MeleeWeapon {
wep.onAbilityKill(hero);
}
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
wep.afterAbilityUsed(hero);

View File

@@ -110,13 +110,13 @@ public class Rapier extends MeleeWeapon {
public void call() {
//+3+lvl damage, equivalent to +67% damage, but more consistent
beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, 1f, augment.damageFactor(3 + level()), Char.INFINITE_ACCURACY)){
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
if (!enemy.isAlive()){
onAbilityKill(hero);
}
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
afterAbilityUsed(hero);

View File

@@ -86,6 +86,7 @@ public class RunicBlade extends MeleeWeapon {
@Override
public void call() {
beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, 1f, 0, Char.INFINITE_ACCURACY)){
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
if (!enemy.isAlive()){
@@ -93,7 +94,6 @@ public class RunicBlade extends MeleeWeapon {
}
}
tracker.detach();
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
afterAbilityUsed(hero);

View File

@@ -87,6 +87,7 @@ public class Sai extends MeleeWeapon {
@Override
public void call() {
wep.beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
boolean hit = hero.attack(enemy, 1, 0, Char.INFINITE_ACCURACY);
if (hit && !enemy.isAlive()){
wep.onAbilityKill(hero);
@@ -100,7 +101,6 @@ public class Sai extends MeleeWeapon {
}
}
AttackIndicator.target(enemy);
if (recentHits >= 2 && hit){
for (Buff b : buffs){
b.detach();

View File

@@ -87,6 +87,7 @@ public class Spear extends MeleeWeapon {
@Override
public void call() {
wep.beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, dmgMulti, 0, Char.INFINITE_ACCURACY)) {
if (enemy.isAlive()){
//trace a ballistica to our target (which will also extend past them
@@ -100,7 +101,6 @@ public class Spear extends MeleeWeapon {
}
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
Invisibility.dispel();
wep.afterAbilityUsed(hero);

View File

@@ -88,11 +88,11 @@ public class Sword extends MeleeWeapon {
@Override
public void call() {
wep.beforeAbilityUsed(hero);
AttackIndicator.target(enemy);
if (hero.attack(enemy, dmgMulti, 0, Char.INFINITE_ACCURACY)){
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
}
AttackIndicator.target(enemy);
hero.spendAndNext(hero.attackDelay());
if (!enemy.isAlive()){
wep.onAbilityKill(hero);