v0.6.2b: bolt-firing wands now press empty tiles if they land there

This commit is contained in:
Evan Debenham 2017-11-09 03:47:35 -05:00 committed by Evan Debenham
parent 0af31996a4
commit 5db33eb8a6
4 changed files with 18 additions and 1 deletions

View File

@ -122,7 +122,11 @@ public class WandOfCorruption extends Wand {
protected void onZap(Ballistica bolt) {
Char ch = Actor.findChar(bolt.collisionPos);
if (ch != null && ch instanceof Mob && !(ch instanceof NPC)){
if (ch != null){
if (!(ch instanceof Mob) || ch instanceof NPC){
return;
}
Mob enemy = (Mob) ch;
@ -173,6 +177,9 @@ public class WandOfCorruption extends Wand {
}
processSoulMark(ch, chargesPerCast());
} else {
Dungeon.level.press(bolt.collisionPos, null);
}
}

View File

@ -86,6 +86,8 @@ public class WandOfFrost extends DamageWand {
else
Buff.prolong(ch, Chill.class, 2+level());
}
} else {
Dungeon.level.press(bolt.collisionPos, null);
}
}

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -55,6 +56,8 @@ public class WandOfMagicMissile extends DamageWand {
ch.sprite.burst(0xFFFFFFFF, level() / 2 + 2);
} else {
Dungeon.level.press(bolt.collisionPos, null);
}
}

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
@ -57,6 +58,10 @@ public class WandOfVenom extends Wand {
processSoulMark(ch, chargesPerCast());
}
}
if (Actor.findChar(bolt.collisionPos) == null){
Dungeon.level.press(bolt.collisionPos, null);
}
}
@Override