Okie,
To start off with, you'll need to create a variable for each affliction. I call them affliction_X where X is the name of the affliction ie. affliction_paralysis. (There's a point to putting affliction_ in front of each one, so don't just use paralysis, asthma, etc.)
Then you'll need to create a set of triggers for each affliction. You'll need the trigger that lets you know you have the affliction and a trigger that tells you that the affliction has been cured. So for masochism you have these triggers (as regular expressions):
An odd sensation descends upon you\.$
You feel the urge to slash\, cut\, and bruise yourself\.$
With the heel of your palm\, you smack.+$
You drive a clenched fist into your gut\.$
You use your (right|left) foot to stomp on your (left|right) as hard as possible\.$
Each of these call the subroutine masochismon:
Sub masochismon (a, b, c)
world.setvariable "affliction_masochism", "on" 'this sets the variable to on
anorexia = world.getvariable ("affliction_anorexia") 'this section stops the trigger from trying to eat if you have anorexia
If anorexia = "off" Then
world.sendpush "eat lobelia"
End If
end Sub
Then you also have the trigger for turning masochism off:
You no longer enjoy pain\.$
This calls the subroutine masochismoff:
Sub masochismoff (a, b, c)
world.setvariable "affliction_masochism", "off"
End Sub
This is the first step. The next is designing the part that eats when you get herb balance back. I'll get to that soon, but I gotta run. |