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