Starting main character creation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-12-08 12:45:43 -05:00
parent 981712c32b
commit 7c454b41c2
9 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,16 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"name",
"pronouns",
"relics",
"approaches"
],
"name" : "FirelightsCharacter",
"type" : "normal"
}

View File

@ -0,0 +1,3 @@
accessing
characters
^ characters ifNil: [ characters := OrderedCollection new]

View File

@ -0,0 +1,3 @@
accessing
namesOracle
^ SfOracle new

View File

@ -0,0 +1,4 @@
accessing
newMainCharacter
self characters ifEmpty: [ self characters add: FirelightsCharacter new].
^ self characters first.

View File

@ -10,7 +10,8 @@
"dice",
"wordMap",
"oracles",
"wiki"
"wiki",
"characters"
],
"name" : "FirelightsGame",
"type" : "normal"

View File

@ -0,0 +1,3 @@
accessing
fromRepository
^ STONJSON fromString: 'https://raw.githubusercontent.com/rsek/dataforged/main/src/starforged/oracles.json' asUrl retrieveContents

View File

@ -0,0 +1,14 @@
accessing
loadCharacterNames
| dataSlice response |
dataSlice := (self fromRepository second at: 'Oracles') sixth.
self name: (dataSlice at: 'Display' at: 'Title').
self intro: (dataSlice at: 'Description').
response := OrderedDictionary new.
#('givenNames' 'callsigns' 'familyNames') doWithIndex: [ :key :i |
response
at: key
put: ((((dataSlice at: 'Oracles') at: i) at: 'Table') collect: [ :each | each at: 'Result' ]).
].
self options: response.
^ self

View File

@ -1,5 +1,7 @@
accessing
printOn: aStream
| currentName |
currentName := self name ifNil: ['Unammed'].
super printOn: aStream.
aStream
nextPutAll: '( ', self name, ' )'.
nextPutAll: '( ', currentName, ' )'.