v0.7.0: bugfixes:

- various cases where hero can appear ontop of enemies
- incorrect wand quickslot functionality with magic immune
This commit is contained in:
Evan Debenham 2018-08-04 15:21:23 -04:00
parent 30c8ea03e8
commit bc14ea0aa0
3 changed files with 30 additions and 8 deletions

View File

@ -378,6 +378,18 @@ public class Dungeon {
hero.pos = pos; hero.pos = pos;
for(Mob m : level.mobs){
if (m.pos == hero.pos){
//displace mob
for(int i : PathFinder.NEIGHBOURS8){
if (Actor.findChar(m.pos+i) == null && level.passable[m.pos + i]){
m.pos += i;
break;
}
}
}
}
Light light = hero.buff( Light.class ); Light light = hero.buff( Light.class );
hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance ); hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance );

View File

@ -159,6 +159,18 @@ public class LloydsBeacon extends Artifact {
if (returnDepth == Dungeon.depth) { if (returnDepth == Dungeon.depth) {
ScrollOfTeleportation.appear( hero, returnPos ); ScrollOfTeleportation.appear( hero, returnPos );
for(Mob m : Dungeon.level.mobs){
if (m.pos == hero.pos){
//displace mob
for(int i : PathFinder.NEIGHBOURS8){
if (Actor.findChar(m.pos+i) == null && Dungeon.level.passable[m.pos + i]){
m.pos += i;
m.sprite.point(m.sprite.worldToCamera(m.pos));
break;
}
}
}
}
Dungeon.level.press( returnPos, hero ); Dungeon.level.press( returnPos, hero );
Dungeon.observe(); Dungeon.observe();
GameScene.updateFog(); GameScene.updateFog();

View File

@ -97,14 +97,9 @@ public abstract class Wand extends Item {
if (action.equals( AC_ZAP )) { if (action.equals( AC_ZAP )) {
if (hero.buff(MagicImmune.class) != null){ curUser = hero;
GLog.w( Messages.get(this, "no_magic") ); curItem = this;
} else { GameScene.selectCell( zapper );
curUser = hero;
curItem = this;
GameScene.selectCell(zapper);
}
} }
} }
@ -374,6 +369,9 @@ public abstract class Wand extends Item {
if (target == curUser.pos || cell == curUser.pos) { if (target == curUser.pos || cell == curUser.pos) {
GLog.i( Messages.get(Wand.class, "self_target") ); GLog.i( Messages.get(Wand.class, "self_target") );
return; return;
} else if (curUser.buff(MagicImmune.class) != null){
GLog.w( Messages.get(Wand.class, "no_magic") );
return;
} }
curUser.sprite.zap(cell); curUser.sprite.zap(cell);