v1.4.2: made 'trample own grass' functionality more robust
This commit is contained in:
@@ -766,14 +766,19 @@ public class Hero extends Char {
|
|||||||
damageInterrupt = false;
|
damageInterrupt = false;
|
||||||
next();
|
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 ) {
|
private boolean actMove( HeroAction.Move action ) {
|
||||||
|
|
||||||
if (getCloser( action.dst )) {
|
if (getCloser( action.dst )) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Hero moves in place if there is high grass to trample
|
//Hero moves in place if there is grass to trample
|
||||||
} else if (!rooted && !flying && Dungeon.level.map[pos] == Terrain.HIGH_GRASS){
|
} else if (isStandingOnTrampleableGrass()){
|
||||||
Dungeon.level.pressCell(pos);
|
Dungeon.level.pressCell(pos);
|
||||||
spendAndNext( 1 / speed() );
|
spendAndNext( 1 / speed() );
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -26,8 +26,11 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
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.buffs.LostInventory;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
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.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
@@ -250,8 +253,12 @@ public class Toolbar extends Component {
|
|||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||||
Dungeon.hero.waitOrPickup = true;
|
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)){
|
&& 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();
|
Dungeon.hero.next();
|
||||||
} else {
|
} else {
|
||||||
examining = false;
|
examining = false;
|
||||||
|
|||||||
+1
-1
@@ -169,7 +169,7 @@ public class v1_X_Changes {
|
|||||||
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), Messages.get(ChangesScene.class, "misc") + " 1",
|
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), Messages.get(ChangesScene.class, "misc") + " 1",
|
||||||
"_-_ Daily runs can now be replayed for practise\n" +
|
"_-_ Daily runs can now be replayed for practise\n" +
|
||||||
"_-_ Waiting now always takes exactly 1 turn, regardless of hero speed\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" +
|
"_-_ 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" +
|
"_-_ 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" +
|
"_-_ DM-300 now knocks back during rockfall even if hero is 1 tile away\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user