That's a very good suggestion. I have added a couple entries to the datamap for the PC to include modifiers for attack, defense, and damage. So, the code (though in separate areas) sort of amounts to:
<!--PC GENERATION-->
(set:$hero to (datamap:
"hp",100,
"attskill",10,
"defskill",10,
"str",10,
"dam",0,
"DR",0,
"oDR",0,
"exp",0,
"gp",10,
"level",1,
"weapon",'none',
"armor",'none',
"magic",'none',
"attmod",0,
"defmod",0,
"dammod",0))
<--!MODIFIER at TOP OF FIGHT ROUTINE-->
(if:$mystance is 'berserk')[
(set:$hero's attmod to 4)
(set:$hero's defmod to -4)
(set:$hero's dammod to 2)
]
(if:$mystance is 'defend')[
(set:$hero's attmod to -2)
(set:$hero's defmod to 2)
(set:$hero's dammod to 0)
]
Where clicking your action on the battle screen assigns the variable to $mystance. At the end of the round, all the modifiers (attmod, defmod, dammod) are set back to zero and the stance is reset.
My goal is to be able to add a plethora of modifiers with as little difficulty and additional programming as possible.
I have started working on a "stunned" modifier that would last for multiple rounds, but it is difficult to get it timed correctly to last and be correctly displayed over the course of several rounds. That's the next challenge, I guess.