Mercurial > hg > batmud > ggrtf
changeset 5:04c05dfb8cca
New flags for trigger code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 01 Sep 2005 18:39:37 +0000 |
parents | 74990d8ad08d |
children | 432f88e9a884 |
files | ggrtf.tf |
diffstat | 1 files changed, 16 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ggrtf.tf Thu Sep 01 16:50:08 2005 +0000 +++ b/ggrtf.tf Thu Sep 01 18:39:37 2005 +0000 @@ -278,20 +278,23 @@ ; -A"<prerequisite trigger #1>" ; -B"<prerequisite trigger #2>" ; -C"<prerequisite trigger #3>" -; -r Use regexp instead of glob +; -r Use regexp instead of simple matching ; -s Stackable prot +; -n Renewable prot (does not stack, but can be renewed) +; -k Takes parameters (implies usage of regexp patterns aka '-r') /set st_prots= /def prcreate =\ - /if (!getopts("i:n:l:A:B:C:u:d:srk", "")) /msq ERROR! Invalid prot creation command!%;/break%;/endif%;\ + /if (!getopts("i:n:l:A:B:C:u:d:srkn", "")) /msq ERROR! Invalid prot creation command!%;/break%;/endif%;\ /set st_prots=%{opt_i} %{st_prots}%;\ /set st_%{opt_i}=0%;\ /set st_%{opt_i}_t=-1%;\ /set st_%{opt_i}_n=%{opt_n}%;\ /set st_%{opt_i}_l=%{opt_l}%;\ - /if (opt_s) /set st_%{opt_i}_stack=1%;/else /set st_%{opt_i}_stack=0%;/endif%;\ + /if (opt_s) /set st_%{opt_i}_stack=1%;/else /set st_%{opt_i}_stack=0%;/endif%;\ + /if (opt_n) /set st_%{opt_i}_renew=1%;/else /set st_%{opt_i}_renew=0%;/endif%;\ /if ({opt_u}=~"" | {opt_d}=~"") /break%;/endif%;\ - /if (!opt_r) /let qmatch=simple%;/else /let qmatch=regexp%;/endif%;\ + /if (opt_k | opt_r) /let qmatch=regexp%;/else /let qmatch=simple%;/endif%;\ /let pstr=0%;\ /if ({opt_A}!~"") /let pstr=1%;/def -i -p99 -F -aCyellow -mregexp -t'%{opt_A}' rec_%{opt_i}_A=/set st_%{opt_i}_p=1%;/endif%;\ /if ({opt_B}!~"") /let pstr=2%;/def -i -p99 -F -aCyellow -mregexp -t'%{opt_B}' rec_%{opt_i}_B=/if ({st_%{opt_i}_p}=1) /set st_%{opt_i}_p=2%%;/endif%;/endif%;\ @@ -317,9 +320,14 @@ /set st_%{1}_t=$[time()]%;\ /eval /set qtval_l=$$[st_%{1}_l]%;\ /eval /set qtval_s=$$[st_%{1}_stack]%;\ + /eval /set qtval_n=$$[st_%{1}_renew]%;\ /eval /set qtval_c=$$[st_%{1}]%;\ - /if ({qtval_c}=0)\ - /let qtstrs=ON!%;\ + /if ({qtval_c}==0 | {qtval_n}==1)\ + /if ({qtval_n})\ + /let qtstrs=Renewed!%;\ + /else \ + /let qtstrs=ON!%;\ + /endif%;\ /set st_%{1}=1%;\ /else \ /if ({qtval_s})\ @@ -373,8 +381,8 @@ /prcreate -i"paranoia" -n"Para" -l"Paranoia" -A" \'noxim delusa\'" -u"You have a bad feeling about this." -d"Everything seems so much more pleasant." ;; ---- Tarmalen ---- -/prcreate -i"unpain" -n"Unpain" -l"Unpain" -r -u"^You feel your will getting stronger.$" -d"^(You feel your will returning normal.|Your Unpain spell dissipates|You feel your will getting normal.|You suffer an acute health change)" -/prcreate -i"unstun" -n"Unstun" -l"Unstun" -s +/prcreate -i"unpain" -n"Unpain" -l"Unpain" -n -r -u"^You feel your will getting stronger.$" -d"^(You feel your will returning normal.|Your Unpain spell dissipates|You feel your will getting normal.|You suffer an acute health change)" +/prcreate -i"unstun" -n"Unstun" -l"Unstun" -n /prcreate -i"bot" -n"BoT" -l"Blessing of Tarmalen" -u"You feel strong - like you could carry whole flat world on your back!" -d"You feel weaker." /prcreate -i"lifelnk" -n"LifeLnk" -l"Life Link" -r -k -u"^You feel somehow linked to ([A-Z][a-z]+)!$" -d"^You hear a loud snap like sound!$"