annotate ggrtf.tf @ 1656:4dd02b568cbe

Bump version.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Sep 2021 02:25:08 +0300
parents 356c3c26aee6
children 31b17baa23b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
1655
356c3c26aee6 Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 1654
diff changeset
3 ;; (C) Copyright 2004-2021 Matti Hamalainen (Ggr Pupunen)
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 ;;
1656
4dd02b568cbe Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 1655
diff changeset
5 /set ggrtf_ver=0.7.4.3
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 ;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 ;;
1136
edc1b69772e0 Update URL and bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 1134
diff changeset
28 ;; http://tnsp.org/~ccr/ggrtf/
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
29 ;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 ;; The actual scriptcode starts here: initialize, load prereqs
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
54 /prdefivar cnt_qlips1 0%;\
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
55 /prdefivar cnt_qlips2 0%;\
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
101
576
586e5cc2cb67 Typofix in prdeffail()
Matti Hamalainen <ccr@tnsp.org>
parents: 570
diff changeset
102 /set cnt_def_fail=0
1227
e5a7b455e681 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1217
diff changeset
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
e5a7b455e681 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1217
diff changeset
119
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
120 /set lst_stats_spell=
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
121 /set lst_stats_skill=
1227
e5a7b455e681 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1217
diff changeset
122 /set lst_resetfuncs=
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
127
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
136 ;; Macros which may be re-defined by user or in other modules
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
156
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
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
6e037feda084 TF4 compat fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 666
diff changeset
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
6e037feda084 TF4 compat fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 666
diff changeset
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
6e037feda084 TF4 compat fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 666
diff changeset
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%;\
1528
67adc80ce1a0 Fix version check.
Matti Hamalainen <ccr@tnsp.org>
parents: 1527
diff changeset
206 /if (gtf_version < 50007)\
67adc80ce1a0 Fix version check.
Matti Hamalainen <ccr@tnsp.org>
parents: 1527
diff changeset
207 /gerror @{BCwhite}GgrTF requires TinyFugue version 5.0 beta 7 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
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
255 ;; Helper macros/functions
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
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
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
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
705805fb8a41 Code cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 544
diff changeset
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
705805fb8a41 Code cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 544
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
317 ;; Return given string post-padded to specified length with specified character
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
318 ;; prpadwith(string,length,char)
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
319 /def -i prpadwith =\
910
39022e835108 Sanitize prpadwith().
Matti Hamalainen <ccr@tnsp.org>
parents: 908
diff changeset
320 /return strcat({1}, strrep({3}, {2} - strlen({1})))
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
321
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
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
705805fb8a41 Code cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 544
diff changeset
332 ;; Return string describing time elapsed from given timestamp parameter
44
Matti Hamalainen <ccr@tnsp.org>
parents: 43
diff changeset
333 /def -i prgetstime =\
547
705805fb8a41 Code cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 544
diff changeset
334 /let _tmps=$[prgettime(time()-{1})]%;\
705805fb8a41 Code cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 544
diff changeset
335 /if (_tmps!~"") /return "[%{_tmps}]"%;/else /return ""%;/endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
349 ;; Execute macros given as parameters
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
350 /def -i prexecfuncs =\
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
351 /while ({#})\
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
352 /eval /%{1}%;\
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
353 /shift%;\
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
354 /done
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
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
f807316cf9a5 Generic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 296
diff changeset
357 ;; Create prettyprint version of a numeric value
f807316cf9a5 Generic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 296
diff changeset
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
f807316cf9a5 Generic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 296
diff changeset
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
f807316cf9a5 Generic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 296
diff changeset
373
283
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
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
ede339f380c9 Bugfix.
Matti Hamalainen <ccr@tnsp.org>
parents: 1294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
416 ;; Option, setting and hook definition macros
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
417 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
418 ;; Define an togglable option
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
419 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
430 /set opt_%{opt_n}_d=%{opt_d}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
431 /eval /def -i %{opt_n} =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
432 /if (opt_%{opt_n}=~"on")\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
435 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
443
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
444
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
445 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
446 ;; Define a value setting
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
447 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
453 /set set_%{opt_n}_d=%{opt_d}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
454 /eval /def -i %{opt_n} =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
455 /if ({#}) \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
456 /if ({1}=~"*") \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
457 /set set_%{opt_n}=%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
458 /msq @{Cyellow}%{opt_d}@{n} : @{BCgreen}Cleared@{n}%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
459 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
462 /endif%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
465 /msq Use "@{BCyellow}/%{opt_n} *@{n}" to clear.%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
466 /endif
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
467
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
468
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
469 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
470 ;; Define a setting with legal values
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
471 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
476 /shift%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
479 /shift%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
480 /done
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
481
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
487 /set set_%{opt_n}_d=%{opt_d}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
488 /set set_%{opt_n}_s=%{opt_s}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
489 /eval /def -i %{opt_n} =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
493 /set set_%{opt_n}=%%%{1}%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
494 /msq @{Cyellow}%{opt_n}@{n} : Set to [@{BCgreen}%%%{set_%{opt_n}}@{n}]%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
495 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
496 /msq @{Cyellow}%{opt_n}@{n} : @{BCred}Invalid setting@{n} [@{BCgreen}%%%{1}@{n}]!%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
497 /endif%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
498 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
499 /msq @{BCred}/%{opt_n}@{n} - @{Cyellow}%{opt_d}@{n} [@{BCgreen}%%%{set_%{opt_n}_s}@{n}]%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
500 /endif
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
501
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
502
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
503 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
504 ;; Define a function hook setting
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
505 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
511 /set set_%{opt_n}_d=%{opt_d}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
512 /set set_%{opt_n}_s=%{opt_s}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
513 /eval /def -i %{opt_n} =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
517 /set set_%{opt_n}=%%%{1}%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
518 /msq @{Cyellow}%{opt_n}@{n} : Set to [@{BCgreen}%%%{set_%{opt_n}}@{n}]%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
519 /eval /def -i %{opt_h}=/%{opt_h}_%%%{1} %%%%%*%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
520 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
521 /msq @{Cyellow}%{opt_n}@{n} : @{BCred}Invalid setting@{n} [@{BCgreen}%%%{1}@{n}]!%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
522 /endif%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
523 /else \
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
524 /msq @{BCred}/%{opt_n}@{n} - @{Cyellow}%{opt_d}@{n} [@{BCgreen}%%%{set_%{opt_n}_s}@{n}]%%%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
525 /endif
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
526
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
527
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
528 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
529 ;; Variable saving functionality
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
530 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
230f5de3b493 Bugfix.
Matti Hamalainen <ccr@tnsp.org>
parents: 346
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
559 ;; Save given list of variables (set 'gsave_varpref' to prefix)
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
560 /def -i gsave_vars =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
574 /shift%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
575 /done
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
576
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
577 ;; Save given list of hooks
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
578 /def -i gsave_hooks =\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
582 /shift%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
583 /done
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
597
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
644 /set gsave_varpref=opt_%;/gsave_vars %{lst_options}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
648
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
649
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
657 /msq @{BCgreen}Done.@{n}%;\
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
658
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
659
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
660 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
661 ;; Hooks and bindings
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
68d1e8417857 Minor bugfix.
Matti Hamalainen <ccr@tnsp.org>
parents: 602
diff changeset
681 /eval /def -i -h"SEND {%{bind_prefix}%{opt_s}}*" bind_%{opt_s} = %{opt_c}%{_qs}
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
682
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
776
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
777 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
95
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
778 ;; Report current statistics
127
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
781 /if ({1}!~"")\
551
39346de4912c Changed /opts panel width
Matti Hamalainen <ccr@tnsp.org>
parents: 550
diff changeset
782 /msw | $[prpadwith({1},18,".")]: $[pad({2},-47)] |%;\
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
783 /else \
551
39346de4912c Changed /opts panel width
Matti Hamalainen <ccr@tnsp.org>
parents: 550
diff changeset
784 /msw | $[pad("",-18)]: $[pad({2},-47)] |%;\
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
785 /endif
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
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
39346de4912c Changed /opts panel width
Matti Hamalainen <ccr@tnsp.org>
parents: 550
diff changeset
788 /msw |$[prpadwith("",69,"-")]|
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
789
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
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
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
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
39346de4912c Changed /opts panel width
Matti Hamalainen <ccr@tnsp.org>
parents: 550
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
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
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
810 /prexecfuncs %{lst_stats_skill}%;\
551
39346de4912c Changed /opts panel width
Matti Hamalainen <ccr@tnsp.org>
parents: 550
diff changeset
811 /msw `---------------------------------------------------------------------'
95
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
812
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
813
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
814 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
283
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
815 ;; List available options / settings
127
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
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
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
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
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
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
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
827 /shift%;\
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
828 /done
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
829
290
89458d89ed04 Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents: 289
diff changeset
830 /def -i gsettings_dolist =\
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
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
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
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
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
863 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
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
fb39f3a271d5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 860
diff changeset
905 /prdeftoggle -n"rmisc" -d"Miscellaneous reporting"
fb39f3a271d5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 860
diff changeset
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
fb39f3a271d5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 860
diff changeset
911 /prdeftoggle -n"rcda" -d"Combat Damage Analysis reporting"
fb39f3a271d5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 860
diff changeset
912 /set opt_rcda=on
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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.
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
916 ;@desc Default value is 'grep'. The value is automatically prefixed with '@@'.
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
917 /prdefvalue -n"grepcmd" -d"BatMUD 'grep' command ('@@' prefix is added)"
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
922
19
284750e78f5e New module added for Lords of Chaos: ggrtf-loc.tf
Matti Hamalainen <ccr@tnsp.org>
parents: 18
diff changeset
923 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
95
82a7db2a498f Reordering/cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 94
diff changeset
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
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
954
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
989 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
990 ;; Movement
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
993 /def -i -mglob -h'send {n|s|e|w|ne|sw|nw|se|u|d}' prmove_send =\
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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
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
1010 /def -i prmove_walk = /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
1011 @@$[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
1012
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
1013 ;; 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
1014 /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
1015 /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
1016 @@$[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
1017 /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
1018 /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
1019 /else /break%;/endif%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
1020 @@%{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
1021 @@%{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
1022
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
1023 ;; 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
1024 ;@command /move <type>
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1025 ;@desc Change the meaning of <link linkend="usage-general-prmove">keyboard movement hooks</link>.
797
5254a84d036e Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 796
diff changeset
1026 /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
1027 /move walk
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
1028
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1029 ;@command /peer [regexp string]
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1030 ;@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
1031 /prdefvalue -n"peer" -d"Regular expression used with autopeering"
283
496c2c457cb1 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 264
diff changeset
1032
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
1033
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
1034 ;; Ship movement
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1035 ;@command /cruise
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1036 ;@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
1037 /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
1038 /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
1039 /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
1040 /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
1041 /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
1042 /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
1043
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
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 ;; Ship viewing setting
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1046 ;@command /shipmove <off|view|map>
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1047 ;@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
1048 /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
1049 /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
1050
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 /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
1052 /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
1053 /elseif (set_shipmove=~"map") @@map%;/endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1054
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1055
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1056 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
1057 ;; Status bar
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1058 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42
8bf52a7380ef New /defhook macro added for making direct hook-settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 41
diff changeset
1059 ; 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
1060 ; some things (like channeller energy aura), etc. are hardcoded here,
1175
0f6d65a158d2 Remove irrelevant note.
Matti Hamalainen <ccr@tnsp.org>
parents: 1174
diff changeset
1061 ; 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
1062
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1063 ;; Add value item (hp/sp/ep/etc) to status string
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1064 /def -i gstatus_add_val =\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1065 /set status_w=$[status_w+13]%;\
922
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1066 /let _val1=status_%{1}%;\
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1067 /let _val2=status_%{1}max%;\
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1068 /let _val1v=$[prgetval(_qtval1)]%;\
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1069 /let _val2v=$[prgetval(_qtval2)]%;\
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1070 /let _vcol=$[prgetnlite(_val1v,_val2v)]%;\
8cf55d010545 More /eval /set -crap cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 921
diff changeset
1071 /set status_pstr=%{status_pstr} "[" "%{2}:":2:BCwhite %{_val1}:-4:%{_vcol} "/" %{_val2}:-4:BCgreen "]"
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1072
1176
595568345130 Add function gstatus_add_var for adding arbitrary variables with labels to statusline.
Matti Hamalainen <ccr@tnsp.org>
parents: 1175
diff changeset
1073 /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
1074 /let _vlabel=%{1}%;\
1188
0dbe46e04a09 Modify gstatus_add_var again to better fit upcoming changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1187
diff changeset
1075 /let _vstr=$[prgetval({2})]%;\
0dbe46e04a09 Modify gstatus_add_var again to better fit upcoming changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1187
diff changeset
1076 /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
1077 /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
1078 /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
1079
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1080 ;; Add aura item
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1081 /def -i gstatus_add_aura =\
1167
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1082 /if (prot_eaura > 0)\
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1083 /if (prot_eaura == 1) /let _ucol=BCyellow%;/endif%;\
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1084 /if (prot_eaura == 2) /let _ucol=BCred%;/endif%;\
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1085 /if (prot_eaura == 3) /let _ucol=BCblue%;/endif%;\
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1086 /if (prot_eaura_weak=~"on")\
1170
955f54364231 Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1167
diff changeset
1087 /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
1088 /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
1089 /set status_pstr=%{status_pstr} "[" "EAura%{prot_eaura}":5:%{_ucol} "/" "WEAK":4:BCwhite ":" "%{_utime}"::BCwhite "]"%;\
1167
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1090 /else \
1170
955f54364231 Compactize the energy aura status indicator a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1167
diff changeset
1091 /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
1092 /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
1093 /set status_pstr=%{status_pstr} "[" "EAura%{prot_eaura}":5:%{_ucol} ":" "%{_utime}" "]"%;\
1167
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1094 /endif%;\
9cdeea4f9f49 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1162
diff changeset
1095 /endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1096
1494
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1097 ;; Add spider demon
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1098 /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
1099 /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
1100 /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
1101 /let _utime=$[prgettime(_qtime)]%;\
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1102 /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
1103 /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
1104 /endif
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1105
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1106 ;; Get value
580
60b9778649d3 gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents: 576
diff changeset
1107 /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
1108 /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
1109
580
60b9778649d3 gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents: 576
diff changeset
1110 /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
1111 /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
1112 /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
1113 /else /return "BCyellow"%;/endif
aa6179ac23b8 v0.6.0-pre1: Cleanups in statusline updating code;
Matti Hamalainen <ccr@tnsp.org>
parents: 396
diff changeset
1114
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
1115 ;; 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
1116 /def -i gstatus_update_do =\
171
0768ec2d22ce And again ... :(
Matti Hamalainen <ccr@tnsp.org>
parents: 170
diff changeset
1117 /set status_w=12%;\
11
a1ccb3446113 Improved indentation and fixed some trigger priorities.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
1118 /set status_pstr=%;\
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1119 /gstatus_add_val hp H%;\
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1120 /gstatus_add_val sp S%;\
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1121 /gstatus_add_val ep E%;\
580
60b9778649d3 gstatus_get* -> gstatus_get_*
Matti Hamalainen <ccr@tnsp.org>
parents: 576
diff changeset
1122 /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
1123 /test gstatus_add_var("T", "heartbeat_cnt", 2)%;\
1498
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
1124 /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
1125 /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
1126 /gstatus_add_aura%;\
bd219dde5c1c Implement spider demon next upcoming drain indicator on status line.
Matti Hamalainen <ccr@tnsp.org>
parents: 1491
diff changeset
1127 /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
1128
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
1129 ;; 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
1130 /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
1131 /gstatus_update_do%;\
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1132 /let _qw=$[columns() - status_w]%;\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1133 /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
1134 /set status_fields=%{status_pstr}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1135
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1136
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
1137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
227
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1138 ;; Status short score/prompt grabbing triggers
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1139 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
121
8c009af416fe Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 119
diff changeset
1140 /def -i prgetdiff =\
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1141 /let _ts=%;/let _tv=$[{1} - {2}]%;\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1142 /if (_tv < 0) /let _ts=@{Cred}%{_tv}@{n}%;\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1143 /elseif (_tv > 0) /let _ts=@{Cgreen}+%{_tv}@{n}%;/endif%;\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1144 /return "[%{_ts}]"
121
8c009af416fe Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 119
diff changeset
1145
227
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1146 /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
1147 /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
1148 /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
1149 /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
1150 /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
1151 /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
1152 /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
1153 /if (opt_gagsc=~"on") /substitute -ag%;/endif
227
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1154
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1155
d40d9607d59a Short score handling improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
1156 ;; 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
1157 ;; !!!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
1158 ;; 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
1159 ;; 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
1160 ;; .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
1161 ;; 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
1162
1181
452bab871539 Remove HCBat-related stuff, cleanups, save old hp/sp/ep status variables.
Matti Hamalainen <ccr@tnsp.org>
parents: 1178
diff changeset
1163 /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
1164 /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
1165
121
8c009af416fe Improved and unified 'sc' trigger and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 119
diff changeset
1166
11
a1ccb3446113 Improved indentation and fixed some trigger priorities.
Matti Hamalainen <ccr@tnsp.org>
parents: 10
diff changeset
1167 ;; Grab PROMPT
1123
b50b22f460bd v0.6.12.9-svn; Misc fiddlings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1113
diff changeset
1168 /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
1169 /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
1170 /if (cast_info!~"" & cast_info_n!~"") \
148
1f8ef34c48f7 The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 146
diff changeset
1171 /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
1172 /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
1173 /else \
945
679f292a3724 Oops, prompt_cast variable should've been status_cast. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 943
diff changeset
1174 /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
1175 /endif%;\
90
76369732f469 Indentations
Matti Hamalainen <ccr@tnsp.org>
parents: 89
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=%;\
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
1178 /endif%;\
1067
41252c4afe91 Possibly fix compatibility with TF5.0 beta 7 in the prompt handling. This should be tested, however ...
Matti Hamalainen <ccr@tnsp.org>
parents: 1037
diff changeset
1179 /if (gtf_version < 50008)\
41252c4afe91 Possibly fix compatibility with TF5.0 beta 7 in the prompt handling. This should be tested, however ...
Matti Hamalainen <ccr@tnsp.org>
parents: 1037
diff changeset
1180 /eval /prompt $[strip_attr(set_gprompt)]%;\
41252c4afe91 Possibly fix compatibility with TF5.0 beta 7 in the prompt handling. This should be tested, however ...
Matti Hamalainen <ccr@tnsp.org>
parents: 1037
diff changeset
1181 /else \
41252c4afe91 Possibly fix compatibility with TF5.0 beta 7 in the prompt handling. This should be tested, however ...
Matti Hamalainen <ccr@tnsp.org>
parents: 1037
diff changeset
1182 /eval /prompt -p %{set_gprompt}%;\
1183
2b79266fa559 Call statusline updating also in prompt handler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1182
diff changeset
1183 /endif%;\
2b79266fa559 Call statusline updating also in prompt handler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1182
diff changeset
1184 /gstatus_update
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1185
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1186
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1187 ;@command /gprompt [prompt string]
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1188 ;@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
1189 ;@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
1190 ;@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
1191 /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
1192
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1193
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1194 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
71
211e7ca6969c Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
1195 ;; Version reporting
211e7ca6969c Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
1196 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1655
356c3c26aee6 Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 1654
diff changeset
1197 /set ggrtf_copy=(C) Copyright 2004-2021 Matti Hamalainen (Ggr Pupunen) and others
71
211e7ca6969c Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
1198
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1199 ;@command /gver
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1200 ;@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
1201 /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
1202
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1203 ;@command /gversion
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1204 ;@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
1205 ;@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
1206 /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
1207 /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
1208
636
9860ca854ca3 pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 633
diff changeset
1209 /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
1210 /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
1211
9860ca854ca3 pre3: Added option for disabling version reporting; Widened /opts panel a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 633
diff changeset
1212 /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
1213 /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
1214 /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
1215 /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
1216 @@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
1217 /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
1218
127
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
1219
71
211e7ca6969c Added version reporting/queries.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
1220 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
570
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1221 ;; 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
1222 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1223 ; -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
1224 ; -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
1225 ; -c Type: Spell
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1226 ; -k Type: Skill
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1227 ; -f Fail
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1228 ; -F Fumble
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1229
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1230 /def -i prdeffail =\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1231 /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
1232 /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
1233 /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
1234 /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
1235 /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
1236 /if (opt_f)\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1237 /let _tmpt=fail%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1238 /let _tmpa=Cred%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1239 /elseif (opt_F)\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1240 /let _tmpt=fumble%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1241 /let _tmpa=BCred%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1242 /else \
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1243 /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
1244 /break%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1245 /endif%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1246 /if (opt_c)\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1247 /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
1248 /elseif (opt_k)\
576
586e5cc2cb67 Typofix in prdeffail()
Matti Hamalainen <ccr@tnsp.org>
parents: 570
diff changeset
1249 /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
1250 /else \
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1251 /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
1252 /break%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1253 /endif%;\
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1254 /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
1255
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1256
213c97ca9382 New skill/spell fail/fumble definition macro; Updated copyright; Language fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 569
diff changeset
1257 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1258 ;; Prot triggers and reporting
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1259 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1260 ;; List of prots and conjurer prots (cprots list needed for handling/clearing minor prot prereqs)
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1261 /set lst_prots=
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1262 /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
1263 /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
1264 /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
1265
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1266
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1267 ;; 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
1268 /def -i prclearpreqs =\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1269 /while ({#})\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1270 /set prot_%{1}_p=0%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1271 /shift%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1272 /done
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1273
154
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1274 /def -i prclearprots =\
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1275 /while ({#})\
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1276 /set prot_%{1}=0%;\
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1277 /set prot_%{1}_p=0%;\
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1278 /shift%;\
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1279 /done
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
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1282 ;; Reset prots
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1283 ;@command /cprots
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1284 ;@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
1285 ;@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
1286 ;@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
1287 /def -i cprots =\
693
f1c49ef6ee68 Some code cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 690
diff changeset
1288 /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
1289 /prclearprots %{lst_prots}%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1290 /gprots_update%;/gstatus_update
154
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1291
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1292
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1293 ;; Define a conjuprot trigger (function)
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1294 /def -i prdefconju =\
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1265
diff changeset
1295 /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
1296 /if (prot_%{1}_p==1) /gprot_on %{1}%{4}/endif%%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1297 /set prot_%{1}_p=0
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1298
1235
f4a450e3e76f Fix support for major folklorist prots (they can be sticky, like conjuprots).
Matti Hamalainen <ccr@tnsp.org>
parents: 1234
diff changeset
1299 /def -i prdeffolk =\
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1265
diff changeset
1300 /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
1301
154
6c66a8dbc750 - Preliminary variable/setting saving (/gsave and /gload commands).
Matti Hamalainen <ccr@tnsp.org>
parents: 153
diff changeset
1302
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1303 ;; 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
1304 ; -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
1305 ; -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
1306 ; -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
1307 ; -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
1308 ; -B"<prerequisite regexp #2>"
79d44844725e 0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
1309 ; -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
1310 ; -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
1311 ; -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
1312 ; -r Use regexp instead of simple matching in up AND down messages
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1313 ; -s Stackable prot
7
a6171a9fe54d Fixed renewable prot flag -n -> -h
Matti Hamalainen <ccr@tnsp.org>
parents: 6
diff changeset
1314 ; -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
1315 ; -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
1316 ; -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
1317 ; -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
1318 ; -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
1319 ; -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
1320 ; -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
1321 ; -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
1322 ; -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
1323
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 326
diff changeset
1324 /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
1325 /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
1326 /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
1327 /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
1328 /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
1329 /test prlist_insert("lst_prots", opt_i)%;\
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1330 /set prot_%{opt_i}=0%;\
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1331 /set prot_%{opt_i}_t=-1%;\
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1332 /set prot_%{opt_i}_n=%{opt_n}%;\
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1333 /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
1334 /set prot_%{opt_i}_p=0%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1335 /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
1336 /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
1337 /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
1338 /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
1339 /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
1340 /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
1341 /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
1342 /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
1343 /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
1344 /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
1345 /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
1346 /let _qmatch=simple%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1347 /let qact1=%%;%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1348 /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
1349 /if (opt_P)\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1350 /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
1351 /prclearpreqs %%{lst_cprots}%%;/set prot_%{opt_i}_p=1%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1352 /test prdefconju(opt_i, opt_i, "You see a %{opt_d} shield fade into existance around you.", qact1)%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1353 /test prdefconju(opt_i, "%{opt_i}_st", "You see an extra %{opt_d} shield fade into existance around you.", qact2)%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1354 /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
1355 /elseif (opt_p)\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1356 /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
1357 /prclearpreqs %%{lst_cprots}%%;/set prot_%{opt_i}_p=1%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1358 /test prdefconju(opt_i, opt_i, "You sense a powerful protective aura around you.", qact1)%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1359 /test prdefconju(opt_i, "%{opt_i}_st", "You sense an extra powerful protective aura around you.", qact2)%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1360 /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
1361 /else \
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, "^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
1363 /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
1364 /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
1365 /endif%;\
114
f8c00e7a42ff Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents: 113
diff changeset
1366 /else \
502
ac625436ea84 Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
1367 /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
1368 /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
1369 /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
1370 /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
1371 /if (opt_r) /let _qmatch=regexp%;/else /let _qmatch=simple%;/endif%;\
128
92cd63c17765 Conjurer typeprot re-code
Matti Hamalainen <ccr@tnsp.org>
parents: 127
diff changeset
1372 /let pstr=0%;\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1373 /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
1374 /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
1375 /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
1376 /if (pstr > 0)\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1377 /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
92cd63c17765 Conjurer typeprot re-code
Matti Hamalainen <ccr@tnsp.org>
parents: 127
diff changeset
1378 /else \
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1379 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1380 /endif%;\
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1381 /endif%;\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1382 /gdef -i -F -p9999 -aCgreen -m%{_qmatch} -t'%{opt_d}' rec_%{opt_i}_off=/gprot_off %{opt_i}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1383
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1384
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1385 ;; 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
1386 /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
1387 /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
1388 /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
1389 /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
1390 /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
1391 /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
1392 /let _prot_c=$[prgetval(strcat("prot_",{1}))]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1393 /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
1394 /if (_prot_c > 0)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1395 /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
1396 /let _tmps=Renewed! $[prgetstime(_prot_t)]%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1397 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1398 /let _tmps=ON!%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1399 /endif%;\
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1400 /set prot_%{1}=1%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1401 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1402 /if (_prot_s)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1403 /set prot_%{1}=$[_prot_c+1]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1404 /let _tmps=ON [#$[_prot_c+1]]%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1405 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1406 /gerror Prot '%{1}' (%{_prot_l}) increased even though not flagged stackable!%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1407 /break%;\
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1408 /endif%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1409 /endif%;\
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1410 /set prot_%{1}_t=$[time()]%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1411 /if ({-1}!~"")\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1412 /msr %{_prot_l} %{-1} %{_tmps}%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1413 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1414 /msr %{_prot_l} %{_tmps}%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1415 /endif%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1416 /gprots_update%;/gstatus_update
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1417
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1418
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1419 ;; 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
1420 /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
1421 /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
1422 /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
1423 /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
1424 /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
1425 /set prot_%{1}=%{_prot_c}%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1426 /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
1427 /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
1428 /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
1429 /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
1430 /if (_prot_c < 0 & _prot_q) \
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1431 /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
1432 /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
1433 /set prot_%{1}_st=0%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1434 /msr %{_prot_l} OFF!%;\
35
63e2f7fd9115 Some work on stacking prots (still not too good)
Matti Hamalainen <ccr@tnsp.org>
parents: 34
diff changeset
1435 /break%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1436 /endif%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1437 /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
1438 /msr %{_prot_l} Weakened! [#%{_prot_c}] $[prgetstime(_prot_t)]%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1439 /else \
18
f63ff175a301 Lots of namespace cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 17
diff changeset
1440 /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
1441 /set prot_%{1}_st=0%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1442 /if (!_prot_q & _prot_c < 0)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1443 /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
1444 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1445 /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
1446 /endif%;\
253
538e785fde00 Indentation fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 247
diff changeset
1447 /endif%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1448 /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
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1452 ;; 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
1453 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1454 /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
1455 /while ({#})\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1456 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1457 /if (_prot_on > 0)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1458 /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
1459 /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
1460 /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
1461 /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
1462 /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
1463 /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
1464 /set cnt_prots=$[cnt_prots + 1]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1465 /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
1466 /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
1467 /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
1468 /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
1469 /let _qss=%{_prot_n}%{_qts}$[prgetstime(_prot_t)]%;\
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1470 /if (status_protstr!~"")\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1471 /set status_protstr=%{status_protstr} | %{_qss}%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1472 /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
1473 /else \
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1474 /set status_protstr=%{_qss}%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1475 /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
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 /endif%;\
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1478 /shift%;\
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1479 /done
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1480
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1481 /def -i gprots_update =\
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1482 /set status_protstr=%;\
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1483 /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
1484 /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
1485 /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
1486 /if (cnt_prots > 0)\
526
a987eadbc08e Namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 524
diff changeset
1487 /return status_protstr%;\
819
2b72f42b4d47 Indentation fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 818
diff changeset
1488 /else \
303
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1489 /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
1490 /endif
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
067315d8223a v0.5.9.25: More namespace cleanups, might add some new breakage.
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
1493 ;; Prot reporting
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1494 ;@command /prots
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
1495 ;@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
1496 ;@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
1497 /def -i prots = /msq $[gprots_update()]
731
f0725dd53994 Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 726
diff changeset
1498
f0725dd53994 Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 726
diff changeset
1499 /prdefgbind -s"prots" -c"/prots"
f0725dd53994 Sanitize the opt_bindings setting a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 726
diff changeset
1500
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
1501 /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
1502 /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
1503
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
1504 /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
1505 /msr $[gprots_update()]
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1506
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1507
111
5a8d99df4f43 Update prots more regularly
Matti Hamalainen <ccr@tnsp.org>
parents: 110
diff changeset
1508 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
476
9c01082502bd - Reboot removes all prots. Do so.
Ealoren Pupunen <ealoren@bat.org>
parents: 475
diff changeset
1509 ;; Prots which expire on death, DMP or reboot
111
5a8d99df4f43 Update prots more regularly
Matti Hamalainen <ccr@tnsp.org>
parents: 110
diff changeset
1510 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
129
f65771b56ddc DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents: 128
diff changeset
1511 ;; Death
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1512 /def -i gprots_clear_rip =\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1513 /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
1514 /while ({#})\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1515 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1516 /if (_prot_on)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1517 /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
1518 /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
1519 /set prot_%{1}_st=0%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1520 /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
1521 /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
1522 /else \
1207
b22508dc2f81 Oops, _ripstr was both global and local variable. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 1198
diff changeset
1523 /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
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 /endif%;\
a083a1925719 New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
1526 /shift%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1527 /done%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1528 /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
1529
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1530 /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
1531 /msq @{BCyellow}Various prots expire as you die!@{n}%;\
436
8d37f21ad563 v0.6.0-pre5
Matti Hamalainen <ccr@tnsp.org>
parents: 430
diff changeset
1532 /set spell_st=off%;\
8d37f21ad563 v0.6.0-pre5
Matti Hamalainen <ccr@tnsp.org>
parents: 430
diff changeset
1533 /set skill_st=off%;\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1534 /let _ripstr=$(/gprots_clear_rip %{lst_ripprots})%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1535 /gprots_update%;/gstatus_update%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1536 /if (_ripstr!~"")\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1537 /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
1538 /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
1539
114
f8c00e7a42ff Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents: 113
diff changeset
1540
127
26b17ae84f1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
1541 ;; Dispel magical protection (dmp)
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1542 /def -i gprots_clear_dmp =\
985
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1543 /let _dmpstr=%;\
129
f65771b56ddc DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents: 128
diff changeset
1544 /while ({#})\
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1545 /let _prot_on=$[prgetval(strcat("prot_",{1}))]%;\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1546 /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
1547 /if (_prot_on & _prot_st == 0)\
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1548 /let _prot_n=$[prgetval(strcat("prot_",{1},"_n"))]%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1549 /set prot_%{1}=0%;\
985
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1550 /if (_dmpstr!~"") \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1551 /let _dmpstr=%{gdmpstr}, %{_prot_n}%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1552 /else \
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1553 /let _dmpstr=%{_prot_n}%;\
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1554 /endif%;\
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1555 /endif%;\
129
f65771b56ddc DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents: 128
diff changeset
1556 /shift%;\
985
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1557 /done%;\
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1558 /result _dmpstr
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1559
129
f65771b56ddc DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents: 128
diff changeset
1560
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1561 /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
1562 /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
1563 /gprots_update%;/gstatus_update%;\
985
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1564 /if (_dmpstr!~"")\
662
47f881160fc1 Prevent "DMP hit you" spam in some situations; Minor optimizations.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
1565 /msq @{BCred}Dispel Magical Protection@{n} hit you!%;\
985
9b9ef109ecb5 Clean up DMP handling macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 984
diff changeset
1566 /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
1567 /endif
129
f65771b56ddc DMP support, probably broken.
Matti Hamalainen <ccr@tnsp.org>
parents: 128
diff changeset
1568
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1569
1319
b9ef8769b69a Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents: 1318
diff changeset
1570 ;; Login after reboot or quit
b9ef8769b69a Rename reboot login event hook to quit login
Matti Hamalainen <ccr@tnsp.org>
parents: 1318
diff changeset
1571 /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
1572 /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
1573
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
1574 /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
1575
742babde0a89 Implement event hooks for normal login from ld and login from reboot.
Matti Hamalainen <ccr@tnsp.org>
parents: 1310
diff changeset
1576 ;; 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
1577 /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
1578 /prexecfuncs %{event_login}
476
9c01082502bd - Reboot removes all prots. Do so.
Ealoren Pupunen <ealoren@bat.org>
parents: 475
diff changeset
1579
504
a083a1925719 New -M flag was added to prdefprot(), which can be used to mark
Matti Hamalainen <ccr@tnsp.org>
parents: 503
diff changeset
1580
69
3cfb24dca78d Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
1581 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1149
12f188b4c094 Added prot 'Searing Fervor'.
Matti Hamalainen <ccr@tnsp.org>
parents: 1148
diff changeset
1582 ;; 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
1583 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
327
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"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
1585 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1586
631
ae5c92e5cbb4 Bumped version up; Infravision is not stacking, but renewable - reported by Xunisiih.
Matti Hamalainen <ccr@tnsp.org>
parents: 627
diff changeset
1587 /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
1588 /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
1589 /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
1590 /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
1591 /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
1592 /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
1593 /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
1594 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1595
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 326
diff changeset
1596 /prdefprot -i"haste" -n"Haste" -l"Haste"
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1597
562
28669f28c254 Re-added old enrage message for hcbat compatibility.
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents: 559
diff changeset
1598 /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
659cb49c3872 Typofixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 518
diff changeset
1599 /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
1600 /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
1601 /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
1602 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1603
1430
fcc8358845ef Fix 'protection by sacrifice' support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1429
diff changeset
1604 /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
1605 /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
1606
598
e2fb3763f12a Added initial support for 'enhanced awareness'.
Matti Hamalainen <ccr@tnsp.org>
parents: 596
diff changeset
1607 /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
1608 /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
1609
708
8890b3294fd4 Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents: 706
diff changeset
1610 /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
1611 /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
1612
8890b3294fd4 Added support for 'Greater Darkness' and 'Greater Light'; v0.6.3
Matti Hamalainen <ccr@tnsp.org>
parents: 706
diff changeset
1613
569
ce387924141b Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents: 566
diff changeset
1614 ;; --- Misc. handicaps ----
ce387924141b Added new "-z" flag to prdefprot() to specify handicaps/curses;
Matti Hamalainen <ccr@tnsp.org>
parents: 566
diff changeset
1615 /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
1616 /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
1617
1145
c450a3d98f0a Add a commented out protdef for 'degenerate person'.
Matti Hamalainen <ccr@tnsp.org>
parents: 1142
diff changeset
1618 ; 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
1619 ;/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
1620
360
d7158a925e21 Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
1621 ;; ---- Spider ----
1161
dffd7414cb06 Clean up the prot system a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
1622 /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
659cb49c3872 Typofixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 518
diff changeset
1623 /prdefprot -i"qsilver" -n"QS" -l"Quicksilver" -u"You feel more agile." -d"You feel less agile."
659cb49c3872 Typofixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 518
diff changeset
1624 /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
1625
499
57fb777fe48b Added Flamefist prot support.
Matti Hamalainen <ccr@tnsp.org>
parents: 496
diff changeset
1626 ;; ---- Tiger ----
838
a2cd4eb72a53 Make 'flame fists' renewable.
Matti Hamalainen <ccr@tnsp.org>
parents: 836
diff changeset
1627 /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
1628 -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
1629 -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
1630
360
d7158a925e21 Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
1631 ;; ---- 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
1632 /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
1633 /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
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents: 474
diff changeset
1634 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1635
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1636 ;; ---- Tarmalen ----
835
2a1290f4283e One more (perhaps recently ninjatuned?) unpain down message added.
Matti Hamalainen <ccr@tnsp.org>
parents: 833
diff changeset
1637 /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
1638 /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
1639
1234
8babe13acfaa Fix "life link" prot support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1227
diff changeset
1640 /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
1641 /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
1642 /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
1643 /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
1644
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1645 ;; ---- 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
1646 /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
1647 -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
1648 -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
1649 /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
580b1f6b05c2 More fixes ... :D
Matti Hamalainen <ccr@tnsp.org>
parents: 884
diff changeset
1650 /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.$"
580b1f6b05c2 More fixes ... :D
Matti Hamalainen <ccr@tnsp.org>
parents: 884
diff changeset
1651 /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
1652
360
d7158a925e21 Added support for 'spider touch'.
Matti Hamalainen <ccr@tnsp.org>
parents: 359
diff changeset
1653 ;; ---- Templar ----
502
ac625436ea84 Added -m flag to prdefprot(), which adds the prot to list, which
Matti Hamalainen <ccr@tnsp.org>
parents: 501
diff changeset
1654 /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
1655 /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
74c2bedb7bff Fixes for prots
Matti Hamalainen <ccr@tnsp.org>
parents: 8
diff changeset
1656
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1657 ;; ---- 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
1658 /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
1659 /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
1660 -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
1661 -d"^Your armour feels thinner.$"
93666678930f Change 'force shield' up/down messages.
Matti Hamalainen <ccr@tnsp.org>
parents: 947
diff changeset
1662
355
32c884e80dd3 v0.5.10.11: Aura string length was miscalculated for status line,
Matti Hamalainen <ccr@tnsp.org>
parents: 349
diff changeset
1663 /prdefprot -i"psish" -n"PsiSh" -l"Psionic Shield" -u"Psionic waves surge through your body and mind!" -d"The psionic shield vanishes."
356
b1b476305c6e v0.5.10.12: Fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 355
diff changeset
1664 /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
1665 /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
1666 ;/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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1667
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1668 ;; ---- 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
1669 /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
1670 /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
1671 /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
1672 /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
1673 /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
1674 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1675
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1676 ;; ---- 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
1677 /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
d4a5eb505126 Adjust some regexps.
Matti Hamalainen <ccr@tnsp.org>
parents: 1576
diff changeset
1678 /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
1679 /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
1680 /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
1681 /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
f7a22f1446d8 0.5.4-cvs
Matti Hamalainen <ccr@tnsp.org>
parents: 69
diff changeset
1682
517
b65e36f7f864 Added support for 'destructive rage' skill/prot.
Matti Hamalainen <ccr@tnsp.org>
parents: 512
diff changeset
1683 ;; ---- LoC ----
b65e36f7f864 Added support for 'destructive rage' skill/prot.
Matti Hamalainen <ccr@tnsp.org>
parents: 512
diff changeset
1684 /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
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1685
114
f8c00e7a42ff Support for some conjurer typeprots added.
Matti Hamalainen <ccr@tnsp.org>
parents: 113
diff changeset
1686 ;; ---- 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
1687 /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
1688 /prdefprot -i"bimage" -n"BImg" -l"Blurred Image" -A" \'ziiiuuuuns wiz\'$" -u"You feel a powerful aura." -d"You feel less invisible."
540
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
1689 /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
1690 /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
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
1691 /prdefprot -i"rentr" -n"REntrop" -l"Resist Entropy" -u"You feel your life force expanding." -d"You feel your hair is getting grayer."
5c1a8d196182 THROW MORE DOTS
Matti Hamalainen <ccr@tnsp.org>
parents: 526
diff changeset
1692 /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
1693 /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
1694
138
79d44844725e 0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
1695 ;; ---- Conjurer::Minor Typeprots ----
1077
3a9be7e507b0 Unify some prot names, mostly conjurer prots.
Matti Hamalainen <ccr@tnsp.org>
parents: 1076
diff changeset
1696 /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
1697 /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
1698 /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
1699 /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
1700 /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
1701 /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
1702 /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
1703 /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
1704 /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
1705
138
79d44844725e 0.5.9.x-svn: Conjuprots breakage; Force Shield support
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
1706 ;; ---- 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
1707 /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
1708 /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
1709 /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
1710 /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
1711 /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
1712 /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
1713 /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
1714 /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
1715 /prdefprot -i"m_cold" -n"GCold" -l"Frost Shield" -P -A"nbarrimon zfettix roi" -d"frosty blue-white"
146
db352c8693e9 v0.5.9.1
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
1716
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
1717 ;; ---- Folklorist ----
1235
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"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
1719 /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
1720 /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
1721 /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
1722 /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
1723
1133
a2a8ab1e2401 v0.6.12.10-svn
Matti Hamalainen <ccr@tnsp.org>
parents: 1123
diff changeset
1724 ;; ---- Lunar Defender ---
a2a8ab1e2401 v0.6.12.10-svn
Matti Hamalainen <ccr@tnsp.org>
parents: 1123
diff changeset
1725 ;/prdefprot -i"lunshield" -n"LunS" -l"Lunacy Shield" -u"A translucent shield appears around you, flashes multiple colours, then vanishes." -d""
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1726
69
3cfb24dca78d Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
1727 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3cfb24dca78d Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
1728 ;; Unstun (NS)
1110
2e71dfd6c983 Change unstun short name to 'Uns'.
Matti Hamalainen <ccr@tnsp.org>
parents: 1100
diff changeset
1729 /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
1730
1577
d4a5eb505126 Adjust some regexps.
Matti Hamalainen <ccr@tnsp.org>
parents: 1576
diff changeset
1731 /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
1732 /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
1733
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1734 /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
1735 /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
1736
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1737 /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
1738 /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
1739
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1740 /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
1741 /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
1742
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1743 /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
1744 /gprot_off unstun
69
3cfb24dca78d Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
1745
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1746 /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
1747 /gspell_interrupt%;/gskill_interrupt%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1748 /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
1749 /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
1750 /gstatus_update
69
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
3cfb24dca78d Comments, moving bits around to reorganize for cleaner look
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
1753 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
518
fb9c524eeca3 Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents: 517
diff changeset
1754 ;; 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
1755 /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
1756
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1757 /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
1758 /gprot_on mthresh%;/set prot_mthresh_w=0
518
fb9c524eeca3 Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents: 517
diff changeset
1759
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1760 /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
1761 /gprot_off mthresh
518
fb9c524eeca3 Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents: 517
diff changeset
1762
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1763 /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
1764 /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
1765 /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
1766 /gstatus_update
518
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
fb9c524eeca3 Preliminary support for 'mesmeric threshold'.
Matti Hamalainen <ccr@tnsp.org>
parents: 517
diff changeset
1769 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1770 ;; 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
1771 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1772 /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
1773 /prdeftoggle -n"cursewarn" -d"Warn about soon expiring curses"
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1774
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
1775 ;; Clear curse prerequisites
833
890457cd4e53 Fix a typo.
Matti Hamalainen <ccr@tnsp.org>
parents: 831
diff changeset
1776 /def -i prclearcurses =\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1777 /while ({#})\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1778 /set curse_%{1}_p=0%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1779 /shift%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1780 /done
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1781
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1782 ;; Define a curse
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1783 ; -i"<idname>" Unique identifier
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1784 ; -n"<short name>" Curse short name
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1785 ; -l"<long name>" Long name
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1786 ; -u"<up message>" Up message (regexp)
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1787 ; -d"<down message>" Optional down message (regexp)
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1788 ; -A"<prerequisite #1>" Optional curse "up" prerequisite #1 (regexp)
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1789 ; -B"<prerequisite #2>"
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1790 ; -C"<prerequisite #3>"
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1791 ; -U# Up message regexp subexpression index for curse target name
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1792 ; -D# Down message regexp subexpression index for curse target name
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1793 ; -t# Final expiration time in seconds (e.g. absolute maximum time the curse may be up)
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1794
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1795 /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
1796 /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
1797 /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
1798 /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
1799 /if (opt_l=~"") /gerror Missing curse long desc (-l) in '%{opt_i}' definition.%;/break%;/endif%;\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1800 /if (opt_u!~"" & !opt_U) /gerror Missing -Ux from curse '%{opt_i}' definition.%;/break%;/endif%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1801 /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
1802 /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
1803 /test prlist_insert("lst_curses", opt_i)%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1804 /set curse_%{opt_i}_n=%{opt_n}%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1805 /set curse_%{opt_i}_l=%{opt_l}%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1806 /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
1807 /if (opt_t)\
588c3dedd496 Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents: 829
diff changeset
1808 /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
1809 /else \
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1810 /set curse_%{opt_i}_m=-1%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1811 /endif%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1812 /let _plevel=0%;\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1813 /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
1814 /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
1815 /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
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1816 /if (_plevel > 0)\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1817 /def -i -F -p9999 -mregexp -t'%{opt_u}' gcurse_%{opt_i}_on=\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1818 /if (curse_%{opt_i}_p==%{_plevel})\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1819 /test gcurse_on("%{opt_i}",{P%{opt_U}})%%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1820 /endif%%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1821 /set curse_%{opt_i}_p=0%;\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1822 /else \
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1823 /def -i -F -p9999 -mregexp -t'%{opt_u}' gcurse_%{opt_i}_on=\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1824 /set curse_%{opt_i}_p=0%%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1825 /test gcurse_on("%{opt_i}",{P%{opt_U}})%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1826 /endif%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1827 /if (opt_d!~"")\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
1828 /def -i -F -p9999 -mregexp -t'%{opt_d}' gcurse_%{opt_i}_off=\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1829 /test gcurse_off("%{opt_i}",{P%{opt_D}})%;\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1830 /endif
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1831
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
1832 ;; 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
1833 /def -i gcurse_check =\
1404
e6e61c1475ea Fix curse expiration timer functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1403
diff changeset
1834 /return regmatch(strcat("(^| )",replace("|","\|",{1}),"( |$$)"), lst_cursed)
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1835
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
1836 ;; Expiration macro
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1837 /def -i gcurse_expire =\
1404
e6e61c1475ea Fix curse expiration timer functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1403
diff changeset
1838 /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
1839 /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
1840 /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
1841 /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
1842 /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
1843 /endif
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1844
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
1845 ;; 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
1846 /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
1847 /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
1848 /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
1849 /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
1850 /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
1851 /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
1852 /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
1853 /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
1854 /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
1855 /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
1856 /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
1857
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
1858 ;; 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
1859 /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
1860 /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
1861 /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
1862 /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
1863 /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
1864 /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
1865 /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
1866 /endif
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1867
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
1868 ;; Turn a curse "on", with some sanity checking
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1869 /def -i gcurse_on =\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1870 /let _cid=%{1}%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1871 /let _ctgt=%{2}%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1872 /let _ccmp=(^| )%{_ctgt}( |$$)%;\
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1873 /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
1874 /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
1875 /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
1876 /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
1877 /set lst_cursed=$(/gcurse_delete %{_cid} %{_ctmp} %{lst_cursed})%;\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1878 /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
1879 /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
1880 /let _cinfo=$[strcat(_ctmp,"|",_cid,"|",time())]%;\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1881 /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
1882 /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
1883 /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
1884 /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
1885 /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
1886 /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
1887 /endif%;\
829
d98e9a88370a Inform the user that partymember curse has been ignored.
Matti Hamalainen <ccr@tnsp.org>
parents: 828
diff changeset
1888 /else \
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1889 /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
1890 /endif
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1891
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1892 /def -i gcurses_do_get =\
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1893 /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
1894 /let _cursestr=%;\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1895 /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
1896 /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
1897 /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
1898 /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
1899 /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
1900 /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
1901 /gerror Invalid curse entry '%{_ctmp}'. Internal error.%;\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1902 /endif%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1903 /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
1904 /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
1905 /result _cursestr
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1906
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1907 /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
1908 /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
1909 /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
1910 /return _ctmp%;\
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1911 /else \
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1912 /return "No curses tracked."%;\
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1913 /endif
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
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1916 ;; 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
1917 /def -i curses = /msq Curses: $[gcurses_get()]
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1918
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1919 /prdefgbind -s"curses" -c"/curses"
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1920
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1921 /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
1922 /msr $[gcurses_get()]
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
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1925 ;; 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
1926 /prdefcurse -i"touch" -n"STouch" -l"spider touched" -t600 \
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1927 -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
1928
830
588c3dedd496 Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents: 829
diff changeset
1929 /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
1930 -A" utters? the magic words \'nilaehz temnahecne neg\'" \
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1931 -U1 -u"^(.+) turns very pale!$"
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1932
830
588c3dedd496 Set the default drop time for all curses to 20 minutes.
Matti Hamalainen <ccr@tnsp.org>
parents: 829
diff changeset
1933 /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
1934 -A" utters? the magic words \'kewa dan dol rae hout\'" \
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1935 -U1 -u"^(.+) appears weakened!$"
826
b89c39bbee10 Added curse tracking support.
Matti Hamalainen <ccr@tnsp.org>
parents: 824
diff changeset
1936
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
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
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
1939 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1940 ;; Skill and skill-status reporting
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1941 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1942 ; skill_t - timestamp of when skill started
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1943 ; skill_st - 'on' during skill "concentration" phase, off when skill goes off
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1944 ; skill_st2 - 'off' during "concentration", on when skill goes off
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1945 ;
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1946 ; cast_info - empty for no cast/skill going on, 'SP' for spells, 'SK' for skills
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1947 ; cast_info_n - name of skill/spell currently going on
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1948 ; cast_info_t - target of skill/spell (empty if no target)
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1949
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1950
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1951 ;; Display information about current skill/spell
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1952 /def -i gshow_info =\
148
1f8ef34c48f7 The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 146
diff changeset
1953 /if (cast_info_t!~"")\
87
d69db598b52f Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
1954 /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
1955 /else \
148
1f8ef34c48f7 The great variable / expression cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 146
diff changeset
1956 /if (battle_target!~"")\
87
d69db598b52f Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
1957 /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
1958 /else \
d69db598b52f Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
1959 /msq '%{cast_info_n}'%;\
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 /endif
d69db598b52f Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
1962
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1963 ;; Start of skill
595
3cb2f995ad46 Make skill/spell "spam" optional
Matti Hamalainen <ccr@tnsp.org>
parents: 590
diff changeset
1964 /def -i -p9999 -msimple -t"You start concentrating on the skill." gskill_start =\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1965 /set skill_t=$[time()]%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1966 /set cnt_skills=$[cnt_skills+1]%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1967 /set skill_st=on%;\
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1968 /set skill_st2=off%;\
87
d69db598b52f Various minor changes to skill/spell handling and information
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
1969 /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
1970 /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
1971 /gstatus_update%;/prexecfuncs %{event_skill_start}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1972
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1973
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1974 ;; Skill done
595
3cb2f995ad46 Make skill/spell "spam" optional
Matti Hamalainen <ccr@tnsp.org>
parents: 590
diff changeset
1975 /def -i -p9999 -msimple -t"You are prepared to do the skill." gskill_end =\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1976 /set cnt_sskills=$[cnt_sskills+1]%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1977 /set skill_st=off%;\
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1978 /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
1979 /set cast_info=%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1980 /set cnt_sktime=$[cnt_sktime+time() - skill_t]%;\
958
a0d4bcfc65de Reorganize some message printing macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 949
diff changeset
1981 /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
1982 /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
1983
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1984
28
c73df1b83f8f Added new option '/info' which shows ongoing spell/skill cast info in
Matti Hamalainen <ccr@tnsp.org>
parents: 24
diff changeset
1985 ;; Cast info
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1986 /def -i -p9999 -ag -mregexp -t"^You are using \'([a-z ]+)\'.$" gskill_info1 =\
294
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
1987 /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
1988 /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
1989
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
1990 /def -i -p9999 -ag -mregexp -t"^You are using \'([a-z ]+)\' at \'(.+?)\'.$" gskill_info2 =\
294
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
1991 /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
1992 /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
1993
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
1994
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1995 ;; Skill fumbled
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
1996 /def -i gskill_fumble =\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
1997 /if (skill_st2=~"on")\
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
1998 /set cnt_sskills=$[cnt_sskills - 1]%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
1999 /set cnt_fuskills=$[cnt_fuskills+1]%;\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2000 /set skill_st2=off%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2001 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2002
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
2003
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2004 ;; Skill failed
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
2005 /def -i gskill_fail =\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2006 /if (skill_st2=~"on")\
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2007 /set cnt_sskills=$[cnt_sskills - 1]%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
2008 /set cnt_fskills=$[cnt_fskills+1]%;\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2009 /set skill_st2=off%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2010 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2011
295
46c9a3991855 v0.5.9.21
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
2012
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2013 ;; Skill interrupted
291
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
2014 /def -i gskill_interrupt =\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2015 /if (skill_st=~"on")\
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2016 /msq @{Cbgred} ---- SKILL INTERRUPTED ---- @{n}%;\
289
26be894717c5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 288
diff changeset
2017 /set cnt_iskills=$[cnt_iskills+1]%;\
153
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2018 /set skill_st=off%;\
3bfbeb2ca379 Cleanups, unified message for skill interrupt
Matti Hamalainen <ccr@tnsp.org>
parents: 152
diff changeset
2019 /set cast_info=%;\
290
89458d89ed04 Namespace cleanups. Possible breakage may follow.
Matti Hamalainen <ccr@tnsp.org>
parents: 289
diff changeset
2020 /gstatus_update%;\
214
080b02940954 Breakage, new event_* variables to list macros executed on specific events.
Matti Hamalainen <ccr@tnsp.org>
parents: 210
diff changeset
2021 /prexecfuncs %{event_skill_intr}%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2022 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2023
1353
2f925800296b New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents: 1352
diff changeset
2024 ;; Skill stopped
2f925800296b New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents: 1352
diff changeset
2025 /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
2026 /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
2027 /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
2028 /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
2029 /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
2030 /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
2031 /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
2032 /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
2033 /endif
2f925800296b New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents: 1352
diff changeset
2034
2f925800296b New event hooks for stopped spells and skills, separate from interrupted ones.
Matti Hamalainen <ccr@tnsp.org>
parents: 1352
diff changeset
2035 /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
789e056eec42 More namespace cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 290
diff changeset
2036 /set skill_st2=on%;/gskill_interrupt
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2037
1390
4637f48d45f6 The 'sleep' command has its own messages for stopping / interrupting any
Matti Hamalainen <ccr@tnsp.org>
parents: 1387
diff changeset
2038 /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
2039 /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
2040
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
2041 /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
2042 /set skill_st2=on%;/gskill_stopped
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2043
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
2044
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2045 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
844
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2046 ;; Ceremony
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2047 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2048 /prdefgbind -s"cere" -c"/ceremony" -n
1139
adac33015c37 Add support for mage staff ceremony.
Matti Hamalainen <ccr@tnsp.org>
parents: 1138
diff changeset
2049
adac33015c37 Add support for mage staff ceremony.
Matti Hamalainen <ccr@tnsp.org>
parents: 1138
diff changeset
2050 /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
2051 /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
2052
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2053 /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
2054 /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
2055
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
2056 ;@command /ceremony
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
2057 ;@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
2058 /def -i ceremony =\
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2059 /if (ceremony_st=~"on")\
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2060 /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
2061 /else \
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2062 @@use ceremony%;\
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2063 /endif
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
2aad98afca1e Move ceremony code from misc to core module.
Matti Hamalainen <ccr@tnsp.org>
parents: 838
diff changeset
2066 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2067 ;; Battle, enemy shape
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2068 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2069 ;; Report shape
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2070 ;@command /shape
1422
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
2071 ;@desc Reports the last catched shape of a opponent (monster) in battle.
5fd83e73cb6e Add documentation for lots of macro commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 1419
diff changeset
2072 ;@desc This does not work too well if you were fighting more than one opponents.
916
9b509ae4ec03 Minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 912
diff changeset
2073 /def -i shape =\
333
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2074 /if (battle_target!~"")\
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2075 /msr %{battle_shape} (%{battle_target})%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2076 /else \
333
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2077 /msr %{battle_shape}%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2078 /endif%;\
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2079
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2080 ;; 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
2081 /prdefvar -n"fmt_shape" \
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2082 -v"@{Cgreen}%%{4} %%{5}@{n} [@{%%{1}}%%{2}@{n}] (@{%%{1}}%%{3}%%%@{n})" \
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2083 -c"Format string for shape reporting. %{1}=shape colour, %{2}=shape short name, %{3}=percentage, %{4}=target name, %{5}=shape long name"
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2084
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2085 ;; Update/set new shape
333
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2086 /eval /def -i gbattle_ss =\
766
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2087 /substitute -p %{fmt_shape}%%;\
333
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2088 /if (battle_st)\
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2089 /set battle_pshape=%%{battle_shape}%%;\
47de1833c029 Copyright cleanup (again); Shape reporting can now be "configured" via
Matti Hamalainen <ccr@tnsp.org>
parents: 332
diff changeset
2090 /set battle_shape=%%{2}%%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2091 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2092
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 326
diff changeset
2093 ;; (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
2094 /def -i gbattle_init =\
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2095 /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
2096 /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
2097 /set battle_pshape=es%;\
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2098 /set battle_st=1%;\
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2099 /prexecfuncs %{event_battle_first_round}
39
e7119d31408f Added battle_roundfuncs hook
Jarkko Vaaraniemi <jeskko@pupunen.net>
parents: 37
diff changeset
2100
1197
Matti Hamalainen <ccr@tnsp.org>
parents: 1195
diff changeset
2101 /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
2102 /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
2103 /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
2104 /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
2105 /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
2106 /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
2107
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2108 ;; 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
2109 /def -i gbattle_round =\
1332
49b4fd8d5e51 Fix round flag trigger, again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1330
diff changeset
2110 /set battle_round=$[battle_round+1]%;\
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2111 /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
2112 /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
2113 /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
2114 /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
2115 /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
2116 /gstatus_update
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2117
1342
692872487dd4 "Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents: 1341
diff changeset
2118 /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
2119 /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
2120
692872487dd4 "Fix" battle rounds flag triggering, again. Hopefully it won't get changed anymore.
Matti Hamalainen <ccr@tnsp.org>
parents: 1341
diff changeset
2121 /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
2122 /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
2123
1328
c960f8d8ac71 Cope with the new format of flowerbat battle round flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 1325
diff changeset
2124
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2125 ;; Grab target via several methods
916
9b509ae4ec03 Minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 912
diff changeset
2126 /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
2127 /msk @{BCyellow}Targetting@{n} -> @{BCred}%{P1}@{n}%;\
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2128 /set battle_target=%{1}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2129
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2130 ;; Get shape
916
9b509ae4ec03 Minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 912
diff changeset
2131 /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)\.$" gbattle_shape1 =\
766
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2132 /if ({P4}=~"excellent shape") /test gbattle_ss("BCgreen","es","90-100",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2133 /elseif ({P4}=~"good shape") /test gbattle_ss("Cgreen","gs","80-90",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2134 /elseif ({P4}=~"slightly hurt") /test gbattle_ss("BCcyan","sh","65-80",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2135 /elseif ({P4}=~"noticeably hurt") /test gbattle_ss("Ccyan","nh","50-65",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2136 /elseif ({P4}=~"not in a good shape") /test gbattle_ss("BCyellow","nigs","35-50",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2137 /elseif ({P4}=~"bad shape") /test gbattle_ss("Cyellow","bs","20-35",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2138 /elseif ({P4}=~"very bad shape") /test gbattle_ss("BCred","vbs","10-20",{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2139 /elseif ({P4}=~"near death") /test gbattle_ss("Cred","nd","0-10",{P1},{P4})%;/endif
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2140
916
9b509ae4ec03 Minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 912
diff changeset
2141 /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_shape2 =\
766
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2142 /if ({P4}=~"excellent shape") /test gbattle_ss("BCgreen","es",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2143 /elseif ({P4}=~"good shape") /test gbattle_ss("Cgreen","gs",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2144 /elseif ({P4}=~"slightly hurt") /test gbattle_ss("BCcyan","sh",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2145 /elseif ({P4}=~"noticeably hurt") /test gbattle_ss("Ccyan","nh",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2146 /elseif ({P4}=~"not in a good shape") /test gbattle_ss("BCyellow","nigs",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2147 /elseif ({P4}=~"bad shape") /test gbattle_ss("Cyellow","bs",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2148 /elseif ({P4}=~"very bad shape") /test gbattle_ss("BCred","vbs",{P5},{P1},{P4})%;\
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2149 /elseif ({P4}=~"near death") /test gbattle_ss("Cred","nd",{P5},{P1},{P4})%;/endif
e9dcf2d389cf Fixed shape getting and liting for latest flower bat tune. Should not break HCBat compatibility.
Matti Hamalainen <ccr@tnsp.org>
parents: 762
diff changeset
2150
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2151 ;; Monster RIP does not necessarily end battle, but let's reset
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2152 ;; the target at least.
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2153 /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
2154 /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
2155 /prexecfuncs %{event_battle_rip}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2156
1182
335ee40ae254 Clean up the battle handling code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1181
diff changeset
2157 ;; 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
2158 ;; 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
2159 ;; 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
2160 /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
2161 /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
2162
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
2163
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
2164 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1214
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2165 ;; 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
2166 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2167 /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
2168 /set heartbeat_last=-1
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2169 /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
2170 /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
2171 /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
2172 /set heartbeat_avg=3
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2173 /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
2174
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2175 ;; 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
2176 /def -i ghbjitter =\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2177 /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
2178
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2179 ;; 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
2180 /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
2181
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2182 ;; 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
2183 /def -i praverage =\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2184 /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
2185 /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
2186 /result (_vsum / _vnum)
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2187
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2188
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2189 /def -i gheartbeat_timer =\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2190 /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
2191 /gbattle_end%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2192 /endif%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2193 /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
2194 /gheartbeat_do force%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2195 /endif%;\
1512
4353e3a8bec1 Check against >= 10 instead of > 10
Matti Hamalainen <ccr@tnsp.org>
parents: 1511
diff changeset
2196 /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
2197 /set heartbeat_discard=0%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2198 /gheartbeat_tick FORCE%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2199 /endif
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2200
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2201 /def -i gheartbeat_tick =\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2202 /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
2203 /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
2204 /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
2205 /set heartbeat_cnt=0%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2206 /gstatus_update
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2207
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2208
1458
9c71601f608a Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 1454
diff changeset
2209 /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
2210 /let _hbtime=$[time()]%;\
1458
9c71601f608a Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 1454
diff changeset
2211 /if ({1}=~"real")\
1214
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2212 /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
2213 /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
2214 /set heartbeat_last=%{_hbtime}%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2215 /let _hbdelta=$[_hbtime - _hblast]%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2216 /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
2217 /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
2218 /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
2219 /endif%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2220 /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
2221 /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
2222 /gstatus_update%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2223 /else \
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2224 /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
2225 /set heartbeat_last=%{_hbtime}%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2226 /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
2227 /if (ghbjitter(_hbdelta))\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2228 /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
2229 /gstatus_update%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2230 /endif%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2231 /endif
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2232
1498
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2233
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2234 /def -i gheartbeat_subtick =\
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2235 /gstatus_update%;\
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2236 /set heartbeat_subtick=$[heartbeat_subtick + 1]
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2237
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2238
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2239 /def -i -ag -msimple -t"Dunk dunk" gheartbeat_dunk =\
1458
9c71601f608a Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 1454
diff changeset
2240 /gheartbeat_do real%;\
1498
918e27cee2c8 Heartbeat subticks.
Matti Hamalainen <ccr@tnsp.org>
parents: 1496
diff changeset
2241 /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
2242 /set heartbeat_pid=$(/grepeat -n -1 3 /gheartbeat_subtick)
1458
9c71601f608a Change stethoscope handling logic.
Matti Hamalainen <ccr@tnsp.org>
parents: 1454
diff changeset
2243
1214
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2244
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2245 /def -i gheartbeat_sc =\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2246 /if (heartbeat_discard)\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2247 /set heartbeat_discard=0%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2248 /return%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2249 /endif%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2250 /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
2251 /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
2252 /gheartbeat_tick NORMAL%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2253 /endif
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2254
1491
b62b0cebe23c Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 1484
diff changeset
2255
1214
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2256 ;; Detect certain events that cause potentially "false" ticks to occur.
1429
1589b7d32b9a Vampiric blow.
Matti Hamalainen <ccr@tnsp.org>
parents: 1426
diff changeset
2257 ;; Of course, sometimes these also contain the real tick, but can't help that.
1589b7d32b9a Vampiric blow.
Matti Hamalainen <ccr@tnsp.org>
parents: 1426
diff changeset
2258 /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
2259 /set heartbeat_discard=1%;\
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2260 /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
2261
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2262
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
2263 /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
2264 /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
2265 /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
2266 /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
2267 /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
2268 /set heartbeat_timer=1
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2269
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2270
287ae10f7137 v0.6.14.0-svn - Added heartbeat code into core.
Matti Hamalainen <ccr@tnsp.org>
parents: 1213
diff changeset
2271 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2272 ;; Consider reporting
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2273 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2274 /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
2275 /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
2276
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2277 /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
2278 /set cons_exp=%{P1}
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2279
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2280 /def -i gdefconspr =\
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2281 /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
2282 /set cons_pr=%{3}
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2283
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2284 /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
2285 /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
2286 /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
2287 /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
2288 /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
2289
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2290 /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
2291 /if (cons_st) \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2292 /let cons_val=%{P1}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2293 /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
2294 /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
2295 /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
2296 /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
2297 /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
2298 /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
2299 /else /set cons_opp=%{cons_val}%;/endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2300 /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
2301 /if (cons_opp!~"")\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2302 /if (_ctmps!~"")\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2303 /let _ctmps=%{_ctmps}, %{cons_opp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2304 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2305 /let _ctmps=%{cons_opp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2306 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2307 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2308 /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
2309 /msr [$[substr(cons_name,0,15)]]: %{_ctmps}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2310 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2311 /set cons_st=0
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2312
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2313
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2314 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2315 ;; Combat damage analysis
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2316 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2317 /def -i gcda_report =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2318 /if (opt_rcda=~"on")\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2319 /msr [%{1}]: %{2}%% resist against %{3}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2320 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2321 /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
2322 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2323
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2324 /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
2325 /test gcda_report({P1},0,{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2326
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2327 /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
2328 /test gcda_report({P1},20,{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2329
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2330 /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
2331 /test gcda_report({P1},40,{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2332
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2333 /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
2334 /test gcda_report({P1},60,{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2335
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2336 /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
2337 /test gcda_report({P1},80,{P2})
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 /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
2340 /test gcda_report({P1},100,{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2341
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2344 ;; Some special hilites and miscellaneous
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2345 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2346 /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
2347
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2348 ;; 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
2349 /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
2350 /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
2351
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2352 /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
2353 /msr I have a rapeprot!
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2354
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2355 ;; 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
2356 /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
2357 /if ({P5} <= status_exp)\
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2358 /if ({P2} < {P3})\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2359 /let _tcs=Cgreen%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2360 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2361 /let _tcs=Cyellow%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2362 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2363 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2364 /let _tcs=n%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2365 /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
2366 /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
2367
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2368
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2369 ;; Ambush
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2370 /set ambush_t=0
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2371 /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
2372 /if (time()-ambush_t > 5)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2373 /set ambush_t=$[time()]%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2374 /msm AMBUSHED!%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2375 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2376
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2377 ;; Gained percentage in skill
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2378 /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
2379 /mse improved in %{P1}
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2380
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2381 ;; Floating disc
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2382 /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
2383 /msm Disc falling!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2384
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2385 /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
2386 /msm Disc reloaded.
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2387
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2388 ;; Party leadership
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2389 /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
2390 @@party forcefollow all%;/msm Leading!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2391
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2392 ;; Poison removed
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2393 /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
2394 /msm Poison removed!
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 ;; Uncon
1577
d4a5eb505126 Adjust some regexps.
Matti Hamalainen <ccr@tnsp.org>
parents: 1576
diff changeset
2397 /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
2398 /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
2399 /msm %{P1} is UNCON!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2400
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 ;; Warn about changes in party formation
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2403 /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
2404 /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
2405 /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
2406
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2407
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2408 ;; Multicolored Demons (event)
1576
e089911ccd06 More MCdemons event messages.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
2409 /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
2410 /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
2411
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2412 ;; Robin Hood
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2413 ; 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
2414 /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
2415 /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
2416
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2417
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2418 ;; Warn about invis tells and emotes
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
2419 /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
2420 /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
2421 /gwarning You are using 'tell' 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
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
2424 /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
2425 /if (opt_rmisc=~"on" & prot_invis > 0)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2426 /gwarning You are using 'emote' while INVISIBLE!%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2427 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2428
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2429 ;; Etc
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2430 /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
2431
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2432 /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
2433 /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
2434 /msm NOTICE! %{P1} got damaged! (%{P2})
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2435
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2436 ;; Resist curses and drains
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2437 /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
2438 /msm Resisted %{P2}!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2439
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2440 /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
2441 /msm Resisted curse! (with NR)
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2442
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2443 ;; Resist poison
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2444 /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
2445 /msm Saved against poison!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2446
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2447 ;; Psi scanning warnings
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2448 /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
2449 /gwarning @{BCwhite}Mental Glance@{n} detected!
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 ;; All-seeing eye
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2452 /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
2453 /gwarning @{BCwhite}All-seeing eye@{n} detected!
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2454
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 ;; Breaking equipment
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2457 /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
2458 /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
2459 /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
2460
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2461
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2462 ;; Banishment
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2463 /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
2464 /set mbanish_st=1
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2465
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2466 /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
2467 /msr Got banished!%;/set mbanish_st=0
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2468
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2469
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2471 ;; Helper for money purse
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2472 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2473 /def -i gpurse_add =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2474 /if (regmatch(strcat("([0-9]+) ",{1}),gpursec_match))\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2475 /set gpursec_total=$[gpursec_total + ({P1} * {2})]%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2476 /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
2477 /if (gpursec_str!~"")\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2478 /set gpursec_str=%{gpursec_str}, %{mptmp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2479 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2480 /set gpursec_str=%{mptmp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2481 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2482 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2483
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2484 /def -i gpurse_report =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2485 /set gpursec_str=%;/set gpursec_total=0%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2486 /test gpurse_add("mithril", 500, "BCgreen")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2487 /test gpurse_add("batium", 100, "Cgreen")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2488 /test gpurse_add("anipium", 50, "BCyellow")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2489 /test gpurse_add("platinum", 10, "Cyellow")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2490 /test gpurse_add("gold", 1, "Cwhite")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2491 /test gpurse_add("silver", 0.6, "BCcyan")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2492 /test gpurse_add("bronze", 0.4, "Ccyan")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2493 /test gpurse_add("copper", 0.2, "BCmagenta")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2494 /test gpurse_add("tin", 0.1, "Cmagenta")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2495 /test gpurse_add("zinc", 0.05, "Cred")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2496 /test gpurse_add("mowgles", 0.01, "BCred")%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2497 /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
2498
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2499 /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
2500 /set gpursec_match=%{P1}%;/gpurse_report
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2501
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2502 /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
2503 /set gpursec_st=1%;/set gpursec_match=%{P1}
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2504
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2505 /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
2506 /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
2507
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2508
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2509 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
861
fb39f3a271d5 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 860
diff changeset
2510 ;; Alignment value mangler
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2511 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1461
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2512 /set galign_regex=
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2513 /def -i galign_clean =\
1474
389445f8e352 Fix a silly bug in 'score' alignment mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1473
diff changeset
2514 /return replace(" ","_",replace("'","_",replace("-","_",tolower({1}))))
1461
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2515
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2516 /def -i gdefalign =\
1461
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2517 /let _val=%{1}%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2518 /let _name=%{2}%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2519 /eval /set galign_$[galign_clean(_name)]=%{_val}%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2520 /if (galign_regex=~"")\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2521 /set galign_regex=%{_name}%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2522 /else \
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2523 /set galign_regex=%{galign_regex}|%{_name}%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2524 /endif
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2525
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2526 /test gdefalign(-7, "Draen-Dalar's love child")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2527 /test gdefalign(-6, "nefariously evil to the core")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2528 /test gdefalign(-5, "morally bankrupt")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2529 /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
2530 /test gdefalign(-3, "a malevolent fiend")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2531 /test gdefalign(-2, "a spiteful bastard")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2532 /test gdefalign(-1, "an unwholesome rogue")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2533 /test gdefalign( 0, "neutral")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2534 /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
2535 /test gdefalign( 2, "a beneficent being")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2536 /test gdefalign( 3, "irreproachably kind")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2537 /test gdefalign( 4, "pure at heart")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2538 /test gdefalign( 5, "a blessing to the world")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2539 /test gdefalign( 6, "Aveallis's gift to mankind")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2540 /test gdefalign( 7, "an angel in disguise")
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2541
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2542
1461
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2543 /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
2544 /let _name=$$[strcat("galign_",galign_clean({P1}))]%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2545 /let _val=$$[prgetval(_name)]%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2546 /if (_val < -4) /let _col=BCred%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2547 /elseif (_val < 0) /let _col=Cred%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2548 /elseif (_val > 4) /let _col=BCgreen%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2549 /elseif (_val > 0) /let _col=Cgreen%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2550 /else /let _col=Cwhite%%;/endif%%;\
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2551 /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
2552
74dc5e2cfb64 Recode 'score' alignment value mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1458
diff changeset
2553
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2554 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2555 ;; Camping / lullaby / etc.
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 (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
2558 /set camp_st=1%;\
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 /msr Can camp again
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2561
1505
9cfb7af9568e Implement support for lounging in the camp status handling. Closes Mantis
Matti Hamalainen <ccr@tnsp.org>
parents: 1503
diff changeset
2562 /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
2563 /set camp_st=2%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2564 /gstatus_update%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2565 /set camp_hp=%{status_hp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2566 /set camp_sp=%{status_sp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2567 /set camp_ep=%{status_ep}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2568 /set camp_time=$[time()]
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2569
1505
9cfb7af9568e Implement support for lounging in the camp status handling. Closes Mantis
Matti Hamalainen <ccr@tnsp.org>
parents: 1503
diff changeset
2570 /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
2571 /if (camp_st == 2)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2572 /set camp_st=0%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2573 /gstatus_update%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2574 @@sc%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2575 /def -p1 -n1 -mregexp -t"^H:" gcamp_awake =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2576 /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
2577 /gmsg_empty_que%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2578 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2579
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2580 /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
2581 /if (camp_st == 2)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2582 /set camp_st=0%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2583 /gstatus_update%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2584 /msr Camping interrupted!%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2585 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2586
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2587
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2588 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2589 ;; Path compression
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2590 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2591 /def -i prcomptoken =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2592 /if ({1} > 1)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2593 /let _qa=%{1} %{2}%;\
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 /let _qa=%{2}%;\
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 /if (qtzst=~"")\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2598 /set qtzst=%{_qa}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2599 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2600 /set qtzst=%{qtzst};%{_qa}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2601 /endif
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2602
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2603 /def -i prcomppath =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2604 /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
2605 /while ({#})\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2606 /if ({1}=~_qp & _qc < 15)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2607 /let _qc=$[_qc+1]%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2608 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2609 /prcomptoken %{_qc} %{_qp}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2610 /let _qc=1%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2611 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2612 /let _qp=%{1}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2613 /shift%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2614 /done%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2615 /prcomptoken %{_qc} %{_qp}
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2616
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2617 /def -i prreversepath =\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2618 /set qtzst=%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2619 /while ({#})\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2620 /if ({1}=~"n") /let _qp=s%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2621 /elseif ({1}=~"s") /let _qp=n%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2622 /elseif ({1}=~"w") /let _qp=e%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2623 /elseif ({1}=~"e") /let _qp=w%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2624 /elseif ({1}=~"nw") /let _qp=se%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2625 /elseif ({1}=~"ne") /let _qp=sw%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2626 /elseif ({1}=~"sw") /let _qp=ne%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2627 /elseif ({1}=~"se") /let _qp=nw%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2628 /elseif ({1}=~"u") /let _qp=d%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2629 /elseif ({1}=~"d") /let _qp=u%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2630 /elseif ({1}=~"N") /let _qp=S%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2631 /elseif ({1}=~"S") /let _qp=N%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2632 /elseif ({1}=~"W") /let _qp=E%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2633 /elseif ({1}=~"E") /let _qp=W%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2634 /elseif ({1}=~"NW") /let _qp=SE%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2635 /elseif ({1}=~"NE") /let _qp=SW%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2636 /elseif ({1}=~"SW") /let _qp=NE%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2637 /elseif ({1}=~"SE") /let _qp=NW%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2638 /elseif ({1}=~"U") /let _qp=D%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2639 /elseif ({1}=~"D") /let _qp=U%;/endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2640 /set qtzst=%{_qp} %{qtzst}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2641 /shift%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2642 /done
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2643
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
2644 /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
2645 /def -i csavepath = /prcomppath %{path}%;/test send(strcat("@@", "command ", {1}, " ", qtzst))
1030
9c56ec511a70 Misc changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1023
diff changeset
2646 /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
2647
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2648
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2649 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2650 ;; Slots mangler
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2651 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2652 ;; 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
2653 ;; the bottom of the table?
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2654
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2655 /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
2656 /substitute -ag%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2657 /set slots_st=1%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2658 /set slots_ftotal=0%;\
960
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2659 /msw ,-------------------------.%;\
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2660 /msw | Free | Slot |%;\
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2661 /msw +-------+-----------------+
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2662
1249
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2663 /def -i gslots_output =\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2664 /let _tslot=%{1}%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2665 /let _titem=%{3}%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2666 /if ({2}=~"no") /let _tnum=0%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2667 /elseif ({2}=~"one") /let _tnum=1%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2668 /elseif ({2}=~"two") /let _tnum=2%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2669 /elseif ({2}=~"three") /let _tnum=3%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2670 /elseif ({2}=~"four") /let _tnum=4%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2671 /elseif ({2}=~"five") /let _tnum=5%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2672 /elseif ({2}=~"six") /let _tnum=6%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2673 /elseif ({2}=~"seven") /let _tnum=7%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2674 /elseif ({2}=~"eight") /let _tnum=8%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2675 /elseif ({2}=~"nine") /let _tnum=9%;\
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2676 /else /let _tnum=-1%;\
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2677 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2678 /if (_tnum < 0)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2679 /let _tcol=Cyellow%;/let _tnum=%{P1}%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2680 /elseif (_tnum > 0)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2681 /set slots_ftotal=$[slots_ftotal+_tnum]%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2682 /if (_tnum > 1)\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2683 /let _tcol=BCgreen%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2684 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2685 /let _tcol=Cgreen%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2686 /endif%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2687 /else \
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2688 /let _tcol=BCred%;\
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2689 /endif%;\
1249
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2690 /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
2691
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2692 /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
2693 /test gslots_output({P2},{P1},"")
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2694
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2695 /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
2696 /test gslots_output({P2},{P1},{P3})
f148b93e2ba8 Fix 'slots' mangler to support 'slots info' output.
Matti Hamalainen <ccr@tnsp.org>
parents: 1245
diff changeset
2697
1265
d1d7c9ecd971 Add functionality for disabling certain hardcoded lites.
Matti Hamalainen <ccr@tnsp.org>
parents: 1261
diff changeset
2698 /def -i -F -Eslots_st -p9999 -mregexp -t"^$" gslots_mangle4 =\
960
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2699 /set slots_st=0%;\
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2700 /msw +-------------------------+%;\
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2701 /msw | Total free: @{BCgreen}$[pad(slots_ftotal,-11)]@{n} |%;\
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2702 /msw `-------------------------'
db5f3bd8422d Improve slots mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 958
diff changeset
2703
858
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2704
5ba435e75dca Integrated GgrTF::Misc to main module.
Matti Hamalainen <ccr@tnsp.org>
parents: 856
diff changeset
2705 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
2706 ;; 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
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 ;; 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
2709 /set toy_sleeves_wait=1500
1437
f1fce8801fd9 Change sleeves max diff to 350.
Matti Hamalainen <ccr@tnsp.org>
parents: 1436
diff changeset
2710 /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
2711 /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
2712
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 /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
2714 /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
2715 /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
2716 /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
2717 /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
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 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
2720 /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
2721 /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
2722 /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
2723
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 /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
2725 /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
2726 /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
2727
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 /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
2729 /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
2730
1418
d445b130f921 'You feel balanced.' trigger does not need to be fallthrough.
Matti Hamalainen <ccr@tnsp.org>
parents: 1417
diff changeset
2731 /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
2732 /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
2733 /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
2734 /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
2735
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 /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
2737 /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
2738 /if (toy_sleeves_bal==1)\
1415
2839ed1a53ce Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1414
diff changeset
2739 /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
2740 /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
2741 /if (_left < toy_sleeves_wait)\
1415
2839ed1a53ce Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1414
diff changeset
2742 /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
2743 /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
2744 /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
2745 /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
2746 /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
2747
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 /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
2749 /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
2750 /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
2751 /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
2752 /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
2753 /else \
1415
2839ed1a53ce Cosmetic improvements in balance macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1414
diff changeset
2754 /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
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
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
2757 /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
2758 /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
2759 /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
2760 /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
2761 /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
2762 /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
2763 /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
2764 /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
2765 /else \
1463
66e4a4364801 Clarify some informational messages of Alexandra sleeve handling functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1462
diff changeset
2766 /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
2767 /endif
1413
0c36f09b074f Document /balance macro command.
Matti Hamalainen <ccr@tnsp.org>
parents: 1412
diff changeset
2768
0c36f09b074f Document /balance macro command.
Matti Hamalainen <ccr@tnsp.org>
parents: 1412
diff changeset
2769 ;;@command /balance
1432
b6d53451692e s/Alexia/Alexandra/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1431
diff changeset
2770 ;;@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
2771 /def -i balance =\
1403
5a95bb1e68bc Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents: 1402
diff changeset
2772 /if (toy_sleeves_on==1)\
5a95bb1e68bc Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents: 1402
diff changeset
2773 /send @@sc%;\
5a95bb1e68bc Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents: 1402
diff changeset
2774 /repeat -0.2 1 /gbalance_do%;\
5a95bb1e68bc Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents: 1402
diff changeset
2775 /else \
5a95bb1e68bc Check sleeve wear status in balance macro.
Matti Hamalainen <ccr@tnsp.org>
parents: 1402
diff changeset
2776 /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
2777 /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
2778
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
2779 ;;@command /chkbalance
1432
b6d53451692e s/Alexia/Alexandra/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1431
diff changeset
2780 ;;@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
2781 /def -i chkbalance =\
1436
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2782 /if (toy_sleeves_on==1)\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2783 /if (gbalance_timeleft()==0)\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2784 /return%;\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2785 /endif%;\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2786 /let _diff=$[status_hp - status_sp]%;\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2787 /if (_diff < toy_sleeves_diff & _diff > toy_sleeves_min)\
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2788 /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
2789 /else \
1463
66e4a4364801 Clarify some informational messages of Alexandra sleeve handling functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1462
diff changeset
2790 /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
2791 /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
2792 /else \
1436
1a8b35960f22 Improve /chkbalance command a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1434
diff changeset
2793 /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
2794 /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
2795
5cded81d0078 Add /chkbalance macro and 'cbalance' binding for only checking of balance would be doable.
Matti Hamalainen <ccr@tnsp.org>
parents: 1413
diff changeset
2796
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
2797 /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
2798 /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
2799
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
2800 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
2801 ;; 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
2802 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
921
5b810625fb3d Change how initialization is ran.
Matti Hamalainen <ccr@tnsp.org>
parents: 920
diff changeset
2803 /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
2804 /greset%;\
550
206714c16bf2 Improved /stats panel.
Matti Hamalainen <ccr@tnsp.org>
parents: 547
diff changeset
2805 /ginitialize%;\
921
5b810625fb3d Change how initialization is ran.
Matti Hamalainen <ccr@tnsp.org>
parents: 920
diff changeset
2806 /set 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
2807 /endif