v2.0.0: fixed several missing bits in flail ability

This commit is contained in:
Evan Debenham
2022-12-08 12:51:45 -05:00
parent 69be76c7cf
commit 45c8063dec
2 changed files with 22 additions and 11 deletions

View File

@@ -1514,6 +1514,8 @@ items.weapon.melee.flail.ability_name=spin
items.weapon.melee.flail.spin_warn=You can't spin the flail any more.
items.weapon.melee.flail.ability_desc=The Duelist can _spin_ a flail to build up power for a short time. Each turn the flail is spun it will deal +20% damage, to a max of 3 times. At 3 spins the flail is also guaranteed to hit. Starting to spin the flail costs 2 charges.
items.weapon.melee.flail.desc=A spiked ball attached to a handle by a length of chain. Very unwieldy, but devastating if it lands a solid hit.
items.weapon.melee.flail$spinabilitytracker.name=spinning
items.weapon.melee.flail$spinabilitytracker.desc=The Duelist is spinning her flail, building damage for her next attack with it. Each spin takes one turn but increases damage by 20%%. At 60%% bonus damage, the flail is also guaranteed to hit.\n\nCurrent bonus damage: %1$d%%.\nTurns remaining: %2$s.
items.weapon.melee.gauntlet.name=stone gauntlet
items.weapon.melee.gauntlet.stats_desc=This is a very fast weapon.

View File

@@ -53,26 +53,30 @@ public class Flail extends MeleeWeapon {
lvl*Math.round(1.6f*(tier+1)); //+8 per level, up from +5
}
private static float spinBonus = 1f;
@Override
public int damageRoll(Char owner) {
int dmg = super.damageRoll(owner);
SpinAbilityTracker spin = owner.buff(SpinAbilityTracker.class);
if (spin != null){
dmg = Math.round(dmg * (1f + 0.2f*spin.spins));
if (spin.spins == 3) Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
spin.detach();
}
int dmg = Math.round(super.damageRoll(owner) * spinBonus);
if (spinBonus == 1.6f) Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG);
spinBonus = 1f;
return dmg;
}
@Override
public float accuracyFactor(Char owner, Char target) {
SpinAbilityTracker spin = owner.buff(SpinAbilityTracker.class);
if (spin != null && spin.spins >= 3f) {
return Float.POSITIVE_INFINITY;
if (spin != null) {
//we detach and calculate bonus here in case the attack misses
spin.detach();
spinBonus = 1f + 0.2f*spin.spins;
if (spinBonus == 1.6f){
return Float.POSITIVE_INFINITY;
} else {
return super.accuracyFactor(owner, target);
}
} else {
spinBonus = 1f;
return super.accuracyFactor(owner, target);
}
}
@@ -137,6 +141,11 @@ public class Flail extends MeleeWeapon {
return Math.max(0, (3 - visualcooldown()) / 3);
}
@Override
public String desc() {
return Messages.get(this, "desc", 20*spins, dispTurns());
}
public static String SPINS = "spins";
@Override