Rolling dice support started.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-12-03 14:48:29 -05:00
parent a9d376b36c
commit 3da183fe80
14 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,3 @@
accessing
dice
^ dice ifNil: [dice := Array with: (Die with: 6) with: (Die with: 6) ]

View File

@ -0,0 +1,3 @@
accessing
roll
^ self dice collect: [:each | each roll ]

View File

@ -0,0 +1,13 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"dice"
],
"name" : "DicePool",
"type" : "normal"
}

View File

View File

@ -0,0 +1,4 @@
accessing
with: anInteger
^ self new
faces: anInteger

View File

@ -0,0 +1,3 @@
accessing
faces: anInteger
faces := anInteger

View File

@ -0,0 +1,3 @@
accessing
faces
^ faces

View File

@ -0,0 +1,3 @@
accessing
roll
^ self faces atRandom

View File

@ -0,0 +1,13 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"faces"
],
"name" : "Die",
"type" : "normal"
}

View File

@ -0,0 +1,3 @@
accessing
dice
^ dice ifNil: [ dice := DicePool new ]

View File

@ -0,0 +1,3 @@
accessing
loadOraclesFromRepository
^ STON fromString: 'https://mutabit.com/repos.fossil/502Lab/raw/f0c299?at=oracles.ston' asUrl retrieveContents utf8Decoded

View File

@ -1,3 +1,3 @@
accessing
oracles
^ oracles ifNil: [ oracles := self loadOraclesFromWikiTemplate]
^ oracles ifNil: [ oracles := self loadOraclesFromRepository]

View File

@ -0,0 +1,3 @@
accessing
roll
^ self dice roll