v0.7.4: wand of living earth now requires a target to grant armor

This commit is contained in:
Evan Debenham 2019-07-14 15:44:21 -04:00
parent ed45c37e0a
commit f3e2c60d46

View File

@ -76,11 +76,15 @@ public class WandOfLivingEarth extends DamageWand {
} }
RockArmor buff = curUser.buff(RockArmor.class); RockArmor buff = curUser.buff(RockArmor.class);
if (buff == null && guardian == null){ if (ch == null){
buff = Buff.affect(curUser, RockArmor.class); armorToAdd = 0;
} } else {
if (buff != null){ if (buff == null && guardian == null) {
buff.addArmor(level(), armorToAdd); buff = Buff.affect(curUser, RockArmor.class);
}
if (buff != null) {
buff.addArmor(level(), armorToAdd);
}
} }
//shooting at the guardian //shooting at the guardian
@ -147,18 +151,20 @@ public class WandOfLivingEarth extends DamageWand {
processSoulMark(ch, chargesPerCast()); processSoulMark(ch, chargesPerCast());
ch.damage(damage, this); ch.damage(damage, this);
if (guardian == null) {
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + level() / 2);
} else {
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + level() / 2);
guardian.setInfo(curUser, level(), armorToAdd);
if (ch.alignment == Char.Alignment.ENEMY || ch.buff(Amok.class) != null) {
guardian.aggro(ch);
}
}
} else { } else {
Dungeon.level.press(bolt.collisionPos, null, true); Dungeon.level.press(bolt.collisionPos, null, true);
} }
if (guardian == null) {
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + level() / 2);
} else {
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + level() / 2);
guardian.setInfo(curUser, level(), armorToAdd);
if (ch != null) guardian.aggro( ch );
}
} }
} }