diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index df34f6eb3..abe8292e0 100644 Binary files a/core/src/main/assets/interfaces/buffs.png and b/core/src/main/assets/interfaces/buffs.png differ diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index d52d6374a..74d833379 100644 Binary files a/core/src/main/assets/interfaces/large_buffs.png and b/core/src/main/assets/interfaces/large_buffs.png differ diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index c7ce911d3..cf7b6a51a 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1193,8 +1193,10 @@ items.wands.wandoflivingearth$earthguardian.desc=The rocks from your wand of liv items.wands.wandofmagicmissile.name=wand of magic missile items.wands.wandofmagicmissile.staff_name=staff of magic missile -items.wands.wandofmagicmissile.desc=This fairly plain wand launches missiles of pure magical energy. While not as strong as other wands, it makes up for it somewhat with more available charges. -items.wands.wandofmagicmissile.stats_desc=Each bolt from this wand deals _%1$d-%2$d damage,_ and has no additional effects. +items.wands.wandofmagicmissile.desc=This fairly plain wand launches missiles of pure magical energy. While the wand itself lacks any special effects, it has more available charges and can briefly empower other wands when upgraded. +items.wands.wandofmagicmissile.stats_desc=Each bolt from this wand deals _%1$d-%2$d damage,_ and will briefly empower other wands if it is upgraded. +items.wands.wandofmagicmissile$magiccharge.name=Magic Charge +items.wands.wandofmagicmissile$magiccharge.desc=Your wand of magic missile has fed power back into your wands, boosting the effective level of the next zap they make.\n\nYour wands are boosted to: +%d.\n\nTurns of magic charge remaining: %s. items.wands.wandofprismaticlight.name=wand of prismatic light items.wands.wandofprismaticlight.staff_name=staff of prismatic light diff --git a/core/src/main/assets/sprites/item_icons.png b/core/src/main/assets/sprites/item_icons.png index 54801375e..32513caa4 100644 Binary files a/core/src/main/assets/sprites/item_icons.png and b/core/src/main/assets/sprites/item_icons.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Recharging.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Recharging.java index b558b30d6..7044d0fdd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Recharging.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Recharging.java @@ -38,6 +38,11 @@ public class Recharging extends FlavourBuff { return BuffIndicator.RECHARGING; } + @Override + public void tintIcon(Image icon) { + icon.hardlight(1, 1, 0); + } + @Override public float iconFadePercent() { return Math.max(0, (DURATION - visualcooldown()) / DURATION); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index e2db0b2d2..aba400c3e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -275,7 +275,19 @@ public abstract class Wand extends Item { return this; } - + + @Override + public int buffedLvl() { + int lvl = super.buffedLvl(); + if (curUser != null && !(this instanceof WandOfMagicMissile)) { + WandOfMagicMissile.MagicCharge buff = curUser.buff(WandOfMagicMissile.MagicCharge.class); + if (buff != null && buff.level() > lvl){ + return buff.level(); + } + } + return lvl; + } + public void updateLevel() { maxCharges = Math.min( initialCharges() + level(), 10 ); curCharges = Math.min( curCharges, maxCharges ); @@ -318,6 +330,11 @@ public abstract class Wand extends Item { } curCharges -= cursed ? 1 : chargesPerCast(); + + WandOfMagicMissile.MagicCharge buff = curUser.buff(WandOfMagicMissile.MagicCharge.class); + if (buff != null && buff.level() > super.buffedLvl()){ + buff.detach(); + } if (curUser.heroClass == HeroClass.MAGE) levelKnown = true; updateQuickslot(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java index 59634b4ed..ce2993d2b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; @@ -56,6 +57,14 @@ public class WandOfMagicMissile extends DamageWand { ch.sprite.burst(0xFFFFFFFF, buffedLvl() / 2 + 2); + //apply the magic charge buff if we have another wand in inventory of a lower level, or already have the buff + for (Wand.Charger wandCharger : curUser.buffs(Wand.Charger.class)){ + if (wandCharger.wand().buffedLvl() < buffedLvl() || curUser.buff(MagicCharge.class) != null){ + Buff.prolong(curUser, MagicCharge.class, MagicCharge.DURATION).setLevel(buffedLvl()); + break; + } + } + } else { Dungeon.level.pressCell(bolt.collisionPos); } @@ -72,4 +81,55 @@ public class WandOfMagicMissile extends DamageWand { return 3; } + public static class MagicCharge extends FlavourBuff { + + { + type = buffType.POSITIVE; + announced = true; + } + + public static float DURATION = 4f; + + private int level = 0; + + public void setLevel(int level){ + this.level = Math.max(level, this.level); + } + + @Override + public void detach() { + super.detach(); + QuickSlotButton.refresh(); + } + + public int level(){ + return this.level; + } + + @Override + public int icon() { + return BuffIndicator.RECHARGING; + } + + @Override + public void tintIcon(Image icon) { + icon.hardlight(0.2f, 0.6f, 1f); + } + + @Override + public float iconFadePercent() { + return Math.max(0, (DURATION - visualcooldown()) / DURATION); + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc", level(), dispTurns()); + } + } + } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index 705d8a12e..18d9dc7bf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -225,7 +225,7 @@ public class ItemSlot extends Button { int trueLvl = item.visiblyUpgraded(); int buffedLvl = item.buffedVisiblyUpgraded(); - if (trueLvl != 0 && buffedLvl != 0) { + if (trueLvl != 0 || buffedLvl != 0) { level.text( Messages.format( TXT_LEVEL, buffedLvl ) ); level.measure(); if (trueLvl == buffedLvl || buffedLvl <= 0) {