Mercurial > mm7
comparison mm7_3.cpp @ 141:cca78efb377e
Constants -> enums
author | Nomad |
---|---|
date | Tue, 12 Feb 2013 03:02:13 +0200 |
parents | f4d7a9a8c363 |
children | 8b8fd4d83fdc |
comparison
equal
deleted
inserted
replaced
140:f4d7a9a8c363 | 141:cca78efb377e |
---|---|
1481 v40 = v8; | 1481 v40 = v8; |
1482 do | 1482 do |
1483 { | 1483 { |
1484 _46E44E_collide_against_faces_and_portals(0); | 1484 _46E44E_collide_against_faces_and_portals(0); |
1485 _46E0B2_collide_against_decorations(); | 1485 _46E0B2_collide_against_decorations(); |
1486 if ( (v1->field_58 & 7) != 4 ) | 1486 if ( (v1->field_58 & 7) != OBJECT_Player) |
1487 _46EF01_collision_chech_player(1); | 1487 _46EF01_collision_chech_player(1); |
1488 v13 = v1->field_58; | 1488 v13 = v1->field_58; |
1489 v42 = v8; | 1489 v42 = v8; |
1490 if ( (v13 & 7) == 3 ) | 1490 if ( (v13 & 7) == OBJECT_Actor) |
1491 { | 1491 { |
1492 if ( (signed int)uNumActors > v8 ) | 1492 if ( (signed int)uNumActors > v8 ) |
1493 { | 1493 { |
1494 v39b = pActors;//[0].word_000086_some_monster_id; | 1494 v39b = pActors;//[0].word_000086_some_monster_id; |
1495 do | 1495 do |
1573 v1->uSectorID = LOWORD(stru_721530.uSectorID); | 1573 v1->uSectorID = LOWORD(stru_721530.uSectorID); |
1574 stru_721530.field_70 += stru_721530.field_7C; | 1574 stru_721530.field_70 += stru_721530.field_7C; |
1575 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) | 1575 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
1576 return; | 1576 return; |
1577 v15 = (signed int)stru_721530.uFaceID >> 3; | 1577 v15 = (signed int)stru_721530.uFaceID >> 3; |
1578 if ( (stru_721530.uFaceID & 7) == 5 ) | 1578 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
1579 { | 1579 { |
1580 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); | 1580 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); |
1581 v23 = stru_5C6E00->Atan2( | 1581 v23 = stru_5C6E00->Atan2( |
1582 v1->vPosition.x - pLevelDecorations[v15].vPosition.x, | 1582 v1->vPosition.x - pLevelDecorations[v15].vPosition.x, |
1583 v1->vPosition.y - pLevelDecorations[v15].vPosition.y); | 1583 v1->vPosition.y - pLevelDecorations[v15].vPosition.y); |
1591 v41 = v26 >> 16; | 1591 v41 = v26 >> 16; |
1592 v1->vVelocity.y = WORD1(v26); | 1592 v1->vVelocity.y = WORD1(v26); |
1593 } | 1593 } |
1594 else | 1594 else |
1595 { | 1595 { |
1596 if ( (stru_721530.uFaceID & 7) != 6 ) | 1596 if ( (stru_721530.uFaceID & 7) != OBJECT_BModel) |
1597 goto LABEL_64; | 1597 goto LABEL_64; |
1598 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3; | 1598 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3; |
1599 v16 = &pIndoor->pFaces[v15]; | 1599 v16 = &pIndoor->pFaces[v15]; |
1600 if ( v16->uPolygonType != 3 ) | 1600 if ( v16->uPolygonType != 3 ) |
1601 { | 1601 { |
1985 v16 = WorldPosToGridCellZ(v1->vPosition.y); | 1985 v16 = WorldPosToGridCellZ(v1->vPosition.y); |
1986 v17 = v1->vPosition.x; | 1986 v17 = v1->vPosition.x; |
1987 v58 = v16; | 1987 v58 = v16; |
1988 v18 = WorldPosToGridCellX(v17); | 1988 v18 = WorldPosToGridCellX(v17); |
1989 _46E26D_collide_against_sprites(v18, v58); | 1989 _46E26D_collide_against_sprites(v18, v58); |
1990 if ( (v1->field_58 & 7) != 4 ) | 1990 if ( (v1->field_58 & 7) != OBJECT_Player) |
1991 _46EF01_collision_chech_player(0); | 1991 _46EF01_collision_chech_player(0); |
1992 if ( (v1->field_58 & 7) == 3 ) | 1992 if ( (v1->field_58 & 7) == OBJECT_Actor) |
1993 { | 1993 { |
1994 v19 = v1->field_58 >> 3; | 1994 v19 = v1->field_58 >> 3; |
1995 if ( v19 >= 0 ) | 1995 if ( v19 >= 0 ) |
1996 { | 1996 { |
1997 if ( v19 < (signed int)(uNumActors - 1) ) | 1997 if ( v19 < (signed int)(uNumActors - 1) ) |
2092 v1->vPosition.z = v54 + 1; | 2092 v1->vPosition.z = v54 + 1; |
2093 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) | 2093 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
2094 return; | 2094 return; |
2095 } | 2095 } |
2096 v30 = (signed int)stru_721530.uFaceID >> 3; | 2096 v30 = (signed int)stru_721530.uFaceID >> 3; |
2097 if ( (stru_721530.uFaceID & 7) == 5 ) | 2097 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
2098 break; | 2098 break; |
2099 if ( (stru_721530.uFaceID & 7) == 6 ) | 2099 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
2100 { | 2100 { |
2101 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; | 2101 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
2102 v32 = &v31->pFaces[v30 & 0x3F]; | 2102 v32 = &v31->pFaces[v30 & 0x3F]; |
2103 if ( v32->uPolygonType != 3 ) | 2103 if ( v32->uPolygonType != 3 ) |
2104 { | 2104 { |
2812 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 2812 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
2813 v43 = stru_721530.uFaceID; | 2813 v43 = stru_721530.uFaceID; |
2814 uSectorID = stru_721530.uSectorID; | 2814 uSectorID = stru_721530.uSectorID; |
2815 stru_721530.field_70 += stru_721530.field_7C; | 2815 stru_721530.field_70 += stru_721530.field_7C; |
2816 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; | 2816 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; |
2817 if ( (stru_721530.uFaceID & 7) == 3 ) | 2817 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) |
2818 { | 2818 { |
2819 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 2819 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 |
2820 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 2820 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) |
2821 pParty->pPartyBuffs[11].Reset(); | 2821 pParty->pPartyBuffs[11].Reset(); |
2822 viewparams->bRedrawGameUI = 1; | 2822 viewparams->bRedrawGameUI = 1; |
2823 goto LABEL_152; | 2823 goto LABEL_152; |
2824 } | 2824 } |
2825 if ( (stru_721530.uFaceID & 7) == 5 ) | 2825 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
2826 { | 2826 { |
2827 v53 = sub_452A9E(v2 * v2 + v1 * v1); | 2827 v53 = sub_452A9E(v2 * v2 + v1 * v1); |
2828 v80 = v53; | 2828 v80 = v53; |
2829 v54 = stru_5C6E00->Atan2( | 2829 v54 = stru_5C6E00->Atan2( |
2830 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, | 2830 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, |
2833 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); | 2833 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); |
2834 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; | 2834 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; |
2835 } | 2835 } |
2836 else | 2836 else |
2837 { | 2837 { |
2838 if ( (stru_721530.uFaceID & 7) == 6 ) | 2838 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
2839 { | 2839 { |
2840 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; | 2840 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; |
2841 v45 = v44->uPolygonType; | 2841 v45 = v44->uPolygonType; |
2842 if ( v45 == 3 ) | 2842 if ( v45 == 3 ) |
2843 { | 2843 { |
2996 { | 2996 { |
2997 //int _zero; // esi@1 | 2997 //int _zero; // esi@1 |
2998 int v1; // edi@1 | 2998 int v1; // edi@1 |
2999 int v2; // ebx@1 | 2999 int v2; // ebx@1 |
3000 int v3; // eax@14 | 3000 int v3; // eax@14 |
3001 Player **v4; // esi@21 | 3001 //Player **v4; // esi@21 |
3002 int v5; // eax@24 | 3002 //int v5; // eax@24 |
3003 int v6; // esi@45 | 3003 int v6; // esi@45 |
3004 ODMFace *v7; // ecx@45 | 3004 ODMFace *v7; // ecx@45 |
3005 //unsigned int v8; // eax@71 | 3005 //unsigned int v8; // eax@71 |
3006 //double v9; // st7@72 | 3006 //double v9; // st7@72 |
3007 //signed __int64 v10; // qax@74 | 3007 //signed __int64 v10; // qax@74 |
3024 //int v27; // eax@98 | 3024 //int v27; // eax@98 |
3025 //double v28; // st7@98 | 3025 //double v28; // st7@98 |
3026 //signed __int64 v29; // qax@98 | 3026 //signed __int64 v29; // qax@98 |
3027 //unsigned int v30; // eax@103 | 3027 //unsigned int v30; // eax@103 |
3028 int v31; // eax@130 | 3028 int v31; // eax@130 |
3029 int v32; // ecx@141 | 3029 //int v32; // ecx@141 |
3030 signed int v33; // eax@143 | 3030 signed int v33; // eax@143 |
3031 int v34; // esi@143 | 3031 int v34; // esi@143 |
3032 unsigned int v35; // esi@147 | 3032 int v35; // esi@147 |
3033 int v36; // eax@155 | 3033 int v36; // eax@155 |
3034 signed int v37; // esi@159 | 3034 signed int v37; // esi@159 |
3035 signed int v38; // eax@159 | 3035 signed int v38; // eax@159 |
3036 signed int i; // esi@159 | 3036 signed int i; // esi@159 |
3037 int v40; // esi@162 | 3037 int v40; // esi@162 |
3038 Player **v41; // esi@172 | 3038 //Player **v41; // esi@172 |
3039 bool v42; // eax@180 | 3039 bool v42; // eax@180 |
3040 signed int v43; // ecx@184 | 3040 signed int v43; // ecx@184 |
3041 signed int v44; // edx@184 | 3041 signed int v44; // edx@184 |
3042 int v45; // ecx@200 | 3042 int v45; // ecx@200 |
3043 BSPModel *v46; // eax@203 | 3043 BSPModel *v46; // eax@203 |
3181 pParty->uFallStartY = v3; | 3181 pParty->uFallStartY = v3; |
3182 else | 3182 else |
3183 v3 = pParty->uFallStartY; | 3183 v3 = pParty->uFallStartY; |
3184 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 ) | 3184 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 ) |
3185 { | 3185 { |
3186 if ( BYTE1(pParty->uFlags) & 1 ) | 3186 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) |
3187 { | 3187 { |
3188 BYTE1(pParty->uFlags) &= 0xFEu; | 3188 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; |
3189 } | 3189 } |
3190 else | 3190 else for (int _i = 0; _i < 4; ++_i) // receive falling damage |
3191 { | 3191 { |
3192 v4 = &pPlayers[1]; // receive falling damage | 3192 auto player = pParty->pPlayers + _i; |
3193 do | 3193 |
3194 { | 3194 if ( !player->HasEnchantedItemEquipped(72) && !player->WearsItem(529, 8) ) |
3195 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) ) | 3195 { |
3196 { | 3196 player->ReceiveDamage( |
3197 v105 = (*v4)->GetMaxHealth(); | 3197 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(player->GetMaxHealth() / 10)) / 256, |
3198 (*v4)->ReceiveDamage( | |
3199 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256, | |
3200 4); | 3198 4); |
3201 v5 = (*v4)->GetActualEndurance(); | 3199 v105 = 20 - player->_48EA1B_get_static_effect(player->GetActualEndurance()); |
3202 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5); | 3200 player->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); |
3203 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); | 3201 } |
3204 } | 3202 //} |
3205 ++v4; | 3203 //while ( (signed int)v4 <= (signed int)&pPlayers[4] ); |
3206 } | |
3207 while ( (signed int)v4 <= (signed int)&pPlayers[4] ); | |
3208 } | 3204 } |
3209 } | 3205 } |
3210 v109 = -1; | 3206 v109 = -1; |
3211 if ( pParty->bFlying ) | 3207 if ( pParty->bFlying ) |
3212 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102); | 3208 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102); |
3222 bJumping = 1; | 3218 bJumping = 1; |
3223 } | 3219 } |
3224 v101 = v123 - v111 <= 32; | 3220 v101 = v123 - v111 <= 32; |
3225 if ( bWalkSound && pParty->field_6F8 > 0 ) | 3221 if ( bWalkSound && pParty->field_6F8 > 0 ) |
3226 pParty->field_6F8 -= pEventTimer->uTimeElapsed; | 3222 pParty->field_6F8 -= pEventTimer->uTimeElapsed; |
3227 if ( !bUnderwater | 3223 if (!bUnderwater |
3228 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 | 3224 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 |
3229 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) | 3225 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) |
3230 pParty->bFlying = false; | 3226 pParty->bFlying = false; |
3231 if (!bJumping) | 3227 if (!bJumping) |
3232 { | 3228 { |
3535 assert(false); | 3531 assert(false); |
3536 | 3532 |
3537 case PARTY_Land: | 3533 case PARTY_Land: |
3538 if (pParty->bFlying) | 3534 if (pParty->bFlying) |
3539 { | 3535 { |
3540 BYTE1(pParty->uFlags) |= 1u; | 3536 pParty->uFlags |= PARTY_FLAGS_1_LANDING; |
3541 pParty->uFallSpeed = 0; | 3537 pParty->uFallSpeed = 0; |
3542 } | 3538 } |
3543 pParty->bFlying = false; | 3539 pParty->bFlying = false; |
3544 pPartyActionQueue->uNumActions = 0; | 3540 pPartyActionQueue->uNumActions = 0; |
3545 break; | 3541 break; |
3558 v126 = stru_5C6E00->SinCos(v31); | 3554 v126 = stru_5C6E00->SinCos(v31); |
3559 v129 = (unsigned __int64)(4i64 * v126) >> 16; | 3555 v129 = (unsigned __int64)(4i64 * v126) >> 16; |
3560 v123 = v113 + v129; | 3556 v123 = v113 + v129; |
3561 if ( v127 ) | 3557 if ( v127 ) |
3562 v123 = v113; | 3558 v123 = v113; |
3563 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0 | 3559 if (pParty->FlyActive()) |
3564 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) ) | |
3565 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu; | 3560 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu; |
3566 pParty->uFallStartY = v123; | 3561 pParty->uFallStartY = v123; |
3567 goto LABEL_141; | 3562 goto LABEL_141; |
3568 } | 3563 } |
3569 if ( v130 && v121 ) | 3564 if ( v130 && v121 ) |
3573 pParty->uFallStartY = v111; | 3568 pParty->uFallStartY = v111; |
3574 } | 3569 } |
3575 if ( pParty->bFlying ) | 3570 if ( pParty->bFlying ) |
3576 goto LABEL_130; | 3571 goto LABEL_130; |
3577 v113 = v123; | 3572 v113 = v123; |
3578 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0 | 3573 if (pParty->FlyActive()) |
3579 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) ) | |
3580 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; | 3574 stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u; |
3575 | |
3581 LABEL_141: | 3576 LABEL_141: |
3582 v32 = 0; | 3577 if (bJumping && !pParty->bFlying) |
3583 if ( bJumping && !pParty->bFlying ) | |
3584 { | 3578 { |
3585 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); | 3579 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength()); |
3586 v34 = v121 + 2 * v33; | 3580 v34 = v121 + 2 * v33; |
3587 v121 += 2 * v33; | 3581 v121 += 2 * v33; |
3588 goto LABEL_149; | 3582 goto LABEL_164; |
3589 } | 3583 } |
3590 if ( !partyAtHighSlope ) | 3584 if (!partyAtHighSlope) |
3591 { | 3585 { |
3592 v34 = v121; | 3586 v34 = v121; |
3593 LABEL_149: | 3587 if (!bJumping) |
3594 if ( bJumping == v32 ) | |
3595 goto LABEL_150; | 3588 goto LABEL_150; |
3596 goto LABEL_164; | 3589 goto LABEL_164; |
3597 } | 3590 } |
3598 if ( !bJumping ) | 3591 if (!bJumping) |
3599 { | 3592 { |
3600 if ( v108 ) | 3593 if ( v108 ) |
3601 goto LABEL_150; | 3594 goto LABEL_150; |
3602 | 3595 |
3603 // rolling down the hill | 3596 // rolling down the hill |
3605 // and falling to the gravity, gradually sliding downwards. nice trick | 3598 // and falling to the gravity, gradually sliding downwards. nice trick |
3606 v123 = v111; | 3599 v123 = v111; |
3607 ODM_GetTerrainNormalAt(v116, v117, &v98); | 3600 ODM_GetTerrainNormalAt(v116, v117, &v98); |
3608 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength(); | 3601 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength(); |
3609 v129 = abs((signed __int64)v2 * v98.x + (signed __int64)v1 * v98.y + (signed __int64)v35 * v98.z) >> 16; | 3602 v129 = abs((signed __int64)v2 * v98.x + (signed __int64)v1 * v98.y + (signed __int64)v35 * v98.z) >> 16; |
3610 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.x) >> 16); | 3603 v2 += (unsigned __int64)(v129 * (signed __int64)v98.x) >> 16; |
3611 v2 += (int)v127; | 3604 v1 += (unsigned __int64)(v129 * (signed __int64)v98.y) >> 16; |
3612 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.y) >> 16); | 3605 v34 = v35 + ((unsigned __int64)(v129 * (signed __int64)v98.z) >> 16); |
3613 v1 += (int)v127; | |
3614 v128 = v1; | 3606 v128 = v1; |
3615 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98.z) >> 16); | |
3616 v34 = (int)((char *)v127 + v35); | |
3617 v32 = 0; | |
3618 v121 = v34; | 3607 v121 = v34; |
3619 goto LABEL_149; | 3608 if (!bJumping) |
3609 goto LABEL_150; | |
3610 goto LABEL_164; | |
3620 } | 3611 } |
3621 v34 = v121; | 3612 v34 = v121; |
3613 | |
3622 LABEL_164: | 3614 LABEL_164: |
3623 if ( !bUnderwater && v34 <= v32 ) | 3615 if ( !bUnderwater && v34 <= 0) |
3624 { | 3616 { |
3625 if ( v34 < -500 | 3617 if ( v34 < -500 |
3626 && !pParty->bFlying | 3618 && !pParty->bFlying |
3627 && pParty->vPosition.z - v111 > 1000 | 3619 && pParty->vPosition.z - v111 > 1000 |
3628 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 | 3620 && !pParty->FeatherFallActive()) |
3629 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) ) | 3621 { // falling scream |
3630 { | 3622 for (int i = 0; i < 4; ++i) |
3631 v41 = &pPlayers[1]; | 3623 { |
3632 do | 3624 auto player = pParty->pPlayers + i; |
3633 { | 3625 if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(529, 8) && player->CanAct()) |
3634 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() ) | 3626 player->PlaySound(66, 0); |
3635 (*v41)->PlaySound(66, 0); | 3627 } |
3636 ++v41; | 3628 } |
3637 } | 3629 } |
3638 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); | 3630 else |
3639 } | 3631 { |
3640 goto LABEL_151; | |
3641 } | |
3642 LABEL_150: | 3632 LABEL_150: |
3643 pParty->uFallStartY = v123; | 3633 pParty->uFallStartY = v123; |
3644 LABEL_151: | 3634 } |
3635 | |
3645 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope ) | 3636 if ( v2 * v2 + v1 * v1 < 400 && !partyAtHighSlope ) |
3646 { | 3637 { |
3647 *(float *)&v128 = 0.0; | 3638 *(float *)&v128 = 0.0; |
3648 v2 = 0; | 3639 v2 = 0; |
3649 } | 3640 } |
3752 stru_721530.field_70 += stru_721530.field_7C; | 3743 stru_721530.field_70 += stru_721530.field_7C; |
3753 v116 = _angle_x; | 3744 v116 = _angle_x; |
3754 v117 = _angle_y; | 3745 v117 = _angle_y; |
3755 v45 = stru_721530.uFaceID; | 3746 v45 = stru_721530.uFaceID; |
3756 v123 = v40; | 3747 v123 = v40; |
3757 if ( (stru_721530.uFaceID & 7) == 3 ) | 3748 if ( (stru_721530.uFaceID & 7) == OBJECT_Actor) |
3758 { | 3749 { |
3759 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 3750 if (pParty->Invisible()) |
3760 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 3751 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); |
3761 pParty->pPartyBuffs[11].Reset(); | 3752 |
3762 viewparams->bRedrawGameUI = 1; | 3753 viewparams->bRedrawGameUI = 1; |
3763 goto LABEL_234; | 3754 goto LABEL_234; |
3764 } | 3755 } |
3765 if ( (stru_721530.uFaceID & 7) == 5 ) | 3756 if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) |
3766 { | 3757 { |
3767 v56 = sub_452A9E(v2 * v2 + v128 * v128); | 3758 v56 = sub_452A9E(v2 * v2 + v128 * v128); |
3768 v118 = v56; | 3759 v118 = v56; |
3769 v57 = stru_5C6E00->Atan2( | 3760 v57 = stru_5C6E00->Atan2( |
3770 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, | 3761 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, |
3781 v122 = v61 >> 16; | 3772 v122 = v61 >> 16; |
3782 v128 = v61 >> 16; | 3773 v128 = v61 >> 16; |
3783 } | 3774 } |
3784 else | 3775 else |
3785 { | 3776 { |
3786 if ( (stru_721530.uFaceID & 7) == 6 ) | 3777 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) |
3787 { | 3778 { |
3788 pParty->bFlying = 0; | 3779 pParty->bFlying = 0; |
3789 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; | 3780 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
3790 v127 = v46; | 3781 v127 = v46; |
3791 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; | 3782 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F]; |
16344 v55 = (unsigned short *)&pActors[0].uAIState; | 16335 v55 = (unsigned short *)&pActors[0].uAIState; |
16345 *(int *)v54 = uNumActors; | 16336 *(int *)v54 = uNumActors; |
16346 do | 16337 do |
16347 { | 16338 { |
16348 v30 = *v55; | 16339 v30 = *v55; |
16349 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 ) | 16340 if ( *v55 == Dead || v30 == Removed || v30 == Disabled || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == OBJECT_Player) |
16350 ++pInString; | 16341 ++pInString; |
16351 v55 += 418; | 16342 v55 += 418; |
16352 --*(int *)v54; | 16343 --*(int *)v54; |
16353 } | 16344 } |
16354 while ( *(int *)v54 ); | 16345 while ( *(int *)v54 ); |
20444 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u); | 20435 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u); |
20445 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) | 20436 if ( v21->pMonsterInfo.uHostilityType && !*v20 ) |
20446 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 20437 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
20447 a2 = *v20; | 20438 a2 = *v20; |
20448 v76 = a2 & 7; | 20439 v76 = a2 & 7; |
20449 if ( (a2 & 7) == 3 ) | 20440 if ( (a2 & 7) == OBJECT_Actor) |
20450 v80 = 0.5; | 20441 v80 = 0.5; |
20451 else | 20442 else |
20452 v80 = 1.0; | 20443 v80 = 1.0; |
20453 v22 = v21->uAIState; | 20444 v22 = v21->uAIState; |
20454 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 ) | 20445 if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) |
20455 goto LABEL_254; | 20446 goto LABEL_254; |
20456 if ( !v21->sCurrentHP ) | 20447 if ( !v21->sCurrentHP ) |
20457 Actor::Die(uActorID); | 20448 Actor::Die(uActorID); |
20458 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) | 20449 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 ) |
20459 { | 20450 { |
20967 if ( this->uActorQueueSize > 0 ) | 20958 if ( this->uActorQueueSize > 0 ) |
20968 { | 20959 { |
20969 v2 = this->pQueue; | 20960 v2 = this->pQueue; |
20970 do | 20961 do |
20971 { | 20962 { |
20972 if ( (v2->uPackedID & 7) == 3 ) | 20963 if ( (v2->uPackedID & 7) == OBJECT_Actor ) |
20973 { | 20964 { |
20974 v3 = &pActors[v2->uPackedID >> 3]; | 20965 v3 = &pActors[v2->uPackedID >> 3]; |
20975 v4 = &pActors[v2->uPackedID >> 3]; | 20966 v4 = &pActors[v2->uPackedID >> 3]; |
20976 LOBYTE(v4->uAttributes) |= 0x80u; | 20967 LOBYTE(v4->uAttributes) |= 0x80u; |
20977 if ( !v4->CanAct() ) | 20968 if ( !v4->CanAct() ) |
20979 --v19; | 20970 --v19; |
20980 v2->field_4 = 1001; | 20971 v2->field_4 = 1001; |
20981 LOBYTE(v3->uAttributes) &= 0x7Fu; | 20972 LOBYTE(v3->uAttributes) &= 0x7Fu; |
20982 } | 20973 } |
20983 } | 20974 } |
20984 if ( (v2->uPackedID & 7) == 4 ) | 20975 if ( (v2->uPackedID & 7) == OBJECT_Player) |
20985 { | 20976 { |
20986 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; | 20977 v5 = &pParty->pPlayers[v2->uPackedID >> 3]; |
20987 if ( v5->pConditions[14] | 20978 if ( v5->pConditions[14] |
20988 || v5->pConditions[16] | 20979 || v5->pConditions[16] |
20989 || v5->pConditions[15] | 20980 || v5->pConditions[15] |
21015 { | 21006 { |
21016 v9 = v8->field_4; | 21007 v9 = v8->field_4; |
21017 v10 = v7->field_4; | 21008 v10 = v7->field_4; |
21018 if ( v9 < v10 | 21009 if ( v9 < v10 |
21019 || v9 == v10 | 21010 || v9 == v10 |
21020 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3 | 21011 && ((v11 = v8->uPackedID & 7, v11 == OBJECT_Player) && (v7->uPackedID & 7) == OBJECT_Actor |
21021 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) | 21012 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) ) |
21022 { | 21013 { |
21023 v12 = v7->uPackedID; | 21014 v12 = v7->uPackedID; |
21024 v13 = v7->field_4; | 21015 v13 = v7->field_4; |
21025 v14 = v7->uActionLength; | 21016 v14 = v7->uActionLength; |
21044 } | 21035 } |
21045 while ( v21 - 1 < v6 ); | 21036 while ( v21 - 1 < v6 ); |
21046 } | 21037 } |
21047 v1->uActorQueueSize = v19; | 21038 v1->uActorQueueSize = v19; |
21048 result = v1->pQueue[0].uPackedID; | 21039 result = v1->pQueue[0].uPackedID; |
21049 if ( (v1->pQueue[0].uPackedID & 7) == 4 ) | 21040 if ( (v1->pQueue[0].uPackedID & 7) == OBJECT_Player) |
21050 { | 21041 { |
21051 result = (result >> 3) + 1; | 21042 result = (result >> 3) + 1; |
21052 uActiveCharacter = result; | 21043 uActiveCharacter = result; |
21053 v1->field_18 |= 4u; | 21044 v1->field_18 |= 4u; |
21054 } | 21045 } |
21061 if ( v1->uActorQueueSize > 0 ) | 21052 if ( v1->uActorQueueSize > 0 ) |
21062 { | 21053 { |
21063 v17 = v1->pQueue; | 21054 v17 = v1->pQueue; |
21064 do | 21055 do |
21065 { | 21056 { |
21066 if ( (v17->uPackedID & 7) == 4 ) | 21057 if ( (v17->uPackedID & 7) == OBJECT_Player) |
21067 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); | 21058 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875); |
21068 ++v22; | 21059 ++v22; |
21069 ++v17; | 21060 ++v17; |
21070 result = v22; | 21061 result = v22; |
21071 } | 21062 } |