summaryrefslogtreecommitdiff
path: root/src/text.cpp
blob: 3c89610d22690a2ed62dc42923394e9802c17d17 (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
#include "common.hpp"

namespace text {

language_t language = LANG_ENGLISH;

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

#define count(A) (sizeof(A) / sizeof((A)[0]))

static std::string get_english(index_t index)
{
	switch (index) {
	case SAY_BLOCKED:
		return "Something is in my way.";

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

	case SAY_READY:
		return "Ready for orders.";

	case SAY_MOVING:
		return "On my way.";

	case UNIT_ALIEN:
		return "Alien";

	case UNIT_HUMAN:
		return human_names[rand() % count(human_names)];

	case UNIT_DEATH:
		return "Death";

	case UNIT_ATTACK:
		return "attacks";

	case UNIT_MISS:
		return "miss";

	case UNIT_CRITICAL_MISS:
		return "critical miss";

	case UNIT_HIT:
		return "hit";

	case UNIT_CRITICAL_HIT:
		return "critical hit";

	case UNIT_DAMAGE:
		return "deals damage to";
	}
}

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

} // namespace text