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);
if (c != null){
c.recover();
c.recover(src);
}
if (this.buff(Frost.class) != null){
Buff.detach( this, Frost.class );

View File

@ -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;

View File

@ -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;}

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){
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);
for (Wand.Charger c : attacker.buffs(Wand.Charger.class)){
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.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 ) {

View File

@ -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);
}

View File

@ -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);
}