Ever wanted to 'stun' or force a character to stay put?
I wanted to make a falling pit trap that a player takes damage from after entering the room.
The messages come up one second after entering the room - by then the player may well have simply left!
So... I added 'wait' as below, so I could prevent said player from doing anything until after the script resolved.
usage:
nop %actor.wait(1)% // adds a 1 second wait to the character
Code:
in dg_variables.c, approximately after line 1125 where it has just handled Wisdom:
snprintf(str, slen, "%d", GET_WIS(c));
}
+ else if (!str_cmp(field, "wait"))
+ {
+ if (subfield && *subfield)
+ {
+ int addition = atoi(subfield);
+ WAIT_STATE(c, addition * ( PULSE_VIOLENCE / 2) ); // by default violence is 2 seconds
+ }
+ snprintf(str, slen, "%d", GET_WAIT_STATE(c));
+ }
break;
} /* switch *field */