mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
seperate identifier
This commit is contained in:
@@ -305,7 +305,7 @@ void CBonusSelection::createBonusesIcons()
|
||||
}
|
||||
|
||||
case CampaignBonusType::HERO:
|
||||
if(bonDescs[i].info2 == HeroTypeID::RANDOM)
|
||||
if(bonDescs[i].info2 == HeroTypeID::CAMP_RANDOM)
|
||||
{
|
||||
desc.appendLocalString(EMetaText::GENERAL_TXT, 720); // Start with random hero
|
||||
picNumber = -1;
|
||||
|
@@ -281,9 +281,9 @@ static const std::map<std::string, ui32> primarySkillsMap = {
|
||||
};
|
||||
|
||||
static const std::map<std::string, ui16> heroSpecialMap = {
|
||||
{"strongest", HeroTypeID::STRONGEST},
|
||||
{"generated", HeroTypeID::GENERATED},
|
||||
{"random", HeroTypeID::RANDOM}
|
||||
{"strongest", HeroTypeID::CAMP_STRONGEST},
|
||||
{"generated", HeroTypeID::CAMP_GENERATED},
|
||||
{"random", HeroTypeID::CAMP_RANDOM}
|
||||
};
|
||||
|
||||
static const std::map<std::string, ui8> resourceTypeMap = {
|
||||
|
@@ -53,11 +53,12 @@ const BattleID BattleID::NONE(-1);
|
||||
const QueryID QueryID::NONE(-1);
|
||||
const QueryID QueryID::CLIENT(-2);
|
||||
const HeroTypeID HeroTypeID::NONE(-1);
|
||||
const HeroTypeID HeroTypeID::RANDOM(-2);
|
||||
const HeroTypeID HeroTypeID::GEM(27);
|
||||
const HeroTypeID HeroTypeID::SOLMYR(45);
|
||||
const HeroTypeID HeroTypeID::STRONGEST(0xFFFD);
|
||||
const HeroTypeID HeroTypeID::GENERATED(0xFFFE);
|
||||
const HeroTypeID HeroTypeID::RANDOM(0xFFFF);
|
||||
const HeroTypeID HeroTypeID::CAMP_STRONGEST(0xFFFD);
|
||||
const HeroTypeID HeroTypeID::CAMP_GENERATED(0xFFFE);
|
||||
const HeroTypeID HeroTypeID::CAMP_RANDOM(0xFFFF);
|
||||
|
||||
const ObjectInstanceID ObjectInstanceID::NONE(-1);
|
||||
|
||||
|
@@ -102,12 +102,13 @@ public:
|
||||
const HeroType * toEntity(const Services * services) const;
|
||||
|
||||
static const HeroTypeID NONE;
|
||||
static const HeroTypeID RANDOM;
|
||||
static const HeroTypeID GEM; // aka Gem, Sorceress in campaign
|
||||
static const HeroTypeID SOLMYR; // aka Young Yog in campaigns
|
||||
|
||||
static const HeroTypeID STRONGEST;
|
||||
static const HeroTypeID GENERATED;
|
||||
static const HeroTypeID RANDOM;
|
||||
static const HeroTypeID CAMP_STRONGEST;
|
||||
static const HeroTypeID CAMP_GENERATED;
|
||||
static const HeroTypeID CAMP_RANDOM;
|
||||
|
||||
bool isValid() const
|
||||
{
|
||||
|
@@ -209,7 +209,7 @@ void CGameStateCampaign::placeCampaignHeroes()
|
||||
if(it != gameState->scenarioOps->playerInfos.end())
|
||||
{
|
||||
HeroTypeID heroTypeId = HeroTypeID(campaignBonus->info2);
|
||||
if(heroTypeId.getNum() == HeroTypeID::RANDOM) // random bonus hero
|
||||
if(heroTypeId.getNum() == HeroTypeID::CAMP_RANDOM) // random bonus hero
|
||||
{
|
||||
heroTypeId = gameState->pickUnusedHeroTypeRandomly(playerColor);
|
||||
}
|
||||
@@ -529,7 +529,7 @@ void CGameStateCampaign::generateCampaignHeroesToReplace()
|
||||
void CGameStateCampaign::initHeroes()
|
||||
{
|
||||
auto chosenBonus = currentBonus();
|
||||
if (chosenBonus && chosenBonus->isBonusForHero() && chosenBonus->info1 != HeroTypeID::GENERATED) //exclude generated heroes
|
||||
if (chosenBonus && chosenBonus->isBonusForHero() && chosenBonus->info1 != HeroTypeID::CAMP_GENERATED) //exclude generated heroes
|
||||
{
|
||||
//find human player
|
||||
PlayerColor humanPlayer=PlayerColor::NEUTRAL;
|
||||
@@ -545,7 +545,7 @@ void CGameStateCampaign::initHeroes()
|
||||
|
||||
const auto & heroes = gameState->players[humanPlayer].getHeroes();
|
||||
|
||||
if (chosenBonus->info1 == HeroTypeID::STRONGEST) //most powerful
|
||||
if (chosenBonus->info1 == HeroTypeID::CAMP_STRONGEST) //most powerful
|
||||
{
|
||||
int maxB = -1;
|
||||
for (int b=0; b<heroes.size(); ++b)
|
||||
|
@@ -112,9 +112,9 @@ ScenarioProperties::ScenarioProperties(std::shared_ptr<CampaignState> campaignSt
|
||||
{
|
||||
heroSelection.emplace(hero->getId().getNum(), hero->getNameTranslated());
|
||||
});
|
||||
heroSelection.emplace(HeroTypeID::STRONGEST, tr("Strongest").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::GENERATED, tr("Generated").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::RANDOM, tr("Random").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_STRONGEST, tr("Strongest").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_GENERATED, tr("Generated").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_RANDOM, tr("Random").toStdString());
|
||||
|
||||
reloadMapRelatedUi();
|
||||
|
||||
|
@@ -56,9 +56,9 @@ void StartingBonus::initControls()
|
||||
for(auto & hero : map->heroesOnMap)
|
||||
if(hero->getOwner() == color || color == PlayerColor::CANNOT_DETERMINE)
|
||||
heroSelection.emplace(hero->getHeroTypeID(), hero->getNameTranslated());
|
||||
heroSelection.emplace(HeroTypeID::STRONGEST, tr("Strongest").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::GENERATED, tr("Generated").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::RANDOM, tr("Random").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_STRONGEST, tr("Strongest").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_GENERATED, tr("Generated").toStdString());
|
||||
heroSelection.emplace(HeroTypeID::CAMP_RANDOM, tr("Random").toStdString());
|
||||
|
||||
for(auto & hero : heroSelection)
|
||||
{
|
||||
@@ -285,11 +285,11 @@ QString StartingBonus::getBonusListTitle(CampaignBonus bonus, std::shared_ptr<CM
|
||||
{
|
||||
auto getHeroName = [](int id){
|
||||
MetaString tmp;
|
||||
if(id == HeroTypeID::STRONGEST)
|
||||
if(id == HeroTypeID::CAMP_STRONGEST)
|
||||
tmp.appendRawString(tr("strongest hero").toStdString());
|
||||
else if(id == HeroTypeID::GENERATED)
|
||||
else if(id == HeroTypeID::CAMP_GENERATED)
|
||||
tmp.appendRawString(tr("generated hero").toStdString());
|
||||
else if(id == HeroTypeID::RANDOM)
|
||||
else if(id == HeroTypeID::CAMP_RANDOM)
|
||||
tmp.appendRawString(tr("random hero").toStdString());
|
||||
else
|
||||
tmp.appendName(HeroTypeID(id));
|
||||
|
Reference in New Issue
Block a user