Change hint behavior to match Steam: hint shows as you approach
This commit is contained in:
parent
67504e436e
commit
e859afe0b5
14
js/game.js
14
js/game.js
@ -782,6 +782,9 @@ export class Level {
|
|||||||
|
|
||||||
// Check for a couple effects that always apply immediately
|
// Check for a couple effects that always apply immediately
|
||||||
// TODO do blocks smash monsters?
|
// TODO do blocks smash monsters?
|
||||||
|
if (actor === this.player) {
|
||||||
|
this._set_prop(this, 'hint_shown', null);
|
||||||
|
}
|
||||||
for (let tile of goal_cell) {
|
for (let tile of goal_cell) {
|
||||||
if (actor.type.is_player && tile.type.is_monster) {
|
if (actor.type.is_player && tile.type.is_monster) {
|
||||||
this.fail(tile.type.name);
|
this.fail(tile.type.name);
|
||||||
@ -796,6 +799,10 @@ export class Level {
|
|||||||
if (tile.type.slide_mode && ! actor.ignores(tile.type.name)) {
|
if (tile.type.slide_mode && ! actor.ignores(tile.type.name)) {
|
||||||
this.make_slide(actor, tile.type.slide_mode);
|
this.make_slide(actor, tile.type.slide_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actor === this.player && tile.type.is_hint) {
|
||||||
|
this._set_prop(this, 'hint_shown', tile.specific_hint ?? this.stored_level.hint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're stepping directly on the player, that kills them too
|
// If we're stepping directly on the player, that kills them too
|
||||||
@ -812,9 +819,6 @@ export class Level {
|
|||||||
|
|
||||||
// Step on every tile in a cell we just arrived in
|
// Step on every tile in a cell we just arrived in
|
||||||
step_on_cell(actor) {
|
step_on_cell(actor) {
|
||||||
if (actor === this.player) {
|
|
||||||
this._set_prop(this, 'hint_shown', null);
|
|
||||||
}
|
|
||||||
let teleporter;
|
let teleporter;
|
||||||
for (let tile of Array.from(actor.cell)) {
|
for (let tile of Array.from(actor.cell)) {
|
||||||
if (tile === actor)
|
if (tile === actor)
|
||||||
@ -822,10 +826,6 @@ export class Level {
|
|||||||
if (actor.ignores(tile.type.name))
|
if (actor.ignores(tile.type.name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (actor === this.player && tile.type.is_hint) {
|
|
||||||
this._set_prop(this, 'hint_shown', tile.specific_hint ?? this.stored_level.hint);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tile.type.is_item && this.give_actor(actor, tile.type.name)) {
|
if (tile.type.is_item && this.give_actor(actor, tile.type.name)) {
|
||||||
this.remove_tile(tile);
|
this.remove_tile(tile);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user