v2.1.3: improved code for regeneration pause effects
This commit is contained in:
+1
-2
@@ -147,8 +147,7 @@ public class Berserk extends Buff implements ActionIndicator.Action {
|
|||||||
detach();
|
detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (state == State.RECOVERING && levelRecovery == 0
|
} else if (state == State.RECOVERING && levelRecovery == 0 && Regeneration.regenOn()){
|
||||||
&& (target.buff(LockedFloor.class) == null || target.buff(LockedFloor.class).regenOn())){
|
|
||||||
turnRecovery--;
|
turnRecovery--;
|
||||||
if (turnRecovery <= 0){
|
if (turnRecovery <= 0){
|
||||||
turnRecovery = 0;
|
turnRecovery = 0;
|
||||||
|
|||||||
+4
-1
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook;
|
import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
|
import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.MiningLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
@@ -67,7 +68,9 @@ public class Hunger extends Buff implements Hero.Doom {
|
|||||||
if (Dungeon.level.locked
|
if (Dungeon.level.locked
|
||||||
|| target.buff(WellFed.class) != null
|
|| target.buff(WellFed.class) != null
|
||||||
|| SPDSettings.intro()
|
|| SPDSettings.intro()
|
||||||
|| target.buff(ScrollOfChallenge.ChallengeArena.class) != null){
|
|| target.buff(ScrollOfChallenge.ChallengeArena.class) != null
|
||||||
|
//this is mainly for the current test sub-level
|
||||||
|
|| Dungeon.level instanceof MiningLevel){
|
||||||
spend(STEP);
|
spend(STEP);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -143,7 +143,7 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
|
|||||||
public void gainEnergy(Mob enemy ){
|
public void gainEnergy(Mob enemy ){
|
||||||
if (target == null) return;
|
if (target == null) return;
|
||||||
|
|
||||||
if (target.buff(LockedFloor.class) != null && !target.buff(LockedFloor.class).regenOn()){
|
if (!Regeneration.regenOn()){
|
||||||
return; //to prevent farming boss minions
|
return; //to prevent farming boss minions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ public class PrismaticGuard extends Buff {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
LockedFloor lock = target.buff(LockedFloor.class);
|
||||||
if (HP < maxHP() && (lock == null || lock.regenOn())){
|
if (HP < maxHP() && Regeneration.regenOn()){
|
||||||
HP += 0.1f;
|
HP += 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-2
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.MiningLevel;
|
||||||
|
|
||||||
public class Regeneration extends Buff {
|
public class Regeneration extends Buff {
|
||||||
|
|
||||||
@@ -41,8 +42,7 @@ public class Regeneration extends Buff {
|
|||||||
if (target.isAlive()) {
|
if (target.isAlive()) {
|
||||||
|
|
||||||
if (target.HP < regencap() && !((Hero)target).isStarving()) {
|
if (target.HP < regencap() && !((Hero)target).isStarving()) {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (regenOn()) {
|
||||||
if (lock == null || lock.regenOn()) {
|
|
||||||
target.HP += 1;
|
target.HP += 1;
|
||||||
if (target.HP == regencap()) {
|
if (target.HP == regencap()) {
|
||||||
((Hero) target).resting = false;
|
((Hero) target).resting = false;
|
||||||
@@ -76,4 +76,15 @@ public class Regeneration extends Buff {
|
|||||||
public int regencap(){
|
public int regencap(){
|
||||||
return target.HT;
|
return target.HT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean regenOn(){
|
||||||
|
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
||||||
|
if (lock != null && !lock.regenOn()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (Dungeon.level instanceof MiningLevel){
|
||||||
|
return false; //this is mainly for the current test sub-level
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -27,7 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
@@ -303,8 +303,7 @@ abstract public class ClassArmor extends Armor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (Regeneration.regenOn()) {
|
||||||
if (lock == null || lock.regenOn()) {
|
|
||||||
float chargeGain = 100 / 500f; //500 turns to full charge
|
float chargeGain = 100 / 500f; //500 turns to full charge
|
||||||
chargeGain *= RingOfEnergy.armorChargeMultiplier(target);
|
chargeGain *= RingOfEnergy.armorChargeMultiplier(target);
|
||||||
charge += chargeGain;
|
charge += chargeGain;
|
||||||
|
|||||||
+2
-3
@@ -26,9 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
@@ -226,8 +226,7 @@ public class CloakOfShadows extends Artifact {
|
|||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
if (charge < chargeCap && !cursed && target.buff(MagicImmune.class) == null) {
|
if (charge < chargeCap && !cursed && target.buff(MagicImmune.class) == null) {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (activeBuff == null && Regeneration.regenOn()) {
|
||||||
if (activeBuff == null && (lock == null || lock.regenOn())) {
|
|
||||||
float missing = (chargeCap - charge);
|
float missing = (chargeCap - charge);
|
||||||
if (level() > 7) missing += 5*(level() - 7)/3f;
|
if (level() > 7) missing += 5*(level() - 7)/3f;
|
||||||
float turnsToCharge = (45 - missing);
|
float turnsToCharge = (45 - missing);
|
||||||
|
|||||||
+3
-5
@@ -32,8 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
@@ -397,8 +397,7 @@ public class DriedRose extends Artifact {
|
|||||||
if (ghost != null && !cursed && target.buff(MagicImmune.class) == null){
|
if (ghost != null && !cursed && target.buff(MagicImmune.class) == null){
|
||||||
|
|
||||||
//heals to full over 500 turns
|
//heals to full over 500 turns
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (ghost.HP < ghost.HT && Regeneration.regenOn()) {
|
||||||
if (ghost.HP < ghost.HT && (lock == null || lock.regenOn())) {
|
|
||||||
partialCharge += (ghost.HT / 500f) * RingOfEnergy.artifactChargeMultiplier(target);
|
partialCharge += (ghost.HT / 500f) * RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
|
|
||||||
@@ -413,11 +412,10 @@ public class DriedRose extends Artifact {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charge < chargeCap
|
if (charge < chargeCap
|
||||||
&& !cursed
|
&& !cursed
|
||||||
&& target.buff(MagicImmune.class) == null
|
&& target.buff(MagicImmune.class) == null
|
||||||
&& (lock == null || lock.regenOn())) {
|
&& Regeneration.regenOn()) {
|
||||||
//500 turns to a full charge
|
//500 turns to a full charge
|
||||||
partialCharge += (1/5f * RingOfEnergy.artifactChargeMultiplier(target));
|
partialCharge += (1/5f * RingOfEnergy.artifactChargeMultiplier(target));
|
||||||
if (partialCharge > 1){
|
if (partialCharge > 1){
|
||||||
|
|||||||
+2
-3
@@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
|
||||||
@@ -305,11 +305,10 @@ public class EtherealChains extends Artifact {
|
|||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
int chargeTarget = 5+(level()*2);
|
int chargeTarget = 5+(level()*2);
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charge < chargeTarget
|
if (charge < chargeTarget
|
||||||
&& !cursed
|
&& !cursed
|
||||||
&& target.buff(MagicImmune.class) == null
|
&& target.buff(MagicImmune.class) == null
|
||||||
&& (lock == null || lock.regenOn())) {
|
&& Regeneration.regenOn()) {
|
||||||
//gains a charge in 40 - 2*missingCharge turns
|
//gains a charge in 40 - 2*missingCharge turns
|
||||||
float chargeGain = (1 / (40f - (chargeTarget - charge)*2f));
|
float chargeGain = (1 / (40f - (chargeTarget - charge)*2f));
|
||||||
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
|
|||||||
+2
-3
@@ -26,7 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
@@ -311,8 +311,7 @@ public class LloydsBeacon extends Artifact {
|
|||||||
public class beaconRecharge extends ArtifactBuff{
|
public class beaconRecharge extends ArtifactBuff{
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (charge < chargeCap && !cursed && Regeneration.regenOn()) {
|
||||||
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) {
|
||||||
|
|||||||
+2
-3
@@ -28,8 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell;
|
||||||
@@ -314,11 +314,10 @@ public class TalismanOfForesight extends Artifact {
|
|||||||
warn = false;
|
warn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charge < chargeCap
|
if (charge < chargeCap
|
||||||
&& !cursed
|
&& !cursed
|
||||||
&& target.buff(MagicImmune.class) == null
|
&& target.buff(MagicImmune.class) == null
|
||||||
&& (lock == null || lock.regenOn())) {
|
&& Regeneration.regenOn()) {
|
||||||
//fully charges in 2000 turns at +0, scaling to 1000 turns at +10.
|
//fully charges in 2000 turns at +0, scaling to 1000 turns at +10.
|
||||||
float chargeGain = (0.05f+(level()*0.005f));
|
float chargeGain = (0.05f+(level()*0.005f));
|
||||||
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
|
|||||||
+2
-3
@@ -27,8 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
@@ -232,11 +232,10 @@ public class TimekeepersHourglass extends Artifact {
|
|||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charge < chargeCap
|
if (charge < chargeCap
|
||||||
&& !cursed
|
&& !cursed
|
||||||
&& target.buff(MagicImmune.class) == null
|
&& target.buff(MagicImmune.class) == null
|
||||||
&& (lock == null || lock.regenOn())) {
|
&& Regeneration.regenOn()) {
|
||||||
//90 turns to charge at full, 60 turns to charge at 0/10
|
//90 turns to charge at full, 60 turns to charge at 0/10
|
||||||
float chargeGain = 1 / (90f - (chargeCap - charge)*3f);
|
float chargeGain = 1 / (90f - (chargeCap - charge)*3f);
|
||||||
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
|
|||||||
+2
-3
@@ -25,8 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||||
@@ -288,11 +288,10 @@ public class UnstableSpellbook extends Artifact {
|
|||||||
public class bookRecharge extends ArtifactBuff{
|
public class bookRecharge extends ArtifactBuff{
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charge < chargeCap
|
if (charge < chargeCap
|
||||||
&& !cursed
|
&& !cursed
|
||||||
&& target.buff(MagicImmune.class) == null
|
&& target.buff(MagicImmune.class) == null
|
||||||
&& (lock == null || lock.regenOn())) {
|
&& Regeneration.regenOn()) {
|
||||||
//120 turns to charge at full, 80 turns to charge at 0/8
|
//120 turns to charge at full, 80 turns to charge at 0/8
|
||||||
float chargeGain = 1 / (120f - (chargeCap - charge)*5f);
|
float chargeGain = 1 / (120f - (chargeCap - charge)*5f);
|
||||||
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ScrollEmpower;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ScrollEmpower;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
@@ -720,8 +720,7 @@ 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)));
|
||||||
|
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
if (Regeneration.regenOn())
|
||||||
if (lock == null || lock.regenOn())
|
|
||||||
partialCharge += (1f/turnsToCharge) * RingOfEnergy.wandChargeMultiplier(target);
|
partialCharge += (1f/turnsToCharge) * RingOfEnergy.wandChargeMultiplier(target);
|
||||||
|
|
||||||
for (Recharging bonus : target.buffs(Recharging.class)){
|
for (Recharging bonus : target.buffs(Recharging.class)){
|
||||||
|
|||||||
+3
-4
@@ -28,9 +28,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MonkEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MonkEnergy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
@@ -455,9 +455,8 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
LockedFloor lock = target.buff(LockedFloor.class);
|
|
||||||
if (charges < chargeCap()){
|
if (charges < chargeCap()){
|
||||||
if (lock == null || lock.regenOn()){
|
if (Regeneration.regenOn()){
|
||||||
partialCharge += 1/(40f-(chargeCap()-charges)); // 40 to 30 turns per charge
|
partialCharge += 1/(40f-(chargeCap()-charges)); // 40 to 30 turns per charge
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
if (Dungeon.hero.subClass == HeroSubClass.CHAMPION
|
if (Dungeon.hero.subClass == HeroSubClass.CHAMPION
|
||||||
&& secondCharges < secondChargeCap()) {
|
&& secondCharges < secondChargeCap()) {
|
||||||
if (lock == null || lock.regenOn()) {
|
if (Regeneration.regenOn()) {
|
||||||
// 80 to 60 turns per charge without talent
|
// 80 to 60 turns per charge without talent
|
||||||
// up to 53.333 to 40 turns per charge at max talent level
|
// up to 53.333 to 40 turns per charge at max talent level
|
||||||
secondPartialCharge += secondChargeMultiplier() / (40f-(secondChargeCap()-secondCharges));
|
secondPartialCharge += secondChargeMultiplier() / (40f-(secondChargeCap()-secondCharges));
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSight;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSight;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.RevealedArea;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.RevealedArea;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
@@ -1064,7 +1065,7 @@ public abstract class Level implements Bundlable {
|
|||||||
&& ch == Dungeon.hero && Dungeon.hero.hasTalent(Talent.REJUVENATING_STEPS)
|
&& ch == Dungeon.hero && Dungeon.hero.hasTalent(Talent.REJUVENATING_STEPS)
|
||||||
&& ch.buff(Talent.RejuvenatingStepsCooldown.class) == null){
|
&& ch.buff(Talent.RejuvenatingStepsCooldown.class) == null){
|
||||||
|
|
||||||
if (Dungeon.hero.buff(LockedFloor.class) != null && !Dungeon.hero.buff(LockedFloor.class).regenOn()){
|
if (!Regeneration.regenOn()){
|
||||||
set(ch.pos, Terrain.FURROWED_GRASS);
|
set(ch.pos, Terrain.FURROWED_GRASS);
|
||||||
} else if (ch.buff(Talent.RejuvenatingStepsFurrow.class) != null && ch.buff(Talent.RejuvenatingStepsFurrow.class).count() >= 200) {
|
} else if (ch.buff(Talent.RejuvenatingStepsFurrow.class) != null && ch.buff(Talent.RejuvenatingStepsFurrow.class).count() >= 200) {
|
||||||
set(ch.pos, Terrain.FURROWED_GRASS);
|
set(ch.pos, Terrain.FURROWED_GRASS);
|
||||||
|
|||||||
Reference in New Issue
Block a user