Mercurial > hg > batmud > ggrtf
changeset 564:398e0685e413
Cleaned up slots-mangler code, added improved colouring and total free slot count.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 22 Nov 2006 12:12:20 +0000 |
parents | 217cc3131d61 |
children | cf92be66fb1e |
files | ggrtf-misc.tf |
diffstat | 1 files changed, 33 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/ggrtf-misc.tf Wed Nov 22 10:49:43 2006 +0000 +++ b/ggrtf-misc.tf Wed Nov 22 12:12:20 2006 +0000 @@ -103,13 +103,14 @@ /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)" lite_plant1 -/def -i -F -p9999 -aCyellow -mregexp -t"in the ground" lite_mineral1 +/def -i -F -p9999 -P1Cgreen -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 -P0Cyellow -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).* (\(open\))" lite_open +/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 + ;; Gained percentage in skill /def -i -p9999 -aCgreen -mregexp -t"^You feel like you just got slightly better in (.*)$" misc_improved =\ /mse improved in %{P1} @@ -492,22 +493,36 @@ ;; the bottom of the table. /def -i -ag -p9999 -msimple -t"Your current armour status is:" gslots_mangle1 =\ - /msw ,-----------------.%;\ - /msw | Free | Slot |%;\ - /msw +------+----------+ + /set slots_st=1%;\ + /set slots_ftotal=0%;\ + /msw ,--------------------.%;\ + /msw | Free | Slot |%;\ + /msw +-------+------------+ -/def -i -ag -p9999 -mregexp -t"^ You have (no|one|two|three|four) free ([a-z]*) slots?\.$" gslots_mangle2 =\ - /if ({P1} =/ "no") /let num 0%;\ - /elseif ({P1} =/ "one") /let num 1%;\ - /elseif ({P1} =/ "two") /let num 2%;\ - /elseif ({P1} =/ "three") /let num 3%;\ - /elseif ({P1} =/ "four") /let num 4%;\ - /else /let num -1%;\ +/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%;\ - /let slots %{P2}%;\ - /if (num <= 0) /msw | @{BCred}$[pad(num,3)]@{n} | $[pad({P2},-8)] |%;\ - /else /msw | @{Cgreen}$[pad(num,3)]@{n} | $[pad({P2},-8)] |%;\ - /endif%;\ - /if (slots =/ "torso") /msw `-----------------'%;\ + /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