Consider the modifications to strength. Wisdom would be similar.


Each character has an SA named "StrengthModifiers". The SA has several scripts (in Object-oriented language these would be the 'Methods').


SA 'Strength Modifiers' has a parameter (as do all good SAs) and the parameter contains the currently active adjustments to the character's strength. The several adjustments are stored in the parameter as a delimited string.....what else?


For example:

"*AppleJuice,+4*ElixirOfArsenic,-8*RedGirdle,22,CherryJuice,+1"

The numbers are the adjustments to strength. Notice that some have a sign in front and some do not. The sign means that the number should be added to the strength. The absence of a sign means that the strength should be set equal to that number.


Given the 'StrengthModifiers' parameter string it is obvious how we compute the current strength of the character. But I will say it out loud just for the record.


Start at the front of the string and add all 'Relative' modifiers together until you come to an 'Absolute' modifier. Add the sum of the relatives to the 'Absolute' and that is the answer. If you come to the end of the string without encountering an 'Absolute' then use the character's base strength instead. Violä.


In the following cases supplied by Manikus I will show the resulting string after each step along with the formula for current strength. In each case, we get the right (sic) answer. That is good.


Case A - Absolute girdle and bra

STR = 15

“” 0 + 15 = 15

Wear red girdle STR = 22

*RedGirdle,22” 0 + 22 = 22

Wear green bra STR = 27

*GreenBra,27*RedGirdle,22” 0 + 27 = 27

remove red girdle STR = 27

*GreenBra,27” 0 + 27 = 27

remove green bra STR = 15

“” 0 + 15 = 15


Case B - Absolute girdle and relative potion.

STR = 15

“” 0 + 15 = 15

Drink potion +40 STR = 55

*Potion,+40” 40 + 15 = 55

Wear girdle STR = 22

*Girdle,22*Potion,+40” 0 + 22 = 22

Remove girdle STR = 55

*Potion,+40” 40 + 15 = 55

potion wears off STR = 15.

“” 0 + 15 = 15




Case C: Absolute girdle and Relative potion in other order.


STR = 15

“” 0 + 15 = 15

Wear girdle STR = 22

*Girdle,22” 0 + 22 = 22

Drink potion +40 STR = 62

*Potion,+40*Girdle,22” 40 + 22 = 62

Remove girdle STR = 55

*Potion,+40” 40 + 15 = 55

potion wears off STR = 1

“” 0 + 15 = 15



Now we need to ask the question “How does this get done?” The “StrengthModifiers” SA has several scripts (or methods).


  1. AddModifier(string) ; For example, AddModifier(“RedGirdle,22”).

  2. DeleteModifier(string) ; For example, DeleteModifier(“RedGirdle”).

  3. EffectiveStrength()


During play the engine will be calling the EffectiveStrength script when it needs to know the character's strength.


The AddModifier script will be called when the character drinks a potion or readies a RedGirdle.


The DeleteModifier script will be called when the potion wears off or the character removes a RedGirdle.


So the DrinkPotion script does a couple of things. It calls the AddModifier script of the “StrengthModifiers” SA (creating such an SA if necessary). It creates an 'ElixerOfArsenic' SA for the character. The 'ElixirOfArsenic' SA has scripts that will delete itself after 5 days, at which time it will call the “StrengthModifiers” DeleteModifier script.


I think we can arrange a way that the “ApplePotion”, the “LemonPotion”, the KiwiPotion”, and the “ElixirOfArsenic” will be able to share all of their scripts so that the scripts need not be replicated over and over. And, when it is discovered why the scripts don't work, they can be repaired in one place rather than a hundred. I assume that each of these potions is an 'Item'. We can put all the necessary information in a SA belonging to the item. For example, the “ApplePotion” that wears off in 12 days will have an SA named “POTION_EFFECTS” with a parameter such as “Strength,+40,12”. The POTION_EFFECTS SA will have scripts that take care of all types of potions, using its parameter to personalize the effects.


Questions and comments will be added here as they arrive.