Refactoring. New and improved SfPlayerCharacter to model character sheets.
This commit is contained in:
parent
62756bf703
commit
40ab1d0000
@ -0,0 +1 @@
|
||||
I model a simple bot to automatize some tasks related with rolling oracles, character creation and playin in general.
|
@ -1,7 +1,9 @@
|
||||
accessing
|
||||
newRandomPlayerCharacter
|
||||
^ SfPlayerCharacter new
|
||||
momentum;
|
||||
momentum: 2;
|
||||
maxMomentum: 10;
|
||||
momentumReset: 2;
|
||||
health: 5;
|
||||
spirit: 5;
|
||||
supply: 5.
|
11
RoloLudo.package/LudoBot.class/instance/rollDice.st
Normal file
11
RoloLudo.package/LudoBot.class/instance/rollDice.st
Normal file
@ -0,0 +1,11 @@
|
||||
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.
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"commentStamp" : "",
|
||||
"commentStamp" : "<historical>",
|
||||
"super" : "Object",
|
||||
"category" : "RoloLudo",
|
||||
"classinstvars" : [ ],
|
||||
|
@ -2,6 +2,7 @@ accessing
|
||||
fromDictionary: aDictionary
|
||||
| optionsTable |
|
||||
name := aDictionary at: 'Name' ifAbsent: [ name := aDictionary at: 'Display name' ].
|
||||
intro := aDictionary at: 'Description'.
|
||||
optionsTable := aDictionary at: 'Table'.
|
||||
optionsTable doWithIndex: [:opt :i | | key value prevKey |
|
||||
(i = 1)
|
||||
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
edge: anRagedInteger
|
||||
"Edge: Quickness, agility, and prowess when fighting at a distance"
|
||||
edge := anRagedInteger
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
edge
|
||||
|
||||
^ edge
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
heart: integerBetween1and3
|
||||
"Heart: Courage, willpower, empathy, sociability, and loyalty"
|
||||
heart := integerBetween1and3
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
heart
|
||||
|
||||
^ heart
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
iron: integerBetween1and3
|
||||
"Iron: Physical strength, endurance, aggressiveness, and prowess when fighting at close quarters"
|
||||
iron := integerBetween1and3
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
iron
|
||||
|
||||
^ iron
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
maxMomentum: anObject
|
||||
|
||||
maxMomentum := anObject
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
maxMomentum
|
||||
|
||||
^ maxMomentum
|
@ -1,4 +1,4 @@
|
||||
accessing
|
||||
momentum: anObject
|
||||
momentum: anInteger
|
||||
|
||||
momentum := anObject
|
||||
momentum := anInteger
|
@ -1,8 +1,3 @@
|
||||
accessing
|
||||
momentum
|
||||
^ momentum ifNil: [
|
||||
momentum := Dictionary new
|
||||
at: 'max' put: 10;
|
||||
at: 'reset' put: 2;
|
||||
at: 'current' put: 2.
|
||||
]
|
||||
^ momentum
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
momentumReset: anObject
|
||||
|
||||
momentumReset := anObject
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
momentumReset
|
||||
|
||||
^ momentumReset
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
shadow: integerBetween1And3
|
||||
"Shadow: Sneakiness, deceptiveness, and cunning"
|
||||
shadow := integerBetween1And3
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
shadow
|
||||
|
||||
^ shadow
|
@ -1,4 +0,0 @@
|
||||
accessing
|
||||
stats: anObject
|
||||
|
||||
stats := anObject
|
@ -1,4 +1,12 @@
|
||||
accessing
|
||||
stats
|
||||
|
||||
^ stats
|
||||
^ Dictionary new
|
||||
addAll: {
|
||||
'Edge' -> self edge .
|
||||
'Heart' -> self heart.
|
||||
'Iron' -> self iron.
|
||||
'Shadow' -> self shadow.
|
||||
'Wits' -> self wits
|
||||
};
|
||||
yourself
|
@ -1,4 +1,4 @@
|
||||
accessing
|
||||
vows: anObject
|
||||
vows: aDictionary
|
||||
|
||||
vows := anObject
|
||||
vows := aDictionary
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
wits: aRangedInteger
|
||||
"Wits: Expertise, knowledge, and observation"
|
||||
wits := aRangedInteger
|
@ -0,0 +1,4 @@
|
||||
accessing
|
||||
wits
|
||||
|
||||
^ wits
|
@ -10,12 +10,18 @@
|
||||
"pronouns",
|
||||
"callsign",
|
||||
"assets",
|
||||
"stats",
|
||||
"edge",
|
||||
"heart",
|
||||
"iron",
|
||||
"shadow",
|
||||
"wits",
|
||||
"vows",
|
||||
"momentum",
|
||||
"health",
|
||||
"spirit",
|
||||
"supply"
|
||||
"supply",
|
||||
"momentum",
|
||||
"momentumReset",
|
||||
"maxMomentum"
|
||||
],
|
||||
"name" : "SfPlayerCharacter",
|
||||
"type" : "normal"
|
||||
|
Loading…
Reference in New Issue
Block a user