v0.9.1: balance changes to battlemage and wand of transfusion

This commit is contained in:
Evan Debenham 2020-11-27 17:56:04 -05:00
parent 10f09bc8a1
commit b0940e7ef5
8 changed files with 52 additions and 25 deletions

View File

@ -494,7 +494,7 @@ public abstract class Char extends Actor {
} }
Charm c = buff(Charm.class); Charm c = buff(Charm.class);
if (c != null){ if (c != null){
c.recover(); c.recover(src);
} }
if (this.buff(Frost.class) != null){ if (this.buff(Frost.class) != null){
Buff.detach( this, Frost.class ); Buff.detach( this, Frost.class );

View File

@ -21,6 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; 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.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
@ -28,8 +30,7 @@ import com.watabou.utils.Bundle;
public class Charm extends FlavourBuff { public class Charm extends FlavourBuff {
public int object = 0; public int object = 0;
public boolean ignoreHeroAllies = false;
private static final String OBJECT = "object";
public static final float DURATION = 10f; public static final float DURATION = 10f;
@ -38,16 +39,21 @@ public class Charm extends FlavourBuff {
announced = true; announced = true;
} }
private static final String OBJECT = "object";
private static final String IGNORE_ALLIES = "ignore_allies";
@Override @Override
public void storeInBundle( Bundle bundle ) { public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle ); super.storeInBundle( bundle );
bundle.put( OBJECT, object ); bundle.put( OBJECT, object );
bundle.put( IGNORE_ALLIES, ignoreHeroAllies );
} }
@Override @Override
public void restoreFromBundle( Bundle bundle ) { public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle ); super.restoreFromBundle( bundle );
object = bundle.getInt( OBJECT ); object = bundle.getInt( OBJECT );
ignoreHeroAllies = bundle.getBoolean( IGNORE_ALLIES );
} }
@Override @Override
@ -77,7 +83,13 @@ public class Charm extends FlavourBuff {
public boolean ignoreNextHit = false; 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){ if (ignoreNextHit){
ignoreNextHit = false; ignoreNextHit = false;
return; return;

View File

@ -105,7 +105,7 @@ public class WandOfFrost extends DamageWand {
@Override @Override
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
Chill chill = defender.buff(Chill.class); 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. //need to delay this through an actor so that the freezing isn't broken by taking damage from the staff hit.
new FlavourBuff(){ new FlavourBuff(){
{actPriority = VFX_PRIO;} {actPriority = VFX_PRIO;}

View File

@ -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){ if (guardian != null){
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2); guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);

View File

@ -82,7 +82,7 @@ public class WandOfMagicMissile extends DamageWand {
SpellSprite.show(attacker, SpellSprite.CHARGE); SpellSprite.show(attacker, SpellSprite.CHARGE);
for (Wand.Charger c : attacker.buffs(Wand.Charger.class)){ for (Wand.Charger c : attacker.buffs(Wand.Charger.class)){
if (c.wand() != this){ if (c.wand() != this){
c.gainCharge(0.33f); c.gainCharge(0.5f);
} }
} }

View File

@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; 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.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; 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.mechanics.ConeAOE;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.LotusSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.LotusSprite;
@ -193,7 +193,27 @@ public class WandOfRegrowth extends Wand {
@Override @Override
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { 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 ) { protected void fx( Ballistica bolt, Callback callback ) {

View File

@ -76,8 +76,8 @@ public class WandOfTransfusion extends Wand {
//heals/shields an ally or a charmed enemy while damaging self //heals/shields an ally or a charmed enemy while damaging self
if (ch.alignment == Char.Alignment.ALLY || ch.buff(Charm.class) != null){ if (ch.alignment == Char.Alignment.ALLY || ch.buff(Charm.class) != null){
// 10% of max hp // 5% of max hp
int selfDmg = Math.round(curUser.HT*0.10f); int selfDmg = Math.round(curUser.HT*0.05f);
int healing = selfDmg + 3*buffedLvl(); int healing = selfDmg + 3*buffedLvl();
int shielding = (ch.HP + healing) - ch.HT; int shielding = (ch.HP + healing) - ch.HT;
@ -104,8 +104,10 @@ public class WandOfTransfusion extends Wand {
//charms living enemies //charms living enemies
if (!ch.properties().contains(Char.Property.UNDEAD)) { if (!ch.properties().contains(Char.Property.UNDEAD)) {
Buff.affect(ch, Charm.class, Charm.DURATION/2f).object = curUser.id(); Charm charm = Buff.affect(ch, Charm.class, Charm.DURATION/2f);
ch.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 3 + buffedLvl()/2 ); charm.object = curUser.id();
charm.ignoreHeroAllies = true;
ch.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 3 );
//harms the undead //harms the undead
} else { } else {
@ -115,7 +117,7 @@ public class WandOfTransfusion extends Wand {
} }
//and grants a self shield //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 @Override
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
// lvl 0 - 10% if (defender.buff(Charm.class) != null && defender.buff(Charm.class).object == attacker.id()){
// lvl 1 - 18% //grants a free use of the staff and shields self
// lvl 2 - 25%
if (Random.Int( buffedLvl() + 10 ) >= 9){
//grants a free use of the staff
freeCharge = true; freeCharge = true;
Buff.affect(curUser, Barrier.class).setShield(2*(5 + buffedLvl()));
GLog.p( Messages.get(this, "charged") ); GLog.p( Messages.get(this, "charged") );
attacker.sprite.emitter().burst(BloodParticle.BURST, 20); attacker.sprite.emitter().burst(BloodParticle.BURST, 20);
} }

View File

@ -150,7 +150,7 @@ public class MagesStaff extends MeleeWeapon {
public int proc(Char attacker, Char defender, int damage) { public int proc(Char attacker, Char defender, int damage) {
if (wand != null && if (wand != null &&
attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) { 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); ScrollOfRecharging.charge((Hero)attacker);
wand.onHit(this, attacker, defender, damage); wand.onHit(this, attacker, defender, damage);
} }