v0.9.2: tweaked wand of regrowth charge limit and added it to desc
This commit is contained in:
parent
99ed2a14a0
commit
b7f2b29554
|
@ -1222,6 +1222,7 @@ items.wands.wandofregrowth.name=wand 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.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$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.
|
||||
|
|
|
@ -62,6 +62,7 @@ public class WandOfRegrowth extends Wand {
|
|||
}
|
||||
|
||||
private int totChrgUsed = 0;
|
||||
private int chargesOverLimit = 0;
|
||||
|
||||
ConeAOE cone;
|
||||
int target;
|
||||
|
@ -81,8 +82,10 @@ public class WandOfRegrowth extends Wand {
|
|||
|
||||
ArrayList<Integer> cells = new ArrayList<>(cone.cells);
|
||||
|
||||
int overLimit = totChrgUsed - chargeLimit(Dungeon.hero.lvl);
|
||||
float furrowedChance = overLimit > 0 ? (overLimit / (10f + Dungeon.hero.lvl)) : 0;
|
||||
float furrowedChance = 0;
|
||||
if (totChrgUsed >= chargeLimit(Dungeon.hero.lvl)){
|
||||
furrowedChance = (chargesOverLimit+1)/5f;
|
||||
}
|
||||
|
||||
int chrgUsed = chargesPerCast();
|
||||
int grassToPlace = Math.round((3.67f+buffedLvl()/3f)*chrgUsed);
|
||||
|
@ -175,9 +178,17 @@ public class WandOfRegrowth extends Wand {
|
|||
grassToPlace--;
|
||||
}
|
||||
|
||||
if (furrowedChance < 1f) {
|
||||
if (totChrgUsed < chargeLimit(Dungeon.hero.lvl)) {
|
||||
chargesOverLimit = 0;
|
||||
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 ){
|
||||
|
@ -254,7 +265,12 @@ public class WandOfRegrowth extends Wand {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
@ -270,17 +286,20 @@ public class WandOfRegrowth extends Wand {
|
|||
}
|
||||
|
||||
private static final String TOTAL = "totChrgUsed";
|
||||
private static final String OVER = "chargesOverLimit";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put( TOTAL, totChrgUsed );
|
||||
bundle.put( OVER, chargesOverLimit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
totChrgUsed = bundle.getInt(TOTAL);
|
||||
chargesOverLimit = bundle.getInt(OVER);
|
||||
}
|
||||
|
||||
public static class Dewcatcher extends Plant{
|
||||
|
|
Loading…
Reference in New Issue
Block a user