Compare commits

..

No commits in common. "master" and "image-sync" have entirely different histories.

156 changed files with 56 additions and 786 deletions

View File

@ -1,5 +0,0 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}

View File

@ -1,8 +0,0 @@
baselines
baseline: spec
<baseline>
spec
for: #common
do: [
spec package: 'RoloLudo'
]

View File

@ -1,3 +0,0 @@
accessing
projectClass
^ MetacelloCypressBaselineProject

View File

@ -1,11 +0,0 @@
{
"commentStamp" : "",
"super" : "BaselineOf",
"category" : "BaselineOfRoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BaselineOfRoloLudo",
"type" : "normal"
}

View File

@ -1 +0,0 @@
SystemOrganization addCategory: #BaselineOfRoloLudo!

View File

@ -1 +0,0 @@
(name 'BaselineOfRoloLudo')

View File

@ -1 +0,0 @@
{ }

View File

@ -1,28 +1,3 @@
# RoloLudo
Utilities for table top role playing, starting with [Ironsworn](https://www.ironswornrpg.com/),
[Starforged](https://www.ironswornrpg.com/product-ironsworn-starforged)
and [Firelights](https://firelights.farirpgs.com/).
To install it on Pharo/GToolkit first install [ExoRepo](https://code.tupale.co/Offray/ExoRepo)
and then run from a Playground:
```smalltalk
ExoRepo new
repository: 'https://code.sustrato.red/Offray/RoloLudo';
load.
```
The first utilities connect JSON oracles with the [502Lab wiki](https://mutabit.com/repos.fossil/502Lab/uv/wiki/502Lab.html#) to facilitate translations.
In the future it is expected to incorporate different utilities to make the game experience more fluid and minimalistic:
* [x] Virtual dice.
* [x] Querying of oracles and wiki.
* [ ] Bots connected to Telegram or other game channels.
* [ ] Querying and editing of character sheets.
**References**:
* [Dataforged](https://github.com/rsek/dataforged): Official Ironsworn: Starforged rules data in JSON, for use in community tools.
* [Datasworn](https://github.com/rsek/datasworn): JSON files of game data for the tabletop role-playing game Ironsworn, and its expansion, Ironsworn: Delve. For use in community-created tools, since it doesn't make sense to duplicate work on data entry.
* [Stargazer conversions](https://github.com/nboughton/stargazer_conversions): This project provides scripts to convert JSON content forged with rsek data to match the models used in the Stargazer project.
Utilities for table top role playing, starting with Ironsworn.

View File

@ -1 +0,0 @@
I represent a deck of cards. The terminology was taken from [Glossary of card game terms](https://en.wikipedia.org/wiki/Glossary_of_card_game_terms) in Wikipedia.

View File

@ -1,10 +0,0 @@
accessing
cards
| response |
response := OrderedCollection new.
self suits keysDo: [:suit |
(self numeralCards, self faceCards) do: [:number|
response add: number asString, suit.
].
].
^ response

View File

@ -1,3 +0,0 @@
accessing
faceCards
^ #( 'J' 'Q' 'K')

View File

@ -1,3 +0,0 @@
accessing
numeralCards
^ 1 to: 10

View File

@ -1,6 +0,0 @@
accessing
suits
^ { '♣' -> 'clubs' .
'♦' -> 'diamons' .
'♥' ->'hearts' .
'♠' ->'spades'} asDictionary

View File

@ -1,3 +0,0 @@
accessing
cards
^ self class cards

View File

@ -1,6 +0,0 @@
accessing
draw: card
self stock
detect: [ :each | each = card ]
ifFound: [self drawn add: card ]
ifNone: [ ^ nil ]

View File

@ -1,6 +0,0 @@
accessing
draw
| taken |
taken := self stock atRandom.
self drawn add: taken.
^ taken

View File

@ -1,3 +0,0 @@
accessing
drawAll: aCollection
self drawn addAll: aCollection

View File

@ -1,3 +0,0 @@
accessing
drawn: aCollection
drawn := aCollection

View File

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

View File

@ -1,12 +0,0 @@
accessing
printOn: aStream
super initialize.
aStream nextPutAll: 'Stock: ', String cr.
self class suits keysDo: [ :suit |
aStream
nextPutAll: (self stockCardsInSuit: suit);
nextPutAll: String cr.
].
aStream nextPutAll: 'Drawn: ', String cr.
self drawn do: [:card | aStream nextPutAll: card, ' ' ].
^ aStream contents.

View File

@ -1,5 +0,0 @@
accessing
reset
self drawn: OrderedCollection new.
self stock: self class cards.
^ self

View File

@ -1,3 +0,0 @@
accessing
stock
^ stock := self class cards copyWithoutAll: self drawn

View File

@ -1,7 +0,0 @@
accessing
stockCardsInSuit: aString
| response suitCards |
response := '' writeStream.
suitCards := self stock select: [ :card | card endsWith: aString ].
suitCards do: [ :card | response nextPutAll: card ].
^ response contents

View File

@ -1,6 +0,0 @@
accessing
uiCardsFor: aView
<gtView>
^ aView text
title: 'Cards';
text: [ self printString ]

View File

@ -1,14 +0,0 @@
{
"commentStamp" : "<historical>",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"drawn",
"stock"
],
"name" : "DeckOfCards",
"type" : "normal"
}

View File

@ -1,3 +0,0 @@
accessing
dice: anArray
dice := anArray

View File

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

View File

@ -1,5 +0,0 @@
accessing
printOn: aStream
super initialize.
aStream
nextPutAll: self dice printString

View File

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

View File

@ -1,14 +0,0 @@
accessing
uiDiceFor: aView
<gtView>
| response currentRoll dicePool |
response := '' writeStream.
currentRoll := self roll.
dicePool := self dice collect: [:each | each faces ].
response
nextPutAll: 'Dice: ', dicePool printString ; cr;
nextPutAll: 'Roll: ', currentRoll printString; cr;
nextPutAll: 'Sum: ', currentRoll sum asString.
^ aView text
title: 'Dice';
text: [ response contents ]

View File

@ -1,4 +0,0 @@
accessing
with: fistInteger with: secondInteger
self dice: (Array with: (Die with: fistInteger) with: (Die with: secondInteger))

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +0,0 @@
accessing
printOn: aStream
super initialize.
aStream
nextPutAll: self faces asString

View File

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

View File

@ -1,9 +0,0 @@
accessing
approaches
^ approaches ifNil: [
approaches := OrderedDictionary new
at: 'Strong' put: 0;
at: 'Patient'put: 0;
at: 'Quick' put: 0;
yourself
]

View File

@ -1,6 +0,0 @@
accessing
inventory
^ inventory ifNil: [
inventory := Dictionary new
at: 'vehicle' put: self vehicle;
yourself]

View File

@ -1,3 +0,0 @@
as yet unclassified
name: aString
name := aString

View File

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

View File

@ -1,3 +0,0 @@
accessing
patient: anInteger
self approaches at: 'Patient' put: anInteger

View File

@ -1,3 +0,0 @@
accessing
patient
^ self approaches at: 'Patient'

View File

@ -1,10 +0,0 @@
accessing
printOn: aStream
super initialize.
aStream
nextPutAll: '- Name: ', self name; cr;
nextPutAll: '- Pronouns: ', self pronouns; cr;
nextPutAll: '- Approaches'; cr;
nextPutAll: ' - Strong: ', self strong asString; cr;
nextPutAll: ' - Patient: ', self patient asString; cr;
nextPutAll: ' - Quick: ', self quick asString; cr

View File

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

View File

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

View File

@ -1,3 +0,0 @@
as yet unclassified
quick: anInteger
self approaches at: 'Quick' put: anInteger.

View File

@ -1,3 +0,0 @@
accessing
quick
^ self approaches at: 'Quick'

View File

@ -1,3 +0,0 @@
accessing
relics
^ self inventory at: 'relics' ifAbsentPut: [ nil ]

View File

@ -1,3 +0,0 @@
accessing
strong: anInteger
self approaches at: 'Strong' put: anInteger

View File

@ -1,3 +0,0 @@
accessing
strong
^ self approaches at: 'Strong'

View File

@ -1,6 +0,0 @@
accessing
uiViewFor: aView
<gtView>
^ aView text
title: 'Character Info';
text: [ self printString ]

View File

@ -1,4 +0,0 @@
accessing
vehicle
"This should be replaced y a Vehicle inventory item, with fatigue status."
^ 'criocápsula móvil'

View File

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

View File

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

View File

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

View File

@ -1,3 +0,0 @@
accessing
deck
^ deck ifNil: [ deck := DeckOfCards new]

View File

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

View File

@ -1,10 +0,0 @@
accessing
export
| response |
response := '' writeStream.
(STON writer on: response)
newLine: String lf;
prettyPrint: true;
keepNewLines: true;
nextPut: self.
^ MarkupFile exportAsFileOn: FileLocator temp / 'firelights.ston' containing: (response contents)

View File

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

View File

@ -1,18 +0,0 @@
accessing
loadOraclesFromWikiTemplate
| oraclesTiddler rows |
oraclesTiddler := self wiki templateWiki tiddlers
detect: [:tiddler | (tiddler title) = 'Tablas Generadoras' ].
rows := oraclesTiddler text lines allButFirst collect: [:each | each splitOn: '|'].
^ rows collect: [:row | | tempDice |
tempDice := (row second splitOn: '"') second.
tempDice := tempDice splitOn: Character space.
tempDice := { tempDice first asNumber . tempDice second asNumber }.
OrderedDictionary new
at: 'dice' put: tempDice;
at: 'region' put: row third;
at: 'theme' put: row fourth;
at: 'event' put: row fifth;
at: 'past' put: row sixth;
yourself.
]

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +0,0 @@
accessing
queryOracles
| currentRoll |
currentRoll := self roll.
^ self oracles detect: [ :each | (each at: 'dice') = currentRoll ] ifNone: [ ^ currentRoll ]

View File

@ -1,8 +0,0 @@
accessing
randomName
| response|
response := self namesOracle.
^ {'Given name' -> (response at: 'givenNames') atRandom.
'callsign' -> (response at: 'callsigns') atRandom.
'Familiy name' -> (response at: 'familyNames') atRandom.
} asDictionary.

View File

@ -1,4 +0,0 @@
accessing
resetWorlMap
self worldMap: nil.
self deck reset.

View File

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

View File

@ -1,11 +0,0 @@
accessing
saveOracles
| fileName formats |
fileName := 'oracles'.
formats := {'ston' -> STON. 'json' -> STONJSON} asDictionary.
formats keysAndValuesDo: [:format :class |
MarkupFile
exportAsFileOn: (FileLocator temp / fileName), format
containing: (class toStringPretty: self oracles)
].
^ FileLocator temp

View File

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

View File

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

View File

@ -1,13 +0,0 @@
accessing
uiGameFor: aView
<gtView>
| response |
response := '' writeStream.
response
nextPutAll: '❭❭❭ Main Character'; cr; cr;
nextPutAll: self characters first printString; cr;
nextPutAll: '❭❭❭ Deck'; cr; cr;
nextPutAll: self deck printString.
^ aView text
title: 'Game';
text: [ response contents ]

View File

@ -1,7 +0,0 @@
accessing
wiki
^ wiki ifNil: [ wiki := TiddlyWiki new
name: 'Firelights/Vivarium games wiki';
template: 'https://vivarium.tiddlyhost.com/'.
]

View File

@ -1,3 +0,0 @@
accessing
worldMap: anObject
wordMap := anObject

View File

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

View File

@ -1,5 +0,0 @@
accessing
worldMapDraw: aCardCollection
self deck drawn addAll: aCardCollection.
self worldMap addAll: aCardCollection.

View File

@ -1,6 +0,0 @@
accessing
worldMapDraw
| currentPlace |
currentPlace := self deck draw.
self worldMap add: currentPlace.
^ currentPlace

View File

@ -1,19 +0,0 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"deck",
"dice",
"wordMap",
"oracles",
"wiki",
"characters",
"story"
],
"name" : "FirelightsGame",
"type" : "normal"
}

View File

@ -1 +0,0 @@
I model a simple bot to automatize some tasks related with rolling oracles, character creation and playin in general.

View File

@ -1,9 +0,0 @@
accessing
newRandomPlayerCharacter
^ SfPlayerCharacter new
momentum: 2;
maxMomentum: 10;
momentumReset: 2;
health: 5;
spirit: 5;
supply: 5.

View File

@ -1,11 +0,0 @@
accessing
rollDice
"For the moment, I will model a dice roll in Ironsworn Starforged.
A more abstract vocabulary should be deviced allowing the roll of
dice pool"
^ OrderedDictionary new
at: 'challenge die (1):' put: 10 atRandom;
at: 'action die:' put: 6 atRandom;
at: 'challenge die (2):' put: 10 atRandom;
yourself.

View File

@ -1,11 +0,0 @@
{
"commentStamp" : "<historical>",
"super" : "Object",
"category" : "RoloLudo",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "LudoBot",
"type" : "normal"
}

View File

@ -2,9 +2,5 @@ I model an asset of the Ironsworn Starforged Tabletop Roleplaying Game.
More information at:
[1] <https://www.ironswornrpg.com/>
[2] <https://www.kickstarter.com/projects/shawntomkin/ironsworn-starforged>
I use as inspiration the data provided by @rsek at this repostory:
<https://github.com/rsek/datasworn>
[1] https://www.ironswornrpg.com/
[2] https://www.kickstarter.com/projects/shawntomkin/ironsworn-starforged

View File

@ -1,9 +0,0 @@
accessing
collectionFromRepository: jsonFileUrl language: isoCode
| rawData |
rawData := STON fromString: jsonFileUrl asUrl retrieveContents.
^ rawData collect: [:assetDict |
(assetDict at: #Assets) collect: [ :assetSubdict |
self new fromDictionary: assetSubdict; language: isoCode
].
]

View File

@ -1,3 +0,0 @@
accessing
collectionFromRepository
^ self collectionFromRepository: 'https://raw.githubusercontent.com/rsek/dataforged/main/dist/starforged/assets.json' language: 'en'

View File

@ -1,3 +1,7 @@
accessing
asJsonTiddler
<<<<<<< HEAD
^ self asTiddler asJson
=======
^ self asTiddler asJson
>>>>>>> master

View File

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

View File

@ -1,6 +1,6 @@
accessing
fromDictionary: aDictionary
name := aDictionary at: #Name.
category := ((aDictionary at: 'Asset Type') splitOn: '/') last copyReplaceAll: '_' with: ' '.
abilities := self populateAbilities: (aDictionary at: #Abilities)
category := aDictionary at: #Category.
abilities := self populateAbilities: (aDictionary at: #Abilities)

View File

@ -1,12 +1,10 @@
accessing
populateAbilities: abilitiesArray
populateAbilities: abilitiesDictionary
| enabled disabled |
enabled := abilitiesArray select: [ :abi | (abi at: 'Enabled') = true ].
disabled := abilitiesArray select: [ :abi | (abi at: 'Enabled') = false ].
enabled := abilitiesDictionary select: [ :abi | abi keys includes: 'Enabled' ].
disabled := abilitiesDictionary reject: [ :abi | abi keys includes: 'Enabled' ].
^ self abilities
at: 'enabled' put: (enabled collect: [:abi |
(WikiText new content: (abi at: 'Text')) convertMarkdownLinks ]);
at: 'disabled' put: (disabled collect: [:abi |
(WikiText new content: (abi at: 'Text')) convertMarkdownLinks ]);
at: 'enabled' put: (enabled collect: [:abi | (abi at: 'Text') ]);
at: 'disabled' put: (disabled collect: [:abi | (abi at: 'Text') ]);
yourself.

View File

@ -0,0 +1,4 @@
I model a collection of Starforged assets.
I use as inspiration the data provided by @rsek at this repostory:
https://github.com/rsek/datasworn

View File

@ -0,0 +1,8 @@
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

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

View File

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

Some files were not shown because too many files have changed in this diff Show More