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  .start_items = &start_longsword,
723  .magic = {
724  .spell_first = 1,
725  .spell_weight = 300,
726  .spell_realm = &test_realm,
727  .num_books = 1,
728  .books = &test_book,
729  .total_spells = 8,
730  },
731 };
732 
734  .next = NULL,
735  .name = "townsfolk",
736  .text = "Townsfolk",
737  .flags = "\0\0\0\0\0\0\0\0\0\0",
738  .spell_flags = "\0\0\0\0\0\0\0\0\0\0\0",
739  .d_char = 116,
740  .pain = NULL,
741 
742 };
743 
745  .name = "HIT",
746  .cut = true,
747  .stun = true,
748  .miss = false,
749  .phys = false,
750  .msgt = 34,
751  .act_msg = "hits you",
752  .desc = "hit",
753  .next = NULL
754 };
755 
757  .name = "HURT",
758  .power = 40,
759  .eval = 0,
760  .desc = "attack",
761  .next = NULL
762 };
763 
765  .name = "POISON",
766  .power = 20,
767  .eval = 10,
768  .desc = "poison",
769  .next = NULL
770 };
771 
773  .name = "ACID",
774  .power = 20,
775  .eval = 20,
776  .desc = "shoot acid",
777  .next = NULL
778 };
779 
781  .name = "ELEC",
782  .power = 40,
783  .eval = 10,
784  .desc = "electrify",
785  .next = NULL
786 };
787 
789  .name = "FIRE",
790  .power = 40,
791  .eval = 10,
792  .desc = "burn",
793  .next = NULL
794 };
795 
797  .name = "COLD",
798  .power = 40,
799  .eval = 10,
800  .desc = "freeze",
801  .next = NULL
802 };
803 
805  .name = "BLIND",
806  .power = 0,
807  .eval = 20,
808  .desc = "blind",
809  .next = NULL
810 };
811 
812 static struct monster_blow TEST_DATA test_blow[4] = {
813  {
815  .effect = &test_blow_effect_hurt,
816  .dice = {
817  .base = 0,
818  .dice = 3,
819  .sides = 1,
820  .m_bonus = 0,
821  },
822  .times_seen = 1,
823  },
824  {
825  .method = NULL,
826  .effect = NULL,
827  .dice = {
828  .base = 0,
829  .dice = 0,
830  .sides = 0,
831  .m_bonus = 0,
832  },
833  .times_seen = 0,
834  },
835  {
836  .method = NULL,
837  .effect = NULL,
838  .dice = {
839  .base = 0,
840  .dice = 0,
841  .sides = 0,
842  .m_bonus = 0,
843  },
844  .times_seen = 0,
845  },
846  {
847  .method = NULL,
848  .effect = NULL,
849  .dice = {
850  .base = 0,
851  .dice = 0,
852  .sides = 0,
853  .m_bonus = 0,
854  },
855  .times_seen = 0,
856  }
857 };
858 
859 static bool TEST_DATA test_blows_known[4] = {
860  true,
861  false,
862  false,
863  false,
864 };
865 
867  .next = NULL,
868  .ridx = 0,
869  .name = "Human",
870  .text = "A random test human",
871 
872  .base = &test_rb_info,
873 
874  .avg_hp = 10,
875  .ac = 12,
876  .sleep = 0,
877  .hearing = 20,
878  .smell = 20,
879  .speed = 110,
880  .mexp = 50,
881  .freq_innate = 0,
882  .freq_spell = 0,
883 
884  .blow = &test_blow[0],
885 
886  .level = 1,
887  .rarity = 1,
888 
889  .d_attr = 0,
890  .d_char = 't',
891 
892  .max_num = 100,
893  .cur_num = 0,
894 
895  .drops = NULL,
896 };
897 
899  .ridx = 0,
900  .sights = 1,
901  .deaths = 0,
902  .pkills = 0,
903  .tkills = 5,
904  .wake = 1,
905  .ignore = 4,
906  .drop_gold = 0,
907  .drop_item = 0,
908  .cast_innate = 0,
909  .cast_spell = 0,
910 
911  .blows = &test_blow[0],
912 
913  .flags = "\0\0\0\0\0\0\0\0\0\0",
914  .spell_flags = "\0\0\0\0\0\0\0\0\0\0\0",
915  .drops = NULL,
916  .friends = NULL,
917  .friends_base = NULL,
918  .mimic_kinds = NULL,
919  .all_known = false,
920  .blow_known = &test_blows_known[0],
921  .armour_known = false,
922  .drop_known = false,
923  .sleep_known = false,
924  .spell_freq_known = false
925 };
926 
928  .f_max = 2,
929  .trap_max = 2,
930  .k_max = 2,
931  .a_max = 2,
932  .e_max = 2,
933  .r_max = 2,
934  .mp_max = 2,
935  .s_max = 2,
936  .pit_max = 2,
937  .act_max = 2,
938  .level_monster_max = 2,
939 };
940 
942  .type = 5,
943  .name = "light",
944  .obj = NULL,
945 };
946 
947 static struct quest TEST_DATA test_quest = {
948  .next = NULL,
949  .index = 0,
950  .name = "Test",
951  .level = 1,
952  .race = &test_r_human,
953  .cur_num = 0,
954  .max_num = 4,
955 };
956 
958  .next = NULL,
959  .name = "Humanoid",
960  .count = 12,
961 };
962 
964  .playing = 1,
965  .autosave = 0,
966  .generate_level = 0,
967  .energy_use = 0,
968  .new_spells = 0,
969 
970  .health_who = NULL,
971  .monster_race = NULL,
972  .object = NULL,
973  .object_kind = NULL,
974 
975  .notice = 0,
976  .update = 0,
977  .redraw = 0,
978 
979  .command_wrk = 0,
980 
981  .create_up_stair = 0,
982  .create_down_stair = 0,
983 
984  .running = 0,
985  .running_withpathfind = 0,
986  .running_firststep = 0,
987 
988  .quiver = NULL,
989  .inven = NULL,
990 
991  .total_weight = 0,
992  .inven_cnt = 0,
993  .equip_cnt = 0,
994  .quiver_cnt = 0,
995 };
996 
998  .kind = NULL,
999  .ego = NULL,
1000  .artifact = NULL,
1001  .prev = NULL,
1002  .next = NULL,
1003  .known = NULL,
1004  .oidx = 0,
1005  .iy = 0,
1006  .ix = 0,
1007  .tval = 0,
1008  .sval = 0,
1009  .pval = 0,
1010  .weight = 0,
1011 
1012  .modifiers = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
1013  .el_info = {
1014  { 0, 0 },
1015  { 0, 0 },
1016  { 0, 0 },
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  },
1040  .brands = NULL,
1041  .slays = NULL,
1042 
1043  .ac = 0,
1044  .to_h = 0,
1045  .to_d = 0,
1046  .to_a = 0,
1047 
1048  .dd = 0,
1049  .ds = 0,
1050 
1051  .effect = NULL,
1052  .effect_msg = NULL,
1053  .activation = NULL,
1054  .time = { 0, 0, 0, 0, },
1055  .timeout = 0,
1056 
1057  .number = 0,
1058  .notice = 0,
1059 
1060  .held_m_idx = 0,
1061  .mimicking_m_idx = 0,
1062  .origin = 0,
1063  .origin_depth = 0,
1064  .origin_race = NULL,
1065  .note = 0,
1066 };
1067 
1068 
1069 static struct player TEST_DATA test_player = {
1070  .py = 1,
1071  .px = 1,
1072  .race = &test_race,
1073  .class = &test_class,
1074  .hitdie = 10,
1075  .expfact = 100,
1076  .age = 12,
1077  .ht = 40,
1078  .wt = 80,
1079  .au = 500,
1080  .max_depth = 10,
1081  .depth = 6,
1082  .max_lev = 3,
1083  .lev = 3,
1084  .max_exp = 100,
1085  .exp = 80,
1086  .mhp = 20,
1087  .chp = 14,
1088  .msp = 12,
1089  .csp = 11,
1090  .stat_max = {
1091  [STAT_STR] = 14,
1092  [STAT_DEX] = 12,
1093  [STAT_CON] = 14,
1094  [STAT_WIS] = 10,
1095  [STAT_INT] = 8,
1096  },
1097  .stat_cur = {
1098  [STAT_STR] = 14,
1099  [STAT_DEX] = 11,
1100  [STAT_CON] = 14,
1101  [STAT_WIS] = 10,
1102  [STAT_INT] = 8,
1103  },
1104  .timed = test_timed,
1105  .word_recall = 0,
1106  .energy = 100,
1107  .food = 5000,
1108  .player_hp = {
1109  5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
1110  55, 60, 65, 70, 75, 80, 85, 90, 95, 100,
1111  105, 110, 115, 120, 125, 130, 135, 140, 145, 150,
1112  155, 160, 165, 170, 175, 180, 185, 190, 195, 200,
1113  205, 210, 215, 220, 225, 230, 235, 240, 245, 250
1114  },
1115  .history = "no history",
1116  .is_dead = 0,
1117  .wizard = 0,
1118  .upkeep = &test_player_upkeep,
1119  .gear = NULL,
1120  .gear_k = NULL,
1121  .obj_k = &test_player_knowledge,
1122 };
1123 
1124 static struct chunk TEST_DATA test_cave = {
1125  .name = "Test",
1126  .turn = 1,
1127  .depth = 1,
1128 
1129  .feeling = 0,
1130  .obj_rating = 0,
1131  .mon_rating = 0,
1132  .good_item = false,
1133 
1134  .height = 2,
1135  .width = 2,
1136 
1137  .feeling_squares = 0,
1138  .feat_count = NULL,
1139 
1140  .squares = NULL,
1141 
1142  .monsters = NULL,
1143  .mon_max = 1,
1144  .mon_cnt = 0,
1145  .mon_current = -1,
1146 };
1147 
1149  {
1150  .index = 0,
1151  .name = "acid",
1152  .type = "element",
1153  .desc = "acid",
1154  .player_desc = "acid",
1155  .blind_desc = "acid",
1156  .numerator = 1,
1157  .denominator = {3, 0, 0, 0},
1158  .divisor = 3,
1159  .damage_cap = 1600,
1160  .msgt = 0,
1161  .obvious = true,
1162  .color = 2,
1163  .next = NULL
1164  },
1165  {
1166  .index = 1,
1167  .name = "electricity",
1168  .type = "element",
1169  .desc = "electricity",
1170  .player_desc = "electricity",
1171  .blind_desc = "electricity",
1172  .numerator = 1,
1173  .denominator = {3, 0, 0, 0},
1174  .divisor = 3,
1175  .damage_cap = 1600,
1176  .msgt = 0,
1177  .obvious = true,
1178  .color = 6,
1179  .next = NULL
1180  },
1181  {
1182  .index = 2,
1183  .name = "fire",
1184  .type = "element",
1185  .desc = "fire",
1186  .player_desc = "fire",
1187  .blind_desc = "fire",
1188  .numerator = 1,
1189  .denominator = {3, 0, 0, 0},
1190  .divisor = 3,
1191  .damage_cap = 1600,
1192  .msgt = 0,
1193  .obvious = true,
1194  .color = 4,
1195  .next = NULL
1196  },
1197  {
1198  .index = 3,
1199  .name = "cold",
1200  .type = "element",
1201  .desc = "cold",
1202  .player_desc = "cold",
1203  .blind_desc = "cold",
1204  .numerator = 1,
1205  .denominator = {3, 0, 0, 0},
1206  .divisor = 3,
1207  .damage_cap = 1600,
1208  .msgt = 0,
1209  .obvious = true,
1210  .color = 1,
1211  .next = NULL
1212  }
1213 };
1214 
1215 #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:927
struct object_base * next
Definition: object.h:136
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:898
static struct chunk TEST_DATA test_cave
Definition: unit-test-data.h:1124
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:756
Information about object kinds, including player knowledge.
Definition: object.h:157
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:127
#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:859
Definition: player.h:118
Structure for the "quests".
Definition: player.h:135
Element struct.
Definition: project.h:28
Definition: player.h:120
Definition: player.h:122
Information about object types, like rods, wands, etc.
Definition: object.h:132
Definition: player.h:124
Player implementation.
Definition: cave.h:160
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:997
static struct equip_slot TEST_DATA test_slot_light
Definition: unit-test-data.h:941
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:744
char * name
Definition: cave.h:161
bool playing
Definition: player.h:394
Object information, for a specific object.
Definition: object.h:393
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:772
static struct quest TEST_DATA test_quest
Definition: unit-test-data.h:947
const char * name
Definition: player.h:173
static struct blow_effect TEST_DATA test_blow_effect_elec
Definition: unit-test-data.h:780
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:454
struct object_kind * next
Definition: object.h:163
int tval
Item type of the book.
Definition: player.h:250
static struct player TEST_DATA test_player
Definition: unit-test-data.h:1069
Definition: player.h:121
struct monster_race * next
Definition: monster.h:266
static struct player_upkeep TEST_DATA test_player_upkeep
Definition: unit-test-data.h:963
struct object_kind * kind
Definition: player.h:209
static struct blow_effect TEST_DATA test_blow_effect_fire
Definition: unit-test-data.h:788
static struct blow_effect TEST_DATA test_blow_effect_cold
Definition: unit-test-data.h:796
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:393
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:764
Wrapper functions for tvals.
static struct player_body TEST_DATA test_player_body
Definition: unit-test-data.h:957
Definition: player.h:123
char * name
Definition: object.h:239
static struct monster_base TEST_DATA test_rb_info
Definition: unit-test-data.h:733
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
A single equipment slot.
Definition: player.h:149
int tval
Definition: object.h:135
static struct blow_effect TEST_DATA test_blow_effect_blind
Definition: unit-test-data.h:804
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:866
Definition: player.h:125
char * name
Definition: mon-blows.h:67
static struct monster_blow TEST_DATA test_blow[4]
Definition: unit-test-data.h:812
Most of the "player" information goes here.
Definition: player.h:450
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:394
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:238
Definition: player.h:119
static struct projection TEST_DATA test_projections[4]
Definition: unit-test-data.h:1148
static struct player_class TEST_DATA test_class
Definition: unit-test-data.h:666
char * name
Definition: object.h:133
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
Definition: player.h:126
static struct object_kind TEST_DATA test_rod_treasure_location
Definition: unit-test-data.h:460
char * name
Definition: object.h:158
static struct start_item TEST_DATA start_torch
Definition: unit-test-data.h:635