Implement monsters not hurting you at decision time in Lynx

This commit is contained in:
Eevee (Evelyn Woods) 2021-05-11 18:31:16 -06:00
parent db02c19a0d
commit 7ed3d38489
2 changed files with 11 additions and 2 deletions

View File

@ -152,7 +152,12 @@ export const COMPAT_FLAGS = [
rulesets: new Set(['lynx', 'ms']), rulesets: new Set(['lynx', 'ms']),
}, { }, {
key: 'player_protected_by_items', key: 'player_protected_by_items',
label: "Players can't get trampled when standing on items", label: "Players can't be trampled when standing on items",
rulesets: new Set(['lynx']),
}, {
// Note that this requires no_early_push as well
key: 'player_safe_at_decision_time',
label: "Players can't be trampled at decision time",
rulesets: new Set(['lynx']), rulesets: new Set(['lynx']),
}, { }, {
key: 'emulate_60fps', key: 'emulate_60fps',

View File

@ -1654,7 +1654,11 @@ export class Level extends LevelInterface {
// a player thinks about moving into a monster, the player dies. A player standing on a // a player thinks about moving into a monster, the player dies. A player standing on a
// wall is only saved by the wall being checked first. This is also why standing on an // wall is only saved by the wall being checked first. This is also why standing on an
// item won't save you: actors are checked before items! // item won't save you: actors are checked before items!
if (layer === LAYERS.actor) { if (layer === LAYERS.actor &&
// Lynx: Touching a monster at decision time doesn't kill you, and pushing doesn't
// happen at decision time thanks to no_early_push
(! this.compat.player_safe_at_decision_time || push_mode === 'push'))
{
this._check_for_player_death(actor, tile); this._check_for_player_death(actor, tile);
} }