Mercurial > hg > batmud > ggrtf
annotate ggrtf.tf @ 1674:fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
compatibility with previous "fmt_shape" setting. You will need to
update yours with the new tokens or remove it from configuration file
to use the new default.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 25 Mar 2024 19:15:08 +0200 |
parents | 54a9a23d8df0 |
children | 27281a74c507 |
rev | line source |
---|---|
1 | 1 ;; |
1123
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
2 ;; GgrTF - A TinyFugue script for BatMUD |
1671 | 3 ;; (C) Copyright 2004-2024 Matti Hamalainen (Ggr Pupunen) |
1 | 4 ;; |
1673 | 5 /set ggrtf_ver=0.7.5.0 |
71
211e7ca6969c
Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
6 ;; |
1454
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
8 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
9 ;; This program is free software; you can redistribute it and/or |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
10 ;; modify it under the terms of the GNU General Public License |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
11 ;; version 2 as published by the Free Software Foundation. |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
12 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
13 ;; This program is distributed in the hope that it will be useful, |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
16 ;; file "COPYING.txt" for more details. |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
17 ;; |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
18 ;; You should have received a copy of the GNU General Public License |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
19 ;; along with this program; if not, write to the Free Software |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
20 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
113c9a66eaf1
Add a better/more proper GPL license header in files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1446
diff
changeset
|
21 ;; MA 02110-1301 USA. |
1 | 22 ;; |
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
24 ;; | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
25 ;; For installation instructions, and more information, |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
26 ;; please refer to GgrTF's homepage and user's manual. |
1 | 27 ;; |
1136
edc1b69772e0
Update URL and bump version.
Matti Hamalainen <ccr@tnsp.org>
parents:
1134
diff
changeset
|
28 ;; http://tnsp.org/~ccr/ggrtf/ |
289 | 29 ;; |
1 | 30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
31 ;; The actual scriptcode starts here: initialize, load prereqs | |
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1398
088eacdcd884
Make TF5 not warn off about using {} in regular expressions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1397
diff
changeset
|
33 /set warn_curly_re=off |
295 | 34 /set warn_status=off |
989
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
35 /set status_pad=_ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
36 /require map.tf |
295 | 37 |
214
080b02940954
Breakage, new event_* variables to list macros executed on specific events.
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
38 |
989
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
39 ;; Reset GgrTF internals |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
40 ;@command /greset |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
41 ;@desc Reset all skill/spell counters and statistics. Notice that issuing |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
42 ;@desc this command also requires executing of "/gsave" if you want to save |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
43 ;@desc the zeroed statistics, otherwise the old saved statistics will be |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
44 ;@desc loaded on next /gload. |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
45 /def -i greset =\ |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
46 /prdefivar cnt_date $[time()]%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
47 /prdefivar cnt_casts 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
48 /prdefivar cnt_scasts 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
49 /prdefivar cnt_icasts 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
50 /prdefivar cnt_fcasts 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
51 /prdefivar cnt_fucasts 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
52 /prdefivar cnt_hastes 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
53 /prdefivar cnt_ghastes 0%;\ |
540 | 54 /prdefivar cnt_qlips1 0%;\ |
55 /prdefivar cnt_qlips2 0%;\ | |
56 /prdefivar cnt_qlips3 0%;\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
57 /prdefivar cnt_trounds 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
58 /prdefivar cnt_damcrits 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
59 /prdefivar cnt_dcrit1 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
60 /prdefivar cnt_dcrit2 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
61 /prdefivar cnt_dcrit3 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
62 /prdefivar cnt_dcrit4 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
63 /prdefivar cnt_skills 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
64 /prdefivar cnt_sskills 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
65 /prdefivar cnt_iskills 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
66 /prdefivar cnt_fskills 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
67 /prdefivar cnt_fuskills 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
68 /prdefivar cnt_ctime 0%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
69 /prdefivar cnt_sktime 0%;\ |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
70 /prexecfuncs %{lst_resetfuncs}%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
71 /set set_cntinit=1%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
72 /msq Global counters reset. |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
73 |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
74 |
550 | 75 /def -i ginitialize =\ |
410
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
76 /prdefvar -n"status_pad" -v"_" -c"The padding character used in displaying the status area in TF visual mode"%;\ |
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
77 /prdefvar -n"status_attr" -v"" -c"The attributes used to display the status area in TF visual mode" %;\ |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
78 /prdefvar -n"fmt_date" -v"%%%c" -c"ftime() formatting string used for dates"%;\ |
1267
9f9d34a50837
Add opt_lites as saveable variable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1266
diff
changeset
|
79 /prdefvar -n"opt_lites" -v"on" -c"Enable default lites for various things (cannot be changed during runtime) (on/off)"%;\ |
377
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
80 /prdefvar -n"opt_bindings" -v"off" -c"Whether command bindings are loaded/defined in startup (on/off)"%;\ |
1034
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
81 /prdefvar -n"opt_keybinds" -v"on" -c"If keyboard numpad cast bindings should be used, requires GgrTF::TargettedCast module (on/off)"%;\ |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
82 /set battle_target=%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
83 /set battle_st=0%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
84 /set spell_st=off%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
85 /set skill_st=off%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
86 /set stun_st=off%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
87 /set camp_st=1%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
88 /set cast_info=%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
89 /set cast_info_t=%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
90 /set cast_info_n=%;\ |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
91 /set opt_verbose=on%;\ |
566
01afb41d74b8
v0.6.1.13; Use @@ instead of @ for escaping the BatMUD parser in some places; Fix problems with Demonic Ring of Invisibility (closes ID#16)
Matti Hamalainen <ccr@tnsp.org>
parents:
562
diff
changeset
|
92 /set set_round=@@scan all%;\ |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
93 /set set_ripcommand=@whee%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
94 /set set_peer=embedded%;\ |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
95 /set set_gprompt=%%{status_prompt}>%;\ |
1654
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
96 /set set_grepcmd=grep%;\ |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
97 /set set_roundmin=2%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
98 /set set_sysinit=1%;\ |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
99 /msq System variables initialized. |
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
100 |
550 | 101 |
576 | 102 /set cnt_def_fail=0 |
1227 | 103 |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
104 /set event_battle_rip=ripfunc |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
105 /set event_battle_first_round= |
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
106 /set event_battle_round= |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
107 /set event_battle_end= |
1394
6bce2e02518f
Rename event_tick_sc to event_sc_printed, as it is more descriptive of what
Matti Hamalainen <ccr@tnsp.org>
parents:
1391
diff
changeset
|
108 /set event_sc_printed= |
759
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
109 /set event_skill_start= |
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
110 /set event_skill_done= |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
111 /set event_skill_intr= |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
112 /set event_skill_stop= |
759
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
113 /set event_spell_start= |
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
114 /set event_spell_done= |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
115 /set event_spell_intr= |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
116 /set event_spell_stop= |
1319
b9ef8769b69a
Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents:
1318
diff
changeset
|
117 /set event_quit_login= |
1318
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
118 /set event_login= |
1227 | 119 |
550 | 120 /set lst_stats_spell= |
121 /set lst_stats_skill= | |
1227 | 122 /set lst_resetfuncs= |
295 | 123 |
732
8870fc4796ce
Set gmodule name in each module.
Matti Hamalainen <ccr@tnsp.org>
parents:
731
diff
changeset
|
124 /set lst_modules= |
8870fc4796ce
Set gmodule name in each module.
Matti Hamalainen <ccr@tnsp.org>
parents:
731
diff
changeset
|
125 /set gmodule=Main |
8870fc4796ce
Set gmodule name in each module.
Matti Hamalainen <ccr@tnsp.org>
parents:
731
diff
changeset
|
126 |
477
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
127 /set status_hp= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
128 /set status_hpmax= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
129 /set status_sp= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
130 /set status_spmax= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
131 /set status_ep= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
132 /set status_epmax= |
893becf797ed
- Define status_{h,s,e}p{,max} to suppress some error messages.
Ealoren Pupunen <ealoren@bat.org>
parents:
476
diff
changeset
|
133 |
338
57884d36173b
Local variable namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
337
diff
changeset
|
134 |
1 | 135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
127 | 136 ;; Macros which may be re-defined by user or in other modules |
1 | 137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1123
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
138 /def -i msd = /echo -- %* |
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
139 /def -i msw = /echo -p -- %* |
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
140 /def -i msq = /echo -p -- @{BCwhite}GgrTF@{n}: %* |
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
141 /def -i mss = /substitute -p -- %* |
958
a0d4bcfc65de
Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
949
diff
changeset
|
142 |
1034
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
143 /def -i gerror = /set set_errcnt=$[set_errcnt+1]%;/set set_errlast=$[strip_attr({*})]%;/msq @{BCred}ERROR!@{n} %* |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
144 /def -i gwarning = /set set_warncnt=$[set_warncnt+1]%;/set set_warnlast=$[strip_attr({*})]%;/msq @{BCred}WARNING!@{n} %* |
1123
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
145 /def -i gsend = /if (!set_idle) /test send({*})%;/endif |
49
88ac0d5cd5d9
PfG trigger fixed, changed msr/mse/msp macros to use direct @@party *
Matti Hamalainen <ccr@tnsp.org>
parents:
48
diff
changeset
|
146 |
958
a0d4bcfc65de
Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
949
diff
changeset
|
147 /def -i msk = /if (opt_skspam=~"on") /substitute -p @{BCwhite}GgrTF@{n}: %*%;/endif |
1318
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
148 /def -i msp = /if (!set_idle & opt_verbose=~"on") /send @@party say %*%;/else /msq %*%;/endif |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
149 /def -i mse = /if (!set_idle & opt_verbose=~"on") /send @@party say emote %*%;/else /msq %*%;/endif |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
150 /def -i msr_real = /if (!set_idle) /send @@party report %*%;/else /msq %*%;/endif |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
151 /def -i msb = /if (set_idle) /msq %*%;/else /send @party report %*%;/endif |
16
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
152 |
1123
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
153 /def -i dig_grave = /gsend @@dig grave |
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
154 /def -i eat_corpse = /gsend @@get corpse%;/gsend @@eat corpse |
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
155 /def -i get_corpse = /gsend @@get corpse |
95 | 156 |
1 | 157 |
18 | 158 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
159 ;; Report message queuing |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
160 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
161 /set lst_busy_queue= |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
162 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
163 /def -i msr =\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
164 /if (opt_verbose=~"on")\ |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
165 /if (camp_st == 2)\ |
675 | 166 /gmsg_que %*%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
167 /else \ |
675 | 168 /msr_real %*%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
169 /endif%;\ |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
170 /else \ |
675 | 171 /msq %*%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
172 /endif |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
173 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
174 /def -i gmsg_que =\ |
1286
2cff76a36d44
Change message queue replacement character.
Matti Hamalainen <ccr@tnsp.org>
parents:
1274
diff
changeset
|
175 /set lst_busy_queue=%{lst_busy_queue} $[replace(" ", "§",{*})] |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
176 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
177 /def -i gmsg_empty_que =\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
178 /gmsg_empty_do %{lst_busy_queue}%;\ |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
179 /unset lst_busy_queue |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
180 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
181 /def -i gmsg_empty_do =\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
182 /while ({#})\ |
1286
2cff76a36d44
Change message queue replacement character.
Matti Hamalainen <ccr@tnsp.org>
parents:
1274
diff
changeset
|
183 /test msr_real(replace("§"," ",{1}))%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
184 /shift%;\ |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
185 /done |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
186 |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
187 |
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
188 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
989
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
189 ;; Get and check TinyFugue version |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
190 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
191 /set gtf_version=0 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
192 /set gtf_ver_minor=0 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
193 /set gtf_ver_major=0 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
194 /set gtf_ver_extra=0 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
195 |
1245
ac9360f5ac0a
gcheck_tf_version was not defined as invisible macro, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1242
diff
changeset
|
196 /def -i gcheck_tf_version =\ |
989
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
197 /if (regmatch("^([0-9]+)\.([0-9]+)", ver()))\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
198 /set gtf_ver_major=%{P1}%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
199 /set gtf_ver_minor=%{P2}%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
200 /set gtf_version=$[{P1}*10000 + {P2}*100]%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
201 /endif%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
202 /if (regmatch("^([0-9]+)\.([0-9]+) beta ([0-9]+)", ver()))\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
203 /set gtf_ver_extra=%{P3}%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
204 /set gtf_version=$[gtf_version + {P3}]%;\ |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
205 /endif%;\ |
1668
a17c3bdff36e
Require TF 5.0 beta 8 at minimum.
Matti Hamalainen <ccr@tnsp.org>
parents:
1663
diff
changeset
|
206 /if (gtf_version < 50008)\ |
a17c3bdff36e
Require TF 5.0 beta 8 at minimum.
Matti Hamalainen <ccr@tnsp.org>
parents:
1663
diff
changeset
|
207 /gerror @{BCwhite}GgrTF requires TinyFugue version 5.0 beta 8 or later!@{n}%;\ |
989
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
208 /endif |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
209 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
210 /gcheck_tf_version |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
211 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
212 |
80fadb0faa34
Compute easy a easy to check against TF version identifier, to check for features; Use the version identifier in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
985
diff
changeset
|
213 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1034
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
214 ;; Module support |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
215 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
216 /set lst_modules=Main |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
217 |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
218 /def -i prcheckdeps =\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
219 /if ({1}=~"") /result ""%;/endif%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
220 /let _missing=%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
221 /while ({#})\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
222 /if (!regmatch(strcat("(^| )",{1},"( |$)"), lst_modules))\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
223 /if (_missing!~"")\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
224 /let _missing=%{_missing}, %{1}%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
225 /else \ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
226 /let _missing=%{1}%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
227 /endif%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
228 /endif%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
229 /shift%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
230 /done%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
231 /result _missing |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
232 |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
233 |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
234 /def -i prdefmodule =\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
235 /test prlist_insert("lst_modules", {1})%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
236 /set gmodule=%{1}%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
237 /if ({#} > 1)\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
238 /let _res=$(/prcheckdeps %{-1})%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
239 /if (_res!~"")\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
240 /gerror @{BCwhite}Module '%{1}' depends on@{n} @{BCyellow}%{_res}@{n} @{BCwhite}to be loaded before it.@{n}%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
241 /repeat -5 1 /msq There were errors loading modules. Please check the full TF/GgrTF init output. %{set_errlast}%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
242 /exit 10%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
243 /endif%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
244 /endif |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
245 |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
246 /def -i gcheck_keybinds =\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
247 /let _res=$[prcheckdeps("TargettedCast")]%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
248 /if ((opt_keybinds=~"on" | opt_keybinds=~"") & _res!~"")\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
249 /gerror Keyboard numpad bindings enabled, but '%{_res}' not loaded before '%{gmodule}'.%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
250 /exit 10%;\ |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
251 /endif |
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
252 |
1146
deaf741af85e
Fix prlist_insert() to properly handle items with special characters used in regexps.
Matti Hamalainen <ccr@tnsp.org>
parents:
1145
diff
changeset
|
253 |
1034
0ac7b5520973
Added rudimentary module depencies system.
Matti Hamalainen <ccr@tnsp.org>
parents:
1033
diff
changeset
|
254 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
127 | 255 ;; Helper macros/functions |
256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
439
ed92a3ff51b3
Some utility functions moved from rais-module to here;
Matti Hamalainen <ccr@tnsp.org>
parents:
436
diff
changeset
|
257 /def -i prconvto = /return tolower(replace(" ","_",{1})) |
ed92a3ff51b3
Some utility functions moved from rais-module to here;
Matti Hamalainen <ccr@tnsp.org>
parents:
436
diff
changeset
|
258 /def -i prconvfrom = /return replace("_"," ",strcat(toupper(substr({1},0,1)),substr({1},1))) |
ed92a3ff51b3
Some utility functions moved from rais-module to here;
Matti Hamalainen <ccr@tnsp.org>
parents:
436
diff
changeset
|
259 /def -i prconvpm = /return replace("_"," ",{1}) |
863
7bc694ae2119
v0.6.9.10.1-svn; Beginning of code sanity cleanup. This will be using a TF5-only feature, namely the function version of eval().
Matti Hamalainen <ccr@tnsp.org>
parents:
861
diff
changeset
|
260 /def -i prgetval = /return eval("/return %{*}",2) |
7bc694ae2119
v0.6.9.10.1-svn; Beginning of code sanity cleanup. This will be using a TF5-only feature, namely the function version of eval().
Matti Hamalainen <ccr@tnsp.org>
parents:
861
diff
changeset
|
261 |
1496
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
262 ;; Return a string of given value {2} repeated {1} times. |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
263 /def -i prrepval_do =\ |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
264 /for _i 1 %{1} /echo %{2} |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
265 |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
266 /def -i prrepval =\ |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
267 /return "$(/prrepval_do %{1} %{2})" |
75f99ae1cdb3
Move utility function to the main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1494
diff
changeset
|
268 |
439
ed92a3ff51b3
Some utility functions moved from rais-module to here;
Matti Hamalainen <ccr@tnsp.org>
parents:
436
diff
changeset
|
269 |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
270 ;; Return ratio of 2 arguments (avoid divide by zero) |
302
a0d5b462870d
More TF5 compatibility fixing.
Matti Hamalainen <ccr@tnsp.org>
parents:
301
diff
changeset
|
271 /def -i prdiv = /if ({2} != 0) /return {1}/{2}%;/else /return 0%;/endif |
84
b5da20be6b96
Skill start/done messages now similar to spell messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
82
diff
changeset
|
272 |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
273 ;; Return ratio of 2 arguments rounded to two decimals |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
274 /def -i prstdiv = /return prround(prdiv({1},{2}),2) |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
275 |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
276 |
316
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
277 ;; Return a substring of given string with specified maxlen, padded to maxlen |
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
278 /def -i prsubpad = /return pad(substr({1},0,{2}),{2}) |
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
279 |
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
280 /def -i prsubipad = /return pad(substr({1},0,{2}),-{2}) |
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
281 |
63dedf2fb38e
Code cleanups, two new utility functions added.
Matti Hamalainen <ccr@tnsp.org>
parents:
313
diff
changeset
|
282 |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
283 ;; Return a string containing a floating point value, |
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
284 ;; truncated to specified number of decimal digits maximum. |
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
285 /def -i prround =\ |
335
07d69d94fdf4
TF insisted that some floating point values were actually timestamps, fixed with a kludge.
Matti Hamalainen <ccr@tnsp.org>
parents:
334
diff
changeset
|
286 /let _rval=$[{1}*1.0]%;\ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
287 /let _rpos=$[strchr(_rval,".")]%;\ |
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
288 /if (_rpos >= 0)\ |
302
a0d5b462870d
More TF5 compatibility fixing.
Matti Hamalainen <ccr@tnsp.org>
parents:
301
diff
changeset
|
289 /if ({2} > 0)\ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
290 /return strcat(substr(_rval,0,_rpos),substr(_rval,_rpos,{2}+1))%;\ |
302
a0d5b462870d
More TF5 compatibility fixing.
Matti Hamalainen <ccr@tnsp.org>
parents:
301
diff
changeset
|
291 /else \ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
292 /return substr(_rval,0,_rpos)%;\ |
302
a0d5b462870d
More TF5 compatibility fixing.
Matti Hamalainen <ccr@tnsp.org>
parents:
301
diff
changeset
|
293 /endif%;\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
294 /else \ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
295 /return _rval%;\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
296 /endif |
127 | 297 |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
298 |
547 | 299 ;; Return string describing timestamp in "[[??h]??m]??s" format |
75
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
300 /def -i prgettime =\ |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
301 /if ({1} > 0)\ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
302 /let _jtime=$[trunc({1})]%;\ |
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
303 /let _jtimeh=$[_jtime/3600]%;\ |
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
304 /let _jtimeq=$[mod(_jtime,3600)]%;\ |
547 | 305 /if (_jtimeh > 0)\ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
306 /let _jstr=%{_jtimeh}h%;\ |
75
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
307 /else \ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
308 /let _jstr=%;\ |
75
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
309 /endif%;\ |
334
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
310 /let _jstr=%{_jstr}$[_jtimeq/60]m$[mod(_jtimeq,60)]s%;\ |
62e0d0fb6ed2
Some more namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
333
diff
changeset
|
311 /return _jstr%;\ |
75
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
312 /else \ |
439
ed92a3ff51b3
Some utility functions moved from rais-module to here;
Matti Hamalainen <ccr@tnsp.org>
parents:
436
diff
changeset
|
313 /return ""%;\ |
75
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
314 /endif |
db7ad704206a
Added simple statistics about spell casting times
Matti Hamalainen <ccr@tnsp.org>
parents:
74
diff
changeset
|
315 |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
316 |
550 | 317 ;; Return given string post-padded to specified length with specified character |
318 ;; prpadwith(string,length,char) | |
319 /def -i prpadwith =\ | |
910 | 320 /return strcat({1}, strrep({3}, {2} - strlen({1}))) |
550 | 321 |
322 | |
653
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
323 ;; If string is longer than specified max, cut and pad with ellipsis (...) |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
324 /def -i prsubstr =\ |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
325 /if (strlen({1})>{2})\ |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
326 /return "$[substr({1},0,{2}-3)]..."%;\ |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
327 /else \ |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
328 /return {1}%;\ |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
329 /endif |
643e93f4b941
Added prsubstr() utility function.
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
330 |
1286
2cff76a36d44
Change message queue replacement character.
Matti Hamalainen <ccr@tnsp.org>
parents:
1274
diff
changeset
|
331 |
547 | 332 ;; Return string describing time elapsed from given timestamp parameter |
44 | 333 /def -i prgetstime =\ |
547 | 334 /let _tmps=$[prgettime(time()-{1})]%;\ |
335 /if (_tmps!~"") /return "[%{_tmps}]"%;/else /return ""%;/endif | |
1 | 336 |
43
224a5962ca1a
New setting /fmttime [1 2] to set preferred timestamp formatting style,
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
337 |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
338 ;; Return a color definition based on [n, nmax] (useful for hp/sp/ep lites) |
82
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
339 /def -i prgetnlite =\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
340 /if ({1} < 0) /return "BCwhite,BCbgred"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
341 /if ({1} < {2}*0.16) /return "BCred"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
342 /if ({1} < {2}*0.33) /return "Cred"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
343 /if ({1} < {2}*0.49) /return "Cyellow"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
344 /if ({1} < {2}*0.66) /return "BCyellow"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
345 /if ({1} < {2}*0.85) /return "Cgreen"%;/endif%;\ |
b779c6ec7392
New function prngetlite(n,nmax) which returns color names based on % ratio of given values.
Matti Hamalainen <ccr@tnsp.org>
parents:
81
diff
changeset
|
346 /return "BCgreen" |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
347 |
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
348 |
283 | 349 ;; Execute macros given as parameters |
350 /def -i prexecfuncs =\ | |
351 /while ({#})\ | |
352 /eval /%{1}%;\ | |
353 /shift%;\ | |
354 /done | |
355 | |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
356 |
299 | 357 ;; Create prettyprint version of a numeric value |
358 /def -i prprettyvalstr =\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
359 /let _jval=$[abs({1})]%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
360 /let _jtmp=$[_jval-trunc(_jval)]%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
361 /if (_jtmp > 0)\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
362 /let _jstr=$[substr(_jtmp,1,3)]%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
363 /else \ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
364 /let _jstr=%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
365 /endif%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
366 /while (_jval >= 1000)\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
367 /let _jstr=,$[replace(" ","0",pad(mod(_jval, 1000.0),3))]%{_jstr}%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
368 /let _jval=$[trunc(_jval / 1000)]%;\ |
299 | 369 /done%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
370 /let _jstr=%{_jval}%{_jstr}%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
371 /if ({1} < 0) /let _jstr=-%{_jstr}%;/endif%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
372 /return _jstr |
299 | 373 |
283 | 374 |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
375 ;; Insert item into list-string variable if it does not exist |
1146
deaf741af85e
Fix prlist_insert() to properly handle items with special characters used in regexps.
Matti Hamalainen <ccr@tnsp.org>
parents:
1145
diff
changeset
|
376 ;; The item may NOT contain whitespace! (This is by design) |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
377 ;; /prlist_insert("list variable name", "item") |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
378 /def -i prlist_insert =\ |
1146
deaf741af85e
Fix prlist_insert() to properly handle items with special characters used in regexps.
Matti Hamalainen <ccr@tnsp.org>
parents:
1145
diff
changeset
|
379 /let _prmatch=$[escape("()|[]^$",{2})]%;\ |
863
7bc694ae2119
v0.6.9.10.1-svn; Beginning of code sanity cleanup. This will be using a TF5-only feature, namely the function version of eval().
Matti Hamalainen <ccr@tnsp.org>
parents:
861
diff
changeset
|
380 /let _prlist= $[eval("/return %{1}",2)] %;\ |
1146
deaf741af85e
Fix prlist_insert() to properly handle items with special characters used in regexps.
Matti Hamalainen <ccr@tnsp.org>
parents:
1145
diff
changeset
|
381 /if (regmatch(strcat("(^",_prmatch,"| ",_prmatch," | ",_prmatch,"$)"),_prlist) <= 0)\ |
821
954f59f625a6
Change the order of item insertion in prlist_insert() to restore how prot informs are formed.
Matti Hamalainen <ccr@tnsp.org>
parents:
819
diff
changeset
|
382 /eval /set %{1}=%{2} %%{%{1}}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
383 /return 1%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
384 /else \ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
385 /return 0%;\ |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
386 /endif |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
387 |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
388 |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
389 ;; Delete item from list-string variable |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
390 ;; /prlist_delete("list variable name", "item") |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
391 /def -i prlist_delete_do =\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
392 /let _tdname=%{1}%;/shift%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
393 /let _tditem=%{1}%;/shift%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
394 /let _tdlist=%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
395 /while ({#})\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
396 /if ({1}!~_tditem)\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
397 /let _tdlist=%{_tdlist} %{1}%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
398 /endif%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
399 /shift%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
400 /done%;\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
401 /eval /set %{_tdname}=%{_tdlist} |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
402 |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
403 |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
404 /def -i prlist_delete =\ |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
405 /eval /prlist_delete_do %{1} %{2} $$[%{1}] |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
406 |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
407 |
1294
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
408 ;; Define a /repeat, but work around the fact that /repeat does NOT |
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
409 ;; return the process id although TF 5.0 beta documentation says so |
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
410 /def -i grepeat =\ |
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
411 /repeat %{*}%;\ |
1295 | 412 /result "$(/last $(/ps -s -r))" |
1294
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
413 |
4986500d464c
Added /grepeat wrapper for /repeat, that fixes some problems with plain vanilla /repeat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1287
diff
changeset
|
414 |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
415 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
295 | 416 ;; Option, setting and hook definition macros |
417 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
418 ;; Define an togglable option | |
419 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
420 /set lst_options= | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
421 /def -i prdeftoggle =\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
422 /if (!getopts("n:d:p", "")) /gerror Invalid toggle creation command!%;/break%;/endif%;\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
423 /if (opt_n=~""|opt_d=~"") /gerror Required arguments not specified!%;/break%;/endif%;\ |
339
224b7014bade
v0.5.10.6: Use prlist_* functions in adding things to internal lists.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
424 /test prlist_insert("lst_options", opt_n)%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
425 /if (opt_p)\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
426 /set opt_%{opt_n}_pre=1%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
427 /else \ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
428 /set opt_%{opt_n}_pre=0%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
429 /endif%;\ |
295 | 430 /set opt_%{opt_n}_d=%{opt_d}%;\ |
431 /eval /def -i %{opt_n} =\ | |
432 /if (opt_%{opt_n}=~"on")\ | |
433 /set opt_%{opt_n}=off%%%;\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
434 /let _qstr=@{Cred}OFF@{n}%%%;\ |
295 | 435 /else \ |
436 /set opt_%{opt_n}=on%%%;\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
437 /let _qstr=@{BCgreen}ON@{n}%%%;\ |
295 | 438 /endif%%%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
439 /msq @{Cyellow}%{opt_d}@{n} [%%%{_qstr}]%%%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
440 /if (opt_%{opt_n}_pre==1)\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
441 /msq @{BCwhite}NOTICE!@{n} Changing this setting requires /gsave and restart to take effect.%%%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
442 /endif |
295 | 443 |
444 | |
445 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
446 ;; Define a value setting | |
447 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
448 /set lst_values= | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
449 /def -i prdefvalue =\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
450 /if (!getopts("n:d:", "")) /gerror Invalid value setting creation command!%;/break%;/endif%;\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
451 /if (opt_n=~""|opt_d=~"") /gerror Required arguments not specified!%;/break%;/endif%;\ |
339
224b7014bade
v0.5.10.6: Use prlist_* functions in adding things to internal lists.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
452 /test prlist_insert("lst_values", opt_n)%;\ |
295 | 453 /set set_%{opt_n}_d=%{opt_d}%;\ |
454 /eval /def -i %{opt_n} =\ | |
455 /if ({#}) \ | |
456 /if ({1}=~"*") \ | |
457 /set set_%{opt_n}=%%%;\ | |
458 /msq @{Cyellow}%{opt_d}@{n} : @{BCgreen}Cleared@{n}%%%;\ | |
459 /else \ | |
460 /set set_%{opt_n}=%%%{*}%%%;\ | |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
461 /msq @{Cyellow}%{opt_d}@{n} [@{Cgreen}$$$[replace("@","@@",{*})]@{n}]%%%;\ |
295 | 462 /endif%%%;\ |
463 /else \ | |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
464 /msq @{Cyellow}%{opt_d}@{n}: [@{Cgreen}$$$[replace("@","@@",set_%{opt_n})]@{n}]%%%;\ |
295 | 465 /msq Use "@{BCyellow}/%{opt_n} *@{n}" to clear.%%%;\ |
466 /endif | |
467 | |
468 | |
469 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
470 ;; Define a setting with legal values | |
471 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
472 /set lst_settings= | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
473 /def -i prchksetting =\ |
338
57884d36173b
Local variable namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
337
diff
changeset
|
474 /set _prdeftmp=0%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
475 /let _qvs=%{1}%;\ |
295 | 476 /shift%;\ |
477 /while ({#})\ | |
338
57884d36173b
Local variable namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
337
diff
changeset
|
478 /if ({1}=~_qvs) /set _prdeftmp=1%;/break%;/endif%;\ |
295 | 479 /shift%;\ |
480 /done | |
481 | |
482 | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
483 /def -i prdefsetting =\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
484 /if (!getopts("n:d:s:", "")) /gerror Invalid setting creation command!%;/break%;/endif%;\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
485 /if (opt_n=~""|opt_d=~""|opt_s=~"") /gerror Required arguments not specified!%;/break%;/endif%;\ |
339
224b7014bade
v0.5.10.6: Use prlist_* functions in adding things to internal lists.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
486 /test prlist_insert("lst_settings", opt_n)%;\ |
295 | 487 /set set_%{opt_n}_d=%{opt_d}%;\ |
488 /set set_%{opt_n}_s=%{opt_s}%;\ | |
489 /eval /def -i %{opt_n} =\ | |
490 /if ({#})\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
491 /prchksetting %%%{1} %%%{set_%{opt_n}_s}%%%;\ |
338
57884d36173b
Local variable namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
337
diff
changeset
|
492 /if (_prdeftmp > 0)\ |
295 | 493 /set set_%{opt_n}=%%%{1}%%%;\ |
494 /msq @{Cyellow}%{opt_n}@{n} : Set to [@{BCgreen}%%%{set_%{opt_n}}@{n}]%%%;\ | |
495 /else \ | |
496 /msq @{Cyellow}%{opt_n}@{n} : @{BCred}Invalid setting@{n} [@{BCgreen}%%%{1}@{n}]!%%%;\ | |
497 /endif%%%;\ | |
498 /else \ | |
499 /msq @{BCred}/%{opt_n}@{n} - @{Cyellow}%{opt_d}@{n} [@{BCgreen}%%%{set_%{opt_n}_s}@{n}]%%%;\ | |
500 /endif | |
501 | |
502 | |
503 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
504 ;; Define a function hook setting | |
505 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
506 /set lst_hooks= | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
507 /def -i prdefhook =\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
508 /if (!getopts("n:d:s:h:", "")) /gerror Invalid function hook setting creation command!%;/break%;/endif%;\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
509 /if (opt_n=~""|opt_d=~""|opt_s=~""|opt_h=~"") /gerror Required arguments not specified!%;/break%;/endif%;\ |
339
224b7014bade
v0.5.10.6: Use prlist_* functions in adding things to internal lists.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
510 /test prlist_insert("lst_hooks", opt_n)%;\ |
295 | 511 /set set_%{opt_n}_d=%{opt_d}%;\ |
512 /set set_%{opt_n}_s=%{opt_s}%;\ | |
513 /eval /def -i %{opt_n} =\ | |
514 /if ({#})\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
515 /prchksetting %%%{1} %%%{set_%{opt_n}_s}%%%;\ |
338
57884d36173b
Local variable namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
337
diff
changeset
|
516 /if (_prdeftmp > 0)\ |
295 | 517 /set set_%{opt_n}=%%%{1}%%%;\ |
518 /msq @{Cyellow}%{opt_n}@{n} : Set to [@{BCgreen}%%%{set_%{opt_n}}@{n}]%%%;\ | |
519 /eval /def -i %{opt_h}=/%{opt_h}_%%%{1} %%%%%*%%%;\ | |
520 /else \ | |
521 /msq @{Cyellow}%{opt_n}@{n} : @{BCred}Invalid setting@{n} [@{BCgreen}%%%{1}@{n}]!%%%;\ | |
522 /endif%%%;\ | |
523 /else \ | |
524 /msq @{BCred}/%{opt_n}@{n} - @{Cyellow}%{opt_d}@{n} [@{BCgreen}%%%{set_%{opt_n}_s}@{n}]%%%;\ | |
525 /endif | |
526 | |
527 | |
528 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
529 ;; Variable saving functionality | |
530 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
531 ;; Define a global, saveable variable | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
532 /set lst_savevars= |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
533 /def -i prdefvar =\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
534 /if (!getopts("n:v:c:", "")) /gerror Invalid save variable definition!%;/break%;/endif%;\ |
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
535 /if (opt_n=~"") /gerror No variable name option specified.%;/break%;/endif%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
536 /if (opt_c!~"") /set comment_%{opt_n}=%{opt_c}%;/endif%;\ |
339
224b7014bade
v0.5.10.6: Use prlist_* functions in adding things to internal lists.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
537 /test prlist_insert("lst_savevars", opt_n)%;\ |
863
7bc694ae2119
v0.6.9.10.1-svn; Beginning of code sanity cleanup. This will be using a TF5-only feature, namely the function version of eval().
Matti Hamalainen <ccr@tnsp.org>
parents:
861
diff
changeset
|
538 /let _dsv=$[prgetval(opt_n)]%;\ |
332
36c9ff0c16af
v0.5.10.3: Preinit settings didn't get actually used in some cases, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
330
diff
changeset
|
539 /if (opt_v!~"" & _dsv=~"")\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
540 /eval /set %{opt_n}=%{opt_v}%;\ |
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
541 /endif |
295 | 542 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
543 /set lst_saveivars= |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
544 /def -i prdefivar =\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
545 /if ({#} < 1) /gerror No arguments specified, at least variable name is required!%;/break%;/endif%;\ |
347 | 546 /test prlist_insert("lst_saveivars", {1})%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
547 /eval /set %{1}=%{-1} |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
548 |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
549 ;; Error reporting |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
550 /def -i gsave_fwrite =\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
551 /let _fresult=$[tfwrite(gsave_file, {1})]%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
552 /if (_fresult < 0)\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
553 /gerror Error #%{_fresult} writing to file '@{Cyellow}%{gsave_filename}@{n}'!%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
554 /return _fresult%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
555 /else \ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
556 /return 0%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
557 /endif |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
558 |
295 | 559 ;; Save given list of variables (set 'gsave_varpref' to prefix) |
560 /def -i gsave_vars =\ | |
561 /while ({#})\ | |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
562 /let _ispre=$[prgetval(strcat(gsave_varpref,{1},"_pre"))]%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
563 /if ((!gsave_onlypre & !_ispre) | (gsave_onlypre & _ispre))\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
564 /let _gsa=$[prgetval(strcat("comment_", gsave_varpref, {1}))]%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
565 /if (_gsa!~"")\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
566 /let _gsa=; %{_gsa}%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
567 /if (gsave_fwrite(_gsa) < 0) /return%;/endif%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
568 /endif%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
569 /let _gva=%{gsave_varpref}%{1}%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
570 /let _gsa=/set %{_gva}=$[prgetval(_gva)]%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
571 /if (gsave_fwrite(_gsa) < 0) /return%;/endif%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
572 /if (gsave_fwrite("") < 0) /return%;/endif%;\ |
326
6e10442a8432
v0.5.9.29: Improved error checking in various /def*-macros; /defvar functionality and syntax changed, added possibility to have comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
321
diff
changeset
|
573 /endif%;\ |
295 | 574 /shift%;\ |
575 /done | |
576 | |
577 ;; Save given list of hooks | |
578 /def -i gsave_hooks =\ | |
579 /while ({#})\ | |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
580 /let _gsa=/%{1} $[prgetval(strcat("set_", {1}))]%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
581 /if (gsave_fwrite(_gsa) < 0) /return%;/endif%;\ |
295 | 582 /shift%;\ |
583 /done | |
584 | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
585 ;; Save a separator |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
586 /def -i gsave_separator =\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
587 /let _ss=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
588 /if (gsave_fwrite(_ss) < 0) /return%;/endif |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
589 |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
590 ;; Save a header string |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
591 /def -i gsave_header =\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
592 /gsave_separator%;\ |
369
f0dfef8c5fcb
ftime() requires two arguments in TF4, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
361
diff
changeset
|
593 /let _ss=;; GgrTF v%{ggrtf_ver} %{1}-INIT savefile ($[ftime(fmt_date,time())])%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
594 /if (gsave_fwrite(_ss) < 0) /return%;/endif%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
595 /gsave_separator |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
596 |
295 | 597 |
598 ;; Save status | |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
599 /def -i gsave_fileopen=\ |
1271
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
600 /set gsave_filename=$[strcat(set_datapath,set_saveprefix,{2})]%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
601 /set gsave_file=$[tfopen(gsave_filename, "w")]%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
602 /if (gsave_file < 0)\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
603 /gerror Could not create/open savefile '@{Cyellow}%{gsave_filename}@{n}', err=%{gsave_file}!%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
604 /else \ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
605 /msq @{BCgreen}Saving %{1} settings to@{n} '@{Cyellow}%{gsave_filename}@{n}'%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
606 /endif%;\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
607 /return gsave_file |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
608 |
1271
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
609 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
610 ;@command /gsave |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
611 ;@desc Save all GgrTF settings. Refer to <link linkend="usage-general-saves">state saving</link> section for more information. |
295 | 612 /def -i gsave =\ |
1271
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
613 /let _testfile=$[tfopen(strcat(set_datapath, "dirtest"), "w")]%;\ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
614 /if (_testfile < 0)\ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
615 /msq @{Cred}Datapath@{n} '@{Cyellow}%{set_datapath}@{n}' @{Cred}might not exist, trying to create directory.@{n}%;\ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
616 /sys mkdir %{set_datapath}%;\ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
617 /else \ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
618 /test tfclose(_testfile)%;\ |
bb99e40405f6
Automagically create datapath directory if it does not seem to exist already.
Matti Hamalainen <ccr@tnsp.org>
parents:
1269
diff
changeset
|
619 /endif%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
620 /if (gsave_fileopen("pre-init", "pre.tf") < 0)\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
621 /break%;\ |
295 | 622 /else \ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
623 /gsave_header PRE%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
624 /set gsave_onlypre=0%;\ |
295 | 625 /set gsave_varpref=%;/gsave_vars %{lst_savevars}%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
626 /gsave_separator%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
627 /set gsave_onlypre=1%;\ |
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
628 /set gsave_varpref=opt_%;/gsave_vars %{lst_options}%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
629 /test tfclose(gsave_file)%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
630 /endif%;\ |
908
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
631 /if (gsave_fileopen("post-init", "post.tf") < 0)\ |
48a0c7207aae
Partial cleanup and rewriting of the save system.
Matti Hamalainen <ccr@tnsp.org>
parents:
887
diff
changeset
|
632 /break%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
633 /else \ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
634 /gsave_header POST%;\ |
1037
3ce10de3f7d8
Improvements in variable saving.
Matti Hamalainen <ccr@tnsp.org>
parents:
1034
diff
changeset
|
635 /set gsave_onlypre=0%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
636 /set gsave_varpref=%;/gsave_vars %{lst_saveivars}%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
637 /gsave_separator%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
638 /gsave_hooks %{lst_hooks}%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
639 /gsave_separator%;\ |
295 | 640 /set gsave_varpref=set_%;/gsave_vars %{lst_settings}%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
641 /gsave_separator%;\ |
295 | 642 /set gsave_varpref=set_%;/gsave_vars %{lst_values}%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
643 /gsave_separator%;\ |
295 | 644 /set gsave_varpref=opt_%;/gsave_vars %{lst_options}%;\ |
645 /test tfclose(gsave_file)%;\ | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
646 /endif%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
647 /msq @{BCgreen}Done.@{n}%;\ |
295 | 648 |
649 | |
650 ;; Load status | |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
651 ;@command /gload |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
652 ;@desc Load GgrTF settings. Refer to <link linkend="usage-general-saves">state saving</link> section for more information. |
295 | 653 /def -i gload =\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
654 /let _spostinit=%{set_datapath}%{set_saveprefix}post.tf%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
655 /msq @{BCgreen}Loading post-init settings from@{n} '@{Cyellow}%{_spostinit}@{n}'%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
656 /load -q %{_spostinit}%;\ |
295 | 657 /msq @{BCgreen}Done.@{n}%;\ |
658 | |
659 | |
660 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
661 ;; Hooks and bindings | |
662 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
663 /set lst_bindings= |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
664 |
295 | 665 ;; Define a generic command/macro bind |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
666 ; -s"<name>" String to bind |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
667 ; -c"<command>" Command/macro to be executed |
394
ed989c51b94e
v0.5.11.3: Moved functionality from temp to tarmalen module and
Matti Hamalainen <ccr@tnsp.org>
parents:
385
diff
changeset
|
668 ; -n Does not need/accept arguments |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
669 /def -i prdefgbind =\ |
731
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
670 /if (opt_bindings!~"on") /break%;/endif%;\ |
377
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
671 /if (!getopts("s:c:n", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
672 /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
673 /set bind_%{opt_s}_n=2%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
674 /set bind_%{opt_s}_t=G%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
675 /set bind_%{opt_s}_c=%{opt_c}%;\ |
377
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
676 /if (opt_n)\ |
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
677 /let _qs=%;\ |
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
678 /else \ |
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
679 /let _qs= %%%{-1}%;\ |
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
680 /endif%;\ |
604 | 681 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} = %{opt_c}%{_qs} |
295 | 682 |
683 | |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
684 ;; Define a skill bind with optional party reporting |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
685 ; -s"<name>" String to bind |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
686 ; -c"<skill name>" Name of the skill to be executed |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
687 ; -n Skill does not use a target |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
688 ; -d"<message>" Use non-default message for reporting |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
689 ; -q Quiet (no reporting) |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
690 /def -i prdefsbind =\ |
731
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
691 /if (opt_bindings!~"on") /break%;/endif%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
692 /if (!getopts("s:c:m:d:nq", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
693 /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
694 /set bind_%{opt_s}_t=S%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
695 /set bind_%{opt_s}_c=%{opt_c}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
696 /let _qs=$[tolower(opt_c)]%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
697 /if (opt_d!~"") /let _qm=%{opt_d}%;/else /let _qm=%{opt_c}%;/endif%;\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
698 /if (opt_n)\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
699 /set bind_%{opt_s}_n=0%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
700 /let _qw=%{_qm} ...%;\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
701 /else \ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
702 /set bind_%{opt_s}_n=1%;\ |
370
804a4486a281
Bindings used only first given argument, fixed; Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
369
diff
changeset
|
703 /let _qw=%{_qm} -> %%%{-1}%;\ |
804a4486a281
Bindings used only first given argument, fixed; Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
369
diff
changeset
|
704 /let _qs='%{_qs}' %%%{-1}%;\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
705 /endif%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
706 /if (opt_q)\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
707 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} =\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
708 @use %{_qs}%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
709 /else \ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
710 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} =\ |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
711 /msb %{_qw}%%%;@use %{_qs}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
712 /endif |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
713 |
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
714 |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
715 ;; Define a spellcasting (at a target) bind with optional party reporting |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
716 ; Usage same as with /prdefsbind |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
717 /def -i prdefcbind =\ |
731
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
718 /if (opt_bindings!~"on") /break%;/endif%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
719 /if (!getopts("s:c:d:nq", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
720 /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
721 /set bind_%{opt_s}_t=C%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
722 /set bind_%{opt_s}_c=%{opt_c}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
723 /let _qs=$[tolower(opt_c)]%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
724 /if (opt_d!~"") /let _qm=%{opt_d}%;/else /let _qm=%{opt_c}%;/endif%;\ |
295 | 725 /if (opt_n)\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
726 /set bind_%{opt_s}_n=0%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
727 /let _qw=%{_qm} ...%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
728 /else \ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
729 /set bind_%{opt_s}_n=1%;\ |
370
804a4486a281
Bindings used only first given argument, fixed; Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
369
diff
changeset
|
730 /let _qw=%{_qm} -> %%%{-1}%;\ |
804a4486a281
Bindings used only first given argument, fixed; Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
369
diff
changeset
|
731 /let _qs='%{_qs}' %%%{-1}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
732 /endif%;\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
733 /if (opt_q)\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
734 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} =\ |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
735 @cast %{_qs}%;\ |
295 | 736 /else \ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
737 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} =\ |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
738 /msb %{_qw}%%%;@cast %{_qs}%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
739 /endif |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
740 |
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
741 |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
742 ;; List bindings |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
743 /def -i prs = /return {*} |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
744 |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
745 /def -i gbindings_dolist =\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
746 /while ({#})\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
747 /let _bval_t=$[prgetval(strcat("bind_",{1},"_t"))]%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
748 /let _bval_c=$[prgetval(strcat("bind_",{1},"_c"))]%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
749 /let _bval_n=$[prgetval(strcat("bind_",{1},"_n"))]%;\ |
1310
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
750 /if (_bval_n==0) /let _ttc=Cred%;/let _tt=No%;\ |
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
751 /elseif (_bval_n==1) /let _ttc=Cgreen%;/let _tt=Yes%;\ |
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
752 /else /let _ttc=Ccyan%;/let _tt=?%;\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
753 /endif%;\ |
1310
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
754 /if (_bval_t=~"G") /let _tc=BCred%;\ |
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
755 /elseif (_bval_t=~"S") /let _tc=BCgreen%;\ |
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
756 /elseif (_bval_t=~"C") /let _tc=BCcyan%;\ |
365229e92169
Actually, replace the hooks with a different kind of reminder bell functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1295
diff
changeset
|
757 /else /let _tc=%{BCwhite}%;\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
758 /endif%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
759 /msw | @{BCyellow}$[prsubipad({1},14)]@{n} | @{%{_tc}}%{_bval_t}@{n} | @{BCmagenta}$[prsubipad(_bval_c,40)]@{n} | @{%{_ttc}}$[pad(_tt,3)]@{n} |%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
760 /shift%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
761 /done |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
762 |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
763 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
764 ;@command /binds |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
765 ;@desc List all currently defined GgrTF command bindings. Refer to |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
766 ;@desc <link linkend="usage-general-binds">bindings</link> section for |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
767 ;@desc more information and example output. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
768 |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
769 /def -i binds =\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
770 /msw ,----------------.%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
771 /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Bindings@{n} |%;\ |
346
4c2c239fc525
Namespace- and cosmetic fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
342
diff
changeset
|
772 /msw +----------------+----------------------------------------------------.%;\ |
342
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
773 /gbindings_dolist %{lst_bindings}%;\ |
8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
Matti Hamalainen <ccr@tnsp.org>
parents:
341
diff
changeset
|
774 /msw `---------------------------------------------------------------------' |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
775 |
295 | 776 |
777 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
95 | 778 ;; Report current statistics |
127 | 779 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
780 /def -i gsprints =\ |
550 | 781 /if ({1}!~"")\ |
551 | 782 /msw | $[prpadwith({1},18,".")]: $[pad({2},-47)] |%;\ |
550 | 783 /else \ |
551 | 784 /msw | $[pad("",-18)]: $[pad({2},-47)] |%;\ |
550 | 785 /endif |
786 | |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
787 /def -i gsprintl =\ |
551 | 788 /msw |$[prpadwith("",69,"-")]| |
550 | 789 |
790 | |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
791 ;@command /stats |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
792 ;@desc Display miscellaneous statistics about skills, spells, etc. |
95 | 793 /def -i stats =\ |
190
86df6dc4c4cb
Changed output of /opts, /stats, /hstats, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
188
diff
changeset
|
794 /msw ,------------------.%;\ |
86df6dc4c4cb
Changed output of /opts, /stats, /hstats, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
188
diff
changeset
|
795 /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Statistics@{n} |%;\ |
551 | 796 /msw +------------------+--------------------------------------------------.%;\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
797 /test gsprints("Gathered since", "$[ftime(fmt_date,cnt_date)]")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
798 /gsprintl%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
799 /test gsprints("Spells", "%{cnt_casts} casts total, %{cnt_scasts} successful.")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
800 /test gsprints(" uncompleted", "%{cnt_fcasts} failed, %{cnt_icasts} interrupted, %{cnt_fucasts} fumbled.")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
801 /test gsprints(" hastes", "%{cnt_hastes} hastes, %{cnt_ghastes} ghastes, %{cnt_trounds} total rounds.")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
802 /test gsprints(" time spent", "$[prgettime(cnt_ctime)] ($[prround(cnt_ctime,2)]s) total, $[prstdiv(cnt_ctime,cnt_trounds)]s/rnd, $[prstdiv(cnt_ctime,cnt_scasts)]s/cast")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
803 /test gsprints(" crits", "%{cnt_damcrits} total, %{cnt_dcrit1} lvl#1, %{cnt_dcrit2} lvl#2, %{cnt_dcrit3} lvl#3")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
804 /test gsprints("", "%{cnt_dcrit4} mage essence")%;\ |
550 | 805 /prexecfuncs %{lst_stats_spell}%;\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
806 /gsprintl%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
807 /test gsprints("Skills", "%{cnt_skills} skills total, %{cnt_sskills} successful.")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
808 /test gsprints(" uncompleted", "%{cnt_fskills} fail, %{cnt_iskills} intr, %{cnt_fuskills} fumbled.")%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
809 /test gsprints(" time spent", "$[prgettime(cnt_sktime)] ($[prround(cnt_sktime,2)]s) total, $[prstdiv(cnt_sktime,cnt_sskills)]s/skill")%;\ |
550 | 810 /prexecfuncs %{lst_stats_skill}%;\ |
551 | 811 /msw `---------------------------------------------------------------------' |
95 | 812 |
813 | |
814 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
283 | 815 ;; List available options / settings |
127 | 816 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
817 /def -i gopts_dolist =\ |
16
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
818 /while ({#})\ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
819 /let _bval=$[prgetval(strcat("opt_",{1}))]%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
820 /let _bval_d=$[prgetval(strcat("opt_",{1},"_d"))]%;\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
821 /if (_bval=~"on")\ |
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
822 /let _bval_s=@{BCgreen} ON@{n}%;\ |
95 | 823 /else \ |
911
f15c9e86d40b
Bunch of code cleanups from "/eval /set" crap to prgetval()
Matti Hamalainen <ccr@tnsp.org>
parents:
910
diff
changeset
|
824 /let _bval_s=@{Cred}OFF@{n}%;\ |
95 | 825 /endif%;\ |
923
93cd8f56d7be
Use prsubipad() and prsubpad() where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
922
diff
changeset
|
826 /msw | /@{BCyellow}$[pad({1},-10)]@{n} : $[prsubipad(_bval_d,45)] - [%{_bval_s}] |%;\ |
18 | 827 /shift%;\ |
828 /done | |
829 | |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
830 /def -i gsettings_dolist =\ |
18 | 831 /while ({#})\ |
922
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
832 /let _bval=$[prgetval(strcat("set_",{1}))]%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
833 /let _bval_d=$[prgetval(strcat("set_",{1},"_d"))]%;\ |
934
38f6c1c124b8
Some option descriptions in /opts panel were not showing due to typo left in a statement, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
924
diff
changeset
|
834 /msw | /@{BCyellow}$[pad({1},-10)]@{n} : $[prsubipad(_bval_d,45)] - [@{Cgreen}$[prsubpad(_bval,8)]@{n}] |%;\ |
16
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
835 /shift%;\ |
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
836 /done |
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
837 |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
838 /def -i gvalues_dolist =\ |
126
d6f7bd31e8ce
Removed hardcoded @scan from combat round trigger, instead added a new
Matti Hamalainen <ccr@tnsp.org>
parents:
123
diff
changeset
|
839 /while ({#})\ |
922
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
840 /let _bval=$[prgetval(strcat("set_",{1}))]%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
841 /let _bval_d=$[prgetval(strcat("set_",{1},"_d"))]%;\ |
636
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
842 /msw |--------------------------------------------------------------------------|%;\ |
922
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
843 /msw | /@{BCyellow}$[pad({1},-10)]@{n} : $[pad(_bval_d,-58)] |%;\ |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
844 /msd | [$[prsubipad(_bval,58)]] |%;\ |
126
d6f7bd31e8ce
Removed hardcoded @scan from combat round trigger, instead added a new
Matti Hamalainen <ccr@tnsp.org>
parents:
123
diff
changeset
|
845 /shift%;\ |
d6f7bd31e8ce
Removed hardcoded @scan from combat round trigger, instead added a new
Matti Hamalainen <ccr@tnsp.org>
parents:
123
diff
changeset
|
846 /done |
d6f7bd31e8ce
Removed hardcoded @scan from combat round trigger, instead added a new
Matti Hamalainen <ccr@tnsp.org>
parents:
123
diff
changeset
|
847 |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
848 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
849 ;@command /opts |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
850 ;@desc Lists all the run-time changeable settings of GgrTF, with short descriptions and current values. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
851 |
18 | 852 /def -i opts =\ |
190
86df6dc4c4cb
Changed output of /opts, /stats, /hstats, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
188
diff
changeset
|
853 /msw ,----------------.%;\ |
86df6dc4c4cb
Changed output of /opts, /stats, /hstats, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
188
diff
changeset
|
854 /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Settings@{n} |%;\ |
636
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
855 /msw +----------------+---------------------------------------------------------.%;\ |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
856 /gopts_dolist %{lst_options}%;\ |
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
857 /gsettings_dolist %{lst_settings}%;\ |
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
858 /gsettings_dolist %{lst_hooks}%;\ |
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
859 /gvalues_dolist %{lst_values}%;\ |
636
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
860 /msw `--------------------------------------------------------------------------' |
16
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
861 |
8aa9dd72b082
New command /opts which lists all available option settings and their
Matti Hamalainen <ccr@tnsp.org>
parents:
15
diff
changeset
|
862 |
18 | 863 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
864 ;; Define some generic option toggles and settings | |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
865 ;@command /verbose |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
866 ;@desc Toggle in-MUD verbosity on and off. Off means that some things are |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
867 ;@desc echoed to client only, aka you. On means that those things are |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
868 ;@desc reported on party channel, etc. |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
869 /prdeftoggle -n"verbose" -d"Verbose (off = echo to client only)" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
870 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
871 ;@command /skspam |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
872 ;@desc Toggle skill/spell start/end liting spam. If disabled, normal |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
873 ;@desc BatMUD skill and spell start and finish lines are let through unmangled. |
595
3cb2f995ad46
Make skill/spell "spam" optional
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
874 /prdeftoggle -n"skspam" -d"Skill/Spell start/end 'lite' spam" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
875 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
876 ;@command /rrounds |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
877 ;@desc Report spell rounds to 'party report' channel. This functionality has |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
878 ;@desc some minor "intelligence" to report only relevant information, but |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
879 ;@desc it may be considered spammy and annoying by many people. |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
880 /prdeftoggle -n"rrounds" -d"Report spell/skill rounds" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
881 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
882 ;@command /roundmin <value> |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
883 ;@desc Maximum amount of spell rounds left before reporting number of rounds. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
884 ;@desc See /rrounds setting. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
885 /prdefvalue -n"roundmin" -d"Amount of rounds left when to report" |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
886 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
887 ;@command /autopss |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
888 ;@desc Toggle autopss-functionality on/off. If enabled, /pss macro is executed |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
889 ;@desc on each battle round flag. By default, /pss is 'party short status', but |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
890 ;@desc some modules (like <link linkend="usage-pssmangle">PSS-mangler</link>) |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
891 ;@desc override this to provide additional functionality. |
419
c728ff45b78a
v0.6.0-pre4: /pstatus was changed to /pss and old /pss toggle is now /autopss;
Matti Hamalainen <ccr@tnsp.org>
parents:
417
diff
changeset
|
892 /prdeftoggle -n"autopss" -d"Auto party short status" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
893 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
894 ;@command /gagsc |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
895 ;@desc Toggle gagging of short score ('sc') messages. |
424
44d19767df30
Added option to gag short score messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
419
diff
changeset
|
896 /prdeftoggle -n"gagsc" -d"Gag Short Score ('sc') messages" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
897 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
898 ;@command /round [commands] |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
899 ;@desc Sets the BatMUD command(s) to be executed on each battle round. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
900 ;@desc The string of commands is sent to the MUD when battle round flag is received. |
796
acf9184fe81c
Make /round macro description more informative.
Matti Hamalainen <ccr@tnsp.org>
parents:
795
diff
changeset
|
901 /prdefvalue -n"round" -d"Commands to execute on each battle round marker" |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
902 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
903 ;@command /rmisc |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
904 ;@desc Toggle miscellaneous reporting features. |
861 | 905 /prdeftoggle -n"rmisc" -d"Miscellaneous reporting" |
906 /set opt_rmisc=on | |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
907 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
908 ;@command /rcda |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
909 ;@desc Toggle reporting of Combat Damage Analysis. If set 'off', CDA reports |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
910 ;@desc are only displayed locally to you, if set 'on', reporting is done to party report channel. |
861 | 911 /prdeftoggle -n"rcda" -d"Combat Damage Analysis reporting" |
912 /set opt_rcda=on | |
1 | 913 |
1654
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
914 ;@command /grepcmd [grep command] |
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
915 ;@desc Set what BatMUD command GgrTF uses for all 'grep' actions. |
1657 | 916 ;@desc Default value is 'grep'. The value is automatically prefixed with a '@@' escape sequence. |
917 /prdefvalue -n"grepcmd" -d"BatMUD command for 'grep'" | |
1654
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
918 |
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
919 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
920 /def -i pss = @@party status short |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
921 |
295 | 922 |
19
284750e78f5e
New module added for Lords of Chaos: ggrtf-loc.tf
Matti Hamalainen <ccr@tnsp.org>
parents:
18
diff
changeset
|
923 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
95 | 924 ;; Define RIP functions and hook |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
925 /def -i prdefripfunc =\ |
67
b7bce888a8e8
Partially rewrote the RIP action/function hooking system.
Matti Hamalainen <ccr@tnsp.org>
parents:
66
diff
changeset
|
926 /eval /set set_ripaction_s=%{1} %{set_ripaction_s}%;\ |
b7bce888a8e8
Partially rewrote the RIP action/function hooking system.
Matti Hamalainen <ccr@tnsp.org>
parents:
66
diff
changeset
|
927 /eval /def -i ripfunc_%{1} = %{-1} |
b7bce888a8e8
Partially rewrote the RIP action/function hooking system.
Matti Hamalainen <ccr@tnsp.org>
parents:
66
diff
changeset
|
928 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
929 /prdefripfunc off |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
930 /prdefripfunc dig /dig_grave |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
931 /prdefripfunc eat /eat_corpse |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
932 /prdefripfunc get /get_corpse |
1030 | 933 /prdefripfunc cmd /eval %%{set_ripcommand} |
67
b7bce888a8e8
Partially rewrote the RIP action/function hooking system.
Matti Hamalainen <ccr@tnsp.org>
parents:
66
diff
changeset
|
934 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
935 ;@command /ripaction <action> |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
936 ;@desc Set the action performed at opponent RIP. Possible additional settings |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
937 ;@desc may be provided by other loaded modules. Functions provided by base GgrTF are: |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
938 ;@desc <emphasis>off</emphasis> (no special action performed), |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
939 ;@desc <emphasis>dig</emphasis> (dig grave for corpse), |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
940 ;@desc <emphasis>eat</emphasis> (get and eat corpse), |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
941 ;@desc <emphasis>get</emphasis> (get corpse) and |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
942 ;@desc <emphasis>cmd</emphasis> (execute mud command(s) specified with /ripcommand setting, see /ripcommand) |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
943 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
944 /prdefhook -n"ripaction" -d"Set the action performed at monster RIP" -h"ripfunc" -s"off dig eat get cmd" |
67
b7bce888a8e8
Partially rewrote the RIP action/function hooking system.
Matti Hamalainen <ccr@tnsp.org>
parents:
66
diff
changeset
|
945 /ripaction off |
1 | 946 |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
947 ;; RIP command |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
948 ;@command /ripcommand [commands] |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
949 ;@desc Sets the MUD command(s) to be executed if /ripaction is set to "cmd". |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
950 ;@desc This string is sent "as is" to the MUD at opponent R.I.P, if /ripaction is "cmd". |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
951 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
952 /prdefvalue -n"ripcommand" -d"Commands to be executed if ripaction = cmd" |
264
176d9060a00a
New ripaction, "cmd", added, which executes string of commands (see /ripcommand)
Matti Hamalainen <ccr@tnsp.org>
parents:
253
diff
changeset
|
953 |
295 | 954 |
955 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
956 ;; LoC-action |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
957 ;@desc Sets action taken after a Lord of Chaos performs "blood corpse". |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
958 ;@desc This is useful for automating corpse handling, if you are a LoC |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
959 ;@desc yourself, or are partying with one. |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
960 |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
961 /prdefsetting -n"locaction" -d"Set action performed after blood corpse" -s"off dig eat get cmd" |
142
6f68da538115
- created a new barbarian module
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
138
diff
changeset
|
962 /locaction off |
6f68da538115
- created a new barbarian module
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
138
diff
changeset
|
963 |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
964 ;; LoC command |
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
965 /prdefvalue -n"loccommand" -d"Commands to be executed if locaction = cmd" |
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
966 |
919
2bca6a1ca4a4
Use a different regexp for xmas elfness.
Matti Hamalainen <ccr@tnsp.org>
parents:
918
diff
changeset
|
967 /def -i -F -p9999 -mregexp -t"^([A-Z][a-z]+)(| the christmas elf) holds (.+) over the still form of (its|her|his) fallen foe\.$" gloc_blood =\ |
918
00dab000ec6d
Fix loc- and lichaction to support christmas elfness.
Matti Hamalainen <ccr@tnsp.org>
parents:
916
diff
changeset
|
968 /substitute -p @{BCyellow}%{P1}@{n} @{BCwhite}holds@{n} @{Cred}%{P3}@{n} @{BCwhite}over the still form of %{P4} fallen foe.@{n}%;\ |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
969 /if (set_locaction=~"dig") /dig_grave%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
970 /elseif (set_locaction=~"eat") /eat_corpse%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
971 /elseif (set_locaction=~"get") /get_corpse%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
972 /elseif (set_locaction=~"cmd") %{set_loccommand}%;/endif |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
973 |
142
6f68da538115
- created a new barbarian module
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
138
diff
changeset
|
974 |
385
c2588ed6386e
Lich soul sucking thingy trig
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
381
diff
changeset
|
975 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
c2588ed6386e
Lich soul sucking thingy trig
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
381
diff
changeset
|
976 ;; Lich-action |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
977 ;@command /lichaction <action> |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
978 ;@desc Sets action taken after a Lich performs "soul sucking". |
385
c2588ed6386e
Lich soul sucking thingy trig
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
381
diff
changeset
|
979 /prdefsetting -n"lichaction" -d"Set action performed after lich sucking" -s"off dig eat get" |
c2588ed6386e
Lich soul sucking thingy trig
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
381
diff
changeset
|
980 /lichaction off |
c2588ed6386e
Lich soul sucking thingy trig
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
381
diff
changeset
|
981 |
919
2bca6a1ca4a4
Use a different regexp for xmas elfness.
Matti Hamalainen <ccr@tnsp.org>
parents:
918
diff
changeset
|
982 /def -i -F -p9999 -mregexp -t"^([A-Z][a-z]+)(| the christmas elf) (chants with an eerie hollow voice some arcane sounding words\.)$" glich_suck =\ |
918
00dab000ec6d
Fix loc- and lichaction to support christmas elfness.
Matti Hamalainen <ccr@tnsp.org>
parents:
916
diff
changeset
|
983 /substitute -p @{BCyellow}%{P1}@{n} @{BCwhite}%{P3}@{n}%;\ |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
984 /if (set_lichaction=~"dig") /dig_grave%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
985 /elseif (set_lichaction=~"eat") /eat_corpse%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
986 /elseif (set_lichaction=~"get") /get_corpse%;/endif |
142
6f68da538115
- created a new barbarian module
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
138
diff
changeset
|
987 |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
988 |
1 | 989 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
990 ;; Movement | |
991 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
992 ;; Catch movement commands to update the status bar |
1663
199b9d60dbd4
Tiny code reformat / cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
993 /def -i -p9999 -mglob -h"SEND {n|s|e|w|ne|sw|nw|se|u|d}" prmove_send =\ |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
994 /set prmove_last=%*%;\ |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
995 /gstatus_update%;\ |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
996 /send %* |
1 | 997 |
1619
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
998 /set prmove_trans_n=north |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
999 /set prmove_trans_s=south |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1000 /set prmove_trans_e=east |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1001 /set prmove_trans_w=west |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1002 |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1003 /set prmove_trans_ne=northeast |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1004 /set prmove_trans_se=southeast |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1005 /set prmove_trans_nw=northwest |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1006 /set prmove_trans_sw=southwest |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1007 |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1008 |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1009 ;; Normal movement |
1663
199b9d60dbd4
Tiny code reformat / cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1010 /def -i prmove_walk =\ |
199b9d60dbd4
Tiny code reformat / cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1011 /set prmove_last=%{1}%;\ |
199b9d60dbd4
Tiny code reformat / cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1012 /gstatus_update%;\ |
1619
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1013 @@$[prgetval(strcat("prmove_trans_",{1}))] |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1014 |
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1015 ;; Autopeering |
983
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1016 /def -i prmove_peer =\ |
1619
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1017 /set prmove_last=%{1}%;/gstatus_update%;\ |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1018 @@$[prgetval(strcat("prmove_trans_",{1}))]%;\ |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1019 /if ({1}=~"n" | {1}=~"s") /let pd1=west%;/let pd2=east%;\ |
37a7899e882e
Implement direction translation in default move/peer modes, e.g. n/s/w/e/etc
Matti Hamalainen <ccr@tnsp.org>
parents:
1614
diff
changeset
|
1020 /elseif ({1}=~"w" | {1}=~"e") /let pd1=north%;/let pd2=south%;\ |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1021 /else /break%;/endif%;\ |
1654
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1022 @@%{set_grepcmd} '(%{set_peer})' peer %{pd1}%;\ |
a599a9429928
Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1023 @@%{set_grepcmd} '(%{set_peer})' peer %{pd2} |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1024 |
1663
199b9d60dbd4
Tiny code reformat / cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1025 |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1026 ;; Main handling macro for binding movemement keys, etc. |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1027 ;@command /move <type> |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1028 ;@desc Change the meaning of <link linkend="usage-general-prmove">keyboard movement hooks</link>. |
797 | 1029 /prdefhook -n"move" -d"Keyboard numpad movement hooks" -h"prmove" -s"walk ship peer" |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1030 /move walk |
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1031 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1032 ;@command /peer [regexp string] |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1033 ;@desc View or set regular expression used with autopeering movement mode (/move peer). |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1034 /prdefvalue -n"peer" -d"Regular expression used with autopeering" |
283 | 1035 |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1036 |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1037 ;; Ship movement |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1038 ;@command /cruise |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1039 ;@desc Toggle cruise mode if movement mode is ship (/move ship). |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1040 /prdeftoggle -n"cruise" -d"Cruise speed on ship (off = sail)" |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1041 /def -i prmove_ship =\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1042 /set prmove_last=%{1}%;/gstatus_update%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1043 /if ({1}=~"X") @@sail stop%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1044 /elseif (opt_cruise=~"on") @@cruise %{1}%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1045 /else @@sail %{1}%;/endif |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1046 |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1047 |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1048 ;; Ship viewing setting |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1049 ;@command /shipmove <off|view|map> |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1050 ;@desc Set what action is performed when ship movement is detected. |
588
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1051 /prdefsetting -n"shipmove" -d"Action on ship movement" -s"off view map" |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1052 /shipmove off |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1053 |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1054 /def -i -F -mregexp -t"^The ship (sails|cruises) " gship_move =\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1055 /if (set_shipmove=~"view") @@view%;\ |
294f8fa08285
v0.6.1.15; New setting for spamming 'view' or 'map' on ship movement; Improvements in other movement logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
582
diff
changeset
|
1056 /elseif (set_shipmove=~"map") @@map%;/endif |
1 | 1057 |
1058 | |
1059 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1060 ;; Status bar |
1 | 1061 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1062 ; These macros handle the statusbar functionality. Unfortunately |
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1063 ; some things (like channeller energy aura), etc. are hardcoded here, |
1175 | 1064 ; due to some complexities in modularizing them. |
42
8bf52a7380ef
New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
41
diff
changeset
|
1065 |
1 | 1066 ;; Add value item (hp/sp/ep/etc) to status string |
291 | 1067 /def -i gstatus_add_val =\ |
289 | 1068 /set status_w=$[status_w+13]%;\ |
922
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1069 /let _val1=status_%{1}%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1070 /let _val2=status_%{1}max%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1071 /let _val1v=$[prgetval(_qtval1)]%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1072 /let _val2v=$[prgetval(_qtval2)]%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1073 /let _vcol=$[prgetnlite(_val1v,_val2v)]%;\ |
8cf55d010545
More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
921
diff
changeset
|
1074 /set status_pstr=%{status_pstr} "[" "%{2}:":2:BCwhite %{_val1}:-4:%{_vcol} "/" %{_val2}:-4:BCgreen "]" |
1 | 1075 |
1176
595568345130
Add function gstatus_add_var for adding arbitrary variables with labels to statusline.
Matti Hamalainen <ccr@tnsp.org>
parents:
1175
diff
changeset
|
1076 /def -i gstatus_add_var =\ |
595568345130
Add function gstatus_add_var for adding arbitrary variables with labels to statusline.
Matti Hamalainen <ccr@tnsp.org>
parents:
1175
diff
changeset
|
1077 /let _vlabel=%{1}%;\ |
1188
0dbe46e04a09
Modify gstatus_add_var again to better fit upcoming changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1187
diff
changeset
|
1078 /let _vstr=$[prgetval({2})]%;\ |
0dbe46e04a09
Modify gstatus_add_var again to better fit upcoming changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1187
diff
changeset
|
1079 /if ({3} > 0) /let _vstr=$[prsubpad(_vstr,{3})]%;/endif%;\ |
1192
0562e36b6418
Oops, forgot to change one variable name to correct one in gstatus_add_var(). Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1191
diff
changeset
|
1080 /set status_w=$[status_w+strlen(_vlabel)+strlen(_vstr)+3]%;\ |
1188
0dbe46e04a09
Modify gstatus_add_var again to better fit upcoming changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
1187
diff
changeset
|
1081 /set status_pstr=%{status_pstr} "[" "%{_vlabel}:"::BCwhite "%{_vstr}"::BCcyan "]" |
1176
595568345130
Add function gstatus_add_var for adding arbitrary variables with labels to statusline.
Matti Hamalainen <ccr@tnsp.org>
parents:
1175
diff
changeset
|
1082 |
1 | 1083 ;; Add aura item |
291 | 1084 /def -i gstatus_add_aura =\ |
1167 | 1085 /if (prot_eaura > 0)\ |
1086 /if (prot_eaura == 1) /let _ucol=BCyellow%;/endif%;\ | |
1087 /if (prot_eaura == 2) /let _ucol=BCred%;/endif%;\ | |
1088 /if (prot_eaura == 3) /let _ucol=BCblue%;/endif%;\ | |
1089 /if (prot_eaura_weak=~"on")\ | |
1170
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1090 /let _utime=$[prgettime(time()-prot_eaura_weak_t)]%;\ |
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1091 /set status_w=$[status_w+8+5+strlen(_utime)]%;\ |
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1092 /set status_pstr=%{status_pstr} "[" "EAura%{prot_eaura}":5:%{_ucol} "/" "WEAK":4:BCwhite ":" "%{_utime}"::BCwhite "]"%;\ |
1167 | 1093 /else \ |
1170
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1094 /let _utime=$[prgettime(time()-prot_eaura_t)]%;\ |
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1095 /set status_w=$[status_w+8+strlen(_utime)]%;\ |
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1096 /set status_pstr=%{status_pstr} "[" "EAura%{prot_eaura}":5:%{_ucol} ":" "%{_utime}" "]"%;\ |
1167 | 1097 /endif%;\ |
1098 /endif | |
1 | 1099 |
1494
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1100 ;; Add spider demon |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1101 /def -i gstatus_add_demon =\ |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1102 /let _qtime=$[spider_next_drain - time()]%;\ |
1503
03574f0c416c
Add threshold setting for how little time there is until next demon drain to
Matti Hamalainen <ccr@tnsp.org>
parents:
1499
diff
changeset
|
1103 /if (_qtime > 0 & _qtime < spider_timer_t)\ |
1494
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1104 /let _utime=$[prgettime(_qtime)]%;\ |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1105 /set status_w=$[status_w+8+strlen(_utime)]%;\ |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1106 /set status_pstr=%{status_pstr} "[" "Drain":5:BCred ":" "%{_utime}" "]"%;\ |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1107 /endif |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1108 |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1109 ;; Get value |
580
60b9778649d3
gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents:
576
diff
changeset
|
1110 /def -i gstatus_get_val =\ |
410
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1111 /if ({1}=~"on") /return "BCwhite"%;/else /return "Cblue"%;/endif |
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1112 |
580
60b9778649d3
gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents:
576
diff
changeset
|
1113 /def -i gstatus_get_camp =\ |
410
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1114 /if (camp_st == 1) /return "BCgreen"%;\ |
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1115 /elseif (camp_st == 2) /return "BCred"%;\ |
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1116 /else /return "BCyellow"%;/endif |
aa6179ac23b8
v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents:
396
diff
changeset
|
1117 |
1185
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1118 ;; Compute updated status string |
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1119 /def -i gstatus_update_do =\ |
171 | 1120 /set status_w=12%;\ |
11
a1ccb3446113
Improved indentation and fixed some trigger priorities.
Matti Hamalainen <ccr@tnsp.org>
parents:
10
diff
changeset
|
1121 /set status_pstr=%;\ |
291 | 1122 /gstatus_add_val hp H%;\ |
1123 /gstatus_add_val sp S%;\ | |
1124 /gstatus_add_val ep E%;\ | |
580
60b9778649d3
gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents:
576
diff
changeset
|
1125 /set status_pstr=%{status_pstr} "[" "%{prmove_last}":2:BCgreen "C":1:$[gstatus_get_val(ceremony_st)] "S":1:$[gstatus_get_val(spell_st)] "K":1:$[gstatus_get_val(skill_st)] "c":1:$[gstatus_get_camp()] "]"%;\ |
1189
cea697a08e89
Initial implementation of the potentially fabulously broken heartbeat and tick counter / predictor. No guarantees of correctness with this one.
Matti Hamalainen <ccr@tnsp.org>
parents:
1188
diff
changeset
|
1126 /test gstatus_add_var("T", "heartbeat_cnt", 2)%;\ |
1498 | 1127 /test gstatus_add_var("S", "heartbeat_subtick", 2)%;\ |
1193
436618d97f8d
Move battle round status after hb, tick and aura indicators.
Matti Hamalainen <ccr@tnsp.org>
parents:
1192
diff
changeset
|
1128 /if (battle_st) /test gstatus_add_var("rnd", "battle_round")%;/endif%;\ |
1494
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1129 /gstatus_add_aura%;\ |
bd219dde5c1c
Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1491
diff
changeset
|
1130 /gstatus_add_demon |
1185
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1131 |
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1132 ;; Update statusbar |
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1133 /def -i gstatus_update =\ |
b1e5b47a59f2
Change how statusline is updated, fixing problems and removing code duplication; Update copyright and GgrTF core requirement in TF5 module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1184
diff
changeset
|
1134 /gstatus_update_do%;\ |
526 | 1135 /let _qw=$[columns() - status_w]%;\ |
1136 /if (_qw > 3) /set status_pstr=%{status_pstr} :1 "%{status_protstr2}":%{_qw}:Cgreen%;/endif%;\ | |
1170
955f54364231
Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1167
diff
changeset
|
1137 /set status_fields=%{status_pstr} |
1 | 1138 |
1139 | |
156
547b5e4b4341
Preliminary version of tick predictor (statusbar only), see /opts for settings. Is bit buggy.
Matti Hamalainen <ccr@tnsp.org>
parents:
155
diff
changeset
|
1140 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
227
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1141 ;; Status short score/prompt grabbing triggers |
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1142 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
121
8c009af416fe
Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
119
diff
changeset
|
1143 /def -i prgetdiff =\ |
526 | 1144 /let _ts=%;/let _tv=$[{1} - {2}]%;\ |
1145 /if (_tv < 0) /let _ts=@{Cred}%{_tv}@{n}%;\ | |
1146 /elseif (_tv > 0) /let _ts=@{Cgreen}+%{_tv}@{n}%;/endif%;\ | |
1147 /return "[%{_ts}]" | |
121
8c009af416fe
Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
119
diff
changeset
|
1148 |
227
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1149 /def -i gstatus_scupd =\ |
1181
452bab871539
Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
1178
diff
changeset
|
1150 /set status_oldhp=%{status_hp}%;/set status_hp=%{1}%;/set status_hpmax=%{2}%;\ |
452bab871539
Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
1178
diff
changeset
|
1151 /set status_oldsp=%{status_sp}%;/set status_sp=%{3}%;/set status_spmax=%{4}%;\ |
452bab871539
Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
1178
diff
changeset
|
1152 /set status_oldep=%{status_ep}%;/set status_ep=%{5}%;/set status_epmax=%{6}%;\ |
1399
4b911e5a5177
Actually show on 'sc' lines on which heartbeat it occured, but only on detected ticks. However, we only "sanely" detect ticks based on sp/ep for now ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
1153 /set status_money=%{7}%;/set status_exp=%{8}%;/set status_qline=%{9}%;\ |
4b911e5a5177
Actually show on 'sc' lines on which heartbeat it occured, but only on detected ticks. However, we only "sanely" detect ticks based on sp/ep for now ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
1154 /gprots_update%;/gstatus_update%;\ |
4b911e5a5177
Actually show on 'sc' lines on which heartbeat it occured, but only on detected ticks. However, we only "sanely" detect ticks based on sp/ep for now ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
1155 /prexecfuncs %{event_sc_printed}%;\ |
4b911e5a5177
Actually show on 'sc' lines on which heartbeat it occured, but only on detected ticks. However, we only "sanely" detect ticks based on sp/ep for now ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
1156 /if (opt_gagsc=~"on") /substitute -ag%;/endif |
227
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1157 |
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1158 |
d40d9607d59a
Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
1159 ;; Grab SHORT SCORE (sc) |
1177
f19faa06424b
Add recommendation / note about not modifying the 'sc'-grabber code, but rather overriding it.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
1160 ;; !!!NOTICE!!! BIG FAT NOTICE HERE !! |
f19faa06424b
Add recommendation / note about not modifying the 'sc'-grabber code, but rather overriding it.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
1161 ;; If you decide NOT to use the recommended 'sc' format, instead of changing |
1396
d4a363883812
Documentation of gstatus_sc in the comments was incorrect, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1394
diff
changeset
|
1162 ;; anything HERE (the gstatus_sc macro below), copy gstatus_sc to your |
1177
f19faa06424b
Add recommendation / note about not modifying the 'sc'-grabber code, but rather overriding it.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
1163 ;; .tfrc and modify and override it there! Thus you'll be spared from most |
f19faa06424b
Add recommendation / note about not modifying the 'sc'-grabber code, but rather overriding it.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
1164 ;; trouble when upgrading to new version of GgrTF. |
f19faa06424b
Add recommendation / note about not modifying the 'sc'-grabber code, but rather overriding it.
Matti Hamalainen <ccr@tnsp.org>
parents:
1176
diff
changeset
|
1165 |
1181
452bab871539
Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
1178
diff
changeset
|
1166 /def -i -F -p9999 -mregexp -t"^H:(-?[0-9]+)/(-?[0-9]+) \[[+-]?[0-9]*\] S:(-?[0-9]+)/(-?[0-9]+) \[[+-]?[0-9]*\] E:(-?[0-9]+)/(-?[0-9]+) \[[+-]?[0-9]*\] \$:(-?[0-9]+) \[[+-]?[0-9]*\] exp:(-?[0-9]+) \[[+-]?[0-9]*\]$" gstatus_sc =\ |
1399
4b911e5a5177
Actually show on 'sc' lines on which heartbeat it occured, but only on detected ticks. However, we only "sanely" detect ticks based on sp/ep for now ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
1167 /test gstatus_scupd({P1},{P2},{P3},{P4},{P5},{P6},{P7},{P8},{*}) |
123
7ac6320c03a9
Accept previous format of 'sc' too.
Matti Hamalainen <ccr@tnsp.org>
parents:
121
diff
changeset
|
1168 |
121
8c009af416fe
Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
119
diff
changeset
|
1169 |
11
a1ccb3446113
Improved indentation and fixed some trigger priorities.
Matti Hamalainen <ccr@tnsp.org>
parents:
10
diff
changeset
|
1170 ;; Grab PROMPT |
1123
b50b22f460bd
v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1113
diff
changeset
|
1171 /def -i -p9999 -mregexp -h"PROMPT PROMPT:(.*)>$" gstatus_prompt=\ |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1172 /set status_prompt=$[strip_attr({P1})]%;\ |
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1173 /if (cast_info!~"" & cast_info_n!~"") \ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1174 /if (cast_info_t!~"") \ |
945
679f292a3724
Oops, prompt_cast variable should've been status_cast. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
943
diff
changeset
|
1175 /set status_cast=%{cast_info}[%{cast_info_n} -> %{cast_info_t}]%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
1176 /else \ |
945
679f292a3724
Oops, prompt_cast variable should've been status_cast. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
943
diff
changeset
|
1177 /set status_cast=%{cast_info}[%{cast_info_n}]%;\ |
613
79dfc5b48dd2
Added a "busy queue" system for storing messages going through /msr macro, while player is in "resting"-mode.
Matti Hamalainen <ccr@tnsp.org>
parents:
604
diff
changeset
|
1178 /endif%;\ |
90 | 1179 /else \ |
945
679f292a3724
Oops, prompt_cast variable should've been status_cast. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
943
diff
changeset
|
1180 /set status_cast=%;\ |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1181 /endif%;\ |
1669
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
1182 /eval /prompt $[strip_attr(set_gprompt)]%;\ |
1183
2b79266fa559
Call statusline updating also in prompt handler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1182
diff
changeset
|
1183 /gstatus_update |
1 | 1184 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1185 |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1186 ;@command /gprompt [prompt string] |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1187 ;@desc Set or change GgrTF's displayed prompt. The setting can contain any |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1188 ;@desc TinyFugue expressions, such as variable substitutions. Refer to |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1189 ;@desc <link linkend="usage-general-prompt">prompt settings section</link> for details. |
742
2cfe91e46d81
New /gprompt setting to set the prompt string. The string is formatted via eval, thus any desired variables can be shown in it.
Matti Hamalainen <ccr@tnsp.org>
parents:
740
diff
changeset
|
1190 /prdefvalue -n"gprompt" -d"GgrTF prompt string" |
2cfe91e46d81
New /gprompt setting to set the prompt string. The string is formatted via eval, thus any desired variables can be shown in it.
Matti Hamalainen <ccr@tnsp.org>
parents:
740
diff
changeset
|
1191 |
1 | 1192 |
1193 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
71
211e7ca6969c
Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
1194 ;; Version reporting |
211e7ca6969c
Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
1195 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1671 | 1196 /set ggrtf_copy=(C) Copyright 2004-2024 Matti Hamalainen (Ggr Pupunen) and others |
71
211e7ca6969c
Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
1197 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1198 ;@command /gver |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1199 ;@desc Prints (or returns, if called as function) a short version string of GgrTF. |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1200 /def -i gver = /result "GgrTF %{ggrtf_ver}" |
300
4133575d83fd
Cleanups, more comments in the code, /clearprots -> /cprots
Matti Hamalainen <ccr@tnsp.org>
parents:
299
diff
changeset
|
1201 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1202 ;@command /gversion |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1203 ;@desc Prints (or returns, if called as function) a long version string of |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1204 ;@desc GgrTF with copyright- and TinyFugue version information. |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1205 /def -i gversion =\ |
308
68ef35393714
v0.5.9.26: Make defined binding macros invisible; Re-written tick-predictor, might work to some extent now.
Matti Hamalainen <ccr@tnsp.org>
parents:
304
diff
changeset
|
1206 /result "GgrTF v%{ggrtf_ver} %{ggrtf_copy} on TinyFugue $[ver()]" |
68ef35393714
v0.5.9.26: Make defined binding macros invisible; Re-written tick-predictor, might work to some extent now.
Matti Hamalainen <ccr@tnsp.org>
parents:
304
diff
changeset
|
1207 |
636
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1208 /prdeftoggle -n"repver" -d"Report version via 'hopple inquisitively'" |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1209 /set opt_repver=on |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1210 |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1211 /set report_ver_t=0 |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1212 /def -i -E(opt_repver=~"on") -p9999 -mregexp -t"^@?([A-Z][a-z]+) hopples around you inquisitively, all bunny-like\.$" greport_ver =\ |
924
9e5732c5b969
Increase version report cooldown.
Matti Hamalainen <ccr@tnsp.org>
parents:
923
diff
changeset
|
1213 /if (time()-report_ver_t > 10)\ |
636
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1214 /set report_ver_t=$[time()]%;\ |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1215 @@emoteto %{P1} is using $[gversion()]%;\ |
9860ca854ca3
pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
633
diff
changeset
|
1216 /endif |
308
68ef35393714
v0.5.9.26: Make defined binding macros invisible; Re-written tick-predictor, might work to some extent now.
Matti Hamalainen <ccr@tnsp.org>
parents:
304
diff
changeset
|
1217 |
127 | 1218 |
71
211e7ca6969c
Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents:
70
diff
changeset
|
1219 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
570
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1220 ;; Skill/spell fumble / fail definition |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1221 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1222 ; -t"<pattern>" Pattern/string for matching |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1223 ; -r Use regexp instead of simple matching |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1224 ; -c Type: Spell |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1225 ; -k Type: Skill |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1226 ; -f Fail |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1227 ; -F Fumble |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1228 |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1229 /def -i prdeffail =\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1230 /if (!getopts("t:rckfF", "")) /gerror Invalid fail/fumble definition!%;/break%;/endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1231 /if (opt_c & opt_k) /gerror Skill and spell options are mutually exclusive!%;/break%;/endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1232 /if (opt_f & opt_F) /gerror Fail and fumble options are mutually exclusive!%;/break%;/endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1233 /if (opt_t=~"") /gerror Invalid fail/fumble definition! -t not specified or empty.%;/break%;/endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1234 /if (opt_r) /let _tmpr=regexp%;/else /let _tmpr=simple%;/endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1235 /if (opt_f)\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1236 /let _tmpt=fail%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1237 /let _tmpa=Cred%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1238 /elseif (opt_F)\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1239 /let _tmpt=fumble%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1240 /let _tmpa=BCred%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1241 /else \ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1242 /gerror Invalid fail/fumble definition! You MUST specify either -f or -F%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1243 /break%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1244 /endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1245 /if (opt_c)\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1246 /def -i -F -p9999 -m%{_tmpr} -a%{_tmpa} -t"%{opt_t}" gspell_%{_tmpt}%{cnt_def_fail} = /gspell_%{_tmpt}%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1247 /elseif (opt_k)\ |
576 | 1248 /def -i -F -p9999 -m%{_tmpr} -a%{_tmpa} -t"%{opt_t}" gskill_%{_tmpt}%{cnt_def_fail} = /gskill_%{_tmpt}%;\ |
570
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1249 /else \ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1250 /gerror Invalid fail/fumble definition! You must specify either -k or -c%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1251 /break%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1252 /endif%;\ |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1253 /set cnt_def_fail=$[cnt_def_fail+1] |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1254 |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1255 |
213c97ca9382
New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents:
569
diff
changeset
|
1256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | 1257 ;; Prot triggers and reporting |
1258 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
146 | 1259 ;; List of prots and conjurer prots (cprots list needed for handling/clearing minor prot prereqs) |
1260 /set lst_prots= | |
1261 /set lst_cprots= | |
502
ac625436ea84
Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents:
501
diff
changeset
|
1262 /set lst_dmpprots= |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1263 /set lst_ripprots= |
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1264 |
146 | 1265 |
1266 ;; Clear a given list of prot prerequisites | |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1267 /def -i prclearpreqs =\ |
146 | 1268 /while ({#})\ |
1269 /set prot_%{1}_p=0%;\ | |
1270 /shift%;\ | |
1271 /done | |
1272 | |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1273 /def -i prclearprots =\ |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1274 /while ({#})\ |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1275 /set prot_%{1}=0%;\ |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1276 /set prot_%{1}_p=0%;\ |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1277 /shift%;\ |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1278 /done |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1279 |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1280 |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1281 ;; Reset prots |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1282 ;@command /cprots |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1283 ;@desc This command clears all prots on you. It is meant for those cases where |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1284 ;@desc GgrTF is either bugging and does not notice a prot dropping, or any other |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1285 ;@dsec reason when you need to remove all prots at your discretion. |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
1286 /def -i cprots =\ |
693 | 1287 /msq @{BCgreen}NOTICE!@{n} @{BCwhite}Clearing status of all prots.@{n}%;\ |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1288 /prclearprots %{lst_prots}%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1289 /gprots_update%;/gstatus_update |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1290 |
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1291 |
146 | 1292 ;; Define a conjuprot trigger (function) |
1293 /def -i prdefconju =\ | |
1266
7910e501e680
Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
1265
diff
changeset
|
1294 /gdef -i -F -p9999 -aCgreen -msimple -t"%{3}" rec_%{2}_on=\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1295 /if (prot_%{1}_p==1) /gprot_on %{1}%{4}/endif%%;\ |
146 | 1296 /set prot_%{1}_p=0 |
1297 | |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1298 /def -i prdeffolk =\ |
1266
7910e501e680
Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
1265
diff
changeset
|
1299 /gdef -i -F -p9999 -aCgreen -mregexp -t"%{3}" rec_%{2}_on=/gprot_on %{1}%{4} |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1300 |
154
6c66a8dbc750
- Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents:
153
diff
changeset
|
1301 |
1 | 1302 ;; Clear/setup all variables related to prot |
983
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1303 ; -i"<name>" Prot unique name (must be unique) |
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1304 ; -n"<shortname>" Short name, shown in /prots output and statusline |
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1305 ; -l"<desc/longname>" Long name, should also be the same as "show effects" output |
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1306 ; -A"<prerequisite regexp #1>" Pre-requisite #1 for prot "up" message |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1307 ; -B"<prerequisite regexp #2>" |
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1308 ; -C"<prerequisite regexp #3>" |
983
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1309 ; -u"<up message>" |
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1310 ; -d"<down message>" |
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1311 ; -r Use regexp instead of simple matching in up AND down messages |
1 | 1312 ; -s Stackable prot |
7
a6171a9fe54d
Fixed renewable prot flag -n -> -h
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1313 ; -h Renewable prot (does not stack, but can be renewed) |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1314 ; -p Conjurer minor typeprot (options -u, -s, -r are meaningless) |
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1315 ; -P Conjurer major typeprot |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1316 ; -F Folklorist prot |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1317 ; -q Don't give error on gprot_off if prot is not up |
502
ac625436ea84
Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents:
501
diff
changeset
|
1318 ; -m DMP removes this prot (all conju prots are added automatically) |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1319 ; -M RIP (player's death) removes this prot |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1320 ; -e Extra counter report (don't ask) |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1321 ; -z Handicap (curse, or similar) |
983
921d8ed4a0fd
v0.6.11.5-svn; Misc. cleanups; Added error messages if certain required options of /prdefprot are missing.
Matti Hamalainen <ccr@tnsp.org>
parents:
960
diff
changeset
|
1322 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1323 /def -i prdefprot =\ |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1324 /if (!getopts("i:n:l:A:B:C:u:d:srhpPFqmMez", "")) /gerror Invalid prot definition!%;/break%;/endif%;\ |
831
af442cd6e40c
Add some error checking into prdefprot.
Matti Hamalainen <ccr@tnsp.org>
parents:
830
diff
changeset
|
1325 /if (opt_i=~"") /gerror Prot definition missing varname (-i)%;/break%;/endif%;\ |
af442cd6e40c
Add some error checking into prdefprot.
Matti Hamalainen <ccr@tnsp.org>
parents:
830
diff
changeset
|
1326 /if (opt_n=~"") /gerror Prot definition '%{opt_i}' missing name (-n)%;/break%;/endif%;\ |
af442cd6e40c
Add some error checking into prdefprot.
Matti Hamalainen <ccr@tnsp.org>
parents:
830
diff
changeset
|
1327 /if (opt_l=~"") /gerror Prot definition '%{opt_i}' missing long name (-l)%;/break%;/endif%;\ |
817
a0e8f8ed9fc1
Use prlist_insert() in prdefprot().
Matti Hamalainen <ccr@tnsp.org>
parents:
816
diff
changeset
|
1328 /test prlist_insert("lst_prots", opt_i)%;\ |
18 | 1329 /set prot_%{opt_i}=0%;\ |
1330 /set prot_%{opt_i}_t=-1%;\ | |
1331 /set prot_%{opt_i}_n=%{opt_n}%;\ | |
1332 /set prot_%{opt_i}_l=%{opt_l}%;\ | |
47
6d7602ad8a41
Minor bugfix for uninitialized values in /defprot
Matti Hamalainen <ccr@tnsp.org>
parents:
44
diff
changeset
|
1333 /set prot_%{opt_i}_p=0%;\ |
146 | 1334 /set prot_%{opt_i}_st=0%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1335 /set prot_%{opt_i}_w=0%;\ |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1336 /if (opt_z) /set prot_%{opt_i}_hcap=1%;/else /set prot_%{opt_i}_hcap=0%;/endif%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1337 /if (opt_e) /set prot_%{opt_i}_e=1%;/else /set prot_%{opt_i}_e=0%;/endif%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1338 /if (opt_M) /set lst_ripprots=%{opt_i} %{lst_ripprots}%;/endif%;\ |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1339 /if (opt_q) /set prot_%{opt_i}_q=0%;/else /set prot_%{opt_i}_q=1%;/endif%;\ |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1340 /if (opt_p | opt_P | opt_F)\ |
301
6862be713676
Use /gerror and /gwarning macros for reporting error and warning messages respectively.
Matti Hamalainen <ccr@tnsp.org>
parents:
300
diff
changeset
|
1341 /if (opt_p & opt_P) /gerror Minor and major typeprot options given.%;/break%;/endif%;\ |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1342 /if (opt_F & (opt_p | opt_P)) /gerror Folklorist prot and minor or major conju typeprot options given.%;/break%;/endif%;\ |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1343 /if (!opt_F & (opt_d=~"" | opt_A=~"")) /gerror Conjurer typeprot definition requires proper -A and -d options!%;/break%;/endif%;\ |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1344 /test prlist_insert("lst_cprots", opt_i)%;\ |
341
141124235c3c
v0.5.10.7: Changes in binding definition macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
339
diff
changeset
|
1345 /let _qmatch=simple%;\ |
146 | 1346 /let qact1=%%;%;\ |
1347 /let qact2= (sticky)%%;/set prot_%{opt_i}_st=1%%;%;\ | |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1348 /if (opt_P)\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1349 /gdef -i -F -p9999 -aCyellow -mregexp -t"^([A-Z][a-z]+) utters? the magic words '%{opt_A}'\$" rec_%{opt_i}_A=\ |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1350 /prclearpreqs %%{lst_cprots}%%;/set prot_%{opt_i}_p=1%;\ |
146 | 1351 /test prdefconju(opt_i, opt_i, "You see a %{opt_d} shield fade into existance around you.", qact1)%;\ |
1352 /test prdefconju(opt_i, "%{opt_i}_st", "You see an extra %{opt_d} shield fade into existance around you.", qact2)%;\ | |
1353 /let opt_d=Your %{opt_d} shield fades out.%;\ | |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1354 /elseif (opt_p)\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1355 /gdef -i -F -p9999 -aCyellow -mregexp -t"^([A-Z][a-z]+) utters? the magic words '%{opt_A}'\$" rec_%{opt_i}_A=\ |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1356 /prclearpreqs %%{lst_cprots}%%;/set prot_%{opt_i}_p=1%;\ |
146 | 1357 /test prdefconju(opt_i, opt_i, "You sense a powerful protective aura around you.", qact1)%;\ |
1358 /test prdefconju(opt_i, "%{opt_i}_st", "You sense an extra powerful protective aura around you.", qact2)%;\ | |
1359 /let opt_d=A %{opt_d} flash momentarily surrounds you and then vanishes.%;\ | |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1360 /else \ |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1361 /test prdeffolk(opt_i, opt_i, "^You feel %{opt_A}protected%{opt_u}\.\$", qact1)%;\ |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1362 /test prdeffolk(opt_i, "%{opt_i}_st", "^You feel extra protected%{opt_u}\.\$", qact2)%;\ |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1363 /let opt_d=The %{opt_d} protection fades away.%;\ |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1364 /endif%;\ |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1365 /else \ |
502
ac625436ea84
Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents:
501
diff
changeset
|
1366 /if (opt_m) /set lst_dmpprots=%{opt_i} %{lst_dmpprots}%;/endif%;\ |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1367 /if (opt_s) /set prot_%{opt_i}_stack=1%;/else /set prot_%{opt_i}_stack=0%;/endif%;\ |
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1368 /if (opt_h) /set prot_%{opt_i}_renew=1%;/else /set prot_%{opt_i}_renew=0%;/endif%;\ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1369 /if (opt_u=~"" | opt_d=~"") /break%;/endif%;\ |
381
6af6df52fefd
v0.5.11.2: Removed tick predictor, it wasn't working anyway;
Matti Hamalainen <ccr@tnsp.org>
parents:
377
diff
changeset
|
1370 /if (opt_r) /let _qmatch=regexp%;/else /let _qmatch=simple%;/endif%;\ |
128 | 1371 /let pstr=0%;\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1372 /if (opt_A!~"") /let pstr=1%;/gdef -i -F -p9999 -aCyellow -mregexp -t'%{opt_A}' rec_%{opt_i}_A=/prclearpreqs %%{lst_prots}%%;/set prot_%{opt_i}_p=1%;/endif%;\ |
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1373 /if (opt_B!~"") /let pstr=2%;/gdef -i -F -p9999 -aCyellow -mregexp -t'%{opt_B}' rec_%{opt_i}_B=/if (prot_%{opt_i}_p == 1) /prclearpreqs %%{lst_prots}%%;/set prot_%{opt_i}_p=2%%;/endif%;/endif%;\ |
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1374 /if (opt_C!~"") /let pstr=3%;/gdef -i -F -p9999 -aCyellow -mregexp -t'%{opt_C}' rec_%{opt_i}_C=/if (prot_%{opt_i}_p == 2) /prclearpreqs %%{lst_prots}%%;/set prot_%{opt_i}_p=3%%;/endif%;/endif%;\ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1375 /if (pstr > 0)\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1376 /gdef -i -F -p9999 -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/if (prot_%{opt_i}_p==%{pstr})/gprot_on %{opt_i}%%;/endif%%;/set prot_%{opt_i}_p=0%;\ |
128 | 1377 /else \ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1378 /gdef -i -F -p9999 -aCgreen -m%{_qmatch} -t'%{opt_u}' rec_%{opt_i}_on=/set prot_%{opt_i}_p=0%%;/gprot_on %{opt_i}%;\ |
1 | 1379 /endif%;\ |
1380 /endif%;\ | |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1381 /gdef -i -F -p9999 -aCgreen -m%{_qmatch} -t'%{opt_d}' rec_%{opt_i}_off=/gprot_off %{opt_i} |
1 | 1382 |
1383 | |
1384 ;; Turn prot ON | |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1385 /def -i gprot_on =\ |
492
bc22d9ac8b3d
/pron and /proff didn't complain if no arguments were given, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
491
diff
changeset
|
1386 /if ({#} < 1) /gerror No prot identifier argument defined!%;/break%;/endif%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1387 /let _prot_l=$[prgetval(strcat("prot_",{1},"_l"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1388 /if (_prot_l=~"") /gerror Invalid prot identifier '%{1}'!%;/break%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1389 /let _prot_s=$[prgetval(strcat("prot_",{1},"_stack"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1390 /let _prot_h=$[prgetval(strcat("prot_",{1},"_renew"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1391 /let _prot_c=$[prgetval(strcat("prot_",{1}))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1392 /if (_prot_c == 0 | (_prot_h == 1 & _prot_s == 0))\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1393 /if (_prot_c > 0)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1394 /let _prot_t=$[prgetval(strcat("prot_",{1},"_t"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1395 /let _tmps=Renewed! $[prgetstime(_prot_t)]%;\ |
253 | 1396 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1397 /let _tmps=ON!%;\ |
253 | 1398 /endif%;\ |
18 | 1399 /set prot_%{1}=1%;\ |
253 | 1400 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1401 /if (_prot_s)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1402 /set prot_%{1}=$[_prot_c+1]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1403 /let _tmps=ON [#$[_prot_c+1]]%;\ |
253 | 1404 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1405 /gerror Prot '%{1}' (%{_prot_l}) increased even though not flagged stackable!%;\ |
1 | 1406 /break%;\ |
1407 /endif%;\ | |
253 | 1408 /endif%;\ |
18 | 1409 /set prot_%{1}_t=$[time()]%;\ |
1 | 1410 /if ({-1}!~"")\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1411 /msr %{_prot_l} %{-1} %{_tmps}%;\ |
253 | 1412 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1413 /msr %{_prot_l} %{_tmps}%;\ |
253 | 1414 /endif%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1415 /gprots_update%;/gstatus_update |
1 | 1416 |
1417 | |
1418 ;; Turn prot OFF | |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1419 /def -i gprot_off =\ |
492
bc22d9ac8b3d
/pron and /proff didn't complain if no arguments were given, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
491
diff
changeset
|
1420 /if ({#} < 1) /gerror No prot identifier argument defined!%;/break%;/endif%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1421 /let _prot_l=$[prgetval(strcat("prot_",{1},"_l"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1422 /if (_prot_l=~"") /gerror No such prot '%{1}' defined!%;/break%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1423 /let _prot_c=$[prgetval(strcat("prot_",{1})) - 1]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1424 /set prot_%{1}=%{_prot_c}%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1425 /let _prot_s=$[prgetval(strcat("prot_",{1},"_stack"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1426 /let _prot_t=$[prgetval(strcat("prot_",{1},"_t"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1427 /let _prot_h=$[prgetval(strcat("prot_",{1},"_renew"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1428 /let _prot_q=$[prgetval(strcat("prot_",{1},"_q"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1429 /if (_prot_c < 0 & _prot_q) \ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1430 /gwarning '%{1}' (%{_prot_l}) count %{_prot_c} at /gprot_off!%;\ |
35
63e2f7fd9115
Some work on stacking prots (still not too good)
Matti Hamalainen <ccr@tnsp.org>
parents:
34
diff
changeset
|
1431 /set prot_%{1}=0%;\ |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1432 /set prot_%{1}_st=0%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1433 /msr %{_prot_l} OFF!%;\ |
35
63e2f7fd9115
Some work on stacking prots (still not too good)
Matti Hamalainen <ccr@tnsp.org>
parents:
34
diff
changeset
|
1434 /break%;\ |
253 | 1435 /endif%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1436 /if (_prot_s & _prot_c >= 1 & _prot_h == 0) \ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1437 /msr %{_prot_l} Weakened! [#%{_prot_c}] $[prgetstime(_prot_t)]%;\ |
253 | 1438 /else \ |
18 | 1439 /set prot_%{1}=0%;\ |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1440 /set prot_%{1}_st=0%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1441 /if (!_prot_q & _prot_c < 0)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1442 /msr %{_prot_l} OFF!%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1443 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1444 /msr %{_prot_l} OFF! $[prgetstime(_prot_t)]%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1445 /endif%;\ |
253 | 1446 /endif%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1447 /gprots_update%;/gstatus_update |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1448 |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1449 |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1450 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1451 ;; Form the "current prots" strings |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1452 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1453 /def -i gprots_doget =\ |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1454 /while ({#})\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1455 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1456 /if (_prot_on > 0)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1457 /let _prot_t=$[prgetval(strcat("prot_",{1},"_t"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1458 /let _prot_n=$[prgetval(strcat("prot_",{1},"_n"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1459 /let _prot_st=$[prgetval(strcat("prot_",{1},"_st"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1460 /let _prot_e=$[prgetval(strcat("prot_",{1},"_e"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1461 /let _prot_w=$[prgetval(strcat("prot_",{1},"_w"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1462 /let _prot_hcap=$[prgetval(strcat("prot_",{1},"_hcap"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1463 /set cnt_prots=$[cnt_prots + 1]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1464 /if (_prot_st) /let _qts=+%;/else /let _qts=%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1465 /if (_prot_on > 1) /let _qts=(%{_prot_on})%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1466 /if (_prot_e & _prot_w > 0) /let _qts=%{_qts}<%{_prot_w}>%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1467 /if (_prot_hcap) /let _prot_n=-%{_prot_n}%;/endif%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1468 /let _qss=%{_prot_n}%{_qts}$[prgetstime(_prot_t)]%;\ |
526 | 1469 /if (status_protstr!~"")\ |
1470 /set status_protstr=%{status_protstr} | %{_qss}%;\ | |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1471 /set status_protstr2=%{status_protstr2}|%{_prot_n}%{_qts}%;\ |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1472 /else \ |
526 | 1473 /set status_protstr=%{_qss}%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1474 /set status_protstr2=%{_prot_n}%{_qts}%;\ |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1475 /endif%;\ |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1476 /endif%;\ |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1477 /shift%;\ |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1478 /done |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1479 |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1480 /def -i gprots_update =\ |
526 | 1481 /set status_protstr=%;\ |
1482 /set status_protstr2=%;\ | |
308
68ef35393714
v0.5.9.26: Make defined binding macros invisible; Re-written tick-predictor, might work to some extent now.
Matti Hamalainen <ccr@tnsp.org>
parents:
304
diff
changeset
|
1483 /set cnt_prots=0%;\ |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1484 /eval /gprots_doget %{lst_prots}%;\ |
308
68ef35393714
v0.5.9.26: Make defined binding macros invisible; Re-written tick-predictor, might work to some extent now.
Matti Hamalainen <ccr@tnsp.org>
parents:
304
diff
changeset
|
1485 /if (cnt_prots > 0)\ |
526 | 1486 /return status_protstr%;\ |
819 | 1487 /else \ |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1488 /return "No prots."%;\ |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1489 /endif |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1490 |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1491 |
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1492 ;; Prot reporting |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1493 ;@command /prots |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1494 ;@desc Show any currently active prots on you. The output is only echoed |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
1495 ;@desc locally, use BatMUD 'tweak me' emote to list prots to party report-channel. |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1496 /def -i prots = /msq $[gprots_update()] |
731
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
1497 |
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
1498 /prdefgbind -s"prots" -c"/prots" |
f0725dd53994
Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
726
diff
changeset
|
1499 |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1500 /def -i -p9999 -mregexp -t"^[A-Z][a-z]+ tweaks your nose (mischievously|mischeviously).$" gprot_tweak1 =\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1501 /msr $[gprots_update()] |
303
067315d8223a
v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents:
302
diff
changeset
|
1502 |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1503 /def -i -p9999 -mregexp -t"^You tweak your own nose (mischievously|mischeviously).$" gprot_tweak3 =\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1504 /msr $[gprots_update()] |
1 | 1505 |
1506 | |
111
5a8d99df4f43
Update prots more regularly
Matti Hamalainen <ccr@tnsp.org>
parents:
110
diff
changeset
|
1507 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
476
9c01082502bd
- Reboot removes all prots. Do so.
Ealoren Pupunen <ealoren@bat.org>
parents:
475
diff
changeset
|
1508 ;; Prots which expire on death, DMP or reboot |
111
5a8d99df4f43
Update prots more regularly
Matti Hamalainen <ccr@tnsp.org>
parents:
110
diff
changeset
|
1509 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
129
f65771b56ddc
DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents:
128
diff
changeset
|
1510 ;; Death |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1511 /def -i gprots_clear_rip =\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1512 /let _ripstr=%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1513 /while ({#})\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1514 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1515 /if (_prot_on)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1516 /let _prot_n=$[prgetval(strcat("prot_",{1},"_n"))]%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1517 /set prot_%{1}=0%;\ |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1518 /set prot_%{1}_st=0%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1519 /if (_ripstr!~"") \ |
1210
228dc52de238
Oops. RIP prots down report forming was broken after some changes, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1209
diff
changeset
|
1520 /let _ripstr=%{_ripstr}, %{_prot_n}%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1521 /else \ |
1207
b22508dc2f81
Oops, _ripstr was both global and local variable. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1198
diff
changeset
|
1522 /let _ripstr=%{_prot_n}%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1523 /endif%;\ |
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1524 /endif%;\ |
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1525 /shift%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1526 /done%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1527 /result _ripstr |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1528 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1529 /gdef -i -F -p9999 -aCgreen -msimple -t"You can see Death, clad in black, collect your corpse." gprots_rip =\ |
24
f16ea23137cb
Some prots now expire correctly when you die... some may still not work as expected.
Matti Hamalainen <ccr@tnsp.org>
parents:
23
diff
changeset
|
1530 /msq @{BCyellow}Various prots expire as you die!@{n}%;\ |
436 | 1531 /set spell_st=off%;\ |
1532 /set skill_st=off%;\ | |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1533 /let _ripstr=$(/gprots_clear_rip %{lst_ripprots})%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1534 /gprots_update%;/gstatus_update%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1535 /if (_ripstr!~"")\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1536 /msr R.I.P. removed: %{_ripstr}%;\ |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1537 /endif |
24
f16ea23137cb
Some prots now expire correctly when you die... some may still not work as expected.
Matti Hamalainen <ccr@tnsp.org>
parents:
23
diff
changeset
|
1538 |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1539 |
127 | 1540 ;; Dispel magical protection (dmp) |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1541 /def -i gprots_clear_dmp =\ |
985
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1542 /let _dmpstr=%;\ |
129
f65771b56ddc
DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents:
128
diff
changeset
|
1543 /while ({#})\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1544 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1545 /let _prot_st=$[prgetval(strcat("prot_",{1},"_st"))]%;\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1546 /if (_prot_on & _prot_st == 0)\ |
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1547 /let _prot_n=$[prgetval(strcat("prot_",{1},"_n"))]%;\ |
146 | 1548 /set prot_%{1}=0%;\ |
985
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1549 /if (_dmpstr!~"") \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1550 /let _dmpstr=%{gdmpstr}, %{_prot_n}%;\ |
146 | 1551 /else \ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1552 /let _dmpstr=%{_prot_n}%;\ |
146 | 1553 /endif%;\ |
1554 /endif%;\ | |
129
f65771b56ddc
DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents:
128
diff
changeset
|
1555 /shift%;\ |
985
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1556 /done%;\ |
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1557 /result _dmpstr |
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1558 |
129
f65771b56ddc
DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents:
128
diff
changeset
|
1559 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1560 /def -i -F -p9999 -ag -mregexp -t"^You feel (unprotected|much more vulnerable)\.$" gprots_dmp =\ |
1209
6b2cec116dd7
Oops, wrong function name had been left in DMP handling, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1207
diff
changeset
|
1561 /let _dmpstr=$(/gprots_clear_dmp %{lst_cprots} %{lst_dmpprots})%;\ |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1562 /gprots_update%;/gstatus_update%;\ |
985
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1563 /if (_dmpstr!~"")\ |
662
47f881160fc1
Prevent "DMP hit you" spam in some situations; Minor optimizations.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
1564 /msq @{BCred}Dispel Magical Protection@{n} hit you!%;\ |
985
9b9ef109ecb5
Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
984
diff
changeset
|
1565 /msr DMP removed: %{_dmpstr}%;\ |
662
47f881160fc1
Prevent "DMP hit you" spam in some situations; Minor optimizations.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
1566 /endif |
129
f65771b56ddc
DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents:
128
diff
changeset
|
1567 |
1 | 1568 |
1319
b9ef8769b69a
Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents:
1318
diff
changeset
|
1569 ;; Login after reboot or quit |
b9ef8769b69a
Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents:
1318
diff
changeset
|
1570 /gdef -i -F -p9999 -aCgreen -msimple -t"Moving to starting location." gevent_quit_login =\ |
b9ef8769b69a
Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents:
1318
diff
changeset
|
1571 /prexecfuncs %{event_quit_login} |
1318
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
1572 |
1325
c629e2de8635
Oops, one reference to event_reboot_login hadn't been changed to event_quit_login. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1319
diff
changeset
|
1573 /test prlist_insert("event_quit_login", "cprots") |
1318
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
1574 |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
1575 ;; Normal relogin from linkdead |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
1576 /gdef -i -F -p9999 -aCgreen -mregexp -t"^Recovering character\.$" gevent_login =\ |
742babde0a89
Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents:
1310
diff
changeset
|
1577 /prexecfuncs %{event_login} |
476
9c01082502bd
- Reboot removes all prots. Do so.
Ealoren Pupunen <ealoren@bat.org>
parents:
475
diff
changeset
|
1578 |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1579 |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1580 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1149
12f188b4c094
Added prot 'Searing Fervor'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
1581 ;; Create regular prots without additional complexities |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1582 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1583 /prdefprot -i"eaura" -n"EAura" -l"Energy Aura" -s -h |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1584 /prdefprot -i"pff" -n"PFF" -l"Personal Force Field" -r -u"^You surround yourself by a bubble of force.$" -d"^Your field disperses with a soft \*pop\* and is gone\.$" |
1 | 1585 |
631
ae5c92e5cbb4
Bumped version up; Infravision is not stacking, but renewable - reported by Xunisiih.
Matti Hamalainen <ccr@tnsp.org>
parents:
627
diff
changeset
|
1586 /prdefprot -i"infra" -n"Infra" -l"Infravision" -h -A"\'demoni on pomoni\'$" -u"You have infravision." -d"Everything no longer seems so red." |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1587 /prdefprot -i"ww" -n"WW" -l"Water Walking" -h -A" \'Jeeeeeeeeeeeesuuuuuuuus\'$" -r -u"^(You feel light|Your feet feel lighter than before)\." -d"^You feel heavier\." |
662
47f881160fc1
Prevent "DMP hit you" spam in some situations; Minor optimizations.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
1588 /prdefprot -i"float" -n"Float" -l"Floating" -s -r -u"^You feel light, and rise into the air.$" -d"^(Your old floating spell dissipates|You slowly descend until your feet are on the ground).$" |
566
01afb41d74b8
v0.6.1.13; Use @@ instead of @ for escaping the BatMUD parser in some places; Fix problems with Demonic Ring of Invisibility (closes ID#16)
Matti Hamalainen <ccr@tnsp.org>
parents:
562
diff
changeset
|
1589 /prdefprot -i"invis" -n"Invis" -l"Invisibility" -r -u"^You (suddenly can\'t see yourself|twist the ring and suddenly you become invisible).$" -d"^You turn visible.$" |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1590 /prdefprot -i"godpr" -n"GodPr" -l"Godly Presence" |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1591 /prdefprot -i"seeinvis" -n"SeeInv" -l"See Invisible" -u"You feel you can see more than ever." -d"Your vision is less sensitive now." |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1592 /prdefprot -i"seemagic" -n"SeeMag" -l"See Magic" -u"You can now see magical things." -d"You are no longer sensitive to magical things." |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1593 /prdefprot -i"hw" -n"HW" -l"Heavy Weight" -A" \'tonnikalaa\'$" -u"You suddenly feel magically heavier." -d"You feel lighter, but it doesn\'t seem to affect your weight!" |
1 | 1594 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1595 /prdefprot -i"haste" -n"Haste" -l"Haste" |
1 | 1596 |
562
28669f28c254
Re-added old enrage message for hcbat compatibility.
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
559
diff
changeset
|
1597 /prdefprot -i"erage" -n"ERage" -l"Enrage" -r -u"^(You feel mildly enraged.|You are maddened with rage!|You feel your barbarian rage stir up.|Holy CRAP! OH what a RUSH!|You feel TOTALLY ENRAGED and ready to KICK ASS!|YOU FEEL AS IF YOU WERE GROO HIMSELF!|You are ENRAGED! Your body ACHES for action!|You feel the adrenaline BURST into your veins!|Your blood is boiling (of|with) rage!|You tremble uncontrollably and feel completely ENRAGED!)$" -d"^You no longer feel enraged.$" |
519 | 1598 /prdefprot -i"pthrsh" -n"PThrsh" -l"Pain Threshold" -u"You begin to concentrate on pain threshold." -d"Your concentration breaks and you feel less protected from physical damage." |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1599 /prdefprot -i"timm" -n"TImm" -l"Toxic Immunity" -u"You begin to concentrate on toxic immunity." -d"Your concentration breaks and you feel less protected from poison." |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1600 /prdefprot -i"ctol" -n"CTol" -l"Cold Tolerance" -u"You begin to concentrate on cold tolerance." -d"Your concentration breaks and you feel less protected from cold." |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1601 /prdefprot -i"fwal" -n"FWal" -l"Fire Walking" -u"You begin to concentrate on fire walking." -d"Your concentration breaks and you feel less protected from fire." |
1 | 1602 |
1430
fcc8358845ef
Fix 'protection by sacrifice' support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1429
diff
changeset
|
1603 /prdefprot -i"pbsf" -n"PbSf" -l"Protection by Sacrifice" -A" kneels before you and whispers \'With my life I\'ll protect yours\'.$" -r -u"^(She|He|It) stands up with a solemn look on (his|her|its) face\.$" -d"^[A-Z][a-z]+ no longer protects you\.$" |
fcc8358845ef
Fix 'protection by sacrifice' support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1429
diff
changeset
|
1604 /prdefprot -i"lol" -n"LoL" -l"Lift of Load" -u"You feel odd. Not stronger, but..." -d"You feel odd. Not weaker, but..." |
24
f16ea23137cb
Some prots now expire correctly when you die... some may still not work as expected.
Matti Hamalainen <ccr@tnsp.org>
parents:
23
diff
changeset
|
1605 |
598
e2fb3763f12a
Added initial support for 'enhanced awareness'.
Matti Hamalainen <ccr@tnsp.org>
parents:
596
diff
changeset
|
1606 /prdefprot -i"eawaren" -n"EA" -l"Enhanced Awareness" -u"You feel more aware of your surroundings." -d"You feel your enhanced awareness subside." |
1149
12f188b4c094
Added prot 'Searing Fervor'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1148
diff
changeset
|
1607 /prdefprot -i"searf" -n"SearF" -l"Searing Fervor" -r -u"^You feel uncomfortable warmth emanate within the bloodstream from your" -d"^The unnatural warmth evens out and stabilizes back to normal." |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1608 |
708
8890b3294fd4
Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents:
706
diff
changeset
|
1609 /prdefprot -i"glight" -n"GLight" -l"Greater Light" -A"^You utter the magic words \'vas ful\'$" -u"A small ball of light starts following you." -d"Your greater light spell flickers briefly and disappears." |
8890b3294fd4
Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents:
706
diff
changeset
|
1610 /prdefprot -i"gdark" -n"GDark" -l"Greater Darkness" -A"^You utter the magic words \'vas na ful\'$" -u"You summon a circle of darkness that absorbs light." -d"Your greater darkness spell dissolves." |
8890b3294fd4
Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents:
706
diff
changeset
|
1611 |
8890b3294fd4
Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents:
706
diff
changeset
|
1612 |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1613 ;; --- Misc. handicaps ---- |
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1614 /prdefprot -i"forget" -n"Forget" -l"Forget" -z -u"You feel rather empty-headed." -d"A fog lifts from your mind. You can remember things clearly now." |
1142
acdfd39ba80c
Fix suppress magic .. again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1139
diff
changeset
|
1615 /prdefprot -i"supprm" -n"Suppr" -l"Suppress Magic" -z -u"You feel excruciating pain in your head." -d"You feel relieved." |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1616 |
1145
c450a3d98f0a
Add a commented out protdef for 'degenerate person'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1142
diff
changeset
|
1617 ; Degen seems not to have any drop message? |
c450a3d98f0a
Add a commented out protdef for 'degenerate person'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1142
diff
changeset
|
1618 ;/prdefprot -i"degen" -n"Degen" -l"Degenerate Person" -z -u"You suddenly feel feeble and old." -d"" |
c450a3d98f0a
Add a commented out protdef for 'degenerate person'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1142
diff
changeset
|
1619 |
360
d7158a925e21
Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
1620 ;; ---- Spider ---- |
1161
dffd7414cb06
Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1155
diff
changeset
|
1621 /prdefprot -i"stouch" -n"STouch" -l"Spider Touch" -z -u"Suddenly you don\'t feel too good. Your blood feels like it is on fire." -d"Your blood does not burn anymore." |
519 | 1622 /prdefprot -i"qsilver" -n"QS" -l"Quicksilver" -u"You feel more agile." -d"You feel less agile." |
1623 /prdefprot -i"spwalk" -n"SWalk" -l"Spider Walk" -u"For some reason you want to run on the walls for a little while." -d"The walls don\'t look so inviting anymore." | |
360
d7158a925e21
Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
1624 |
499
57fb777fe48b
Added Flamefist prot support.
Matti Hamalainen <ccr@tnsp.org>
parents:
496
diff
changeset
|
1625 ;; ---- Tiger ---- |
838
a2cd4eb72a53
Make 'flame fists' renewable.
Matti Hamalainen <ccr@tnsp.org>
parents:
836
diff
changeset
|
1626 /eval /prdefprot -i"ffist" -n"FFist" -l"Flame Fists" -r -h \ |
816
063f4e44b84f
Fix 'flame fists' support in prot system, the dropping message had been tuned, but is also conflicting with how the old version of the spell works. Thus some care is needed to not break compatibility with HCbat.
Matti Hamalainen <ccr@tnsp.org>
parents:
814
diff
changeset
|
1627 -u"^Your fists are surrounded by Curath\\'s black flames!$$" \ |
1387
479a34db7049
Fix 'flame fists' prot support, patch from Zaeth.
Matti Hamalainen <ccr@tnsp.org>
parents:
1384
diff
changeset
|
1628 -d"^(Your flaming fists disappear\\.|Your fists are no longer surrounded by Curath\\'s black flames\.|Flames around %{set_plrname}\\'s fists disappear!)$$" |
499
57fb777fe48b
Added Flamefist prot support.
Matti Hamalainen <ccr@tnsp.org>
parents:
496
diff
changeset
|
1629 |
360
d7158a925e21
Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
1630 ;; ---- Evil priest ---- |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1631 /prdefprot -i"pfg" -n"PfG" -l"Protection from Good" -u"A vile black aura surrounds you." -d"You no longer have a vile black aura around you." |
569
ce387924141b
Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents:
566
diff
changeset
|
1632 /prdefprot -i"paranoia" -n"Para" -l"Paranoia" -z -A" \'noxim delusa\'" -u"You have a bad feeling about this." -d"Everything seems so much more pleasant." |
475 | 1633 /prdefprot -i"aoh" -n"AoH" -l"Aura of Hate" -r -u"^You feel burning hatred and rage erupt within you!" -d"^You feel your anger and hate of the world recede." |
1 | 1634 |
1635 ;; ---- Tarmalen ---- | |
835
2a1290f4283e
One more (perhaps recently ninjatuned?) unpain down message added.
Matti Hamalainen <ccr@tnsp.org>
parents:
833
diff
changeset
|
1636 /prdefprot -i"unpain" -n"Unp" -l"Unpain" -h -r -u"^You feel your will getting stronger.$" -d"^(You feel your will returning to normal\.|You feel your will returning normal\.|Your Unpain spell dissipates|You feel your will getting normal\.|You suffer an acute health change)" |
552
914c0375ce8e
'Blessing of Tarmalen' up-message was tuned, fixed with backwards compatibility for HC.
Matti Hamalainen <ccr@tnsp.org>
parents:
551
diff
changeset
|
1637 /prdefprot -i"bot" -n"BoT" -l"Blessing of Tarmalen" -r -u"^You feel strong - like you could carry( the)? whole flat world on your back!$" -d"^You feel weaker\.$" |
914c0375ce8e
'Blessing of Tarmalen' up-message was tuned, fixed with backwards compatibility for HC.
Matti Hamalainen <ccr@tnsp.org>
parents:
551
diff
changeset
|
1638 |
1234
8babe13acfaa
Fix "life link" prot support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1227
diff
changeset
|
1639 /prdefprot -i"lifelnk" -n"LifeLnk" -l"Life Link" -r -u"^You (succeed. You create a link to [A-Z][a-z]+\.|create a link to [A-Z][a-z]+\.|feel somehow linked to [A-Z][a-z]+!)$" -d"^You hear a loud snap like sound!$" |
425
14dc51b9c99b
- Fix "enhanced vitality" up trig to catch cast on self.
Ealoren Pupunen <ealoren@bat.org>
parents:
424
diff
changeset
|
1640 /prdefprot -i"evital" -n"EV" -l"Enhanced Vitality" -A"\'zoot zoot zoot\'" -r -u"^A bright light extracts from (your|.+\'s) hands covering your skin.$" -d"^Your skin stops glowing.$" |
430
d44a097df956
- Add Guardian Angel for Tarmalen prots.
Ealoren Pupunen <ealoren@bat.org>
parents:
426
diff
changeset
|
1641 /prdefprot -i"gangel" -n"GAngel" -l"Guardian Angel" -u"A guardian angel arrives to protect you!" -d"Your guardian angel cannot stay for longer and flies away." |
949
b16a2554ad63
Added 'see the light' prot.
Matti Hamalainen <ccr@tnsp.org>
parents:
948
diff
changeset
|
1642 /prdefprot -i"seelight" -n"SeeLight" -l"See the Light" -u"Wow! Suddenly you see the Light!" -d"You no longer see the light!" |
430
d44a097df956
- Add Guardian Angel for Tarmalen prots.
Ealoren Pupunen <ealoren@bat.org>
parents:
426
diff
changeset
|
1643 |
1 | 1644 ;; ---- Nun ---- |
1082
50c9e5159f46
'protection from evil' does not implicitly go down when dying in flower bat anymore, thus make it not error for compatibility with HC.
Matti Hamalainen <ccr@tnsp.org>
parents:
1079
diff
changeset
|
1645 /prdefprot -i"pfe" -n"PfE" -l"Protection from Evil" -M -r -q \ |
947
546e9ba6f819
Add some PfE drop messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
946
diff
changeset
|
1646 -u" (you feel more protected against evil|with sheer power as you are surrounded by)" \ |
546e9ba6f819
Add some PfE drop messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
946
diff
changeset
|
1647 -d"^(Your holy aura prevents you (from turning into a frog|being paralyzed)|You suddenly feel more vulnerable to evil|Your glow fades away and you suddenly feel more vulnerable to evil|The evil in you gives you strength and you shatter the holy aura around you).$" |
1240
99ef9f76dcdc
"Soul shield" is now renewable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1237
diff
changeset
|
1648 /prdefprot -i"soulsh" -n"SoulSh" -l"Soul Shield" -h -M -r -u"^(Your soul is covered by holy aura.|You spiritually reach out for your soul, protecting it with holy force.|[A-Z][a-z]+ places her hand over you and blesses your soul in the name of Las.)$" -d"^Your soul feels suddenly more vulnerable.$" |
885 | 1649 /prdefprot -i"hprot" -n"HProt" -l"Heavenly Protection" -M -r -u"(glow supernatural light|vibrates under magical pressure|blazes heavenly|flashes uncanny|twinkles|flickers) as you .* dazzling white particles dancing" -d"^Holy particles slow down, rapidly fading away.$" |
1650 /prdefprot -i"manash" -n"ManaSh" -l"Mana Shield" -s -u"You feel your magical power expanding." -d"Your life force seems weaker." | |
76
8c69696d83ab
Fixes in the protsystem, added and improved nun prots, cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
1651 |
360
d7158a925e21
Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents:
359
diff
changeset
|
1652 ;; ---- Templar ---- |
502
ac625436ea84
Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents:
501
diff
changeset
|
1653 /prdefprot -i"sof" -n"SoF" -l"Shield of Faith" -m -u"You are surrounded by divine glow!" -d"Your glow disappears." |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1654 /prdefprot -i"bof" -n"BoF" -l"Blessing of Faerwon" -r -u"^You feel your conviction to rid the world of evil grow stronger as you" -d"^You can feel the power of Faerwon leaving you\.$" |
9 | 1655 |
1 | 1656 ;; ---- Psionicist ---- |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1657 /prdefprot -i"levi" -n"Levi" -l"Levitation" -u"You slowly rise from the ground and start levitating." -d"You decide that you have levitated enough and slowly descend to the ground." |
948
93666678930f
Change 'force shield' up/down messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
947
diff
changeset
|
1658 /prdefprot -i"forcesh" -n"FSh" -l"Force Shield" -r \ |
93666678930f
Change 'force shield' up/down messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
947
diff
changeset
|
1659 -u"^(You form a psionic shield of force around your body|[A-Z][a-z]+ forms a shield of force around you)\.$" \ |
93666678930f
Change 'force shield' up/down messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
947
diff
changeset
|
1660 -d"^Your armour feels thinner.$" |
93666678930f
Change 'force shield' up/down messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
947
diff
changeset
|
1661 |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1662 /prdefprot -i"psish" -n"PsiSh" -l"Psionic Shield" -u"Psionic waves surge through your body and mind!" -d"The psionic shield vanishes." |
356 | 1663 /prdefprot -i"minddev" -n"MDev" -l"Mind Development" -s -u"You feel your mind developing." -d"Your brain suddenly seems smaller." |
1351
65475a57bcf7
Another attempt at fixing the 'beacon of enlightenment'-related issues.
Matti Hamalainen <ccr@tnsp.org>
parents:
1350
diff
changeset
|
1664 /prdefprot -i"ebeacon" -n"EBeacon" -l"Beacon of Enlightenment" -q -s -r -u"^Everything seems clearer under the inspiration of ([A-Z][a-z]+\'s?|your own) magic\.$" -d"^You (no longer feel inspired by ([A-Z][a-z]+\'s?|your) beacon of enlightenment-spell|feel lost as all beacons of enlightenment around you die out)\.$" |
359
44e0b9337fc4
Commented out 'transmute self' prot, it won't work due to not having
Matti Hamalainen <ccr@tnsp.org>
parents:
357
diff
changeset
|
1665 ;/prdefprot -i"transs" -n"TSelf" -l"Transmute Self" -A" \'nihenuak assaam no nek orrek\'$" -u"There is a puff of logic!" -d"You feel like the illusion around you lifted." |
1 | 1666 |
1667 ;; ---- Druid ---- | |
504
a083a1925719
New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents:
503
diff
changeset
|
1668 /prdefprot -i"flexsh" -n"FlexSh" -l"Flex Shield" -M -u"You sense a flex shield covering your body like a second skin." -d"Your flex shield wobbles, PINGs and vanishes." |
1355
1b74ab649379
Fix 'earth power' handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
1354
diff
changeset
|
1669 /prdefprot -i"epower" -n"EPower" -l"Earth Power" -r -u"^You feel your strength changing\. You flex your? muscles experimentally\.$" -d"^The runic sigla \'% !\^\' fade away\.\. leaving you feeling strange\.$" |
1256
440eb15076db
Possibly fix "earth skin" support, the down message has changed ...
Matti Hamalainen <ccr@tnsp.org>
parents:
1253
diff
changeset
|
1670 /prdefprot -i"eskin" -n"ESkin" -l"Earth Skin" -M -s -r -u"^You feel your skin harden\.$" -d"^Your skin (returns to its original texture|feels softer)\.$" |
377
97bae5a28498
v0.5.11.0: Removed bindings module, moved bindings to
Matti Hamalainen <ccr@tnsp.org>
parents:
372
diff
changeset
|
1671 /prdefprot -i"eblood" -n"EBlood" -l"Earth Blood" -A" traces? icy blue runes on the ground with" -B" is surrounded by a sudden cloudburst" -u"An icy chill runs through your veins." -d"The runic sigla \'!( *)\' fade away.. leaving you feeling strange." |
1383
07649fc280d3
Fix 'vine mantle' support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1370
diff
changeset
|
1672 /prdefprot -i"vmant" -n"Vmant" -l"Vine Mantle" -M -r -s -u"^Vines entangle your body\.$" -d"^The vines (around your body shrink|crumble to dust)\.$" |
1261
0d16130be22c
'Regeneration' down message had been changed, fixed to support the new message.
Matti Hamalainen <ccr@tnsp.org>
parents:
1257
diff
changeset
|
1673 /prdefprot -i"regen" -n"Regen" -l"Regeneration" -r -u"^You feel your metabolism speed up\.$" -d"^You no longer have an? active regeneration spell on you\.$" |
1 | 1674 |
1675 ;; ---- Bard ---- | |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1676 /prdefprot -i"warez" -n"WarEns" -l"War Ensemble" -A"\'War is TOTAL massacre, sport the war, war SUPPOORT!!!\'" -u"You feel full of battle rage! Victory is CERTAIN!" -d"The effect of war ensemble wears off." |
1577 | 1677 /prdefprot -i"emelody" -n"EMelody" -l"Embracing Melody" -r -u"^(You embrace yourself with your|[A-Z][a-z]+ wraps you into an embracing) melody\.$" -d"^The embracing melody subsides, leaving you longing for more\.$" |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1678 /prdefprot -i"afavour" -n"AFav" -l"Arches Favour" -u"You feel optimistic about your near future!" -d"You no longer have Arches Favour on you. You feel sad." |
355
32c884e80dd3
v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents:
349
diff
changeset
|
1679 /prdefprot -i"cthought" -n"CT" -l"Clandestine Thoughts" -u"[clandestine thought]: activated. Snooping activities will be terminated and reported." -d"[clandestine thought]: scanning ended. Shielding from snoopers no longer active." |
599
7b8b6424956c
Added support for 'melody of the misadventurer'.
Matti Hamalainen <ccr@tnsp.org>
parents:
598
diff
changeset
|
1680 /prdefprot -i"motma" -n"MotMA" -l"Melody of the Misadventurer" -z -A"^The melody sung by .* descends upon you like a weight on your shoulders\.$" -u"You feel miserable." -d"You feel like a weight has been lifted from your mental shoulders." |
70 | 1681 |
517
b65e36f7f864
Added support for 'destructive rage' skill/prot.
Matti Hamalainen <ccr@tnsp.org>
parents:
512
diff
changeset
|
1682 ;; ---- LoC ---- |
b65e36f7f864
Added support for 'destructive rage' skill/prot.
Matti Hamalainen <ccr@tnsp.org>
parents:
512
diff
changeset
|
1683 /prdefprot -i"drage" -n"DRage" -l"Destructive Rage" -r -A"^A veiled darkness descends over your eyes. Sounds are oddly distorted" -u"but wreaking havoc on all that stands before you\.$" -d"^Your massive build-up of rage slowly dissipates leaving you drained" |
1 | 1684 |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1685 ;; ---- Conjurer::Basic Prots ---- |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1686 /prdefprot -i"sop" -n"SoP" -l"Shield of Protection" -A" \'nsiiznau\'$" -u"You feel a slight tingle." -d"You feel more vulnerable now." |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1687 /prdefprot -i"bimage" -n"BImg" -l"Blurred Image" -A" \'ziiiuuuuns wiz\'$" -u"You feel a powerful aura." -d"You feel less invisible." |
540 | 1688 /prdefprot -i"disp" -n"Disp" -l"Displacement" -A" \'diiiiuuunz aaanziz\'$" -r -u"^You feel a powerful aura\.$" -d"^You(r displacement spell wears off| feel much less invisible)\.$" |
507
35182db3914b
Points added for iron will
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
505
diff
changeset
|
1689 /prdefprot -i"iwill" -n"IWill" -l"Iron Will" -u"You feel protected from being stunned." -d"You feel no longer protected from being stunned." |
540 | 1690 /prdefprot -i"rentr" -n"REntrop" -l"Resist Entropy" -u"You feel your life force expanding." -d"You feel your hair is getting grayer." |
1691 /prdefprot -i"rdisint" -n"RDisInt" -l"Resist Disintegrate" -u"You feel very firm." -d"You feel somewhat weaker." | |
706
43e7e89f47c8
Added support for new style 'Resist Dispel'; Fixed a bug with 'Blurred Image' and 'Displacement' and similar prots with exactly same "up" message, but different prereqs.
Matti Hamalainen <ccr@tnsp.org>
parents:
704
diff
changeset
|
1692 /prdefprot -i"rdisp" -n"RDisp" -l"Resist Dispel" -u"You feel extra sticky for protection." -d"You feel less sticky." |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1693 |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1694 ;; ---- Conjurer::Minor Typeprots ---- |
1077
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1695 /prdefprot -i"c_phys" -n"Fabs" -l"Force Absorption" -p -A"ztonez des deckers" -d"skin brown" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1696 /prdefprot -i"c_acid" -n"cAcid" -l"Corrosion Shield" -p -A"sulphiraidzik hydrochloodriz gidz zuf" -d"disgusting yellow" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1697 /prdefprot -i"c_poison" -n"cPois" -l"Toxic Dilution" -p -A"morri nam pantoloosa" -d"green" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1698 /prdefprot -i"c_elec" -n"cElec" -l"Energy Channeling" -p -A"kablaaaammmmm bliitz zundfer" -d"crackling blue" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1699 /prdefprot -i"c_asphyx" -n"cAsph" -l"Ether Boundary" -p -A"qor monoliftus" -d"dull black" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1700 /prdefprot -i"c_fire" -n"cFire" -l"Heat Reduction" -p -A"hot hot not zeis daimons" -d"burning red" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1701 /prdefprot -i"c_magic" -n"cMana" -l"Magic Dispersion" -p -A"meke tul magic" -d"golden" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1702 /prdefprot -i"c_psi" -n"cPsi" -l"Psychic Sanctuary" -p -A"toughen da mind reeez un biis" -d"transparent" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1703 /prdefprot -i"c_cold" -n"cCold" -l"Frost Insulation" -p -A"skaki barictos yetz fiil" -d"cold white" |
114
f8c00e7a42ff
Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents:
113
diff
changeset
|
1704 |
138
79d44844725e
0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents:
136
diff
changeset
|
1705 ;; ---- Conjurer::Major Typeprots ---- |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
1706 /prdefprot -i"m_phys" -n"AoA" -l"Armour of Aether" -P -A"fooharribah inaminos cantor" -d"crystal clear" |
1077
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1707 /prdefprot -i"m_acid" -n"GAcid" -l"Acid Shield" -P -A"hfizz hfizz nglurglptz" -d"bubbling yellow" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1708 /prdefprot -i"m_poison" -n"GPois" -l"Shield of Detoxification" -P -A"nyiaha llaimay exchekes ployp" -d"slimy olive green" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1709 /prdefprot -i"m_elec" -n"GElec" -l"Lightning Shield" -P -A"ohm" -d"neon purple" |
1079
5f0e69d879fb
Oops, a doublequote (") was missing from GAsphyx (Aura of Wind) conjurer prot definition due to typo. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1077
diff
changeset
|
1710 /prdefprot -i"m_asphyx" -n"GAsph" -l"Aura of Wind" -P -A"englobo globo mc\'pop" -d"swirling foggy white" |
1077
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1711 /prdefprot -i"m_fire" -n"GFire" -l"Flame Shield" -P -A"huppa huppa tiki tiki" -d"crackling red-orange" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1712 /prdefprot -i"m_magic" -n"GMana" -l"Repulsor Aura" -P -A"shamarubu incixtes delfo" -d"flickering golden" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1713 /prdefprot -i"m_psi" -n"GPsi" -l"Psionic Phalanx" -P -A"all for one, gather around me" -d"misty pale blue" |
3a9be7e507b0
Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1076
diff
changeset
|
1714 /prdefprot -i"m_cold" -n"GCold" -l"Frost Shield" -P -A"nbarrimon zfettix roi" -d"frosty blue-white" |
146 | 1715 |
725
aca05fb5dd7d
v0.6.3.2-svn; Added some Folklorist prots, courtesy of Nu. Still left one prot out, not sure if it is correct...
Matti Hamalainen <ccr@tnsp.org>
parents:
718
diff
changeset
|
1716 ;; ---- Folklorist ---- |
1235
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1717 /prdefprot -i"minprot" -n"MinorP" -l"Minor Protection" -u"You feel slightly protected." -d"The minor protection fades away." |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1718 /prdefprot -i"zooprot" -n"ZooP" -l"Zoological Protection" -F -u" from animals" -d"zoological" |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1719 /prdefprot -i"cryzprot" -n"CrypZP" -l"Cryptozoological Protection" -F -u" from mythical creatures" -d"cryptozoological" |
f4a450e3e76f
Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents:
1234
diff
changeset
|
1720 /prdefprot -i"kineprot" -n"KineP" -l"Kinemortological Protection" -F -u" from undead creatures" -d"kinemortological" |
1446
e05353343873
Possibly fix 'iron will' up message from being misdetected as 'racial protection'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1440
diff
changeset
|
1721 /prdefprot -i"raciprot" -n"RacP" -l"Racial Protection" -h -F -u" from [a-z -]+s" -d"racial" |
725
aca05fb5dd7d
v0.6.3.2-svn; Added some Folklorist prots, courtesy of Nu. Still left one prot out, not sure if it is correct...
Matti Hamalainen <ccr@tnsp.org>
parents:
718
diff
changeset
|
1722 |
1133 | 1723 ;; ---- Lunar Defender --- |
1724 ;/prdefprot -i"lunshield" -n"LunS" -l"Lunacy Shield" -u"A translucent shield appears around you, flashes multiple colours, then vanishes." -d"" | |
1 | 1725 |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1726 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1727 ;; Unstun (NS) |
1110
2e71dfd6c983
Change unstun short name to 'Uns'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1100
diff
changeset
|
1728 /prdefprot -i"unstun" -n"Uns" -l"Unstun" -h -q -e |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1729 |
1577 | 1730 /gdef -i -F -aCgreen -mregexp -t"^[A-Z][a-z]+\'s chanting appears to do absolutely nothing.$" rec_unstun_on =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1731 /gprot_on unstun%;/set prot_unstun_w=0 |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1732 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1733 /gdef -i -F -aCgreen -msimple -t"You are STUNNED." rec_stun_start =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1734 /set stun_st=on%;/gprot_off unstun |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1735 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1736 /gdef -i -F -aCgreen -mregexp -t" paralyzes you with its mind\.$" rec_paralyzed_start =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1737 /gspell_interrupt%;/gskill_interrupt%;/set stun_st=on%;/gprot_off unstun |
633
7ad08f4c0514
Skill/spell breaks were not properly handled in some cases, this should now be fixed; Also paralyzes
Matti Hamalainen <ccr@tnsp.org>
parents:
631
diff
changeset
|
1738 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1739 /gdef -i -F -aCgreen -msimple -t"You are no longer stunned." rec_stun_end =\ |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1740 /set stun_st=off%;/msr No longer stunned |
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1741 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1742 /gdef -i -F -aCgreen -msimple -t"It doesn't hurt as much as it normally does!" rec_unstun_off =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1743 /gprot_off unstun |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1744 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1745 /gdef -i -F -aCgreen -msimple -t"It doesn't hurt at all!" rec_unstun_notall =\ |
633
7ad08f4c0514
Skill/spell breaks were not properly handled in some cases, this should now be fixed; Also paralyzes
Matti Hamalainen <ccr@tnsp.org>
parents:
631
diff
changeset
|
1746 /gspell_interrupt%;/gskill_interrupt%;\ |
289 | 1747 /set prot_unstun_w=$[prot_unstun_w+1]%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1748 /msr Unstun weakened [#%{prot_unstun_w}]%;\ |
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1749 /gstatus_update |
69
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1750 |
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1751 |
3cfb24dca78d
Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
1752 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1753 ;; Mesmeric Threshold (NS) |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1754 /prdefprot -i"mthresh" -n"MesmTh" -l"Mesmeric Threshold" -h -q -e |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1755 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1756 /gdef -i -F -aCgreen -msimple -t"You feel too mesmerized to know pain as a supernatural trance takes over you." rec_mthresh_on =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1757 /gprot_on mthresh%;/set prot_mthresh_w=0 |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1758 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1759 /gdef -i -F -aCgreen -msimple -t"The dreamlike feeling improving your concentration subsides." rec_mthresh_off =\ |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1760 /gprot_off mthresh |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1761 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1762 /gdef -i -F -aCgreen -msimple -t"You get hit HARD, but continue your actions under a supernatural trance." rec_mthresh_weak =\ |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1763 /set prot_mthresh_w=$[prot_mthresh_w+1]%;\ |
524
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1764 /msr Mesmeric Threshold weakened [#%{prot_mthresh_w}]%;\ |
338e2b7335f5
v0.6.1.8: Added /loccommand and /locaction cmd; Unstun and Mesmeric Threshold now show (in prot report lines) if they have been weakened. The number of weakenings is indicated by "<N>".
Matti Hamalainen <ccr@tnsp.org>
parents:
522
diff
changeset
|
1765 /gstatus_update |
518
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1766 |
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1767 |
fb9c524eeca3
Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents:
517
diff
changeset
|
1768 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1769 ;; Special curse tracking timers |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1770 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1030 | 1771 /set lst_cursed= |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1772 /prdeftoggle -n"cursewarn" -d"Warn about soon expiring curses" |
1030 | 1773 |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1774 ;; Clear curse prerequisites |
833 | 1775 /def -i prclearcurses =\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1776 /while ({#})\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1777 /set curse_%{1}_p=0%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1778 /shift%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1779 /done |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1780 |
1030 | 1781 ;; Define a curse |
1782 ; -i"<idname>" Unique identifier | |
1783 ; -n"<short name>" Curse short name | |
1784 ; -l"<long name>" Long name | |
1785 ; -u"<up message>" Up message (regexp) | |
1786 ; -d"<down message>" Optional down message (regexp) | |
1787 ; -A"<prerequisite #1>" Optional curse "up" prerequisite #1 (regexp) | |
1788 ; -B"<prerequisite #2>" | |
1789 ; -C"<prerequisite #3>" | |
1790 ; -U# Up message regexp subexpression index for curse target name | |
1791 ; -D# Down message regexp subexpression index for curse target name | |
1792 ; -t# Final expiration time in seconds (e.g. absolute maximum time the curse may be up) | |
1793 | |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1794 /def -i prdefcurse =\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1795 /if (!getopts("i:n:l:A:B:C:u:d:t#U#D#", "")) /gerror Invalid curse definition!%;/break%;/endif%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1796 /if (opt_i=~"") /gerror Missing curse vardef (-i) in definition.%;/break%;/endif%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1797 /if (opt_n=~"") /gerror Missing curse name (-n) in '%{opt_i}' definition.%;/break%;/endif%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1798 /if (opt_l=~"") /gerror Missing curse long desc (-l) in '%{opt_i}' definition.%;/break%;/endif%;\ |
1030 | 1799 /if (opt_u!~"" & !opt_U) /gerror Missing -Ux from curse '%{opt_i}' definition.%;/break%;/endif%;\ |
1800 /if (opt_d!~"" & !opt_D) /gerror Missing -Dx from curse '%{opt_i}' definition.%;/break%;/endif%;\ | |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1801 /if (opt_w > opt_t) /gerror Curse '%{opt_i}' (%{opt_n}) has expiration warning longer than max duration (-w > -t)!%;/break%;/endif%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1802 /test prlist_insert("lst_curses", opt_i)%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1803 /set curse_%{opt_i}_n=%{opt_n}%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1804 /set curse_%{opt_i}_l=%{opt_l}%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1805 /set curse_%{opt_i}_p=0%;\ |
830
588c3dedd496
Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents:
829
diff
changeset
|
1806 /if (opt_t)\ |
588c3dedd496
Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents:
829
diff
changeset
|
1807 /set curse_%{opt_i}_m=%{opt_t}%;\ |
588c3dedd496
Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents:
829
diff
changeset
|
1808 /else \ |
1030 | 1809 /set curse_%{opt_i}_m=-1%;\ |
1810 /endif%;\ | |
1811 /let _plevel=0%;\ | |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1812 /if (opt_A!~"") /let _plevel=1%;/def -i -F -p9999 -mregexp -t'%{opt_A}' rec_%{opt_i}_A=/prclearcurses %%{lst_curses}%%;/set curse_%{opt_i}_p=1%;/endif%;\ |
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1813 /if (opt_B!~"") /let _plevel=2%;/def -i -F -p9999 -mregexp -t'%{opt_B}' rec_%{opt_i}_B=/if (curse_%{opt_i}_p == 1) /prclearcurses %%{lst_curses}%%;/set curse_%{opt_i}_p=2%%;/endif%;/endif%;\ |
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1814 /if (opt_C!~"") /let _plevel=3%;/def -i -F -p9999 -mregexp -t'%{opt_C}' rec_%{opt_i}_C=/if (curse_%{opt_i}_p == 2) /prclearcurses %%{lst_curses}%%;/set curse_%{opt_i}_p=3%%;/endif%;/endif%;\ |
1030 | 1815 /if (_plevel > 0)\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1816 /def -i -F -p9999 -mregexp -t'%{opt_u}' gcurse_%{opt_i}_on=\ |
1030 | 1817 /if (curse_%{opt_i}_p==%{_plevel})\ |
1818 /test gcurse_on("%{opt_i}",{P%{opt_U}})%%;\ | |
1819 /endif%%;\ | |
1820 /set curse_%{opt_i}_p=0%;\ | |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1821 /else \ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1822 /def -i -F -p9999 -mregexp -t'%{opt_u}' gcurse_%{opt_i}_on=\ |
1030 | 1823 /set curse_%{opt_i}_p=0%%;\ |
1824 /test gcurse_on("%{opt_i}",{P%{opt_U}})%;\ | |
1825 /endif%;\ | |
1826 /if (opt_d!~"")\ | |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
1827 /def -i -F -p9999 -mregexp -t'%{opt_d}' gcurse_%{opt_i}_off=\ |
1030 | 1828 /test gcurse_off("%{opt_i}",{P%{opt_D}})%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1829 /endif |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1830 |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1831 ;; Check if given curse ID is still existing |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1832 /def -i gcurse_check =\ |
1404
e6e61c1475ea
Fix curse expiration timer functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1403
diff
changeset
|
1833 /return regmatch(strcat("(^| )",replace("|","\|",{1}),"( |$$)"), lst_cursed) |
1030 | 1834 |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1835 ;; Expiration macro |
1030 | 1836 /def -i gcurse_expire =\ |
1404
e6e61c1475ea
Fix curse expiration timer functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1403
diff
changeset
|
1837 /let _cid=%{2}%;/let _ctgt=%{1}%;/let _cinfo=%{3}%;\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1838 /if (gcurse_check(_cinfo))\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1839 /test prlist_delete("lst_cursed", _cinfo)%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1840 /let _clong=$[prgetval(strcat("curse_",_cid,"_n"))]%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1841 /msr %{_clong} on %{_ctgt} expired!%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1842 /endif |
1030 | 1843 |
1215
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1844 ;; Delete matching curses |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1845 /def -i gcurse_delete =\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1846 /let _cid=%{1}%;/shift%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1847 /let _ctgt=%{1}%;/shift%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1848 /let _ctmp=%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1849 /while ({#})\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1850 /if (!regmatch(strcat("^",_ctgt,"\|",_cid,"\|"),{1}))\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1851 /let _ctmp=%{1} %{_ctmp}%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1852 /endif%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1853 /shift%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1854 /done%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1855 /result _ctmp |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1856 |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1857 ;; Expiration warning |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1858 /def -i gcurse_warn =\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1859 /if (opt_cursewarn!~"on") /break%;/endif%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1860 /let _cid=%{2}%;/let _ctgt=%{1}%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1861 /let _ctime=%{3}%;/let _cinfo=%{4}%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1862 /if (gcurse_check(_cinfo))\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1863 /let _clong=$[prgetval(strcat("curse_",_cid,"_n"))]%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1864 /msr %{_clong} on %{_ctgt} expiring in %{_ctime} seconds!%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1865 /endif |
1030 | 1866 |
828
3bb448e9791e
Check curse target against party member list (requires GgrTF::PSSMangler) to avoid catching stuff cast on players by monsters.
Matti Hamalainen <ccr@tnsp.org>
parents:
827
diff
changeset
|
1867 ;; Turn a curse "on", with some sanity checking |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1868 /def -i gcurse_on =\ |
1030 | 1869 /let _cid=%{1}%;\ |
1870 /let _ctgt=%{2}%;\ | |
1871 /let _ccmp=(^| )%{_ctgt}( |$$)%;\ | |
1872 /let _clong=$[prgetval(strcat("curse_",_cid,"_l"))]%;\ | |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1873 /if (_clong=~"") /gerror Invalid curse ID '%{_cid}'%;/break%;/endif%;\ |
828
3bb448e9791e
Check curse target against party member list (requires GgrTF::PSSMangler) to avoid catching stuff cast on players by monsters.
Matti Hamalainen <ccr@tnsp.org>
parents:
827
diff
changeset
|
1874 /if (!regmatch(_ccmp, gparty_members))\ |
1215
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1875 /let _ctmp=$[replace(" ","§",_ctgt)]%;\ |
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1876 /set lst_cursed=$(/gcurse_delete %{_cid} %{_ctmp} %{lst_cursed})%;\ |
1030 | 1877 /let _cexpire=$[prgetval(strcat("curse_",_cid,"_m"))]%;\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1878 /let _cwarn=$[prgetval(strcat("curse_",_cid,"_w"))]%;\ |
1215
ff4599b860ae
Delete previous curse of same type cast at same-named target, if the current one has not expired yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1214
diff
changeset
|
1879 /let _cinfo=$[strcat(_ctmp,"|",_cid,"|",time())]%;\ |
1030 | 1880 /test prlist_insert("lst_cursed", _cinfo)%;\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1881 /msr %{_ctgt} has been %{_clong}!%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1882 /eval /repeat -%{_cexpire} 1 /test gcurse_expire("%{_ctgt}", "%{_cid}", "%{_cinfo}")%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1883 /if (opt_cursewarn=~"on")\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1884 /let _cwarn=$[trunc(_cexpire * 0.20)]%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1885 /eval /repeat -$[_cexpire - _cwarn] 1 /test gcurse_warn("%{_ctgt}", "%{_cid}", %{_cwarn}, "%{_cinfo}")%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1886 /endif%;\ |
829
d98e9a88370a
Inform the user that partymember curse has been ignored.
Matti Hamalainen <ccr@tnsp.org>
parents:
828
diff
changeset
|
1887 /else \ |
1030 | 1888 /msq Ignoring partymember %{_ctgt} being %{_clong}.%;\ |
828
3bb448e9791e
Check curse target against party member list (requires GgrTF::PSSMangler) to avoid catching stuff cast on players by monsters.
Matti Hamalainen <ccr@tnsp.org>
parents:
827
diff
changeset
|
1889 /endif |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1890 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1891 /def -i gcurses_do_get =\ |
1030 | 1892 /let _ctime=$[time()]%;\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1893 /let _cursestr=%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1894 /while ({#})\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1895 /let _ctmp=%{1}%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1896 /if (regmatch("^(.+?)\|([a-z][a-z0-9]+)\|([0-9.]+)$",_ctmp))\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1897 /let _ctmp=$[prgetval(strcat("curse_",{P2},"_n"))] @ $[replace("§"," ",{P1})] ($[prgettime(_ctime - {P3})])%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1898 /if (_cursestr!~"") /let _cursestr=%{_cursestr} | %{_ctmp}%;/else /let _cursestr=%{_ctmp}%;/endif%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1899 /else \ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1900 /gerror Invalid curse entry '%{_ctmp}'. Internal error.%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1901 /endif%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1902 /shift%;\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1903 /done%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1904 /result _cursestr |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1905 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1906 /def -i gcurses_get =\ |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1907 /let _ctmp=$(/gcurses_do_get %{lst_cursed})%;\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1908 /if (_ctmp!~"")\ |
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1909 /return _ctmp%;\ |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1910 /else \ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1911 /return "No curses tracked."%;\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1912 /endif |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1913 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1914 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1915 ;; Curse reporting |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1916 /def -i curses = /msq Curses: $[gcurses_get()] |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1917 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1918 /prdefgbind -s"curses" -c"/curses" |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1919 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1920 /def -i -p9999 -mregexp -t"^(You twirl before yourself|[A-Z][a-z]+ twirls before you)\.$" gcurses_twirl =\ |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1921 /msr $[gcurses_get()] |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1922 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1923 |
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1924 ;; Curse definitions |
1147
4c657ec0d0d8
Finally repair the long-broken curse handling. Can now handle multiple targets of the same curse type, also informs when the curse "expires" (naturally the exact time cannot be known, but average of 10 minutes is assumed for now). Optional warning about soon expiring curses can also be reported (/cursewarn)
Matti Hamalainen <ccr@tnsp.org>
parents:
1146
diff
changeset
|
1925 /prdefcurse -i"touch" -n"STouch" -l"spider touched" -t600 \ |
1030 | 1926 -U1 -u"^(.+) turns very pale and shivers as if (he|she|it) had just been poisoned\.$" |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1927 |
830
588c3dedd496
Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents:
829
diff
changeset
|
1928 /prdefcurse -i"cot" -n"CoT" -l"cursed/cotted" -t600 \ |
828
3bb448e9791e
Check curse target against party member list (requires GgrTF::PSSMangler) to avoid catching stuff cast on players by monsters.
Matti Hamalainen <ccr@tnsp.org>
parents:
827
diff
changeset
|
1929 -A" utters? the magic words \'nilaehz temnahecne neg\'" \ |
1030 | 1930 -U1 -u"^(.+) turns very pale!$" |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1931 |
830
588c3dedd496
Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents:
829
diff
changeset
|
1932 /prdefcurse -i"degen" -n"Degen" -l"degenerated" -t600 \ |
828
3bb448e9791e
Check curse target against party member list (requires GgrTF::PSSMangler) to avoid catching stuff cast on players by monsters.
Matti Hamalainen <ccr@tnsp.org>
parents:
827
diff
changeset
|
1933 -A" utters? the magic words \'kewa dan dol rae hout\'" \ |
1030 | 1934 -U1 -u"^(.+) appears weakened!$" |
826
b89c39bbee10
Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents:
824
diff
changeset
|
1935 |
795
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1936 |
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1937 |
a3624cda1141
Renamed pron/proff macros to gprot_on and gprot_off. Added preliminary code for curse timers.
Matti Hamalainen <ccr@tnsp.org>
parents:
794
diff
changeset
|
1938 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | 1939 ;; Skill and skill-status reporting |
1940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
295 | 1941 ; skill_t - timestamp of when skill started |
1942 ; skill_st - 'on' during skill "concentration" phase, off when skill goes off | |
1943 ; skill_st2 - 'off' during "concentration", on when skill goes off | |
1944 ; | |
1945 ; cast_info - empty for no cast/skill going on, 'SP' for spells, 'SK' for skills | |
1946 ; cast_info_n - name of skill/spell currently going on | |
1947 ; cast_info_t - target of skill/spell (empty if no target) | |
1948 | |
1949 | |
1950 ;; Display information about current skill/spell | |
291 | 1951 /def -i gshow_info =\ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1952 /if (cast_info_t!~"")\ |
87
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1953 /msq '%{cast_info_n}' -> %{cast_info_t}%;\ |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1954 /else \ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1955 /if (battle_target!~"")\ |
87
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1956 /msq '%{cast_info_n}' -> (%{battle_target})%;\ |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1957 /else \ |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1958 /msq '%{cast_info_n}'%;\ |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1959 /endif%;\ |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1960 /endif |
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1961 |
1 | 1962 ;; Start of skill |
595
3cb2f995ad46
Make skill/spell "spam" optional
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1963 /def -i -p9999 -msimple -t"You start concentrating on the skill." gskill_start =\ |
1 | 1964 /set skill_t=$[time()]%;\ |
289 | 1965 /set cnt_skills=$[cnt_skills+1]%;\ |
1 | 1966 /set skill_st=on%;\ |
1967 /set skill_st2=off%;\ | |
87
d69db598b52f
Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents:
84
diff
changeset
|
1968 /set cast_info=SK%;/set cast_info_n=%;/set cast_info_t=%;@@cast info%;\ |
958
a0d4bcfc65de
Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
949
diff
changeset
|
1969 /msk @{BCyellow} ---- SKILL START ---- @{n} (@{Cyellow}%{cnt_skills}@{n})%;\ |
759
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
1970 /gstatus_update%;/prexecfuncs %{event_skill_start} |
1 | 1971 |
1972 | |
1973 ;; Skill done | |
595
3cb2f995ad46
Make skill/spell "spam" optional
Matti Hamalainen <ccr@tnsp.org>
parents:
590
diff
changeset
|
1974 /def -i -p9999 -msimple -t"You are prepared to do the skill." gskill_end =\ |
289 | 1975 /set cnt_sskills=$[cnt_sskills+1]%;\ |
1 | 1976 /set skill_st=off%;\ |
1977 /set skill_st2=on%;\ | |
28
c73df1b83f8f
Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
1978 /set cast_info=%;\ |
289 | 1979 /set cnt_sktime=$[cnt_sktime+time() - skill_t]%;\ |
958
a0d4bcfc65de
Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
949
diff
changeset
|
1980 /msk @{Cbggreen} ---- SKILL DONE ---- @{n} @{Cyellow}$[prgetstime(skill_t)]@{n}%;\ |
759
c525ebc0448c
Add event hooks for skill/spell start/done events.
Matti Hamalainen <ccr@tnsp.org>
parents:
758
diff
changeset
|
1981 /gstatus_update%;/prexecfuncs %{event_skill_done} |
28
c73df1b83f8f
Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
1982 |
295 | 1983 |
28
c73df1b83f8f
Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
1984 ;; Cast info |
291 | 1985 /def -i -p9999 -ag -mregexp -t"^You are using \'([a-z ]+)\'.$" gskill_info1 =\ |
294 | 1986 /set cast_info_n=%{P1}%;/set cast_info_t=%;/gshow_info%;\ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1987 /if (opt_rskills=~"on") @@emote is using '%{P1}'%;/endif |
28
c73df1b83f8f
Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
1988 |
1030 | 1989 /def -i -p9999 -ag -mregexp -t"^You are using \'([a-z ]+)\' at \'(.+?)\'.$" gskill_info2 =\ |
294 | 1990 /set cast_info_n=%{P1}%;/set cast_info_t=%{P2}%;/gshow_info%;\ |
148
1f8ef34c48f7
The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents:
146
diff
changeset
|
1991 /if (opt_rskills=~"on") @@emote is using '%{P1}' -> '%{P2}'%;/endif |
28
c73df1b83f8f
Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
1992 |
295 | 1993 |
1 | 1994 ;; Skill fumbled |
291 | 1995 /def -i gskill_fumble =\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
1996 /if (skill_st2=~"on")\ |
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
1997 /set cnt_sskills=$[cnt_sskills - 1]%;\ |
289 | 1998 /set cnt_fuskills=$[cnt_fuskills+1]%;\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
1999 /set skill_st2=off%;\ |
1 | 2000 /endif |
2001 | |
295 | 2002 |
1 | 2003 ;; Skill failed |
291 | 2004 /def -i gskill_fail =\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2005 /if (skill_st2=~"on")\ |
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2006 /set cnt_sskills=$[cnt_sskills - 1]%;\ |
289 | 2007 /set cnt_fskills=$[cnt_fskills+1]%;\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2008 /set skill_st2=off%;\ |
1 | 2009 /endif |
2010 | |
295 | 2011 |
1 | 2012 ;; Skill interrupted |
291 | 2013 /def -i gskill_interrupt =\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2014 /if (skill_st=~"on")\ |
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2015 /msq @{Cbgred} ---- SKILL INTERRUPTED ---- @{n}%;\ |
289 | 2016 /set cnt_iskills=$[cnt_iskills+1]%;\ |
153
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2017 /set skill_st=off%;\ |
3bfbeb2ca379
Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
2018 /set cast_info=%;\ |
290
89458d89ed04
Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents:
289
diff
changeset
|
2019 /gstatus_update%;\ |
214
080b02940954
Breakage, new event_* variables to list macros executed on specific events.
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
2020 /prexecfuncs %{event_skill_intr}%;\ |
1 | 2021 /endif |
2022 | |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2023 ;; Skill stopped |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2024 /def -i gskill_stopped =\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2025 /if (skill_st=~"on")\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2026 /msq @{Cbgred} ---- SKILL STOPPED ---- @{n}%;\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2027 /set cnt_iskills=$[cnt_iskills+1]%;\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2028 /set skill_st=off%;\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2029 /set cast_info=%;\ |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2030 /gstatus_update%;\ |
1357
bc7a15e69a95
The triggered events for skill and spell stopped were using wrong variable name, fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1355
diff
changeset
|
2031 /prexecfuncs %{event_skill_stop}%;\ |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2032 /endif |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2033 |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2034 /def -i -p9999 -ag -mregexp -t"^(Your movement prevents you from doing the skill|You lose your concentration and cannot do the skill)\.$" gskill_interrupt1 =\ |
291 | 2035 /set skill_st2=on%;/gskill_interrupt |
1 | 2036 |
1390
4637f48d45f6
The 'sleep' command has its own messages for stopping / interrupting any
Matti Hamalainen <ccr@tnsp.org>
parents:
1387
diff
changeset
|
2037 /def -i -p9999 -ag -mregexp -t"^You (decide to change the skill to (a )?new one|stop concentrating on the skill and begin searching for a proper place to rest)\.$" gskill_stopped1 =\ |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2038 /set skill_st2=off%;/gskill_stopped |
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2039 |
1359
dab01d1b619f
One skill break/stop trigger had same overlapping name, and thus not working. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1357
diff
changeset
|
2040 /def -i -p9999 -ag -mregexp -t"^You break your skill attempt\.$" gskill_stopped2 =\ |
1353
2f925800296b
New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents:
1352
diff
changeset
|
2041 /set skill_st2=on%;/gskill_stopped |
1 | 2042 |
1359
dab01d1b619f
One skill break/stop trigger had same overlapping name, and thus not working. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1357
diff
changeset
|
2043 |
1 | 2044 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
844
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2045 ;; Ceremony |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2046 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2047 /prdefgbind -s"cere" -c"/ceremony" -n |
1139
adac33015c37
Add support for mage staff ceremony.
Matti Hamalainen <ccr@tnsp.org>
parents:
1138
diff
changeset
|
2048 |
adac33015c37
Add support for mage staff ceremony.
Matti Hamalainen <ccr@tnsp.org>
parents:
1138
diff
changeset
|
2049 /def -i -p9999 -mregexp -t"^You (perform the ceremony|feel your staff touching your mind)\.$" gceremony_on =\ |
adac33015c37
Add support for mage staff ceremony.
Matti Hamalainen <ccr@tnsp.org>
parents:
1138
diff
changeset
|
2050 /set ceremony_st=on%;/gstatus_update |
844
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2051 |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2052 /def -i -p9999 -ag -msimple -t"You have an unusual feeling as you cast the spell." gceremony_off =\ |
856
f539b6c28fbe
Make ceremony informing on spell start work.
Matti Hamalainen <ccr@tnsp.org>
parents:
851
diff
changeset
|
2053 /set ceremony_st=off%;/set ceremony_st2=on |
844
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2054 |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
2055 ;@command /ceremony |
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
2056 ;@desc Perform skill 'ceremony', but only if ceremony is not already "active". |
844
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2057 /def -i ceremony =\ |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2058 /if (ceremony_st=~"on")\ |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2059 /msq @{BCwhite}Ceremony@{n} @{Cyellow}already in effect!@{n}%;\ |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2060 /else \ |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2061 @@use ceremony%;\ |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2062 /endif |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2063 |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2064 |
2aad98afca1e
Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents:
838
diff
changeset
|
2065 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | 2066 ;; Battle, enemy shape |
2067 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
2068 ;; Report shape | |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2069 ;@command /shape |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
2070 ;@desc Reports the last catched shape of a opponent (monster) in battle. |
1674
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2071 ;@desc This does not work too well if you are fighting more than one opponents. |
916 | 2072 /def -i shape =\ |
333
47de1833c029
Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents:
332
diff
changeset
|
2073 /if (battle_target!~"")\ |
47de1833c029
Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents:
332
diff
changeset
|
2074 /msr %{battle_shape} (%{battle_target})%;\ |
1 | 2075 /else \ |
333
47de1833c029
Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents:
332
diff
changeset
|
2076 /msr %{battle_shape}%;\ |
1 | 2077 /endif%;\ |
2078 | |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2079 ;; Define shape formatting string |
333
47de1833c029
Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents:
332
diff
changeset
|
2080 /prdefvar -n"fmt_shape" \ |
1674
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2081 -v"@{Cgreen}$$[pad({bs_name},-40)}@{n} [@{%%{bc_color}}%%{bs_short}@{n}] (@{%%{bs_color}}%%{bs_range}%%%@{n})@{BCred}%%{bs_extra}@{n}" \ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2082 -c"Format string for shape reporting. %{bs_name}=target name, %{bs_color}=shape color, %{bs_short}=shape short name, %{bs_long}=shape long name, %{bs_range}=percentage/range, %{bs_extra}=stunned etc" |
1 | 2083 |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2084 ;; (Re)initialize battle |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2085 /def -i gbattle_init =\ |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2086 /set battle_round=1%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2087 /set battle_shape=es%;\ |
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2088 /set battle_pshape=es%;\ |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2089 /set battle_st=1%;\ |
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2090 /prexecfuncs %{event_battle_first_round} |
39
e7119d31408f
Added battle_roundfuncs hook
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents:
37
diff
changeset
|
2091 |
1197 | 2092 /def -i gbattle_end =\ |
1187
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2093 /if (battle_st)\ |
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2094 /set battle_st=0%;\ |
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2095 /set battle_target=%;\ |
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2096 /prexecfuncs %{event_battle_end}%;\ |
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2097 /endif |
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2098 |
1 | 2099 ;; New round |
1342
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2100 /def -i gbattle_round =\ |
1332
49b4fd8d5e51
Fix round flag trigger, again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1330
diff
changeset
|
2101 /set battle_round=$[battle_round+1]%;\ |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2102 /set battle_round_t=$[time()]%;\ |
1174
cd9b8dc264fa
Initiate battle status on first round before calling any other related functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1171
diff
changeset
|
2103 /if (!battle_st) /gbattle_init%;/endif%;\ |
329
16a26a4ba04b
v0.5.10.1: Reverted the round_cmd setting, it is unnecessary. Please use event_battle_round hooks instead; Different kind of shape highlighting now in use.
Matti Hamalainen <ccr@tnsp.org>
parents:
327
diff
changeset
|
2104 /if (set_round!~"") %{set_round}%;/endif%;\ |
419
c728ff45b78a
v0.6.0-pre4: /pstatus was changed to /pss and old /pss toggle is now /autopss;
Matti Hamalainen <ccr@tnsp.org>
parents:
417
diff
changeset
|
2105 /if (opt_autopss=~"on") /pss%;/endif%;\ |
329
16a26a4ba04b
v0.5.10.1: Reverted the round_cmd setting, it is unnecessary. Please use event_battle_round hooks instead; Different kind of shape highlighting now in use.
Matti Hamalainen <ccr@tnsp.org>
parents:
327
diff
changeset
|
2106 /prexecfuncs %{event_battle_round}%;\ |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2107 /gstatus_update |
1 | 2108 |
1342
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2109 /def -i -F -mregexp -t"^\*{10,25} (Round \d+|Round \d+ \(\d+\)) \*{10,25}$" gbattle_round1 =\ |
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2110 /gbattle_round |
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2111 |
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2112 /def -i -F -msimple -t"*****************************************************" gbattle_round2 =\ |
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2113 /gbattle_round |
692872487dd4
"Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
1341
diff
changeset
|
2114 |
1328
c960f8d8ac71
Cope with the new format of flowerbat battle round flags.
Matti Hamalainen <ccr@tnsp.org>
parents:
1325
diff
changeset
|
2115 |
1 | 2116 ;; Grab target via several methods |
916 | 2117 /def -i -F -p9999 -mregexp -t"^You are now targetting ([A-Za-z ,.'-]+)\.$" gbattle_target3 =\ |
958
a0d4bcfc65de
Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
949
diff
changeset
|
2118 /msk @{BCyellow}Targetting@{n} -> @{BCred}%{P1}@{n}%;\ |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2119 /set battle_target=%{1} |
1 | 2120 |
1674
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2121 |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2122 ;; Get and mangle target(s) shape |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2123 /def -i gbattle_shape_mangle =\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2124 /let bs_name=%{1}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2125 /let bs_long=%{2}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2126 /let bs_perc=%{3}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2127 /let bs_extra=%{4}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2128 /if (battle_st)\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2129 /set battle_pshape=%{battle_shape}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2130 /set battle_shape=%{bs_long}%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2131 /endif%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2132 /if (bs_long=~"excellent shape") /let bs_color=BCgreen%; /let bs_short=es%; /let bs_range=90-100%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2133 /elseif (bs_long=~"good shape") /let bs_color=Cgreen%; /let bs_short=gs%; /let bs_range=80-90%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2134 /elseif (bs_long=~"slightly hurt") /let bs_color=BCcyan%; /let bs_short=sh%; /let bs_range=65-80%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2135 /elseif (bs_long=~"noticeably hurt") /let bs_color=Ccyan%; /let bs_short=nh%; /let bs_range=50-65%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2136 /elseif (bs_long=~"not in a good shape") /let bs_color=BCyellow%;/let bs_short=nigs%;/let bs_range=35-50%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2137 /elseif (bs_long=~"bad shape") /let bs_color=Cyellow%; /let bs_short=bs%; /let bs_range=20-35%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2138 /elseif (bs_long=~"very bad shape") /let bs_color=BCred%; /let bs_short=vbs%; /let bs_range=10-20%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2139 /elseif (bs_long=~"near death") /let bs_color=Cred%; /let bs_short=nd%; /let bs_range=0-10%;/endif%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2140 /if (bs_perc!~"") /let bs_range=%{bs_perc}%;/endif%;\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2141 /eval /substitute -p %{fmt_shape} |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2142 |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2143 /def -i -F -p9999 -mregexp -t"^([A-Za-z ,.'-]+) is (in (a )?)?(excellent shape|good shape|slightly hurt|noticeably hurt|not in a good shape|bad shape|very bad shape|near death)( \(([0-9]+)%\))?(.*?)?\.$" gbattle_shape_match =\ |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2144 /test gbattle_shape_mangle({P1},{P4},{P6},{P7}) |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2145 |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2146 |
fddc49a03f9e
Refactor the target shape mangling. Unfortunately this breaks backwards
Matti Hamalainen <ccr@tnsp.org>
parents:
1673
diff
changeset
|
2147 ;; Monster RIP does not necessarily end battle, but let's reset the target at least. |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2148 /gdef -i -p9999 -aCgreen -mregexp -t"^[A-Za-z ,.'-]+ is DEAD, R.I.P.$" gbattle_rip =\ |
66
5c7192f709cc
Non-visible changes to battle_target handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
64
diff
changeset
|
2149 /set battle_target=%;\ |
214
080b02940954
Breakage, new event_* variables to list macros executed on specific events.
Matti Hamalainen <ccr@tnsp.org>
parents:
210
diff
changeset
|
2150 /prexecfuncs %{event_battle_rip} |
1 | 2151 |
1182
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2152 ;; End of battle, probably. We trust here that the last 'scan' (if any) |
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2153 ;; occurs after monster has died. If this is not the case, the heartbeat |
335ee40ae254
Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents:
1181
diff
changeset
|
2154 ;; function should take care of it eventually. |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2155 /gdef -i -p9999 -aCyellow -msimple -t"You are not in combat right now." gbattle_nocombat =\ |
1187
d68d84b46da0
Move battle ending functionality to gbattle_stop, use it from gbattle_nocombat (renamed from gbattle_end).
Matti Hamalainen <ccr@tnsp.org>
parents:
1185
diff
changeset
|
2156 /gbattle_end |
327
521d0c3233bd
v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents:
326
diff
changeset
|
2157 |
1189
cea697a08e89
Initial implementation of the potentially fabulously broken heartbeat and tick counter / predictor. No guarantees of correctness with this one.
Matti Hamalainen <ccr@tnsp.org>
parents:
1188
diff
changeset
|
2158 |
cea697a08e89
Initial implementation of the potentially fabulously broken heartbeat and tick counter / predictor. No guarantees of correctness with this one.
Matti Hamalainen <ccr@tnsp.org>
parents:
1188
diff
changeset
|
2159 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2160 ;; EXPERIMENTAL heartbeat / tick / timed battle end handling |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2161 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2162 /set heartbeat_res=0.05 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2163 /set heartbeat_last=-1 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2164 /set heartbeat_last_real=-1 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2165 /set heartbeat_tick_t=-1 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2166 /set heartbeat_jitter=0.5 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2167 /set heartbeat_avg=3 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2168 /set heartbeat_avg_last=3 3 3 3 3 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2169 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2170 ;; Check given value against heartbeat average and jitter bounds |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2171 /def -i ghbjitter =\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2172 /return ({1} >= heartbeat_jitter & {1} >= heartbeat_avg - heartbeat_jitter & {1} <= heartbeat_avg + heartbeat_jitter) |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2173 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2174 ;; Return all but first values of given arguments |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2175 /def -i prnth = /result "%{-1}" |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2176 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2177 ;; Compute simple average of given argument values |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2178 /def -i praverage =\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2179 /let _vsum=0.0%;/let _vnum=%{#}%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2180 /while ({#}) /let _vsum=$[_vsum+{1}]%;/shift%;/done%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2181 /result (_vsum / _vnum) |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2182 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2183 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2184 /def -i gheartbeat_timer =\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2185 /if (battle_st & time() - battle_round_t > 5)\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2186 /gbattle_end%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2187 /endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2188 /if (time() - heartbeat_last >= heartbeat_avg + 2 * heartbeat_res)\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2189 /gheartbeat_do force%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2190 /endif%;\ |
1512
4353e3a8bec1
Check against >= 10 instead of > 10
Matti Hamalainen <ccr@tnsp.org>
parents:
1511
diff
changeset
|
2191 /if (heartbeat_cnt >= 10)\ |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2192 /set heartbeat_discard=0%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2193 /gheartbeat_tick FORCE%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2194 /endif |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2195 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2196 /def -i gheartbeat_tick =\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2197 /let _tdelta=$[time() - heartbeat_tick_t]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2198 /if (hb_debug)/msq TICK %{1} (cnt=%{heartbeat_cnt}, delta=%{_tdelta})%;/endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2199 /set heartbeat_tick_t=$[time()]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2200 /set heartbeat_cnt=0%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2201 /gstatus_update |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2202 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2203 |
1458
9c71601f608a
Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
1454
diff
changeset
|
2204 /def -i gheartbeat_do =\ |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2205 /let _hbtime=$[time()]%;\ |
1458
9c71601f608a
Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
1454
diff
changeset
|
2206 /if ({1}=~"real")\ |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2207 /let _hblast=%{heartbeat_last_real}%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2208 /set heartbeat_last_real=%{_hbtime}%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2209 /set heartbeat_last=%{_hbtime}%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2210 /let _hbdelta=$[_hbtime - _hblast]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2211 /if (_hblast > 0 & ghbjitter(_hbdelta))\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2212 /set heartbeat_avg_last=$(/prnth %{heartbeat_avg_last} %{_hbdelta})%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2213 /set heartbeat_avg=$(/praverage %{heartbeat_avg_last})%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2214 /endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2215 /set heartbeat_cnt=$[heartbeat_cnt+1]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2216 /if (hb_debug) /msq HB_DO[%{1}]: %{_hbdelta} / %{heartbeat_avg} avgs={%{heartbeat_avg_last}}%;/endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2217 /gstatus_update%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2218 /else \ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2219 /let _hbdelta=$[_hbtime - heartbeat_last]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2220 /set heartbeat_last=%{_hbtime}%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2221 /if (hb_debug) /msq HB_DO[%{1}]: %{_hbdelta} / %{heartbeat_avg}%;/endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2222 /if (ghbjitter(_hbdelta))\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2223 /set heartbeat_cnt=$[heartbeat_cnt+1]%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2224 /gstatus_update%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2225 /endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2226 /endif |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2227 |
1498 | 2228 |
2229 /def -i gheartbeat_subtick =\ | |
2230 /gstatus_update%;\ | |
2231 /set heartbeat_subtick=$[heartbeat_subtick + 1] | |
2232 | |
2233 | |
2234 /def -i -ag -msimple -t"Dunk dunk" gheartbeat_dunk =\ | |
1458
9c71601f608a
Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
1454
diff
changeset
|
2235 /gheartbeat_do real%;\ |
1498 | 2236 /set heartbeat_subtick=0%;\ |
1511
7978e50eb93b
Oops, /grepeat returns a value, we need to catch it or otherwise it will
Matti Hamalainen <ccr@tnsp.org>
parents:
1510
diff
changeset
|
2237 /set heartbeat_pid=$(/grepeat -n -1 3 /gheartbeat_subtick) |
1458
9c71601f608a
Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents:
1454
diff
changeset
|
2238 |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2239 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2240 /def -i gheartbeat_sc =\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2241 /if (heartbeat_discard)\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2242 /set heartbeat_discard=0%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2243 /return%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2244 /endif%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2245 /if (status_sp - status_oldsp > 30 | status_ep - status_oldep > 5)\ |
1433
ad04147a7643
Remove 'HB' text from sc line.
Matti Hamalainen <ccr@tnsp.org>
parents:
1432
diff
changeset
|
2246 /substitute -p %{status_qline} @{Cgreen}[%{heartbeat_cnt}]@{n}%;\ |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2247 /gheartbeat_tick NORMAL%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2248 /endif |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2249 |
1491 | 2250 |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2251 ;; Detect certain events that cause potentially "false" ticks to occur. |
1429 | 2252 ;; Of course, sometimes these also contain the real tick, but can't help that. |
2253 /def -i -F -mregexp -t"^(Your blow impacts with chaotic force...|You feel like .+? healed you a bit\.|The crystal throbs faintly, healing some of your wounds\.|The fire.s warmth soothes you\.|The fire.s warmth feels especially soothing\.|The shimmering blue forcefield.s safety soothes you\.)$" gheartbeat_discard =\ | |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2254 /set heartbeat_discard=1%;\ |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2255 /if (hb_debug)/msq Discarding next sc%;/endif |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2256 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2257 |
1394
6bce2e02518f
Rename event_tick_sc to event_sc_printed, as it is more descriptive of what
Matti Hamalainen <ccr@tnsp.org>
parents:
1391
diff
changeset
|
2258 /test prlist_insert("event_sc_printed", "gheartbeat_sc") |
1214
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2259 /test prlist_insert("event_spell_done", "gheartbeat_do") |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2260 /test prlist_insert("event_skill_done", "gheartbeat_do") |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2261 /test prlist_insert("event_spell_round", "gheartbeat_do") |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2262 /eval /if (!heartbeat_timer) /repeat -%{heartbeat_res} i /gheartbeat_timer%;/endif |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2263 /set heartbeat_timer=1 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2264 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2265 |
287ae10f7137
v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents:
1213
diff
changeset
|
2266 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2267 ;; Consider reporting |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2269 /def -i -mregexp -t"^You take a close look at (.*) in comparison to yourself\.$" gconsider_rep0 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2270 /set cons_st=1%;/set cons_pr=%;/set cons_exp=%;/set cons_name=%{P1} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2271 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2272 /def -i -Econs_st -ag -mregexp -t"^You would get (.*) experience for " gconsider_rep1 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2273 /set cons_exp=%{P1} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2274 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2275 /def -i gdefconspr =\ |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2276 /def -i -Econs_st -ag -mregexp -t"^[A-Za-z<> ,.'-]+ %{2}$$" gconsider_pr%{1} =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2277 /set cons_pr=%{3} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2278 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2279 /test gdefconspr(1, "has a soft skin.", "soft", 0) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2280 /test gdefconspr(2, "seems to have a bit hardened skin.", "bit hardened", 0) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2281 /test gdefconspr(3, "has somewhat hardened skin.", "somewhat hardened", 0) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2282 /test gdefconspr(4, "skin could fold up a rapier!", "could fold up a rapier!", 0) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2283 /test gdefconspr(5, "skin seems to be virtually impenetrable!", "impenetrable!", 0) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2284 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2285 /def -i -ag -mregexp -t"^The final estimation is that (.*)$" gconsider_final =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2286 /if (cons_st) \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2287 /let cons_val=%{P1}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2288 /if (regmatch("doesn't look", cons_val)) /set cons_opp=dlvd%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2289 /elseif (regmatch("fair opponent", cons_val)) /set cons_opp=fair%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2290 /elseif (regmatch("nearly equal", cons_val)) /set cons_opp=equal%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2291 /elseif (regmatch("quite skilled", cons_val)) /set cons_opp=skilled%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2292 /elseif (regmatch("much stronger", cons_val)) /set cons_opp=much stronger%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2293 /elseif (regmatch("has such bulging", cons_val)) /set cons_opp=DANGEROUS%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2294 /else /set cons_opp=%{cons_val}%;/endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2295 /if (cons_exp!~"") /let _ctmps=%{cons_exp} exp%;/else /let _ctmps=%;/endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2296 /if (cons_opp!~"")\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2297 /if (_ctmps!~"")\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2298 /let _ctmps=%{_ctmps}, %{cons_opp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2299 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2300 /let _ctmps=%{cons_opp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2301 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2302 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2303 /if (cons_pr!~"") /let _ctmps=%{_ctmps} (PR: %{cons_pr})%;/endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2304 /msr [$[substr(cons_name,0,15)]]: %{_ctmps}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2305 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2306 /set cons_st=0 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2307 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2308 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2310 ;; Combat damage analysis |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2312 /def -i gcda_report =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2313 /if (opt_rcda=~"on")\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2314 /msr [%{1}]: %{2}%% resist against %{3}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2315 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2316 /msq [@{Cgreen}%{1}@{n}]: @{BCcyan}%{2}@{n}%% resist against @{BCyellow}%{3}@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2317 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2318 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2319 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) is defenseless against ([a-zA-Z]+) damage\.$" gcda_resist0 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2320 /test gcda_report({P1},0,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2321 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2322 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems to be almost defenseless against ([a-zA-Z]+) damage\.$" gcda_resist20 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2323 /test gcda_report({P1},20,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2324 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2325 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) has some resistance against ([a-zA-Z]+) damage\.$" gcda_resist40 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2326 /test gcda_report({P1},40,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2327 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2328 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems to be moderately resistant against ([a-zA-Z]+) damage\.$" gcda_resist60 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2329 /test gcda_report({P1},60,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2330 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2331 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) has good resistance against ([a-zA-Z]+) damage\.$" gcda_resist80 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2332 /test gcda_report({P1},80,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2333 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2334 /def -i -p9999 -ag -mregexp -t"^([A-Za-z ,.'-]+) seems almost immune against ([a-zA-Z]+) damage\.$" gcda_resist100 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2335 /test gcda_report({P1},100,{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2336 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2337 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2338 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2339 ;; Some special hilites and miscellaneous |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2340 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2341 /def -i msm = /if (opt_rmisc=~"on") /msr %*%;/endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2342 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2343 ;; Highlite open containers, doors etc. |
1274
aa3ce34f804d
Add coffers and scroll cabinets to chest open/closed lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1272
diff
changeset
|
2344 /glite -P2BCred -mregexp -t" (safe|chest|crate|vault|box|closet|money-box|coffer|scroll cabinet).* (\(open\))" glite_open |
aa3ce34f804d
Add coffers and scroll cabinets to chest open/closed lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1272
diff
changeset
|
2345 /glite -P2BCgreen -mregexp -t" (safe|chest|crate|vault|box|closet|money-box|coffer|scroll cabinet).* (\(closed\))" glite_closed |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2346 |
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2347 /gdef -i -F -p9999 -aBCred -mregexp -t"^This monster looks somehow familiar" glite_rapeprot =\ |
1217
5b7fe0bd5a0b
Add lite/warning for monster rapeprots.
Matti Hamalainen <ccr@tnsp.org>
parents:
1215
diff
changeset
|
2348 /msr I have a rapeprot! |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2349 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2350 ;; Lite skills/spells you can train with current exp |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2351 /def -i -F -p9999 -mregexp -t"^\| ([A-Z][A-Za-z ]+) +\| +([0-9]+) \| +([0-9]+) \| +([0-9]+) \| +([0-9]+) \|$" glite_trainexp =\ |
1181
452bab871539
Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents:
1178
diff
changeset
|
2352 /if ({P5} <= status_exp)\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2353 /if ({P2} < {P3})\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2354 /let _tcs=Cgreen%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2355 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2356 /let _tcs=Cyellow%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2357 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2358 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2359 /let _tcs=n%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2360 /endif%;\ |
1391
bb9c5005805e
The width of 'train' and 'study' output's exp cost column has changed. The
Matti Hamalainen <ccr@tnsp.org>
parents:
1390
diff
changeset
|
2361 /substitute -p | @{%{_tcs}}%{P1}@{n} | @{%{_tcs}}$[pad({P2},3)]@{n} | @{%{_tcs}}$[pad({P3},3)]@{n} | @{%{_tcs}}$[pad({P4},3)]@{n} | @{%{_tcs}}$[pad({P5},11)]@{n} | |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2362 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2363 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2364 ;; Ambush |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2365 /set ambush_t=0 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2366 /gdef -i -F -p9999 -aCred -msimple -t"You cannot leave, you have been AMBUSHED." gmisc_ambush1 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2367 /if (time()-ambush_t > 5)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2368 /set ambush_t=$[time()]%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2369 /msm AMBUSHED!%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2370 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2371 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2372 ;; Gained percentage in skill |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2373 /gdef -i -F -p9999 -aCgreen -mregexp -t"^You feel like you just got slightly better in (.*)$" gmisc_improved =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2374 /mse improved in %{P1} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2375 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2376 ;; Floating disc |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2377 /gdef -i -F -p9999 -msimple -t"Your disc wavers dangerously." gmisc_fdweak =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2378 /msm Disc falling! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2379 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2380 /gdef -i -F -p9999 -msimple -t"You reload magical energy to the disc that is floating in the air." gmisc_fdreload =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2381 /msm Disc reloaded. |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2382 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2383 ;; Party leadership |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2384 /gdef -i -F -p9999 -aCred -msimple -t"You are the new leader of the party." gmisc_pleader =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2385 @@party forcefollow all%;/msm Leading! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2386 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2387 ;; Poison removed |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2388 /gdef -i -F -p9999 -aCred -msimple -t"You feel the poison leaving your veins!" gmisc_poisonrm =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2389 /msm Poison removed! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2390 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2391 ;; Uncon |
1577 | 2392 /gdef -i -F -p9999 -ag -mregexp -t"^([A-Z][a-z]+) lapses into unconsciousness from severe loss of blood.$" gmisc_uncon =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2393 /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} is @{BCgreen}UNCON@{n} @{BCred}!!!@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2394 /msm %{P1} is UNCON! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2395 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2396 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2397 ;; Warn about changes in party formation |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2398 /gdef -i -F -p9999 -ag -mregexp -t"^([A-Z][a-z]+) is now in the 1st row.$" gmisc_firstrow =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2399 /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} @{BCyellow}is now in 1st row@{n} @{BCred}!!!@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2400 /if ({P1}=~set_plrname) /msm %{P1} is now in 1st row!%;/endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2401 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2402 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2403 ;; Multicolored Demons (event) |
1576
e089911ccd06
More MCdemons event messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2404 /gdef -i -F -p9999 -aCred -mregexp -t"^A Nasty Multicolored Demon arrives with (a |)puff of red smoke\.$|^You suddenly have a terrible sensation about your moneypurse\.|^An odd looking cloud appears in the sky\. It looks just like \$\$\$\.|^For a while you thought you saw a grinning face of a leprechaun in the sky over |^You hear a booming voice from the sky: \'Go get them my beautiful demons\!\'" gmisc_mcdemon =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2405 /msq @{BCwhite}*@{n} @{BCgreen}---@{n} @{BCred}MC DEMONS EVENT!@{n} @{BCgreen}---@{n} @{BCwhite}*@{n} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2406 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2407 ;; Robin Hood |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2408 ; Robin Hood took Ring of the Medusa labeled as (Ggr) <red glow> from Ggr. |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2409 /gdef -i -F -p9999 -aCred -mregexp -t"^Robin Hood arrives from " gmisc_robin1 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2410 /msq @{BCwhite}*@{n} @{BCgreen}---@{n} @{BCred}ROBIN HOOD EVENT!@{n} @{BCgreen}---@{n} @{BCwhite}*@{n} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2411 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2412 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2413 ;; Warn about invis tells and emotes |
1030 | 2414 /def -i -F -p9999 -mregexp -t"^You tell ([^']*)" gmisc_invtell =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2415 /if (opt_rmisc=~"on" & prot_invis > 0 & !regmatch("(monster)", {P1}))\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2416 /gwarning You are using 'tell' while INVISIBLE!%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2417 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2418 |
1030 | 2419 /def -i -F -p9999 -mregexp -t"^You emote to " gmisc_invemote =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2420 /if (opt_rmisc=~"on" & prot_invis > 0)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2421 /gwarning You are using 'emote' while INVISIBLE!%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2422 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2423 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2424 ;; Etc |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2425 /prdeffail -k -f -t"You fail to start the fire." |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2426 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2427 /def -i -ag -mregexp -t"^Your ([A-Za-z ]+) gets damaged; it's now in ([a-z]+) condition.$" gmisc_eqdamage =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2428 /msq @{BCred}!!!@{n} @{BCwhite}%{P1}@{n} @{BCyellow}got damaged!@{n} (@{BCgreen}%{P2}@{n}) @{BCred}!!!@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2429 /msm NOTICE! %{P1} got damaged! (%{P2}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2430 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2431 ;; Resist curses and drains |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2432 /gdef -i -F -p1 -aCred -mregexp -t"^You (are not affected by|successfully resist a|successfully resist the) ([a-z ]+)\.$" gmisc_curseres =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2433 /msm Resisted %{P2}! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2434 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2435 /gdef -i -F -p1 -aCred -msimple -t"You feel as if you caught something, but don't feel worse at all." gmisc_curseres_nr =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2436 /msm Resisted curse! (with NR) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2437 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2438 ;; Resist poison |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2439 /gdef -i -F -p1 -aCred -msimple -t"You SAVE against POISON." gmisc_poisonres =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2440 /msm Saved against poison! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2441 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2442 ;; Psi scanning warnings |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2443 /gdef -i -F -ag -msimple -t"You get the feeling that someone is looking over your shoulder." gmisc_mglance =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2444 /gwarning @{BCwhite}Mental Glance@{n} detected! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2445 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2446 ;; All-seeing eye |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2447 /gdef -i -F -ag -msimple -t"You have a feeling that somebody is watching you." gmisc_alleye =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2448 /gwarning @{BCwhite}All-seeing eye@{n} detected! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2449 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2450 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2451 ;; Breaking equipment |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2452 /gdef -i -F -ab -p1 -F -mregexp -t"^Your (.+) breaks into zillions of pieces\.$" gmisc_break_eq =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2453 /gwarning @{BCgreen}ALARM!@{n} @{BCred}HALB!@{n} @{BCyellow}ABUA!@{n} [ @{BCwhite}%{P1}@{n} ] @{BCred}broken!@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2454 /msm ALARM! HALB! ABUA! My %{P1} broke into pieces! |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2455 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2456 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2457 ;; Banishment |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2458 /gdef -i -F -aBCred -mregexp -t"^You feel that (.+) doesn\'t enjoy your presence\.$" gmisc_banish0 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2459 /set mbanish_st=1 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2460 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2461 /def -i -F -ag -msimple -Embanish_st -t"Suddenly your eyes close and when you open them you see:" gmisc_banish1 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2462 /msr Got banished!%;/set mbanish_st=0 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2463 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2464 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2465 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2466 ;; Helper for money purse |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2468 /def -i gpurse_add =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2469 /if (regmatch(strcat("([0-9]+) ",{1}),gpursec_match))\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2470 /set gpursec_total=$[gpursec_total + ({P1} * {2})]%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2471 /let mptmp=@{BCwhite}$[prprettyvalstr({P1})]@{n} @{%{3}}%{1}@{n}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2472 /if (gpursec_str!~"")\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2473 /set gpursec_str=%{gpursec_str}, %{mptmp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2474 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2475 /set gpursec_str=%{mptmp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2476 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2477 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2478 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2479 /def -i gpurse_report =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2480 /set gpursec_str=%;/set gpursec_total=0%;\ |
1660 | 2481 /test gpurse_add("mithril" , 500 , "BCgreen")%;\ |
2482 /test gpurse_add("batium" , 100 , "Cgreen")%;\ | |
2483 /test gpurse_add("anipium" , 50 , "BCyellow")%;\ | |
2484 /test gpurse_add("platinum" , 10 , "Cyellow")%;\ | |
2485 /test gpurse_add("gold" , 1 , "Cwhite")%;\ | |
2486 /test gpurse_add("silver" , 0.6 , "BCcyan")%;\ | |
2487 /test gpurse_add("bronze" , 0.4 , "Ccyan")%;\ | |
2488 /test gpurse_add("copper" , 0.2 , "BCmagenta")%;\ | |
2489 /test gpurse_add("tin" , 0.1 , "Cmagenta")%;\ | |
2490 /test gpurse_add("zinc" , 0.05 , "Cred")%;\ | |
2491 /test gpurse_add("mowgles" , 0.01 , "BCred")%;\ | |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2492 /msw It contains %{gpursec_str} (Total: @{BCwhite}$[prprettyvalstr(gpursec_total)]@{n} in @{BCyellow}gold@{n}) |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2493 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2494 /def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+) coins\.$" gpurse_rep1 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2495 /set gpursec_match=%{P1}%;/gpurse_report |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2496 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2497 /def -i -ag -mregexp -t"^It contains ([a-z0-9 ,]+)$" gpurse_rep2 =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2498 /set gpursec_st=1%;/set gpursec_match=%{P1} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2499 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2500 /def -i -ag -Egpursec_st -mregexp -t"^([a-z0-9 ,]*)coins\.$" gpurse_rep3 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2501 /set gpursec_st=0%;/set gpursec_match=%{gpursec_match} %{P1}%;/gpurse_report |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2502 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2503 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2504 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
861 | 2505 ;; Alignment value mangler |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2506 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1461
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2507 /set galign_regex= |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2508 /def -i galign_clean =\ |
1474
389445f8e352
Fix a silly bug in 'score' alignment mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1473
diff
changeset
|
2509 /return replace(" ","_",replace("'","_",replace("-","_",tolower({1})))) |
1461
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2510 |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2511 /def -i gdefalign =\ |
1461
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2512 /let _val=%{1}%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2513 /let _name=%{2}%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2514 /eval /set galign_$[galign_clean(_name)]=%{_val}%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2515 /if (galign_regex=~"")\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2516 /set galign_regex=%{_name}%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2517 /else \ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2518 /set galign_regex=%{galign_regex}|%{_name}%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2519 /endif |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2520 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2521 /test gdefalign(-7, "Draen-Dalar's love child") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2522 /test gdefalign(-6, "nefariously evil to the core") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2523 /test gdefalign(-5, "morally bankrupt") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2524 /test gdefalign(-4, "a malignant growth on the face of society") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2525 /test gdefalign(-3, "a malevolent fiend") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2526 /test gdefalign(-2, "a spiteful bastard") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2527 /test gdefalign(-1, "an unwholesome rogue") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2528 /test gdefalign( 0, "neutral") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2529 /test gdefalign( 1, "good and the gods smile on you") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2530 /test gdefalign( 2, "a beneficent being") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2531 /test gdefalign( 3, "irreproachably kind") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2532 /test gdefalign( 4, "pure at heart") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2533 /test gdefalign( 5, "a blessing to the world") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2534 /test gdefalign( 6, "Aveallis's gift to mankind") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2535 /test gdefalign( 7, "an angel in disguise") |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2536 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2537 |
1461
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2538 /eval /def -i -mregexp -t"^You are (%{galign_regex})\.$$" galign_mangle =\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2539 /let _name=$$[strcat("galign_",galign_clean({P1}))]%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2540 /let _val=$$[prgetval(_name)]%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2541 /if (_val < -4) /let _col=BCred%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2542 /elseif (_val < 0) /let _col=Cred%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2543 /elseif (_val > 4) /let _col=BCgreen%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2544 /elseif (_val > 0) /let _col=Cgreen%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2545 /else /let _col=Cwhite%%;/endif%%;\ |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2546 /substitute -p You are @{%%{_col}}%%{P1}@{n} -- @{BCyellow}[ %%{_val} ]@{n} in scale @{BCred}-7 (max evil)@{n} .. @{BCgreen}+7 (max good)@{n}. |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2547 |
74dc5e2cfb64
Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents:
1458
diff
changeset
|
2548 |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2549 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2550 ;; Camping / lullaby / etc. |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2551 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1505
9cfb7af9568e
Implement support for lounging in the camp status handling. Closes Mantis
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
2552 /gdef -i -F -p9999 -aCgreen -mregexp -t"^You (are in a mood for a bit of lounging again|stretch yourself and consider about camping|feel a bit tired|feel like camping a little)" gcamp_ready =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2553 /set camp_st=1%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2554 /gstatus_update%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2555 /msr Can camp again |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2556 |
1505
9cfb7af9568e
Implement support for lounging in the camp status handling. Closes Mantis
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
2557 /gdef -i -F -p9999 -aCgreen -mregexp -t"^You lie down and begin to rest for a while\.$|^You look around and find a suitable spot on the ground to do some lounging\!$|^You lie down for a short rest, soothed by the lullaby sung by " gcamp_start =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2558 /set camp_st=2%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2559 /gstatus_update%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2560 /set camp_hp=%{status_hp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2561 /set camp_sp=%{status_sp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2562 /set camp_ep=%{status_ep}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2563 /set camp_time=$[time()] |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2564 |
1505
9cfb7af9568e
Implement support for lounging in the camp status handling. Closes Mantis
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
2565 /gdef -i -F -p9999 -aCgreen -mregexp -t"^You awaken from your short rest, and feel slightly better\.$|^You are done with your lounging for now, you feel better\!$" gcamp_end =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2566 /if (camp_st == 2)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2567 /set camp_st=0%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2568 /gstatus_update%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2569 @@sc%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2570 /def -p1 -n1 -mregexp -t"^H:" gcamp_awake =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2571 /msr Awake - $$[status_hp - camp_hp]hp, $$[status_sp - camp_sp]sp, $$[status_ep - camp_ep]ep $[prgetstime(camp_time)]%%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2572 /gmsg_empty_que%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2573 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2574 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2575 /gdef -i -F -p9999 -aCgreen -msimple -t"You wake up!" gcamp_interrupt =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2576 /if (camp_st == 2)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2577 /set camp_st=0%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2578 /gstatus_update%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2579 /msr Camping interrupted!%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2580 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2581 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2582 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2583 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2584 ;; Path compression |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2585 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2586 /def -i prcomptoken =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2587 /if ({1} > 1)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2588 /let _qa=%{1} %{2}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2589 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2590 /let _qa=%{2}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2591 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2592 /if (qtzst=~"")\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2593 /set qtzst=%{_qa}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2594 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2595 /set qtzst=%{qtzst};%{_qa}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2596 /endif |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2597 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2598 /def -i prcomppath =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2599 /set qtzst=%;/let _qp=%;/let _qi=1%;/let _qc=1%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2600 /while ({#})\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2601 /if ({1}=~_qp & _qc < 15)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2602 /let _qc=$[_qc+1]%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2603 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2604 /prcomptoken %{_qc} %{_qp}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2605 /let _qc=1%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2606 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2607 /let _qp=%{1}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2608 /shift%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2609 /done%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2610 /prcomptoken %{_qc} %{_qp} |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2611 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2612 /def -i prreversepath =\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2613 /set qtzst=%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2614 /while ({#})\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2615 /if ({1}=~"n") /let _qp=s%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2616 /elseif ({1}=~"s") /let _qp=n%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2617 /elseif ({1}=~"w") /let _qp=e%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2618 /elseif ({1}=~"e") /let _qp=w%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2619 /elseif ({1}=~"nw") /let _qp=se%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2620 /elseif ({1}=~"ne") /let _qp=sw%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2621 /elseif ({1}=~"sw") /let _qp=ne%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2622 /elseif ({1}=~"se") /let _qp=nw%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2623 /elseif ({1}=~"u") /let _qp=d%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2624 /elseif ({1}=~"d") /let _qp=u%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2625 /elseif ({1}=~"N") /let _qp=S%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2626 /elseif ({1}=~"S") /let _qp=N%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2627 /elseif ({1}=~"W") /let _qp=E%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2628 /elseif ({1}=~"E") /let _qp=W%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2629 /elseif ({1}=~"NW") /let _qp=SE%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2630 /elseif ({1}=~"NE") /let _qp=SW%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2631 /elseif ({1}=~"SW") /let _qp=NE%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2632 /elseif ({1}=~"SE") /let _qp=NW%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2633 /elseif ({1}=~"U") /let _qp=D%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2634 /elseif ({1}=~"D") /let _qp=U%;/endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2635 /set qtzst=%{_qp} %{qtzst}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2636 /shift%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2637 /done |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2638 |
943
62b1971f9772
v0.6.11.4-svn; Prompt handling improvements (enable colour lites in prompt, function execution); Handle @{} codes in /opts panel better; Many documentation updates related to prompt, and other things.
Matti Hamalainen <ccr@tnsp.org>
parents:
934
diff
changeset
|
2639 /def -i comppath = /prcomppath %{path}%;/echo Compressed Path: %{qtzst} |
1422
5fd83e73cb6e
Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
1419
diff
changeset
|
2640 /def -i csavepath = /prcomppath %{path}%;/test send(strcat("@@", "command ", {1}, " ", qtzst)) |
1030 | 2641 /def -i reversepath = /prreversepath %{path}%;/set path=%{qtzst}%;/echo Reversed Path: %{qtzst} |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2642 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2643 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2644 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2645 ;; Slots mangler |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2646 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2647 ;; FIXME: What if torso is not the last slot listed? How to elegantly print |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2648 ;; the bottom of the table? |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2649 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2650 /def -i -F -p9999 -msimple -t"Your current armour status is:" gslots_mangle1 =\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2651 /substitute -ag%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2652 /set slots_st=1%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2653 /set slots_ftotal=0%;\ |
960 | 2654 /msw ,-------------------------.%;\ |
2655 /msw | Free | Slot |%;\ | |
2656 /msw +-------+-----------------+ | |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2657 |
1249
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2658 /def -i gslots_output =\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2659 /let _tslot=%{1}%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2660 /let _titem=%{3}%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2661 /if ({2}=~"no") /let _tnum=0%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2662 /elseif ({2}=~"one") /let _tnum=1%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2663 /elseif ({2}=~"two") /let _tnum=2%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2664 /elseif ({2}=~"three") /let _tnum=3%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2665 /elseif ({2}=~"four") /let _tnum=4%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2666 /elseif ({2}=~"five") /let _tnum=5%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2667 /elseif ({2}=~"six") /let _tnum=6%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2668 /elseif ({2}=~"seven") /let _tnum=7%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2669 /elseif ({2}=~"eight") /let _tnum=8%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2670 /elseif ({2}=~"nine") /let _tnum=9%;\ |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2671 /else /let _tnum=-1%;\ |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2672 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2673 /if (_tnum < 0)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2674 /let _tcol=Cyellow%;/let _tnum=%{P1}%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2675 /elseif (_tnum > 0)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2676 /set slots_ftotal=$[slots_ftotal+_tnum]%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2677 /if (_tnum > 1)\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2678 /let _tcol=BCgreen%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2679 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2680 /let _tcol=Cgreen%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2681 /endif%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2682 /else \ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2683 /let _tcol=BCred%;\ |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2684 /endif%;\ |
1249
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2685 /mss | @{%{_tcol}}$[pad(_tnum,5)]@{n} | $[pad(_tslot,-15)] | @{Cyellow}%{_titem}@{n} |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2686 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2687 /def -i -F -Eslots_st -p9999 -mregexp -t"^ You have (.*) free ([a-z]*) slots?\.?$" gslots_mangle2 =\ |
1249
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2688 /test gslots_output({P2},{P1},"") |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2689 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2690 /def -i -F -Eslots_st -p9999 -mregexp -t"^ You have (.*) free ([a-z]*) slots? \[(.*)\]$" gslots_mangle3 =\ |
1249
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2691 /test gslots_output({P2},{P1},{P3}) |
f148b93e2ba8
Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1245
diff
changeset
|
2692 |
1265
d1d7c9ecd971
Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents:
1261
diff
changeset
|
2693 /def -i -F -Eslots_st -p9999 -mregexp -t"^$" gslots_mangle4 =\ |
960 | 2694 /set slots_st=0%;\ |
2695 /msw +-------------------------+%;\ | |
2696 /msw | Total free: @{BCgreen}$[pad(slots_ftotal,-11)]@{n} |%;\ | |
2697 /msw `-------------------------' | |
2698 | |
858
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2699 |
5ba435e75dca
Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents:
856
diff
changeset
|
2700 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2701 ;; Support for certain toys with timers |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2702 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2703 ;; 25 min * 60s = 1500 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2704 /set toy_sleeves_wait=1500 |
1437
f1fce8801fd9
Change sleeves max diff to 350.
Matti Hamalainen <ccr@tnsp.org>
parents:
1436
diff
changeset
|
2705 /set toy_sleeves_diff=350 |
1412
060c1b5513ed
Add toy_sleeves_min variable setting for the minimal acceptable 'gain' of Alexia sleeves 'balance' operation. Current default value is now 100.
Matti Hamalainen <ccr@tnsp.org>
parents:
1411
diff
changeset
|
2706 /set toy_sleeves_min=100 |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2707 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2708 /def -i gtoy_sleeves_msg =\ |
1408
094e13a50b39
Set alex sleeves timer pid to null after it has ran out.
Matti Hamalainen <ccr@tnsp.org>
parents:
1404
diff
changeset
|
2709 /set toy_sleeves_pid=%;\ |
1438
267cee0ac805
Only inform about recharging of sleeves if they are known to be worn.
Matti Hamalainen <ccr@tnsp.org>
parents:
1437
diff
changeset
|
2710 /if (toy_sleeves_on==1)\ |
267cee0ac805
Only inform about recharging of sleeves if they are known to be worn.
Matti Hamalainen <ccr@tnsp.org>
parents:
1437
diff
changeset
|
2711 /msq @{BCgreen}Alexandra sleeves recharged@{n}, @{BCwhite}Use /balance for 'safe' balancing.@{n}%;\ |
267cee0ac805
Only inform about recharging of sleeves if they are known to be worn.
Matti Hamalainen <ccr@tnsp.org>
parents:
1437
diff
changeset
|
2712 /endif |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2713 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2714 /def -i gtoy_sleeves_timer =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2715 /set toy_sleeves_t=$[time()]%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2716 /if (toy_sleeves_pid!~"") /kill %{toy_sleeves_pid}%;/endif%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2717 /set toy_sleeves_pid=$(/grepeat -%{toy_sleeves_wait} 1 /gtoy_sleeves_msg) |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2718 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2719 /def -i -F -p9999 -mregexp -t"^You wear .*?a pair of pure white flowing sleeves" gtoy_sleeves_wear =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2720 /set toy_sleeves_on=1%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2721 /gtoy_sleeves_timer |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2722 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2723 /def -i -F -p9999 -mregexp -t"^You remove .*?a pair of pure white flowing sleeves" gtoy_sleeves_rm =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2724 /set toy_sleeves_on=0 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2725 |
1418
d445b130f921
'You feel balanced.' trigger does not need to be fallthrough.
Matti Hamalainen <ccr@tnsp.org>
parents:
1417
diff
changeset
|
2726 /def -i -p9999 -msimple -t"You feel balanced." gtoy_sleeves_bal =\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2727 /set toy_sleeves_on=1%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2728 /set toy_sleeves_bal=1%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2729 /gtoy_sleeves_timer |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2730 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2731 /def -i gbalance_timeleft =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2732 /let _left=$[time() - toy_sleeves_t]%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2733 /if (toy_sleeves_bal==1)\ |
1415
2839ed1a53ce
Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1414
diff
changeset
|
2734 /msq Last balance: @{BCwhite}$[prgettime(_left)]@{n} ago.%;\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2735 /endif%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2736 /if (_left < toy_sleeves_wait)\ |
1415
2839ed1a53ce
Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1414
diff
changeset
|
2737 /msq Time left until balance available: @{BCwhite}$[prgettime(toy_sleeves_wait - _left)]@{n}.%;\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2738 /return 0%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2739 /else \ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2740 /return -1%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2741 /endif |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2742 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2743 /def -i -F -p9999 -msimple -t"The sleeves seem unable to grant balance at the time." gtoy_sleeves_no =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2744 /if (toy_sleeves_on==1)\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2745 /if (gbalance_timeleft() < 0)\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2746 /msq Sleeves SHOULD be charged, internal inconsistency!%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2747 /endif%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2748 /else \ |
1415
2839ed1a53ce
Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents:
1414
diff
changeset
|
2749 /msq @{BCred}Sleeve wear time not known.@{n}%;\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2750 /endif |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2751 |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2752 /def -i gbalance_do =\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2753 /if (gbalance_timeleft()==0)\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2754 /return%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2755 /endif%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2756 /let _diff=$[status_hp - status_sp]%;\ |
1412
060c1b5513ed
Add toy_sleeves_min variable setting for the minimal acceptable 'gain' of Alexia sleeves 'balance' operation. Current default value is now 100.
Matti Hamalainen <ccr@tnsp.org>
parents:
1411
diff
changeset
|
2757 /if (_diff < toy_sleeves_diff & _diff > toy_sleeves_min)\ |
1463
66e4a4364801
Clarify some informational messages of Alexandra sleeve handling functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1462
diff
changeset
|
2758 /msq @{BCgreen}HP - SP diff (%{_diff}) < %{toy_sleeves_diff} limit, balancing ...@{n}%;\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2759 /send @@balance%;\ |
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2760 /else \ |
1463
66e4a4364801
Clarify some informational messages of Alexandra sleeve handling functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1462
diff
changeset
|
2761 /msq @{BCred}HP - SP diff (%{_diff}) > %{toy_sleeves_diff} limit, NOT BALANCING!@{n} (Use @{BCwhite}@@@@balance@{n} to force this action.)%;\ |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2762 /endif |
1413
0c36f09b074f
Document /balance macro command.
Matti Hamalainen <ccr@tnsp.org>
parents:
1412
diff
changeset
|
2763 |
0c36f09b074f
Document /balance macro command.
Matti Hamalainen <ccr@tnsp.org>
parents:
1412
diff
changeset
|
2764 ;;@command /balance |
1432 | 2765 ;;@desc Perform Alexandra sleeves 'balance', but only if the current HP - SP difference is favorable. |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2766 /def -i balance =\ |
1403
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2767 /if (toy_sleeves_on==1)\ |
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2768 /send @@sc%;\ |
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2769 /repeat -0.2 1 /gbalance_do%;\ |
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2770 /else \ |
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2771 /msq Sleeves possibly not worn. If you are certain that they are, use @{BCwhite}@@@@balance@{n} to force action.%;\ |
5a95bb1e68bc
Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents:
1402
diff
changeset
|
2772 /endif |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2773 |
1414
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2774 ;;@command /chkbalance |
1432 | 2775 ;;@desc Check and report the status of Alexandra sleeve 'balance' without actually performing 'balance'. |
1414
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2776 /def -i chkbalance =\ |
1436
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2777 /if (toy_sleeves_on==1)\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2778 /if (gbalance_timeleft()==0)\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2779 /return%;\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2780 /endif%;\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2781 /let _diff=$[status_hp - status_sp]%;\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2782 /if (_diff < toy_sleeves_diff & _diff > toy_sleeves_min)\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2783 /msq @{BCgreen}HP - SP diff = %{_diff}, OK TO BALANCE ...@{n}%;\ |
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2784 /else \ |
1463
66e4a4364801
Clarify some informational messages of Alexandra sleeve handling functionality.
Matti Hamalainen <ccr@tnsp.org>
parents:
1462
diff
changeset
|
2785 /msq @{BCred}HP - SP diff (%{_diff}) > %{toy_sleeves_diff} limit, balance not favorable!@{n}%;\ |
1436
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2786 /endif%;\ |
1414
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2787 /else \ |
1436
1a8b35960f22
Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1434
diff
changeset
|
2788 /msq Sleeves possibly not worn. If you are certain that they are, use @{BCwhite}@@@@balance@{n} to force action.%;\ |
1414
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2789 /endif |
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2790 |
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2791 |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2792 /prdefgbind -s"balance" -c"/balance" |
1414
5cded81d0078
Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1413
diff
changeset
|
2793 /prdefgbind -s"cbalance" -c"/chkbalance" |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2794 |
1669
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2795 |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2796 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2797 ;; TF5 extended statusline handling |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2798 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2799 /def -i gstatus_init =\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2800 /prdefvar -n"status_height" -v"2" -c"The number of rows in the status area in TF visual mode (GgrTF::TF5 uses 2)"%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2801 /prdefvar -n"status_start" -v"0" -c"Start row used by GgrTF in TF visual mode (GgrTF::TF5 uses 0 by default)"%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2802 /if (status_height < 2) /set status_height=2%;/endif%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2803 /status_add -s0 -r$[status_start+1] -c "["%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2804 /status_add -s0 -r$[status_start+1] status_protstr2::Cgreen%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2805 /status_add -s0 -r$[status_start+1] "]" |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2806 |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2807 /def -i gstatus_update =\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2808 /gstatus_update_do%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2809 /eval /status_add -c -s0 -r%{status_start} %{status_pstr} |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2810 |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2811 |
1402
fdded0f87476
Added preliminary support for 'balance' functionality of Alexandra sleeves (a pair of pure white flowing sleeves).
Matti Hamalainen <ccr@tnsp.org>
parents:
1401
diff
changeset
|
2812 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
336
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
2813 ;; Global script initialization |
f56c6dd17964
v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents:
335
diff
changeset
|
2814 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
921
5b810625fb3d
Change how initialization is ran.
Matti Hamalainen <ccr@tnsp.org>
parents:
920
diff
changeset
|
2815 /eval /if (set_wasinit != 1)\ |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
2816 /greset%;\ |
550 | 2817 /ginitialize%;\ |
921
5b810625fb3d
Change how initialization is ran.
Matti Hamalainen <ccr@tnsp.org>
parents:
920
diff
changeset
|
2818 /set set_wasinit=1%;\ |
1669
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2819 /gstatus_init%;\ |
97df3a9b3d45
Integrate the TF5 module into main and remove the module.
Matti Hamalainen <ccr@tnsp.org>
parents:
1668
diff
changeset
|
2820 /gstatus_update%;\ |
337
11cdfed3ee99
v0.5.10.5: Added new setting /roundmin to set number of rounds
Matti Hamalainen <ccr@tnsp.org>
parents:
336
diff
changeset
|
2821 /endif |