reformat remaining files
This commit is contained in:
+47
-233
@@ -118,147 +118,47 @@ const char* abbreviation_for_mode(GameMode mode) {
|
||||
}
|
||||
|
||||
static const array<const char*, 10> section_id_to_name = {
|
||||
"Viridia", "Greennill", "Skyly", "Bluefull", "Purplenum",
|
||||
"Pinkal", "Redria", "Oran", "Yellowboze", "Whitill"};
|
||||
"Viridia", "Greennill", "Skyly", "Bluefull", "Purplenum", "Pinkal", "Redria", "Oran", "Yellowboze", "Whitill"};
|
||||
|
||||
static const array<const char*, 10> section_id_to_abbreviation = {
|
||||
"Vir", "Grn", "Sky", "Blu", "Prp", "Pnk", "Red", "Orn", "Ylw", "Wht"};
|
||||
|
||||
const unordered_map<string, uint8_t> name_to_section_id({
|
||||
{"viridia", 0},
|
||||
{"greennill", 1},
|
||||
{"greenill", 1},
|
||||
{"skyly", 2},
|
||||
{"bluefull", 3},
|
||||
{"purplenum", 4},
|
||||
{"pinkal", 5},
|
||||
{"redria", 6},
|
||||
{"oran", 7},
|
||||
{"yellowboze", 8},
|
||||
{"whitill", 9},
|
||||
const unordered_map<string, uint8_t> name_to_section_id({{"viridia", 0},
|
||||
// Greennill is spelled Greenill in some places, so we accept both spellings
|
||||
{"greennill", 1}, {"greenill", 1}, {"skyly", 2}, {"bluefull", 3}, {"purplenum", 4}, {"pinkal", 5}, {"redria", 6},
|
||||
{"oran", 7}, {"yellowboze", 8}, {"whitill", 9},
|
||||
|
||||
// Shortcuts for chat commands
|
||||
{"b", 3},
|
||||
{"g", 1},
|
||||
{"o", 7},
|
||||
{"pi", 5},
|
||||
{"pu", 4},
|
||||
{"r", 6},
|
||||
{"s", 2},
|
||||
{"v", 0},
|
||||
{"w", 9},
|
||||
{"y", 8},
|
||||
});
|
||||
{"b", 3}, {"g", 1}, {"o", 7}, {"pi", 5}, {"pu", 4}, {"r", 6}, {"s", 2}, {"v", 0}, {"w", 9}, {"y", 8}});
|
||||
|
||||
const vector<string> lobby_event_to_name = {
|
||||
"none", "xmas", "none", "val", "easter", "hallo", "sonic", "newyear",
|
||||
"summer", "white", "wedding", "fall", "s-spring", "s-summer", "spring"};
|
||||
|
||||
const unordered_map<string, uint8_t> name_to_lobby_event({
|
||||
{"none", 0},
|
||||
{"xmas", 1},
|
||||
{"val", 3},
|
||||
{"easter", 4},
|
||||
{"hallo", 5},
|
||||
{"sonic", 6},
|
||||
{"newyear", 7},
|
||||
{"summer", 8},
|
||||
{"white", 9},
|
||||
{"wedding", 10},
|
||||
{"fall", 11},
|
||||
{"s-spring", 12},
|
||||
{"s-summer", 13},
|
||||
{"spring", 14},
|
||||
});
|
||||
const unordered_map<string, uint8_t> name_to_lobby_event = {
|
||||
{"none", 0}, {"xmas", 1}, {"val", 3}, {"easter", 4}, {"hallo", 5}, {"sonic", 6}, {"newyear", 7}, {"summer", 8},
|
||||
{"white", 9}, {"wedding", 10}, {"fall", 11}, {"s-spring", 12}, {"s-summer", 13}, {"spring", 14}};
|
||||
|
||||
const unordered_map<uint8_t, string> lobby_type_to_name({
|
||||
{0x00, "normal"},
|
||||
{0x0F, "inormal"},
|
||||
{0x10, "ipc"},
|
||||
{0x11, "iball"},
|
||||
{0x67, "cave2u"},
|
||||
{0xD4, "cave1"},
|
||||
{0xE9, "planet"},
|
||||
{0xEA, "clouds"},
|
||||
{0xED, "cave"},
|
||||
{0xEE, "jungle"},
|
||||
{0xEF, "forest2-2"},
|
||||
{0xF0, "forest2-1"},
|
||||
{0xF1, "windpower"},
|
||||
{0xF2, "overview"},
|
||||
{0xF3, "seaside"},
|
||||
{0xF4, "fons"},
|
||||
{0xF5, "dmorgue"},
|
||||
{0xF6, "caelum"},
|
||||
{0xF8, "cyber"},
|
||||
{0xF9, "boss1"},
|
||||
{0xFA, "boss2"},
|
||||
{0xFB, "dolor"},
|
||||
{0xFC, "dragon"},
|
||||
{0xFD, "derolle"},
|
||||
{0xFE, "volopt"},
|
||||
{0xFF, "darkfalz"},
|
||||
});
|
||||
const unordered_map<uint8_t, string> lobby_type_to_name = {
|
||||
{0x00, "normal"}, {0x0F, "inormal"}, {0x10, "ipc"}, {0x11, "iball"}, {0x67, "cave2u"}, {0xD4, "cave1"},
|
||||
{0xE9, "planet"}, {0xEA, "clouds"}, {0xED, "cave"}, {0xEE, "jungle"}, {0xEF, "forest2-2"}, {0xF0, "forest2-1"},
|
||||
{0xF1, "windpower"}, {0xF2, "overview"}, {0xF3, "seaside"}, {0xF4, "fons"}, {0xF5, "dmorgue"}, {0xF6, "caelum"},
|
||||
{0xF8, "cyber"}, {0xF9, "boss1"}, {0xFA, "boss2"}, {0xFB, "dolor"}, {0xFC, "dragon"}, {0xFD, "derolle"},
|
||||
{0xFE, "volopt"}, {0xFF, "darkfalz"}};
|
||||
|
||||
const unordered_map<string, uint8_t> name_to_lobby_type({
|
||||
{"normal", 0x00},
|
||||
{"inormal", 0x0F},
|
||||
{"ipc", 0x10},
|
||||
{"iball", 0x11},
|
||||
{"cave1", 0xD4},
|
||||
{"cave2u", 0x67},
|
||||
{"dragon", 0xFC},
|
||||
{"derolle", 0xFD},
|
||||
{"volopt", 0xFE},
|
||||
{"darkfalz", 0xFF},
|
||||
{"planet", 0xE9},
|
||||
{"clouds", 0xEA},
|
||||
{"cave", 0xED},
|
||||
{"jungle", 0xEE},
|
||||
{"forest2-2", 0xEF},
|
||||
{"forest2-1", 0xF0},
|
||||
{"windpower", 0xF1},
|
||||
{"overview", 0xF2},
|
||||
{"seaside", 0xF3},
|
||||
{"fons", 0xF4},
|
||||
{"dmorgue", 0xF5},
|
||||
{"caelum", 0xF6},
|
||||
{"cyber", 0xF8},
|
||||
{"boss1", 0xF9},
|
||||
{"boss2", 0xFA},
|
||||
{"dolor", 0xFB},
|
||||
{"ravum", 0xFC},
|
||||
{"sky", 0xFE},
|
||||
{"morgue", 0xFF},
|
||||
});
|
||||
const unordered_map<string, uint8_t> name_to_lobby_type = {
|
||||
{"normal", 0x00}, {"inormal", 0x0F}, {"ipc", 0x10}, {"iball", 0x11}, {"cave1", 0xD4}, {"cave2u", 0x67},
|
||||
{"dragon", 0xFC}, {"derolle", 0xFD}, {"volopt", 0xFE}, {"darkfalz", 0xFF}, {"planet", 0xE9}, {"clouds", 0xEA},
|
||||
{"cave", 0xED}, {"jungle", 0xEE}, {"forest2-2", 0xEF}, {"forest2-1", 0xF0}, {"windpower", 0xF1},
|
||||
{"overview", 0xF2}, {"seaside", 0xF3}, {"fons", 0xF4}, {"dmorgue", 0xF5}, {"caelum", 0xF6}, {"cyber", 0xF8},
|
||||
{"boss1", 0xF9}, {"boss2", 0xFA}, {"dolor", 0xFB}, {"ravum", 0xFC}, {"sky", 0xFE}, {"morgue", 0xFF}};
|
||||
|
||||
const vector<string> npc_id_to_name({
|
||||
"ninja",
|
||||
"rico",
|
||||
"sonic",
|
||||
"knuckles",
|
||||
"tails",
|
||||
"flowen",
|
||||
"elly",
|
||||
"momoka",
|
||||
"irene",
|
||||
"guild",
|
||||
"nurse",
|
||||
});
|
||||
const vector<string> npc_id_to_name = {
|
||||
"ninja", "rico", "sonic", "knuckles", "tails", "flowen", "elly", "momoka", "irene", "guild", "nurse"};
|
||||
|
||||
const unordered_map<string, uint8_t> name_to_npc_id = {
|
||||
{"ninja", 0},
|
||||
{"rico", 1},
|
||||
{"sonic", 2},
|
||||
{"knuckles", 3},
|
||||
{"tails", 4},
|
||||
{"flowen", 5},
|
||||
{"elly", 6},
|
||||
{"momoka", 7},
|
||||
{"irene", 8},
|
||||
{"guild", 9},
|
||||
{"nurse", 10},
|
||||
};
|
||||
{"ninja", 0}, {"rico", 1}, {"sonic", 2}, {"knuckles", 3}, {"tails", 4}, {"flowen", 5}, {"elly", 6}, {"momoka", 7},
|
||||
{"irene", 8}, {"guild", 9}, {"nurse", 10}};
|
||||
|
||||
bool npc_valid_for_version(uint8_t npc, Version version) {
|
||||
switch (version) {
|
||||
@@ -393,19 +293,8 @@ uint8_t npc_for_name(const string& name, Version version) {
|
||||
|
||||
const char* name_for_char_class(uint8_t cls) {
|
||||
static const array<const char*, 12> names = {
|
||||
"HUmar",
|
||||
"HUnewearl",
|
||||
"HUcast",
|
||||
"RAmar",
|
||||
"RAcast",
|
||||
"RAcaseal",
|
||||
"FOmarl",
|
||||
"FOnewm",
|
||||
"FOnewearl",
|
||||
"HUcaseal",
|
||||
"FOmar",
|
||||
"RAmarl",
|
||||
};
|
||||
"HUmar", "HUnewearl", "HUcast", "RAmar", "RAcast", "RAcaseal", "FOmarl", "FOnewm", "FOnewearl", "HUcaseal",
|
||||
"FOmar", "RAmarl"};
|
||||
try {
|
||||
return names.at(cls);
|
||||
} catch (const out_of_range&) {
|
||||
@@ -415,19 +304,7 @@ const char* name_for_char_class(uint8_t cls) {
|
||||
|
||||
const char* abbreviation_for_char_class(uint8_t cls) {
|
||||
static const array<const char*, 12> names = {
|
||||
"HUmr",
|
||||
"HUnl",
|
||||
"HUct",
|
||||
"RAmr",
|
||||
"RAct",
|
||||
"RAcl",
|
||||
"FOml",
|
||||
"FOnm",
|
||||
"FOnl",
|
||||
"HUcl",
|
||||
"FOmr",
|
||||
"RAml",
|
||||
};
|
||||
"HUmr", "HUnl", "HUct", "RAmr", "RAct", "RAcl", "FOml", "FOnm", "FOnl", "HUcl", "FOmr", "RAml"};
|
||||
try {
|
||||
return names.at(cls);
|
||||
} catch (const out_of_range&) {
|
||||
@@ -489,8 +366,7 @@ bool char_class_is_force(uint8_t cls) {
|
||||
}
|
||||
|
||||
const char* name_for_difficulty(Difficulty difficulty) {
|
||||
static const array<const char*, 4> names = {
|
||||
"Normal", "Hard", "Very Hard", "Ultimate"};
|
||||
static const array<const char*, 4> names = {"Normal", "Hard", "Very Hard", "Ultimate"};
|
||||
try {
|
||||
return names.at(static_cast<size_t>(difficulty));
|
||||
} catch (const out_of_range&) {
|
||||
@@ -499,8 +375,7 @@ const char* name_for_difficulty(Difficulty difficulty) {
|
||||
}
|
||||
|
||||
const char* token_name_for_difficulty(Difficulty difficulty) {
|
||||
static const array<const char*, 4> names = {
|
||||
"Normal", "Hard", "VeryHard", "Ultimate"};
|
||||
static const array<const char*, 4> names = {"Normal", "Hard", "VeryHard", "Ultimate"};
|
||||
try {
|
||||
return names.at(static_cast<size_t>(difficulty));
|
||||
} catch (const out_of_range&) {
|
||||
@@ -518,14 +393,8 @@ char abbreviation_for_difficulty(Difficulty difficulty) {
|
||||
}
|
||||
|
||||
const char* name_for_language(Language language) {
|
||||
array<const char*, 8> names = {{"Japanese",
|
||||
"English",
|
||||
"German",
|
||||
"French",
|
||||
"Spanish",
|
||||
"Simplified Chinese",
|
||||
"Traditional Chinese",
|
||||
"Korean"}};
|
||||
array<const char*, 8> names = {
|
||||
"Japanese", "English", "German", "French", "Spanish", "Simplified Chinese", "Traditional Chinese", "Korean"};
|
||||
size_t lang_index = static_cast<size_t>(language);
|
||||
return (lang_index < 8) ? names[lang_index] : "Unknown";
|
||||
}
|
||||
@@ -599,33 +468,13 @@ Language language_for_name(const string& name) {
|
||||
}
|
||||
|
||||
const vector<string> tech_id_to_name = {
|
||||
"foie", "gifoie", "rafoie",
|
||||
"barta", "gibarta", "rabarta",
|
||||
"zonde", "gizonde", "razonde",
|
||||
"grants", "deband", "jellen", "zalure", "shifta",
|
||||
"ryuker", "resta", "anti", "reverser", "megid"};
|
||||
"foie", "gifoie", "rafoie", "barta", "gibarta", "rabarta", "zonde", "gizonde", "razonde", "grants", "deband",
|
||||
"jellen", "zalure", "shifta", "ryuker", "resta", "anti", "reverser", "megid"};
|
||||
|
||||
const unordered_map<string, uint8_t> name_to_tech_id({
|
||||
{"foie", 0},
|
||||
{"gifoie", 1},
|
||||
{"rafoie", 2},
|
||||
{"barta", 3},
|
||||
{"gibarta", 4},
|
||||
{"rabarta", 5},
|
||||
{"zonde", 6},
|
||||
{"gizonde", 7},
|
||||
{"razonde", 8},
|
||||
{"grants", 9},
|
||||
{"deband", 10},
|
||||
{"jellen", 11},
|
||||
{"zalure", 12},
|
||||
{"shifta", 13},
|
||||
{"ryuker", 14},
|
||||
{"resta", 15},
|
||||
{"anti", 16},
|
||||
{"reverser", 17},
|
||||
{"megid", 18},
|
||||
});
|
||||
const unordered_map<string, uint8_t> name_to_tech_id = {
|
||||
{"foie", 0}, {"gifoie", 1}, {"rafoie", 2}, {"barta", 3}, {"gibarta", 4}, {"rabarta", 5}, {"zonde", 6},
|
||||
{"gizonde", 7}, {"razonde", 8}, {"grants", 9}, {"deband", 10}, {"jellen", 11}, {"zalure", 12}, {"shifta", 13},
|
||||
{"ryuker", 14}, {"resta", 15}, {"anti", 16}, {"reverser", 17}, {"megid", 18}};
|
||||
|
||||
const string& name_for_technique(uint8_t tech) {
|
||||
try {
|
||||
@@ -652,49 +501,15 @@ uint8_t technique_for_name(const string& name) {
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
const vector<const char*> name_for_mag_color({
|
||||
/* 00 */ "red",
|
||||
/* 01 */ "blue",
|
||||
/* 02 */ "yellow",
|
||||
/* 03 */ "green",
|
||||
/* 04 */ "purple",
|
||||
/* 05 */ "black",
|
||||
/* 06 */ "white",
|
||||
/* 07 */ "cyan",
|
||||
/* 08 */ "brown",
|
||||
/* 09 */ "orange",
|
||||
/* 0A */ "light-blue",
|
||||
/* 0B */ "olive",
|
||||
/* 0C */ "turquoise",
|
||||
/* 0D */ "fuchsia",
|
||||
/* 0E */ "grey",
|
||||
/* 0F */ "cream",
|
||||
/* 10 */ "pink",
|
||||
/* 11 */ "dark-green",
|
||||
/* 12 */ "costume",
|
||||
});
|
||||
const vector<const char*> name_for_mag_color = {
|
||||
"red", "blue", "yellow", "green", "purple", "black", "white", "cyan", "brown", "orange", "light-blue", "olive",
|
||||
"turquoise", "fuchsia", "grey", "cream", "pink", "dark-green", "costume"};
|
||||
|
||||
const unordered_map<string, uint8_t> mag_color_for_name({
|
||||
{"red", 0x00},
|
||||
{"blue", 0x01},
|
||||
{"yellow", 0x02},
|
||||
{"green", 0x03},
|
||||
{"purple", 0x04},
|
||||
{"black", 0x05},
|
||||
{"white", 0x06},
|
||||
{"cyan", 0x07},
|
||||
{"brown", 0x08},
|
||||
{"orange", 0x09},
|
||||
{"light-blue", 0x0A},
|
||||
{"olive", 0x0B},
|
||||
{"turquoise", 0x0C},
|
||||
{"fuchsia", 0x0D},
|
||||
{"grey", 0x0E},
|
||||
{"cream", 0x0F},
|
||||
{"pink", 0x10},
|
||||
{"dark-green", 0x11},
|
||||
{"costume-color", 0x12},
|
||||
});
|
||||
const unordered_map<string, uint8_t> mag_color_for_name = {
|
||||
{"red", 0x00}, {"blue", 0x01}, {"yellow", 0x02}, {"green", 0x03}, {"purple", 0x04}, {"black", 0x05},
|
||||
{"white", 0x06}, {"cyan", 0x07}, {"brown", 0x08}, {"orange", 0x09}, {"light-blue", 0x0A}, {"olive", 0x0B},
|
||||
{"turquoise", 0x0C}, {"fuchsia", 0x0D}, {"grey", 0x0E}, {"cream", 0x0F}, {"pink", 0x10}, {"dark-green", 0x11},
|
||||
{"costume-color", 0x12}};
|
||||
|
||||
static constexpr uint8_t F_CITY = FloorDefinition::Flag::CITY;
|
||||
static constexpr uint8_t F_LOBBY = FloorDefinition::Flag::LOBBY;
|
||||
@@ -836,8 +651,7 @@ size_t FloorDefinition::limit_for_episode(Episode ep) {
|
||||
}
|
||||
|
||||
uint32_t class_flags_for_class(uint8_t char_class) {
|
||||
static constexpr uint8_t flags[12] = {
|
||||
0x25, 0x2A, 0x31, 0x45, 0x51, 0x52, 0x86, 0x89, 0x8A, 0x32, 0x85, 0x46};
|
||||
static constexpr uint8_t flags[12] = {0x25, 0x2A, 0x31, 0x45, 0x51, 0x52, 0x86, 0x89, 0x8A, 0x32, 0x85, 0x46};
|
||||
if (char_class >= 12) {
|
||||
throw runtime_error("invalid character class");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user