changeset 570:213c97ca9382

New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 26 Nov 2006 04:45:38 +0000
parents ce387924141b
children cb2e4a70d26d
files ggrtf.tf
diffstat 1 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ggrtf.tf	Wed Nov 22 22:17:03 2006 +0000
+++ b/ggrtf.tf	Sun Nov 26 04:45:38 2006 +0000
@@ -864,7 +864,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Version reporting
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-/set ggrtf_copy=(C) Copyright 2004-2006 Matti Hämäläinen (Ggr Pupunen)
+/set ggrtf_copy=(C) Copyright 2004-2006 Matti Hämäläinen (Ggr Pupunen) and others
 
 /def gver = /result "GgrTF %{ggrtf_ver}"
 
@@ -876,6 +876,43 @@
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Skill/spell fumble / fail definition
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; -t"<pattern>" Pattern/string for matching
+; -r Use regexp instead of simple matching
+; -c Type: Spell
+; -k Type: Skill
+; -f Fail
+; -F Fumble
+
+/def -i prdeffail =\
+	/if (!getopts("t:rckfF", "")) /gerror Invalid fail/fumble definition!%;/break%;/endif%;\
+	/if (opt_c & opt_k) /gerror Skill and spell options are mutually exclusive!%;/break%;/endif%;\
+	/if (opt_f & opt_F) /gerror Fail and fumble options are mutually exclusive!%;/break%;/endif%;\
+	/if (opt_t=~"") /gerror Invalid fail/fumble definition! -t not specified or empty.%;/break%;/endif%;\
+	/if (opt_r) /let _tmpr=regexp%;/else /let _tmpr=simple%;/endif%;\
+	/if (opt_f)\
+		/let _tmpt=fail%;\
+		/let _tmpa=Cred%;\
+	/elseif (opt_F)\
+		/let _tmpt=fumble%;\
+		/let _tmpa=BCred%;\
+	/else \
+		/gerror Invalid fail/fumble definition! You MUST specify either -f or -F%;\
+		/break%;\
+	/endif%;\
+	/if (opt_c)\
+		/def -i -F -p9999 -m%{_tmpr} -a%{_tmpa} -t"%{opt_t}" gspell_%{_tmpt}%{cnt_def_fail} = /gspell_%{_tmpt}%;\
+	/elseif (opt_k)\
+		/def -i -F -p9999 -m%{_tmpr} -a%{_tmpa} -t"%{opt_t}" gspell_%{_tmpt}%{cnt_def_fail} = /gskill_%{_tmpt}%;\
+	/else \
+		/gerror Invalid fail/fumble definition! You must specify either -k or -c%;\
+		/break%;\
+	/endif%;\
+	/set cnt_def_fail=$[cnt_def_fail+1]
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Prot triggers and reporting
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; List of prots and conjurer prots (cprots list needed for handling/clearing minor prot prereqs)
@@ -932,7 +969,7 @@
 ; -e Extra counter report (don't ask)
 ; -z Handicap (curse, or similar)
 /def -i prdefprot =\
-	/if (!getopts("i:n:l:A:B:C:u:d:srhpPqmMez", "")) /gerror Invalid prot creation command!%;/break%;/endif%;\
+	/if (!getopts("i:n:l:A:B:C:u:d:srhpPqmMez", "")) /gerror Invalid prot definition!%;/break%;/endif%;\
 	/set lst_prots=%{opt_i} %{lst_prots}%;\
 	/set prot_%{opt_i}=0%;\
 	/set prot_%{opt_i}_t=-1%;\