mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
@@ -1106,7 +1106,7 @@ void CGHeroInstance::initObj()
|
||||
}
|
||||
//initialize bonuses
|
||||
for (std::vector<std::pair<ui8,ui8> >::iterator it = secSkills.begin(); it != secSkills.end(); it++)
|
||||
updateSkill(it->first, it->second, true);
|
||||
updateSkill(it->first, it->second);
|
||||
UpdateSpeciality();
|
||||
}
|
||||
void CGHeroInstance::UpdateSpeciality()
|
||||
@@ -1153,7 +1153,7 @@ void CGHeroInstance::UpdateSpeciality()
|
||||
}
|
||||
}
|
||||
}
|
||||
void CGHeroInstance::updateSkill(int which, int val, bool abs)
|
||||
void CGHeroInstance::updateSkill(int which, int val)
|
||||
{
|
||||
int skillVal = 0;
|
||||
switch (which)
|
||||
@@ -1192,15 +1192,17 @@ void CGHeroInstance::updateSkill(int which, int val, bool abs)
|
||||
case 27: //First Aid
|
||||
skillVal = 25 + 25*val; break;
|
||||
}
|
||||
if(!hasBonusOfType(Bonus::SECONDARY_SKILL_PREMY, which))
|
||||
if (skillVal) //we don't need bonuses of other types here
|
||||
{
|
||||
bonuses.push_back
|
||||
(Bonus(Bonus::PERMANENT, Bonus::SECONDARY_SKILL_PREMY, id, skillVal, ID, which, Bonus::BASE_NUMBER));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skillVal)
|
||||
if (hasBonusOfType(Bonus::SECONDARY_SKILL_PREMY, which))
|
||||
{
|
||||
getBonus(Selector::typeSybtype(Bonus::SECONDARY_SKILL_PREMY, which))->val = skillVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
bonuses.push_back
|
||||
(Bonus(Bonus::PERMANENT, Bonus::SECONDARY_SKILL_PREMY, id, skillVal, ID, which, Bonus::BASE_NUMBER));
|
||||
}
|
||||
}
|
||||
}
|
||||
void CGHeroInstance::setPropertyDer( ui8 what, ui32 val )
|
||||
|
@@ -380,7 +380,7 @@ public:
|
||||
void initHeroDefInfo();
|
||||
void pushPrimSkill(int which, int val);
|
||||
void UpdateSpeciality();
|
||||
void updateSkill(int which, int val, bool abs);
|
||||
void updateSkill(int which, int val);
|
||||
|
||||
CGHeroInstance();
|
||||
virtual ~CGHeroInstance();
|
||||
|
@@ -2987,19 +2987,7 @@ ui32 BattleInfo::calculateSpellDmg( const CSpell * sp, const CGHeroInstance * ca
|
||||
//applying sorcerery secondary skill
|
||||
if(caster)
|
||||
{
|
||||
switch(caster->getSecSkillLevel(25))
|
||||
{
|
||||
case 1: //basic
|
||||
ret *= 1.05f;
|
||||
break;
|
||||
case 2: //advanced
|
||||
ret *= 1.1f;
|
||||
break;
|
||||
case 3: //expert
|
||||
ret *= 1.15f;
|
||||
break;
|
||||
}
|
||||
//applying hero bonuses
|
||||
ret *= (100.f + caster->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, 25)) / 100.0f; //mysticism
|
||||
ret *= (100.f + caster->valOfBonuses(Bonus::SPELL_DAMAGE) + caster->valOfBonuses(Bonus::SPECIFIC_SPELL_DAMAGE, sp->id)) / 100.0f;
|
||||
|
||||
if(sp->air)
|
||||
|
@@ -100,7 +100,7 @@ DLL_EXPORT void SetSecSkill::applyGs( CGameState *gs )
|
||||
}
|
||||
}
|
||||
}
|
||||
hero->updateSkill(which, val, abs);
|
||||
hero->updateSkill(which, val);
|
||||
}
|
||||
|
||||
DLL_EXPORT void HeroVisitCastle::applyGs( CGameState *gs )
|
||||
|
@@ -616,7 +616,6 @@ int Mapa::loadSeerHut( const unsigned char * bufor, int i, CGObjectInstance *& n
|
||||
}
|
||||
else //RoE
|
||||
{
|
||||
hut->isCustom = false;
|
||||
int artID = bufor[i]; ++i;
|
||||
if(artID!=255) //not none quest
|
||||
{
|
||||
@@ -625,11 +624,12 @@ int Mapa::loadSeerHut( const unsigned char * bufor, int i, CGObjectInstance *& n
|
||||
}
|
||||
else
|
||||
{
|
||||
hut->missionType = 255;
|
||||
hut->missionType = 0; //no mission
|
||||
}
|
||||
hut->isCustom = false;
|
||||
}
|
||||
|
||||
if(hut->missionType!=255)
|
||||
if(hut->missionType)
|
||||
{
|
||||
unsigned char rewardType = bufor[i]; ++i;
|
||||
hut->rewardType = rewardType;
|
||||
|
Reference in New Issue
Block a user