From b0940e7ef5cdd88ed30ba93b0d8ca58324b420b3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 27 Nov 2020 17:56:04 -0500 Subject: [PATCH] v0.9.1: balance changes to battlemage and wand of transfusion --- .../shatteredpixeldungeon/actors/Char.java | 2 +- .../actors/buffs/Charm.java | 18 ++++++++++--- .../items/wands/WandOfFrost.java | 2 +- .../items/wands/WandOfLivingEarth.java | 2 +- .../items/wands/WandOfMagicMissile.java | 2 +- .../items/wands/WandOfRegrowth.java | 24 ++++++++++++++++-- .../items/wands/WandOfTransfusion.java | 25 ++++++++----------- .../items/weapon/melee/MagesStaff.java | 2 +- 8 files changed, 52 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 8a677b495..eec279897 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -494,7 +494,7 @@ public abstract class Char extends Actor { } Charm c = buff(Charm.class); if (c != null){ - c.recover(); + c.recover(src); } if (this.buff(Frost.class) != null){ Buff.detach( this, Frost.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java index 48a6b75ff..6782afba5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Charm.java @@ -21,6 +21,8 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.watabou.utils.Bundle; @@ -28,8 +30,7 @@ import com.watabou.utils.Bundle; public class Charm extends FlavourBuff { public int object = 0; - - private static final String OBJECT = "object"; + public boolean ignoreHeroAllies = false; public static final float DURATION = 10f; @@ -38,16 +39,21 @@ public class Charm extends FlavourBuff { announced = true; } + private static final String OBJECT = "object"; + private static final String IGNORE_ALLIES = "ignore_allies"; + @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( OBJECT, object ); + bundle.put( IGNORE_ALLIES, ignoreHeroAllies ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); object = bundle.getInt( OBJECT ); + ignoreHeroAllies = bundle.getBoolean( IGNORE_ALLIES ); } @Override @@ -77,7 +83,13 @@ public class Charm extends FlavourBuff { public boolean ignoreNextHit = false; - public void recover() { + public void recover(Object src) { + if (ignoreHeroAllies && src instanceof Char){ + if (src != Dungeon.hero && ((Char) src).alignment == Char.Alignment.ALLY){ + return; + } + } + if (ignoreNextHit){ ignoreNextHit = false; return; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java index 2353ad47b..6e93f4d25 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java @@ -105,7 +105,7 @@ public class WandOfFrost extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { Chill chill = defender.buff(Chill.class); - if (chill != null && chill.cooldown() >= Chill.DURATION){ + if (chill != null && Random.IntRange(2, (int)Chill.DURATION) <= chill.cooldown()){ //need to delay this through an actor so that the freezing isn't broken by taking damage from the staff hit. new FlavourBuff(){ {actPriority = VFX_PRIO;} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java index 4b8dd7b1e..f3141e890 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java @@ -194,7 +194,7 @@ public class WandOfLivingEarth extends DamageWand { } } - int armor = Math.round(damage*0.25f); + int armor = Math.round(damage*0.33f); if (guardian != null){ guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2); 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 7dbe63670..a78f0a83c 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 @@ -82,7 +82,7 @@ public class WandOfMagicMissile extends DamageWand { SpellSprite.show(attacker, SpellSprite.CHARGE); for (Wand.Charger c : attacker.buffs(Wand.Charger.class)){ if (c.wand() != this){ - c.gainCharge(0.33f); + c.gainCharge(0.5f); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 8dff9b037..598de5552 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blooming; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -40,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.mechanics.ConeAOE; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; +import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.LotusSprite; @@ -193,7 +193,27 @@ public class WandOfRegrowth extends Wand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { - new Blooming().proc(staff, attacker, defender, damage); + //like pre-nerf vampiric enchantment, except with herbal healing buff, only in grass + boolean grass = false; + int terr = Dungeon.level.map[attacker.pos]; + if (terr == Terrain.GRASS || terr == Terrain.HIGH_GRASS || terr == Terrain.FURROWED_GRASS){ + grass = true; + } + terr = Dungeon.level.map[defender.pos]; + if (terr == Terrain.GRASS || terr == Terrain.HIGH_GRASS || terr == Terrain.FURROWED_GRASS){ + grass = true; + } + + if (grass) { + int level = Math.max(0, staff.buffedLvl()); + + // lvl 0 - 16% + // lvl 1 - 21% + // lvl 2 - 25% + int healing = Math.round(damage * (level + 2f) / (level + 6f) / 2f); + Buff.affect(attacker, Sungrass.Health.class).boost(healing); + } + } protected void fx( Ballistica bolt, Callback callback ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index ebed5750c..a1844d4b2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -76,8 +76,8 @@ public class WandOfTransfusion extends Wand { //heals/shields an ally or a charmed enemy while damaging self if (ch.alignment == Char.Alignment.ALLY || ch.buff(Charm.class) != null){ - // 10% of max hp - int selfDmg = Math.round(curUser.HT*0.10f); + // 5% of max hp + int selfDmg = Math.round(curUser.HT*0.05f); int healing = selfDmg + 3*buffedLvl(); int shielding = (ch.HP + healing) - ch.HT; @@ -104,8 +104,10 @@ public class WandOfTransfusion extends Wand { //charms living enemies if (!ch.properties().contains(Char.Property.UNDEAD)) { - Buff.affect(ch, Charm.class, Charm.DURATION/2f).object = curUser.id(); - ch.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 3 + buffedLvl()/2 ); + Charm charm = Buff.affect(ch, Charm.class, Charm.DURATION/2f); + charm.object = curUser.id(); + charm.ignoreHeroAllies = true; + ch.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 3 ); //harms the undead } else { @@ -115,7 +117,7 @@ public class WandOfTransfusion extends Wand { } //and grants a self shield - Buff.affect(curUser, Barrier.class).setShield((5 + 2*buffedLvl())); + Buff.affect(curUser, Barrier.class).setShield((5 + buffedLvl())); } @@ -134,19 +136,12 @@ public class WandOfTransfusion extends Wand { } } - @Override - protected int initialCharges() { - return 1; - } - @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { - // lvl 0 - 10% - // lvl 1 - 18% - // lvl 2 - 25% - if (Random.Int( buffedLvl() + 10 ) >= 9){ - //grants a free use of the staff + if (defender.buff(Charm.class) != null && defender.buff(Charm.class).object == attacker.id()){ + //grants a free use of the staff and shields self freeCharge = true; + Buff.affect(curUser, Barrier.class).setShield(2*(5 + buffedLvl())); GLog.p( Messages.get(this, "charged") ); attacker.sprite.emitter().burst(BloodParticle.BURST, 20); } 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 95fcb1f23..15afbb8b3 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 @@ -150,7 +150,7 @@ public class MagesStaff extends MeleeWeapon { public int proc(Char attacker, Char defender, int damage) { if (wand != null && attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) { - if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.33f; + if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.5f; ScrollOfRecharging.charge((Hero)attacker); wand.onHit(this, attacker, defender, damage); }