changeset 381:6af6df52fefd

v0.5.11.2: Removed tick predictor, it wasn't working anyway; Removed -k option from prot defination macro, it was useless and just added to the code convolution mess.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 10 Apr 2006 00:10:07 +0000
parents b681dd8c4d41
children 3d296ec5a02a
files docs/manual.sgml ggrtf-druid.tf ggrtf-temp.tf ggrtf.tf
diffstat 4 files changed, 20 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/docs/manual.sgml	Wed Apr 05 00:09:02 2006 +0000
+++ b/docs/manual.sgml	Mon Apr 10 00:10:07 2006 +0000
@@ -1063,15 +1063,6 @@
 
 <!-- ================================================ -->
 
-<section id="usage-general-tickpred"><title>Tick predictor</title>
-<para>
-The tick-predictor is currently broken and unsupported. It will
-be either fixed or completely removed before release of 0.6.0.
-</para>
-</section>
-
-<!-- ================================================ -->
-
 <section id="usage-misc"><title>Miscellaneous stuff (ggrtf-misc.tf)</title>
 <para>
 In the beginning of GgrTF's development, many features now residing
@@ -1963,7 +1954,6 @@
 
  <listitem><para>There may still be some unnoticed incompabilities with TF5.</para></listitem>
 
- <listitem><para>The tick-predictor does not work correctly. Please don't ask.</para></listitem>
 <!--
  <listitem><para></para></listitem>
 -->
@@ -2014,6 +2004,7 @@
      </answer>
   </qandaentry>
 
+
   <qandaentry>
      <question>
        <para>My statusline is not updating, why?</para>
--- a/ggrtf-druid.tf	Wed Apr 05 00:09:02 2006 +0000
+++ b/ggrtf-druid.tf	Mon Apr 10 00:10:07 2006 +0000
@@ -22,7 +22,8 @@
 	/prdefcbind -s"sl"	-c"Star Light"		-q%;\
 	/prdefcbind -s"gf"	-c"Gem Fire"		-q%;\
 	/prdefcbind -s"inquiry"	-c"Inquiry to Ahm"%;\
-	/prdefcbind -s"flex"	-c"Flex Shield"%;\
+	/prdefcbind -s"cflex"	-c"Flex Shield"%;\
+	/prdefcbind -s"wdl"	-c"Wilderness Location"%;\
 /endif
 
 
--- a/ggrtf-temp.tf	Wed Apr 05 00:09:02 2006 +0000
+++ b/ggrtf-temp.tf	Mon Apr 10 00:10:07 2006 +0000
@@ -19,16 +19,23 @@
 /def -i -b'^[w' = /prcast cure serious wounds
 /def -i -b'^[e' = /prcast cure critical wounds
 /def -i -b'^[r' = /prcast major heal
-/def -i -b'^[g' = /prcast deaths door
 
+/def -i -b'^[z' = /prcast deaths door
+/def -i -b'^[x' = /prcast unstun
+/def -i -b'^[c' = /prcast unpain
+/def -i -b'^[v' = /prcast unpain
 /def -i -b'^[f' = @css
 
-/def -i -b'^[Op' = /pstatus
+/def key_nkp- = @smode
+/def key_nkp+ = @cmode
+/def key_nkp/ = /if (cast_target!~"") @@tweak %{cast_target}%;/endif
+/def key_nkp0 = /pstatus
 
 
 /def -i prcast =\
 	/if (cast_target!~"") @@cast '%{*}' %{cast_target}%;/endif
 
+
 /def -i prmove =\
 	/if	({1}=~"nw")	/let t=1_1%;\
 	/elseif ({1}=~"n")	/let t=1_2%;\
--- a/ggrtf.tf	Wed Apr 05 00:09:02 2006 +0000
+++ b/ggrtf.tf	Mon Apr 10 00:10:07 2006 +0000
@@ -1,8 +1,8 @@
 ;;
-;; GgrTF v0.5.11.0-svn - TinyFugue script for BatMUD
+;; GgrTF v0.5.11.2-svn - TinyFugue script for BatMUD
 ;; (C) Copyright 2004-2006 Matti Hämäläinen (Ggr Pupunen)
 ;;
-/set ggrtf_ver=0.5.11.0-svn
+/set ggrtf_ver=0.5.11.2-svn
 ;;
 ;; This triggerset is Free Software distributed under
 ;; GNU General Public License version 2.
@@ -69,10 +69,6 @@
 	/set set_round=@scan all%;\
 	/set set_ripcommand=@whee%;\
 	/set set_peer=embedded%;\
-	/set opt_tickpred=off%;\
-	/set opt_tickst=off%;\
-	/set set_tickmin=25%;\
-	/set set_tickwarn=5%;\
 	/set set_roundmin=2%;\
 	/set set_sysinit=1%;\
 	/msq System variables initialized.
@@ -589,10 +585,6 @@
 /msw | Cast time.....: $[pad(_qs5,-50)] |%;\
 /msw | Skill time....: $[pad(_qs6,-50)] |%;\
 /msw | Damcrits......: $[pad(_qs3,-50)] |%;\
-/if (opt_tickpred=~"on")\
-/let _qs7=Freq: $[prround(tick_k,2)]s, [H:$[prround(tick_hp_avg,2)]] [S:$[prround(tick_sp_avg,2)]] [E:$[prround(tick_ep_avg,2)]]%;\
-/msw | Ticks.........: $[pad(_qs7,-50)] |%;\
-/endif%;\
 /msw `--------------------------------------------------------------------'
 
 
@@ -774,15 +766,6 @@
 	/elseif (camp_st == 2) /let qtcolor4=BCred%;\
 	/else /let qtcolor4=BCyellow%;/endif%;\
 	/set status_pstr=%{status_pstr} "[" "%{prmove_last}":2:BCgreen "C":1:%{qtcolor1} "S":1:%{qtcolor3} "K":1:%{qtcolor2} "c":1:%{qtcolor4} "]"%;\
-	/if (opt_tickpred=~"on" & opt_tickst=~"on")\
-		/if (tick_st3)\
-			/let qtmps=$[trunc(tick_t+tick_k-time())]%;\
-		/else \
-			/let qtmps=%;\
-		/endif%;\
-		/set status_pstr=%{status_pstr} "[" "$[pad(qtmps,3)]":3:BCyellow "]"%;\
-		/set status_w=$[status_w+8]%;\
-	/endif%;\
 	/gstatus_add_aura%;\
 	/let qtmpw=$[columns() - status_w]%;\
 	/if (qtmpw > 3) /set status_pstr=%{status_pstr} :1 "%{str_prots2}":%{qtmpw}:Cgreen%;/endif%;\
@@ -790,114 +773,6 @@
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Tick prediction and status/sc/prompt grabbing triggers
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Reset tick-predictor
-/def -i prtick_reset =\
-	/set tick_st=0%;\
-	/set tick_st2=0%;\
-	/set tick_st3=0%;\
-	/set tick_ignore=0%;\
-	/set tick_t=$[time()]%;\
-	/set tick_n=1%;\
-	/set tick_k=30%;\
-	/set tick_hp_avg=0%;\
-	/set tick_sp_avg=0%;\
-	/set tick_ep_avg=0%;\
-	/if (tick_pid > 0) /kill %{tick_pid}%;/endif%;\
-	/set tick_pid=$[repeat("-1 1 /prtick_tick")]%;\
-	/if (tick_pid=~"" | tick_pid <= 0)\
-		/gerror Tick predictor initialization failed!%;\
-	/else \
-		/gwarning Tick predictor reset! @{BCyellow}Some ticks required for re-calibration!@{n}%;\
-	/endif
-
-/prtick_reset
-
-;; Ignore ticks that come from heals/crystals/fires/etc
-/def -i -mregexp -t"^([A-Z][a-z]+'s spell makes you feel little better|You heal a few of your wounds|You feel like [A-Z][a-z]+ healed you a bit|The fire's warmth soothe?s you|The crystal throbs faintly, healing some of your wounds|The sphere pulses softly; your mind and body feel more relaxed).$" prtick_filter =\
-	/set tick_ignore=1
-
-;; Tick update function
-/def -i prtick_tick =\
-	/set tick_pid=$[repeat("-1 1 /prtick_tick")]%;\
-	/if (opt_tickpred=~"on")\
-		/prtick_reinit%;\
-		/let _tt=$[tick_t+tick_k-time()]%;\
-		/if ((status_hpmax-status_hp == 0) & (status_spmax-status_sp == 0) & (status_epmax-status_ep == 0))\
-			/set tick_st=0%;\
-		/endif%;\
-		/if (set_tickwarn > 0 & tick_st2)\
-			/if (_tt > 0 & _tt < set_tickwarn)\
-				/msq @{BCgreen} ---- Tick in $[prround(_tt,2)]s ---- @{n}%;\
-				/set tick_st2=0%;\
-			/endif%;\
-		/endif%;\
-		/if (tick_st3 & opt_tickst=~"on")\
-			/if (_tt < -10) /set tick_st3=0%;/endif%;\
-			/gstatus_update%;\
-		/endif%;\
-	/endif
-	
-;; Tick-predictor main function
-;;				/msq @{BCyellow}Tick-predictor miss $[trunc(_tm)]s, adjusting to $[trunc(tick_k)].@{n}%;\
-/def -i prtick_pred =\
-/if (opt_tickpred=~"on")\
-	/let _thp=$[{1}-status_hp]%;\
-	/let _tsp=$[{2}-status_sp]%;\
-	/let _tep=$[{3}-status_ep]%;\
-	/if (_thp > 0 | _tsp > 0 | _tep > 0)\
-		/if (tick_ignore) /set tick_ignore=0%;/break%;/endif%;\
-		/let _tt=$[time()]%;\
-		/if (tick_st)\
-			/let _td=$[_tt-tick_t]%;\
-		/else \
-			/let _td=%{set_tickmin}%;\
-		/endif%;\
-		/if (_td >= set_tickmin | tick_n < 2)\
-			/let _tm=$[tick_t+tick_k-_tt]%;\
-			/set tick_st=1%;\
-			/set tick_n=$[tick_n+1]%;\
-			/set tick_t=$[time()]%;\
-			/if (_tm < -1 | _tm > 1)\
-				/msq _td=%{_td}, _tm=%{_tm}%;\
-				/if (_td > _tm | _td < (-_tm))\
-					/set tick_k=%{_td}%;\
-				/else \
-					/set tick_k=%{set_tickmin}%;\
-				/endif%;\
-				/break%;\
-			/endif%;\
-			/set tick_st2=1%;\
-			/set tick_st3=1%;\
-			/set tick_k=$[(tick_k + (_td*3.0)) / 4.0]%;\
-			/set tick_hp_avg=$[(tick_hp_avg + (_thp*3.0)) / 4.0]%;\
-			/set tick_sp_avg=$[(tick_sp_avg + (_tsp*3.0)) / 4.0]%;\
-			/set tick_ep_avg=$[(tick_ep_avg + (_tep*3.0)) / 4.0]%;\
-			/if (_thp != 0) /let _mhp=$[(status_hpmax-{1}+0.0) / tick_hp_avg]%;/else /let _mhp=0.0%;/endif%;\
-			/if (_tsp != 0) /let _msp=$[(status_spmax-{2}+0.0) / tick_sp_avg]%;/else /let _msp=0.0%;/endif%;\
-			/if (_tep != 0) /let _mep=$[(status_epmax-{3}+0.0) / tick_ep_avg]%;/else /let _mep=0.0%;/endif%;\
-			/if (opt_predmax=~"on")\
-				/msq Max in @{BCyellow}$[prround(_mhp,2)]@{n}(HP), @{BCgreen}$[prround(_msp,2)]@{n}(SP), @{BCcyan}$[prround(_mep,2)]@{n}(EP) ticks.%;\
-			/endif%;\
-		/else \
-			/set tick_st=0%;\
-			/gstatus_update%;\
-		/endif%;\
-	/else \
-		/set tick_st=0%;/set tick_st2=0%;/set tick_st3=0%;\
-	/endif%;\
-/endif
-
-;; Initialize
-/prdeftoggle -n"predmax" -d"Predict max hp/sp/ep in ticks"
-/prdeftoggle -n"tickst" -d"Show tick timer in statusline"
-/prdeftoggle -n"tickpred" -d"Tick prediction"
-/prdefvalue -n"tickwarn" -d"Tick prediction alert resolution (seconds)"
-/prdefvalue -n"tickmin" -d"Minimum tick-time (seconds), adjust for FM"
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Status short score/prompt grabbing triggers
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 /def -i prgetdiff =\
@@ -910,7 +785,6 @@
 	/return "@{$[prgetnlite({1},{2})]}%{1}@{n}/%{2} $[prgetdiff({1},{3})]"
 
 /def -i gstatus_scupd =\
-	/test prtick_pred({1},{3},{5})%;\
 	/set status_qhp=%{1}%;/set status_hp=%{1}%;/set status_hpmax=%{2}%;\
 	/set status_qsp=%{3}%;/set status_sp=%{3}%;/set status_spmax=%{4}%;\
 	/set status_qep=%{5}%;/set status_ep=%{5}%;/set status_epmax=%{6}%;\
@@ -1004,12 +878,11 @@
 ; -r Use regexp instead of simple matching
 ; -s Stackable prot
 ; -h Renewable prot (does not stack, but can be renewed)
-; -k Takes parameters (implies usage of regexp patterns aka '-r')
 ; -p Conjurer minor typeprot (options -u, -s, -r are meaningless)
 ; -P Conjurer major typeprot
 ; -q Don't give error on proff if prot is not up
 /def -i prdefprot =\
-	/if (!getopts("i:n:l:A:B:C:u:d:srkhpPq", "")) /gerror Invalid prot creation command!%;/break%;/endif%;\
+	/if (!getopts("i:n:l:A:B:C:u:d:srhpPq", "")) /gerror Invalid prot creation command!%;/break%;/endif%;\
 	/set lst_prots=%{opt_i} %{lst_prots}%;\
 	/set prot_%{opt_i}=0%;\
 	/set prot_%{opt_i}_t=-1%;\
@@ -1042,23 +915,15 @@
 		/if (opt_s) /set prot_%{opt_i}_stack=1%;/else /set prot_%{opt_i}_stack=0%;/endif%;\
 		/if (opt_h) /set prot_%{opt_i}_renew=1%;/else /set prot_%{opt_i}_renew=0%;/endif%;\
 		/if (opt_u=~"" | opt_d=~"") /break%;/endif%;\
-		/if (opt_k | opt_r) /let _qmatch=regexp%;/else /let _qmatch=simple%;/endif%;\
+		/if (opt_r) /let _qmatch=regexp%;/else /let _qmatch=simple%;/endif%;\
 		/let pstr=0%;\
 		/if (opt_A!~"") /let pstr=1%;/def -i -p9999 -F -aCyellow -mregexp -t'%{opt_A}' rec_%{opt_i}_A=/set prot_%{opt_i}_p=1%;/endif%;\
 		/if (opt_B!~"") /let pstr=2%;/def -i -p9999 -F -aCyellow -mregexp -t'%{opt_B}' rec_%{opt_i}_B=/if (prot_%{opt_i}_p == 1) /set prot_%{opt_i}_p=2%%;/endif%;/endif%;\
 		/if (opt_C!~"") /let pstr=3%;/def -i -p9999 -F -aCyellow -mregexp -t'%{opt_C}' rec_%{opt_i}_C=/if (prot_%{opt_i}_p == 2) /set prot_%{opt_i}_p=3%%;/endif%;/endif%;\
 		/if (pstr > 0)\
-			/if (opt_k)\
-				/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/if (prot_%{opt_i}_p==%{pstr})/pron %{opt_i} [%%{P1}]%%;/endif%%;/set prot_%{opt_i}_p=0%;\
-			/else \
-				/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/if (prot_%{opt_i}_p==%{pstr})/pron %{opt_i}%%;/endif%%;/set prot_%{opt_i}_p=0%;\
-			/endif%;\
+			/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/if (prot_%{opt_i}_p==%{pstr})/pron %{opt_i}%%;/endif%%;/set prot_%{opt_i}_p=0%;\
 		/else \
-			/if (opt_k)\
-				/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/set prot_%{opt_i}_p=0%%;/pron %{opt_i} [%%{P1}]%;\
-			/else \
-				/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/set prot_%{opt_i}_p=0%%;/pron %{opt_i}%;\
-			/endif%;\
+			/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/set prot_%{opt_i}_p=0%%;/pron %{opt_i}%;\
 		/endif%;\
 	/endif%;\
 	/def -i -p9999 -F -aCgreen -m%{_qmatch} -t'%{opt_d}' rec_%{opt_i}_off=/proff %{opt_i}
@@ -1105,6 +970,7 @@
 	/eval /set qtval_t=$$[prot_%{1}_t]%;\
 	/eval /set qtval_h=$$[prot_%{1}_renew]%;\
 	/eval /set qtval_q=$$[prot_%{1}_q]%;\
+	/if (qtval_l=~"") /gerror No such prot '%{1}' defined!%;/break%;/endif%;\
 	/if (qtval_c < 0 & qtval_q) \
 		/gwarning '%{1}' (%{qtval_l}) count %{qtval_c} at /proff!%;\
 		/set prot_%{1}=0%;\
@@ -1240,7 +1106,7 @@
 ;; ---- Tarmalen ----
 /prdefprot -i"unpain"	-n"Unp"		-l"Unpain" -h -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)"
 /prdefprot -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."
-/prdefprot -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!$"
+/prdefprot -i"lifelnk"	-n"LifeLnk"	-l"Life Link" -r -u"^You (succeed. You create a link to [A-Z][a-z]+\.|feel somehow linked to [A-Z][a-z]+!)$" -d"^You hear a loud snap like sound!$"
 /prdefprot -i"evital"	-n"EV"		-l"Enhanced Vitality" -A"\'zoot zoot zoot\'" -r -u"^A bright light extracts from .+\'s hands covering your skin.$" -d"^Your skin stops glowing.$"
 
 ;; ---- Nun ----
@@ -1467,7 +1333,6 @@
 
 ;; New round
 /def -i -F -msimple -t"*****************************************************" gbattle_round =\
-	/set tick_ignore=1%;\
 	/if (set_round!~"") %{set_round}%;/endif%;\
 	/if (opt_pss=~"on") /pstatus%;/endif%;\
 	/if (battle_st==0) /gbattle_init%;/endif%;\