1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

* jousting support

This commit is contained in:
mateuszb
2009-08-22 15:29:30 +00:00
parent ef8f2e695f
commit 56fe3b0547
4 changed files with 28 additions and 15 deletions

View File

@ -1898,7 +1898,7 @@ bool CGameState::checkForVisitableDir(const int3 & src, const int3 & dst) const
return true;
}
int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, const CGHeroInstance * attackerHero, const CGHeroInstance * defendingHero, bool shooting)
int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, const CGHeroInstance * attackerHero, const CGHeroInstance * defendingHero, bool shooting, ui8 charge)
{
int attackDefenseBonus,
minDmg = attacker->creature->damageMin * attacker->amount,
@ -1986,6 +1986,10 @@ int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, con
float dmgBonusMultiplier = 1.0f;
//applying jousting bonus
if( attacker->hasFeatureOfType(StackFeature::JOUSTING) && !defender->hasFeatureOfType(StackFeature::CHARGE_IMMUNITY) )
dmgBonusMultiplier += charge * 0.05f;
//bonus from attack/defense skills
if(attackDefenseBonus < 0) //decreasing dmg
{