#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 "died"; 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