mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-07 01:04:25 +03:00
Resolved #2: forbid leaving a room
You can use `@exit()` to set `canExit` and print the "YOU SHALL NOT LEAVE" message.
This commit is contained in:
parent
4412081800
commit
e3e17eb295
|
@ -24,6 +24,7 @@ class SaletRoom
|
||||||
@priority = 1
|
@priority = 1
|
||||||
@displayOrder = 1
|
@displayOrder = 1
|
||||||
@canSave = true
|
@canSave = true
|
||||||
|
@canExit = true
|
||||||
@tags = []
|
@tags = []
|
||||||
@choices = ""
|
@choices = ""
|
||||||
@optionText = "Choice"
|
@optionText = "Choice"
|
||||||
|
@ -63,6 +64,14 @@ class SaletRoom
|
||||||
Also if f == this.name (we're in the same location) the `before` and `after` callbacks are ignored.
|
Also if f == this.name (we're in the same location) the `before` and `after` callbacks are ignored.
|
||||||
###
|
###
|
||||||
@entering = (system, f) =>
|
@entering = (system, f) =>
|
||||||
|
if (
|
||||||
|
f != @name and
|
||||||
|
f? and
|
||||||
|
system.rooms[f].canExit? and
|
||||||
|
system.rooms[f].canExit == false
|
||||||
|
)
|
||||||
|
return system.goTo(f, f)
|
||||||
|
|
||||||
if @clear and f?
|
if @clear and f?
|
||||||
system.view.clearContent()
|
system.view.clearContent()
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue