v0.3.2: changed most passive effects to pause when a floor is locked

This commit is contained in:
Evan Debenham 2015-11-04 02:37:32 -05:00
parent 0bcaba7a7c
commit 257ca8a6c6
11 changed files with 23 additions and 14 deletions

View File

@ -50,9 +50,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, you will not gain hunger, or take damage from starving, " +
"but your current hunger state is still in effect. For example, if you are starving you won't take " +
"damage, but will still not regenerate health.\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" +
"\n" +
"Additionally, if you are revived by an unblessed ankh while the floor is locked, then it will reset.\n" +
"\n" +

View File

@ -34,7 +34,7 @@ public class Regeneration extends Buff {
if (target.HP < target.HT && !((Hero)target).isStarving()) {
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;

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -182,7 +183,7 @@ public class CloakOfShadows extends Artifact {
@Override
public boolean act() {
if (charge < chargeCap) {
if (!stealthed)
if (!stealthed && target.buff(LockedFloor.class) == null)
partialCharge += (1f / (60 - (chargeCap-charge)*2));
if (partialCharge >= 1) {

View File

@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
@ -207,7 +208,7 @@ public class DriedRose extends Artifact {
@Override
public boolean act() {
if (charge < chargeCap && !cursed) {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
//TODO: investigate balancing on this.
partialCharge += 10/75f;
if (partialCharge > 1){

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
@ -207,7 +208,7 @@ public class EtherealChains extends Artifact {
@Override
public boolean act() {
int chargeTarget = 5+(level*2);
if (!cursed && charge < chargeTarget) {
if (!cursed && charge < chargeTarget && target.buff(LockedFloor.class) == null) {
partialCharge += 1 / (40f - (chargeTarget - charge)*2f);
} else if (cursed && Random.Int(100) == 0){
Buff.prolong( target, Cripple.class, 10f);

View File

@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
@ -172,7 +173,7 @@ public class HornOfPlenty extends Artifact {
@Override
public boolean act() {
if (charge < chargeCap && !cursed) {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
//generates 0.25 food value every round, +0.015 value per level
//to a max of 0.70 food value per round (0.25+0.5, at level 30)

View File

@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RotHeart;
@ -303,7 +304,7 @@ public class LloydsBeacon extends Artifact {
public class beaconRecharge extends ArtifactBuff{
@Override
public boolean act() {
if (charge < chargeCap && !cursed) {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
partialCharge += 1 / (100f - (chargeCap - charge)*10f);
if (partialCharge >= 1) {

View File

@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@ -156,7 +157,7 @@ public class TalismanOfForesight extends Artifact {
}
}
if (smthFound == true && !cursed){
if (smthFound && !cursed){
if (warn == 0){
GLog.w("You feel uneasy.");
if (target instanceof Hero){
@ -172,7 +173,7 @@ public class TalismanOfForesight extends Artifact {
BuffIndicator.refreshHero();
//fully charges in 2500 turns at lvl=0, scaling to 1000 turns at lvl = 10.
if (charge < 100 && !cursed) {
if (charge < 100 && !cursed && target.buff(LockedFloor.class) == null) {
partialCharge += 0.04+(level*0.006);
if (partialCharge > 1 && charge < 100) {

View File

@ -24,6 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -200,7 +201,7 @@ public class TimekeepersHourglass extends Artifact {
public class hourglassRecharge extends ArtifactBuff {
@Override
public boolean act() {
if (charge < chargeCap && !cursed) {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
partialCharge += 1 / (60f - (chargeCap - charge)*2f);
if (partialCharge >= 1) {

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
@ -196,7 +197,7 @@ public class UnstableSpellbook extends Artifact {
public class bookRecharge extends ArtifactBuff{
@Override
public boolean act() {
if (charge < chargeCap && !cursed) {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
partialCharge += 1 / (150f - (chargeCap - charge)*15f);
if (partialCharge >= 1) {

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
@ -435,7 +436,8 @@ public abstract class Wand extends Item {
float turnsToCharge = (float) (BASE_CHARGE_DELAY
+ (SCALING_CHARGE_ADDITION * Math.pow(scalingFactor, missingCharges)));
partialCharge += 1f/turnsToCharge;
if (target.buff(LockedFloor.class) == null)
partialCharge += 1f/turnsToCharge;
ScrollOfRecharging.Recharging bonus = target.buff(ScrollOfRecharging.Recharging.class);
if (bonus != null && bonus.remainder() > 0f){