Don't die to a monster that was just hooked
This interaction sounds ridiculous but it is real CC2 nonsense. Fixes the Hoopla replay!
This commit is contained in:
parent
af57e8a33e
commit
939c71aab7
20
js/game.js
20
js/game.js
@ -68,7 +68,6 @@ export class Tile {
|
|||||||
|
|
||||||
// Blocks being pulled are blocked by their pullers (which are, presumably, the only things
|
// Blocks being pulled are blocked by their pullers (which are, presumably, the only things
|
||||||
// they can be moving towards)
|
// they can be moving towards)
|
||||||
// FIXME something about this broke pulling blocks through teleporters; see #99 Delirium
|
|
||||||
if (this.type.is_actor && other.type.is_block && other.is_pulled)
|
if (this.type.is_actor && other.type.is_block && other.is_pulled)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -1726,11 +1725,16 @@ export class Level extends LevelInterface {
|
|||||||
// blocked by anything.
|
// blocked by anything.
|
||||||
}
|
}
|
||||||
else if (tile.type.is_real_player) {
|
else if (tile.type.is_real_player) {
|
||||||
if (actor.type.is_monster) {
|
if (actor.is_pulled) {
|
||||||
|
// We can't be killed by something we're pulling. Even if that thing is a monster,
|
||||||
|
// which is not something we can pull! See CC2LP1 #110 Hoopla
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (actor.type.is_monster) {
|
||||||
this.kill_actor(tile, actor);
|
this.kill_actor(tile, actor);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (actor.type.is_block && ! actor.is_pulled) {
|
else if (actor.type.is_block) {
|
||||||
this.kill_actor(tile, actor, null, null, 'squished');
|
this.kill_actor(tile, actor, null, null, 'squished');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1780,10 +1784,14 @@ export class Level extends LevelInterface {
|
|||||||
if (behind_actor.movement_cooldown) {
|
if (behind_actor.movement_cooldown) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (behind_actor.type.is_block && push_mode === 'push') {
|
else if (push_mode === 'push') {
|
||||||
|
// Only blocks can actually be moved via pulling, but monsters can still
|
||||||
|
// count as pulled, which stops them from killing us
|
||||||
this._set_tile_prop(behind_actor, 'is_pulled', true);
|
this._set_tile_prop(behind_actor, 'is_pulled', true);
|
||||||
this._set_tile_prop(behind_actor, 'pending_push', direction);
|
if (behind_actor.type.is_block) {
|
||||||
behind_actor.decision = direction;
|
this._set_tile_prop(behind_actor, 'pending_push', direction);
|
||||||
|
behind_actor.decision = direction;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user