v0.8.2: the ring of energy now also boosts artifact recharge speed

This commit is contained in:
Evan Debenham 2020-07-29 13:27:35 -04:00
parent 1e361fd546
commit 9e6339aa7f
14 changed files with 70 additions and 25 deletions

View File

@ -815,9 +815,9 @@ items.rings.ringofelements.typical_stats=When worn, this ring will typically pro
items.rings.ringofelements.desc=This ring provides resistance to most elemental and magical effects, decreasing damage and debuff duration. Naturally a cursed ring will instead worsen these effects.
items.rings.ringofenergy.name=ring of energy
items.rings.ringofenergy.stats=When worn, this ring will increase wand charge speed by _%s%%._
items.rings.ringofenergy.typical_stats=When worn, this ring will typically increase wand charge speed by _%s%%._
items.rings.ringofenergy.desc=Your wands will recharge more quickly in the arcane field that radiates from this ring. A cursed ring will instead slow wand recharge.
items.rings.ringofenergy.stats=When worn, this ring will increase wand charge speed by _%s%%_ and artifact charge speed by _%s%%._
items.rings.ringofenergy.typical_stats=When worn, this ring will typically increase wand charge speed by _%s%%_ and artifact charge speed by _%s%%._
items.rings.ringofenergy.desc=Your wands and artifacts will recharge more quickly in the arcane field that radiates from this ring. A cursed ring will instead slow recharge.
items.rings.ringofevasion.name=ring of evasion
items.rings.ringofevasion.stats=When worn, this ring will increase your evasion by _%s%%._

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
public class Regeneration extends Buff {
@ -51,13 +52,16 @@ public class Regeneration extends Buff {
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
if (regenBuff != null)
if (regenBuff.isCursed())
spend( REGENERATION_DELAY * 1.5f );
else
spend( REGENERATION_DELAY - regenBuff.itemLevel()*0.9f );
else
spend( REGENERATION_DELAY );
float delay = REGENERATION_DELAY;
if (regenBuff != null) {
if (regenBuff.isCursed()) {
delay *= 1.5f;
} else {
delay -= regenBuff.itemLevel()*0.9f;
delay /= RingOfEnergy.artifactChargeMultiplier(target);
}
}
spend( delay );
} else {

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.AlchemyScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -179,7 +180,9 @@ public class AlchemistsToolkit extends Artifact {
//This means that energy absorbed into the kit is recovered in 6.67 hero levels (as 33% of input energy is kept)
//exp towards toolkit levels is included here
float effectiveLevel = GameMath.gate(0, level() + exp/10f, 10);
partialCharge += (2 + (1f * effectiveLevel)) * levelPortion;
float chargeGain = (2 + (1f * effectiveLevel)) * levelPortion;
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
//charge is in increments of 1/10 max hunger value.
while (partialCharge >= 1) {

View File

@ -167,7 +167,7 @@ public class ChaliceOfBlood extends Artifact {
}
public class chaliceRegen extends ArtifactBuff {
//see Regeneration.class for effect
}
}

View File

@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Preparation;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -181,6 +182,7 @@ public class CloakOfShadows extends Artifact {
float missing = (chargeCap - charge);
if (level() > 7) missing += 5*(level() - 7)/3f;
float turnsToCharge = (45 - missing);
turnsToCharge /= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += (1f / turnsToCharge);
}

View File

@ -43,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
@ -61,8 +62,8 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBlacksmith;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.watabou.noosa.Game;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
@ -377,7 +378,8 @@ public class DriedRose extends Artifact {
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1/5f; //500 turns to a full charge
//500 turns to a full charge
partialCharge += (1/5f * RingOfEnergy.artifactChargeMultiplier(target));
if (partialCharge > 1){
charge++;
partialCharge--;

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
@ -271,7 +272,10 @@ public class EtherealChains extends Artifact {
int chargeTarget = 5+(level()*2);
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeTarget && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (40f - (chargeTarget - charge)*2f);
//gains a charge in 40 - 2*missingCharge turns
float chargeGain = (1 / (40f - (chargeTarget - charge)*2f));
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
} else if (cursed && Random.Int(100) == 0){
Buff.prolong( target, Cripple.class, 10f);
}

View File

@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -225,7 +226,9 @@ public class HornOfPlenty extends Artifact {
//generates 0.25x max hunger value every hero level, +0.125x max value per horn level
//to a max of 1.5x max hunger value per hero level
//This means that a standard ration will be recovered in ~5.333 hero levels
partialCharge += Hunger.STARVING * levelPortion * (0.25f + (0.125f*level()));
float chargeGain = Hunger.STARVING * levelPortion * (0.25f + (0.125f*level()));
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
//charge is in increments of 1/10 max hunger value.
while (partialCharge >= Hunger.STARVING/10) {

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.utils.Random;
@ -71,7 +72,7 @@ public class MasterThievesArmband extends Artifact {
public class Thievery extends ArtifactBuff{
public void collect(int gold){
if (!cursed) {
charge += gold/2;
charge += gold/2 * RingOfEnergy.artifactChargeMultiplier(target);
}
}

View File

@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
@ -170,7 +171,13 @@ public class SandalsOfNature extends Artifact {
public void charge() {
if (level() > 0 && charge < target.HT){
//gain 1+(1*level)% of the difference between current charge and max HP.
charge+= (Math.round( (target.HT-charge) * (.01+ level()*0.01) ));
float chargeGain = (target.HT-charge) * (.01f+ level()*0.01f);
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += Math.max(0, chargeGain);
while (partialCharge > 1){
charge++;
partialCharge--;
}
updateQuickslot();
}
}

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
@ -294,10 +295,12 @@ public class TalismanOfForesight extends Artifact {
warn = false;
}
//fully charges in 2000 turns at lvl=0, scaling to 1000 turns at lvl = 10.
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 0.05f+(level()*0.005f);
//fully charges in 2000 turns at +0, scaling to 1000 turns at +10.
float chargeGain = (0.05f+(level()*0.005f));
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
if (partialCharge > 1 && charge < chargeCap) {
partialCharge--;

View File

@ -30,6 +30,7 @@ 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;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -213,7 +214,10 @@ public class TimekeepersHourglass extends Artifact {
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (90f - (chargeCap - charge)*3f);
//90 turns to charge at full, 60 turns to charge at 0/10
float chargeGain = 1 / (90f - (chargeCap - charge)*3f);
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
if (partialCharge >= 1) {
partialCharge --;

View File

@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
@ -277,7 +278,10 @@ public class UnstableSpellbook extends Artifact {
public boolean act() {
LockedFloor lock = target.buff(LockedFloor.class);
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
partialCharge += 1 / (120f - (chargeCap - charge)*5f);
//120 turns to charge at full, 80 turns to charge at 0/8
float chargeGain = 1 / (120f - (chargeCap - charge)*5f);
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += chargeGain;
if (partialCharge >= 1) {
partialCharge --;

View File

@ -35,9 +35,13 @@ public class RingOfEnergy extends Ring {
public String statsInfo() {
if (isIdentified()){
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.30f, soloBuffedBonus()) - 1f)));
return Messages.get(this, "stats",
new DecimalFormat("#.##").format(100f * (Math.pow(1.20f, soloBuffedBonus()) - 1f)),
new DecimalFormat("#.##").format(100f * (Math.pow(1.10f, soloBuffedBonus()) - 1f)));
} else {
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f));
return Messages.get(this, "typical_stats",
new DecimalFormat("#.##").format(20f),
new DecimalFormat("#.##").format(10f));
}
}
@ -47,7 +51,11 @@ public class RingOfEnergy extends Ring {
}
public static float wandChargeMultiplier( Char target ){
return (float)Math.pow(1.30, getBuffedBonus(target, Energy.class));
return (float)Math.pow(1.20, getBuffedBonus(target, Energy.class));
}
public static float artifactChargeMultiplier( Char target ){
return (float)Math.pow(1.10, getBuffedBonus(target, Energy.class));
}
public class Energy extends RingBuff {