diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 50cf768dc..183dc17ee 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -348,7 +348,7 @@ actors.hero.talent.energizing_meal.desc=_+1:_ Eating food takes the Mage 1 turn actors.hero.talent.energizing_upgrade.title=energizing upgrade actors.hero.talent.energizing_upgrade.desc=_+1:_ Using a scroll of upgrade instantly recharges the Mage's staff _for 1 charge_, this can put it above its current charge cap.\n\n_+2:_ Using a scroll of upgrade instantly recharges the Mage's staff _for 2 charges_, this can put it above its current charge cap.\n\nThis talent also triggers when using scrolls or spells based on scrolls of upgrade. actors.hero.talent.wand_preservation.title=wand preservation -actors.hero.talent.wand_preservation.desc=_+1:_ When the Mage imbues a new wand into his staff, the old wand has a _60% chance_ of being returned at +0.\n\n_+2:_ When the Mage imbues a new wand into his staff, the old wand has a _90% chance_ of being returned at +0. +actors.hero.talent.wand_preservation.desc=_+1:_ When the Mage imbues a new wand into his staff, the old wand has a _67% chance_ of being returned at +0.\n\n_+2:_ When the Mage imbues a new wand into his staff, the old wand has a _100% chance_ of being returned at +0.\n\nThis talent can preserve a wand up to three times. actors.hero.talent.arcane_vision.title=arcane vision actors.hero.talent.arcane_vision.desc=_+1:_ When the Mage zaps an enemy, he gains mind vision on them for _10 turns_.\n\n_+2:_ When the Mage zaps an enemy, he gains mind vision on them for _15 turns_. actors.hero.talent.shield_battery.title=shield battery diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 5213b08ad..0f975b998 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -108,6 +108,7 @@ public enum Talent { public static class ImprovisedProjectileCooldown extends FlavourBuff{}; public static class LethalMomentumTracker extends FlavourBuff{}; + public static class WandPreservationCounter extends CounterBuff{}; public static class RejuvenatingStepsCooldown extends FlavourBuff{}; int icon; 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 1dfde8518..6dc0283c2 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 @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; @@ -191,14 +192,18 @@ public class MagesStaff extends MeleeWeapon { 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); + && Random.Float() < 0.34f + 0.33f*Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)){ + + Talent.WandPreservationCounter counter = Buff.affect(Dungeon.hero, Talent.WandPreservationCounter.class); + if (counter.count() < 3) { + counter.countUp(1); + this.wand.level(0); + if (!this.wand.collect()) { + Dungeon.level.drop(this.wand, owner.pos); + } + GLog.newLine(); + GLog.p(Messages.get(this, "preserved")); } - GLog.newLine(); - GLog.p(Messages.get(this, "preserved")); } this.wand = null;