changeset 649:fcaf1254d25f

Fixed and improved PR support (for HCBat) in consider reporting.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 24 Jul 2007 01:21:54 +0000
parents 8322134a1989
children 7a420127f257
files ggrtf-misc.tf
diffstat 1 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ggrtf-misc.tf	Tue Jul 24 01:19:34 2007 +0000
+++ b/ggrtf-misc.tf	Tue Jul 24 01:21:54 2007 +0000
@@ -33,19 +33,23 @@
 ;; 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}
+	/set cons_st=1%;/set cons_pr=%;/set cons_exp=%;/set cons_name=%{P1}
 
-/def -i -ag -mregexp -t"^You would get (.*) experience for" gconsider_rep1 =\
+/def -i -Econs_st==1 -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 defconspr =\
+	/def -i -Econs_st==1 -ag -mregexp -t"^[A-Za-z<> ,.'-]+ %{2}$$" gconsider_pr%{1} =\
+		/set cons_pr=%{3}
 
-/def -i -ag -mregexp -t"^The final estimation is that (.*)" gconsider_final =\
-	/if (cons_st=~"on") \
+/test defconspr(1, "has a soft skin.", "soft", 0)
+/test defconspr(2, "seems to have a bit hardened skin.", "bit hardened", 0)
+/test defconspr(3, "has somewhat hardened skin.", "somewhat hardened", 0)
+/test defconspr(4, "skin could fold up a rapier!", "could fold up a rapier!", 0)
+/test defconspr(5, "skin seems to be virtually impenetrable!", "impenetrable!", 0)
+
+/def -i -ag -mregexp -t"^The final estimation is that (.*)$" gconsider_final =\
+	/if (cons_st) \
 		/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%;\
@@ -53,7 +57,7 @@
 		/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%;\
+		/else /set cons_opp=%{cons_val}%;/endif%;\
 		/if (cons_exp!~"") /let qtmps=%{cons_exp} exp%;/else /let qtmps=%;/endif%;\
 		/if (cons_opp!~"")\
 			/if (qtmps!~"")\
@@ -62,10 +66,10 @@
 				/let qtmps=%{cons_opp}%;\
 			/endif%;\
 		/endif%;\
-		/if (cons_pr!~"") /let qtmps=%{qtmps} (%{cons_pr} PR)%;/endif%;\
+		/if (cons_pr!~"") /let qtmps=%{qtmps} (PR: %{cons_pr})%;/endif%;\
 		/msr [$[substr(cons_name,0,15)]]: %{qtmps}%;\
 	/endif%;\
-	/set cons_st=off
+	/set cons_st=0
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;