Mercurial > hg > batmud > ggrtf
comparison gm-magical.tf @ 1677:32c6a74b989a
Improve spell handling, add grabbing of wiz-only spell chance value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 27 Mar 2024 17:24:10 +0200 |
parents | 356c3c26aee6 |
children |
comparison
equal
deleted
inserted
replaced
1676:b189ae1b391c | 1677:32c6a74b989a |
---|---|
138 ; cast_info_t - target of skill/spell (empty if no target) | 138 ; cast_info_t - target of skill/spell (empty if no target) |
139 | 139 |
140 ;; Start of spell | 140 ;; Start of spell |
141 | 141 |
142 | 142 |
143 /def -i -F -p9999 -msimple -t"You start chanting." gspell_start =\ | 143 /def -i -F -p9999 -mregexp -t"^You start chanting( \(chance ([0-9]+)\))?\.$" gspell_start =\ |
144 /if (ceremony_st2=~"on")/let _cere=[@{BCgreen}CERE@{n}]%;/else /let _cere=%;/endif%;\ | 144 /set spell_chance=%{P2}%;\ |
145 /if (spell_chance!~"")/let _chance= [chance @{Cgreen}%{spell_chance}@{n}%%]%;/else /let _chance=%;/endif%;\ | |
146 /if (ceremony_st2=~"on")/let _cere= [@{BCgreen}CERE@{n}]%;/else /let _cere=%;/endif%;\ | |
145 /set ceremony_st2=off%;\ | 147 /set ceremony_st2=off%;\ |
146 /set ceremony_st=off%;\ | 148 /set ceremony_st=off%;\ |
147 /set spell_t=$[time()]%;\ | 149 /set spell_t=$[time()]%;\ |
148 /set cnt_casts=$[cnt_casts+1]%;\ | 150 /set cnt_casts=$[cnt_casts+1]%;\ |
149 /set spell_rfirst=1%;\ | 151 /set spell_rfirst=1%;\ |
151 /set spell_st=on%;\ | 153 /set spell_st=on%;\ |
152 /set spell_st2=off%;\ | 154 /set spell_st2=off%;\ |
153 /set spell_hastes=0%;\ | 155 /set spell_hastes=0%;\ |
154 /set spell_ghastes=0%;\ | 156 /set spell_ghastes=0%;\ |
155 /set cast_info=SP%;/set cast_info_n=%;/set cast_info_t=%;@@cast info%;\ | 157 /set cast_info=SP%;/set cast_info_n=%;/set cast_info_t=%;@@cast info%;\ |
156 /msk @{BCyellow} ---- SPELL START ---- @{n} (@{Cyellow}%{cnt_casts}@{n}) %{_cere}%;\ | 158 /msk @{BCyellow} ---- SPELL START ---- @{n} (@{Cyellow}%{cnt_casts}@{n})%{_cere}%{_chance}%;\ |
157 /gstatus_update%;/prexecfuncs %{event_spell_start} | 159 /gstatus_update%;/prexecfuncs %{event_spell_start} |
158 | 160 |
159 | 161 |
160 ;; Spell done | 162 ;; Spell done |
161 /def -i -F -p9999 -msimple -t"You are done with the chant." gspell_end =\ | 163 /def -i -F -p9999 -msimple -t"You are done with the chant." gspell_end =\ |
164 /if (spell_chance!~"")/let _chance= [chance @{Cgreen}%{spell_chance}@{n}%%]%;/else /let _chance=%;/endif%;\ | |
162 /set cnt_trounds=$[cnt_trounds+spell_rcount]%;\ | 165 /set cnt_trounds=$[cnt_trounds+spell_rcount]%;\ |
163 /set cnt_scasts=$[cnt_scasts+1]%;\ | 166 /set cnt_scasts=$[cnt_scasts+1]%;\ |
164 /set spell_st=off%;\ | 167 /set spell_st=off%;\ |
165 /set spell_st2=on%;\ | 168 /set spell_st2=on%;\ |
166 /set cast_info=%;\ | 169 /set cast_info=%;\ |
167 /set cnt_ctime=$[cnt_ctime+time()-spell_t]%;\ | 170 /set cnt_ctime=$[cnt_ctime+time()-spell_t]%;\ |
168 /msk @{Cbggreen} ---- SPELL DONE ---- @{n} in [@{BCred}%{spell_rcount}@{n}] @{BCgreen}rounds!@{n} @{Cyellow}$[prgetstime(spell_t)]@{n}%;\ | 171 /msk @{Cbggreen} ---- SPELL DONE ---- @{n} in [@{BCred}%{spell_rcount}@{n}] @{BCgreen}rounds!@{n} @{Cyellow}$[prgetstime(spell_t)]@{n}%{_chance}%;\ |
169 /gstatus_update%;/prexecfuncs %{event_spell_done} | 172 /gstatus_update%;/prexecfuncs %{event_spell_done} |
170 | 173 |
171 | 174 |
172 ;; Cast info | 175 ;; Cast info |
173 /def -i -F -p9999 -ag -mregexp -t"^You are casting \'([a-z ]+)\'.$" gspell_info1 =\ | 176 /def -i -F -p9999 -ag -mregexp -t"^You are casting \'([a-z ]+)\'.$" gspell_info1 =\ |