Angband
unit-test-data.h
Go to the documentation of this file.
1 /* unit-test-data.h
2  * Predefined data for tests
3  */
4 
5 #ifndef UNIT_TEST_DATA
6 #define UNIT_TEST_DATA
7 
8 #ifndef TEST_DATA
9  #ifdef __GNUC__
10  #define TEST_DATA __attribute__ ((unused))
11  #else
12  #define TEST_DATA
13  #endif
14 #endif /* TEST_DATA */
15 
16 #include "angband.h"
17 #include "init.h"
18 #include "mon-lore.h"
19 #include "monster.h"
20 #include "obj-tval.h"
21 #include "player.h"
22 #include "player-calcs.h"
23 #include "project.h"
24 
25 /* 30 = TMD_MAX */
26 static s16b TEST_DATA test_timed[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
27 };
28 
29 static struct object_base TEST_DATA sword_base = {
30  .name = "Test Sword",
31  .tval = TV_SWORD,
32  .next = NULL,
33  .break_perc = 50,
34 };
35 
36 static struct object_base TEST_DATA light_base = {
37  .name = "Test Light~",
38  .tval = TV_LIGHT,
39  .next = NULL,
40  .break_perc = 50,
41 };
42 
43 static struct object_base TEST_DATA flask_base = {
44  .name = "Test Flask~",
45  .tval = TV_FLASK,
46  .next = NULL,
47  .break_perc = 100,
48 };
49 
50 static struct object_base TEST_DATA rod_base = {
51  .name = "Test Rod~",
52  .tval = TV_ROD,
53  .next = NULL,
54 };
55 
57  .name = "Test Artifact",
58  .text = "A test artifact.",
59  .aidx = 0,
60  .next = NULL,
61  .tval = TV_SWORD,
62  .sval = 8, //Hack - depends on edit file order - Long Sword (NRM)
63  .to_a = 1,
64  .to_h = 2,
65  .to_d = 3,
66  .ac = 5,
67  .dd = 2,
68  .ds = 5,
69  .weight = 16,
70  .cost = 40,
71 };
72 
74  .name = "Test Longsword",
75  .text = "A test longsword [0].",
76  .base = &sword_base,
77  .kidx = 0,
78  .tval = TV_SWORD,
79  .sval = 8, //Hack - depends on edit file order - Long Sword (NRM)
80  .pval = {
81  .base = 0,
82  .dice = 0,
83  .sides = 0,
84  .m_bonus = 0,
85  },
86  .modifiers = {
87  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
88  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
89  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
90  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
91  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
92  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
93  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
94  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
95  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
96  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
97  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
98  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
99  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
100  [OBJ_MOD_LIGHT] = { 0, 0, 0, 0 },
101  },
102  .to_h = {
103  .base = 1,
104  .dice = 0,
105  .sides = 0,
106  .m_bonus = 0,
107  },
108  .to_d = {
109  .base = 1,
110  .dice = 0,
111  .sides = 0,
112  .m_bonus = 0,
113  },
114  .to_a = {
115  .base = 2,
116  .dice = 0,
117  .sides = 0,
118  .m_bonus = 0,
119  },
120 
121  .dd = 4,
122  .ds = 6,
123  .weight = 16,
124 
125  .cost = 20,
126 
127  .d_attr = 0,
128  .d_char = L'|',
129 
130  .alloc_prob = 20,
131  .alloc_min = 1,
132  .alloc_max = 10,
133  .level = 0,
134 
135  .effect = NULL,
136 
137  .gen_mult_prob = 0,
138  .flavor = NULL,
139 };
140 
142  .name = "Test Torch",
143  .text = "A test torch [1].",
144  .base = &light_base,
145  .next = NULL,
146  .kidx = 2,
147  .tval = TV_LIGHT,
148  .sval = 1, //Hack - depends on edit file order - Wooden Torch (NRM)
149  .pval = {
150  .base = 5000,
151  .dice = 0,
152  .sides = 0,
153  .m_bonus = 0,
154  },
155 
156  .to_h = {
157  .base = 0,
158  .dice = 0,
159  .sides = 0,
160  .m_bonus = 0,
161  },
162  .to_d = {
163  .base = 0,
164  .dice = 0,
165  .sides = 0,
166  .m_bonus = 0,
167  },
168  .to_a = {
169  .base = 0,
170  .dice = 0,
171  .sides = 0,
172  .m_bonus = 0,
173  },
174  .ac = 0,
175 
176  .dd = 1,
177  .ds = 1,
178  .weight = 22,
179 
180  .cost = 1,
181 
182  .flags = { 0, 0, 4, 0 },
183  .kind_flags = { 32, 0 },
184 
185  .modifiers = {
186  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
187  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
188  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
189  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
190  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
191  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
192  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
193  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
194  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
195  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
196  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
197  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
198  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
199  [OBJ_MOD_LIGHT] = { 1, 0, 0, 0 },
200  },
201  .el_info = {
202  [ELEM_ACID] = { 0, 0 },
203  [ELEM_ELEC] = { 0, 0 },
204  [ELEM_FIRE] = { 0, 0 },
205  [ELEM_COLD] = { 0, 0 },
206  [ELEM_POIS] = { 0, 0 },
207  [ELEM_LIGHT] = { 0, 0 },
208  [ELEM_DARK] = { 0, 0 },
209  [ELEM_SOUND] = { 0, 0 },
210  [ELEM_SHARD] = { 0, 0 },
211  [ELEM_NEXUS] = { 0, 0 },
212  [ELEM_NETHER] = { 0, 0 },
213  [ELEM_CHAOS] = { 0, 0 },
214  [ELEM_DISEN] = { 0, 0 },
215  [ELEM_WATER] = { 0, 0 },
216  [ELEM_ICE] = { 0, 0 },
217  [ELEM_GRAVITY] = { 0, 0 },
218  [ELEM_INERTIA] = { 0, 0 },
219  [ELEM_FORCE] = { 0, 0 },
220  [ELEM_TIME] = { 0, 0 },
221  [ELEM_PLASMA] = { 0, 0 },
222  [ELEM_METEOR] = { 0, 0 },
223  [ELEM_MISSILE] = { 0, 0 },
224  [ELEM_MANA] = { 0, 0 },
225  [ELEM_HOLY_ORB] = { 0, 0 },
226  [ELEM_ARROW] = { 0, 0 },
227  },
228 
229  .brands = NULL,
230  .slays = NULL,
231 
232  .d_attr = 7,
233  .d_char = L'~',
234 
235  .alloc_prob = 70,
236  .alloc_min = 1,
237  .alloc_max = 40,
238  .level = 1,
239 
240  .effect = NULL,
241  .power = 0,
242  .effect_msg = NULL,
243  .time = {
244  .base = 0,
245  .dice = 0,
246  .sides = 0,
247  .m_bonus = 0,
248  },
249  .charge = {
250  .base = 0,
251  .dice = 0,
252  .sides = 0,
253  .m_bonus = 0,
254  },
255 
256  .gen_mult_prob = 0,
257  .stack_size = {
258  .base = 0,
259  .dice = 0,
260  .sides = 0,
261  .m_bonus = 0,
262  },
263  .flavor = NULL,
264 };
265 
267  .name = "Test Lantern",
268  .text = "A test lantern.",
269  .base = &light_base,
270  .next = NULL,
271  .kidx = 3,
272  .tval = TV_LIGHT,
273  .sval = 2, //Hack - depends on edit file order - Lantern (NRM)
274  .pval = {
275  .base = 5000,
276  .dice = 0,
277  .sides = 0,
278  .m_bonus = 0,
279  },
280 
281  .to_h = {
282  .base = 0,
283  .dice = 0,
284  .sides = 0,
285  .m_bonus = 0,
286  },
287  .to_d = {
288  .base = 0,
289  .dice = 0,
290  .sides = 0,
291  .m_bonus = 0,
292  },
293  .to_a = {
294  .base = 0,
295  .dice = 0,
296  .sides = 0,
297  .m_bonus = 0,
298  },
299  .ac = 0,
300 
301  .dd = 1,
302  .ds = 1,
303  .weight = 50,
304 
305  .cost = 1,
306 
307  .flags = { 0, 0, 8, 0 }, /* OF_TAKES_FUEL */
308  .kind_flags = { 32, 0 },
309 
310  .modifiers = {
311  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
312  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
313  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
314  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
315  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
316  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
317  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
318  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
319  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
320  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
321  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
322  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
323  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
324  [OBJ_MOD_LIGHT] = { 2, 0, 0, 0 },
325  },
326  .el_info = {
327  [ELEM_ACID] = { 0, 0 },
328  [ELEM_ELEC] = { 0, 0 },
329  [ELEM_FIRE] = { 0, 4 },
330  [ELEM_COLD] = { 0, 0 },
331  [ELEM_POIS] = { 0, 0 },
332  [ELEM_LIGHT] = { 0, 0 },
333  [ELEM_DARK] = { 0, 0 },
334  [ELEM_SOUND] = { 0, 0 },
335  [ELEM_SHARD] = { 0, 0 },
336  [ELEM_NEXUS] = { 0, 0 },
337  [ELEM_NETHER] = { 0, 0 },
338  [ELEM_CHAOS] = { 0, 0 },
339  [ELEM_DISEN] = { 0, 0 },
340  [ELEM_WATER] = { 0, 0 },
341  [ELEM_ICE] = { 0, 0 },
342  [ELEM_GRAVITY] = { 0, 0 },
343  [ELEM_INERTIA] = { 0, 0 },
344  [ELEM_FORCE] = { 0, 0 },
345  [ELEM_TIME] = { 0, 0 },
346  [ELEM_PLASMA] = { 0, 0 },
347  [ELEM_METEOR] = { 0, 0 },
348  [ELEM_MISSILE] = { 0, 0 },
349  [ELEM_MANA] = { 0, 0 },
350  [ELEM_HOLY_ORB] = { 0, 0 },
351  [ELEM_ARROW] = { 0, 0 },
352  },
353 
354  .brands = NULL,
355  .slays = NULL,
356 
357  .d_attr = 0,
358  .d_char = L'~',
359 
360  .alloc_prob = 10,
361  .alloc_min = 1,
362  .alloc_max = 10,
363  .level = 0,
364 
365  .effect = NULL,
366  .power = 0,
367  .effect_msg = NULL,
368  .time = {
369  .base = 0,
370  .dice = 0,
371  .sides = 0,
372  .m_bonus = 0,
373  },
374  .charge = {
375  .base = 0,
376  .dice = 0,
377  .sides = 0,
378  .m_bonus = 0,
379  },
380 
381  .gen_mult_prob = 0,
382  .stack_size = {
383  .base = 0,
384  .dice = 0,
385  .sides = 0,
386  .m_bonus = 0,
387  },
388  .flavor = NULL,
389 };
390 
392  .name = "Test Flask",
393  .text = "A test flask.",
394  .base = &flask_base,
395  .kidx = 1,
396  .tval = TV_FLASK,
397  .sval = 0,
398  .pval = {
399  .base = 7500,
400  .dice = 0,
401  .sides = 0,
402  .m_bonus = 0,
403  },
404 
405  .modifiers = {
406  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
407  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
408  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
409  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
410  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
411  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
412  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
413  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
414  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
415  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
416  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
417  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
418  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
419  [OBJ_MOD_LIGHT] = { 0, 0, 0, 0 },
420  },
421  .to_h = {
422  .base = 0,
423  .dice = 0,
424  .sides = 0,
425  .m_bonus = 0,
426  },
427  .to_d = {
428  .base = 0,
429  .dice = 0,
430  .sides = 0,
431  .m_bonus = 0,
432  },
433  .to_a = {
434  .base = 0,
435  .dice = 0,
436  .sides = 0,
437  .m_bonus = 0,
438  },
439 
440  .dd = 1,
441  .ds = 4,
442  .weight = 20,
443 
444  .cost = 3,
445 
446  .d_attr = 11,
447  .d_char = L'!',
448 
449  .alloc_prob = 50,
450  .alloc_min = 1,
451  .alloc_max = 100,
452  .level = 1,
453 
454  .effect = NULL,
455 
456  .gen_mult_prob = 0,
457  .flavor = NULL,
458 };
459 
461  .name = "Test Rod of Treasure Location",
462  .text = "A test rod of treasure location.",
463  .base = &rod_base,
464  .kidx = 1,
465  .tval = TV_ROD,
466  .sval = 1,
467  .pval = {
468  .base = 0,
469  .dice = 0,
470  .sides = 0,
471  .m_bonus = 0,
472  },
473 
474  .modifiers = {
475  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
476  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
477  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
478  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
479  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
480  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
481  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
482  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
483  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
484  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
485  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
486  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
487  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
488  [OBJ_MOD_LIGHT] = { 0, 0, 0, 0 },
489  },
490  .to_h = {
491  .base = 0,
492  .dice = 0,
493  .sides = 0,
494  .m_bonus = 0,
495  },
496  .to_d = {
497  .base = 0,
498  .dice = 0,
499  .sides = 0,
500  .m_bonus = 0,
501  },
502  .to_a = {
503  .base = 0,
504  .dice = 0,
505  .sides = 0,
506  .m_bonus = 0,
507  },
508 
509  .dd = 0,
510  .ds = 0,
511  .weight = 15,
512 
513  .cost = 1000,
514 
515  .d_attr = 0,
516  .d_char = L'-',
517 
518  .alloc_prob = 30,
519  .alloc_min = 8,
520  .alloc_max = 75,
521  .level = 5,
522 
523  .effect = NULL,
524 
525  .gen_mult_prob = 0,
526  .flavor = NULL,
527 };
528 
529 static struct object_kind TEST_DATA test_gold = {
530  .name = "Test Gold",
531  .text = "Test gold [2].",
532  .kidx = 2,
533  .tval = TV_GOLD,
534  .sval = 0,
535  .pval = {
536  .base = 0,
537  .dice = 0,
538  .sides = 0,
539  .m_bonus = 0,
540  },
541 
542  .modifiers = {
543  [OBJ_MOD_STR] = { 0, 0, 0, 0 },
544  [OBJ_MOD_INT] = { 0, 0, 0, 0 },
545  [OBJ_MOD_WIS] = { 0, 0, 0, 0 },
546  [OBJ_MOD_DEX] = { 0, 0, 0, 0 },
547  [OBJ_MOD_CON] = { 0, 0, 0, 0 },
548  [OBJ_MOD_STEALTH] = { 0, 0, 0, 0 },
549  [OBJ_MOD_SEARCH] = { 0, 0, 0, 0 },
550  [OBJ_MOD_INFRA] = { 0, 0, 0, 0 },
551  [OBJ_MOD_TUNNEL] = { 0, 0, 0, 0 },
552  [OBJ_MOD_SPEED] = { 0, 0, 0, 0 },
553  [OBJ_MOD_BLOWS] = { 0, 0, 0, 0 },
554  [OBJ_MOD_SHOTS] = { 0, 0, 0, 0 },
555  [OBJ_MOD_MIGHT] = { 0, 0, 0, 0 },
556  [OBJ_MOD_LIGHT] = { 0, 0, 0, 0 },
557  },
558  .to_h = {
559  .base = 0,
560  .dice = 0,
561  .sides = 0,
562  .m_bonus = 0,
563  },
564  .to_d = {
565  .base = 0,
566  .dice = 0,
567  .sides = 0,
568  .m_bonus = 0,
569  },
570  .to_a = {
571  .base = 0,
572  .dice = 0,
573  .sides = 0,
574  .m_bonus = 0,
575  },
576 
577  .dd = 1,
578  .ds = 1,
579  .weight = 1,
580 
581  .cost = 0,
582 
583  .d_attr = 0,
584  .d_char = L'$',
585 
586  .alloc_prob = 0,
587  .alloc_min = 0,
588  .alloc_max = 0,
589  .level = 0,
590 
591  .effect = NULL,
592 
593  .gen_mult_prob = 0,
594  .flavor = NULL,
595 };
596 
597 static struct player_race TEST_DATA test_race = {
598  .name = "TestRace",
599  .r_adj = {
600  [STAT_STR] = +2,
601  [STAT_DEX] = +1,
602  [STAT_CON] = +3,
603  [STAT_INT] = -1,
604  [STAT_WIS] = -2,
605  },
606  .r_skills = {
607  [SKILL_DISARM_PHYS] = 0,
608  [SKILL_DISARM_MAGIC] = 0,
609  [SKILL_DEVICE] = 5,
610  [SKILL_SAVE] = 10,
611  [SKILL_STEALTH] = -5,
612  [SKILL_SEARCH] = -10,
613  [SKILL_TO_HIT_MELEE] = 0,
614  [SKILL_TO_HIT_BOW] = 0,
615  [SKILL_TO_HIT_THROW] = 0,
616  [SKILL_DIGGING] = 0,
617  },
618 
619  .r_mhp = 10,
620  .r_exp = 110,
621 
622  .b_age = 14,
623  .m_age = 6,
624 
625  .base_hgt = 72,
626  .mod_hgt = 6,
627  .base_wgt = 150,
628  .mod_wgt = 20,
629 
630  .infra = 40,
631 
632  .history = NULL,
633 };
634 
636  .kind = &test_torch,
637  .min = 3,
638  .max = 5,
639  .next = NULL,
640 };
641 
643  .kind = &test_longsword,
644  .min = 1,
645  .max = 1,
646  .next = &start_torch,
647 };
648 
649 static struct class_book TEST_DATA test_book = {
650  .tval = 10,
651  .sval = 4,
652  .realm = 1,
653  .num_spells = 8,
654  .spells = NULL,
655 };
656 
658  .next = NULL,
659  .name = "realm",
660  .stat = 1,
661  .verb = "spell_verb",
662  .spell_noun = "spell_noun",
663  .book_noun = "book_noun",
664 };
665 
667  .name = "TestClass",
668  .title = {
669  "TestTitle0",
670  "TestTitle1",
671  "TestTitle2",
672  "TestTitle3",
673  "TestTitle4",
674  "TestTitle5",
675  "TestTitle6",
676  "TestTitle7",
677  "TestTitle8",
678  "TestTitle9",
679  },
680 
681  .c_adj = {
682  [STAT_STR] = +1,
683  [STAT_DEX] = +2,
684  [STAT_CON] = -1,
685  [STAT_INT] = -2,
686  [STAT_WIS] = +3,
687  },
688 
689  .c_skills = {
690  [SKILL_DISARM_PHYS] = 25,
691  [SKILL_DISARM_MAGIC] = 25,
692  [SKILL_DEVICE] = 18,
693  [SKILL_SAVE] = 18,
694  [SKILL_STEALTH] = 1,
695  [SKILL_SEARCH] = 14,
696  [SKILL_TO_HIT_MELEE] = 70,
697  [SKILL_TO_HIT_BOW] = 55,
698  [SKILL_TO_HIT_THROW] = 55,
699  [SKILL_DIGGING] = 0,
700  },
701 
702  .x_skills = {
703  [SKILL_DISARM_PHYS] = 10,
704  [SKILL_DISARM_MAGIC] = 10,
705  [SKILL_DEVICE] = 7,
706  [SKILL_SAVE] = 10,
707  [SKILL_STEALTH] = 0,
708  [SKILL_SEARCH] = 0,
709  [SKILL_TO_HIT_MELEE] = 45,
710  [SKILL_TO_HIT_BOW] = 45,
711  [SKILL_TO_HIT_THROW] = 45,
712  [SKILL_DIGGING] = 0,
713  },
714 
715  .c_mhp = 9,
716  .c_exp = 0,
717 
718  .max_attacks = 6,
719  .min_weight = 30,
720  .att_multiply = 5,
721 
722  .sense_base = 7000,
723  .sense_div = 40,
724 
725  .start_items = &start_longsword,
726  .magic = {
727  .spell_first = 1,
728  .spell_weight = 300,
729  .spell_realm = &test_realm,
730  .num_books = 1,
731  .books = &test_book,
732  .total_spells = 8,
733  },
734 };
735 
737  .next = NULL,
738  .name = "townsfolk",
739  .text = "Townsfolk",
740  .flags = "\0\0\0\0\0\0\0\0\0\0",
741  .spell_flags = "\0\0\0\0\0\0\0\0\0\0\0",
742  .d_char = 116,
743  .pain = NULL,
744 
745 };
746 
748  .name = "HIT",
749  .cut = true,
750  .stun = true,
751  .miss = false,
752  .phys = false,
753  .msgt = 34,
754  .act_msg = "hits you",
755  .desc = "hit",
756  .next = NULL
757 };
758 
760  .name = "HURT",
761  .power = 40,
762  .eval = 0,
763  .desc = "attack",
764  .next = NULL
765 };
766 
768  .name = "POISON",
769  .power = 20,
770  .eval = 10,
771  .desc = "poison",
772  .next = NULL
773 };
774 
776  .name = "ACID",
777  .power = 20,
778  .eval = 20,
779  .desc = "shoot acid",
780  .next = NULL
781 };
782 
784  .name = "ELEC",
785  .power = 40,
786  .eval = 10,
787  .desc = "electrify",
788  .next = NULL
789 };
790 
792  .name = "FIRE",
793  .power = 40,
794  .eval = 10,
795  .desc = "burn",
796  .next = NULL
797 };
798 
800  .name = "COLD",
801  .power = 40,
802  .eval = 10,
803  .desc = "freeze",
804  .next = NULL
805 };
806 
808  .name = "BLIND",
809  .power = 0,
810  .eval = 20,
811  .desc = "blind",
812  .next = NULL
813 };
814 
815 static struct monster_blow TEST_DATA test_blow[4] = {
816  {
818  .effect = &test_blow_effect_hurt,
819  .dice = {
820  .base = 0,
821  .dice = 3,
822  .sides = 1,
823  .m_bonus = 0,
824  },
825  .times_seen = 1,
826  },
827  {
828  .method = NULL,
829  .effect = NULL,
830  .dice = {
831  .base = 0,
832  .dice = 0,
833  .sides = 0,
834  .m_bonus = 0,
835  },
836  .times_seen = 0,
837  },
838  {
839  .method = NULL,
840  .effect = NULL,
841  .dice = {
842  .base = 0,
843  .dice = 0,
844  .sides = 0,
845  .m_bonus = 0,
846  },
847  .times_seen = 0,
848  },
849  {
850  .method = NULL,
851  .effect = NULL,
852  .dice = {
853  .base = 0,
854  .dice = 0,
855  .sides = 0,
856  .m_bonus = 0,
857  },
858  .times_seen = 0,
859  }
860 };
861 
862 static bool TEST_DATA test_blows_known[4] = {
863  true,
864  false,
865  false,
866  false,
867 };
868 
870  .next = NULL,
871  .ridx = 0,
872  .name = "Human",
873  .text = "A random test human",
874 
875  .base = &test_rb_info,
876 
877  .avg_hp = 10,
878  .ac = 12,
879  .sleep = 0,
880  .hearing = 20,
881  .smell = 20,
882  .speed = 110,
883  .mexp = 50,
884  .freq_innate = 0,
885  .freq_spell = 0,
886 
887  .blow = &test_blow[0],
888 
889  .level = 1,
890  .rarity = 1,
891 
892  .d_attr = 0,
893  .d_char = 't',
894 
895  .max_num = 100,
896  .cur_num = 0,
897 
898  .drops = NULL,
899 };
900 
902  .ridx = 0,
903  .sights = 1,
904  .deaths = 0,
905  .pkills = 0,
906  .tkills = 5,
907  .wake = 1,
908  .ignore = 4,
909  .drop_gold = 0,
910  .drop_item = 0,
911  .cast_innate = 0,
912  .cast_spell = 0,
913 
914  .blows = &test_blow[0],
915 
916  .flags = "\0\0\0\0\0\0\0\0\0\0",
917  .spell_flags = "\0\0\0\0\0\0\0\0\0\0\0",
918  .drops = NULL,
919  .friends = NULL,
920  .friends_base = NULL,
921  .mimic_kinds = NULL,
922  .all_known = false,
923  .blow_known = &test_blows_known[0],
924  .armour_known = false,
925  .drop_known = false,
926  .sleep_known = false,
927  .spell_freq_known = false
928 };
929 
931  .f_max = 2,
932  .trap_max = 2,
933  .k_max = 2,
934  .a_max = 2,
935  .e_max = 2,
936  .r_max = 2,
937  .mp_max = 2,
938  .s_max = 2,
939  .pit_max = 2,
940  .act_max = 2,
941  .level_monster_max = 2,
942 };
943 
945  .type = 5,
946  .name = "light",
947  .obj = NULL,
948 };
949 
950 static struct quest TEST_DATA test_quest = {
951  .next = NULL,
952  .index = 0,
953  .name = "Test",
954  .level = 1,
955  .race = &test_r_human,
956  .cur_num = 0,
957  .max_num = 4,
958 };
959 
961  .next = NULL,
962  .name = "Humanoid",
963  .count = 12,
964 };
965 
967  .playing = 1,
968  .autosave = 0,
969  .generate_level = 0,
970  .energy_use = 0,
971  .new_spells = 0,
972 
973  .health_who = NULL,
974  .monster_race = NULL,
975  .object = NULL,
976  .object_kind = NULL,
977 
978  .notice = 0,
979  .update = 0,
980  .redraw = 0,
981 
982  .command_wrk = 0,
983 
984  .create_up_stair = 0,
985  .create_down_stair = 0,
986 
987  .running = 0,
988  .running_withpathfind = 0,
989  .running_firststep = 0,
990 
991  .quiver = NULL,
992  .inven = NULL,
993 
994  .total_weight = 0,
995  .inven_cnt = 0,
996  .equip_cnt = 0,
997  .quiver_cnt = 0,
998 };
999 
1001  .kind = NULL,
1002  .ego = NULL,
1003  .artifact = NULL,
1004  .prev = NULL,
1005  .next = NULL,
1006  .known = NULL,
1007  .oidx = 0,
1008  .iy = 0,
1009  .ix = 0,
1010  .tval = 0,
1011  .sval = 0,
1012  .pval = 0,
1013  .weight = 0,
1014 
1015  .modifiers = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1016  .el_info = {
1017  { 0, 0 },
1018  { 0, 0 },
1019  { 0, 0 },
1020  { 0, 0 },
1021  { 0, 0 },
1022  { 0, 0 },
1023  { 0, 0 },
1024  { 0, 0 },
1025  { 0, 0 },
1026  { 0, 0 },
1027  { 0, 0 },
1028  { 0, 0 },
1029  { 0, 0 },
1030  { 0, 0 },
1031  { 0, 0 },
1032  { 0, 0 },
1033  { 0, 0 },
1034  { 0, 0 },
1035  { 0, 0 },
1036  { 0, 0 },
1037  { 0, 0 },
1038  { 0, 0 },
1039  { 0, 0 },
1040  { 0, 0 },
1041  { 0, 0 }
1042  },
1043  .brands = NULL,
1044  .slays = NULL,
1045 
1046  .ac = 0,
1047  .to_h = 0,
1048  .to_d = 0,
1049  .to_a = 0,
1050 
1051  .dd = 0,
1052  .ds = 0,
1053 
1054  .effect = NULL,
1055  .effect_msg = NULL,
1056  .activation = NULL,
1057  .time = { 0, 0, 0, 0, },
1058  .timeout = 0,
1059 
1060  .number = 0,
1061  .notice = 0,
1062 
1063  .held_m_idx = 0,
1064  .mimicking_m_idx = 0,
1065  .origin = 0,
1066  .origin_depth = 0,
1067  .origin_race = NULL,
1068  .note = 0,
1069 };
1070 
1071 
1072 static struct player TEST_DATA test_player = {
1073  .py = 1,
1074  .px = 1,
1075  .race = &test_race,
1076  .class = &test_class,
1077  .hitdie = 10,
1078  .expfact = 100,
1079  .age = 12,
1080  .ht = 40,
1081  .wt = 80,
1082  .au = 500,
1083  .max_depth = 10,
1084  .depth = 6,
1085  .max_lev = 3,
1086  .lev = 3,
1087  .max_exp = 100,
1088  .exp = 80,
1089  .mhp = 20,
1090  .chp = 14,
1091  .msp = 12,
1092  .csp = 11,
1093  .stat_max = {
1094  [STAT_STR] = 14,
1095  [STAT_DEX] = 12,
1096  [STAT_CON] = 14,
1097  [STAT_WIS] = 10,
1098  [STAT_INT] = 8,
1099  },
1100  .stat_cur = {
1101  [STAT_STR] = 14,
1102  [STAT_DEX] = 11,
1103  [STAT_CON] = 14,
1104  [STAT_WIS] = 10,
1105  [STAT_INT] = 8,
1106  },
1107  .timed = test_timed,
1108  .word_recall = 0,
1109  .energy = 100,
1110  .food = 5000,
1111  .player_hp = {
1112  5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
1113  55, 60, 65, 70, 75, 80, 85, 90, 95, 100,
1114  105, 110, 115, 120, 125, 130, 135, 140, 145, 150,
1115  155, 160, 165, 170, 175, 180, 185, 190, 195, 200,
1116  205, 210, 215, 220, 225, 230, 235, 240, 245, 250
1117  },
1118  .history = "no history",
1119  .is_dead = 0,
1120  .wizard = 0,
1121  .upkeep = &test_player_upkeep,
1122  .gear = NULL,
1123  .gear_k = NULL,
1124  .obj_k = &test_player_knowledge,
1125 };
1126 
1127 static struct chunk TEST_DATA test_cave = {
1128  .name = "Test",
1129  .created_at = 1,
1130  .depth = 1,
1131 
1132  .feeling = 0,
1133  .obj_rating = 0,
1134  .mon_rating = 0,
1135  .good_item = false,
1136 
1137  .height = 2,
1138  .width = 2,
1139 
1140  .feeling_squares = 0,
1141  .feat_count = NULL,
1142 
1143  .squares = NULL,
1144 
1145  .monsters = NULL,
1146  .mon_max = 1,
1147  .mon_cnt = 0,
1148  .mon_current = -1,
1149 };
1150 
1152  {
1153  .index = 0,
1154  .name = "acid",
1155  .type = "element",
1156  .desc = "acid",
1157  .player_desc = "acid",
1158  .blind_desc = "acid",
1159  .numerator = 1,
1160  .denominator = {3, 0, 0, 0},
1161  .divisor = 3,
1162  .damage_cap = 1600,
1163  .msgt = 0,
1164  .obvious = true,
1165  .color = 2,
1166  .next = NULL
1167  },
1168  {
1169  .index = 1,
1170  .name = "electricity",
1171  .type = "element",
1172  .desc = "electricity",
1173  .player_desc = "electricity",
1174  .blind_desc = "electricity",
1175  .numerator = 1,
1176  .denominator = {3, 0, 0, 0},
1177  .divisor = 3,
1178  .damage_cap = 1600,
1179  .msgt = 0,
1180  .obvious = true,
1181  .color = 6,
1182  .next = NULL
1183  },
1184  {
1185  .index = 2,
1186  .name = "fire",
1187  .type = "element",
1188  .desc = "fire",
1189  .player_desc = "fire",
1190  .blind_desc = "fire",
1191  .numerator = 1,
1192  .denominator = {3, 0, 0, 0},
1193  .divisor = 3,
1194  .damage_cap = 1600,
1195  .msgt = 0,
1196  .obvious = true,
1197  .color = 4,
1198  .next = NULL
1199  },
1200  {
1201  .index = 3,
1202  .name = "cold",
1203  .type = "element",
1204  .desc = "cold",
1205  .player_desc = "cold",
1206  .blind_desc = "cold",
1207  .numerator = 1,
1208  .denominator = {3, 0, 0, 0},
1209  .divisor = 3,
1210  .damage_cap = 1600,
1211  .msgt = 0,
1212  .obvious = true,
1213  .color = 1,
1214  .next = NULL
1215  }
1216 };
1217 
1218 #endif /* !UNIT_TEST_DATA */
static struct player_race TEST_DATA test_race
Definition: unit-test-data.h:597
struct player_body * next
Definition: player.h:161
static struct start_item TEST_DATA start_longsword
Definition: unit-test-data.h:642
projection and helpers
static struct object_kind TEST_DATA test_lantern
Definition: unit-test-data.h:266
int index
Definition: project.h:29
Monster "race" information, including racial memories.
Definition: monster.h:265
Includes basic includes.
Player race info.
Definition: player.h:171
static struct object_kind TEST_DATA test_flask
Definition: unit-test-data.h:391
static struct angband_constants TEST_DATA test_z_info
Definition: unit-test-data.h:930
struct object_base * next
Definition: object.h:137
initialization
A structure to hold class-dependent information on spell books.
Definition: player.h:249
static monster_lore TEST_DATA test_lore
Definition: unit-test-data.h:901
static struct chunk TEST_DATA test_cave
Definition: unit-test-data.h:1127
Structure for magic realms.
Definition: player.h:219
int ridx
Definition: mon-lore.h:30
static struct object_kind TEST_DATA test_longsword
Definition: unit-test-data.h:73
struct magic_realm * next
Definition: player.h:220
Definition: mon-blows.h:26
static struct blow_effect TEST_DATA test_blow_effect_hurt
Definition: unit-test-data.h:759
Information about object kinds, including player knowledge.
Definition: object.h:158
static struct class_book TEST_DATA test_book
Definition: unit-test-data.h:649
static struct object_base TEST_DATA rod_base
Definition: unit-test-data.h:50
Definition: player.h:119
#define TEST_DATA
Definition: unit-test-data.h:12
u16b type
Definition: player.h:152
static bool TEST_DATA test_blows_known[4]
Definition: unit-test-data.h:862
Structure for the "quests".
Definition: player.h:135
Element struct.
Definition: project.h:28
Information about object types, like rods, wands, etc.
Definition: object.h:133
Definition: player.h:125
Player implementation.
Definition: cave.h:147
Definition: player.h:121
static struct artifact TEST_DATA test_artifact_sword
Definition: unit-test-data.h:56
static struct object_base TEST_DATA light_base
Definition: unit-test-data.h:36
static struct object TEST_DATA test_player_knowledge
Definition: unit-test-data.h:1000
static struct equip_slot TEST_DATA test_slot_light
Definition: unit-test-data.h:944
Player temporary status structures.
char * name
Definition: mon-blows.h:27
static struct blow_method TEST_DATA test_blow_method
Definition: unit-test-data.h:747
char * name
Definition: cave.h:148
bool playing
Definition: player.h:397
Object information, for a specific object.
Definition: object.h:394
Definition: mon-blows.h:66
Player class info.
Definition: player.h:272
static struct blow_effect TEST_DATA test_blow_effect_acid
Definition: unit-test-data.h:775
static struct quest TEST_DATA test_quest
Definition: unit-test-data.h:950
Definition: player.h:122
Definition: player.h:127
const char * name
Definition: player.h:173
static struct blow_effect TEST_DATA test_blow_effect_elec
Definition: unit-test-data.h:783
static struct object_base TEST_DATA sword_base
Definition: unit-test-data.h:29
struct monster_base * next
Definition: monster.h:194
u16b f_max
Maximum number of terrain features.
Definition: init.h:30
Base monster type.
Definition: monster.h:193
s16b py
Definition: player.h:456
struct object_kind * next
Definition: object.h:164
int tval
Item type of the book.
Definition: player.h:250
static struct player TEST_DATA test_player
Definition: unit-test-data.h:1072
struct monster_race * next
Definition: monster.h:266
Definition: player.h:124
static struct player_upkeep TEST_DATA test_player_upkeep
Definition: unit-test-data.h:966
struct object_kind * kind
Definition: player.h:209
static struct blow_effect TEST_DATA test_blow_effect_fire
Definition: unit-test-data.h:791
static struct blow_effect TEST_DATA test_blow_effect_cold
Definition: unit-test-data.h:799
const char * name
Definition: player.h:274
Items the player starts with.
Definition: player.h:208
Flags, structures and variables for monsters.
int16_t s16b
Definition: h-basic.h:170
Temporary, derived, player-related variables used during play but not saved.
Definition: player.h:396
static struct object_kind TEST_DATA test_gold
Definition: unit-test-data.h:529
static struct blow_effect TEST_DATA test_blow_effect_poison
Definition: unit-test-data.h:767
Wrapper functions for tvals.
static struct player_body TEST_DATA test_player_body
Definition: unit-test-data.h:960
Definition: player.h:123
char * name
Definition: object.h:240
static struct monster_base TEST_DATA test_rb_info
Definition: unit-test-data.h:736
Information about maximal indices of certain arrays.
Definition: init.h:27
static struct object_base TEST_DATA flask_base
Definition: unit-test-data.h:43
static struct object_kind TEST_DATA test_torch
Definition: unit-test-data.h:141
Definition: player.h:126
Definition: player.h:120
A single equipment slot.
Definition: player.h:149
int tval
Definition: object.h:136
static struct blow_effect TEST_DATA test_blow_effect_blind
Definition: unit-test-data.h:807
Monster "lore" information.
Definition: mon-lore.h:28
struct blow_method * method
Definition: monster.h:148
static struct monster_race TEST_DATA test_r_human
Definition: unit-test-data.h:869
Definition: player.h:118
char * name
Definition: mon-blows.h:67
static struct monster_blow TEST_DATA test_blow[4]
Definition: unit-test-data.h:815
Most of the "player" information goes here.
Definition: player.h:452
Structures and functions for monster recall.
int cur_num
Definition: monster.h:303
struct quest * next
Definition: player.h:137
struct object_kind * kind
Kind of the object.
Definition: object.h:395
NULL
Definition: list-summon-types.h:18
static struct magic_realm TEST_DATA test_realm
Definition: unit-test-data.h:657
Information about artifacts.
Definition: object.h:239
static struct projection TEST_DATA test_projections[4]
Definition: unit-test-data.h:1151
static struct player_class TEST_DATA test_class
Definition: unit-test-data.h:666
char * name
Definition: object.h:134
Monster blows.
Definition: monster.h:145
A player 'body'.
Definition: player.h:160
static s16b TEST_DATA test_timed[30]
Definition: unit-test-data.h:26
static struct object_kind TEST_DATA test_rod_treasure_location
Definition: unit-test-data.h:460
char * name
Definition: object.h:159
static struct start_item TEST_DATA start_torch
Definition: unit-test-data.h:635