mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-05-24 11:58:21 +03:00
Fixed the diceString method in RNG.
This commit is contained in:
parent
eb1f8df89a
commit
0a259527e4
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salet",
|
||||
"version": "1.4.12",
|
||||
"version": "1.4.13",
|
||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||
"homepage": "http://salet.oreolek.ru",
|
||||
|
|
|
@ -43,11 +43,10 @@ class Random
|
|||
@rand(upper)
|
||||
|
||||
# Returns the result of rolling *n* dice with *dx* sides, and adding *plus*.
|
||||
dice: (n, dx, plus) ->
|
||||
dice: (n = 1, dx, plus = 0) ->
|
||||
result = 0
|
||||
for i in [0..n]
|
||||
console.log i
|
||||
result += 1 + @randRange(1,dx)
|
||||
result = 1 + Math.floor(@randf() * dx)
|
||||
if (plus)
|
||||
result += plus
|
||||
result
|
||||
|
|
Loading…
Reference in a new issue