From 1e09ffbb049153ecf0a255a8fcd2fa723c42f17c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 17 Feb 2023 15:10:23 -0500 Subject: [PATCH] v2.0.0: fixed sword dance not applying on unarmed attacks --- .../main/assets/messages/items/items.properties | 2 +- .../shatteredpixeldungeon/actors/hero/Hero.java | 15 +++++++++++++-- .../items/weapon/Weapon.java | 12 +----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 78965b0ae..4a3e48c4e 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1682,7 +1682,7 @@ items.weapon.melee.scimitar.ability_name=sword dance items.weapon.melee.scimitar.ability_desc=The Duelist can perform a _sword dance_ with a scimitar. This stance grants the Duelist +60% attack speed and -20% accuracy for 6 turns, takes no time to activate, and costs two charges. items.weapon.melee.scimitar.desc=A thick curved blade. Its shape allows for faster, yet less powerful attacks. items.weapon.melee.scimitar$sworddance.name=sword dance -items.weapon.melee.scimitar$sworddance.desc=The Duelist is making quick momentum based strikes with her weapon, in a sort of dance. While this stance is active, she attacks 60%% faster (enough to attack exactly twice a turn with a scimitar), but suffers -20%% accuracy.\n\nTurns remaining: %s. +items.weapon.melee.scimitar$sworddance.desc=The Duelist is making quick momentum based strikes in a sort of dance. While this stance is active, she attacks 60%% faster (enough to attack exactly twice a turn with a scimitar), but suffers -20%% accuracy.\n\nTurns remaining: %s. items.weapon.melee.spear.name=spear items.weapon.melee.spear.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 0bc4a4a07..da6b0379c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -126,6 +126,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Quarterstaff; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RoundShield; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sai; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; @@ -475,6 +476,10 @@ public class Hero extends Char { accuracy *= 1.5f; } } + + if (buff(Scimitar.SwordDance.class) != null){ + accuracy *= 0.8f; + } if (!RingOfForce.fightingUnarmed(this)) { return (int)(attackSkill * accuracy * wep.accuracyFactor( this, target )); @@ -681,15 +686,21 @@ public class Hero extends Char { return 0; } + float delay = 1f; + + if (buff(Scimitar.SwordDance.class) != null){ + delay /= 1.6f; //+60% speed + } + if (!RingOfForce.fightingUnarmed(this)) { - return belongings.weapon().delayFactor( this ); + return delay * belongings.weapon().delayFactor( this ); } else { //Normally putting furor speed on unarmed attacks would be unnecessary //But there's going to be that one guy who gets a furor+force ring combo //This is for that one guy, you shall get your fists of fury! - float delay = 1f/RingOfFuror.attackSpeedMultiplier(this); + delay *= 1f/RingOfFuror.attackSpeedMultiplier(this); if (RingOfForce.unarmedGetsWeaponEffects(this)){ delay = ((Weapon)belongings.weapon).augment.delayFactor(delay); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index be02ccfbc..a0363c918 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -186,10 +186,6 @@ abstract public class Weapon extends KindOfWeapon { ACC /= 5; } - if (owner.buff(Scimitar.SwordDance.class) != null){ - ACC *= 0.8f; - } - return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC; } @@ -211,13 +207,7 @@ abstract public class Weapon extends KindOfWeapon { } protected float speedMultiplier(Char owner ){ - float multi = RingOfFuror.attackSpeedMultiplier(owner); - - if (owner.buff(Scimitar.SwordDance.class) != null){ - multi += 0.6f; - } - - return multi; + return RingOfFuror.attackSpeedMultiplier(owner); } @Override