1 /*
2  * amulets.h
3  * Copyright (C) 2009-2020 Joachim de Groot <jdegroot@web.de>
4  *
5  * NLarn is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * NLarn is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef __AMULETS_H_
20 #define __AMULETS_H_
21 
22 #include "items.h"
23 
24 typedef enum amulet_types
25 {
26     AM_AWARENESS,
27     AM_SUSTAINMENT,
28     AM_UNDEAD_CONTROL,
29     AM_NEGATE_SPIRIT,
30     AM_NOTHEFT,
31     AM_DRAGON_SLAYING,
32     AM_POWER,
33     AM_REFLECTION,
34     AM_LARN,
35     AM_MAX
36 } amulet_t;
37 
38 typedef enum amulet_type
39 {
40     AMULET,
41     TALISMAN
42 } amulet_type;
43 
44 typedef struct amulet_data
45 {
46     amulet_t id;
47     amulet_type typ;  /* talisman or amulet? */
48     const char *name;
49     effect_t effect; /* effect causes by this amulet */
50     int price;       /* base price in the shops */
51 } amulet_data;
52 
53 /* external vars */
54 
55 extern const amulet_data amulets[AM_MAX];
56 
57 /* function declarations */
58 
59 item_material_t amulet_material(amulet_t amulet_id);
60 
61 /* macros */
62 
63 #define amulet_type(item)        (amulets[(item)->id].typ)
64 #define amulet_name(item)        (amulets[(item)->id].name)
65 #define amulet_effect_t(item)    (amulets[(item)->id].effect)
66 #define amulet_price(item)       (amulets[(item)->id].price)
67 
68 #endif
69