v0.3.0: improved previous hunger mechanics changes, now better coded & clarified
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user