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

View File

@ -24,7 +24,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class LockedFloor extends Buff { 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 @Override
public boolean act() { public boolean act() {
@ -33,9 +35,20 @@ public class LockedFloor extends Buff {
if (!Dungeon.level.locked) if (!Dungeon.level.locked)
detach(); detach();
if (left >= 1)
left --;
return true; return true;
} }
public void addTime(float time){
left += time;
}
public boolean regenOn(){
return left >= 1;
}
@Override @Override
public int icon() { public int icon() {
return BuffIndicator.LOCKED_FLOOR; return BuffIndicator.LOCKED_FLOOR;
@ -50,8 +63,8 @@ public class LockedFloor extends Buff {
public String desc() { public String desc() {
return "The current floor is locked, and you are unable to leave it!\n" + return "The current floor is locked, and you are unable to leave it!\n" +
"\n" + "\n" +
"While a floor is locked hunger, passive health regen, and passive item recharging will not function. " + "While a floor is locked, you will not gain hunger or take damage from starving. In addition, " +
"The passing of time will not help or hinder you here.\n" + "if you do not work towards defeating this floor's boss, passive regeneration effects will also stop.\n " +
"\n" + "\n" +
"Additionally, if you are revived by an unblessed ankh while the floor is locked, then it will reset.\n" + "Additionally, if you are revived by an unblessed ankh while the floor is locked, then it will reset.\n" +
"\n" + "\n" +

View File

@ -32,12 +32,13 @@ public class Regeneration extends Buff {
public boolean act() { public boolean act() {
if (target.isAlive()) { if (target.isAlive()) {
if (target.HP < target.HT && !((Hero)target).isStarving()) {
LockedFloor lock = target.buff(LockedFloor.class);
if (target.HP < target.HT && !((Hero)target).isStarving() && target.buff(LockedFloor.class) == null) { if (lock == null || lock.regenOn()) {
target.HP += 1; target.HP += 1;
if (target.HP == target.HT){ if (target.HP == target.HT) {
((Hero)target).resting = false; ((Hero) target).resting = false;
}
} }
} }

View File

@ -183,7 +183,8 @@ public class CloakOfShadows extends Artifact {
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap) { if (charge < chargeCap) {
if (!stealthed && target.buff(LockedFloor.class) == null) LockedFloor lock = target.buff(LockedFloor.class);
if (!stealthed && (lock == null || lock.regenOn()))
partialCharge += (1f / (60 - (chargeCap-charge)*2)); partialCharge += (1f / (60 - (chargeCap-charge)*2));
if (partialCharge >= 1) { if (partialCharge >= 1) {

View File

@ -208,7 +208,8 @@ public class DriedRose extends Artifact {
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
//TODO: investigate balancing on this. //TODO: investigate balancing on this.
partialCharge += 10/75f; partialCharge += 10/75f;
if (partialCharge > 1){ if (partialCharge > 1){

View File

@ -208,7 +208,8 @@ public class EtherealChains extends Artifact {
@Override @Override
public boolean act() { public boolean act() {
int chargeTarget = 5+(level*2); int chargeTarget = 5+(level*2);
if (!cursed && charge < chargeTarget && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeTarget && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (40f - (chargeTarget - charge)*2f); partialCharge += 1 / (40f - (chargeTarget - charge)*2f);
} else if (cursed && Random.Int(100) == 0){ } else if (cursed && Random.Int(100) == 0){
Buff.prolong( target, Cripple.class, 10f); Buff.prolong( target, Cripple.class, 10f);

View File

@ -173,7 +173,8 @@ public class HornOfPlenty extends Artifact {
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
//generates 0.25 food value every round, +0.015 value per level //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) //to a max of 0.70 food value per round (0.25+0.5, at level 30)

View File

@ -304,7 +304,8 @@ public class LloydsBeacon extends Artifact {
public class beaconRecharge extends ArtifactBuff{ public class beaconRecharge extends ArtifactBuff{
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (100f - (chargeCap - charge)*10f); partialCharge += 1 / (100f - (chargeCap - charge)*10f);
if (partialCharge >= 1) { if (partialCharge >= 1) {

View File

@ -58,7 +58,7 @@ public class TalismanOfForesight extends Artifact {
@Override @Override
public ArrayList<String> actions( Hero hero ) { public ArrayList<String> actions( Hero hero ) {
ArrayList<String> actions = super.actions( hero ); ArrayList<String> actions = super.actions( hero );
if (isEquipped( hero ) && charge == 100 && !cursed) if (isEquipped( hero ) && charge == chargeCap && !cursed)
actions.add(AC_SCRY); actions.add(AC_SCRY);
return actions; return actions;
} }
@ -108,7 +108,7 @@ public class TalismanOfForesight extends Artifact {
if ( isEquipped( Dungeon.hero ) ){ if ( isEquipped( Dungeon.hero ) ){
if (!cursed) { if (!cursed) {
desc += "\n\nWhen you hold the talisman you feel like your senses are heightened."; desc += "\n\nWhen you hold the talisman you feel like your senses are heightened.";
if (charge == 100) if (charge == chargeCap)
desc += "\n\nThe talisman is radiating energy, prodding at your mind. You wonder what would " + desc += "\n\nThe talisman is radiating energy, prodding at your mind. You wonder what would " +
"happen if you let it in."; "happen if you let it in.";
} else { } else {
@ -173,13 +173,14 @@ public class TalismanOfForesight extends Artifact {
BuffIndicator.refreshHero(); BuffIndicator.refreshHero();
//fully charges in 2500 turns at lvl=0, scaling to 1000 turns at lvl = 10. //fully charges in 2500 turns at lvl=0, scaling to 1000 turns at lvl = 10.
if (charge < 100 && !cursed && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 0.04+(level*0.006); partialCharge += 0.04+(level*0.006);
if (partialCharge > 1 && charge < 100) { if (partialCharge > 1 && charge < chargeCap) {
partialCharge--; partialCharge--;
charge++; charge++;
} else if (charge >= 100) { } else if (charge >= chargeCap) {
partialCharge = 0; partialCharge = 0;
GLog.p("Your Talisman is fully charged!"); GLog.p("Your Talisman is fully charged!");
} }

View File

@ -201,7 +201,9 @@ public class TimekeepersHourglass extends Artifact {
public class hourglassRecharge extends ArtifactBuff { public class hourglassRecharge extends ArtifactBuff {
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) {
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (60f - (chargeCap - charge)*2f); partialCharge += 1 / (60f - (chargeCap - charge)*2f);
if (partialCharge >= 1) { if (partialCharge >= 1) {

View File

@ -197,7 +197,8 @@ public class UnstableSpellbook extends Artifact {
public class bookRecharge extends ArtifactBuff{ public class bookRecharge extends ArtifactBuff{
@Override @Override
public boolean act() { public boolean act() {
if (charge < chargeCap && !cursed && target.buff(LockedFloor.class) == null) { LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (150f - (chargeCap - charge)*15f); partialCharge += 1 / (150f - (chargeCap - charge)*15f);
if (partialCharge >= 1) { if (partialCharge >= 1) {

View File

@ -436,7 +436,8 @@ public abstract class Wand extends Item {
float turnsToCharge = (float) (BASE_CHARGE_DELAY float turnsToCharge = (float) (BASE_CHARGE_DELAY
+ (SCALING_CHARGE_ADDITION * Math.pow(scalingFactor, missingCharges))); + (SCALING_CHARGE_ADDITION * Math.pow(scalingFactor, missingCharges)));
if (target.buff(LockedFloor.class) == null) LockedFloor lock = target.buff(LockedFloor.class);
if (lock == null || lock.regenOn())
partialCharge += 1f/turnsToCharge; partialCharge += 1f/turnsToCharge;
ScrollOfRecharging.Recharging bonus = target.buff(ScrollOfRecharging.Recharging.class); ScrollOfRecharging.Recharging bonus = target.buff(ScrollOfRecharging.Recharging.class);