Mercurial > mm7
comparison mm7_3.cpp @ 413:111f25d1cc04
AI_Stand
author | Nomad |
---|---|
date | Sat, 23 Feb 2013 16:39:32 +0200 |
parents | 747933903b1c |
children | d8b3056df4e2 |
comparison
equal
deleted
inserted
replaced
412:bbd8888534dc | 413:111f25d1cc04 |
---|---|
17752 int v78; // [sp+78h] [bp-38h]@79 | 17752 int v78; // [sp+78h] [bp-38h]@79 |
17753 AIDirection pDir; // [sp+7Ch] [bp-34h]@129 | 17753 AIDirection pDir; // [sp+7Ch] [bp-34h]@129 |
17754 float v80; // [sp+98h] [bp-18h]@33 | 17754 float v80; // [sp+98h] [bp-18h]@33 |
17755 int v81; // [sp+9Ch] [bp-14h]@100 | 17755 int v81; // [sp+9Ch] [bp-14h]@100 |
17756 int v82; // [sp+A0h] [bp-10h]@45 | 17756 int v82; // [sp+A0h] [bp-10h]@45 |
17757 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 | 17757 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 |
17758 unsigned int v84; // [sp+A8h] [bp-8h]@11 | 17758 unsigned int v84; // [sp+A8h] [bp-8h]@11 |
17759 signed int a2; // [sp+ACh] [bp-4h]@83 | 17759 signed int a2; // [sp+ACh] [bp-4h]@83 |
17760 | 17760 |
17761 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 17761 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
17762 MakeActorAIList_ODM(); | 17762 MakeActorAIList_ODM(); |
17909 actor->uAIState = Dead; | 17909 actor->uAIState = Dead; |
17910 else | 17910 else |
17911 { | 17911 { |
17912 if (actor->uAIState != Summoned) | 17912 if (actor->uAIState != Summoned) |
17913 { | 17913 { |
17914 Actor::_403F58(i, Dying, 256, 0); | 17914 Actor::_403F58(i, OBJECT_Player, 256, nullptr); |
17915 continue; | 17915 continue; |
17916 } | 17916 } |
17917 actor->uAIState = Standing; | 17917 actor->uAIState = Standing; |
17918 } | 17918 } |
17919 | 17919 |
17927 //while ( (signed int)uActorID < (signed int)uNumActors ); | 17927 //while ( (signed int)uActorID < (signed int)uNumActors ); |
17928 } | 17928 } |
17929 | 17929 |
17930 | 17930 |
17931 v78 = 0; | 17931 v78 = 0; |
17932 int actor_id = -1; | |
17932 if ( ai_arrays_size > 0 ) | 17933 if ( ai_arrays_size > 0 ) |
17933 { | 17934 { |
17934 while ( 1 ) | 17935 while ( 1 ) |
17935 { | 17936 { |
17936 uActorID = ai_near_actors_ids[v78]; | 17937 actor_id = ai_near_actors_ids[v78]; |
17937 v20 = &dword_4F6E08[uActorID]; | 17938 assert(actor_id < uNumActors); |
17938 v21 = &pActors[uActorID]; | 17939 |
17939 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u); | 17940 v20 = &dword_4F6E08[actor_id]; |
17941 v21 = &pActors[actor_id]; | |
17942 Actor::_401221(actor_id, &dword_4F6E08[actor_id], 1u); | |
17940 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) | 17943 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) |
17941 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 17944 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
17942 a2 = *v20; | 17945 a2 = *v20; |
17943 v76 = a2 & 7; | 17946 v76 = a2 & 7; |
17944 if ( (a2 & 7) == OBJECT_Actor) | 17947 if ( (a2 & 7) == OBJECT_Actor) |
17947 v80 = 1.0; | 17950 v80 = 1.0; |
17948 v22 = v21->uAIState; | 17951 v22 = v21->uAIState; |
17949 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) | 17952 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) |
17950 goto LABEL_254; | 17953 goto LABEL_254; |
17951 if ( !v21->sCurrentHP ) | 17954 if ( !v21->sCurrentHP ) |
17952 Actor::Die(uActorID); | 17955 Actor::Die(actor_id); |
17953 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) | 17956 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) |
17954 { | 17957 { |
17955 v84 = 0; | 17958 v84 = 0; |
17956 v23 = 1; | 17959 v23 = 1; |
17957 } | 17960 } |
18015 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 ) | 18018 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 ) |
18016 v21->pMonsterInfo.uRecoveryTime = 0; | 18019 v21->pMonsterInfo.uRecoveryTime = 0; |
18017 v29 = v21->uAttributes; | 18020 v29 = v21->uAttributes; |
18018 if ( !(v29 & 0x8000) ) | 18021 if ( !(v29 & 0x8000) ) |
18019 v21->uAttributes = v29 | 0x8000; | 18022 v21->uAttributes = v29 | 0x8000; |
18020 a1 = 8 * uActorID | 3; | 18023 a1 = 8 * actor_id | OBJECT_Actor; |
18021 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0); | 18024 v30 = Actor::GetDirectionInfo(8 * actor_id | OBJECT_Actor, a2, &a3, 0); |
18022 v49 = v21->pMonsterInfo.uHostilityType == 0; | 18025 v49 = v21->pMonsterInfo.uHostilityType == 0; |
18023 memcpy(&v75, v30, sizeof(v75)); | 18026 memcpy(&v75, v30, sizeof(v75)); |
18024 memcpy(&pDir, &v75, sizeof(pDir)); | 18027 memcpy(&pDir, &v75, sizeof(pDir)); |
18025 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) | 18028 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 ) |
18026 { | 18029 { |
18027 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance | 18030 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance |
18028 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9) | 18031 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9) |
18029 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 ) | 18032 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 ) |
18030 { | 18033 { |
18031 v32 = uActorID; | 18034 v32 = actor_id; |
18032 goto LABEL_152; | 18035 goto LABEL_152; |
18033 } | 18036 } |
18034 } | 18037 } |
18035 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength ) | 18038 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength ) |
18036 goto LABEL_254; | 18039 goto LABEL_254; |
18037 if ( v21->uAIState == 2 ) | 18040 if ( v21->uAIState == 2 ) |
18038 { | 18041 { |
18039 v32 = uActorID; | 18042 v32 = actor_id; |
18040 v35 = stru_50C198.special_ability_use_check(v21, uActorID); | 18043 v35 = stru_50C198.special_ability_use_check(v21, actor_id); |
18041 stru_50FE08.Add( | 18044 stru_50FE08.Add( |
18042 a1, | 18045 a1, |
18043 5120, | 18046 5120, |
18044 v21->vPosition.x, | 18047 v21->vPosition.x, |
18045 v21->vPosition.y, | 18048 v21->vPosition.y, |
18057 if ( v21->uAIState == 12 ) | 18060 if ( v21->uAIState == 12 ) |
18058 { | 18061 { |
18059 v34 = v21->pMonsterInfo.uMissleAttack2Type; | 18062 v34 = v21->pMonsterInfo.uMissleAttack2Type; |
18060 v66 = 1; | 18063 v66 = 1; |
18061 LABEL_149: | 18064 LABEL_149: |
18062 v32 = uActorID; | 18065 v32 = actor_id; |
18063 Actor::_404874(uActorID, &pDir, v34, v66); | 18066 Actor::_404874(actor_id, &pDir, v34, v66); |
18064 goto LABEL_152; | 18067 goto LABEL_152; |
18065 } | 18068 } |
18066 v32 = uActorID; | 18069 v32 = actor_id; |
18067 if ( v21->uAIState == 13 ) | 18070 if ( v21->uAIState == 13 ) |
18068 break; | 18071 break; |
18069 if ( v21->uAIState == 18 ) | 18072 if ( v21->uAIState == 18 ) |
18070 { | 18073 { |
18071 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2; | 18074 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2; |
18072 v60 = 3; | 18075 v60 = 3; |
18073 v33 = v21->pMonsterInfo.uSpell2ID; | 18076 v33 = v21->pMonsterInfo.uSpell2ID; |
18074 LABEL_146: | 18077 LABEL_146: |
18075 Actor::_404AC7(uActorID, &pDir, v33, v60, v65); | 18078 Actor::_404AC7(actor_id, &pDir, v33, v60, v65); |
18076 } | 18079 } |
18077 LABEL_152: | 18080 LABEL_152: |
18078 v36 = v75.uDistance; | 18081 v36 = v75.uDistance; |
18079 if ( v21->pMonsterInfo.uHostilityType ) | 18082 if ( v21->pMonsterInfo.uHostilityType ) |
18080 goto LABEL_165; | 18083 goto LABEL_165; |
18134 if ( v21->pMonsterInfo.uAIType == 1 ) | 18137 if ( v21->pMonsterInfo.uAIType == 1 ) |
18135 { | 18138 { |
18136 v67 = &pDir; | 18139 v67 = &pDir; |
18137 if ( v21->pMonsterInfo.uMovementType != 5 ) | 18140 if ( v21->pMonsterInfo.uMovementType != 5 ) |
18138 goto LABEL_181; | 18141 goto LABEL_181; |
18139 Actor::_403EB6( | 18142 Actor::AI_Stand( |
18140 v32, | 18143 v32, |
18141 a2, | 18144 a2, |
18142 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333), | 18145 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333), |
18143 &pDir); | 18146 &pDir); |
18144 } | 18147 } |
18250 LABEL_219: | 18253 LABEL_219: |
18251 v51 = a2; | 18254 v51 = a2; |
18252 v64 = (signed __int64)v47; | 18255 v64 = (signed __int64)v47; |
18253 v52 = v32; | 18256 v52 = v32; |
18254 LABEL_247: | 18257 LABEL_247: |
18255 Actor::_403EB6(v52, v51, v64, v69); | 18258 Actor::AI_Stand(v52, v51, v64, v69); |
18256 goto LABEL_254; | 18259 goto LABEL_254; |
18257 } | 18260 } |
18258 v69 = &pDir; | 18261 v69 = &pDir; |
18259 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 18262 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
18260 goto LABEL_225; | 18263 goto LABEL_225; |
18319 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0); | 18322 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0); |
18320 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 18323 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
18321 memcpy(&v74, v57, sizeof(v74)); | 18324 memcpy(&v74, v57, sizeof(v74)); |
18322 memcpy(&pDir, &v74, sizeof(pDir)); | 18325 memcpy(&pDir, &v74, sizeof(pDir)); |
18323 v69 = &pDir; | 18326 v69 = &pDir; |
18324 v52 = uActorID; | 18327 v52 = actor_id; |
18325 v64 = (signed __int64)v58; | 18328 v64 = (signed __int64)v58; |
18326 v51 = 4; | 18329 v51 = 4; |
18327 goto LABEL_247; | 18330 goto LABEL_247; |
18328 } | 18331 } |
18329 goto LABEL_254; | 18332 goto LABEL_254; |