123456789101112 |
- module Tests {
- export var MIN_DICE = 0; // Dices can be < 0
- export var MAX_DICE = 3; // Dices can go real high
- export function rollDice () {
- return Math.floor(Math.random() * (MAX_DICE - MIN_DICE)) + 1 + MIN_DICE;
- }
- export function test (attr : number, difficulty : number) {
- return (attr + rollDice()) >= difficulty;
- }
- }
|