Mercurial > mm7
diff Player.cpp @ 1875:1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
author | Grumpy7 |
---|---|
date | Thu, 17 Oct 2013 08:55:28 +0200 |
parents | 351b4ff10ac1 |
children | 2070d01ccfae |
line wrap: on
line diff
--- a/Player.cpp Thu Oct 17 07:57:01 2013 +0200 +++ b/Player.cpp Thu Oct 17 08:55:28 2013 +0200 @@ -7246,7 +7246,7 @@ //----- (00439FCB) -------------------------------------------------------- -void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int element, Vec3_int_ *pPos, unsigned int a4) +void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int dmgSource, Vec3_int_ *pPos, unsigned int a4) { Player *playerPtr; // ebx@3 Actor *actorPtr; // esi@3 @@ -7297,7 +7297,7 @@ } } pAudioPlayer->PlaySound(soundToPlay, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); - int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, element); + int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, dmgSource); if ( actorPtr->pActorBuffs[3].uExpireTime > 0 ) { __int16 spellPower = actorPtr->pActorBuffs[3].uPower; @@ -7305,7 +7305,7 @@ dmgToReceive /= (signed int)spellPower; } int damageType; - switch (element) + switch (dmgSource) { case 0: damageType = actorPtr->pMonsterInfo.uAttack1Type; break; @@ -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, element); + int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, dmgSource); unsigned __int16 spriteType = v37->uType; if ( v37->uType == 545 ) { @@ -7492,7 +7492,7 @@ dmgToReceive /= (signed int)spellPower; } int damageType; - switch(element) + switch(dmgSource) { case 0: damageType = actorPtr->pMonsterInfo.uAttack1Type; @@ -7553,7 +7553,7 @@ } } } - if ( !element + if ( !dmgSource && !(dword_6BE368_debug_settings_2 & 0x10) && actorPtr->pMonsterInfo.uSpecialAttackType && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackLevel )