1 /*
2 * amulets.c
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 #include <glib.h>
20 #include "amulets.h"
21 #include "items.h"
22 #include "extdefs.h"
23
24 const amulet_data amulets[AM_MAX] =
25 {
26 { AM_AWARENESS, AMULET, "awareness", ET_AWARENESS, 400, },
27 { AM_SUSTAINMENT, AMULET, "sustainment", ET_SUSTAINMENT, 400, },
28 { AM_UNDEAD_CONTROL, TALISMAN, "undead control", ET_UNDEAD_PROTECTION, 5000, },
29 { AM_NEGATE_SPIRIT, TALISMAN, "negate spirit", ET_SPIRIT_PROTECTION, 5000, },
30 { AM_NOTHEFT, TALISMAN, "theft prevention", ET_NOTHEFT, 6000, },
31 { AM_DRAGON_SLAYING, TALISMAN, "dragon slaying", ET_NONE, 6000, },
32 { AM_POWER, AMULET, "power", ET_NONE, 8000, },
33 { AM_REFLECTION, AMULET, "reflection", ET_REFLECTION, 8000, },
34 { AM_LARN, AMULET, "Eye of Larn", ET_INFRAVISION, 9000, },
35 };
36
37 static const int amulet_materials[AM_MAX] =
38 {
39 IM_GOLD,
40 IM_SILVER,
41 IM_PLATINUM,
42 IM_SILVER,
43 IM_COPPER,
44 IM_STEEL,
45 IM_GLASS,
46 IM_BONE,
47 IM_GEMSTONE,
48 };
49
amulet_material(amulet_t amulet_id)50 item_material_t amulet_material(amulet_t amulet_id)
51 {
52 g_assert(amulet_id < AM_MAX);
53 return amulet_materials[nlarn->amulet_material_mapping[amulet_id]];
54 }
55