v2.0.0: fixed sword dance not applying on unarmed attacks

This commit is contained in:
Evan Debenham
2023-02-17 15:10:23 -05:00
parent e82ea5a5f0
commit 1e09ffbb04
3 changed files with 15 additions and 14 deletions

View File

@@ -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.

View File

@@ -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);

View File

@@ -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