comparison mm7_3.cpp @ 863:b7b67485ec43

* AI fixed * some PID_ID replaces
author zipi
date Sun, 31 Mar 2013 17:40:31 +0100
parents f4394e320312
children 0b4fc79351b6
comparison
equal deleted inserted replaced
862:f4394e320312 863:b7b67485ec43
15103 int v33; // eax@144 15103 int v33; // eax@144
15104 int v34; // eax@147 15104 int v34; // eax@147
15105 char v35; // al@150 15105 char v35; // al@150
15106 unsigned int v36; // edi@152 15106 unsigned int v36; // edi@152
15107 signed int v37; // eax@154 15107 signed int v37; // eax@154
15108 unsigned __int8 v38; // sf@158 15108 //unsigned __int8 v38; // sf@158
15109 unsigned __int8 v39; // of@158 15109 //unsigned __int8 v39; // of@158
15110 //signed int v40; // edx@166 15110 //signed int v40; // edx@166
15111 //unsigned int v41; // ecx@166 15111 //unsigned int v41; // ecx@166
15112 double v42; // st7@176 15112 double v42; // st7@176
15113 double v43; // st6@176 15113 double v43; // st6@176
15114 //bool v44; // eax@189 15114 //bool v44; // eax@189
15152 //int v82; // [sp+A0h] [bp-10h]@45 15152 //int v82; // [sp+A0h] [bp-10h]@45
15153 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 15153 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
15154 unsigned int v84; // [sp+A8h] [bp-8h]@11 15154 unsigned int v84; // [sp+A8h] [bp-8h]@11
15155 signed int target_pid; // [sp+ACh] [bp-4h]@83 15155 signed int target_pid; // [sp+ACh] [bp-4h]@83
15156 AIState uAIState; 15156 AIState uAIState;
15157 int v38;
15157 15158
15158 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 15159 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
15159 MakeActorAIList_ODM(); 15160 MakeActorAIList_ODM();
15160 else 15161 else
15161 MakeActorAIList_BLV(); 15162 MakeActorAIList_BLV();
15278 // || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) ) 15279 // || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
15279 actor->uActorHeight = pMonsterList->pMonsters[actor->pMonsterInfo.uID - 1].uMonsterHeight; 15280 actor->uActorHeight = pMonsterList->pMonsters[actor->pMonsterInfo.uID - 1].uMonsterHeight;
15280 if ( (signed __int64)actor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 ) 15281 if ( (signed __int64)actor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 )
15281 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 15282 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
15282 // not sure 15283 // not sure
15283 else // if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 ) 15284 else if ( (signed __int64)actor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 )
15284 actor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[actor->pMonsterInfo.uID].uHostilityType; 15285 actor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[actor->pMonsterInfo.uID].uHostilityType;
15285 15286
15286 if ((signed __int64)actor->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0 15287 if ((signed __int64)actor->pActorBuffs[ACTOR_BUFF_PARALYZED].uExpireTime > 0
15287 || (signed __int64)actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0) 15288 || (signed __int64)actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0)
15288 continue; 15289 continue;
15365 if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime < 0 ) 15366 if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime < 0 )
15366 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight; 15367 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
15367 if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 ) 15368 if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 )
15368 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 15369 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
15369 // not sure 15370 // not sure
15370 else // if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 ) 15371 else if ( (signed __int64)v21->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 )
15371 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType; 15372 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
15372 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime < 0 ) 15373 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime < 0 )
15373 { 15374 {
15374 v21->uAIState = Removed; 15375 v21->uAIState = Removed;
15375 continue; 15376 continue;
15382 v27 = pMiscTimer->uTimeElapsed; 15383 v27 = pMiscTimer->uTimeElapsed;
15383 v28 = v21->pMonsterInfo.uRecoveryTime; 15384 v28 = v21->pMonsterInfo.uRecoveryTime;
15384 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed; 15385 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
15385 if ( (signed int)v28 > 0 ) 15386 if ( (signed int)v28 > 0 )
15386 v21->pMonsterInfo.uRecoveryTime = v28 - v27; 15387 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
15387 if ( v21->pMonsterInfo.uRecoveryTime< 0 ) 15388 if ( v21->pMonsterInfo.uRecoveryTime < 0 )
15388 v21->pMonsterInfo.uRecoveryTime = 0; 15389 v21->pMonsterInfo.uRecoveryTime = 0;
15389 if ( !(v21->uAttributes & 0x8000) ) 15390 if ( !(v21->uAttributes & 0x8000) )
15390 v21->uAttributes |= 0x8000; 15391 v21->uAttributes |= 0x8000;
15391 a1 = PID(OBJECT_Actor,actor_id); 15392 a1 = PID(OBJECT_Actor,actor_id);
15392 v30 = Actor::GetDirectionInfo(PID(OBJECT_Actor,actor_id), target_pid, &a3, 0); 15393 v30 = Actor::GetDirectionInfo(PID(OBJECT_Actor,actor_id), target_pid, &a3, 0);
15461 } 15462 }
15462 else 15463 else
15463 { 15464 {
15464 v37 = 4; 15465 v37 = 4;
15465 } 15466 }
15467 v38=0;
15466 if ( v37 == 2 ) 15468 if ( v37 == 2 )
15467 { 15469 {
15468 v39 = __OFSUB__(v36, 1024); 15470 //v39 = __OFSUB__(v36, 1024);
15469 v38 = ((v36 - 1024) & 0x80000000u) != 0; 15471 //v38 = ((v36 - 1024) & 0x80000000u) != 0;
15472 v38 = 1024;
15470 } 15473 }
15471 else if ( v37 == 3 ) 15474 else if ( v37 == 3 )
15472 { 15475 {
15473 v39 = __OFSUB__(v36, 2560); 15476 //v39 = __OFSUB__(v36, 2560);
15474 v38 = ((v36 - 2560) & 0x80000000u) != 0; 15477 //v38 = ((v36 - 2560) & 0x80000000u) != 0;
15478 v38 = 2560;
15475 } 15479 }
15476 else if ( v37 == 4 ) 15480 else if ( v37 == 4 )
15477 { 15481 {
15478 v39 = __OFSUB__(v36, 5120); 15482 //v39 = __OFSUB__(v36, 5120);
15479 v38 = ((v36 - 5120) & 0x80000000u) != 0; 15483 //v38 = ((v36 - 5120) & 0x80000000u) != 0;
15484 v38 = 5120;
15480 } 15485 }
15481 if ( v37 >= 1 && v37 <= 4 && v38 ^ v39 || v37 == 1 ) 15486 if ( v37 >= 1 && v37 <= 4 && v36 < v38 || v37 == 1 )
15482 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; 15487 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
15483 } 15488 }
15484 15489
15485 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 ) 15490 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
15486 { 15491 {
15495 Actor::Flee(actor_id, target_pid, 0, &pDir); 15500 Actor::Flee(actor_id, target_pid, 0, &pDir);
15496 } 15501 }
15497 continue; 15502 continue;
15498 } 15503 }
15499 15504
15500 if ( /*v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long &&*/ target_pid ) // temporary 15505 if ( v21->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long && target_pid )
15501 { 15506 {
15502 15507
15503 if ( v21->pMonsterInfo.uAIType == 1 ) 15508 if ( v21->pMonsterInfo.uAIType == 1 )
15504 { 15509 {
15505 if ( v21->pMonsterInfo.uMovementType == 5 ) 15510 if ( v21->pMonsterInfo.uMovementType == 5 )
15560 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333; 15565 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
15561 if ( !(v54 | v55) ) 15566 if ( !(v54 | v55) )
15562 { 15567 {
15563 v64 = (signed __int64)v47; 15568 v64 = (signed __int64)v47;
15564 Actor::AI_Stand(actor_id, target_pid, v64, &pDir); 15569 Actor::AI_Stand(actor_id, target_pid, v64, &pDir);
15565 continue;
15566 } 15570 }
15567 Actor::Pursue1(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir); 15571 else
15572 {
15573 Actor::Pursue1(actor_id, target_pid, actor_id, (signed __int64)v47, &pDir);
15574 }
15568 } 15575 }
15569 } 15576 }
15570 else 15577 else
15571 { 15578 {
15572 v56 = v80 * 307.2; 15579 v56 = v80 * 307.2;
15927 } 15934 }
15928 v1->uActorQueueSize = v19; 15935 v1->uActorQueueSize = v19;
15929 result = v1->pQueue[0].uPackedID; 15936 result = v1->pQueue[0].uPackedID;
15930 if ( PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player) 15937 if ( PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player)
15931 { 15938 {
15932 result = (result >> 3) + 1; 15939 result = PID_ID(result) + 1;
15933 uActiveCharacter = result; 15940 uActiveCharacter = result;
15934 v1->field_18 |= 4u; 15941 v1->field_18 |= 4u;
15935 } 15942 }
15936 else 15943 else
15937 { 15944 {
15943 { 15950 {
15944 v17 = v1->pQueue; 15951 v17 = v1->pQueue;
15945 do 15952 do
15946 { 15953 {
15947 if ( PID_TYPE(v17->uPackedID) == OBJECT_Player) 15954 if ( PID_TYPE(v17->uPackedID) == OBJECT_Player)
15948 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); 15955 pParty->pPlayers[PID_ID(v17->uPackedID)].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
15949 ++v22; 15956 ++v22;
15950 ++v17; 15957 ++v17;
15951 result = v22; 15958 result = v22;
15952 } 15959 }
15953 while ( v22 < v1->uActorQueueSize ); 15960 while ( v22 < v1->uActorQueueSize );