From 5793ee30a3d546c580d380c18c15c715e9a30439 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 1 Dec 2020 16:01:02 -0500 Subject: [PATCH] v0.9.1: staff now pools charges when imbued, rather than being maxed --- .../shatteredpixeldungeon/items/weapon/melee/MagesStaff.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java index 42cae83a7..1dfde8518 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java @@ -188,9 +188,12 @@ public class MagesStaff extends MeleeWeapon { public Item imbueWand(Wand wand, Char owner){ + int oldStaffcharges = this.wand.curCharges; + if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION) && Random.Float() < 0.3f + 0.3f*Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)){ this.wand.level(0); + this.wand.curCharges = 0; if (!this.wand.collect()){ Dungeon.level.drop(this.wand, owner.pos); } @@ -209,7 +212,7 @@ public class MagesStaff extends MeleeWeapon { level(targetLevel); this.wand = wand; updateWand(false); - wand.curCharges = wand.maxCharges; + wand.curCharges = Math.min(wand.maxCharges, wand.curCharges+oldStaffcharges); if (owner != null) wand.charge(owner); //This is necessary to reset any particles.