1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "ultima/ultima4/game/names.h"
24 
25 namespace Ultima {
26 namespace Ultima4 {
27 
getClassName(ClassType klass)28 const char *getClassName(ClassType klass) {
29 	switch (klass) {
30 	case CLASS_MAGE:
31 		return "Mage";
32 	case CLASS_BARD:
33 		return "Bard";
34 	case CLASS_FIGHTER:
35 		return "Fighter";
36 	case CLASS_DRUID:
37 		return "Druid";
38 	case CLASS_TINKER:
39 		return "Tinker";
40 	case CLASS_PALADIN:
41 		return "Paladin";
42 	case CLASS_RANGER:
43 		return "Ranger";
44 	case CLASS_SHEPHERD:
45 		return "Shepherd";
46 	default:
47 		return "???";
48 	}
49 }
50 
getReagentName(Reagent reagent)51 const char *getReagentName(Reagent reagent) {
52 	static const char *const reagentNames[] = {
53 		"Sulfur Ash", "Ginseng", "Garlic",
54 		"Spider Silk", "Blood Moss", "Black Pearl",
55 		"Nightshade", "Mandrake"
56 	};
57 
58 	if (reagent < REAG_MAX)
59 		return reagentNames[reagent - REAG_ASH];
60 	else
61 		return "???";
62 }
63 
getVirtueName(Virtue virtue)64 const char *getVirtueName(Virtue virtue) {
65 	static const char *const virtueNames[] = {
66 		"Honesty", "Compassion", "Valor",
67 		"Justice", "Sacrifice", "Honor",
68 		"Spirituality", "Humility"
69 	};
70 
71 	if (virtue < 8)
72 		return virtueNames[virtue - VIRT_HONESTY];
73 	else
74 		return "???";
75 }
76 
getBaseVirtueName(int virtueMask)77 const char *getBaseVirtueName(int virtueMask) {
78 	if (virtueMask == VIRT_TRUTH)           return "Truth";
79 	else if (virtueMask == VIRT_LOVE)       return "Love";
80 	else if (virtueMask == VIRT_COURAGE)    return "Courage";
81 	else if (virtueMask == (VIRT_TRUTH | VIRT_LOVE)) return "Truth and Love";
82 	else if (virtueMask == (VIRT_LOVE | VIRT_COURAGE)) return "Love and Courage";
83 	else if (virtueMask == (VIRT_COURAGE | VIRT_TRUTH)) return "Courage and Truth";
84 	else if (virtueMask == (VIRT_TRUTH | VIRT_LOVE | VIRT_COURAGE)) return "Truth, Love and Courage";
85 	else return "???";
86 }
87 
getBaseVirtues(Virtue virtue)88 int getBaseVirtues(Virtue virtue) {
89 	switch (virtue) {
90 	case VIRT_HONESTY:
91 		return VIRT_TRUTH;
92 	case VIRT_COMPASSION:
93 		return VIRT_LOVE;
94 	case VIRT_VALOR:
95 		return VIRT_COURAGE;
96 	case VIRT_JUSTICE:
97 		return VIRT_TRUTH | VIRT_LOVE;
98 	case VIRT_SACRIFICE:
99 		return VIRT_LOVE | VIRT_COURAGE;
100 	case VIRT_HONOR:
101 		return VIRT_COURAGE | VIRT_TRUTH;
102 	case VIRT_SPIRITUALITY:
103 		return VIRT_TRUTH | VIRT_LOVE | VIRT_COURAGE;
104 	case VIRT_HUMILITY:
105 		return 0;
106 	default:
107 		return 0;
108 	}
109 }
110 
getVirtueAdjective(Virtue virtue)111 const char *getVirtueAdjective(Virtue virtue) {
112 	static const char *const virtueAdjectives[] = {
113 		"honest",
114 		"compassionate",
115 		"valiant",
116 		"just",
117 		"sacrificial",
118 		"honorable",
119 		"spiritual",
120 		"humble"
121 	};
122 
123 	if (virtue < 8)
124 		return virtueAdjectives[virtue - VIRT_HONESTY];
125 	else
126 		return "???";
127 }
128 
getStoneName(Virtue virtue)129 const char *getStoneName(Virtue virtue) {
130 	static const char *const virtueNames[] = {
131 		"Blue", "Yellow", "Red",
132 		"Green", "Orange", "Purple",
133 		"White", "Black"
134 	};
135 
136 	if (virtue < VIRT_MAX)
137 		return virtueNames[virtue - VIRT_HONESTY];
138 	else
139 		return "???";
140 }
141 
getItemName(Item item)142 const char *getItemName(Item item) {
143 	switch (item) {
144 	case ITEM_SKULL:
145 		return "Skull";
146 	case ITEM_CANDLE:
147 		return "Candle";
148 	case ITEM_BOOK:
149 		return "Book";
150 	case ITEM_BELL:
151 		return "Bell";
152 	case ITEM_KEY_C:
153 		return "Courage";
154 	case ITEM_KEY_L:
155 		return "Love";
156 	case ITEM_KEY_T:
157 		return "Truth";
158 	case ITEM_HORN:
159 		return "Horn";
160 	case ITEM_WHEEL:
161 		return "Wheel";
162 	default:
163 		return "???";
164 	}
165 }
166 
getDirectionName(Direction dir)167 const char *getDirectionName(Direction dir) {
168 	static const char *const directionNames[] = {
169 		"West", "North", "East", "South"
170 	};
171 
172 	if (dir >= DIR_WEST && dir <= DIR_SOUTH)
173 		return directionNames[dir - DIR_WEST];
174 	else
175 		return "???";
176 }
177 
178 } // End of namespace Ultima4
179 } // End of namespace Ultima
180