v0.9.2: tweaked wand of regrowth charge limit and added it to desc

This commit is contained in:
Evan Debenham 2021-02-11 22:48:55 -05:00
parent 99ed2a14a0
commit b7f2b29554
2 changed files with 24 additions and 4 deletions

View File

@ -1222,6 +1222,7 @@ items.wands.wandofregrowth.name=wand of regrowth
items.wands.wandofregrowth.staff_name=staff of regrowth items.wands.wandofregrowth.staff_name=staff of regrowth
items.wands.wandofregrowth.desc=This wand is made from a thin shaft of expertly carved wood. Somehow it is still alive and vibrant, bright green like a young tree's core. "When life ceases new life always begins to grow... The eternal cycle always remains!" items.wands.wandofregrowth.desc=This wand is made from a thin shaft of expertly carved wood. Somehow it is still alive and vibrant, bright green like a young tree's core. "When life ceases new life always begins to grow... The eternal cycle always remains!"
items.wands.wandofregrowth.stats_desc=When used, this wand will blast magical regrowth energy outward in a cone, causing grass, roots, and rare plants to spring to life. Its next zap will consume _%1$d charges_. The more charges the wand uses, the larger and stronger the effect. items.wands.wandofregrowth.stats_desc=When used, this wand will blast magical regrowth energy outward in a cone, causing grass, roots, and rare plants to spring to life. Its next zap will consume _%1$d charges_. The more charges the wand uses, the larger and stronger the effect.
items.wands.wandofregrowth.degradation=After another _%d charges_ this wand will start failing to produce plants and fresh grass. This limit is increased by levelling up or upgrading the wand.
items.wands.wandofregrowth.bmage_desc=When _the Battlemage_ strikes an enemy with a staff of regrowth, and either are standing on grass, the Battlemage will gain herbal healing in proportion with the damage dealt. items.wands.wandofregrowth.bmage_desc=When _the Battlemage_ strikes an enemy with a staff of regrowth, and either are standing on grass, the Battlemage will gain herbal healing in proportion with the damage dealt.
items.wands.wandofregrowth$dewcatcher.name=Dewcatcher items.wands.wandofregrowth$dewcatcher.name=Dewcatcher
items.wands.wandofregrowth$dewcatcher.desc=Dewcatchers are wondrous plants that fill themselves with magical dew. They attempt to camouflage as grass to avoid attention, but their bulges of collected dew give them away. items.wands.wandofregrowth$dewcatcher.desc=Dewcatchers are wondrous plants that fill themselves with magical dew. They attempt to camouflage as grass to avoid attention, but their bulges of collected dew give them away.

View File

@ -62,6 +62,7 @@ public class WandOfRegrowth extends Wand {
} }
private int totChrgUsed = 0; private int totChrgUsed = 0;
private int chargesOverLimit = 0;
ConeAOE cone; ConeAOE cone;
int target; int target;
@ -81,8 +82,10 @@ public class WandOfRegrowth extends Wand {
ArrayList<Integer> cells = new ArrayList<>(cone.cells); ArrayList<Integer> cells = new ArrayList<>(cone.cells);
int overLimit = totChrgUsed - chargeLimit(Dungeon.hero.lvl); float furrowedChance = 0;
float furrowedChance = overLimit > 0 ? (overLimit / (10f + Dungeon.hero.lvl)) : 0; if (totChrgUsed >= chargeLimit(Dungeon.hero.lvl)){
furrowedChance = (chargesOverLimit+1)/5f;
}
int chrgUsed = chargesPerCast(); int chrgUsed = chargesPerCast();
int grassToPlace = Math.round((3.67f+buffedLvl()/3f)*chrgUsed); int grassToPlace = Math.round((3.67f+buffedLvl()/3f)*chrgUsed);
@ -175,9 +178,17 @@ public class WandOfRegrowth extends Wand {
grassToPlace--; grassToPlace--;
} }
if (furrowedChance < 1f) { if (totChrgUsed < chargeLimit(Dungeon.hero.lvl)) {
chargesOverLimit = 0;
totChrgUsed += chrgUsed; totChrgUsed += chrgUsed;
if (totChrgUsed > chargeLimit(Dungeon.hero.lvl)){
chargesOverLimit = totChrgUsed - chargeLimit(Dungeon.hero.lvl);
totChrgUsed = chargeLimit(Dungeon.hero.lvl);
} }
} else {
chargesOverLimit += chrgUsed;
}
} }
private int chargeLimit( int heroLvl ){ private int chargeLimit( int heroLvl ){
@ -254,7 +265,12 @@ public class WandOfRegrowth extends Wand {
@Override @Override
public String statsDesc() { public String statsDesc() {
return Messages.get(this, "stats_desc", chargesPerCast()); String desc = Messages.get(this, "stats_desc", chargesPerCast());
if (isIdentified()){
int chargeLeft = chargeLimit(Dungeon.hero.lvl) - totChrgUsed;
if (chargeLeft < 10000) desc += " " + Messages.get(this, "degradation", Math.max(chargeLeft, 0));
}
return desc;
} }
@Override @Override
@ -270,17 +286,20 @@ public class WandOfRegrowth extends Wand {
} }
private static final String TOTAL = "totChrgUsed"; private static final String TOTAL = "totChrgUsed";
private static final String OVER = "chargesOverLimit";
@Override @Override
public void storeInBundle(Bundle bundle) { public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle); super.storeInBundle(bundle);
bundle.put( TOTAL, totChrgUsed ); bundle.put( TOTAL, totChrgUsed );
bundle.put( OVER, chargesOverLimit);
} }
@Override @Override
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
totChrgUsed = bundle.getInt(TOTAL); totChrgUsed = bundle.getInt(TOTAL);
chargesOverLimit = bundle.getInt(OVER);
} }
public static class Dewcatcher extends Plant{ public static class Dewcatcher extends Plant{