Mercurial > mm7
comparison mm7_6.cpp @ 141:cca78efb377e
Constants -> enums
author | Nomad |
---|---|
date | Tue, 12 Feb 2013 03:02:13 +0200 |
parents | f4d7a9a8c363 |
children | 9abdd40a107b ee11772d0ad2 |
comparison
equal
deleted
inserted
replaced
140:f4d7a9a8c363 | 141:cca78efb377e |
---|---|
3322 v666 = 1; | 3322 v666 = 1; |
3323 else | 3323 else |
3324 v666 = v1; | 3324 v666 = v1; |
3325 a2 = stru_50C198.FindClosesActor(5120, 1, v666); | 3325 a2 = stru_50C198.FindClosesActor(5120, 1, v666); |
3326 v6 = pMouse->uPointingObjectID; | 3326 v6 = pMouse->uPointingObjectID; |
3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == 3 && pActors[v6 >> 3].CanAct() ) | 3327 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
3328 { | 3328 { |
3329 v4 = pMouse->uPointingObjectID; | 3329 v4 = pMouse->uPointingObjectID; |
3330 LABEL_18: | 3330 LABEL_18: |
3331 a2 = v4; | 3331 a2 = v4; |
3332 } | 3332 } |
3333 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | 3333 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; |
3334 if ( (short)a1.uItemType != (short)v1 ) | 3334 if ( (short)a1.uItemType != (short)v1 ) |
3335 { | 3335 { |
3336 if ( (a2 & 7) == 3 ) | 3336 if ( (a2 & 7) == OBJECT_Actor) |
3337 { | 3337 { |
3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | 4, a2, &a3, 0), sizeof(v715)); | 3338 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
3339 v2 = v723; | 3339 v2 = v723; |
3340 v1 = 0; | 3340 v1 = 0; |
3341 } | 3341 } |
3342 else | 3342 else |
3343 { | 3343 { |
3670 case 20: | 3670 case 20: |
3671 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3671 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3672 goto LABEL_83; | 3672 goto LABEL_83; |
3673 if ( a2 == v1 ) | 3673 if ( a2 == v1 ) |
3674 goto LABEL_200; | 3674 goto LABEL_200; |
3675 if ( (a2 & 7) != 3 ) | 3675 if ( (a2 & 7) != OBJECT_Actor) |
3676 goto LABEL_1056; | 3676 goto LABEL_1056; |
3677 v699 = v1; | 3677 v699 = v1; |
3678 v698 = v1; | 3678 v698 = v1; |
3679 v697 = v1; | 3679 v697 = v1; |
3680 a1.stru_24.Reset(); | 3680 a1.stru_24.Reset(); |
3748 LABEL_133: | 3748 LABEL_133: |
3749 v670 = (Vec3_int_ *)v43; | 3749 v670 = (Vec3_int_ *)v43; |
3750 v47 = v38; | 3750 v47 = v38; |
3751 goto LABEL_139; | 3751 goto LABEL_139; |
3752 case 79: | 3752 case 79: |
3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != 3 ) | 3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) |
3754 goto LABEL_83; | 3754 goto LABEL_83; |
3755 v730 = a2 >> 3; | 3755 v730 = a2 >> 3; |
3756 v693 = v1; | 3756 v693 = v1; |
3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | 3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
3758 v692 = v1; | 3758 v692 = v1; |
3853 goto LABEL_83; | 3853 goto LABEL_83; |
3854 case 81: | 3854 case 81: |
3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3856 goto LABEL_83; | 3856 goto LABEL_83; |
3857 if ( a2 == v1 | 3857 if ( a2 == v1 |
3858 || (a2 & 7) != 3 | 3858 || (a2 & 7) != OBJECT_Actor |
3859 || (v730 = a2 >> 3, | 3859 || (v730 = a2 >> 3, |
3860 v721 = (int)&pActors[a2 >> 3], | 3860 v721 = (int)&pActors[a2 >> 3], |
3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | 3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) |
3862 goto LABEL_1056; | 3862 goto LABEL_1056; |
3863 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1); | 3863 Actor::_403EB6(v730, 4u, 0x80u, (AIDirection *)v1); |
3895 amount = 2; | 3895 amount = 2; |
3896 LABEL_174: | 3896 LABEL_174: |
3897 LODWORD(v733) = v57; | 3897 LODWORD(v733) = v57; |
3898 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3898 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3899 goto LABEL_83; | 3899 goto LABEL_83; |
3900 if ( (a2 & 7) != 3 | 3900 if ( (a2 & 7) != OBJECT_Actor |
3901 || (v721 = 836 * (a2 >> 3), | 3901 || (v721 = 836 * (a2 >> 3), |
3902 LODWORD(v718) = (int)&pActors[a2 >> 3], | 3902 LODWORD(v718) = (int)&pActors[a2 >> 3], |
3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | 3903 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) |
3904 goto LABEL_1056; | 3904 goto LABEL_1056; |
3905 v726 = (Player *)(23040 * v2); | 3905 v726 = (Player *)(23040 * v2); |
4322 ++v105; | 4322 ++v105; |
4323 } | 4323 } |
4324 while ( v730b <= &pParty->pPlayers[3] ); | 4324 while ( v730b <= &pParty->pPlayers[3] ); |
4325 goto LABEL_1056; | 4325 goto LABEL_1056; |
4326 case 52: | 4326 case 52: |
4327 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == 3 ) | 4327 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) |
4328 { | 4328 { |
4329 v730 = a2 >> 3; | 4329 v730 = a2 >> 3; |
4330 v112 = &pActors[a2 >> 3]; | 4330 v112 = &pActors[a2 >> 3]; |
4331 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | 4331 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); |
4332 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | 4332 v721 = abs(v112->vPosition.y - pParty->vPosition.y); |
4509 goto LABEL_201; | 4509 goto LABEL_201; |
4510 } | 4510 } |
4511 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4511 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4512 goto LABEL_83; | 4512 goto LABEL_83; |
4513 LODWORD(v725) = a2 & 7; | 4513 LODWORD(v725) = a2 & 7; |
4514 if ( (a2 & 7) == 3 ) | 4514 if ( (a2 & 7) == OBJECT_Actor) |
4515 { | 4515 { |
4516 v152 = a2 >> 3; | 4516 v152 = a2 >> 3; |
4517 uRequiredMana = pActors[v152].vPosition.x; | 4517 uRequiredMana = pActors[v152].vPosition.x; |
4518 v153 = pActors[v152].vPosition.y; | 4518 v153 = pActors[v152].vPosition.y; |
4519 v154 = pActors[v152].vPosition.z; | 4519 v154 = pActors[v152].vPosition.z; |
5818 v651 = v731; | 5818 v651 = v731; |
5819 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | 5819 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); |
5820 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | 5820 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; |
5821 goto LABEL_104; | 5821 goto LABEL_104; |
5822 } | 5822 } |
5823 if ( (v342 & 7) == 3 ) | 5823 if ( (v342 & 7) == OBJECT_Actor) |
5824 { | 5824 { |
5825 v343 = v342 >> 3; | 5825 v343 = v342 >> 3; |
5826 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | 5826 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); |
5827 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | 5827 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
5828 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | 5828 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); |
6209 v656 = 3; | 6209 v656 = 3; |
6210 goto LABEL_640; | 6210 goto LABEL_640; |
6211 case 59: | 6211 case 59: |
6212 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6212 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6213 goto LABEL_83; | 6213 goto LABEL_83; |
6214 if ( a2 == v1 || (a2 & 7) != 3 ) | 6214 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) |
6215 goto LABEL_1056; | 6215 goto LABEL_1056; |
6216 v417 = (int)&pActors[a2 >> 3]; | 6216 v417 = (int)&pActors[a2 >> 3]; |
6217 v730 = v417; | 6217 v730 = v417; |
6218 if ( !(*(char *)(v417 + 38) & 0x80) ) | 6218 if ( !(*(char *)(v417 + 38) & 0x80) ) |
6219 { | 6219 { |
6301 } | 6301 } |
6302 amount = v425; | 6302 amount = v425; |
6303 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6303 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6304 goto LABEL_83; | 6304 goto LABEL_83; |
6305 v426 = a2 >> 3; | 6305 v426 = a2 >> 3; |
6306 if ( (a2 & 7) != 3 ) | 6306 if ( (a2 & 7) != OBJECT_Actor) |
6307 goto LABEL_1056; | 6307 goto LABEL_1056; |
6308 v730 = 836 * v426; | 6308 v730 = 836 * v426; |
6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | 6309 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) |
6310 { | 6310 { |
6311 pActors[v426].pActorBuffs[1].Reset(); | 6311 pActors[v426].pActorBuffs[1].Reset(); |
6329 case 66: | 6329 case 66: |
6330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6331 goto LABEL_83; | 6331 goto LABEL_83; |
6332 amount = 600 * v2; | 6332 amount = 600 * v2; |
6333 v427 = a2 >> 3; | 6333 v427 = a2 >> 3; |
6334 if ( (a2 & 7) != 3 ) | 6334 if ( (a2 & 7) != OBJECT_Actor) |
6335 goto LABEL_1056; | 6335 goto LABEL_1056; |
6336 v730 = 836 * v427; | 6336 v730 = 836 * v427; |
6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 6337 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6338 goto LABEL_83; | 6338 goto LABEL_83; |
6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) | 6339 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) |
6462 } | 6462 } |
6463 amount = v444; | 6463 amount = v444; |
6464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6465 goto LABEL_83; | 6465 goto LABEL_83; |
6466 v445 = a2 >> 3; | 6466 v445 = a2 >> 3; |
6467 if ( (a2 & 7) == 2 ) | 6467 if ( (a2 & 7) == OBJECT_Item) |
6468 { | 6468 { |
6469 v449 = (char *)&pLayingItems[v445].stru_24; | 6469 v449 = (char *)&pLayingItems[v445].stru_24; |
6470 v450 = *(int *)v449; | 6470 v450 = *(int *)v449; |
6471 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | 6471 if ( pItemsTable->pItems[v450].uEquipType == 18 ) |
6472 { | 6472 { |
6482 } | 6482 } |
6483 LayingItem::_42F933(v445); | 6483 LayingItem::_42F933(v445); |
6484 } | 6484 } |
6485 else | 6485 else |
6486 { | 6486 { |
6487 if ( (a2 & 7) == 3 ) | 6487 if ( (a2 & 7) == OBJECT_Actor) |
6488 { | 6488 { |
6489 stru_50C198.LootActor(&pActors[v445]); | 6489 stru_50C198.LootActor(&pActors[v445]); |
6490 } | 6490 } |
6491 else | 6491 else |
6492 { | 6492 { |
6493 if ( (a2 & 7) != 5 ) | 6493 if ( (a2 & 7) != OBJECT_Decoration) |
6494 { | 6494 { |
6495 if ( (a2 & 7) != 6 ) | 6495 if ( (a2 & 7) != OBJECT_BModel) |
6496 goto LABEL_1056; | 6496 goto LABEL_1056; |
6497 dword_507CD8 = 1; | 6497 dword_507CD8 = 1; |
6498 v677 = 1; | 6498 v677 = 1; |
6499 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 6499 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
6500 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | 6500 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; |
6605 v353 = pGame->GetStru6(); | 6605 v353 = pGame->GetStru6(); |
6606 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); | 6606 pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); |
6607 } | 6607 } |
6608 else | 6608 else |
6609 { | 6609 { |
6610 if ( (v460 & 7) == 3 ) | 6610 if ( (v460 & 7) == OBJECT_Actor) |
6611 { | 6611 { |
6612 v461 = &pActors[v460 >> 3]; | 6612 v461 = &pActors[v460 >> 3]; |
6613 v462 = v461->uAIState; | 6613 v462 = v461->uAIState; |
6614 v463 = v461->pMonsterInfo.uHP; | 6614 v463 = v461->pMonsterInfo.uHP; |
6615 if ( v462 != 5 ) | 6615 if ( v462 != 5 ) |
7429 } | 7429 } |
7430 if ( v731 == 4 ) | 7430 if ( v731 == 4 ) |
7431 LODWORD(v733) = 29030400; | 7431 LODWORD(v733) = 29030400; |
7432 LABEL_1082: | 7432 LABEL_1082: |
7433 v599 = a2 >> 3; | 7433 v599 = a2 >> 3; |
7434 if ( (a2 & 7) != 3 ) | 7434 if ( (a2 & 7) != OBJECT_Actor) |
7435 goto LABEL_1056; | 7435 goto LABEL_1056; |
7436 v730 = 836 * v599; | 7436 v730 = 836 * v599; |
7437 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 7437 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
7438 goto LABEL_83; | 7438 goto LABEL_83; |
7439 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) | 7439 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) |
7914 } | 7914 } |
7915 v30 = 0; | 7915 v30 = 0; |
7916 v29 = 0; | 7916 v29 = 0; |
7917 v28 = 0; | 7917 v28 = 0; |
7918 v7 = pMouse->uPointingObjectID; | 7918 v7 = pMouse->uPointingObjectID; |
7919 if ( (pMouse->uPointingObjectID & 7) != 3 || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) | 7919 if ( (pMouse->uPointingObjectID & 7) != OBJECT_Actor || (v34 = pMouse->uPointingObjectID, !pActors[v7 >> 3].CanAct()) ) |
7920 v34 = stru_50C198.FindClosesActor(5120, 0, 0); | 7920 v34 = stru_50C198.FindClosesActor(5120, 0, 0); |
7921 a3.z = 0; | 7921 a3.z = 0; |
7922 a3.y = 0; | 7922 a3.y = 0; |
7923 a3.x = 0; | 7923 a3.x = 0; |
7924 if ( (v34 & 7) == 3 ) | 7924 if ( (v34 & 7) == OBJECT_Actor) |
7925 { | 7925 { |
7926 a2 = v34 >> 3; | 7926 a2 = v34 >> 3; |
7927 v8 = &pActors[v34 >> 3]; | 7927 v8 = &pActors[v34 >> 3]; |
7928 v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z)) | 7928 v34 = sub_452A9E((v8->vPosition.x - pParty->vPosition.x) * (v8->vPosition.x - pParty->vPosition.x) + (v8->vPosition.y - pParty->vPosition.y) * (v8->vPosition.y - pParty->vPosition.y) + (v8->vPosition.z - pParty->vPosition.z) * (v8->vPosition.z - pParty->vPosition.z)) |
7929 - v8->uActorRadius; | 7929 - v8->uActorRadius; |
8172 v27 = v23 - v29; | 8172 v27 = v23 - v29; |
8173 do | 8173 do |
8174 { | 8174 { |
8175 v22 = *v28; | 8175 v22 = *v28; |
8176 v11 = *v28 & 0xFFFF; | 8176 v11 = *v28 & 0xFFFF; |
8177 if ( (*(char *)v28 & 7) == 3 ) | 8177 if ( (*(char *)v28 & 7) == OBJECT_Actor) |
8178 { | 8178 { |
8179 v12 = &pActors[(unsigned int)v11 >> 3]; | 8179 v12 = &pActors[(unsigned int)v11 >> 3]; |
8180 v13 = v12->uAIState; | 8180 v13 = v12->uAIState; |
8181 if ( v13 != 5 ) | 8181 if ( v13 != 5 ) |
8182 { | 8182 { |
9113 //__debugbreak(); | 9113 //__debugbreak(); |
9114 if ( !pCurrentScreen ) | 9114 if ( !pCurrentScreen ) |
9115 { | 9115 { |
9116 if (pParty->bTurnBasedModeOn) | 9116 if (pParty->bTurnBasedModeOn) |
9117 { | 9117 { |
9118 if ( pTurnEngine->field_4 == 3 || (pTurnEngine->pQueue[0].uPackedID & 7) == 4 ) | 9118 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) |
9119 { | 9119 { |
9120 pParty->bTurnBasedModeOn = 0; | 9120 pParty->bTurnBasedModeOn = 0; |
9121 pTurnEngine->End(true); | 9121 pTurnEngine->End(true); |
9122 } | 9122 } |
9123 } | 9123 } |