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