v0.3.2b: tweaked lock floor effect, allowed for some regen to process if time is awarded.

This commit is contained in:
Evan Debenham
2015-11-07 20:02:22 -05:00
parent 519e1252cb
commit 47aa30c830
11 changed files with 46 additions and 22 deletions
@@ -24,7 +24,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
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.
//the amount of turns remaining before beneficial passive effects turn off
private float left = 20; //starts at 20 turns
@Override
public boolean act() {
@@ -33,9 +35,20 @@ public class LockedFloor extends Buff {
if (!Dungeon.level.locked)
detach();
if (left >= 1)
left --;
return true;
}
public void addTime(float time){
left += time;
}
public boolean regenOn(){
return left >= 1;
}
@Override
public int icon() {
return BuffIndicator.LOCKED_FLOOR;
@@ -50,8 +63,8 @@ public class LockedFloor extends Buff {
public String desc() {
return "The current floor is locked, and you are unable to leave it!\n" +
"\n" +
"While a floor is locked hunger, passive health regen, and passive item recharging will not function. " +
"The passing of time will not help or hinder you here.\n" +
"While a floor is locked, you will not gain hunger or take damage from starving. In addition, " +
"if you do not work towards defeating this floor's boss, passive regeneration effects will also stop.\n " +
"\n" +
"Additionally, if you are revived by an unblessed ankh while the floor is locked, then it will reset.\n" +
"\n" +
@@ -32,12 +32,13 @@ public class Regeneration extends Buff {
public boolean act() {
if (target.isAlive()) {
if (target.HP < target.HT && !((Hero)target).isStarving() && target.buff(LockedFloor.class) == null) {
target.HP += 1;
if (target.HP == target.HT){
((Hero)target).resting = false;
if (target.HP < target.HT && !((Hero)target).isStarving()) {
LockedFloor lock = target.buff(LockedFloor.class);
if (lock == null || lock.regenOn()) {
target.HP += 1;
if (target.HP == target.HT) {
((Hero) target).resting = false;
}
}
}