1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-03 23:19:22 +02:00

* campaign against magic numbers

* ArtifactID was misleading and wrongly used in one place -- renamed and fixed
* minor changes
This commit is contained in:
mateuszb
2012-09-23 18:01:04 +00:00
parent 3fcba4fb5c
commit 6a81c8b1af
32 changed files with 567 additions and 511 deletions

View File

@@ -337,16 +337,12 @@ void CCampaignScenario::prepareCrossoverHeroes( std::vector<CGHeroInstance *> he
//trimming prim skills
BOOST_FOREACH(CGHeroInstance * cgh, crossoverHeroes)
{
#define RESET_PRIM_SKILL(NAME, VALNAME) \
cgh->getBonusLocalFirst(Selector::type(Bonus::PRIMARY_SKILL) && \
Selector::subtype(PrimarySkill::NAME) && \
Selector::sourceType(Bonus::HERO_BASE_SKILL) )->val = cgh->type->heroClass->VALNAME;
RESET_PRIM_SKILL(ATTACK, initialAttack);
RESET_PRIM_SKILL(DEFENSE, initialDefence);
RESET_PRIM_SKILL(SPELL_POWER, initialPower);
RESET_PRIM_SKILL(KNOWLEDGE, initialKnowledge);
#undef RESET_PRIM_SKILL
for(int g=0; g<GameConstants::PRIMARY_SKILLS; ++g)
{
cgh->getBonusLocalFirst(Selector::type(Bonus::PRIMARY_SKILL) &&
Selector::subtype(g) && Selector::sourceType(Bonus::HERO_BASE_SKILL) )->val
= cgh->type->heroClass->initialPrimSkills[g];
}
}
}
if (!(travelOptions.whatHeroKeeps & 4))