I have no experience writing these rulebooks, but it seems to me that you’d have to pass both the initial score and some parameter that told you which score you’re calculating: body or mind… and I see that you can’t actually have a rulebook based on two values. Maybe that’s hackable with a new kind, but in this case the initial value is always zero. Maybe we can do that with zarf’s abstract-stat parameter from here:
[code]“Mind” by Victor Gijsbers
Test lab is a room.
Asking status is an action out of world. Understand “stats” as asking status.
An abstract stat is a kind of thing.
Body-stat is an abstract stat. The printed name of body-stat is “body”.
Mind-stat is an abstract stat. The printed name of mind-stat is “mind”.
Spirit-stat is an abstract stat. The printed name of spirit-stat is “spirit”.
To decide what number is the (stat - abstract stat) in numbers:
if stat is:
– body-stat: decide on the body;
– mind-stat: decide on the mind;
– spirit-stat: decide on the spirit.
Body score is a number that varies. Mind score is a number that varies. Spirit score is a number that varies.
To decide what number is the mind:
now mind score is 0;
consider the bonus calculating rules for the mind-stat;
decide on mind score.
To decide what number is the body:
now body score is 0;
consider the bonus calculating rules for the body-stat;
decide on body score.
To decide what number is the spirit:
now spirit score is 0;
consider the bonus calculating rules for the spirit-stat;
decide on spirit score.
The bonus calculating rules are an abstract stat based rulebook.
Bonus calculating body-stat: increase body score by 1.
Bonus calculating mind-stat: increase mind score by 2.
Bonus calculating spirit-stat: increase spirit score by 3.
Carry out asking status:
repeat with stat running through abstract stats:
let stat-name be indexed text;
now stat-name is the printed name of stat;
now stat-name is stat-name in sentence case;
say “[Stat-name]: [stat in numbers]. [run paragraph on]”;
say line break.
[/code]
This is working in this case, but I’m not sure if it scales up to a case where you want to calculate stats for different people – how can you pass a person and an abstract stat to the bonus calculating rules? And the indexed text is unfortunate. If the real problem is the spurious line break, climbingstars’s I6 solution is probably what we want.