Created
February 10, 2016 01:43
-
-
Save sigsegv-mvm/2e92634d436d804c6526 to your computer and use it in GitHub Desktop.
MvM item schema code excerpts (as of 20160202a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum EMvMChallengeDifficulty | |
{ | |
MVM_D_NORMAL = 1, | |
MVM_D_INTERMEDIATE = 2, | |
MVM_D_ADVANCED = 3, | |
MVM_D_EXPERT = 4, | |
MVM_D_HAUNTED = 5, | |
MVM_D_INVALID = -1, | |
}; | |
EMvMChallengeDifficulty GetMvMChallengeDifficultyByInternalName(const char *name) | |
{ | |
if (V_stricmp(name, "normal") == 0) return MVM_D_NORMAL; | |
if (V_stricmp(name, "intermediate") == 0) return MVM_D_INTERMEDIATE; | |
if (V_stricmp(name, "advanced") == 0) return MVM_D_ADVANCED; | |
if (V_stricmp(name, "expert") == 0) return MVM_D_EXPERT; | |
if (V_stricmp(name, "nightmare") == 0) return MVM_D_NIGHTMARE; | |
return MVM_D_INVALID; | |
} | |
EMvMChallengeDifficulty GetMvMChallengeDifficultyLocName(EMvMChallengeDifficulty difficulty) | |
{ | |
switch (difficulty) { | |
default: | |
case MVM_D_NORMAL: | |
return "#TF_MvM_Normal"; | |
// tf_english.txt: "Normal" | |
case MVM_D_INTERMEDIATE: | |
return "#TF_MvM_Intermediate"; | |
// tf_english.txt: "Intermediate" | |
case MVM_D_ADVANCED: | |
return "#TF_MvM_Advanced"; | |
// tf_english.txt: "Advanced" | |
case MVM_D_EXPERT: | |
return "#TF_MvM_Expert"; | |
// tf_english.txt: "Expert" | |
case MVM_D_HAUNTED: | |
return "#TF_MvM_Haunted"; | |
// tf_english.txt: "Nightmare" | |
} | |
} | |
static const char *const s_pszMvMBadgeContractLevelAttributes[] = { | |
nullptr, | |
"mvm contract level intermediate", | |
"mvm contract level advanced", | |
"mvm contract level expert", | |
nullptr, | |
}; | |
const char *CTFItemSchema::GetMvMBadgeContractLevelAttributeName(EMvMChallengeDifficulty difficulty) | |
{ | |
if (difficulty == MVM_D_INVALID) { | |
return nullptr; | |
} | |
return s_pszMvMBadgeContractLevelAttributes[difficulty - 1]; | |
} | |
static const char *const s_pszMvMBadgeContractPointsAttributes[] = { | |
nullptr, | |
"mvm contract points intermediate", | |
"mvm contract points advanced", | |
"mvm contract points expert", | |
nullptr, | |
}; | |
const char *CTFItemSchema::GetMvMBadgeContractPointsAttributeName(EMvMChallengeDifficulty difficulty) | |
{ | |
if (difficulty == MVM_D_INVALID) { | |
return nullptr; | |
} | |
return s_pszMvMBadgeContractPointsAttributes[difficulty - 1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment