Mercurial > mm7
changeset 1876:2070d01ccfae
Actor::_43B3E0_CalcDamage changed to non-static
author | Grumpy7 |
---|---|
date | Thu, 17 Oct 2013 09:00:11 +0200 |
parents | 1d9e4b50bc7c |
children | bed4532cfe59 |
files | Actor.cpp Actor.h Player.cpp mm7_5.cpp |
diffstat | 4 files changed, 24 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Thu Oct 17 08:55:28 2013 +0200 +++ b/Actor.cpp Thu Oct 17 09:00:11 2013 +0200 @@ -1393,7 +1393,7 @@ } //----- (0043B3E0) -------------------------------------------------------- -int Actor::_43B3E0_CalcDamage(Actor *a1, signed int dmgSource) +int Actor::_43B3E0_CalcDamage( signed int dmgSource ) { signed int v2; // ebp@1 int v3; // eax@9 @@ -1410,37 +1410,37 @@ switch( dmgSource ) { case 0: - if ( a1->pActorBuffs[14].uExpireTime > 0 ) - v2 = a1->pActorBuffs[14].uPower; - if ( a1->pActorBuffs[18].uExpireTime > 0 && a1->pActorBuffs[18].uPower > v2 ) - v2 = a1->pActorBuffs[18].uPower; - if ( a1->pActorBuffs[21].uExpireTime > 0 ) - v2 += a1->pActorBuffs[21].uPower; - v3 = a1->pMonsterInfo.uAttack1DamageDiceRolls; - v4 = a1->pMonsterInfo.uAttack1DamageDiceSides; - v5 = a1->pMonsterInfo.uAttack1DamageBonus; + if ( this->pActorBuffs[14].uExpireTime > 0 ) + v2 = this->pActorBuffs[14].uPower; + if ( this->pActorBuffs[18].uExpireTime > 0 && this->pActorBuffs[18].uPower > v2 ) + v2 = this->pActorBuffs[18].uPower; + if ( this->pActorBuffs[21].uExpireTime > 0 ) + v2 += this->pActorBuffs[21].uPower; + v3 = this->pMonsterInfo.uAttack1DamageDiceRolls; + v4 = this->pMonsterInfo.uAttack1DamageDiceSides; + v5 = this->pMonsterInfo.uAttack1DamageBonus; break; case 1: - v3 = a1->pMonsterInfo.uAttack2DamageDiceRolls; - v4 = a1->pMonsterInfo.uAttack2DamageDiceSides; - v5 = a1->pMonsterInfo.uAttack2DamageBonus; + v3 = this->pMonsterInfo.uAttack2DamageDiceRolls; + v4 = this->pMonsterInfo.uAttack2DamageDiceSides; + v5 = this->pMonsterInfo.uAttack2DamageBonus; break; case 2: - v8 = a1->pMonsterInfo.uSpellSkillAndMastery1; - v9 = a1->pMonsterInfo.uSpell1ID; + v8 = this->pMonsterInfo.uSpellSkillAndMastery1; + v9 = this->pMonsterInfo.uSpell1ID; v10 = SkillToMastery(v8); return _43AFE3_calc_spell_damage(v9, v8 & 0x3F, v10, 0); break; case 3: - v8 = a1->pMonsterInfo.uSpellSkillAndMastery2; - v9 = a1->pMonsterInfo.uSpell2ID; + v8 = this->pMonsterInfo.uSpellSkillAndMastery2; + v9 = this->pMonsterInfo.uSpell2ID; v10 = SkillToMastery(v8); return _43AFE3_calc_spell_damage(v9, v8 & 0x3F, v10, 0); break; case 4: - v3 = a1->pMonsterInfo.uSpecialAbilityDamageDiceRolls; - v4 = a1->pMonsterInfo.uSpecialAbilityDamageDiceSides; - v5 = a1->pMonsterInfo.uSpecialAbilityDamageDiceBonus; + v3 = this->pMonsterInfo.uSpecialAbilityDamageDiceRolls; + v4 = this->pMonsterInfo.uSpecialAbilityDamageDiceSides; + v5 = this->pMonsterInfo.uSpecialAbilityDamageDiceBonus; default: return 0; }
--- a/Actor.h Thu Oct 17 08:55:28 2013 +0200 +++ b/Actor.h Thu Oct 17 09:00:11 2013 +0200 @@ -242,7 +242,7 @@ static void ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle); static void ApplyFineForKillingPeasant(unsigned int uActorID); static void DrawHealthBar(Actor *actor, struct GUIWindow *window); - static int _43B3E0_CalcDamage(Actor *a1, signed int a2); + int _43B3E0_CalcDamage(signed int dmgSource); static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3);
--- a/Player.cpp Thu Oct 17 08:55:28 2013 +0200 +++ b/Player.cpp Thu Oct 17 09:00:11 2013 +0200 @@ -7297,7 +7297,7 @@ } } pAudioPlayer->PlaySound(soundToPlay, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); - int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, dmgSource); + int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource); if ( actorPtr->pActorBuffs[3].uExpireTime > 0 ) { __int16 spellPower = actorPtr->pActorBuffs[3].uPower; @@ -7437,7 +7437,7 @@ if ( a4 == -1 ) a4 = stru_50C198.which_player_would_attack(actorPtr); Player *playerPtr = &pParty->pPlayers[a4]; - int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, dmgSource); + int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource); unsigned __int16 spriteType = v37->uType; if ( v37->uType == 545 ) {
--- a/mm7_5.cpp Thu Oct 17 08:55:28 2013 +0200 +++ b/mm7_5.cpp Thu Oct 17 09:00:11 2013 +0200 @@ -3983,7 +3983,7 @@ v6 = stru_50C198._4273BB(v8, v7, v4, 0); if ( v6 ) { - v10 = (unsigned int)Actor::_43B3E0_CalcDamage(v8, a4); + v10 = (unsigned int)v8->_43B3E0_CalcDamage(a4); if ( (signed __int64)v8->pActorBuffs[3].uExpireTime > 0 ) { v11 = v8->pActorBuffs[3].uPower;