summaryrefslogtreecommitdiff
path: root/src/game/text.cpp
blob: b9cdd323491d2b0ab2a9a1d797fba00163ee3e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
This file is part of Minitrem.

Minitrem is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

Minitrem is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Minitrem.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "game.hpp"

namespace game::text {

language_t language = LANG_ENGLISH;

static const char *soldier_names[] = {
	"Kowalski", "Jackson", "Carter", "O'Neill", "Hammond", "Mitchell"
};

static std::string get_english(index_t index)
{
	switch (index) {
	case PAUSED:
		return "PAUSED";

	case UNPAUSED:
		return "UNPAUSED";

	case FOLLOWING_ON:
		return "Following: on.";

	case FOLLOWING_OFF:
		return "Following: off.";

	case SAY_GROUP:
		return "Group";

	case SAY_BLOCKED:
		return "Something is in my way.";

	case SAY_NO_PATH:
		return "I can't get there.";

	case SAY_READY:
	case SAY_READY_GROUP:
		return "Ready for orders.";

	case SAY_MOVING:
		return "On my way.";

	case SAY_MOVING_GROUP:
		return "On our way.";

	case SAY_PANIC:
		return "I'm not getting paid enough for this.";

	case UNIT_NAME_SPIDER:
		return "Spider";

	case UNIT_NAME_SOLDIER:
		return soldier_names[rand() % COUNT(soldier_names)];

	case UNIT_NAME_NEST:
		return "Nest";

	case UNIT_DEATH:
		return "died";

	case UNIT_ATTACK:
		return "attacks";

	case UNIT_MISS:
		return "miss";

	case UNIT_CRITICAL_MISS:
		return "critical miss";

	case UNIT_CRITICAL_HIT:
		return "critical hit";

	case UNIT_DAMAGE:
		return "deals damage";

	case UNIT_SAVING_THROW_WILLPOWER:
		return "makes a saving throw for willpower";

	case UNIT_SAVING_THROW_SUCCESS:
		return "success";

	case UNIT_SAVING_THROW_FAILURE:
		return "failure";

	default:
		abort();
	}
}

static std::string get_polish(index_t index)
{
	switch (index) {
	case PAUSED:
		return "WSTRZYMANO";

	case UNPAUSED:
		return "WZNOWIONO";

	case FOLLOWING_ON:
		return "Podążanie: włączone.";

	case FOLLOWING_OFF:
		return "Podążanie: wyłączone.";

	case SAY_GROUP:
		return "Oddział";

	case SAY_BLOCKED:
		return "Coś jest na mojej drodze.";

	case SAY_NO_PATH:
		return "Nie mogę się tam dostać.";

	case SAY_READY:
	case SAY_READY_GROUP:
		return "Gotowy na rozkaz.";

	case SAY_MOVING:
		return "Jestem w drodze.";

	case SAY_MOVING_GROUP:
		return "W drodze.";

	case SAY_PANIC:
		return "Za mało mi za to płacą.";

	case UNIT_NAME_SPIDER:
		return "Pająk";

	case UNIT_NAME_SOLDIER:
		return soldier_names[rand() % COUNT(soldier_names)];

	case UNIT_NAME_NEST:
		return "Gniazdo";

	case UNIT_DEATH:
		return "nie żyje";

	case UNIT_ATTACK:
		return "atakuje";

	case UNIT_MISS:
		return "chybienie";

	case UNIT_CRITICAL_MISS:
		return "chybienie krytyczne";

	case UNIT_CRITICAL_HIT:
		return "trafienie krytyczne";

	case UNIT_DAMAGE:
		return "zadaje obrażenia";

	case UNIT_SAVING_THROW_WILLPOWER:
		return "wykonuje rzut obronny na siłę woli";

	case UNIT_SAVING_THROW_SUCCESS:
		return "sukces";

	case UNIT_SAVING_THROW_FAILURE:
		return "porażka";

	default:
		abort();
	}
}
std::string get(index_t index)
{
	switch (language) {
	case LANG_ENGLISH:
		return get_english(index);

	case LANG_POLISH:
		return get_polish(index);

	default:
		abort();
	}
}

} // namespace text