Mercurial > mm7
comparison mm7_3.cpp @ 855:cb0b3badc7f7
Слияние
author | Ritor1 |
---|---|
date | Sun, 31 Mar 2013 16:44:01 +0600 |
parents | 06fc66ceecd6 ceef50611567 |
children | e4bd2a0bf08b |
comparison
equal
deleted
inserted
replaced
854:06fc66ceecd6 | 855:cb0b3badc7f7 |
---|---|
896 signed int i; // ebx@57 | 896 signed int i; // ebx@57 |
897 unsigned int v33; // ecx@58 | 897 unsigned int v33; // ecx@58 |
898 //int v34; // ebx@64 | 898 //int v34; // ebx@64 |
899 int v35; // edi@64 | 899 int v35; // edi@64 |
900 int v36; // eax@64 | 900 int v36; // eax@64 |
901 unsigned __int16 v37; // cx@66 | 901 //unsigned __int16 v37; // cx@66 |
902 signed int v38; // edx@71 | 902 signed int v38; // edx@71 |
903 signed int v39; // edi@71 | 903 unsigned int v39; // edi@71 |
904 BSPModel *v40; // eax@75 | 904 BSPModel *v40; // eax@75 |
905 ODMFace *v41; // edi@75 | 905 ODMFace *v41; // edi@75 |
906 int v42; // ebx@76 | 906 int v42; // ebx@76 |
907 int v43; // ecx@77 | 907 int v43; // ecx@77 |
908 int v44; // edx@77 | 908 int v44; // edx@77 |
911 signed int v47; // ebx@85 | 911 signed int v47; // ebx@85 |
912 int v48; // edi@85 | 912 int v48; // edi@85 |
913 int v49; // edi@85 | 913 int v49; // edi@85 |
914 int v50; // eax@85 | 914 int v50; // eax@85 |
915 unsigned __int64 v51; // qax@85 | 915 unsigned __int64 v51; // qax@85 |
916 unsigned __int8 v52; // zf@87 | 916 //unsigned __int8 v52; // zf@87 |
917 unsigned __int8 v53; // sf@87 | 917 //unsigned __int8 v53; // sf@87 |
918 // unsigned __int8 v54; // of@104 | 918 // unsigned __int8 v54; // of@104 |
919 int v55; // eax@107 | 919 int v55; // eax@107 |
920 unsigned int v56; // edi@107 | 920 unsigned int v56; // edi@107 |
921 int v57; // ST10_4@107 | 921 int v57; // ST10_4@107 |
922 unsigned int v58; // edi@107 | 922 unsigned int v58; // edi@107 |
1137 0); | 1137 0); |
1138 if ( uIsOnWater ) | 1138 if ( uIsOnWater ) |
1139 { | 1139 { |
1140 if ( v35 < v36 + 60 ) | 1140 if ( v35 < v36 + 60 ) |
1141 { | 1141 { |
1142 v37 = v0->uAIState; | 1142 if ( uAIState == Dead || uAIState == Dying || uAIState == Removed || uAIState == Disabled ) |
1143 if ( v37 == 5 || v37 == 4 || v37 == 11 || v37 == 19 ) | |
1144 { | 1143 { |
1145 if ( v64 ) | 1144 if ( v64 ) |
1146 v61 = v36 + 30; | 1145 v61 = v36 + 30; |
1147 else | 1146 else |
1148 v61 = v5 + 60; | 1147 v61 = v5 + 60; |
1165 v0->vPosition.y += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.y) >> 16; | 1164 v0->vPosition.y += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.y) >> 16; |
1166 v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; | 1165 v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
1167 v38 = stru_721530.uFaceID; | 1166 v38 = stru_721530.uFaceID; |
1168 v0->vPosition.z += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.z) >> 16; | 1167 v0->vPosition.z += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.z) >> 16; |
1169 stru_721530.field_70 += stru_721530.field_7C; | 1168 stru_721530.field_70 += stru_721530.field_7C; |
1170 v39 = v38 >> 3; | 1169 v39 = PID_ID(v38); |
1171 switch ( PID_TYPE(v38) ) | 1170 switch ( PID_TYPE(v38) ) |
1172 { | 1171 { |
1173 case OBJECT_Actor: | 1172 case OBJECT_Actor: |
1174 if ( pTurnEngine->field_4 != 2 && pTurnEngine->field_4 != 3 || pParty->bTurnBasedModeOn != 1 ) | 1173 if ( pTurnEngine->field_4 != 2 && pTurnEngine->field_4 != 3 || pParty->bTurnBasedModeOn != 1 ) |
1175 { | 1174 { |
1205 { | 1204 { |
1206 v38 = stru_721530.uFaceID; | 1205 v38 = stru_721530.uFaceID; |
1207 Actor::FaceObject(v75, v38, 0, (AIDirection *)0); | 1206 Actor::FaceObject(v75, v38, 0, (AIDirection *)0); |
1208 break; | 1207 break; |
1209 } | 1208 } |
1210 v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0; | 1209 //v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0; |
1211 v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0; | 1210 //v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0; |
1212 v0->vVelocity.y = 0; | 1211 v0->vVelocity.y = 0; |
1213 v0->vVelocity.x = 0; | 1212 v0->vVelocity.x = 0; |
1214 //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) ) | 1213 //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) ) |
1215 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime < 0) | 1214 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime < 0) |
1216 pParty->pPartyBuffs[11].Reset(); | 1215 pParty->pPartyBuffs[11].Reset(); |
1370 { | 1369 { |
1371 //v3 = item->uObjectDescID; | 1370 //v3 = item->uObjectDescID; |
1372 v4 = &pObjectList->pObjects[item->uObjectDescID]; | 1371 v4 = &pObjectList->pObjects[item->uObjectDescID]; |
1373 if (item->AttachedToActor()) | 1372 if (item->AttachedToActor()) |
1374 { | 1373 { |
1375 v5 = item->spell_target_pid >> 3; | 1374 v5 = PID_ID(item->spell_target_pid); |
1376 *(int *)(v2 - 26) = pActors[v5].vPosition.x; | 1375 *(int *)(v2 - 26) = pActors[v5].vPosition.x; |
1377 *(int *)(v2 - 22) = pActors[v5].vPosition.y; | 1376 *(int *)(v2 - 22) = pActors[v5].vPosition.y; |
1378 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight; | 1377 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight; |
1379 if ( !item->uObjectDescID || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) ) | 1378 if ( !item->uObjectDescID || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) ) |
1380 goto LABEL_36; | 1379 goto LABEL_36; |
1913 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 1912 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
1914 v43 = stru_721530.uFaceID; | 1913 v43 = stru_721530.uFaceID; |
1915 uSectorID = stru_721530.uSectorID; | 1914 uSectorID = stru_721530.uSectorID; |
1916 stru_721530.field_70 += stru_721530.field_7C; | 1915 stru_721530.field_70 += stru_721530.field_7C; |
1917 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; | 1916 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; |
1918 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) | 1917 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) |
1919 { | 1918 { |
1920 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 1919 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 |
1921 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 1920 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) |
1922 pParty->pPartyBuffs[11].Reset(); | 1921 pParty->pPartyBuffs[11].Reset(); |
1923 viewparams->bRedrawGameUI = 1; | 1922 viewparams->bRedrawGameUI = 1; |
1924 goto LABEL_152; | 1923 goto LABEL_152; |
1925 } | 1924 } |
1926 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) | 1925 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
1927 { | 1926 { |
1928 v53 = integer_sqrt(v2 * v2 + v1 * v1); | 1927 v53 = integer_sqrt(v2 * v2 + v1 * v1); |
1929 v80 = v53; | 1928 v80 = v53; |
1930 v54 = stru_5C6E00->Atan2(new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, | 1929 v54 = stru_5C6E00->Atan2(new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, |
1931 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y); | 1930 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y); |
1933 v55 = stru_5C6E00->Sin(v54); | 1932 v55 = stru_5C6E00->Sin(v54); |
1934 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; | 1933 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; |
1935 } | 1934 } |
1936 else | 1935 else |
1937 { | 1936 { |
1938 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) | 1937 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) |
1939 { | 1938 { |
1940 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; | 1939 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; |
1941 v45 = v44->uPolygonType; | 1940 v45 = v44->uPolygonType; |
1942 if ( v45 == 3 ) | 1941 if ( v45 == 3 ) |
1943 { | 1942 { |
2837 stru_721530.field_70 += stru_721530.field_7C; | 2836 stru_721530.field_70 += stru_721530.field_7C; |
2838 pX = _angle_x; | 2837 pX = _angle_x; |
2839 pY = _angle_y; | 2838 pY = _angle_y; |
2840 v45 = stru_721530.uFaceID; | 2839 v45 = stru_721530.uFaceID; |
2841 pZ = v40; | 2840 pZ = v40; |
2842 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) | 2841 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) |
2843 { | 2842 { |
2844 if (pParty->Invisible()) | 2843 if (pParty->Invisible()) |
2845 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | 2844 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); |
2846 | 2845 |
2847 viewparams->bRedrawGameUI = 1; | 2846 viewparams->bRedrawGameUI = 1; |
2848 goto LABEL_234; | 2847 goto LABEL_234; |
2849 } | 2848 } |
2850 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) | 2849 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
2851 { | 2850 { |
2852 v56 = integer_sqrt(v2 * v2 + v128 * v128); | 2851 v56 = integer_sqrt(v2 * v2 + v128 * v128); |
2853 v118 = v56; | 2852 v118 = v56; |
2854 v57 = stru_5C6E00->Atan2( | 2853 v57 = stru_5C6E00->Atan2( |
2855 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, | 2854 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, |
2866 v122 = v61 >> 16; | 2865 v122 = v61 >> 16; |
2867 v128 = v61 >> 16; | 2866 v128 = v61 >> 16; |
2868 } | 2867 } |
2869 else | 2868 else |
2870 { | 2869 { |
2871 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) | 2870 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) |
2872 { | 2871 { |
2873 pParty->bFlying = 0; | 2872 pParty->bFlying = 0; |
2874 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; | 2873 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
2875 v127 = v46; | 2874 v127 = v46; |
2876 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; | 2875 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; |
12787 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || | 12786 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || |
12788 pActors[i].uAIState == Disabled) | 12787 pActors[i].uAIState == Disabled) |
12789 ++num_dead_actors; | 12788 ++num_dead_actors; |
12790 else | 12789 else |
12791 { | 12790 { |
12792 int sumonner_type = pActors[i].uSummonerID & 7;; | 12791 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); |
12793 if (sumonner_type == OBJECT_Player) | 12792 if (sumonner_type == OBJECT_Player) |
12794 ++num_dead_actors; | 12793 ++num_dead_actors; |
12795 } | 12794 } |
12796 } | 12795 } |
12797 if (num_dead_actors == uNumActors) | 12796 if (num_dead_actors == uNumActors) |
15142 //AIDirection *v71; // [sp-10h] [bp-C0h]@216 | 15141 //AIDirection *v71; // [sp-10h] [bp-C0h]@216 |
15143 AIDirection v72; // [sp+0h] [bp-B0h]@246 | 15142 AIDirection v72; // [sp+0h] [bp-B0h]@246 |
15144 AIDirection a3; // [sp+1Ch] [bp-94h]@129 | 15143 AIDirection a3; // [sp+1Ch] [bp-94h]@129 |
15145 AIDirection v74; // [sp+38h] [bp-78h]@246 | 15144 AIDirection v74; // [sp+38h] [bp-78h]@246 |
15146 AIDirection v75; // [sp+54h] [bp-5Ch]@129 | 15145 AIDirection v75; // [sp+54h] [bp-5Ch]@129 |
15147 int actor_pid_type; // [sp+70h] [bp-40h]@83 | 15146 int target_pid_type; // [sp+70h] [bp-40h]@83 |
15148 signed int a1; // [sp+74h] [bp-3Ch]@129 | 15147 signed int a1; // [sp+74h] [bp-3Ch]@129 |
15149 int v78; // [sp+78h] [bp-38h]@79 | 15148 int v78; // [sp+78h] [bp-38h]@79 |
15150 AIDirection pDir; // [sp+7Ch] [bp-34h]@129 | 15149 AIDirection pDir; // [sp+7Ch] [bp-34h]@129 |
15151 float v80; // [sp+98h] [bp-18h]@33 | 15150 float v80; // [sp+98h] [bp-18h]@33 |
15152 int v81; // [sp+9Ch] [bp-14h]@100 | 15151 int v81; // [sp+9Ch] [bp-14h]@100 |
15153 //int v82; // [sp+A0h] [bp-10h]@45 | 15152 //int v82; // [sp+A0h] [bp-10h]@45 |
15154 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 | 15153 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 |
15155 unsigned int v84; // [sp+A8h] [bp-8h]@11 | 15154 unsigned int v84; // [sp+A8h] [bp-8h]@11 |
15156 signed int actor_pid; // [sp+ACh] [bp-4h]@83 | 15155 signed int target_pid; // [sp+ACh] [bp-4h]@83 |
15157 AIState uAIState; | 15156 AIState uAIState; |
15158 | 15157 |
15159 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 15158 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
15160 MakeActorAIList_ODM(); | 15159 MakeActorAIList_ODM(); |
15161 else | 15160 else |
15341 //v20 = &ai_near_actors_targets_pid[actor_id]; | 15340 //v20 = &ai_near_actors_targets_pid[actor_id]; |
15342 v21 = &pActors[actor_id]; | 15341 v21 = &pActors[actor_id]; |
15343 Actor::_SelectTarget(actor_id, &ai_near_actors_targets_pid[actor_id], true); | 15342 Actor::_SelectTarget(actor_id, &ai_near_actors_targets_pid[actor_id], true); |
15344 if (v21->pMonsterInfo.uHostilityType && !ai_near_actors_targets_pid[actor_id]) | 15343 if (v21->pMonsterInfo.uHostilityType && !ai_near_actors_targets_pid[actor_id]) |
15345 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 15344 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
15346 actor_pid = ai_near_actors_targets_pid[actor_id]; | 15345 target_pid = ai_near_actors_targets_pid[actor_id]; |
15347 actor_pid_type = PID_TYPE(actor_pid); | 15346 target_pid_type = PID_TYPE(target_pid); |
15348 if ( actor_pid_type == OBJECT_Actor) | 15347 if ( target_pid_type == OBJECT_Actor) |
15349 v80 = 0.5; | 15348 v80 = 0.5; |
15350 else | 15349 else |
15351 v80 = 1.0; | 15350 v80 = 1.0; |
15352 v22 = v21->uAIState; | 15351 v22 = v21->uAIState; |
15353 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) | 15352 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) |
15388 if ( v21->pMonsterInfo.uRecoveryTime< 0 ) | 15387 if ( v21->pMonsterInfo.uRecoveryTime< 0 ) |
15389 v21->pMonsterInfo.uRecoveryTime = 0; | 15388 v21->pMonsterInfo.uRecoveryTime = 0; |
15390 if ( !(v21->uAttributes & 0x8000) ) | 15389 if ( !(v21->uAttributes & 0x8000) ) |
15391 v21->uAttributes |= 0x8000; | 15390 v21->uAttributes |= 0x8000; |
15392 a1 = 8 * actor_id | OBJECT_Actor; | 15391 a1 = 8 * actor_id | OBJECT_Actor; |
15393 v30 = Actor::GetDirectionInfo(8 * actor_id | OBJECT_Actor, actor_pid, &a3, 0); | 15392 v30 = Actor::GetDirectionInfo(8 * actor_id | OBJECT_Actor, target_pid, &a3, 0); |
15394 memcpy(&v75, v30, sizeof(v75)); | 15393 memcpy(&v75, v30, sizeof(v75)); |
15395 memcpy(&pDir, &v75, sizeof(pDir)); | 15394 memcpy(&pDir, &v75, sizeof(pDir)); |
15396 uAIState = v21->uAIState; | 15395 uAIState = v21->uAIState; |
15397 /*if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Friendly | 15396 /*if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Friendly |
15398 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 | 15397 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 |
15399 && v80 * 307.2 >= (double)(signed int)v75.uDistance | 15398 && v80 * 307.2 >= (double)(signed int)v75.uDistance |
15400 && (uAIState == Pursuing || uAIState == Standing || uAIState == Tethered || uAIState == Fidgeting) | 15399 && (uAIState == Pursuing || uAIState == Standing || uAIState == Tethered || uAIState == Fidgeting) |
15401 || ( v21->pMonsterInfo.uMissleAttack1Type && uAIState == Stunned ) ) | 15400 || ( v21->pMonsterInfo.uMissleAttack1Type && uAIState == Stunned ) ) |
15402 { | 15401 { |
15403 v32 = actor_id; | 15402 v32 = actor_id; |
15404 }*/ | 15403 } |
15404 else | |
15405 */ | |
15405 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly | 15406 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly |
15406 || (signed int)v21->pMonsterInfo.uRecoveryTime > 0 | 15407 || (signed int)v21->pMonsterInfo.uRecoveryTime > 0 |
15407 || v80 * 307.2 < (double)(signed int)v75.uDistance | 15408 || v80 * 307.2 < (double)(signed int)v75.uDistance |
15408 || uAIState != Pursuing && uAIState != Standing && uAIState != Tethered && uAIState != Fidgeting | 15409 || uAIState != Pursuing && uAIState != Standing && uAIState != Tethered && uAIState != Fidgeting |
15409 && !v21->pMonsterInfo.uMissleAttack1Type || uAIState != Stunned ) | 15410 && !v21->pMonsterInfo.uMissleAttack1Type || uAIState != Stunned ) |
15410 //else | |
15411 { | 15411 { |
15412 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength ) | 15412 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength ) |
15413 { | 15413 { |
15414 continue; | 15414 continue; |
15415 } | 15415 } |
15434 else if ( v21->uAIState == AttackingRanged2 ) | 15434 else if ( v21->uAIState == AttackingRanged2 ) |
15435 { | 15435 { |
15436 v34 = v21->pMonsterInfo.uMissleAttack2Type; | 15436 v34 = v21->pMonsterInfo.uMissleAttack2Type; |
15437 Actor::_404874(actor_id, &pDir, v34, 1); | 15437 Actor::_404874(actor_id, &pDir, v34, 1); |
15438 } | 15438 } |
15439 else | 15439 else if ( v21->uAIState == AttackingRanged3 ) |
15440 { | 15440 { |
15441 if ( v21->uAIState == AttackingRanged3 ) | 15441 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1; |
15442 { | 15442 v33 = v21->pMonsterInfo.uSpell1ID; |
15443 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1; | 15443 Actor::_404AC7(actor_id, &pDir, v33, 2, v65); |
15444 v33 = v21->pMonsterInfo.uSpell1ID; | 15444 } |
15445 Actor::_404AC7(actor_id, &pDir, v33, 2, v65); | 15445 else if ( v21->uAIState == AttackingRanged4 ) |
15446 } | 15446 { |
15447 else if ( v21->uAIState == AttackingRanged4 ) | 15447 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2; |
15448 { | 15448 v33 = v21->pMonsterInfo.uSpell2ID; |
15449 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2; | 15449 Actor::_404AC7(actor_id, &pDir, v33, 3, v65); |
15450 v33 = v21->pMonsterInfo.uSpell2ID; | |
15451 Actor::_404AC7(actor_id, &pDir, v33, 3, v65); | |
15452 } | |
15453 } | 15450 } |
15454 } | 15451 } |
15455 | 15452 |
15456 v36 = v75.uDistance; | 15453 v36 = v75.uDistance; |
15457 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly) | 15454 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly) |
15458 { | 15455 { |
15459 if ( actor_pid_type == OBJECT_Actor ) | 15456 if ( target_pid_type == OBJECT_Actor ) |
15460 { | 15457 { |
15461 v36 = v75.uDistance; | 15458 v36 = v75.uDistance; |
15462 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3] | 15459 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3] |
15463 + (pActors[actor_pid >> 3].pMonsterInfo.uID - 1) / 3); | 15460 + (pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3); |
15464 } | 15461 } |
15465 else | 15462 else |
15466 { | 15463 { |
15467 v37 = 4; | 15464 v37 = 4; |
15468 } | 15465 } |
15487 | 15484 |
15488 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 ) | 15485 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 ) |
15489 { | 15486 { |
15490 if ( (signed int)v36 >= 10240 ) | 15487 if ( (signed int)v36 >= 10240 ) |
15491 { | 15488 { |
15492 Actor::_4032B2(actor_id, actor_pid, 1024, 0); | 15489 Actor::_4032B2(actor_id, target_pid, 1024, 0); |
15493 } | 15490 } |
15494 else | 15491 else |
15495 { | 15492 { |
15496 //peasents after attacked | 15493 //peasents after attacked |
15497 //guard after attacked | 15494 //guard after attacked |
15498 Actor::_402968(actor_id, actor_pid, 0, &pDir); | 15495 Actor::_402968(actor_id, target_pid, 0, &pDir); |
15499 } | 15496 } |
15500 continue; | 15497 continue; |
15501 } | 15498 } |
15502 | 15499 |
15503 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long && actor_pid ) | 15500 if ( /*v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long &&*/ target_pid ) // temporary |
15504 { | 15501 { |
15505 | 15502 |
15506 if ( v21->pMonsterInfo.uAIType == 1 ) | 15503 if ( v21->pMonsterInfo.uAIType == 1 ) |
15507 { | 15504 { |
15508 if ( v21->pMonsterInfo.uMovementType == 5 ) | 15505 if ( v21->pMonsterInfo.uMovementType == 5 ) |
15509 { | 15506 { |
15510 Actor::AI_Stand(actor_id, actor_pid, (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333), &pDir); | 15507 Actor::AI_Stand(actor_id, target_pid, (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333), &pDir); |
15511 } | 15508 } |
15512 else | 15509 else |
15513 { | 15510 { |
15514 Actor::_402968(actor_id, actor_pid, 0, &pDir); | 15511 Actor::_402968(actor_id, target_pid, 0, &pDir); |
15515 continue; | 15512 continue; |
15516 } | 15513 } |
15517 | 15514 |
15518 } | 15515 } |
15519 if ( !(v21->uAttributes & 0x020000) ) | 15516 if ( !(v21->uAttributes & 0x020000) ) |
15526 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1; | 15523 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1; |
15527 v84 = v21->sCurrentHP; | 15524 v84 = v21->sCurrentHP; |
15528 v42 = (double)(signed int)v84; | 15525 v42 = (double)(signed int)v84; |
15529 if ( v43 > v42 && (signed int)v36 < 10240 ) | 15526 if ( v43 > v42 && (signed int)v36 < 10240 ) |
15530 { | 15527 { |
15531 Actor::_402968(actor_id, actor_pid, 0, &pDir); | 15528 Actor::_402968(actor_id, target_pid, 0, &pDir); |
15532 continue; | 15529 continue; |
15533 } | 15530 } |
15534 } | 15531 } |
15535 } | 15532 } |
15536 | 15533 |
15537 v81 = v36 - v21->uActorRadius; | 15534 v81 = v36 - v21->uActorRadius; |
15538 if ( actor_pid_type == OBJECT_Actor ) | 15535 if ( target_pid_type == OBJECT_Actor ) |
15539 v81 -= pActors[actor_pid >> 3].uActorRadius; | 15536 v81 -= pActors[PID_ID(target_pid)].uActorRadius; |
15540 if ( v81 < 0 ) | 15537 if ( v81 < 0 ) |
15541 v81 = 0; | 15538 v81 = 0; |
15542 rand(); | 15539 rand(); |
15543 v21->uAttributes &= 0xFBFFFF; | 15540 v21->uAttributes &= 0xFBFFFF; |
15544 if ( v81 < 5120 ) | 15541 if ( v81 < 5120 ) |
15548 { | 15545 { |
15549 if ( v21->pMonsterInfo.uMissleAttack1Type ) | 15546 if ( v21->pMonsterInfo.uMissleAttack1Type ) |
15550 { | 15547 { |
15551 if ( (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) | 15548 if ( (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) |
15552 { | 15549 { |
15553 Actor::_403476(actor_id, actor_pid, &pDir); | 15550 Actor::_403476(actor_id, target_pid, &pDir); |
15554 } | 15551 } |
15555 else if ( v21->pMonsterInfo.uMovementType == 5 ) | 15552 else if ( v21->pMonsterInfo.uMovementType == 5 ) |
15556 { | 15553 { |
15557 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15554 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15558 v64 = (signed __int64)v47; | 15555 v64 = (signed __int64)v47; |
15559 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15556 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15560 } | 15557 } |
15561 else | 15558 else |
15562 { | 15559 { |
15563 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15560 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15564 if ( !(v54 | v55) ) | 15561 if ( !(v54 | v55) ) |
15565 { | 15562 { |
15566 v64 = (signed __int64)v47; | 15563 v64 = (signed __int64)v47; |
15567 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15564 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15568 continue; | 15565 continue; |
15569 } | 15566 } |
15570 Actor::_402AD7(actor_id, actor_pid, actor_id, (signed __int64)v47, &pDir); | 15567 Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir); |
15571 } | 15568 } |
15572 } | 15569 } |
15573 else | 15570 else |
15574 { | 15571 { |
15575 v56 = v80 * 307.2; | 15572 v56 = v80 * 307.2; |
15579 { | 15576 { |
15580 if ( v21->pMonsterInfo.uMovementType == 5 ) | 15577 if ( v21->pMonsterInfo.uMovementType == 5 ) |
15581 { | 15578 { |
15582 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15579 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15583 v64 = (signed __int64)v47; | 15580 v64 = (signed __int64)v47; |
15584 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15581 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15585 } | 15582 } |
15586 else | 15583 else |
15587 { | 15584 { |
15588 //monsters | 15585 //monsters |
15589 Actor::_402686(actor_id, actor_pid, 0, &pDir); | 15586 Actor::_402686(actor_id, target_pid, 0, &pDir); |
15590 } | 15587 } |
15591 } | 15588 } |
15592 else if ( v21->pMonsterInfo.uMovementType == 5 ) | 15589 else if ( v21->pMonsterInfo.uMovementType == 5 ) |
15593 { | 15590 { |
15594 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15591 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15595 v64 = (signed __int64)v47; | 15592 v64 = (signed __int64)v47; |
15596 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15593 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15597 } | 15594 } |
15598 else | 15595 else |
15599 { | 15596 { |
15600 v70 = (signed __int64)v56; | 15597 v70 = (signed __int64)v56; |
15601 //monsters | 15598 //monsters |
15602 //guard after player runs away | 15599 //guard after player runs away |
15603 // follow player | 15600 // follow player |
15604 Actor::_40281C(actor_id, actor_pid, 0, &pDir, v70); | 15601 Actor::_40281C(actor_id, target_pid, 0, &pDir, v70); |
15605 } | 15602 } |
15606 } | 15603 } |
15607 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) | 15604 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) |
15608 { | 15605 { |
15609 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15606 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15610 v64 = (signed __int64)v47; | 15607 v64 = (signed __int64)v47; |
15611 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15608 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15612 } | 15609 } |
15613 else | 15610 else |
15614 { | 15611 { |
15615 //monsters | 15612 //monsters |
15616 Actor::_403C6C(actor_id, actor_pid, &pDir); | 15613 Actor::_403C6C(actor_id, target_pid, &pDir); |
15617 } | 15614 } |
15618 } | 15615 } |
15619 continue; | 15616 continue; |
15620 } | 15617 } |
15621 else if ( v45 == 2 || v45 == 3 ) | 15618 else if ( v45 == 2 || v45 == 3 ) |
15627 if ( v46 ) | 15624 if ( v46 ) |
15628 { | 15625 { |
15629 if ( (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) | 15626 if ( (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) |
15630 { | 15627 { |
15631 if ( v45 == 2 ) | 15628 if ( v45 == 2 ) |
15632 Actor::_403854(actor_id, actor_pid, &pDir); | 15629 Actor::_403854(actor_id, target_pid, &pDir); |
15633 else | 15630 else |
15634 Actor::_403A60(actor_id, actor_pid, &pDir); | 15631 Actor::_403A60(actor_id, target_pid, &pDir); |
15635 } | 15632 } |
15636 else if ( v80 * 307.2 > (double)v81 || v21->pMonsterInfo.uMovementType == 5 ) | 15633 else if ( v80 * 307.2 > (double)v81 || v21->pMonsterInfo.uMovementType == 5 ) |
15637 { | 15634 { |
15638 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15635 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15639 v64 = (signed __int64)v47; | 15636 v64 = (signed __int64)v47; |
15640 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15637 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15641 } | 15638 } |
15642 else | 15639 else |
15643 { | 15640 { |
15644 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15641 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15645 Actor::_402AD7(actor_id, actor_pid, actor_id, (signed __int64)v47, &pDir); | 15642 Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir); |
15646 } | 15643 } |
15647 } | 15644 } |
15648 else | 15645 else |
15649 { | 15646 { |
15650 v48 = v80 * 307.2; | 15647 v48 = v80 * 307.2; |
15654 { | 15651 { |
15655 if ( v21->pMonsterInfo.uMovementType == 5 ) | 15652 if ( v21->pMonsterInfo.uMovementType == 5 ) |
15656 { | 15653 { |
15657 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15654 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15658 v64 = (signed __int64)v47; | 15655 v64 = (signed __int64)v47; |
15659 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15656 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15660 } | 15657 } |
15661 else | 15658 else |
15662 { | 15659 { |
15663 Actor::_402686(actor_id, actor_pid, 256, &pDir); | 15660 Actor::_402686(actor_id, target_pid, 256, &pDir); |
15664 } | 15661 } |
15665 } | 15662 } |
15666 else if ( v21->pMonsterInfo.uMovementType == 5 ) | 15663 else if ( v21->pMonsterInfo.uMovementType == 5 ) |
15667 { | 15664 { |
15668 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15665 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15669 v64 = (signed __int64)v47; | 15666 v64 = (signed __int64)v47; |
15670 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15667 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15671 } | 15668 } |
15672 else | 15669 else |
15673 { | 15670 { |
15674 v70 = (signed __int64)v48; | 15671 v70 = (signed __int64)v48; |
15675 Actor::_40281C(actor_id, actor_pid, 0, &pDir, v70); | 15672 Actor::_40281C(actor_id, target_pid, 0, &pDir, v70); |
15676 } | 15673 } |
15677 } | 15674 } |
15678 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) | 15675 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) |
15679 { | 15676 { |
15680 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15677 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15681 v64 = (signed __int64)v47; | 15678 v64 = (signed __int64)v47; |
15682 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15679 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15683 } | 15680 } |
15684 else | 15681 else |
15685 { | 15682 { |
15686 Actor::_403C6C(actor_id, actor_pid, &pDir); | 15683 Actor::_403C6C(actor_id, target_pid, &pDir); |
15687 } | 15684 } |
15688 } | 15685 } |
15689 continue; | 15686 continue; |
15690 } | 15687 } |
15691 } | 15688 } |
15692 } | 15689 } |
15693 | 15690 |
15694 if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long || !actor_pid || v81 >= 5120 || v45 != 1 ) | 15691 if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long || !target_pid || v81 >= 5120 || v45 != 1 ) |
15695 { | 15692 { |
15696 if ( !v21->pMonsterInfo.uMovementType ) | 15693 if ( !v21->pMonsterInfo.uMovementType ) |
15697 { | 15694 { |
15698 Actor::_4032B2(actor_id, 4, 1024, 0); | 15695 Actor::_4032B2(actor_id, 4, 1024, 0); |
15699 } | 15696 } |
15728 { | 15725 { |
15729 if ( v21->pMonsterInfo.uMovementType == 5 ) | 15726 if ( v21->pMonsterInfo.uMovementType == 5 ) |
15730 { | 15727 { |
15731 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15728 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15732 v64 = (signed __int64)v47; | 15729 v64 = (signed __int64)v47; |
15733 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15730 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15734 } | 15731 } |
15735 else | 15732 else |
15736 { | 15733 { |
15737 Actor::_402686(actor_id, actor_pid, 256, &pDir); | 15734 Actor::_402686(actor_id, target_pid, 256, &pDir); |
15738 } | 15735 } |
15739 } | 15736 } |
15740 else if ( v21->pMonsterInfo.uMovementType == 5 ) | 15737 else if ( v21->pMonsterInfo.uMovementType == 5 ) |
15741 { | 15738 { |
15742 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15739 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15743 v64 = (signed __int64)v47; | 15740 v64 = (signed __int64)v47; |
15744 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15741 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15745 } | 15742 } |
15746 else | 15743 else |
15747 { | 15744 { |
15748 v70 = (signed __int64)v56; | 15745 v70 = (signed __int64)v56; |
15749 Actor::_40281C(actor_id, actor_pid, 0, &pDir, v70); | 15746 Actor::_40281C(actor_id, target_pid, 0, &pDir, v70); |
15750 } | 15747 } |
15751 } | 15748 } |
15752 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) | 15749 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) |
15753 { | 15750 { |
15754 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15751 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15755 v64 = (signed __int64)v47; | 15752 v64 = (signed __int64)v47; |
15756 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15753 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15757 } | 15754 } |
15758 else | 15755 else |
15759 { | 15756 { |
15760 Actor::_403C6C(actor_id, actor_pid, &pDir); | 15757 Actor::_403C6C(actor_id, target_pid, &pDir); |
15761 } | 15758 } |
15762 } | 15759 } |
15763 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) | 15760 else if ( (signed int)v21->pMonsterInfo.uRecoveryTime > 0 ) |
15764 { | 15761 { |
15765 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 15762 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
15766 if ( !(v54 | v55) || v21->pMonsterInfo.uMovementType == 5 ) | 15763 if ( !(v54 | v55) || v21->pMonsterInfo.uMovementType == 5 ) |
15767 { | 15764 { |
15768 v64 = (signed __int64)v47; | 15765 v64 = (signed __int64)v47; |
15769 Actor::AI_Stand(actor_id, actor_pid, v64, &pDir); | 15766 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); |
15770 } | 15767 } |
15771 else | 15768 else |
15772 { | 15769 { |
15773 Actor::_402AD7(actor_id, actor_pid, actor_id, (signed __int64)v47, &pDir); | 15770 Actor::_402AD7(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir); |
15774 } | 15771 } |
15775 } | 15772 } |
15776 else | 15773 else |
15777 { | 15774 { |
15778 Actor::_40368B(actor_id, actor_pid, &pDir); | 15775 Actor::_40368B(actor_id, target_pid, &pDir); |
15779 } | 15776 } |
15780 } | 15777 } |
15781 } | 15778 } |
15782 } | 15779 } |
15783 | 15780 |
15851 if ( this->uActorQueueSize > 0 ) | 15848 if ( this->uActorQueueSize > 0 ) |
15852 { | 15849 { |
15853 v2 = this->pQueue; | 15850 v2 = this->pQueue; |
15854 do | 15851 do |
15855 { | 15852 { |
15856 if ( (v2->uPackedID & 7) == OBJECT_Actor ) | 15853 if ( PID_TYPE(v2->uPackedID) == OBJECT_Actor ) |
15857 { | 15854 { |
15858 v3 = &pActors[v2->uPackedID >> 3]; | 15855 v3 = &pActors[PID_ID(v2->uPackedID)]; |
15859 v4 = &pActors[v2->uPackedID >> 3]; | 15856 v4 = &pActors[PID_ID(v2->uPackedID)]; |
15860 LOBYTE(v4->uAttributes) |= 0x80u; | 15857 LOBYTE(v4->uAttributes) |= 0x80u; |
15861 if ( !v4->CanAct() ) | 15858 if ( !v4->CanAct() ) |
15862 { | 15859 { |
15863 --v19; | 15860 --v19; |
15864 v2->field_4 = 1001; | 15861 v2->field_4 = 1001; |
15865 LOBYTE(v3->uAttributes) &= 0x7Fu; | 15862 LOBYTE(v3->uAttributes) &= 0x7Fu; |
15866 } | 15863 } |
15867 } | 15864 } |
15868 if ( (v2->uPackedID & 7) == OBJECT_Player) | 15865 if ( PID_TYPE(v2->uPackedID) == OBJECT_Player) |
15869 { | 15866 { |
15870 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; | 15867 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; |
15871 if ( v5->pConditions[14] | 15868 if ( v5->pConditions[14] |
15872 || v5->pConditions[16] | 15869 || v5->pConditions[16] |
15873 || v5->pConditions[15] | 15870 || v5->pConditions[15] |
15899 { | 15896 { |
15900 v9 = v8->field_4; | 15897 v9 = v8->field_4; |
15901 v10 = v7->field_4; | 15898 v10 = v7->field_4; |
15902 if ( v9 < v10 | 15899 if ( v9 < v10 |
15903 || v9 == v10 | 15900 || v9 == v10 |
15904 && ((v11 = v8->uPackedID & 7, v11 == OBJECT_Player) && (v7->uPackedID & 7) == OBJECT_Actor | 15901 && ((v11 = PID_TYPE(v8->uPackedID), v11 == OBJECT_Player) && PID_TYPE(v7->uPackedID) == OBJECT_Actor |
15905 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) | 15902 || v11 == PID_TYPE(v7->uPackedID) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) |
15906 { | 15903 { |
15907 v12 = v7->uPackedID; | 15904 v12 = v7->uPackedID; |
15908 v13 = v7->field_4; | 15905 v13 = v7->field_4; |
15909 v14 = v7->uActionLength; | 15906 v14 = v7->uActionLength; |
15910 v15 = v7->field_C; | 15907 v15 = v7->field_C; |
15928 } | 15925 } |
15929 while ( v21 - 1 < v6 ); | 15926 while ( v21 - 1 < v6 ); |
15930 } | 15927 } |
15931 v1->uActorQueueSize = v19; | 15928 v1->uActorQueueSize = v19; |
15932 result = v1->pQueue[0].uPackedID; | 15929 result = v1->pQueue[0].uPackedID; |
15933 if ( (v1->pQueue[0].uPackedID & 7) == OBJECT_Player) | 15930 if ( PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player) |
15934 { | 15931 { |
15935 result = (result >> 3) + 1; | 15932 result = (result >> 3) + 1; |
15936 uActiveCharacter = result; | 15933 uActiveCharacter = result; |
15937 v1->field_18 |= 4u; | 15934 v1->field_18 |= 4u; |
15938 } | 15935 } |
15945 if ( v1->uActorQueueSize > 0 ) | 15942 if ( v1->uActorQueueSize > 0 ) |
15946 { | 15943 { |
15947 v17 = v1->pQueue; | 15944 v17 = v1->pQueue; |
15948 do | 15945 do |
15949 { | 15946 { |
15950 if ( (v17->uPackedID & 7) == OBJECT_Player) | 15947 if ( PID_TYPE(v17->uPackedID) == OBJECT_Player) |
15951 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); | 15948 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); |
15952 ++v22; | 15949 ++v22; |
15953 ++v17; | 15950 ++v17; |
15954 result = v22; | 15951 result = v22; |
15955 } | 15952 } |
16083 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) | 16080 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) |
16084 { | 16081 { |
16085 v12 = (char *)&v1->pQueue[0].field_4; | 16082 v12 = (char *)&v1->pQueue[0].field_4; |
16086 while ( 1 ) | 16083 while ( 1 ) |
16087 { | 16084 { |
16088 v13 = *((int *)v12 - 1) & 7; | 16085 v13 = PID_TYPE(*((int *)v12 - 1)); |
16089 if ( v13 != OBJECT_Player ) | 16086 if ( v13 != OBJECT_Player ) |
16090 break; | 16087 break; |
16091 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery; | 16088 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery; |
16092 if ( v14 != (short)v2 ) | 16089 if ( v14 != (short)v2 ) |
16093 { | 16090 { |