Mercurial > hg > batmud > ggrtf
changeset 565:cf92be66fb1e
Cosmetic code, macro and variable namespace cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 22 Nov 2006 13:09:19 +0000 |
parents | 398e0685e413 |
children | 01afb41d74b8 |
files | ggrtf-misc.tf |
diffstat | 1 files changed, 59 insertions(+), 55 deletions(-) [+] |
line wrap: on
line diff
--- a/ggrtf-misc.tf Wed Nov 22 12:12:20 2006 +0000 +++ b/ggrtf-misc.tf Wed Nov 22 13:09:19 2006 +0000 @@ -108,93 +108,93 @@ ;; Highlite open containers, doors etc. /def -i -F -p9999 -P2BCred -mregexp -t" (safe|chest|crate|vault|box|closet).* (\(open\))" glite_open -/def -i -F -p9999 -P2BCgreen -mregexp -t" (safe|chest|crate|vault|box|closet).* (\(closed\))" lite_closed +/def -i -F -p9999 -P2BCgreen -mregexp -t" (safe|chest|crate|vault|box|closet).* (\(closed\))" glite_closed ;; Gained percentage in skill -/def -i -p9999 -aCgreen -mregexp -t"^You feel like you just got slightly better in (.*)$" misc_improved =\ +/def -i -p9999 -aCgreen -mregexp -t"^You feel like you just got slightly better in (.*)$" gmisc_improved =\ /mse improved in %{P1} ;; Floating disc -/def -i -p9999 -msimple -t"Your disc wavers dangerously." misc_fdweak =\ +/def -i -p9999 -msimple -t"Your disc wavers dangerously." gmisc_fdweak =\ /msm Disc falling! -/def -i -p9999 -msimple -t"You reload magical energy to the disc that is floating in the air." misc_fdreload =\ +/def -i -p9999 -msimple -t"You reload magical energy to the disc that is floating in the air." gmisc_fdreload =\ /msm Disc reloaded. ;; Ambush -/def -i -p9999 -aCred -msimple -t"You cannot leave, you have been AMBUSHED." misc_ambush1 =\ +/def -i -p9999 -aCred -msimple -t"You cannot leave, you have been AMBUSHED." gmisc_ambush1 =\ /msm AMBUSHED! ;; Poison removed -/def -i -p9999 -aCred -msimple -t"You feel the poison leaving your veins!" misc_poisonrem =\ +/def -i -p9999 -aCred -msimple -t"You feel the poison leaving your veins!" gmisc_poisonrm =\ /msm Poison removed! ;; Uncon -/def -i -p9999 -ag -mregexp -t"^([A-Z][A-Za-z]+) lapses into unconsciousness from severe loss of blood.$" misc_uncon =\ +/def -i -p9999 -ag -mregexp -t"^([A-Z][A-Za-z]+) lapses into unconsciousness from severe loss of blood.$" gmisc_uncon =\ /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} is @{BCgreen}UNCON@{n} @{BCred}!!!@{n}%;\ /msm %{P1} is UNCON! ;; Warn about changes in party formation -/def -i -p9999 -ag -mregexp -t"^([A-Z][a-z]+) is now in the 1st row.$" misc_firstrow =\ +/def -i -p9999 -ag -mregexp -t"^([A-Z][a-z]+) is now in the 1st row.$" gmisc_firstrow =\ /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} @{BCyellow}is now in 1st row@{n} @{BCred}!!!@{n}%;\ /if ({P1}=~set_plrname) /msm %{P1} is now in 1st row!%;/endif ;; Multicolored Demons (event) -/def -i -aCred -msimple -t"A Nasty Multicolored Demon arrives with puff of red smoke." misc_mcdemon =\ +/def -i -aCred -msimple -t"A Nasty Multicolored Demon arrives with puff of red smoke." gmisc_mcdemon =\ /msq @{BCwhite}*@{n} @{BCgreen}---@{n} @{BCred}MC DEMONS EVENT!@{n} @{BCgreen}---@{n} @{BCwhite}*@{n} ;; Robin Hood ; Robin Hood took Ring of the Medusa labeled as (Ggr) <red glow> from Ggr. -/def -i -aCred -mregexp -t"^Robin Hood arrives from " misc_robin1 =\ +/def -i -aCred -mregexp -t"^Robin Hood arrives from " gmisc_robin1 =\ /msq @{BCwhite}*@{n} @{BCgreen}---@{n} @{BCred}ROBIN HOOD EVENT!@{n} @{BCgreen}---@{n} @{BCwhite}*@{n} -/def -i -aCred -mregexp -t"^Robin Hood took (.+) from ([A-Z][a-z]+)\.$" misc_robin2 =\ +/def -i -aCred -mregexp -t"^Robin Hood took (.+) from ([A-Z][a-z]+)\.$" gmisc_robin2 =\ /msr Robin Hood stole %{P1} from %{P2}!!! ;; Warn about invis tells and emotes -/def -i -p9999 -aCgreen -mregexp -t"^You tell ([^']*)" misc_invtell =\ +/def -i -p9999 -aCgreen -mregexp -t"^You tell ([^']*)" gmisc_invtell =\ /if (opt_rmisc=~"on" & prot_invis > 0 & !regmatch("(monster)", {P1}))\ /gwarning You are using 'tell' while INVISIBLE!%;\ /endif -/def -i -p9999 -aCgreen -mregexp -t"^You emote to " misc_invemote =\ +/def -i -p9999 -aCgreen -mregexp -t"^You emote to " gmisc_invemote =\ /if (opt_rmisc=~"on" & prot_invis > 0)\ /gwarning You are using 'emote' while INVISIBLE!%;\ /endif ;; Etc -/def -i -F -aCred -msimple -t"You fail to start the fire." misc_fbfail = /gskill_fail +/def -i -F -aCred -msimple -t"You fail to start the fire." gmisc_fbfail = /gskill_fail -/def -i -ag -mregexp -t"^Your ([A-Za-z ]+) gets damaged; it's now in ([a-z]+) condition.$" misc_eqdamage =\ +/def -i -ag -mregexp -t"^Your ([A-Za-z ]+) gets damaged; it's now in ([a-z]+) condition.$" gmisc_eqdamage =\ /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} @{BCyellow}got damaged!@{n} (@{BCgreen}%{P2}@{n}) @{BCred}!!!@{n}%;\ /msm NOTICE! %{P1} got damaged! (%{P2}) ;; Resist curses and drains -/def -i -p1 -aCred -mregexp -t"^You (are not affected by|successfully resist a) ([a-z ]+)\.$" misc_curseres =\ +/def -i -p1 -aCred -mregexp -t"^You (are not affected by|successfully resist a) ([a-z ]+)\.$" gmisc_curseres =\ /msm Resisted %{P2}! ;; Resist poison -/def -i -p1 -aCred -msimple -t"You SAVE against POISON." misc_poisonres =\ +/def -i -p1 -aCred -msimple -t"You SAVE against POISON." gmisc_poisonres =\ /msm Saved against poison! ;; Psi scanning warnings -/def -i -ag -msimple -t"You get the feeling that someone is looking over your shoulder." misc_mglance =\ +/def -i -ag -msimple -t"You get the feeling that someone is looking over your shoulder." gmisc_mglance =\ /gwarning @{BCwhite}Mental Glance@{n} detected! ;; All-seeing eye -/def -i -ag -msimple -t"You have a feeling that somebody is watching you." misc_alleye =\ +/def -i -ag -msimple -t"You have a feeling that somebody is watching you." gmisc_alleye =\ /gwarning @{BCwhite}All-seeing eye@{n} detected! ;; Banishment -/def -i -aBCred -mregexp -t"^You feel that (.+) doesn\'t enjoy your presence\.$" misc_banish0 =\ +/def -i -aBCred -mregexp -t"^You feel that (.+) doesn\'t enjoy your presence\.$" gmisc_banish0 =\ /set mbanish_st=1 -/def -i -ag -msimple -E(mbanish_st==1) -t"Suddenly your eyes close and when you open them you see:" misc_banish1 =\ +/def -i -ag -msimple -E(mbanish_st==1) -t"Suddenly your eyes close and when you open them you see:" gmisc_banish1 =\ /msr Got banished!%;/set mbanish_st=0 @@ -212,7 +212,7 @@ /endif%;\ /endif -/def -i misc_cpurse =\ +/def -i gmisc_cpurse =\ /set mcont_str=%;/set mcont_total=0%;\ /test prmatchadd("mithril", 500, "BCgreen")%;\ /test prmatchadd("batium", 100, "Cgreen")%;\ @@ -227,25 +227,25 @@ /test prmatchadd("mowgles", 0.01, "BCred")%;\ /msw It contains %{mcont_str} (Total: @{BCwhite}$[prprettyvalstr(mcont_total)]@{n} in @{BCyellow}gold@{n}) -/def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+) coins\.$" misc_cpurse1 =\ - /set mcont_match=%{P1}%;/misc_cpurse +/def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+) coins\.$" gmisc_cpurse1 =\ + /set mcont_match=%{P1}%;/gmisc_cpurse -/def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+)$" misc_cpurse2 =\ +/def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+)$" gmisc_cpurse2 =\ /set mcont_st=1%;/set mcont_match=%{P1} -/def -i -ag -E(mcont_st==1) -mregexp -t"^([a-z0-9 ,]*)coins\.$" misc_cpurse3 =\ - /set mcont_st=0%;/set mcont_match=%{mcont_match} %{P1}%;/misc_cpurse +/def -i -ag -E(mcont_st==1) -mregexp -t"^([a-z0-9 ,]*)coins\.$" gmisc_cpurse3 =\ + /set mcont_st=0%;/set mcont_match=%{mcont_match} %{P1}%;/gmisc_cpurse ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Camping ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -/def -i -p9999 -aCgreen -mregexp -t"^You (stretch yourself and consider about camping|feel a bit tired|feel like camping a little)" camp_ready =\ +/def -i -p9999 -aCgreen -mregexp -t"^You (stretch yourself and consider about camping|feel a bit tired|feel like camping a little)" gcamp_ready =\ /set camp_st=1%;\ /gstatus_update%;\ - /msr (can camp) + /msr Can camp again -/def -i -p9999 -aCgreen -msimple -t"You lie down and begin to rest for a while." camp_start =\ +/def -i -p9999 -aCgreen -msimple -t"You lie down and begin to rest for a while." gcamp_start =\ /set camp_st=2%;\ /gstatus_update%;\ /set camp_hp=%{status_hp}%;\ @@ -253,7 +253,7 @@ /set camp_ep=%{status_ep}%;\ /set camp_time=$[time()] -/def -i -p9999 -aCgreen -msimple -t"You awaken from your short rest, and feel slightly better." camp_end =\ +/def -i -p9999 -aCgreen -msimple -t"You awaken from your short rest, and feel slightly better." gcamp_end =\ /if (camp_st == 2) \ /set camp_st=0%;\ /gstatus_update%;\ @@ -262,7 +262,7 @@ /msr Awake - $$[status_hp - camp_hp]hp, $$[status_sp - camp_sp]sp, $$[status_ep - camp_ep]ep $[prgetstime(camp_time)]%;\ /endif -/def -i -p9999 -aCgreen -msimple -t"You wake up!" camp_interrupt =\ +/def -i -p9999 -aCgreen -msimple -t"You wake up!" gcamp_interrupt =\ /if (camp_st == 2) \ /set camp_st=0%;\ /gstatus_update%;\ @@ -273,13 +273,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Ceremony ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -/def -i -p9999 -msimple -t"You perform the ceremony." ceremony_on =\ +/def -i -p9999 -msimple -t"You perform the ceremony." gceremony_on =\ /if (skill_st2=~"on")\ /set skill_st2=off%;\ /set ceremony_st=on%;\ /endif -/def -i -p9999 -ag -msimple -t"You have an unusual feeling as you cast the spell." ceremony_off =\ +/def -i -p9999 -ag -msimple -t"You have an unusual feeling as you cast the spell." gceremony_off =\ /set ceremony_st=off /def -i ceremony =\ @@ -362,10 +362,10 @@ /set lst_hits= /set lst_crits= -/def -i -mregexp -t"^You score a \*?CRITICAL\*? hit!" hstats_crit =\ +/def -i -mregexp -t"^You score a \*?CRITICAL\*? hit!" ghitstats_crit =\ /set hst_crithit=1 -/def -i -mregexp -t"^You miss" hstats_miss =\ +/def -i -mregexp -t"^You miss" ghitstats_miss =\ /set hst_misses=$[hst_misses+1] /def -i prdefhit =\ @@ -375,7 +375,7 @@ /set hst_c%{1}=0%;\ /set name_%{1}=%{-1}%;\ /set name_c%{1}=%{-1}%;\ - /def -i -F -mregexp -t"^(You|(Cackling|Smiling|Grinning) (demonically|devilishly|diabolically) you) %{-1} " hstats_%{1} =\ + /def -i -F -mregexp -t"^(You|(Cackling|Smiling|Grinning) (demonically|devilishly|diabolically) you) %{-1} " ghitstats_%{1} =\ /set hst_total=$$[hst_total+1]%%;\ /if (hst_crithit==1) \ /set hst_crithit=0%%;\ @@ -445,7 +445,7 @@ ;; Output -/def -i hstats_print =\ +/def -i ghitstats_print =\ /eval /set cnttmp=$$[hst_%{1}]%;\ /if (cnttmp > 0) \ /set hst_count=$[hst_count + 1]%;\ @@ -457,29 +457,30 @@ /eval /msw | $$[pad(name_%{1},-30)] - $$[pad(hst_%{1},4)] / $$[pad(cnttmp,4)]%%% |%;\ /endif -/def -i hstats_dolist1 = /while ({#}) /hstats_print %{1}%;/shift%;/done -/def -i hstats_dolist2 = /while ({#}) /hstats_print c%{1}%;/shift%;/done +/def -i ghitstats_dolist1 = /while ({#}) /ghitstats_print %{1}%;/shift%;/done +/def -i ghitstats_dolist2 = /while ({#}) /ghitstats_print c%{1}%;/shift%;/done -/def -i hstats = /set hst_count=0%;\ +/def -i hstats =\ +/set hst_count=0%;\ /msw ,-----------------.%;\ /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Hit Stats@{n} |%;\ /msw +-| @{BCgreen}Normal@{n} |------+-----------------------------.%;\ -/hstats_dolist1 %{lst_hits}%;\ +/ghitstats_dolist1 %{lst_hits}%;\ /msw +-| @{BCred}Critical@{n} |----------------------------------+%;\ -/hstats_dolist2 %{lst_crits}%;\ +/ghitstats_dolist2 %{lst_crits}%;\ /msw +-----------------------------------------------'%;\ -/let qtmp=$[hst_total + hst_misses]%;\ -/if (qtmp != 0) \ - /let qtmp1=$[trunc((100 * hst_total) / qtmp)]%;\ - /let qtmp2=$[trunc((100 * hst_misses) / qtmp)]%;\ - /let qtmp3=$[trunc((100 * hst_crits) / qtmp)]%;\ +/let _qtmp=$[hst_total + hst_misses]%;\ +/if (_qtmp != 0) \ + /let _qtmp1=$[trunc((100 * hst_total) / _qtmp)]%;\ + /let _qtmp2=$[trunc((100 * hst_misses) / _qtmp)]%;\ + /let _qtmp3=$[trunc((100 * hst_crits) / _qtmp)]%;\ /else \ - /let qtmp1=0%;\ - /let qtmp2=0%;\ - /let qtmp3=0%;\ + /let _qtmp1=0%;\ + /let _qtmp2=0%;\ + /let _qtmp3=0%;\ /endif%;\ -/msw | Hits..: @{Cgreen}$[pad(hst_total,-6)]@{n} (@{BCgreen}$[pad(qtmp1,3)]\%@{n}) | Crits: @{Cred}$[pad(hst_crits,-6)]@{n} (@{BCred}$[pad(qtmp3,3)]\%@{n}) |%;\ -/msw | Misses: @{Cyellow}$[pad(hst_misses,-6)]@{n} (@{BCyellow}$[pad(qtmp2,3)]\%@{n}) | Total Hit Types: @{BCwhite}$[pad(hst_count,-3)]@{n} |%;\ +/msw | Hits..: @{Cgreen}$[pad(hst_total,-6)]@{n} (@{BCgreen}$[pad(_qtmp1,3)]\%@{n}) | Crits: @{Cred}$[pad(hst_crits,-6)]@{n} (@{BCred}$[pad(_qtmp3,3)]\%@{n}) |%;\ +/msw | Misses: @{Cyellow}$[pad(hst_misses,-6)]@{n} (@{BCyellow}$[pad(_qtmp2,3)]\%@{n}) | Total Hit Types: @{BCwhite}$[pad(hst_count,-3)]@{n} |%;\ /msw `----------------------------------------------' @@ -509,7 +510,8 @@ /elseif ({P1}=~"five") /let _tnum=5%;\ /else /let _tnum=-1%;\ /endif%;\ - /if (_tnum < 0) /let _tcol=Cyellow%;/let _tnum=%{P1}%;\ + /if (_tnum < 0)\ + /let _tcol=Cyellow%;/let _tnum=%{P1}%;\ /elseif (_tnum > 0)\ /set slots_ftotal=$[slots_ftotal+_tnum]%;\ /if (_tnum > 1)\ @@ -517,7 +519,9 @@ /else \ /let _tcol=Cgreen%;\ /endif%;\ - /else /let _tcol=BCred%;/endif%;\ + /else \ + /let _tcol=BCred%;\ + /endif%;\ /msw | @{%{_tcol}}$[pad(_tnum,5)]@{n} | $[pad(_tslot,-10)] |%;\ /if (_tslot=~"torso")\ /set slots_st=0%;\