v0.6.4a: fixed an exploit involving chasms

This commit is contained in:
Evan Debenham 2018-04-06 23:36:58 -04:00
parent f850f6d521
commit 04dfde31ff
2 changed files with 15 additions and 4 deletions

View File

@ -76,6 +76,7 @@ public class Chasm {
if (Dungeon.hero.isAlive()) { if (Dungeon.hero.isAlive()) {
Dungeon.hero.interrupt(); Dungeon.hero.interrupt();
Buff.affect(Dungeon.hero, Falling.class);
InterlevelScene.mode = InterlevelScene.Mode.FALL; InterlevelScene.mode = InterlevelScene.Mode.FALL;
if (Dungeon.level instanceof RegularLevel) { if (Dungeon.level instanceof RegularLevel) {
Room room = ((RegularLevel)Dungeon.level).room( pos ); Room room = ((RegularLevel)Dungeon.level).room( pos );
@ -118,4 +119,18 @@ public class Chasm {
((MobSprite)mob.sprite).fall(); ((MobSprite)mob.sprite).fall();
} }
public static class Falling extends Buff{
{
actPriority = VFX_PRIO;
}
@Override
public boolean act() {
heroLand();
detach();
return true;
}
}
} }

View File

@ -48,7 +48,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.journal.Journal; import com.shatteredpixel.shatteredpixeldungeon.journal.Journal;
import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
@ -333,9 +332,6 @@ public class GameScene extends PixelScene {
case RETURN: case RETURN:
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos ); ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
break; break;
case FALL:
Chasm.heroLand();
break;
case DESCEND: case DESCEND:
switch (Dungeon.depth) { switch (Dungeon.depth) {
case 1: case 1: