Mercurial > mm7
diff mm7_6.cpp @ 2291:69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
author | Grumpy7 |
---|---|
date | Sun, 16 Mar 2014 19:11:52 +0100 |
parents | aff7a7b072b7 |
children | ab8797ea43b6 |
line wrap: on
line diff
--- a/mm7_6.cpp Sun Mar 16 03:08:26 2014 +0100 +++ b/mm7_6.cpp Sun Mar 16 19:11:52 2014 +0100 @@ -39,84 +39,6 @@ -//----- (004272F5) -------------------------------------------------------- -int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) -{ - signed int v5; // esi@1 - signed int v6; // edi@1 - int v7; // esi@8 - int v8; // eax@9 - int v9; // edx@11 - unsigned __int8 v12; // sf@13 - unsigned __int8 v13; // of@13 - int v14; // edx@14 - int v15; // eax@14 - signed int result; // eax@17 - - v5 = pActor->pMonsterInfo.uAC; - v6 = 0; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 ) - v5 /= 2; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) - v6 = pActor->pActorBuffs[ACTOR_BUFF_SHIELD].uPower; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v6 ) - v6 = pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; - v7 = v6 + v5; - if ( a3 ) - v8 = pPlayer->GetRangedAttack(); - else - v8 = pPlayer->GetActualAttack(false); - v9 = rand() % (v7 + 2 * v8 + 30); - if ( a3 == 2 ) - { - v14 = a4 + v9; - v15 = ((v7 + 15) / 2) + v7 + 15; - v13 = __OFSUB__(v14, v15); - v12 = v14 - v15 < 0; - } - else if ( a3 == 3 ) - { - v14 = a4 + v9; - v15 = 2 * v7 + 30; - v13 = __OFSUB__(v14, v15); - v12 = v14 - v15 < 0; - } - else - { - v14 = a4 + v9; - v15 = v7 + 15; - v13 = __OFSUB__(v14, v15); - v12 = v14 - v15 < 0; - } - - if ( v12 ^ v13 ) - result = 0; - else - result = 1; - return result; -} - -//----- (004274AD) -------------------------------------------------------- -bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) -{ - signed int v3; // edi@1 - signed int v4; // esi@8 - int v5; // esi@8 - - v3 = 0; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) - v3 = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower > v3 ) - v3 = pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 ) - { - v3 += pActor->pActorBuffs[ACTOR_BUFF_FATE].uPower; - pActor->pActorBuffs[ACTOR_BUFF_FATE].Reset(); - } - v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; - v5 = rand() % v4 + 1; - return v3 + v5 > pPlayer->GetActualAC() + 5; -} //----- (00427546) -------------------------------------------------------- int stru319::_427546(int a2)