v0.3.0: improved previous hunger mechanics changes, now better coded & clarified

This commit is contained in:
Evan Debenham
2015-04-05 12:40:01 -04:00
parent 80c591e64a
commit 4e34e81365
13 changed files with 63 additions and 15 deletions
@@ -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";
@@ -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";
}
}
@@ -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();
@@ -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();