v1.4.2: made 'trample own grass' functionality more robust

This commit is contained in:
Evan Debenham
2022-10-11 13:41:55 -04:00
parent 5d0c1bf2e2
commit f87170b2f8
3 changed files with 16 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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" +