0
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet-module.git synced 2024-06-28 21:05:03 +03:00

Follow-up: @display as a function

This commit is contained in:
Alexander Yakovlev 2017-05-20 17:31:58 +07:00
parent eda7aabdf1
commit 8131138254
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{
"name": "salet",
"version": "1.7.6",
"version": "1.7.7",
"description": "A general client-side framework for cybertext interactive fiction games.",
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
"homepage": "https://salet.su",

View file

@ -21,7 +21,7 @@ class Character
@listinv = (thing) =>
for i in @inventory
if i.name == thing
return invlink(i.display, i.name)
return invlink(i.display.fcall(i), i.name)
@inv = (thing) =>
for i in @inventory

View file

@ -15,10 +15,10 @@ class SaletUnit
return parsedsc(text, @name)
@takeable = false
@display = ""
@take = () => "You take the #{@display}." # taking to inventory
@act = () => "You don't find anything extraordinary about the #{@display}." # unit action
@dsc = () => "You see a {{#{@display}}} here." # unit description
@inv = () => "It's a #{@display}." # inventory description
@take = () => "You take the #{@display.fcall(@)}." # taking to inventory
@act = () => "You don't find anything extraordinary about the #{@display.fcall(@)}." # unit action
@dsc = () => "You see a {{#{@display.fcall(@)}}} here." # unit description
@inv = () => "It's a #{@display.fcall(@)}." # inventory description
@location = ""
@put = (location) =>
if salet.rooms[location]?