From 4cf61f482009bdae557f97e1614b1a840c241e7e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 17 May 2023 21:42:28 -0400 Subject: [PATCH] v2.1.0: added an icon for precise assault and fixed a flail interaction --- .../actors/hero/Talent.java | 6 +++++- .../items/weapon/melee/MeleeWeapon.java | 17 +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 92fecb35d..6ec66494b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -269,7 +269,11 @@ public enum Talent { } }; public static class DeadlyFollowupTracker extends FlavourBuff{}; - public static class PreciseAssaultTracker extends FlavourBuff{}; + public static class PreciseAssaultTracker extends FlavourBuff{ + { type = buffType.POSITIVE; } + public int icon() { return BuffIndicator.INVERT_MARK; } + public void tintIcon(Image icon) { icon.hardlight(1f, 1f, 0.0f); } + }; public static class CombinedLethalityAbilityTracker extends FlavourBuff{ public MeleeWeapon weapon; }; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 88e2ba1d7..847c78d97 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -218,10 +218,6 @@ public class MeleeWeapon extends Weapon { Buff.affect(hero, Barrier.class).setShield(3); } - if (hero.buff(Talent.PreciseAssaultTracker.class) != null) { - hero.buff(Talent.PreciseAssaultTracker.class).detach(); - } - if (hero.buff(Talent.CombinedLethalityAbilityTracker.class) != null && hero.buff(Talent.CombinedLethalityAbilityTracker.class).weapon != null && hero.buff(Talent.CombinedLethalityAbilityTracker.class).weapon != this){ @@ -234,7 +230,7 @@ public class MeleeWeapon extends Weapon { protected void afterAbilityUsed( Hero hero ){ hero.belongings.abilityWeapon = null; if (hero.hasTalent(Talent.PRECISE_ASSAULT)){ - Buff.affect(hero, Talent.PreciseAssaultTracker.class, hero.cooldown()+4f); + Buff.prolong(hero, Talent.PreciseAssaultTracker.class, hero.cooldown()+4f); } if (hero.hasTalent(Talent.COMBINED_LETHALITY)) { Talent.CombinedLethalityAbilityTracker tracker = hero.buff(Talent.CombinedLethalityAbilityTracker.class); @@ -320,10 +316,15 @@ public class MeleeWeapon extends Weapon { public float accuracyFactor(Char owner, Char target) { float ACC = super.accuracyFactor(owner, target); - if (owner instanceof Hero && ((Hero) owner).hasTalent(Talent.PRECISE_ASSAULT)) { - if (((Hero) owner).heroClass != HeroClass.DUELIST){ + if (owner instanceof Hero + && ((Hero) owner).hasTalent(Talent.PRECISE_ASSAULT) + //does not trigger on ability attacks + && ((Hero) owner).belongings.abilityWeapon != this) { + if (((Hero) owner).heroClass != HeroClass.DUELIST) { //persistent +10%/20%/30% ACC for other heroes - ACC *= 1f + 0.1f*((Hero) owner).pointsInTalent(Talent.PRECISE_ASSAULT); + ACC *= 1f + 0.1f * ((Hero) owner).pointsInTalent(Talent.PRECISE_ASSAULT); + } else if (this instanceof Flail && owner.buff(Flail.SpinAbilityTracker.class) != null){ + //do nothing, this is not a regular attack so don't consume preciase assault } else if (owner.buff(Talent.PreciseAssaultTracker.class) != null) { // 2x/4x/8x ACC for duelist if she just used a weapon ability ACC *= Math.pow(2, ((Hero) owner).pointsInTalent(Talent.PRECISE_ASSAULT));