Compare commits

...

1 Commits

Author SHA1 Message Date
Offray Vladimir Luna Cárdenas ada2d9c5d2 Testing changes in the repository. 2021-06-20 15:50:56 -05:00
66 changed files with 0 additions and 351 deletions

View File

@ -1,4 +0,0 @@
accessing
abilities: abilitiesDictionary
"Keys are 'enabled' and 'disbled' and both contain arrays of text with abities."
abilities := abilitiesDictionary

View File

@ -1,6 +0,0 @@
accessing
abilities
^ abilities ifNil: [ abilities := Dictionary new
at: 'enabled' put: OrderedCollection new;
at: 'disabled' put: OrderedCollection new;
yourself ]

View File

@ -1,10 +0,0 @@
converting
abilitiesAsWikiText
| output |
output := '' writeStream.
output
nextPutAll: '<ul style="list-style-type:none;">'; lf;
nextPutAll: (self abilitiesAsWikiTextFor: self currentAbilities marked: '⬢');
nextPutAll: (self abilitiesAsWikiTextFor: self pendingAbilities marked: '⬡');
nextPutAll: '</ul>'.
^ output contents

View File

@ -1,12 +0,0 @@
utilities
abilitiesAsWikiTextFor: abilitiesSubset marked: unicodeSymbol
| aStream |
aStream := '' writeStream.
abilitiesSubset do: [:abi|
aStream
nextPutAll: ' <li> ', unicodeSymbol ; cr;
nextPutAll: ' ';
nextPutAll: abi; cr;
nextPutAll: ' </li>'; cr ].
^ aStream contents

View File

@ -1,3 +0,0 @@
accessing
asJsonTiddler
^ self asTiddler asJson

View File

@ -1,7 +0,0 @@
converting
asTiddler
^ Tiddler new
title: self name;
tags: 'Starforged ' , self category;
text: self abilitiesAsWikiText;
created: DateAndTime now asString.

View File

@ -1,3 +0,0 @@
accessing
category: anObject
category := anObject

View File

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

View File

@ -1,3 +0,0 @@
converting
currentAbilities
^ self abilities at: 'enabled'

View File

@ -1,6 +0,0 @@
accessing
fromDictionary: aDictionary
name := aDictionary at: #Name.
category := aDictionary at: #Category.
abilities := self populateAbilities: (aDictionary at: #Abilities)

View File

@ -1,3 +0,0 @@
accessing
language: anObject
language := anObject

View File

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

View File

@ -1,3 +0,0 @@
accessing
name: anObject
name := anObject

View File

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

View File

@ -1,3 +0,0 @@
converting
pendingAbilities
^ self abilities at: 'disabled'

View File

@ -1,10 +0,0 @@
accessing
populateAbilities: abilitiesDictionary
| enabled disabled |
enabled := abilitiesDictionary select: [ :abi | abi keys includes: 'Enabled' ].
disabled := abilitiesDictionary reject: [ :abi | abi keys includes: 'Enabled' ].
^ self abilities
at: 'enabled' put: (enabled collect: [:abi | (abi at: 'Text') ]);
at: 'disabled' put: (disabled collect: [:abi | (abi at: 'Text') ]);
yourself.

View File

@ -1,6 +0,0 @@
printing
printOn: aStream
super printOn: aStream.
aStream
nextPutAll: ' ( ' , self name , ' | ';
nextPutAll: self category, ' )'

View File

@ -1,4 +0,0 @@
accessing
translations: translationsDictory
"Keys are ISO two letters language codes and values are the names of the asset in such language."
translations := translationsDictory

View File

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

View File

@ -1,8 +0,0 @@
accessing
fromUrlString: aString language: isoCode
| rawData |
rawData := STON fromString: aString asUrl retrieveContents.
self items: ((rawData at: 'Assets') collect: [:assetDict |
SfAsset new fromDictionary: assetDict; language: isoCode ])

View File

@ -1,3 +0,0 @@
accessing
items: anObject
items := anObject

View File

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

View File

@ -1,7 +0,0 @@
accessing
asTiddler
^ Tiddler new
title: self name;
tags: 'Starforged ' ,'[[', self category,']]';
text: self text;
created: DateAndTime now asString.

View File

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

View File

@ -1,8 +0,0 @@
accessing
fromDictionary: aDictionary
| tempText |
tempText := (WikiText new content: (aDictionary at: 'Text')) convertMarkdownBold; convertMarkdownLinks.
category := aDictionary at: 'Category'.
name := aDictionary at: 'Name'.
text := tempText content.
(aDictionary includesKey: 'Progress Move') ifTrue: [ self progress: true ]

View File

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

View File

@ -1,4 +0,0 @@
accessing
printOn: aStream
super printOn: aStream.
aStream nextPutAll: '( ', self name, ' ) '.

View File

@ -1,3 +0,0 @@
accessing
progress: aBoolean
progress := aBoolean

View File

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

View File

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

View File

@ -1,7 +0,0 @@
accessing
asTiddler
^ Tiddler new
title: self name;
tags: 'Starforged';
text: self intro, String lf, String lf, self optionsWikiTextTable;
created: DateAndTime now asString.

View File

@ -1,15 +0,0 @@
accessing
fromDictionary: aDictionary
| optionsTable |
name := aDictionary at: 'Name'.
optionsTable := aDictionary at: 'Table'.
optionsTable doWithIndex: [:opt :i | | key value prevKey |
(i = 1)
ifTrue: [key := 1 to: (opt at: 'Chance') asInteger]
ifFalse: [
prevKey := ((optionsTable at: (i-1)) at: 'Chance').
key := (prevKey asInteger + 1) to: (opt at: 'Chance') asInteger.
].
value := (opt at: 'Description') capitalized.
self options at: key put: value .
].

View File

@ -1,3 +0,0 @@
accessing
intro: longerText
intro := longerText

View File

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

View File

@ -1,3 +0,0 @@
accessing
name: shortText
name := shortText

View File

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

View File

@ -1,3 +0,0 @@
accessing
options: anOrderedDictionary
options := anOrderedDictionary

View File

@ -1,3 +0,0 @@
accessing
options
^ options ifNil: [ options := OrderedDictionary new ]

View File

@ -1,10 +0,0 @@
accessing
optionsWikiTextTable
| output |
output := '' writeStream.
self options keysAndValuesDo: [:k :v |
output
nextPutAll: '| ', k first asString, ' - ', k last asString, ' |';
nextPutAll: v, ' |'; cr
].
^ output contents

View File

@ -1,5 +0,0 @@
accessing
printOn: aStream
super printOn: aStream.
aStream
nextPutAll: '( ', self name, ' )'.

View File

@ -1,7 +0,0 @@
accessing
roll
| diceRoll |
diceRoll := 100 atRandom.
self options keysAndValuesDo: [:k :v |
(k includes: diceRoll) ifTrue: [ ^ v ]
]

View File

@ -1,3 +0,0 @@
accessing
asJson
^ STONJSON toStringPretty: (self asTiddlers collect: [:each | each asDictionary]) asArray

View File

@ -1,23 +0,0 @@
accessing
asTiddlers
| tiddlers transcluderText transcluder |
tiddlers := OrderedCollection new.
transcluderText := '' writeStream.
self options doWithIndex: [:opt :i | | tiddler |
tiddler := Tiddler new
title: self name, 'Option', i asString;
text: opt asWikiText;
created: DateAndTime now asString.
transcluderText nextPutAll: '{{', tiddler title, '}}'; cr; cr.
tiddlers add: tiddler.
].
transcluderText
nextPutAll: '----'; cr;
nextPutAll: '👤 ', self character.
transcluder := Tiddler new
title: self name;
tags: 'Starforged Truths';
text: transcluderText contents;
created: DateAndTime now asString.
tiddlers add: transcluder.
^ tiddlers

View File

@ -1,3 +0,0 @@
accessing
character: optionsPhrase
character := optionsPhrase

View File

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

View File

@ -1,6 +0,0 @@
accessing
fromDictionary: aDictionary
name := aDictionary at: 'Name'.
character := aDictionary at: 'Character'.
(aDictionary at: 'Truths') collect: [:truth | self options add: ((SfTruthOption new fromDictionary: truth))].
self refineOptionIntervals.

View File

@ -1,3 +0,0 @@
accessing
name: aString
name := aString

View File

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

View File

@ -1,3 +0,0 @@
accessing
options: anOrderedCollection
options := anOrderedCollection

View File

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

View File

@ -1,5 +0,0 @@
accessing
printOn: aStream
super printOn: aStream.
aStream
nextPutAll: ' ( ', self name, ' ) '

View File

@ -1,13 +0,0 @@
accessing
refineOptionIntervals
| endings |
endings := self options collect: [:opt | opt chance ].
endings doWithIndex: [:end :i |
(i = 1)
ifTrue: [(self options at: i) chance: (1 to: end)]
ifFalse: [
(self options at: i) chance: (((endings at: (i-1)) + 1) to: (endings at: i))
]
].

View File

@ -1,7 +0,0 @@
accessing
emptyTruth
<gtExample>
| testSfTruth |
testSfTruth := SfTruth new.
self assert: testSfTruth isEmpty.
^ testSfTruth

View File

@ -1,19 +0,0 @@
accessing
asWikiText
| stream |
stream := '' writeStream.
stream
nextPutAll: '<b>';
nextPutAll: self chance first asString, '-', self chance last asString;
nextPutAll: ' | ', self brief;
nextPutAll: '</b>'; cr;
nextPutAll: String cr;
nextPutAll: self details;
nextPutAll: String cr;
nextPutAll: self subtableAsWikiText.
stream
nextPutAll: String cr;
nextPutAll: '<$details summary="Quest Starter">'; cr;
nextPutAll: '//', self questStarter, '//'; cr;
nextPutAll: '</$details>'.
^ stream contents

View File

@ -1,3 +0,0 @@
accessing
brief: shortText
brief := shortText

View File

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

View File

@ -1,3 +0,0 @@
accessing
chance: integerInterval
chance := integerInterval

View File

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

View File

@ -1,3 +0,0 @@
accessing
details: longerText
details := longerText

View File

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

View File

@ -1,9 +0,0 @@
accessing
fromDictionary: aDictionary
brief := aDictionary at: 'Description'.
details := aDictionary at: 'Details'.
questStarter := aDictionary at: 'Quest Starter'.
subtable := aDictionary at: 'Table' ifAbsent: [ subtable := nil ].
"Because of JSON original data this only puts the end of the chance interval.
This needs to be refined at 'container' object SfTruth."
chance := aDictionary at: 'Chance'

View File

@ -1,6 +0,0 @@
accessing
printOn: aStream
super printOn: aStream.
aStream
nextPutAll: ' ( ', self brief, ' )'

View File

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

View File

@ -1,3 +0,0 @@
accessing
subtable: aDictionary
subtable := aDictionary

View File

@ -1,3 +0,0 @@
accessing
subtable
^ subtable ifNil: [ subtable := OrderedDictionary new]

View File

@ -1,10 +0,0 @@
accessing
subtableAsWikiText
| stream chances |
stream := '' writeStream.
self subtable ifEmpty: [ ^ stream contents ].
chances := self subtable collect: [ :each | each at: 'Chance' ].
chances doWithIndex: [:ch :i |
stream nextPutAll: '| ', ch asString, ' |', ((self subtable at: i) at: 'Description'), ' |' ; cr
].
^ stream contents