Mercurial > hg > batmud > ggrtf
view ggrtf-misc.tf @ 644:e63f283f610e
Lite 'train'/'study' output so that skills/spells you can afford currently are lited green.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 25 Jun 2007 20:35:49 +0000 |
parents | 09808d5e006f |
children | fcaf1254d25f |
line wrap: on
line source
;; ;; GgrTF::Misc - Additional macros/triggers (some modules require this) ;; (C) Copyright 2004-2007 Matti Hämäläinen (Ggr) ;; ;; This file (triggerset) is Free Software distributed under ;; GNU General Public License version 2. ;; ;; NOTICE! This file requires GgrTF (version 0.6.0 or later) to be loaded. ;; /loaded GgrTF:Misc /require map.tf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Bindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /if (opt_bindings=~"on")\ /prdefgbind -s"cere" -c"/ceremony" -n%;\ /prdefsbind -s"fire" -c"Fire Building" -n%;\ /endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Initialization and options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /prdeftoggle -n"rmisc" -d"Miscellaneous reporting" /set opt_rmisc=on /prdeftoggle -n"rcda" -d"Combat Damage Analysis reporting" /set opt_rcda=on ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Consider reporting ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i -mregexp -t"^You take a close look at (.*) in comparison to yourself\.$" gconsider_rep0 =\ /set cons_st=on%;/set cons_pr=%;/set cons_exp=%;/set cons_opp=%;/set cons_name=%{P1} /def -i -ag -mregexp -t"^You would get (.*) experience for" gconsider_rep1 =\ /set cons_exp=%{P1} /def -i -ag -mregexp -t"^[A-Za-z<> ,.'-]+ has ([a-z ]+) skin\.$" gconsider_rep2 =\ /set cons_pr=%{P1}%;\ /if ({P1}=~"a soft") /set cons_pr=none%;\ /elseif ({P1}=~"somewhat hardened") /set cons_pr=some%;\ /endif /def -i -ag -mregexp -t"^The final estimation is that (.*)" gconsider_final =\ /if (cons_st=~"on") \ /let cons_val=%{P1}%;\ /if (regmatch("doesn't look", cons_val)) /set cons_opp=dlvd%;\ /elseif (regmatch("fair opponent", cons_val)) /set cons_opp=fair%;\ /elseif (regmatch("nearly equal", cons_val)) /set cons_opp=equal%;\ /elseif (regmatch("quite skilled", cons_val)) /set cons_opp=skilled%;\ /elseif (regmatch("much stronger", cons_val)) /set cons_opp=much stronger%;\ /elseif (regmatch("has such bulging", cons_val)) /set cons_opp=DANGEROUS%;\ /endif%;\ /if (cons_exp!~"") /let qtmps=%{cons_exp} exp%;/else /let qtmps=%;/endif%;\ /if (cons_opp!~"")\ /if (qtmps!~"")\ /let qtmps=%{qtmps}, %{cons_opp}%;\ /else \ /let qtmps=%{cons_opp}%;\ /endif%;\ /endif%;\ /if (cons_pr!~"") /let qtmps=%{qtmps} (%{cons_pr} PR)%;/endif%;\ /msr [$[substr(cons_name,0,15)]]: %{qtmps}%;\ /endif%;\ /set cons_st=off ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Combat damage analysis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i gcda_report =\ /if (opt_rcda=~"on")\ /msr [%{1}]: %{2} resist against %{3}%;\ /else \ /msq [@{Cgreen}%{1}@{n}]: @{BCcyan}%{2}@{n} resist against @{BCyellow}%{3}@{n}%;\ /endif /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) is defenseless against ([a-zA-Z]+) damage\.$" cda_resist0 =\ /test gcda_report({P1},0,{P2}) /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems to be almost defenseless against ([a-zA-Z]+) damage\.$" cda_resist20 =\ /test gcda_report({P1},20,{P2}) /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) has some resistance against ([a-zA-Z]+) damage\.$" cda_resist40 =\ /test gcda_report({P1},40,{P2}) /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems to be moderately resistant against ([a-zA-Z]+) damage." cda_resist60 =\ /test gcda_report({P1},60,{P2}) /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) has good resistance against ([a-zA-Z]+) damage\.$" cda_resist80 =\ /test gcda_report({P1},80,{P2}) /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems almost immune against ([a-zA-Z]+) damage\.$" cda_resist100 =\ /test gcda_report({P1},100,{P2}) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Some special hilites and miscellaneous ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i msm = /if (opt_rmisc=~"on") /msr %*%;/endif ;; Highlite plants and mineral deposits /def -i -F -p9999 -aCgreen -mregexp -t"(plant stands|plant lies|growing|grows here|is starting to grow|tree stands|bush is here|oak tree)" glite_plant1 /def -i -F -p9999 -aCyellow -mregexp -t"in the ground" glite_mineral1 ;; Highlite open containers, doors etc. /def -i -F -p9999 -P2BCred -mregexp -t" (safe|chest|crate|vault|box|closet|money-box).* (\(open\))" glite_open /def -i -F -p9999 -P2BCgreen -mregexp -t" (safe|chest|crate|vault|box|closet|money-box).* (\(closed\))" glite_closed ;; Lite skills/spells you can train with current exp /def -i -F -p9999 -mregexp -t"^\| ([A-Z][A-Za-z ]+) +\| +([0-9]+) \| +([0-9]+) \| +([0-9]+) \| +([0-9]+) \|$" glite_trainexp =\ /if ({P5} <= status_qexp)\ /let _tcs=Cgreen%;\ /else \ /let _tcs=n%;\ /endif%;\ /substitute -p | @{%{_tcs}}%{P1}@{n} | @{%{_tcs}}$[pad({P2},3)]@{n} | @{%{_tcs}}$[pad({P3},3)]@{n} | @{%{_tcs}}$[pad({P4},3)]@{n} | @{%{_tcs}}$[pad({P5},8)]@{n} | ;; Ambush /set ambush_t=0 /def -i -p9999 -aCred -msimple -t"You cannot leave, you have been AMBUSHED." gmisc_ambush1 =\ /if (time()-ambush_t > 5)\ /set ambush_t=$[time()]%;\ /msm AMBUSHED!%;\ /endif ;; Gained percentage in skill /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." gmisc_fdweak =\ /msm Disc falling! /def -i -p9999 -msimple -t"You reload magical energy to the disc that is floating in the air." gmisc_fdreload =\ /msm Disc reloaded. ;; Party leadership /def -i -F -p9999 -aCred -msimple -t"You are the new leader of the party." gmisc_pleader =\ @@party forcefollow all%;/msm Leading! ;; Poison removed /def -i -F -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.$" 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.$" 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 -F -p9999 -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 -F -p9999 -aCred -mregexp -t"^Robin Hood arrives from " gmisc_robin1 =\ /msq @{BCwhite}*@{n} @{BCgreen}---@{n} @{BCred}ROBIN HOOD EVENT!@{n} @{BCgreen}---@{n} @{BCwhite}*@{n} ;; Warn about invis tells and emotes /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 " gmisc_invemote =\ /if (opt_rmisc=~"on" & prot_invis > 0)\ /gwarning You are using 'emote' while INVISIBLE!%;\ /endif ;; Etc /prdeffail -k -f -t"You fail to start the fire." /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|successfully resist the) ([a-z ]+)\.$" gmisc_curseres =\ /msm Resisted %{P2}! ;; Resist poison /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." 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." gmisc_alleye =\ /gwarning @{BCwhite}All-seeing eye@{n} detected! ;; Banishment /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:" gmisc_banish1 =\ /msr Got banished!%;/set mbanish_st=0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Helper for money purse ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i gpurse_add =\ /if (regmatch(strcat("([0-9]+) ",{1}),gpursec_match))\ /set gpursec_total=$[gpursec_total + ({P1} * {2})]%;\ /let mptmp=@{BCwhite}$[prprettyvalstr({P1})]@{n} @{%{3}}%{1}@{n}%;\ /if (gpursec_str!~"")\ /set gpursec_str=%{gpursec_str}, %{mptmp}%;\ /else \ /set gpursec_str=%{mptmp}%;\ /endif%;\ /endif /def -i gpurse_report =\ /set gpursec_str=%;/set gpursec_total=0%;\ /test gpurse_add("mithril", 500, "BCgreen")%;\ /test gpurse_add("batium", 100, "Cgreen")%;\ /test gpurse_add("anipium", 50, "BCyellow")%;\ /test gpurse_add("platinum", 10, "Cyellow")%;\ /test gpurse_add("gold", 1, "Cwhite")%;\ /test gpurse_add("silver", 0.6, "BCcyan")%;\ /test gpurse_add("bronze", 0.4, "Ccyan")%;\ /test gpurse_add("copper", 0.2, "BCmagenta")%;\ /test gpurse_add("tin", 0.1, "Cmagenta")%;\ /test gpurse_add("zinc", 0.05, "Cred")%;\ /test gpurse_add("mowgles", 0.01, "BCred")%;\ /msw It contains %{gpursec_str} (Total: @{BCwhite}$[prprettyvalstr(gpursec_total)]@{n} in @{BCyellow}gold@{n}) /def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+) coins\.$" gpurse_rep1 =\ /set gpursec_match=%{P1}%;/gpurse_report /def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+)$" gpurse_rep2 =\ /set gpursec_st=1%;/set gpursec_match=%{P1} /def -i -ag -E(gpursec_st==1) -mregexp -t"^([a-z0-9 ,]*)coins\.$" gpurse_rep3 =\ /set gpursec_st=0%;/set gpursec_match=%{gpursec_match} %{P1}%;/gpurse_report ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Helper for reagent pouch ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i grpouch_report =\ /substitute -p @{BCyellow}$[pad({1},5)]@{n} | @{BCgreen}$[pad({6},-25)]@{n} (@{BCred}$[pad({2},4)]@{n},@{Cgreen}$[pad({3},4)]@{n},@{Cyellow}$[pad({4},4)]@{n}) @{BCgray}(%{5})@{n} /def -i grpouch_def =\ /let _tmps=$[replace(" ","_",tolower({2}))]%;\ /def -i -mregexp -t"^(One|Two|Three|Four|Five|Six|Seven|Eight|Nine|[0-9]+) (%{1}) \\(([0-9]+) power, ([0-9]+) standard, ([0-9]+) poor\\)$$" grpouch_%{_tmps} =\ /test grpouch_report({P1},{P3},{P4},{P5},{P2},"%{2}") /test grpouch_def("handfuls? of olivine powder", "Acid Blast") /test grpouch_def("stone cubes?", "Acid Shield") /test grpouch_def("pairs? of interlocked bloodstone rings", "Acid Storm") /test grpouch_def("small highsteel discs?", "Armour of Aether") /test grpouch_def("tiny leather bags? \(empty\)", "Aura of Wind") /test grpouch_def("bronze marbles?", "Blast Vacuum") /test grpouch_def("steel arrowheads?", "Cold Ray") /test grpouch_def("small pieces? of electrum wire", "Electrocution") /test grpouch_def("small glass cones?", "Flame Shield") /test grpouch_def("grey fur triangles?", "Frost Shield") /test grpouch_def("copper rods?", "Golden Arrow") /test grpouch_def("handfuls? of onyx gravel", "Hailstorm") /test grpouch_def("ebony tubes?", "Killing Cloud") /test grpouch_def("granite spheres?", "Lava Blast") /test grpouch_def("blue cobalt cups?", "Lava Storm") /test grpouch_def("small iron rods?", "Lightning Shield") /test grpouch_def("clusters? of tungsten wires", "Lightning Storm") /test grpouch_def("tiny platinum hammers?", "Magic Eruption") /test grpouch_def("quartz prisms?", "Repulsor Aura") /test grpouch_def("tiny amethyst crystals?", "Shield of Detoxification") /test grpouch_def("silvery bark chips?", "Summon Carnal Spores") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Camping / lullaby / etc. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /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 again /def -i gcamp_start =\ /set camp_st=2%;\ /gstatus_update%;\ /set camp_hp=%{status_hp}%;\ /set camp_sp=%{status_sp}%;\ /set camp_ep=%{status_ep}%;\ /set camp_time=$[time()] /def -i -p9999 -aCgreen -msimple -t"You lie down and begin to rest for a while." gcamp_start1 =\ /gcamp_start /def -i -p9999 -aCgreen -mregexp -t"^You lie down for a short rest, soothed by the lullaby sung by " gcamp_start2 =\ /gcamp_start /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%;\ @@sc%;\ /def -p1 -n1 -mregexp -t"^H:" gcamp_awake =\ /msr Awake - $$[status_hp - camp_hp]hp, $$[status_sp - camp_sp]sp, $$[status_ep - camp_ep]ep $[prgetstime(camp_time)]%%;\ /gmsg_empty_que%;\ /endif /def -i -p9999 -aCgreen -msimple -t"You wake up!" gcamp_interrupt =\ /if (camp_st == 2)\ /set camp_st=0%;\ /gstatus_update%;\ /msr Camping interrupted!%;\ /endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Ceremony ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /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." gceremony_off =\ /set ceremony_st=off /def -i ceremony =\ /if (ceremony_st=~"on")\ /msq @{BCwhite}Ceremony@{n} @{Cyellow}already in effect!@{n}%;\ /else \ @@use ceremony%;\ /endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Path compression ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; /def -i prcomptoken =\ /if ({1} > 1)\ /let _qa=%{1} %{2}%;\ /else \ /let _qa=%{2}%;\ /endif%;\ /if (qtzst=~"")\ /set qtzst=%{_qa}%;\ /else \ /set qtzst=%{qtzst};%{_qa}%;\ /endif /def -i prcomppath =\ /set qtzst=%;/let _qp=%;/let _qi=1%;/let _qc=1%;\ /while ({#})\ /if ({1}=~_qp & _qc < 15)\ /let _qc=$[_qc+1]%;\ /else \ /prcomptoken %{_qc} %{_qp}%;\ /let _qc=1%;\ /endif%;\ /let _qp=%{1}%;\ /shift%;\ /done%;\ /prcomptoken %{_qc} %{_qp} /def -i prreversepath =\ /set qtzst=%;\ /while ({#})\ /if ({1}=~"n") /let _qp=s%;\ /elseif ({1}=~"s") /let _qp=n%;\ /elseif ({1}=~"w") /let _qp=e%;\ /elseif ({1}=~"e") /let _qp=w%;\ /elseif ({1}=~"nw") /let _qp=se%;\ /elseif ({1}=~"ne") /let _qp=sw%;\ /elseif ({1}=~"sw") /let _qp=ne%;\ /elseif ({1}=~"se") /let _qp=nw%;\ /elseif ({1}=~"u") /let _qp=d%;\ /elseif ({1}=~"d") /let _qp=u%;\ /elseif ({1}=~"N") /let _qp=S%;\ /elseif ({1}=~"S") /let _qp=N%;\ /elseif ({1}=~"W") /let _qp=E%;\ /elseif ({1}=~"E") /let _qp=W%;\ /elseif ({1}=~"NW") /let _qp=SE%;\ /elseif ({1}=~"NE") /let _qp=SW%;\ /elseif ({1}=~"SW") /let _qp=NE%;\ /elseif ({1}=~"SE") /let _qp=NW%;\ /elseif ({1}=~"U") /let _qp=D%;\ /elseif ({1}=~"D") /let _qp=U%;/endif%;\ /set qtzst=%{_qp} %{qtzst}%;\ /shift%;\ /done /def comppath = /prcomppath %{path}%;/echo Compressed Path: %{qtzst} /def csavepath = /prcomppath %{path}%;@command %1 %{qtzst} /def reversepath = /prreversepath %{path}%;/echo Reversed Path: %{qtzst} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Hit stats ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; TODO: make the stats general (ggrtf-fighter.tf) or something /set hst_total=0 /set hst_misses=0 /set hst_crits=0 /set hst_crithit=0 /set lst_hits= /set lst_crits= /def -i -mregexp -t"^You score a \*?CRITICAL\*? hit!" ghitstats_crit =\ /set hst_crithit=1 /def -i -mregexp -t"^You miss" ghitstats_miss =\ /set hst_misses=$[hst_misses+1] /def -i prdefhit =\ /set lst_hits=%{lst_hits} %{1}%;\ /set lst_crits=%{lst_crits} %{1}%;\ /set hst_%{1}=0%;\ /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} " ghitstats_%{1} =\ /set hst_total=$$[hst_total+1]%%;\ /if (hst_crithit==1) \ /set hst_crithit=0%%;\ /set hst_crits=$$[hst_crits+1]%%;\ /set hst_c%{1}=$$[hst_c%{1}+1]%%;\ /else \ /set hst_%{1}=$$[hst_%{1}+1]%%;\ /endif ;; Non-weapon /prdefhit spank spank ;; Slashing weapons (axes and long blades) /prdefhit sslash solidly slash /prdefhit gash gash /prdefhit lcut lightly cut /prdefhit cut cut /prdefhit tear tear /prdefhit incise incise /prdefhit shred shred /prdefhit hshred horribly shred /prdefhit slash slash /prdefhit inccut incisively cut /prdefhit pierce pierce /prdefhit slit slit /prdefhit ctatter cruelly tatter /prdefhit rive rive /prdefhit sshave savagely shave /prdefhit cslash cruelly slash /prdefhit uslash uncontrollably slash /prdefhit qcut quickly cut /prdefhit srip savagely rip /prdefhit cbtear BRUTALLY TEAR /prdefhit csshred SAVAGELY SHRED /prdefhit ccrend CRUELLY REND /prdefhit cdismember DISMEMBER ;; Bludgeons /prdefhit jostle jostle /prdefhit butt butt /prdefhit bump bump /prdefhit thump thump /prdefhit thrust thrust /prdefhit stroke stroke /prdefhit jab jab /prdefhit bash bash /prdefhit strike strike /prdefhit sock sock /prdefhit cuff cuff /prdefhit knock knock /prdefhit flail flail /prdefhit beat beat /prdefhit whack whack /prdefhit smash smash /prdefhit cbeat cruelly beat /prdefhit bsmash badly smash /prdefhit hthrust horribly thrust /prdefhit sstrike savagely strike /prdefhit ssock savagely sock /prdefhit cccuff CRUELLY CUFF /prdefhit cbbash BARBARICALLY BASH /prdefhit crwhack REALLY WHACK /prdefhit cbbeat BRUTALLY BEAT /prdefhit ccdism CRUELLY DISMEMBER ;; Output /def -i ghitstats_print =\ /eval /set cnttmp=$$[hst_%{1}]%;\ /if (cnttmp > 0) \ /set hst_count=$[hst_count + 1]%;\ /if (hst_total > 0) \ /eval /set cnttmp=$$[trunc((cnttmp * 100) / hst_total)]%;\ /else \ /set cnttmp=0%;\ /endif%;\ /eval /msw | $$[pad(name_%{1},-30)] - $$[pad(hst_%{1},4)] / $$[pad(cnttmp,4)]%%% |%;\ /endif /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%;\ /msw ,-----------------.%;\ /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Hit Stats@{n} |%;\ /msw +-| @{BCgreen}Normal@{n} |------+-----------------------------.%;\ /ghitstats_dolist1 %{lst_hits}%;\ /msw +-| @{BCred}Critical@{n} |----------------------------------+%;\ /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)]%;\ /else \ /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 `----------------------------------------------' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Special highlights and maglings for misc. commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mangle 'slots' command's messages to more nicer layout. ;; FIXME: ;; What if torso is not the last slot listed? How to elegantly print ;; the bottom of the table. /def -i -ag -p9999 -msimple -t"Your current armour status is:" gslots_mangle1 =\ /set slots_st=1%;\ /set slots_ftotal=0%;\ /msw ,--------------------.%;\ /msw | Free | Slot |%;\ /msw +-------+------------+ /def -i -E(slots_st==1) -ag -p9999 -mregexp -t"^ You have (.*) free ([a-z]*) slots?\.$" gslots_mangle2 =\ /let _tslot=%{P2}%;\ /if ({P1}=~"no") /let _tnum=0%;\ /elseif ({P1}=~"one") /let _tnum=1%;\ /elseif ({P1}=~"two") /let _tnum=2%;\ /elseif ({P1}=~"three") /let _tnum=3%;\ /elseif ({P1}=~"four") /let _tnum=4%;\ /elseif ({P1}=~"five") /let _tnum=5%;\ /else /let _tnum=-1%;\ /endif%;\ /if (_tnum < 0)\ /let _tcol=Cyellow%;/let _tnum=%{P1}%;\ /elseif (_tnum > 0)\ /set slots_ftotal=$[slots_ftotal+_tnum]%;\ /if (_tnum > 1)\ /let _tcol=BCgreen%;\ /else \ /let _tcol=Cgreen%;\ /endif%;\ /else \ /let _tcol=BCred%;\ /endif%;\ /msw | @{%{_tcol}}$[pad(_tnum,5)]@{n} | $[pad(_tslot,-10)] |%;\ /if (_tslot=~"torso")\ /set slots_st=0%;\ /msw +--------------------+%;\ /msw | Total free: @{BCgreen}$[pad(slots_ftotal,-6)]@{n} |%;\ /msw `--------------------'%;\ /endif