Mercurial > mm7
diff mm7_6.cpp @ 1911:af38275939cc
which_player_to_attack rename and cleaning
author | Ritor1 |
---|---|
date | Tue, 22 Oct 2013 15:52:01 +0600 |
parents | b6a7410ff0ef |
children | 68f2d9d3a1d9 |
line wrap: on
line diff
--- a/mm7_6.cpp Tue Oct 22 00:04:14 2013 -0700 +++ b/mm7_6.cpp Tue Oct 22 15:52:01 2013 +0600 @@ -203,191 +203,6 @@ pActor->Remove(); } } - -//----- (00426E10) -------------------------------------------------------- -int stru319::which_player_would_attack(Actor *pActor) -{ - signed int v2; // ebx@1 - int v3; // ecx@2 - signed int v4; // edx@3 - char v5; // zf@3 - unsigned int v6; // eax@3 - int v7; // eax@6 - int v8; // eax@7 - int v9; // eax@8 - int v10; // eax@9 - int v11; // eax@10 - int v12; // eax@11 - int v13; // esi@35 - signed int v14; // edi@37 - enum CHARACTER_RACE v15; // eax@44 - Player *v16; // ecx@47 - unsigned __int8 v17; // sf@50 - unsigned __int8 v18; // of@50 - int v19; // esi@52 - Player *v20; // ecx@53 - int result; // eax@57 - int v22[16]; // [sp+8h] [bp-140h]@3 - int v23[60]; // [sp+48h] [bp-100h]@48 - int v24; // [sp+138h] [bp-10h]@2 - int v25; // [sp+13Ch] [bp-Ch]@1 - int v26; // [sp+140h] [bp-8h]@1 - int v27; // [sp+144h] [bp-4h]@1 - - v27 = -1; - v26 = -1; - v25 = -1; - v2 = 0; - if ( pActor->pMonsterInfo.uAttackPreference ) - { - v3 = 0; - v24 = 0; - do - { - v4 = 1; - v6 = pActor->pMonsterInfo.uAttackPreference & (1 << v3); - v5 = (pActor->pMonsterInfo.uAttackPreference & (1 << v3)) == 0; - v22[v3] = v6; - if ( !v5 ) - { - if ( (signed int)v6 > 128 ) - { - switch ( v6 ) - { - case 0x100u: - v27 = 8; - break; - case 0x200u: - v25 = 0; - break; - case 0x400u: - v25 = 1; - break; - case 0x800u: - v26 = 0; - break; - case 0x1000u: - v26 = 1; - break; - case 0x2000u: - v26 = 3; - break; - case 0x4000u: - v26 = 2; - break; - } - } - else - { - if ( v6 == 128 ) - { - v27 = 4; - } - else - { - v7 = v6 - 1; - if ( v7 ) - { - v8 = v7 - 1; - if ( v8 ) - { - v9 = v8 - 2; - if ( v9 ) - { - v10 = v9 - 4; - if ( v10 ) - { - v11 = v10 - 8; - if ( v11 ) - { - v12 = v11 - 16; - if ( v12 ) - { - if ( v12 == 32 ) - v27 = 20; - } - else - { - v27 = 32; - } - } - else - { - v27 = 24; - } - } - else - { - v27 = 28; - } - } - else - { - v27 = 16; - } - } - else - { - v27 = 12; - } - } - else - { - v27 = 0; - } - } - } - v2 = 0; - v13 = 0; - while ( 1 ) - { - v14 = 0; - if ( v27 != -1 && v27 == pPlayers[v13 + 1]->classType ) - v14 = v4; - if ( v25 != -1 && v25 == pPlayers[v13 + 1]->uSex ) - v14 = v4; - if ( v26 != -1 ) - { - v15 = pPlayers[v13 + 1]->GetRace(); - if ( v26 == v15 ) - v14 = 1; - } - if ( v14 == 1 ) - { - v16 = pPlayers[v13 + 1]; - if ( !(v16->pConditions[12] | v16->pConditions[13] | v16->pConditions[14] | v16->pConditions[15] | v16->pConditions[16]) ) - v23[v2++] = v13; - } - ++v13; - if ( v13 >= 4 ) - break; - v4 = 1; - } - } - v3 = v24 + 1; - v18 = __OFSUB__(v24 + 1, 15); - v17 = v24++ - 14 < 0; - } - while ( v17 ^ v18 ); - if ( v2 ) - return v23[rand() % v2]; - } - v19 = 0; - do - { - v20 = pPlayers[v19 + 1]; - if ( !(v20->pConditions[12] | v20->pConditions[13] | v20->pConditions[14] | v20->pConditions[15] | v20->pConditions[16]) ) - v23[v2++] = v19; - ++v19; - } - while ( v19 < 4 ); - if ( v2 ) - result = v23[rand() % v2]; - else - result = 0; - return result; -} - //----- (0042704B) -------------------------------------------------------- int stru319::special_ability_use_check( struct Actor *pActor, int a2 ) {