v2.0.0: fixed brawlers stance benefiting from weapon reach
This commit is contained in:
+4
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
@@ -164,6 +165,7 @@ public class RingOfForce extends Ring {
|
|||||||
if (action.equals(AC_ABILITY)){
|
if (action.equals(AC_ABILITY)){
|
||||||
if (hero.buff(BrawlersStance.class) != null){
|
if (hero.buff(BrawlersStance.class) != null){
|
||||||
hero.buff(BrawlersStance.class).detach();
|
hero.buff(BrawlersStance.class).detach();
|
||||||
|
AttackIndicator.updateState();
|
||||||
} else if (!isEquipped(hero)) {
|
} else if (!isEquipped(hero)) {
|
||||||
GLog.w(Messages.get(MeleeWeapon.class, "ability_need_equip"));
|
GLog.w(Messages.get(MeleeWeapon.class, "ability_need_equip"));
|
||||||
|
|
||||||
@@ -173,6 +175,7 @@ public class RingOfForce extends Ring {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
Buff.affect(hero, BrawlersStance.class);
|
Buff.affect(hero, BrawlersStance.class);
|
||||||
|
AttackIndicator.updateState();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.execute(hero, action);
|
super.execute(hero, action);
|
||||||
@@ -203,6 +206,7 @@ public class RingOfForce extends Ring {
|
|||||||
//clear the buff if no ring of force is equipped
|
//clear the buff if no ring of force is equipped
|
||||||
if (hero.buff(RingOfForce.Force.class) == null){
|
if (hero.buff(RingOfForce.Force.class) == null){
|
||||||
stance.detach();
|
stance.detach();
|
||||||
|
AttackIndicator.updateState();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+7
-2
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.El
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
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.rings.RingOfFuror;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing;
|
||||||
@@ -212,10 +213,14 @@ abstract public class Weapon extends KindOfWeapon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int reachFactor(Char owner) {
|
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)){
|
if (hasEnchant(Projecting.class, owner)){
|
||||||
return RCH + Math.round(enchantment.procChanceMultiplier(owner));
|
return reach + Math.round(enchantment.procChanceMultiplier(owner));
|
||||||
} else {
|
} else {
|
||||||
return RCH;
|
return reach;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user