Mercurial > mm7
comparison mm7_5.cpp @ 872:2db21a810d48
Merge
author | Nomad |
---|---|
date | Mon, 01 Apr 2013 13:39:39 +0200 |
parents | 710cf848ad24 f4394e320312 |
children | 7eb081d32614 |
comparison
equal
deleted
inserted
replaced
871:710cf848ad24 | 872:2db21a810d48 |
---|---|
1739 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | 1739 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); |
1740 pPoint = pMouse->GetCursorPos(&v208); | 1740 pPoint = pMouse->GetCursorPos(&v208); |
1741 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | 1741 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; |
1742 } | 1742 } |
1743 v44 = (unsigned __int16)v42; | 1743 v44 = (unsigned __int16)v42; |
1744 v45 = v44 & 7; | 1744 v45 = PID_TYPE(v44); |
1745 uNumSeconds = v44; | 1745 uNumSeconds = v44; |
1746 v46 = v44 >> 3; | 1746 v46 = PID_ID(v44); |
1747 if ( v45 == 3 ) | 1747 if ( v45 == 3 ) |
1748 { | 1748 { |
1749 v47 = pActors[v46].uAIState == Dead; | 1749 v47 = pActors[v46].uAIState == Dead; |
1750 //goto LABEL_400; | 1750 //goto LABEL_400; |
1751 if ( !v47 ) | 1751 if ( !v47 ) |
2085 { | 2085 { |
2086 LABEL_486: | 2086 LABEL_486: |
2087 SaveGame(v0, 0); | 2087 SaveGame(v0, 0); |
2088 v64 = pMapStats->GetMapInfo(pCurrentMapName); | 2088 v64 = pMapStats->GetMapInfo(pCurrentMapName); |
2089 v65 = uMessageParam; | 2089 v65 = uMessageParam; |
2090 if ( v64 == stru_4ECBB8[uMessageParam].uMapInfoID ) | 2090 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) |
2091 { | 2091 { |
2092 pParty->vPosition.x = stru_4ECBB8[v65].pos.x; | 2092 pParty->vPosition.x = TownPortalList[v65].pos.x; |
2093 pParty->vPosition.y = stru_4ECBB8[v65].pos.y; | 2093 pParty->vPosition.y = TownPortalList[v65].pos.y; |
2094 pParty->vPosition.z = stru_4ECBB8[v65].pos.z; | 2094 pParty->vPosition.z = TownPortalList[v65].pos.z; |
2095 pParty->uFallStartY = pParty->vPosition.z; | 2095 pParty->uFallStartY = pParty->vPosition.z; |
2096 pParty->sRotationY = stru_4ECBB8[v65].rot_y; | 2096 pParty->sRotationY = TownPortalList[v65].rot_y; |
2097 pParty->sRotationX = stru_4ECBB8[v65].rot_x; | 2097 pParty->sRotationX = TownPortalList[v65].rot_x; |
2098 } | 2098 } |
2099 else | 2099 else |
2100 { | 2100 { |
2101 SaveGame(v0, 0); | 2101 SaveGame(v0, 0); |
2102 OnMapLeave(); | 2102 OnMapLeave(); |
2103 dword_6BE364_game_settings_1 |= v0; | 2103 dword_6BE364_game_settings_1 |= v0; |
2104 uGameState = 2; | 2104 uGameState = 2; |
2105 strcpy(pCurrentMapName, pMapStats->pInfos[stru_4ECBB8[uMessageParam].uMapInfoID].pFilename); | 2105 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
2106 dword_5B65C0 = v0; | 2106 dword_5B65C0 = v0; |
2107 _5B65A8_npcdata_uflags_or_other = stru_4ECBB8[uMessageParam].pos.x; | 2107 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; |
2108 _5B65AC_npcdata_fame_or_other = stru_4ECBB8[uMessageParam].pos.y; | 2108 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; |
2109 _5B65B0_npcdata_rep_or_other = stru_4ECBB8[uMessageParam].pos.z; | 2109 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; |
2110 v66 = stru_4ECBB8[uMessageParam].rot_x; | 2110 v66 = TownPortalList[uMessageParam].rot_x; |
2111 _5B65B4_npcdata_loword_house_or_other = stru_4ECBB8[uMessageParam].rot_y; | 2111 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; |
2112 _5B65B8_npcdata_hiword_house_or_other = v66; | 2112 _5B65B8_npcdata_hiword_house_or_other = v66; |
2113 InitializeActors(); | 2113 InitializeActors(); |
2114 } | 2114 } |
2115 v67 = pGUIWindow_CurrentMenu->Hint; | 2115 v67 = pGUIWindow_CurrentMenu->Hint; |
2116 if ( v67 ) | 2116 if ( v67 ) |
2395 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | 2395 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; |
2396 } | 2396 } |
2397 v83 = v81; | 2397 v83 = v81; |
2398 v44 = (unsigned __int16)v81; | 2398 v44 = (unsigned __int16)v81; |
2399 v84 = v83 >> 16; | 2399 v84 = v83 >> 16; |
2400 if ( (v44 & 7) != 3 || v84 >= 5120 ) | 2400 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
2401 //goto LABEL_90; | 2401 //goto LABEL_90; |
2402 { | 2402 { |
2403 v1 = ""; | 2403 v1 = ""; |
2404 v0 = 1; | 2404 v0 = 1; |
2405 continue; | 2405 continue; |
4518 { | 4518 { |
4519 pVelocity = &stru_50FE08.vec_4B4; | 4519 pVelocity = &stru_50FE08.vec_4B4; |
4520 v1 = (char *)stru_50FE08.pZs; | 4520 v1 = (char *)stru_50FE08.pZs; |
4521 do | 4521 do |
4522 { | 4522 { |
4523 v2 = *((short *)v1 - 300) & 7; | 4523 v2 = PID_TYPE(*((short *)v1 - 300)); |
4524 v3 = (signed int)*((short *)v1 - 300) >> 3; | 4524 v3 = PID_ID((signed int)*((short *)v1 - 300)); |
4525 v39 = (signed int)*((short *)v1 - 300) >> 3; | 4525 v39 = PID_ID((signed int)*((short *)v1 - 300)); |
4526 if ( v2 == 2 ) | 4526 if ( v2 == 2 ) |
4527 { | 4527 { |
4528 v4 = &pSpriteObjects[v3]; | 4528 v4 = &pSpriteObjects[v3]; |
4529 v36 = v4; | 4529 v36 = v4; |
4530 v5 = v4->spell_caster_pid; | 4530 v5 = v4->spell_caster_pid; |
4531 v2 = v5 & 7; | 4531 v2 = PID_TYPE(v5); |
4532 v3 = v5 >> 3; | 4532 v3 = PID_ID(v5); |
4533 } | 4533 } |
4534 v41 = v2; | 4534 v41 = v2; |
4535 v37 = v3; | 4535 v37 = v3; |
4536 if ( stru_50FE08.field_3EC[v0] & 1 ) | 4536 if ( stru_50FE08.field_3EC[v0] & 1 ) |
4537 { | 4537 { |
4538 v6 = ai_near_actors_targets_pid[v3]; | 4538 v6 = ai_near_actors_targets_pid[v3]; |
4539 v7 = v6 >> 3; | 4539 v7 = PID_ID(v6); |
4540 v8 = (v6 & 7) - 3; | 4540 v8 = PID_TYPE(v6) - 3; |
4541 uActorID = v7; | 4541 uActorID = v7; |
4542 if ( v8 ) | 4542 if ( v8 ) |
4543 { | 4543 { |
4544 if ( v8 == 1 ) | 4544 if ( v8 == 1 ) |
4545 { | 4545 { |
4761 uDamageAmount = 0; | 4761 uDamageAmount = 0; |
4762 a4 = 0; | 4762 a4 = 0; |
4763 v61 = 0; | 4763 v61 = 0; |
4764 v59 = 0; | 4764 v59 = 0; |
4765 v62 = 0; | 4765 v62 = 0; |
4766 if ( (a1 & 7) == OBJECT_Item) | 4766 if ( PID_TYPE(a1) == OBJECT_Item) |
4767 { | 4767 { |
4768 v4 = &pSpriteObjects[a1 >> 3]; | 4768 v4 = &pSpriteObjects[PID_ID(a1)]; |
4769 //uDamageAmount = (int)v4; | 4769 //uDamageAmount = (int)v4; |
4770 v61 = v4->field_60_distance_related_prolly_lod; | 4770 v61 = v4->field_60_distance_related_prolly_lod; |
4771 a1 = v4->spell_caster_pid; | 4771 a1 = v4->spell_caster_pid; |
4772 //v54 = v4->field_58_pid; | 4772 //v54 = v4->field_58_pid; |
4773 } | 4773 } |
4774 //v5 = a1 & 7; | 4774 //v5 = a1 & 7; |
4775 //uPlayerID = a1 >> 3; | 4775 //uPlayerID = a1 >> 3; |
4776 if ((a1 & 7) != OBJECT_Player) | 4776 if (PID_TYPE(a1) != OBJECT_Player) |
4777 return; | 4777 return; |
4778 | 4778 |
4779 assert(abs(a1 >> 3) < 4); | 4779 assert(PID_ID(abs(a1)) < 4); |
4780 auto player = &pParty->pPlayers[a1 >> 3]; | 4780 auto player = &pParty->pPlayers[PID_ID(a1)]; |
4781 pMonster = &pActors[uActorID_Monster_]; | 4781 pMonster = &pActors[uActorID_Monster_]; |
4782 //uPlayerID = pMonster->IsAlive(); | 4782 //uPlayerID = pMonster->IsAlive(); |
4783 if (pMonster->IsNotAlive()) | 4783 if (pMonster->IsNotAlive()) |
4784 return; | 4784 return; |
4785 | 4785 |
5032 player->PlaySound(SPEECH_52, 0); | 5032 player->PlaySound(SPEECH_52, 0); |
5033 return; | 5033 return; |
5034 } | 5034 } |
5035 if ( pMonster->sCurrentHP > 0 ) | 5035 if ( pMonster->sCurrentHP > 0 ) |
5036 { | 5036 { |
5037 Actor::_4030AD(uActorID_Monster_, a1, 0); | 5037 Actor::Stun(uActorID_Monster_, a1, 0); |
5038 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1); | 5038 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1); |
5039 if ( bShowDamage ) | 5039 if ( bShowDamage ) |
5040 { | 5040 { |
5041 v50 = uDamageAmount; | 5041 v50 = uDamageAmount; |
5042 pMonsterName = (char *)pMonster; | 5042 pMonsterName = (char *)pMonster; |
5236 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 | 5236 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 |
5237 int v77; // [sp+50h] [bp-4h]@26 | 5237 int v77; // [sp+50h] [bp-4h]@26 |
5238 signed int a4a; // [sp+60h] [bp+Ch]@162 | 5238 signed int a4a; // [sp+60h] [bp+Ch]@162 |
5239 Player *a4b; // [sp+60h] [bp+Ch]@168 | 5239 Player *a4b; // [sp+60h] [bp+Ch]@168 |
5240 | 5240 |
5241 v4 = (signed int)uObjID >> 3; | 5241 v4 = PID_ID(uObjID); |
5242 v5 = (uObjID & 7) - 2; | 5242 v5 = PID_TYPE(uObjID) - 2; |
5243 v74 = a2; | 5243 v74 = a2; |
5244 uActorID = v4; | 5244 uActorID = v4; |
5245 if ( v5 ) | 5245 if ( v5 ) |
5246 { | 5246 { |
5247 if ( v5 != 1 | 5247 if ( v5 != 1 |
5307 goto LABEL_26; | 5307 goto LABEL_26; |
5308 } | 5308 } |
5309 } | 5309 } |
5310 v17 = (SoundID)a4; | 5310 v17 = (SoundID)a4; |
5311 LABEL_26: | 5311 LABEL_26: |
5312 pAudioPlayer->PlaySound(v17, (8 * a4 + 80) | 4, 0, -1, 0, 0, 0, 0); | 5312 pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); |
5313 v18 = Actor::_43B3E0_CalcDamage(v7, v74); | 5313 v18 = Actor::_43B3E0_CalcDamage(v7, v74); |
5314 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; | 5314 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; |
5315 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; | 5315 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; |
5316 v77 = v18; | 5316 v77 = v18; |
5317 if ( !v20 && (!(v20 | v19) || LODWORD(v7->pActorBuffs[3].uExpireTime) > 0) ) | 5317 if ( !v20 && (!(v20 | v19) || LODWORD(v7->pActorBuffs[3].uExpireTime) > 0) ) |
5367 v7->sCurrentHP -= v26; | 5367 v7->sCurrentHP -= v26; |
5368 if ( v26 ) | 5368 if ( v26 ) |
5369 { | 5369 { |
5370 if ( v7->sCurrentHP >= 1 ) | 5370 if ( v7->sCurrentHP >= 1 ) |
5371 { | 5371 { |
5372 Actor::_4030AD(uActorID, 8 * a4 | OBJECT_Player, 0); | 5372 Actor::Stun(uActorID, PID(OBJECT_Player,a4), 0); |
5373 Actor::AggroSurroundingPeasants(uActorID, 1); | 5373 Actor::AggroSurroundingPeasants(uActorID, 1); |
5374 } | 5374 } |
5375 else | 5375 else |
5376 { | 5376 { |
5377 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) | 5377 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) |
5434 } | 5434 } |
5435 viewparams->bRedrawGameUI = 1; | 5435 viewparams->bRedrawGameUI = 1; |
5436 return; | 5436 return; |
5437 } | 5437 } |
5438 v37 = &pSpriteObjects[uActorID]; | 5438 v37 = &pSpriteObjects[uActorID]; |
5439 v38 = v37->spell_caster_pid & 7; | 5439 v38 = PID_TYPE(v37->spell_caster_pid); |
5440 v39 = v37->spell_caster_pid >> 3; | 5440 v39 = PID_ID(v37->spell_caster_pid); |
5441 v40 = v37->spell_caster_pid & 7; | 5441 v40 = PID_TYPE(v37->spell_caster_pid); |
5442 uActorID = v37->spell_caster_pid >> 3; | 5442 uActorID = PID_ID(v37->spell_caster_pid); |
5443 v41 = v40 - 2; | 5443 v41 = v40 - 2; |
5444 if ( !v41 ) | 5444 if ( !v41 ) |
5445 goto LABEL_80; | 5445 goto LABEL_80; |
5446 v42 = v41 - 1; | 5446 v42 = v41 - 1; |
5447 if ( !v42 ) | 5447 if ( !v42 ) |
5553 v44->sCurrentHP -= v56; | 5553 v44->sCurrentHP -= v56; |
5554 if ( v56 ) | 5554 if ( v56 ) |
5555 { | 5555 { |
5556 if ( v44->sCurrentHP >= 1 ) | 5556 if ( v44->sCurrentHP >= 1 ) |
5557 { | 5557 { |
5558 Actor::_4030AD(uActorID, 8 * a4 | OBJECT_Player, 0); | 5558 Actor::Stun(uActorID, PID(OBJECT_Player,a4), 0); |
5559 Actor::AggroSurroundingPeasants(uActorID, 1); | 5559 Actor::AggroSurroundingPeasants(uActorID, 1); |
5560 } | 5560 } |
5561 else | 5561 else |
5562 { | 5562 { |
5563 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) | 5563 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) |
5833 uActorIDa = uActorID; | 5833 uActorIDa = uActorID; |
5834 pActor = &pActors[uActorID]; | 5834 pActor = &pActors[uActorID]; |
5835 a2 = uObjID; | 5835 a2 = uObjID; |
5836 if ( !pActors[uActorID].IsNotAlive() ) | 5836 if ( !pActors[uActorID].IsNotAlive() ) |
5837 { | 5837 { |
5838 if ( (a2 & 7) == OBJECT_Item) | 5838 if ( PID_TYPE(a2) == OBJECT_Item) |
5839 { | 5839 { |
5840 v4 = &pSpriteObjects[(signed int)a2 >> 3]; | 5840 v4 = &pSpriteObjects[PID_ID(a2)]; |
5841 v5 = v4->spell_id; | 5841 v5 = v4->spell_id; |
5842 if ( v5 ) | 5842 if ( v5 ) |
5843 { | 5843 { |
5844 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP); | 5844 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP); |
5845 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); | 5845 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); |
5846 pActor->sCurrentHP -= v7; | 5846 pActor->sCurrentHP -= v7; |
5847 if ( v7 ) | 5847 if ( v7 ) |
5848 { | 5848 { |
5849 if ( pActor->sCurrentHP > 0 ) | 5849 if ( pActor->sCurrentHP > 0 ) |
5850 Actor::_4030AD(uActorIDa, a2, 0); | 5850 Actor::Stun(uActorIDa, a2, 0); |
5851 else | 5851 else |
5852 Actor::Die(uActorIDa); | 5852 Actor::Die(uActorIDa); |
5853 a2a = 20 * v7 / (signed int)pActor->pMonsterInfo.uHP; | 5853 a2a = 20 * v7 / (signed int)pActor->pMonsterInfo.uHP; |
5854 if ( 20 * v7 / (signed int)pActor->pMonsterInfo.uHP > 10 ) | 5854 if ( 20 * v7 / (signed int)pActor->pMonsterInfo.uHP > 10 ) |
5855 a2a = 10; | 5855 a2a = 10; |
5864 } | 5864 } |
5865 Actor::AddBloodsplatOnDamageOverlay(uActorIDa, 1, v7); | 5865 Actor::AddBloodsplatOnDamageOverlay(uActorIDa, 1, v7); |
5866 } | 5866 } |
5867 else | 5867 else |
5868 { | 5868 { |
5869 Actor::_4030AD(uActorIDa, a2, 0); | 5869 Actor::Stun(uActorIDa, a2, 0); |
5870 } | 5870 } |
5871 } | 5871 } |
5872 } | 5872 } |
5873 } | 5873 } |
5874 } | 5874 } |
5892 int v18; // [sp+20h] [bp+Ch]@34 | 5892 int v18; // [sp+20h] [bp+Ch]@34 |
5893 | 5893 |
5894 v4 = 0; | 5894 v4 = 0; |
5895 uActorID = a2; | 5895 uActorID = a2; |
5896 v17 = a1; | 5896 v17 = a1; |
5897 if ( (a1 & 7) == OBJECT_Item) | 5897 if ( PID_TYPE(a1) == OBJECT_Item) |
5898 { | 5898 { |
5899 v5 = &pSpriteObjects[a1 >> 3]; | 5899 v5 = &pSpriteObjects[PID_ID(a1)]; |
5900 v4 = v5->field_60_distance_related_prolly_lod; | 5900 v4 = v5->field_60_distance_related_prolly_lod; |
5901 v17 = v5->spell_caster_pid; | 5901 v17 = v5->spell_caster_pid; |
5902 } | 5902 } |
5903 LOWORD(v6) = v17 & 7; | 5903 LOWORD(v6) = PID_TYPE(v17); |
5904 if ( v6 == OBJECT_Actor) | 5904 if ( v6 == OBJECT_Actor) |
5905 { | 5905 { |
5906 v7 = &pActors[a2]; | 5906 v7 = &pActors[a2]; |
5907 v8 = &pActors[v17 >> 3]; | 5907 v8 = &pActors[PID_ID(v17)]; |
5908 v6 = pActors[a2].IsNotAlive(); | 5908 v6 = pActors[a2].IsNotAlive(); |
5909 if ( !v6 ) | 5909 if ( !v6 ) |
5910 { | 5910 { |
5911 v9 = v7->uAIState == 7; | 5911 v9 = v7->uAIState == 7; |
5912 v7->uLastCharacterIDToHit = v17; | 5912 v7->uLastCharacterIDToHit = v17; |
5953 v14 = stru_50C198.CalcMagicalDamageToActor(v7, v12, v10); | 5953 v14 = stru_50C198.CalcMagicalDamageToActor(v7, v12, v10); |
5954 v7->sCurrentHP -= v14; | 5954 v7->sCurrentHP -= v14; |
5955 if ( v14 ) | 5955 if ( v14 ) |
5956 { | 5956 { |
5957 if ( v7->sCurrentHP > 0 ) | 5957 if ( v7->sCurrentHP > 0 ) |
5958 Actor::_4030AD(uActorID, v17, 0); | 5958 Actor::Stun(uActorID, v17, 0); |
5959 else | 5959 else |
5960 Actor::Die(uActorID); | 5960 Actor::Die(uActorID); |
5961 Actor::AggroSurroundingPeasants(uActorID, 0); | 5961 Actor::AggroSurroundingPeasants(uActorID, 0); |
5962 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP; | 5962 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP; |
5963 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 ) | 5963 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 ) |
5973 } | 5973 } |
5974 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14); | 5974 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14); |
5975 } | 5975 } |
5976 else | 5976 else |
5977 { | 5977 { |
5978 Actor::_4030AD(uActorID, v17, 0); | 5978 Actor::Stun(uActorID, v17, 0); |
5979 } | 5979 } |
5980 return; | 5980 return; |
5981 } | 5981 } |
5982 v13 = v7->pMonsterInfo.uSpell2ID; | 5982 v13 = v7->pMonsterInfo.uSpell2ID; |
5983 } | 5983 } |
6745 goto LABEL_11; | 6745 goto LABEL_11; |
6746 v16 = v1->pQueue; | 6746 v16 = v1->pQueue; |
6747 while ( 1 ) | 6747 while ( 1 ) |
6748 { | 6748 { |
6749 v5 = v16->uPackedID; | 6749 v5 = v16->uPackedID; |
6750 if ( (v16->uPackedID & 7) == OBJECT_Player) | 6750 if ( PID_TYPE(v16->uPackedID) == OBJECT_Player) |
6751 break; | 6751 break; |
6752 LABEL_8: | 6752 LABEL_8: |
6753 ++v17; | 6753 ++v17; |
6754 ++v16; | 6754 ++v16; |
6755 if ( v17 >= v1->uActorQueueSize ) | 6755 if ( v17 >= v1->uActorQueueSize ) |
6756 goto LABEL_11; | 6756 goto LABEL_11; |
6757 } | 6757 } |
6758 v15 = v5 >> 3; | 6758 v15 = PID_ID(v5); |
6759 if ( !pPlayers[(v5 >> 3) + 1]->CanAct() || v19 != v15 ) | 6759 if ( !pPlayers[(PID_ID(v5)) + 1]->CanAct() || v19 != v15 ) |
6760 { | 6760 { |
6761 v2 = 0; | 6761 v2 = 0; |
6762 goto LABEL_8; | 6762 goto LABEL_8; |
6763 } | 6763 } |
6764 v2 = 0; | 6764 v2 = 0; |
6765 LABEL_11: | 6765 LABEL_11: |
6766 if ( v17 == v1->uActorQueueSize ) | 6766 if ( v17 == v1->uActorQueueSize ) |
6767 { | 6767 { |
6768 *(int *)v4 = 100; | 6768 *(int *)v4 = 100; |
6769 v6 = 8 * v19; | 6769 v6 = 8 * v19; |
6770 LOBYTE(v6) = 8 * v19 | 4; | 6770 LOBYTE(v6) = PID(OBJECT_Player,v19); |
6771 *((int *)v4 + 2) = v2; | 6771 *((int *)v4 + 2) = v2; |
6772 *((int *)v4 - 1) = v6; | 6772 *((int *)v4 - 1) = v6; |
6773 *((int *)v4 + 1) = v2; | 6773 *((int *)v4 + 1) = v2; |
6774 ++v3; | 6774 ++v3; |
6775 v4 += 16; | 6775 v4 += 16; |
6788 if ( v1->uActorQueueSize > v2 ) | 6788 if ( v1->uActorQueueSize > v2 ) |
6789 { | 6789 { |
6790 v8 = v1->pQueue; | 6790 v8 = v1->pQueue; |
6791 do | 6791 do |
6792 { | 6792 { |
6793 if ( (v8->uPackedID & 7) == OBJECT_Actor && ai_near_actors_ids[v20] == v8->uPackedID >> 3 ) | 6793 if ( PID_TYPE(v8->uPackedID) == OBJECT_Actor && ai_near_actors_ids[v20] == PID_ID(v8->uPackedID) ) |
6794 break; | 6794 break; |
6795 ++v18; | 6795 ++v18; |
6796 ++v8; | 6796 ++v8; |
6797 } | 6797 } |
6798 while ( v18 < v1->uActorQueueSize ); | 6798 while ( v18 < v1->uActorQueueSize ); |
6801 if ( v18 == v1->uActorQueueSize ) | 6801 if ( v18 == v1->uActorQueueSize ) |
6802 { | 6802 { |
6803 v9 = ai_near_actors_ids[v20]; | 6803 v9 = ai_near_actors_ids[v20]; |
6804 *(int *)v7 = 1; | 6804 *(int *)v7 = 1; |
6805 *((int *)v7 + 2) = v2; | 6805 *((int *)v7 + 2) = v2; |
6806 *((int *)v7 - 1) = 8 * v9 | 3; | 6806 *((int *)v7 - 1) = PID(OBJECT_Actor,v9); |
6807 *((int *)v7 + 1) = v2; | 6807 *((int *)v7 + 1) = v2; |
6808 ++v3; | 6808 ++v3; |
6809 v7 += 16; | 6809 v7 += 16; |
6810 } | 6810 } |
6811 ++v20; | 6811 ++v20; |
6832 if ( v1->uActorQueueSize > 0 ) | 6832 if ( v1->uActorQueueSize > 0 ) |
6833 { | 6833 { |
6834 v13 = (char *)&v1->pQueue[0].field_4; | 6834 v13 = (char *)&v1->pQueue[0].field_4; |
6835 do | 6835 do |
6836 { | 6836 { |
6837 v11 = *((int *)v13 - 1) & 7; | 6837 v11 = PID_TYPE(*((int *)v13 - 1)); |
6838 if ( (char)v11 == 4 ) | 6838 if ( (char)v11 == 4 ) |
6839 break; | 6839 break; |
6840 if ( *(int *)v13 > 0 ) | 6840 if ( *(int *)v13 > 0 ) |
6841 break; | 6841 break; |
6842 LOWORD(v11) = v1->_40680F(v12++); | 6842 LOWORD(v11) = v1->_40680F(v12++); |
6922 else | 6922 else |
6923 { | 6923 { |
6924 if ( v6 != 8 ) | 6924 if ( v6 != 8 ) |
6925 goto LABEL_19; | 6925 goto LABEL_19; |
6926 v3 = 0; | 6926 v3 = 0; |
6927 Actor::AI_StandOrBored(v2->uPackedID >> 3, ai_near_actors_targets_pid[v2->uPackedID >> 3], 32, 0); | 6927 Actor::AI_StandOrBored(PID_ID(v2->uPackedID), ai_near_actors_targets_pid[PID_ID(v2->uPackedID)], 32, 0); |
6928 } | 6928 } |
6929 } | 6929 } |
6930 } | 6930 } |
6931 LABEL_20: | 6931 LABEL_20: |
6932 ++v4; | 6932 ++v4; |
7025 LABEL_24: | 7025 LABEL_24: |
7026 result = 1; | 7026 result = 1; |
7027 } | 7027 } |
7028 else | 7028 else |
7029 { | 7029 { |
7030 v8 = &pActors[v1->pQueue[0].uPackedID >> 3]; | 7030 v8 = &pActors[PID_ID(v1->pQueue[0].uPackedID)]; |
7031 if ( v4 > 0 ) | 7031 if ( v4 > 0 ) |
7032 { | 7032 { |
7033 do | 7033 do |
7034 { | 7034 { |
7035 v9 = v8->uAIState; | 7035 v9 = v8->uAIState; |
7077 int v9; // ecx@14 | 7077 int v9; // ecx@14 |
7078 char v10; // zf@15 | 7078 char v10; // zf@15 |
7079 | 7079 |
7080 v2 = this; | 7080 v2 = this; |
7081 v3 = *(&this->field_0 + 4 * (a2 + 2)); | 7081 v3 = *(&this->field_0 + 4 * (a2 + 2)); |
7082 if ( (*((char *)&this->field_0 + 16 * (a2 + 2)) & 7) == OBJECT_Player) | 7082 if ( (*((char *)&this->field_0 + 16 * PID_TYPE(a2 + 2))) == OBJECT_Player) |
7083 { | 7083 { |
7084 v4 = v3 >> 3; | 7084 v4 = PID_ID(v3); |
7085 v5 = (char *)&pParty->pTurnBasedPlayerRecoveryTimes[v3 >> 3]; | 7085 v5 = (char *)&pParty->pTurnBasedPlayerRecoveryTimes[PID_ID(v3)]; |
7086 v6 = *(int *)v5; | 7086 v6 = *(int *)v5; |
7087 if ( *(int *)v5 ) | 7087 if ( *(int *)v5 ) |
7088 *(int *)v5 = 0; | 7088 *(int *)v5 = 0; |
7089 else | 7089 else |
7090 v6 = pPlayers[v4 + 1]->GetAttackRecoveryTime(0); | 7090 v6 = pPlayers[v4 + 1]->GetAttackRecoveryTime(0); |
7091 if ( v6 < 30 ) | 7091 if ( v6 < 30 ) |
7092 v6 = 30; | 7092 v6 = 30; |
7093 } | 7093 } |
7094 else | 7094 else |
7095 { | 7095 { |
7096 v6 = pMonsterStats->pInfos[pActors[v3 >> 3].pMonsterInfo.uID].uRecoveryTime; | 7096 v6 = pMonsterStats->pInfos[pActors[PID_ID(v3)].pMonsterInfo.uID].uRecoveryTime; |
7097 } | 7097 } |
7098 v2->pQueue[a2].field_4 = v6; | 7098 v2->pQueue[a2].field_4 = v6; |
7099 v2->_404544(); | 7099 v2->_404544(); |
7100 if (PID_TYPE(v2->pQueue[0].uPackedID) == OBJECT_Player) | 7100 if (PID_TYPE(v2->pQueue[0].uPackedID) == OBJECT_Player) |
7101 uActiveCharacter = PID_ID(v2->pQueue[0].uPackedID) + 1; | 7101 uActiveCharacter = PID_ID(v2->pQueue[0].uPackedID) + 1; |
7129 } | 7129 } |
7130 | 7130 |
7131 //----- (0040652A) -------------------------------------------------------- | 7131 //----- (0040652A) -------------------------------------------------------- |
7132 void stru262_TurnBased::_40652A() | 7132 void stru262_TurnBased::_40652A() |
7133 { | 7133 { |
7134 char *v1; // edx@2 | 7134 int *v1; // edx@2 |
7135 Actor *v2; // eax@5 | 7135 Actor *v2; // eax@5 |
7136 unsigned __int16 v3; // si@5 | 7136 unsigned __int16 v3; // si@5 |
7137 unsigned int v4; // esi@8 | 7137 unsigned int v4; // esi@8 |
7138 int v5; // [sp+Ch] [bp-4h]@1 | 7138 int v5; // [sp+Ch] [bp-4h]@1 |
7139 | 7139 |
7140 v5 = 0; | 7140 v5 = 0; |
7141 if ( this->uActorQueueSize > 0 ) | 7141 if ( this->uActorQueueSize > 0 ) |
7142 { | 7142 { |
7143 v1 = (char *)&this->pQueue[0].field_4; | 7143 v1 = &this->pQueue[0].field_4; |
7144 do | 7144 do |
7145 { | 7145 { |
7146 if ( !*(int *)v1 ) | 7146 if ( !*(int *)v1 ) |
7147 { | 7147 { |
7148 if ( (*(v1 - 4) & 7) == OBJECT_Player) | 7148 if ( PID_TYPE(*(v1 - 4)) == OBJECT_Player) |
7149 return; | 7149 return; |
7150 v2 = &pActors[*((int *)v1 - 1) >> 3]; | 7150 v2 = &pActors[PID_ID(*(v1 - 1))]; |
7151 v3 = v2->uAIState; | 7151 v3 = v2->uAIState; |
7152 if (v3 == Standing || v3 == Fleeing || v3 == Fidgeting) | 7152 if (v3 == Standing || v3 == Fleeing || v3 == Fidgeting) |
7153 { | 7153 { |
7154 v4 = pMonsterStats->pInfos[v2->pMonsterInfo.uID].uRecoveryTime; | 7154 v4 = pMonsterStats->pInfos[v2->pMonsterInfo.uID].uRecoveryTime; |
7155 *(int *)v1 = v4; | 7155 *(int *)v1 = v4; |
7174 unsigned int v5; // edi@14 | 7174 unsigned int v5; // edi@14 |
7175 | 7175 |
7176 v1 = this; | 7176 v1 = this; |
7177 LOWORD(v2) = _404544(); | 7177 LOWORD(v2) = _404544(); |
7178 if ( v1->pQueue[0].field_4 <= 0 | 7178 if ( v1->pQueue[0].field_4 <= 0 |
7179 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ? (uActiveCharacter = 0) : (v2 = (v2 >> 3) + 1, uActiveCharacter = v2), | 7179 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ? (uActiveCharacter = 0) : (v2 = (PID_ID(v2)) + 1, uActiveCharacter = v2), |
7180 viewparams->bRedrawGameUI = 1, | 7180 viewparams->bRedrawGameUI = 1, |
7181 v1->pQueue[0].field_4 <= 0) ) | 7181 v1->pQueue[0].field_4 <= 0) ) |
7182 { | 7182 { |
7183 v3 = 0; | 7183 v3 = 0; |
7184 if ( v1->uActorQueueSize > 0 ) | 7184 if ( v1->uActorQueueSize > 0 ) |
7185 { | 7185 { |
7186 v4 = (int)v1->pQueue; | 7186 v4 = (int)v1->pQueue; |
7187 do | 7187 do |
7188 { | 7188 { |
7189 v2 = *(int *)v4; | 7189 v2 = *(int *)v4; |
7190 if ( (*(char *)v4 & 7) == OBJECT_Player || *(int *)(v4 + 4) > 0 ) | 7190 if ( PID_TYPE(*(char *)v4) == OBJECT_Player || *(int *)(v4 + 4) > 0 ) |
7191 break; | 7191 break; |
7192 if ( *(int *)(v4 + 8) <= 0 ) | 7192 if ( *(int *)(v4 + 8) <= 0 ) |
7193 { | 7193 { |
7194 LOWORD(v2) = v2 & 3; | 7194 LOWORD(v2) = v2 & 3; |
7195 if ( (char)v2 == 3 ) | 7195 if ( (char)v2 == 3 ) |
7248 { | 7248 { |
7249 v4 = PID_ID(v3); | 7249 v4 = PID_ID(v3); |
7250 a2a = ai_near_actors_targets_pid[PID_ID(v3)]; | 7250 a2a = ai_near_actors_targets_pid[PID_ID(v3)]; |
7251 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[PID_ID(v3)], &a3, 0), sizeof(a3)); | 7251 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[PID_ID(v3)], &a3, 0), sizeof(a3)); |
7252 memcpy(&a4, &a3, sizeof(a4)); | 7252 memcpy(&a4, &a3, sizeof(a4)); |
7253 v5 = &pActors[PID_ID(v3 >> 3)]; | 7253 v5 = &pActors[PID_ID(v3)]; |
7254 LOWORD(v3) = v5->uAIState; | 7254 LOWORD(v3) = v5->uAIState; |
7255 if ( (short)v3 != Dead ) | 7255 if ( (short)v3 != Dead ) |
7256 { | 7256 { |
7257 if ( (short)v3 != Disabled ) | 7257 if ( (short)v3 != Disabled ) |
7258 { | 7258 { |
7325 { | 7325 { |
7326 v24 = v5->pMonsterInfo.uSpellSkillAndMastery1; | 7326 v24 = v5->pMonsterInfo.uSpellSkillAndMastery1; |
7327 v22 = 2; | 7327 v22 = 2; |
7328 v17 = v5->pMonsterInfo.uSpell1ID; | 7328 v17 = v5->pMonsterInfo.uSpell1ID; |
7329 } | 7329 } |
7330 Actor::_404AC7(v4, &a4, v17, v22, v24); | 7330 Actor::SpellAttack(v4, &a4, v17, v22, v24); |
7331 LABEL_25: | 7331 LABEL_25: |
7332 v16 = a2a; | 7332 v16 = a2a; |
7333 v23 = &a4; | 7333 v23 = &a4; |
7334 v21 = 0; | 7334 v21 = 0; |
7335 v15 = v4; | 7335 v15 = v4; |
7341 else | 7341 else |
7342 { | 7342 { |
7343 v18 = v5->pMonsterInfo.uMissleAttack1Type; | 7343 v18 = v5->pMonsterInfo.uMissleAttack1Type; |
7344 v25 = 0; | 7344 v25 = 0; |
7345 } | 7345 } |
7346 Actor::_404874(v4, &a4, v18, v25); | 7346 Actor::RangedAttack(v4, &a4, v18, v25); |
7347 goto LABEL_25; | 7347 goto LABEL_25; |
7348 } | 7348 } |
7349 } | 7349 } |
7350 } | 7350 } |
7351 } | 7351 } |
7355 | 7355 |
7356 //----- (0040680F) -------------------------------------------------------- | 7356 //----- (0040680F) -------------------------------------------------------- |
7357 __int16 stru262_TurnBased::_40680F(int a2) | 7357 __int16 stru262_TurnBased::_40680F(int a2) |
7358 { | 7358 { |
7359 TurnBased_QueueElem *v2; // eax@1 | 7359 TurnBased_QueueElem *v2; // eax@1 |
7360 TurnBased_QueueElem *v3; // eax@1 | 7360 unsigned int v3; // eax@1 |
7361 TurnBased_QueueElem *v4; // edi@2 | 7361 unsigned int v4; // edi@2 |
7362 Actor *v5; // ebx@2 | 7362 Actor *v5; // ebx@2 |
7363 unsigned int *v6; // esi@7 | 7363 unsigned int *v6; // esi@7 |
7364 AIDirection *v7; // esi@10 | 7364 AIDirection *v7; // esi@10 |
7365 int v8; // eax@10 | 7365 int v8; // eax@10 |
7366 unsigned int v9; // ecx@10 | 7366 unsigned int v9; // ecx@10 |
7378 signed int v22; // [sp+58h] [bp+8h]@10 | 7378 signed int v22; // [sp+58h] [bp+8h]@10 |
7379 | 7379 |
7380 v2 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2)); | 7380 v2 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2)); |
7381 v21 = v2; | 7381 v21 = v2; |
7382 v2->uActionLength = 0; | 7382 v2->uActionLength = 0; |
7383 v3 = (TurnBased_QueueElem *)v2->uPackedID; | 7383 v3 = v2->uPackedID; |
7384 if ( (unsigned __int8)v3 & 3 ) | 7384 if ( (unsigned __int8)v3 & 3 ) |
7385 { | 7385 { |
7386 v3 = (TurnBased_QueueElem *)((signed int)v3 >> 3); | 7386 v3 = PID_ID(v3); |
7387 v4 = v3; | 7387 v4 = v3; |
7388 a2a = (int)v3; | 7388 a2a = v3; |
7389 v5 = &pActors[(int)v3]; | 7389 v5 = &pActors[v3]; |
7390 LOWORD(v3) = v5->uAIState; | 7390 LOWORD(v3) = v5->uAIState; |
7391 if ( (short)v3 != 5 ) | 7391 if ( (short)v3 != 5 ) |
7392 { | 7392 { |
7393 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 ) | 7393 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 ) |
7394 { | 7394 { |
7395 v6 = (unsigned int *)&ai_near_actors_targets_pid[(int)v4]; | 7395 v6 = (unsigned int *)&ai_near_actors_targets_pid[(int)v4]; |
7396 Actor::_SelectTarget((unsigned int)v4, &ai_near_actors_targets_pid[(int)v4], true); | 7396 Actor::_SelectTarget((unsigned int)v4, &ai_near_actors_targets_pid[(int)v4], true); |
7397 if ( v5->pMonsterInfo.uHostilityType && !*v6 ) | 7397 if ( v5->pMonsterInfo.uHostilityType && !*v6 ) |
7398 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 7398 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
7399 v22 = *v6; | 7399 v22 = *v6; |
7400 v7 = Actor::GetDirectionInfo(8 * (int)v4 | 3, *v6, &a3, 0); | 7400 v7 = Actor::GetDirectionInfo(PID(OBJECT_Actor,(int)v4), *v6, &a3, 0); |
7401 v8 = v5->uActorRadius; | 7401 v8 = v5->uActorRadius; |
7402 memcpy(&a3, v7, sizeof(a3)); | 7402 memcpy(&a3, v7, sizeof(a3)); |
7403 memcpy(&v18, &a3, sizeof(v18)); | 7403 memcpy(&v18, &a3, sizeof(v18)); |
7404 v9 = a3.uDistance - v8; | 7404 v9 = a3.uDistance - v8; |
7405 v20 = a3.uDistance - v8; | 7405 v20 = a3.uDistance - v8; |
7407 { | 7407 { |
7408 v9 = 0; | 7408 v9 = 0; |
7409 v20 = 0; | 7409 v20 = 0; |
7410 } | 7410 } |
7411 if (PID_TYPE(v22) == OBJECT_Actor) | 7411 if (PID_TYPE(v22) == OBJECT_Actor) |
7412 v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[v22 >> 3].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3); | 7412 v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3); |
7413 else | 7413 else |
7414 v10 = 4; | 7414 v10 = 4; |
7415 if ( v10 == 1 ) | 7415 if ( v10 == 1 ) |
7416 { | 7416 { |
7417 if ( (double)(signed int)v20 < 307.2 ) | 7417 if ( (double)(signed int)v20 < 307.2 ) |
7456 v14 = stru_50C198.special_ability_use_check(v5, a2a); | 7456 v14 = stru_50C198.special_ability_use_check(v5, a2a); |
7457 if ( v14 == 1 ) | 7457 if ( v14 == 1 ) |
7458 { | 7458 { |
7459 if ( v5->pMonsterInfo.uMissleAttack2Type ) | 7459 if ( v5->pMonsterInfo.uMissleAttack2Type ) |
7460 { | 7460 { |
7461 Actor::_40368B(v13, v22, &v18); | 7461 Actor::MissileAttack2(v13, v22, &v18); |
7462 goto LABEL_43; | 7462 goto LABEL_43; |
7463 } | 7463 } |
7464 } | 7464 } |
7465 else | 7465 else |
7466 { | 7466 { |
7471 else | 7471 else |
7472 v15 = v5->pMonsterInfo.uSpell2ID; | 7472 v15 = v5->pMonsterInfo.uSpell2ID; |
7473 if ( v15 ) | 7473 if ( v15 ) |
7474 { | 7474 { |
7475 if ( v14 == 2 ) | 7475 if ( v14 == 2 ) |
7476 Actor::_403854(v13, v22, &v18); | 7476 Actor::SpellAttack1(v13, v22, &v18); |
7477 else | 7477 else |
7478 Actor::_403A60(v13, v22, &v18); | 7478 Actor::SpellAttack2(v13, v22, &v18); |
7479 goto LABEL_43; | 7479 goto LABEL_43; |
7480 } | 7480 } |
7481 goto LABEL_44; | 7481 goto LABEL_44; |
7482 } | 7482 } |
7483 if ( v5->pMonsterInfo.uMissleAttack1Type ) | 7483 if ( v5->pMonsterInfo.uMissleAttack1Type ) |
7484 { | 7484 { |
7485 Actor::_403476(v13, v22, &v18); | 7485 Actor::MissileAttack1(v13, v22, &v18); |
7486 LABEL_43: | 7486 LABEL_43: |
7487 v3 = v21; | 7487 //v3 = v21; |
7488 v21->field_C = 1; | 7488 v21->field_C = 1; |
7489 LABEL_48: | 7489 LABEL_48: |
7490 v3->uActionLength = v5->uCurrentActionLength; | 7490 v21->uActionLength = v5->uCurrentActionLength; |
7491 return (signed __int16)v3; | 7491 //return (signed __int16)v3; |
7492 return (signed __int16)&v21; | |
7492 } | 7493 } |
7493 } | 7494 } |
7494 LABEL_44: | 7495 LABEL_44: |
7495 if ( (double)(signed int)v20 < 307.2 ) | 7496 if ( (double)(signed int)v20 < 307.2 ) |
7496 { | 7497 { |
7497 Actor::_403C6C(v13, v22, &v18); | 7498 Actor::MeleeAttack(v13, v22, &v18); |
7498 v3 = v21; | 7499 //v3 = v21; |
7499 v21->field_C = 3; | 7500 v21->field_C = 3; |
7500 goto LABEL_48; | 7501 goto LABEL_48; |
7501 } | 7502 } |
7502 LABEL_47: | 7503 LABEL_47: |
7503 Actor::AI_Stand(v13, v22, 0x40u, &v18); | 7504 Actor::AI_Stand(v13, v22, 0x40u, &v18); |
7504 v3 = v21; | 7505 //v3 = v21; |
7505 v21->field_C = 0; | 7506 v21->field_C = 0; |
7506 goto LABEL_48; | 7507 goto LABEL_48; |
7507 } | 7508 } |
7508 } | 7509 } |
7509 } | 7510 } |
7541 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor) | 7542 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor) |
7542 { | 7543 { |
7543 v8 = ai_near_actors_targets_pid[PID_ID(v5)]; | 7544 v8 = ai_near_actors_targets_pid[PID_ID(v5)]; |
7544 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7)); | 7545 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7)); |
7545 if ( !v1->_406D10(a2) ) | 7546 if ( !v1->_406D10(a2) ) |
7546 Actor::AI_Stand(v10->uPackedID >> 3, v8, 0x20u, &v7); | 7547 Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 0x20u, &v7); |
7547 } | 7548 } |
7548 ++a2; | 7549 ++a2; |
7549 ++v10; | 7550 ++v10; |
7550 if ( a2 >= v1->uActorQueueSize ) | 7551 if ( a2 >= v1->uActorQueueSize ) |
7551 break; | 7552 break; |
7632 { | 7633 { |
7633 v4 = v14->uPackedID; | 7634 v4 = v14->uPackedID; |
7634 a1 = v14->uPackedID; | 7635 a1 = v14->uPackedID; |
7635 if (PID_TYPE(a1) != OBJECT_Player) | 7636 if (PID_TYPE(a1) != OBJECT_Player) |
7636 { | 7637 { |
7637 v5 = v4 >> 3; | 7638 v5 = PID_ID(v4); |
7638 v12 = v5; | 7639 v12 = v5; |
7639 v6 = &pActors[v5]; | 7640 v6 = &pActors[v5]; |
7640 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result | 7641 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result |
7641 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result ) | 7642 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result ) |
7642 v13 = result; | 7643 v13 = result; |
7812 { | 7813 { |
7813 Actor::AI_Stand(uActorID, a2a, 0x20u, 0); | 7814 Actor::AI_Stand(uActorID, a2a, 0x20u, 0); |
7814 goto LABEL_25; | 7815 goto LABEL_25; |
7815 } | 7816 } |
7816 LABEL_24: | 7817 LABEL_24: |
7817 Actor::_402968(v16, v15, v21, v23); | 7818 Actor::Flee(v16, v15, v21, v23); |
7818 LABEL_25: | 7819 LABEL_25: |
7819 v17 = v29; | 7820 v17 = v29; |
7820 v29->field_C = 4; | 7821 v29->field_C = 4; |
7821 LABEL_60: | 7822 LABEL_60: |
7822 v17->uActionLength = v4->uCurrentActionLength; | 7823 v17->uActionLength = v4->uCurrentActionLength; |
7829 if ( (double)(signed int)v28 < 307.2 ) | 7830 if ( (double)(signed int)v28 < 307.2 ) |
7830 return 0; | 7831 return 0; |
7831 if ( (signed int)v11 < 5120 ) | 7832 if ( (signed int)v11 < 5120 ) |
7832 { | 7833 { |
7833 if ( v4->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 ) | 7834 if ( v4->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 ) |
7834 Actor::_402AD7(uActorID, a2a, uActorID, 32, &pDir); | 7835 Actor::Pursue1(uActorID, a2a, uActorID, 32, &pDir); |
7835 else | 7836 else |
7836 Actor::_40281C(uActorID, a2a, 32, &pDir, 307); | 7837 Actor::Pursue2(uActorID, a2a, 32, &pDir, 307); |
7837 goto LABEL_59; | 7838 goto LABEL_59; |
7838 } | 7839 } |
7839 LABEL_46: | 7840 LABEL_46: |
7840 if ( !v4->pMonsterInfo.uMovementType ) | 7841 if ( !v4->pMonsterInfo.uMovementType ) |
7841 { | 7842 { |
8028 int v63; // [sp+58h] [bp-10h]@4 | 8029 int v63; // [sp+58h] [bp-10h]@4 |
8029 int v64; // [sp+5Ch] [bp-Ch]@4 | 8030 int v64; // [sp+5Ch] [bp-Ch]@4 |
8030 int v65; // [sp+60h] [bp-8h]@4 | 8031 int v65; // [sp+60h] [bp-8h]@4 |
8031 int v66; // [sp+64h] [bp-4h]@7 | 8032 int v66; // [sp+64h] [bp-4h]@7 |
8032 | 8033 |
8033 v2 = (signed int)uObjID >> 3; | 8034 v2 = PID_ID(uObjID); |
8034 v3 = (uObjID & 7) - 2; | 8035 v3 = PID_TYPE(uObjID) - 2; |
8035 v4 = uObj2ID; | 8036 v4 = uObj2ID; |
8036 if ( v3 ) | 8037 if ( v3 ) |
8037 { | 8038 { |
8038 v5 = v3 - 1; | 8039 v5 = v3 - 1; |
8039 if ( v5 ) | 8040 if ( v5 ) |
8064 v11 = pSpriteObjects[v10].vPosition.z; | 8065 v11 = pSpriteObjects[v10].vPosition.z; |
8065 v7 = pSpriteObjects[v10].uSectorID; | 8066 v7 = pSpriteObjects[v10].uSectorID; |
8066 v65 = v11; | 8067 v65 = v11; |
8067 } | 8068 } |
8068 v66 = v7; | 8069 v66 = v7; |
8069 v12 = v4 >> 3; | 8070 v12 = PID_ID(v4); |
8070 v13 = (v4 & 7) - 2; | 8071 v13 = PID_TYPE(v4) - 2; |
8071 if ( v13 ) | 8072 if ( v13 ) |
8072 { | 8073 { |
8073 v14 = v13 - 1; | 8074 v14 = v13 - 1; |
8074 if ( v14 ) | 8075 if ( v14 ) |
8075 { | 8076 { |