v2.0.0: fixed brawlers stance benefiting from weapon reach

This commit is contained in:
Evan Debenham
2023-02-21 16:46:13 -05:00
parent 581c03036e
commit 97a71c60b5
2 changed files with 11 additions and 2 deletions
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.Image;
@@ -164,6 +165,7 @@ public class RingOfForce extends Ring {
if (action.equals(AC_ABILITY)){
if (hero.buff(BrawlersStance.class) != null){
hero.buff(BrawlersStance.class).detach();
AttackIndicator.updateState();
} else if (!isEquipped(hero)) {
GLog.w(Messages.get(MeleeWeapon.class, "ability_need_equip"));
@@ -173,6 +175,7 @@ public class RingOfForce extends Ring {
} else {
Buff.affect(hero, BrawlersStance.class);
AttackIndicator.updateState();
}
} else {
super.execute(hero, action);
@@ -203,6 +206,7 @@ public class RingOfForce extends Ring {
//clear the buff if no ring of force is equipped
if (hero.buff(RingOfForce.Force.class) == null){
stance.detach();
AttackIndicator.updateState();
return false;
} else {
return true;
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.El
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing;
@@ -212,10 +213,14 @@ abstract public class Weapon extends KindOfWeapon {
@Override
public int reachFactor(Char owner) {
int reach = RCH;
if (owner instanceof Hero && RingOfForce.unarmedGetsWeaponEffects((Hero) owner)){
reach = 1; //brawlers stance benefits from enchantments, but not innate reach
}
if (hasEnchant(Projecting.class, owner)){
return RCH + Math.round(enchantment.procChanceMultiplier(owner));
return reach + Math.round(enchantment.procChanceMultiplier(owner));
} else {
return RCH;
return reach;
}
}