From 7b4df33d5c0db942c572e0e766b64deac3ddb974 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 8 Mar 2023 12:46:21 -0500 Subject: [PATCH] v2.0.0: refactored sword dance, now applies to thrown weapons --- .../shatteredpixeldungeon/actors/hero/Hero.java | 14 ++++++++------ .../shatteredpixeldungeon/items/weapon/Weapon.java | 9 ++++++++- .../items/weapon/missiles/MissileWeapon.java | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) 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 e9a91fb7a..b6421766d 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 @@ -699,10 +699,6 @@ public class Hero extends Char { float delay = 1f; - if (buff(Scimitar.SwordDance.class) != null){ - delay /= 1.6f; //+60% speed - } - if (!RingOfForce.fightingUnarmed(this)) { return delay * belongings.attackingWeapon().delayFactor( this ); @@ -711,13 +707,19 @@ public class Hero extends Char { //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! - delay *= 1f/RingOfFuror.attackSpeedMultiplier(this); + float speed = RingOfFuror.attackSpeedMultiplier(this); + //ditto for furor + sword dance! + if (buff(Scimitar.SwordDance.class) != null){ + speed += 0.6f; + } + + //and augments + brawler's stance! My goodness, so many options now compared to 2014! if (RingOfForce.unarmedGetsWeaponAugment(this)){ delay = ((Weapon)belongings.weapon).augment.delayFactor(delay); } - return delay; + return delay/speed; } } 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 e63b2c00a..445fa3fc3 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 @@ -57,6 +57,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocki import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Unstable; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RunicBlade; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -208,7 +209,13 @@ abstract public class Weapon extends KindOfWeapon { } protected float speedMultiplier(Char owner ){ - return RingOfFuror.attackSpeedMultiplier(owner); + float multi = RingOfFuror.attackSpeedMultiplier(owner); + + if (owner.buff(Scimitar.SwordDance.class) != null){ + multi += 0.6f; + } + + return multi; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 47321ac1d..f07774e73 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projecting; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;