From 9518f3dbb5075bd7b08570e761925ff385cc45cf Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 5 Jul 2016 19:01:37 -0400 Subject: [PATCH] v0.4.1: rebalanced the flail --- .../shatteredpixeldungeon/actors/hero/Hero.java | 13 +++++++++++-- .../items/weapon/melee/Flail.java | 1 + .../messages/items/items.properties | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index cd0a1093e..5cedb2bd9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -81,6 +81,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMappi import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Flail; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -372,8 +373,16 @@ public class Hero extends Char { } public boolean canSurpriseAttack(){ - return !(belongings.weapon != null && belongings.weapon instanceof Weapon - && STR() < ((Weapon)belongings.weapon).STRReq()); + if (belongings.weapon == null || !(belongings.weapon instanceof Weapon)) + return true; + + if (STR() < ((Weapon)belongings.weapon).STRReq()) + return false; + + if (belongings.weapon instanceof Flail && rangedWeapon == null) + return false; + + return true; } public boolean canAttack(Char enemy){ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java index d236c48ec..94ebc8bcd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Flail.java @@ -29,6 +29,7 @@ public class Flail extends MeleeWeapon { tier = 4; DLY = 1.25f; //0.8x speed + //also cannot surprise attack, see Hero.canSurpriseAttack } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 86b9f3749..fefb11bed 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -782,7 +782,7 @@ items.weapon.melee.dirk.stats_desc=This weapon is stronger against unaware enemi items.weapon.melee.dirk.desc=A longer thrusting dagger, gives bit more steel to plunge into foes. items.weapon.melee.flail.name=flail -items.weapon.melee.flail.stats_desc=This is a slightly slow weapon.\nThis is a rather inaccurate weapon. +items.weapon.melee.flail.stats_desc=This is a slightly slow weapon.\nThis weapon cannot surprise attack. items.weapon.melee.flail.desc=A spiked ball attached to a handle by a length of chain. Very unwieldy, but devastating if it lands a solid hit. items.weapon.melee.glaive.name=glaive