v2.2.0: fixed some wands giving buffs when shooting NPCs/allies
This commit is contained in:
+11
-3
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
@@ -79,7 +80,10 @@ public class WandOfLivingEarth extends DamageWand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RockArmor buff = curUser.buff(RockArmor.class);
|
RockArmor buff = curUser.buff(RockArmor.class);
|
||||||
if (ch == null){
|
//only grant armor if we are shooting at an enemy, or a hiding mimic
|
||||||
|
if (ch == null
|
||||||
|
|| ch.alignment == Char.Alignment.ALLY
|
||||||
|
|| ch.alignment == Char.Alignment.NEUTRAL && !(ch instanceof Mimic)){
|
||||||
armorToAdd = 0;
|
armorToAdd = 0;
|
||||||
} else {
|
} else {
|
||||||
if (buff == null && guardian == null) {
|
if (buff == null && guardian == null) {
|
||||||
@@ -125,7 +129,9 @@ public class WandOfLivingEarth extends DamageWand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (closest == -1){
|
if (closest == -1){
|
||||||
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl()/2);
|
if (armorToAdd > 0) {
|
||||||
|
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
||||||
|
}
|
||||||
return; //do not spawn guardian or detach buff
|
return; //do not spawn guardian or detach buff
|
||||||
} else {
|
} else {
|
||||||
guardian.pos = closest;
|
guardian.pos = closest;
|
||||||
@@ -159,7 +165,9 @@ public class WandOfLivingEarth extends DamageWand {
|
|||||||
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) );
|
Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) );
|
||||||
|
|
||||||
if (guardian == null) {
|
if (guardian == null) {
|
||||||
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
if (armorToAdd > 0) {
|
||||||
|
curUser.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2);
|
||||||
guardian.setInfo(curUser, buffedLvl(), armorToAdd);
|
guardian.setInfo(curUser, buffedLvl(), armorToAdd);
|
||||||
|
|||||||
+3
-1
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
@@ -101,7 +102,8 @@ public class WandOfTransfusion extends Wand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//for enemies...
|
//for enemies...
|
||||||
} else {
|
//(or for mimics which are hiding, special case)
|
||||||
|
} else if (ch.alignment == Char.Alignment.ENEMY || ch instanceof Mimic) {
|
||||||
|
|
||||||
//grant a self-shield, and...
|
//grant a self-shield, and...
|
||||||
Buff.affect(curUser, Barrier.class).setShield((5 + buffedLvl()));
|
Buff.affect(curUser, Barrier.class).setShield((5 + buffedLvl()));
|
||||||
|
|||||||
Reference in New Issue
Block a user