diff --git a/assets/buffs.png b/assets/buffs.png index 575cfe8c4..32b19ca66 100644 Binary files a/assets/buffs.png and b/assets/buffs.png differ diff --git a/assets/large_buffs.png b/assets/large_buffs.png index 624f5f7c4..0e4e2476e 100644 Binary files a/assets/large_buffs.png and b/assets/large_buffs.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 0ad1d8938..69c457a13 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -136,7 +136,7 @@ public class Hunger extends Buff implements Hero.Doom { @Override public int icon() { - if (Dungeon.level.locked || level < HUNGRY) { + if (level < HUNGRY) { return BuffIndicator.NONE; } else if (level < STARVING) { return BuffIndicator.HUNGER; @@ -147,7 +147,7 @@ public class Hunger extends Buff implements Hero.Doom { @Override public String toString() { - if (Dungeon.level.locked || level < STARVING) { + if (level < STARVING) { return "Hungry"; } else { return "Starving"; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java new file mode 100644 index 000000000..fd62a7e5d --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/LockedFloor.java @@ -0,0 +1,33 @@ +package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; + +/** + * Created by Evan on 04/04/2015. + */ +public class LockedFloor extends Buff { + //this buff is purely meant as a visual indicator that the gameplay implications of a level seal are in effect. + + + @Override + public boolean act() { + spend(TICK); + + if (!Dungeon.level.locked) + detach(); + + return true; + } + + @Override + public int icon() { + return BuffIndicator.LOCKED_FLOOR; + } + + @Override + public String toString() { + return "Floor is Locked"; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 550b4dab1..5cd04aaa4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -423,7 +423,7 @@ public class Hero extends Char { if (curAction == null) { if (restoreHealth) { - if (isStarving() || HP >= HT) { + if (isStarving() || HP >= HT || Dungeon.level.locked) { restoreHealth = false; } else { spend( TIME_TO_REST ); next(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java index 9b501fdda..584dfceff 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java @@ -186,7 +186,7 @@ public class Goo extends Mob { @Override public void move( int step ) { - ((SewerBossLevel)Dungeon.level).seal(); + Dungeon.level.seal(); super.move( step ); } @@ -195,7 +195,7 @@ public class Goo extends Mob { super.die( cause ); - ((SewerBossLevel)Dungeon.level).unseal(); + Dungeon.level.unseal(); GameScene.bossSlain(); Dungeon.level.drop( new SkeletonKey( Dungeon.depth ), pos ).sprite.drop(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index 6d341b2c5..6c5b46080 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -218,7 +218,7 @@ public class CavesBossLevel extends Level { if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) { enteredArena = true; - locked = true; + seal(); Mob boss = Bestiary.mob( Dungeon.depth ); boss.state = boss.HUNTING; @@ -246,7 +246,7 @@ public class CavesBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; - locked = false; + unseal(); CellEmitter.get( arenaDoor ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index ca81d9fe2..bb700b294 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -177,7 +177,7 @@ public class CityBossLevel extends Level { if (!enteredArena && outsideEntraceRoom( cell ) && hero == Dungeon.hero) { enteredArena = true; - locked = true; + seal(); Mob boss = Bestiary.mob( Dungeon.depth ); boss.state = boss.HUNTING; @@ -208,7 +208,7 @@ public class CityBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; - locked = false; + unseal(); set( arenaDoor, Terrain.DOOR ); GameScene.updateMap( arenaDoor ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index 2a6a21619..d3f9b36c6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -167,7 +167,7 @@ public class HallsBossLevel extends Level { if (!enteredArena && hero == Dungeon.hero && cell != entrance) { enteredArena = true; - locked = true; + seal(); for (int i=ROOM_LEFT-1; i <= ROOM_RIGHT + 1; i++) { doMagic( (ROOM_TOP - 1) * WIDTH + i ); @@ -206,7 +206,7 @@ public class HallsBossLevel extends Level { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; - locked = false; + unseal(); entrance = stairs; set( entrance, Terrain.ENTRANCE ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 34f302c2e..a9b9e3c58 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WellWater; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; @@ -415,6 +416,19 @@ public abstract class Level implements Bundlable { abstract protected void createItems(); + public void seal(){ + if (!locked) { + locked = true; + Buff.affect(Dungeon.hero, LockedFloor.class); + } + } + + public void unseal(){ + if (locked) { + locked = false; + } + } + public void addVisuals( Scene scene ) { for (int i=0; i < LENGTH; i++) { if (pit[i]) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index a1b845d1d..ab8ed3fa7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -309,7 +309,7 @@ public class PrisonBossLevel extends RegularLevel { if (ch == Dungeon.hero && !enteredArena && roomExit.inside( cell )) { enteredArena = true; - locked = true; + seal(); int pos; do { @@ -337,7 +337,7 @@ public class PrisonBossLevel extends RegularLevel { if (!keyDropped && item instanceof SkeletonKey) { keyDropped = true; - locked = false; + unseal(); set( arenaDoor, Terrain.DOOR ); GameScene.updateMap( arenaDoor ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index 78534b222..8533ffe7b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -241,7 +241,7 @@ public class SewerBossLevel extends RegularLevel { public void seal() { if (entrance != 0) { - locked = true; + super.seal(); set( entrance, Terrain.WATER_TILES ); GameScene.updateMap( entrance ); @@ -255,7 +255,7 @@ public class SewerBossLevel extends RegularLevel { public void unseal() { if (stairs != 0) { - locked = false; + super.unseal(); entrance = stairs; stairs = 0; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 9ecce0be9..138a9452c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -68,6 +68,7 @@ public class BuffIndicator extends Component { public static final int FORESIGHT = 32; public static final int VERTIGO = 33; public static final int CHARGE = 34; + public static final int LOCKED_FLOOR= 35; public static final int SIZE = 7;