From f87170b2f898d3a68edddf073ed9763f3ac6702f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 11 Oct 2022 13:41:55 -0400 Subject: [PATCH] v1.4.2: made 'trample own grass' functionality more robust --- .../shatteredpixeldungeon/actors/hero/Hero.java | 9 +++++++-- .../shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java | 9 ++++++++- .../ui/changelist/v1_X_Changes.java | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 3c94b1909..1ea5bceb8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -766,14 +766,19 @@ public class Hero extends Char { damageInterrupt = false; next(); } + + public boolean isStandingOnTrampleableGrass(){ + return !rooted && !flying && + (Dungeon.level.map[pos] == Terrain.HIGH_GRASS || (heroClass != HeroClass.HUNTRESS && Dungeon.level.map[pos] == Terrain.FURROWED_GRASS)); + } private boolean actMove( HeroAction.Move action ) { if (getCloser( action.dst )) { return true; - //Hero moves in place if there is high grass to trample - } else if (!rooted && !flying && Dungeon.level.map[pos] == Terrain.HIGH_GRASS){ + //Hero moves in place if there is grass to trample + } else if (isStandingOnTrampleableGrass()){ Dungeon.level.pressCell(pos); spendAndNext( 1 / speed() ); return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java index 1203d9efc..42cefa211 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java @@ -26,8 +26,11 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.QuickSlot; import com.shatteredpixel.shatteredpixeldungeon.SPDAction; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.HoldFast; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -250,8 +253,12 @@ public class Toolbar extends Component { protected void onClick() { if (Dungeon.hero.ready && !GameScene.cancel()) { Dungeon.hero.waitOrPickup = true; - if (Dungeon.level.heaps.get(Dungeon.hero.pos) != null + if ((Dungeon.level.heaps.get(Dungeon.hero.pos) != null || Dungeon.hero.isStandingOnTrampleableGrass()) && Dungeon.hero.handle(Dungeon.hero.pos)){ + //trigger hold fast here, even if the hero didn't specifically wait + if (Dungeon.hero.hasTalent(Talent.HOLD_FAST)){ + Buff.affect(Dungeon.hero, HoldFast.class); + } Dungeon.hero.next(); } else { examining = false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v1_X_Changes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v1_X_Changes.java index d1096cc6a..b92f76991 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v1_X_Changes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/changelist/v1_X_Changes.java @@ -169,7 +169,7 @@ public class v1_X_Changes { changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), Messages.get(ChangesScene.class, "misc") + " 1", "_-_ Daily runs can now be replayed for practise\n" + "_-_ Waiting now always takes exactly 1 turn, regardless of hero speed\n" + - "_-_ Hero can now trample grass and trigger traps they are standing on by waiting\n" + + "_-_ Grass the hero is standing on can now be trampled by selecting the hero's position\n" + "_-_ Hero now pauses before ascending/descending if enemies are nearby\n" + "_-_ Goo's pump up attack now always gives the hero at least 1 action to react\n" + "_-_ DM-300 now knocks back during rockfall even if hero is 1 tile away\n" +