v0.9.1: staff now pools charges when imbued, rather than being maxed

This commit is contained in:
Evan Debenham 2020-12-01 16:01:02 -05:00
parent f255ff070d
commit 5793ee30a3

View File

@ -188,9 +188,12 @@ public class MagesStaff extends MeleeWeapon {
public Item imbueWand(Wand wand, Char owner){ public Item imbueWand(Wand wand, Char owner){
int oldStaffcharges = this.wand.curCharges;
if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION) if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION)
&& Random.Float() < 0.3f + 0.3f*Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)){ && Random.Float() < 0.3f + 0.3f*Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)){
this.wand.level(0); this.wand.level(0);
this.wand.curCharges = 0;
if (!this.wand.collect()){ if (!this.wand.collect()){
Dungeon.level.drop(this.wand, owner.pos); Dungeon.level.drop(this.wand, owner.pos);
} }
@ -209,7 +212,7 @@ public class MagesStaff extends MeleeWeapon {
level(targetLevel); level(targetLevel);
this.wand = wand; this.wand = wand;
updateWand(false); updateWand(false);
wand.curCharges = wand.maxCharges; wand.curCharges = Math.min(wand.maxCharges, wand.curCharges+oldStaffcharges);
if (owner != null) wand.charge(owner); if (owner != null) wand.charge(owner);
//This is necessary to reset any particles. //This is necessary to reset any particles.