summaryrefslogtreecommitdiff
path: root/world/map/conf/magic-debug.sex
blob: 3cefd3b981014c2bcf6f573539c14c16ff43a30e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
"--------------------------------------------------------------------------------"
"Debug keywords"
"--------------------------------------------------------------------------------"
(SPELL () debug "debug" ()
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (message caster
                (+
                    (+
                        (+
                            (+
                                (+
                                    (+
                                        (+
                                            (+
                                                (+
                                                    (+
                                                        (+
                                                            (+
                                                                (+
                                                                    (+
                                                                        (+
                                                                            (+
                                                                                (+
                                                                                    (+
                                                                                        (+
                                                                                            (+
                                                                                                (+
                                                                                                    (+
                                                                                                        (+
                                                                                                            (+
                                                                                                                (+
                                                                                                                    (+
                                                                                                                        (+
                                                                                                                            (+
                                                                                                                                (+
                                                                                                                                    (+
                                                                                                                                        (+
                                                                                                                                            (+
                                                                                                                                                (+
                                                                                                                                                    (+
                                                                                                                                                        (+
                                                                                                                                                            (+
                                                                                                                                                                (+
                                                                                                                                                                    (+
                                                                                                                                                                        (+
                                                                                                                                                                            (+
                                                                                                                                                                                (+
                                                                                                                                                                                    (+
                                                                                                                                                                                        (+
                                                                                                                                                                                            (+
                                                                                                                                                                                                (+
                                                                                                                                                                                                    (+
                                                                                                                                                                                                        (+ "FLAGS: " "drank=")
                                                                                                                                                                                                        (>
                                                                                                                                                                                                            (&
                                                                                                                                                                                                                (script_int caster "MAGIC_FLAGS")
                                                                                                                                                                                                                1)
                                                                                                                                                                                                            0))
                                                                                                                                                                                                    ", ")
                                                                                                                                                                                                "Kmseed=")
                                                                                                                                                                                            (>
                                                                                                                                                                                                (&
                                                                                                                                                                                                    (script_int caster "MAGIC_FLAGS")
                                                                                                                                                                                                    2)
                                                                                                                                                                                                0))
                                                                                                                                                                                        ", ")
                                                                                                                                                                                    "touched-mseed=")
                                                                                                                                                                                (>
                                                                                                                                                                                    (&
                                                                                                                                                                                        (script_int caster "MAGIC_FLAGS")
                                                                                                                                                                                        4)
                                                                                                                                                                                    0))
                                                                                                                                                                            ", ")
                                                                                                                                                                        "mseed-max=")
                                                                                                                                                                    (>
                                                                                                                                                                        (&
                                                                                                                                                                            (script_int caster "MAGIC_FLAGS")
                                                                                                                                                                            8)
                                                                                                                                                                        0))
                                                                                                                                                                ", ")
                                                                                                                                                            "Kauldsbel=")
                                                                                                                                                        (>
                                                                                                                                                            (&
                                                                                                                                                                (script_int caster "MAGIC_FLAGS")
                                                                                                                                                                16)
                                                                                                                                                            0))
                                                                                                                                                    ", ")
                                                                                                                                                "Kwyara=")
                                                                                                                                            (>
                                                                                                                                                (&
                                                                                                                                                    (script_int caster "MAGIC_FLAGS")
                                                                                                                                                    32)
                                                                                                                                                0))
                                                                                                                                        ", ")
                                                                                                                                    "Ksagatha=")
                                                                                                                                (>
                                                                                                                                    (&
                                                                                                                                        (script_int caster "MAGIC_FLAGS")
                                                                                                                                        64)
                                                                                                                                    0))
                                                                                                                            ", ")
                                                                                                                        "Kmpotion=")
                                                                                                                    (>
                                                                                                                        (&
                                                                                                                            (script_int caster "MAGIC_FLAGS")
                                                                                                                            128)
                                                                                                                        0))
                                                                                                                ", ")
                                                                                                            "mseed-rumour=")
                                                                                                        (>
                                                                                                            (&
                                                                                                                (script_int caster "MAGIC_FLAGS")
                                                                                                                256)
                                                                                                            0))
                                                                                                    ", ")
                                                                                                "Kcuttree=")
                                                                                            (>
                                                                                                (&
                                                                                                    (script_int caster "MAGIC_FLAGS")
                                                                                                    512)
                                                                                                0))
                                                                                        ", ")
                                                                                    "cut=")
                                                                                (>
                                                                                    (&
                                                                                        (script_int caster "MAGIC_FLAGS")
                                                                                        1024)
                                                                                    0))
                                                                            ", ")
                                                                        "Kdruidtree=")
                                                                    (>
                                                                        (&
                                                                            (script_int caster "MAGIC_FLAGS")
                                                                            2048)
                                                                        0))
                                                                ", ")
                                                            "Kimp=")
                                                        (>
                                                            (&
                                                                (script_int caster "MAGIC_FLAGS")
                                                                4096)
                                                            0))
                                                    ", ")
                                                "Koldwiz=")
                                            (>
                                                (&
                                                    (script_int caster "MAGIC_FLAGS")
                                                    8192)
                                                0))
                                        ", ")
                                    "made-conc=")
                                (>
                                    (&
                                        (script_int caster "MAGIC_FLAGS")
                                        16384)
                                    0))
                            ", ")
                        "elanore-omar=")
                    (>
                        (&
                            (script_int caster "MAGIC_FLAGS")
                            32768)
                        0)))
            (message caster
                (+
                    (+
                        (+
                            (+
                                (+ "EXP: "
                                    (&
                                        (script_int caster "MAGIC_EXPERIENCE")
                                        0xffff))
                                ", lastspell=")
                            (&
                                (>>
                                    (script_int caster "MAGIC_EXPERIENCE")
                                    16)
                                0xff))
                        ", healexp=")
                    (&
                        (>>
                            (script_int caster "MAGIC_EXPERIENCE")
                            24)
                        0xff)))
            (message caster
                (+
                    (+
                        (+
                            (+
                                (+
                                    (+
                                        (+
                                            (+
                                                (+
                                                    (+
                                                        (+
                                                            (+
                                                                (+
                                                                    (+
                                                                        (+
                                                                            (+
                                                                                (+
                                                                                    (+
                                                                                        (+
                                                                                            (+
                                                                                                (+
                                                                                                    (+
                                                                                                        (+
                                                                                                            (+
                                                                                                                (+
                                                                                                                    (+
                                                                                                                        (+
                                                                                                                            (+ "STATUS: " "auldsbel:")
                                                                                                                            (&
                                                                                                                                (script_int caster "QUEST_MAGIC")
                                                                                                                                0x1f))
                                                                                                                        ",")
                                                                                                                    (&
                                                                                                                        (>>
                                                                                                                            (script_int caster "QUEST_MAGIC")
                                                                                                                            5)
                                                                                                                        0x7))
                                                                                                                ", ")
                                                                                                            "dt/mb:")
                                                                                                        (&
                                                                                                            (>>
                                                                                                                (script_int caster "QUEST_MAGIC")
                                                                                                                8)
                                                                                                            0xf))
                                                                                                    ", ")
                                                                                                "s-unhappy:")
                                                                                            (&
                                                                                                (>>
                                                                                                    (script_int caster "QUEST_MAGIC")
                                                                                                    12)
                                                                                                0xf))
                                                                                        ", ")
                                                                                    "sagatha:")
                                                                                (&
                                                                                    (>>
                                                                                        (script_int caster "QUEST_MAGIC")
                                                                                        16)
                                                                                    0xff))
                                                                            ", ")
                                                                        "swords:")
                                                                    (&
                                                                        (>>
                                                                            (script_int caster "QUEST_MAGIC")
                                                                            24)
                                                                        0xff))
                                                                ", ")
                                                            "imp:")
                                                        (&
                                                            (>>
                                                                (script_int caster "QUEST_MAGIC2")
                                                                0)
                                                            0xf))
                                                    ", ")
                                                "elanore:")
                                            (&
                                                (>>
                                                    (script_int caster "QUEST_MAGIC2")
                                                    4)
                                                0xf))
                                        ", ")
                                    "elanore-sub:")
                                (&
                                    (>>
                                        (script_int caster "QUEST_MAGIC2")
                                        12)
                                    0xf))
                            ", ")
                        "wyara:")
                    (&
                        (>>
                            (script_int caster "QUEST_MAGIC2")
                            8)
                        0xf))))))
(PROCEDURE debug_xmod (name mask shift gain)
    (SET value
        (+
            (&
                (>>
                    (script_int caster name)
                    shift)
                mask)
            gain))
    (IF (< value 0)
        (SET value 0))
    (IF (> value mask)
        (SET value mask))
    (CALL set_var name mask shift value))
(PROCEDURE debug_mod (name delta)
    (IF (== name "mexp")
        (CALL debug_xmod "MAGIC_EXPERIENCE" 0xffff 0 delta)
        (IF (== name "lastspell")
            (CALL debug_xmod "MAGIC_EXPERIENCE" 0xff 16 delta)
            (IF (== name "healexp")
                (CALL debug_xmod "MAGIC_EXPERIENCE" 0xff 24 delta)
                (IF (== name "drank")
                    (CALL debug_xmod "MAGIC_FLAGS" 0x1 0 delta)
                    (IF (== name "Kmseed")
                        (CALL debug_xmod "MAGIC_FLAGS" 0x1 1 delta)
                        (IF (== name "touched-mseed")
                            (CALL debug_xmod "MAGIC_FLAGS" 0x1 2 delta)
                            (IF (== name "mseed-max")
                                (CALL debug_xmod "MAGIC_FLAGS" 0x1 3 delta)
                                (IF (== name "Kauldsbel")
                                    (CALL debug_xmod "MAGIC_FLAGS" 0x1 4 delta)
                                    (IF (== name "Kwyara")
                                        (CALL debug_xmod "MAGIC_FLAGS" 0x1 5 delta)
                                        (IF (== name "Ksagatha")
                                            (CALL debug_xmod "MAGIC_FLAGS" 0x1 6 delta)
                                            (IF (== name "Kmpotion")
                                                (CALL debug_xmod "MAGIC_FLAGS" 0x1 7 delta)
                                                (IF (== name "mseed-rumour")
                                                    (CALL debug_xmod "MAGIC_FLAGS" 0x1 8 delta)
                                                    (IF (== name "Kcuttree")
                                                        (CALL debug_xmod "MAGIC_FLAGS" 0x1 9 delta)
                                                        (IF (== name "cut")
                                                            (CALL debug_xmod "MAGIC_FLAGS" 0x1 10 delta)
                                                            (IF (== name "Kdruidtree")
                                                                (CALL debug_xmod "MAGIC_FLAGS" 0x1 11 delta)
                                                                (IF (== name "Kimp")
                                                                    (CALL debug_xmod "MAGIC_FLAGS" 0x1 12 delta)
                                                                    (IF (== name "oldwiz")
                                                                        (CALL debug_xmod "MAGIC_FLAGS" 0x1 13 delta)
                                                                        (IF (== name "made-conc")
                                                                            (CALL debug_xmod "MAGIC_FLAGS" 0x1 14 delta)
                                                                            (IF (== name "elanore-omar")
                                                                                (CALL debug_xmod "MAGIC_FLAGS" 0x1 15 delta)
                                                                                (IF (== name "auldsbel")
                                                                                    (CALL debug_xmod "QUEST_MAGIC" 0x1f 0 delta)
                                                                                    (IF (== name "Qauldsbel")
                                                                                        (CALL debug_xmod "QUEST_MAGIC" 0x7 5 delta)
                                                                                        (IF (== name "dt")
                                                                                            (CALL debug_xmod "QUEST_MAGIC" 0x3 10 delta)
                                                                                            (IF (== name "mb")
                                                                                                (CALL debug_xmod "QUEST_MAGIC" 0x3 8 delta)
                                                                                                (IF (== name "s-unhappy")
                                                                                                    (CALL debug_xmod "QUEST_MAGIC" 0xff 12 delta)
                                                                                                    (IF (== name "sagatha")
                                                                                                        (CALL debug_xmod "QUEST_MAGIC" 0xff 16 delta)
                                                                                                        (IF (== name "swords")
                                                                                                            (CALL debug_xmod "QUEST_MAGIC" 0xff 24 delta)
                                                                                                            (IF (== name "imp")
                                                                                                                (CALL debug_xmod "QUEST_MAGIC2" 0xf 0 delta)
                                                                                                                (IF (== name "elanore")
                                                                                                                    (CALL debug_xmod "QUEST_MAGIC2" 0xf 4 delta)
                                                                                                                    (IF (== name "wyara")
                                                                                                                        (CALL debug_xmod "QUEST_MAGIC2" 0xf 8 delta)
                                                                                                                        (IF (== name "elanore-sub")
                                                                                                                            (CALL debug_xmod "QUEST_MAGIC2" 0xf 12 delta)
                                                                                                                            (message caster "Unknown"))))))))))))))))))))))))))))))))

(SPELL () debug-up1 "debug+1" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (CALL debug_mod name 1))))

(SPELL () debug-down1 "debug-1" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (CALL debug_mod name
                (- 0 1)))))

(SPELL () debug-up16 "debug+16" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (CALL debug_mod name 16))))

(SPELL () debug-down16 "debug-16" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (CALL debug_mod name
                (- 0 16)))))

(SPELL () debug-up256 "debug+256" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT

            (CALL debug_mod name 256))))
(SPELL () debug-down256 "debug-256" (STRING name)
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (CALL debug_mod name
                (- 0 256)))))

(SPELL () debug-reset "debug-reset" ()
    (=>
        (REQUIRE DEBUG)
        (EFFECT
            (set_script_variable caster "QUEST_MAGIC"
                0)
            (set_script_variable caster "QUEST_MAGIC2"
                0)
            (set_script_variable caster "MAGIC_FLAGS"
                0)
            (set_script_variable caster "MAGIC_EXP"
                0))))