changeset 50:7e472136e41d

New resist type code (buggy)
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 22 Sep 2005 07:54:03 +0000
parents 88ac0d5cd5d9
children e1590da3143d
files ggrtf-magical.tf ggrtf.tf
diffstat 2 files changed, 37 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ggrtf-magical.tf	Mon Sep 19 22:15:14 2005 +0000
+++ b/ggrtf-magical.tf	Thu Sep 22 07:54:03 2005 +0000
@@ -12,6 +12,7 @@
 ;; Initializing and options
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 /deftoggle -n"rmagic" -d"Report magic spells"
+/deftoggle -n"rresist" -d"Report blast resists"
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Fails and fumbles
@@ -162,25 +163,43 @@
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Resistances
+;; Battle targetting and resistances
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-/def -i mresist =\
-	/set resist_name=%{-1}%;/set resist_str=???%;/set resist_val=???%;/set resist_col=@{BCwhite}%;\
-	/if ({1}=1)	/set resist_str=screams%; /set resist_val=0%;	/set resist_col=@{BCgreen}%;\
-	/elseif ({1}=2)	/set resist_str=writhes%; /set resist_val=20%;	/set resist_col=@{Cgreen}%;\
-	/elseif ({1}=3)	/set resist_str=shudders%;/set resist_val=40%;	/set resist_col=@{BCyellow}%;\
-	/elseif ({1}=4)	/set resist_str=grunts%;  /set resist_val=60%;	/set resist_col=@{Cyellow}%;\
-	/elseif ({1}=5)	/set resist_str=winces%;  /set resist_val=80%;	/set resist_col=@{Cred}%;\
-	/elseif ({1}=6)	/set resist_str=shrugs%;  /set resist_val=100%;	/set resist_col=@{BCred}%;\
+/def -i prgetresist = /let rstr=%;\
+	/if ({1}=~"channelball"|{1}=~"channelray"|{1}=~"golden arrow"|{1}=~"magic missile") /let rstr=mana%;\
+	/elseif ({1}=~"channelbolt"|{1}=~"electrocution"|{1}=~"lightning bolt"|{1}=~"chain lightning"|{1}=~"shocking grasp"|{1}=~"lightning storm"|{1}=~"blast lightning") /let rstr=elec%;\
+	/elseif ({1}=~"channelburn"|{1}=~"channelspray"|{1}=~"firebolt"|{1}=~"flame arrow") /let rstr=fire%;\
+	/elseif ({1}=~"mind blast"|{1}=~"psibolt"|{1}=~"psi blast"|{1}=~"mind disruption"|{1}=~"psychic crush") /let rstr=psi%;\
+	/endif%;/return rstr
+
+/def -i -p9999 -ag -mregexp -t"^You watch with selfpride as your ([a-z ]+) hits (.*)\.$" battle_spellhit =\
+	/echo -p @{BCcyan}You watch with selfpride as your@{n} @{Cred}%{P1}%{n} @{BCcyan}hits@{n} @{BCgreen}%{P2}@{n}.%;\
+	/set battle_sname=%{P2}%;/battle_settarget %{P1}
+
+/def -i represist =\
+	/let resist_name=%{-1}%;/let resist_str=???%;/let resist_val=???%;/let resist_col=@{Cwhite}%;\
+	/if ({1}=1)	/let resist_str=screams%; /let resist_val=0%;	/let resist_col=@{BCgreen}%;\
+	/elseif ({1}=2)	/let resist_str=writhes%; /let resist_val=20%;	/let resist_col=@{Cgreen}%;\
+	/elseif ({1}=3)	/let resist_str=shudders%;/let resist_val=40%;	/let resist_col=@{BCyellow}%;\
+	/elseif ({1}=4)	/let resist_str=grunts%;  /let resist_val=60%;	/let resist_col=@{Cyellow}%;\
+	/elseif ({1}=5)	/let resist_str=winces%;  /let resist_val=80%;	/let resist_col=@{Cred}%;\
+	/elseif ({1}=6)	/let resist_str=shrugs%;  /let resist_val=100%;	/let resist_col=@{BCred}%;\
 	/endif%;\
-	/echo -p @{BCyellow}%{resist_name}@{n} %{resist_col}%{resist_str}@{n} (@{BCwhite}%{resist_val}%%@{n} resist)
+	/let resist_type=$[prgetresist({battle_sname})]%;\
+	/set battle_sname=%;\
+	/echo -p @{BCyellow}%{resist_name}@{n} %{resist_col}%{resist_str}@{n} @{BCcyan}%{resist_type}@{n} (@{BCwhite}%{resist_val}%%@{n} resist)%;\
+	/if ({opt_rresist}=~"on") \
+		/msr %{resist_val}%% %{resist_type} resist%;\
+	/endif
 
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) screams in pain\.$" resist1 = /mresist 1 %{P1}
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) writhes in agony\.$" resist2 = /mresist 2 %{P1}
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) shudders from the force of the attack\.$" resist3 = /mresist 3 %{P1}
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) grunts from the pain\.$" resist4 = /mresist 4 %{P1}
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) winces a little from the pain\.$" resist5 = /mresist 5 %{P1}
-/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) shrugs off the attack\.$" resist6 = /mresist 6 %{P1}
+;	/let resist_type=$[prexeconreturn({lst_spresists},{battle_sname})]%;\
+
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) screams in pain\.$" battle_resist1 = /represist 1 %{P1}
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) writhes in agony\.$" battle_resist2 = /represist 2 %{P1}
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) shudders from the force of the attack\.$" battle_resist3 = /represist 3 %{P1}
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) grunts from the pain\.$" battle_resist4 = /represist 4 %{P1}
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) winces a little from the pain\.$" battle_resist5 = /represist 5 %{P1}
+/def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) shrugs off the attack\.$" battle_resist6 = /represist 6 %{P1}
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- a/ggrtf.tf	Mon Sep 19 22:15:14 2005 +0000
+++ b/ggrtf.tf	Thu Sep 22 07:54:03 2005 +0000
@@ -601,7 +601,7 @@
 /prcreate -i"sop"	-n"SoP"		-l"Shield of Protection" -A" \'nsiiznau\'$" -u"You feel a slight tingle." -d"You feel more vulnerable now."
 /prcreate -i"bimage"	-n"BImg"	-l"Blurred Image" -A" \'ziiiuuuuns wiz\'$" -u"You feel a powerful aura." -d"You feel less invisible."
 /prcreate -i"disp"	-n"Disp"	-l"Displacement" -A" \'diiiiuuunz aaanziz\'$" -u"You feel a powerful aura." -d"You feel much less invisible."
-/prcreate -i"fabs"	-n"Fabs"	-l"Force Absorption"
+;/prcreate -i"fabs"	-n"Fabs"	-l"Force Absorption" -u"You sense a powerful protective aura around you." -d"A skin brown flash momentarily surrounds you and then vanishes."
 /prcreate -i"aoa"	-n"AoA"		-l"Armour of Aether" -A" \'fooharribah inaminos cantor\'$" -u"You see a crystal clear shield fade into existance around you." -d"Your crystal clear shield fades out."
 /prcreate -i"frosts"	-n"FrostS"	-l"Frost Shield" -u"You see a frosty blue-white shield fade into existance around you." -d"Your frosty blue-white shield fades out."
 
@@ -785,15 +785,12 @@
 	/prexecfuncs %{battle_roundfuncs}
 
 ;; Grab target via several methods
-/def -i -p9999 -F -aBCcyan -mregexp -t"^You watch with selfpride as your .* hits (.*).$" battle_settarget1 =\
-	/if ({battle_st}=~"on") /battle_settarget %{P1}%;/endif
-
 /def -i -p9999 -ag -mregexp -t"^You are now targetting ([A-Za-z ,.'-]+)\.$" battle_settarget3 =\
 	/msq @{BCyellow}Targetting@{n} -> @{BCred}%{P1}@{n}%;\
 	/battle_settarget %{P1}
 
 /def -mregexp -t"^%{set_plrname} hits (.*) [1-9] times*.$" battle_settarget2 =\
-	/if ({battle_st}=~"on") /battle_settarget %{P1}%;/endif
+	/battle_settarget %{P1}
 
 ;; Get shape
 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+ is in excellent shape)\.$"	battle_shape0 = /battle_ss es 90-100 %{P1}