1 /*
2  * rings.c
3  * Copyright (C) 2009-2018 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 
21 #include "extdefs.h"
22 #include "rings.h"
23 
24 const ring_data rings[RT_MAX] =
25 {
26     /* type            name                  effect           price ob bo */
27     { RT_REGENERATION, "regeneration",       ET_INC_HP_REGEN,  250, 0, 0 },
28     { RT_PROTECTION,   "protection",         ET_PROTECTION,    150, 0, 1 },
29     { RT_ENERGY,       "energy",             ET_INC_MP_REGEN,  250, 0, 0 },
30     { RT_DEXTERITY,    "dexterity",          ET_INC_DEX,       110, 1, 1 },
31     { RT_STRENGTH,     "strength",           ET_INC_STR,       110, 1, 1 },
32     { RT_CLEVERNESS,   "cleverness",         ET_INC_INT,       110, 1, 1 },
33     { RT_INC_DAMAGE,   "increase damage",    ET_INC_DAMAGE,    150, 0, 0 },
34     { RT_EXTRA_REGEN,  "extra regeneration", ET_INC_HP_REGEN, 1000, 0, 0 },
35 };
36 
37 static const int ring_materials[RT_MAX] =
38 {
39     IM_GOLD,
40     IM_SILVER,
41     IM_PLATINUM,
42     IM_GEMSTONE,
43     IM_COPPER,
44     IM_STEEL,
45     IM_GLASS,
46     IM_BONE
47 };
48 
ring_material(ring_t ring_id)49 item_material_t ring_material(ring_t ring_id)
50 {
51     g_assert(ring_id < RT_MAX);
52     return ring_materials[nlarn->ring_material_mapping[ring_id]];
53 }
54