v1.1.0: fixed various rare errors with teleportation and vertigo
This commit is contained in:
parent
d467032baa
commit
b1b887f264
|
@ -789,10 +789,15 @@ public abstract class Char extends Actor {
|
|||
public float stealth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void move( int step ) {
|
||||
|
||||
if (Dungeon.level.adjacent( step, pos ) && buff( Vertigo.class ) != null) {
|
||||
public void move( int step ) {
|
||||
move( step, true );
|
||||
}
|
||||
|
||||
//travelling may be false when a character is moving instantaneously, such as via teleportation
|
||||
public void move( int step, boolean travelling ) {
|
||||
|
||||
if (travelling && Dungeon.level.adjacent( step, pos ) && buff( Vertigo.class ) != null) {
|
||||
sprite.interruptMotion();
|
||||
int newPos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
|
||||
if (!(Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos])
|
||||
|
|
|
@ -1773,12 +1773,12 @@ public class Hero extends Char {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void move( int step ) {
|
||||
public void move(int step, boolean travelling) {
|
||||
boolean wasHighGrass = Dungeon.level.map[step] == Terrain.HIGH_GRASS;
|
||||
|
||||
super.move( step );
|
||||
super.move( step, travelling);
|
||||
|
||||
if (!flying) {
|
||||
if (!flying && travelling) {
|
||||
if (Dungeon.level.water[pos]) {
|
||||
Sample.INSTANCE.play( Assets.Sounds.WATER, 1, Random.Float( 0.8f, 1.25f ) );
|
||||
} else if (Dungeon.level.map[pos] == Terrain.EMPTY_SP) {
|
||||
|
|
|
@ -308,10 +308,10 @@ public class DM300 extends Mob {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void move(int step) {
|
||||
public void move(int step, boolean travelling) {
|
||||
super.move(step);
|
||||
|
||||
Camera.main.shake( supercharged ? 3 : 1, 0.25f );
|
||||
if (travelling) Camera.main.shake( supercharged ? 3 : 1, 0.25f );
|
||||
|
||||
if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP && state == HUNTING) {
|
||||
|
||||
|
|
|
@ -96,11 +96,11 @@ public class Monk extends Mob {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void move( int step ) {
|
||||
public void move( int step, boolean travelling) {
|
||||
// moving reduces cooldown by an additional 0.67, giving a total reduction of 1.67f.
|
||||
// basically monks will become focused notably faster if you kite them.
|
||||
focusCooldown -= 0.67f;
|
||||
super.move( step );
|
||||
if (travelling) focusCooldown -= 0.67f;
|
||||
super.move( step, travelling);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,11 +35,11 @@ public class Senior extends Monk {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void move( int step ) {
|
||||
public void move( int step, boolean travelling) {
|
||||
// on top of the existing move bonus, senior monks get a further 1.66 cooldown reduction
|
||||
// for a total of 3.33, double the normal 1.67 for regular monks
|
||||
focusCooldown -= 1.66f;
|
||||
super.move( step );
|
||||
if (travelling) focusCooldown -= 1.66f;
|
||||
super.move( step, travelling);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -354,7 +354,7 @@ public class Ghost extends NPC {
|
|||
}
|
||||
|
||||
public static boolean completed(){
|
||||
return processed() && weapon == null && armor == null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ public class ScrollOfTeleportation extends Scroll {
|
|||
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
|
||||
}
|
||||
|
||||
ch.move( pos );
|
||||
ch.move( pos, false );
|
||||
if (ch.pos == pos) ch.sprite.place( pos );
|
||||
|
||||
if (ch.invisible == 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user