1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

* new spell: blind

* a part of hypnotize support
* minor changes and bugfixes
This commit is contained in:
mateuszb
2009-08-07 11:22:17 +00:00
parent 9d531b0d84
commit 0787b6a79b
6 changed files with 79 additions and 18 deletions

View File

@ -1861,7 +1861,7 @@ bool CGameState::checkForVisitableDir(const int3 & src, const int3 & dst) const
int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, const CGHeroInstance * attackerHero, const CGHeroInstance * defendingHero, bool shooting)
{
int attackDefenseBonus = attacker->Attack() - defender->Defense(),
int attackDefenseBonus,
minDmg = attacker->creature->damageMin * attacker->amount,
maxDmg = attacker->creature->damageMax * attacker->amount;
@ -1871,6 +1871,15 @@ int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, con
maxDmg *= attackerHero->getPrimSkillLevel(0) + 1;
}
if(attacker->hasFeatureOfType(StackFeature::GENERAL_ATTACK_REDUCTION))
{
attackDefenseBonus = attacker->Attack() * (attacker->valOfFeatures(StackFeature::GENERAL_ATTACK_REDUCTION, -1024) / 100.0f) - defender->Defense();
}
else
{
attackDefenseBonus = attacker->Attack() - defender->Defense();
}
//calculating total attack/defense skills modifier
if(!shooting && attacker->hasFeatureOfType(StackFeature::ATTACK_BONUS, 0)) //bloodlust handling (etc.)
@ -1883,6 +1892,7 @@ int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, con
attackDefenseBonus += attacker->valOfFeatures(StackFeature::ATTACK_BONUS, 1);
}
if(attacker->getEffect(55)) //slayer handling
{
std::vector<int> affectedIds;