mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-06-16 23:20:54 +03:00
randomElement fix and unitDelimiter for units
This commit is contained in:
parent
ffbc7174d8
commit
36bd3cdf5d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salet",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||
"homepage": "https://salet.su",
|
||||
|
|
|
@ -44,7 +44,7 @@ class Random
|
|||
|
||||
# return a random element from an array
|
||||
randomElement: (elements) ->
|
||||
return elements[@rand(elements.length - 1)]
|
||||
return elements[@rand(elements.length)]
|
||||
|
||||
# return odds of a (value + dN) being larger than target, rounded down
|
||||
odds: (value, target, n) ->
|
||||
|
|
|
@ -110,6 +110,9 @@ class SaletRoom
|
|||
if salet.autosave and @canSave
|
||||
salet.saveGame()
|
||||
|
||||
# A string between unit descriptions.
|
||||
@unitDelimiter = ""
|
||||
|
||||
###
|
||||
An internal function to get the room's description and the descriptions of
|
||||
every unit in this room.
|
||||
|
@ -136,7 +139,7 @@ class SaletRoom
|
|||
)
|
||||
|
||||
for description in unitDescriptions
|
||||
retval += " "+description.content
|
||||
retval += @unitDelimiter + description.content
|
||||
|
||||
return markdown(retval)
|
||||
|
||||
|
|
Loading…
Reference in a new issue