Mercurial > mm7
comparison mm7_3.cpp @ 2084:48b790721bdc
WalkSound
author | Ritor1 |
---|---|
date | Sat, 07 Dec 2013 14:25:50 +0600 |
parents | 87be06553c76 |
children | 3920278a2905 |
comparison
equal
deleted
inserted
replaced
2083:69af571f793b | 2084:48b790721bdc |
---|---|
1449 } | 1449 } |
1450 } | 1450 } |
1451 return result; | 1451 return result; |
1452 } | 1452 } |
1453 | 1453 |
1454 //----- (00472866) -------------------------------------------------------- | |
1455 void BLV_ProcessPartyActions() | |
1456 { | |
1457 int v1; // ebx@1 | |
1458 int v2; // edi@1 | |
1459 //int v6; // eax@18 | |
1460 //signed __int64 v8; // qax@27 | |
1461 //int v9; // eax@27 | |
1462 double v10; // st7@27 | |
1463 unsigned int v12; // eax@49 | |
1464 double v13; // st7@50 | |
1465 //int v14; // eax@51 | |
1466 //signed __int64 v15; // qax@53 | |
1467 //double v16; // st7@54 | |
1468 int v17; // eax@62 | |
1469 double v18; // st7@62 | |
1470 int v19; // ST40_4@62 | |
1471 int v20; // eax@65 | |
1472 double v21; // st7@65 | |
1473 int v22; // ST40_4@65 | |
1474 int v23; // eax@66 | |
1475 double v24; // st7@66 | |
1476 int v25; // ST40_4@66 | |
1477 int v26; // eax@67 | |
1478 double v27; // st7@67 | |
1479 int v28; // ST40_4@67 | |
1480 unsigned int v35; // eax@74 | |
1481 int v36; // ecx@88 | |
1482 int new_party_z; // esi@96 | |
1483 int v38; // eax@96 | |
1484 int v39; // ecx@106 | |
1485 int v40; // eax@106 | |
1486 Player **v41; // esi@113 | |
1487 int v42; // eax@120 | |
1488 signed int v43; // ecx@123 | |
1489 BLVFace *v44; // esi@126 | |
1490 PolygonType v45; // al@126 | |
1491 int v46; // ecx@133 | |
1492 char v47; // zf@133 | |
1493 int v48; // eax@133 | |
1494 int v49; // ST40_4@136 | |
1495 int v50; // ST40_4@140 | |
1496 int v51; // eax@140 | |
1497 int v52; // eax@140 | |
1498 signed int v53; // edi@146 | |
1499 int v54; // ebx@146 | |
1500 int v55; // ST30_4@146 | |
1501 AudioPlayer *v56; // ecx@162 | |
1502 SoundID v57; // [sp-20h] [bp-80h]@163 | |
1503 signed int v58; // [sp-1Ch] [bp-7Ch]@161 | |
1504 unsigned int v59; // [sp-18h] [bp-78h]@161 | |
1505 signed int v60; // [sp-14h] [bp-74h]@161 | |
1506 signed int v61; // [sp-10h] [bp-70h]@161 | |
1507 int v62; // [sp-Ch] [bp-6Ch]@161 | |
1508 int v63; // [sp-8h] [bp-68h]@75 | |
1509 unsigned int v64; // [sp-8h] [bp-68h]@161 | |
1510 int v65; // [sp-4h] [bp-64h]@75 | |
1511 int v66; // [sp-4h] [bp-64h]@161 | |
1512 //int v68; // [sp+10h] [bp-50h]@45 | |
1513 int v69; // [sp+10h] [bp-50h]@140 | |
1514 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1 | |
1515 //signed int v71; // [sp+18h] [bp-48h]@1 | |
1516 signed int v72; // [sp+1Ch] [bp-44h]@1 | |
1517 signed int v73; // [sp+20h] [bp-40h]@100 | |
1518 int v74; // [sp+20h] [bp-40h]@140 | |
1519 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15 | |
1520 unsigned int uSectorID; // [sp+28h] [bp-38h]@1 | |
1521 int v78; // [sp+2Ch] [bp-34h]@1 | |
1522 unsigned int uFaceID; // [sp+30h] [bp-30h]@1 | |
1523 int v80; // [sp+34h] [bp-2Ch]@1 | |
1524 int v81; // [sp+38h] [bp-28h]@47 | |
1525 int v82; // [sp+3Ch] [bp-24h]@47 | |
1526 int _view_angle; // [sp+40h] [bp-20h]@47 | |
1527 int bJumping; // [sp+44h] [bp-1Ch]@1 | |
1528 int new_party_y; // [sp+48h] [bp-18h]@1 | |
1529 int new_party_x; // [sp+4Ch] [bp-14h]@1 | |
1530 int party_z; // [sp+50h] [bp-10h]@1 | |
1531 //int v89; // [sp+58h] [bp-8h]@1 | |
1532 int angle; // [sp+5Ch] [bp-4h]@47 | |
1533 | |
1534 uFaceEvent = 0; | |
1535 //v89 = pParty->uFallSpeed; | |
1536 v1 = 0; | |
1537 v2 = 0; | |
1538 new_party_x = pParty->vPosition.x; | |
1539 new_party_y = pParty->vPosition.y; | |
1540 party_z = pParty->vPosition.z; | |
1541 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | |
1542 v72 = 0; | |
1543 v78 = 0; | |
1544 bJumping = 0; | |
1545 | |
1546 uFaceID = -1; | |
1547 int floor_level = collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); | |
1548 | |
1549 if ( pParty->bFlying ) | |
1550 { | |
1551 pParty->bFlying = false; | |
1552 if (pParty->FlyActive()) | |
1553 pOtherOverlayList->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1].field_E |= 1; | |
1554 } | |
1555 | |
1556 if ( floor_level == -30000 || uFaceID == -1) | |
1557 { | |
1558 floor_level = collide_against_floor_approximate(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); | |
1559 if ( floor_level == -30000 || uFaceID == -1) | |
1560 { | |
1561 __debugbreak(); // level built with errors | |
1562 pParty->vPosition.x = blv_prev_party_x; | |
1563 pParty->vPosition.y = blv_prev_party_z; | |
1564 pParty->vPosition.z = blv_prev_party_y; | |
1565 pParty->uFallStartY = blv_prev_party_y; | |
1566 return; | |
1567 } | |
1568 } | |
1569 | |
1570 blv_prev_party_x = pParty->vPosition.x; | |
1571 blv_prev_party_z = pParty->vPosition.y; | |
1572 blv_prev_party_y = pParty->vPosition.z; | |
1573 if (!pParty->bTurnBasedModeOn) | |
1574 { | |
1575 int v67 = GetTickCount() / 500; | |
1576 if (dword_720CDC != v67 ) | |
1577 { | |
1578 dword_4F8580[3 * dword_4F8580[1]] = pParty->vPosition.x; | |
1579 dword_4F8580[3 * dword_4F8580[2]] = pParty->vPosition.y; | |
1580 dword_4F8580[3 * dword_4F8580[3]] = pParty->vPosition.z; | |
1581 if ( dword_4F8580[0] > 60 ) | |
1582 dword_4F8580[0] = 1; | |
1583 } | |
1584 dword_720CDC = v67; | |
1585 } | |
1586 | |
1587 uint fall_start; | |
1588 if (!pParty->FeatherFallActive()) | |
1589 { | |
1590 bFeatherFall = false; | |
1591 if (!pParty->pPlayers[0].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) && // grants feather fall | |
1592 !pParty->pPlayers[1].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) && | |
1593 !pParty->pPlayers[2].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) && | |
1594 !pParty->pPlayers[3].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT)) | |
1595 { | |
1596 fall_start = pParty->uFallStartY; | |
1597 } | |
1598 } | |
1599 else | |
1600 { | |
1601 fall_start = floor_level; | |
1602 bFeatherFall = true; | |
1603 pParty->uFallStartY = floor_level; | |
1604 } | |
1605 | |
1606 | |
1607 if (fall_start - party_z > 512 && !bFeatherFall && party_z <= floor_level + 1) | |
1608 { | |
1609 assert(~pParty->uFlags & PARTY_FLAGS_1_LANDING); // why land in indoor? | |
1610 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) | |
1611 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; | |
1612 else for (uint i = 0; i < 4; ++i) | |
1613 { // receive falling damage | |
1614 Player* player = &pParty->pPlayers[i]; | |
1615 if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS)) | |
1616 { | |
1617 player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, DMGT_PHISYCAL); | |
1618 v10 = (double)(20 - player->GetParameterBonus(player->GetActualEndurance())) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; | |
1619 player->SetRecoveryTime((signed __int64)v10); | |
1620 } | |
1621 } | |
1622 } | |
1623 | |
1624 if ( party_z > floor_level + 1 ) | |
1625 bJumping = 1; | |
1626 | |
1627 bool jumping_up = false; | |
1628 | |
1629 if ( party_z - floor_level <= 32 ) | |
1630 { | |
1631 pParty->uFallStartY = party_z; | |
1632 jumping_up = true; | |
1633 } | |
1634 | |
1635 if (bWalkSound && pParty->walk_sound_timer) | |
1636 { | |
1637 if (pParty->walk_sound_timer > pEventTimer->uTimeElapsed) | |
1638 pParty->walk_sound_timer -= pEventTimer->uTimeElapsed; | |
1639 else pParty->walk_sound_timer = 0; | |
1640 } | |
1641 | |
1642 | |
1643 if (party_z <= floor_level + 1) | |
1644 { | |
1645 party_z = floor_level + 1; | |
1646 pParty->uFallStartY = floor_level + 1; | |
1647 | |
1648 if (!bJumping && pParty->floor_face_pid != uFaceID) | |
1649 { | |
1650 BLVFace* pFace = &pIndoor->pFaces[uFaceID]; | |
1651 if (pFace->uAttributes & FACE_PRESSURE_PLATE) | |
1652 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
1653 } | |
1654 } | |
1655 if (!bJumping) | |
1656 pParty->floor_face_pid = uFaceID; | |
1657 | |
1658 bool on_water = false; | |
1659 if ( pIndoor->pFaces[uFaceID].Fluid()) | |
1660 on_water = true; | |
1661 | |
1662 v81 = pParty->uWalkSpeed; | |
1663 angle = pParty->sRotationY; | |
1664 _view_angle = pParty->sRotationX; | |
1665 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi) | |
1666 / 180)) >> 16; | |
1667 //LABEL_87: | |
1668 while ( pPartyActionQueue->uNumActions ) | |
1669 { | |
1670 switch ( pPartyActionQueue->Next() ) | |
1671 { | |
1672 case PARTY_TurnLeft: | |
1673 if (uTurnSpeed) | |
1674 angle = stru_5C6E00->uDoublePiMask & (angle + uTurnSpeed); | |
1675 else | |
1676 angle = stru_5C6E00->uDoublePiMask & (angle + (int)(v82 * fTurnSpeedMultiplier)); | |
1677 break; | |
1678 case PARTY_TurnRight: | |
1679 if (uTurnSpeed) | |
1680 angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed); | |
1681 else | |
1682 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(v82 * fTurnSpeedMultiplier)); | |
1683 break; | |
1684 | |
1685 case PARTY_FastTurnLeft: | |
1686 if (uTurnSpeed) | |
1687 angle = stru_5C6E00->uDoublePiMask & (angle + uTurnSpeed); | |
1688 else | |
1689 angle = stru_5C6E00->uDoublePiMask & (angle + (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); | |
1690 break; | |
1691 | |
1692 case PARTY_FastTurnRight: | |
1693 if (uTurnSpeed) | |
1694 angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed); | |
1695 else | |
1696 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); | |
1697 break; | |
1698 | |
1699 case PARTY_StrafeLeft: | |
1700 v2 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); | |
1701 v1 += fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); | |
1702 v78 = 1; | |
1703 break; | |
1704 case PARTY_StrafeRight: | |
1705 v2 += fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); | |
1706 v1 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); | |
1707 v78 = 1; | |
1708 break; | |
1709 case PARTY_WalkForward: | |
1710 v2 += fixpoint_mul(stru_5C6E00->Cos(angle), 5 * v81 * fWalkSpeedMultiplier); | |
1711 v1 += fixpoint_mul(stru_5C6E00->Sin(angle), 5 * v81 * fWalkSpeedMultiplier); | |
1712 v78 = 1; | |
1713 break; | |
1714 case PARTY_WalkBackward: | |
1715 v2 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); | |
1716 v1 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); | |
1717 v78 = 1; | |
1718 break; | |
1719 case PARTY_RunForward: | |
1720 v2 += fixpoint_mul(stru_5C6E00->Cos(angle), 2 * v81 * fWalkSpeedMultiplier); | |
1721 v1 += fixpoint_mul(stru_5C6E00->Sin(angle), 2 * v81 * fWalkSpeedMultiplier); | |
1722 v72 = 1; | |
1723 break; | |
1724 case PARTY_RunBackward: | |
1725 //v32 = stru_5C6E00->SinCos(angle); | |
1726 //v33 = (double)v81; | |
1727 //v88 = (double)v81; | |
1728 v2 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); | |
1729 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | |
1730 v1 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); | |
1731 v72 = 1; | |
1732 break; | |
1733 case PARTY_LookUp: | |
1734 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); | |
1735 if ( _view_angle > 128 ) | |
1736 _view_angle = 128; | |
1737 v35 = uActiveCharacter; | |
1738 if ( uActiveCharacter ) | |
1739 pPlayers[v35]->PlaySound((PlayerSpeech)SPEECH_63, 0); | |
1740 break; | |
1741 case PARTY_LookDown: | |
1742 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); | |
1743 if ( _view_angle < -128 ) | |
1744 _view_angle = -128; | |
1745 v35 = uActiveCharacter; | |
1746 if ( uActiveCharacter ) | |
1747 pPlayers[v35]->PlaySound((PlayerSpeech)SPEECH_64, 0); | |
1748 break; | |
1749 case PARTY_CenterView: | |
1750 _view_angle = 0; | |
1751 break; | |
1752 case PARTY_Jump: | |
1753 if ( (!bJumping || party_z <= floor_level + 6 && pParty->uFallSpeed <= 0) && pParty->field_24 ) | |
1754 { | |
1755 bJumping = 1; | |
1756 pParty->uFallSpeed = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)pParty->uFallSpeed); | |
1757 } | |
1758 break; | |
1759 default: | |
1760 break; | |
1761 } | |
1762 } | |
1763 v36 = 0; | |
1764 pParty->sRotationY = angle; | |
1765 pParty->sRotationX = _view_angle; | |
1766 if ( bJumping ) | |
1767 { | |
1768 pParty->uFallSpeed += -2 * pEventTimer->uTimeElapsed * GetGravityStrength(); | |
1769 if ( bJumping != v36 && pParty->uFallSpeed <= v36 ) | |
1770 { | |
1771 if ( pParty->uFallSpeed < -500 && !pParty->bFlying ) | |
1772 { | |
1773 v41 = &pPlayers[1]; | |
1774 do | |
1775 { | |
1776 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) ) //was 8 | |
1777 (*v41)->PlayEmotion(CHARACTER_EXPRESSION_SCARED, 0); | |
1778 ++v41; | |
1779 } | |
1780 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); | |
1781 } | |
1782 } | |
1783 else | |
1784 pParty->uFallStartY = party_z; | |
1785 } | |
1786 else | |
1787 { | |
1788 if ( pIndoor->pFaces[uFaceID].pFacePlane_old.vNormal.z < 32768 ) | |
1789 { | |
1790 pParty->uFallSpeed -= pEventTimer->uTimeElapsed * GetGravityStrength(); | |
1791 pParty->uFallStartY = party_z; | |
1792 } | |
1793 else | |
1794 { | |
1795 if (! (pParty->uFlags & PARTY_FLAGS_1_LANDING) ) | |
1796 pParty->uFallSpeed = 0; | |
1797 pParty->uFallStartY = party_z; | |
1798 } | |
1799 } | |
1800 if ( v2 * v2 + v1 * v1 < 400 ) | |
1801 { | |
1802 v1 = 0; | |
1803 v2 = 0; | |
1804 } | |
1805 stru_721530.field_84 = -1; | |
1806 stru_721530.field_70 = 0; | |
1807 stru_721530.prolly_normal_d = pParty->field_14_radius; | |
1808 stru_721530.field_8_radius = pParty->field_14_radius / 2; | |
1809 int v83 = 0; | |
1810 stru_721530.field_0 = 1; | |
1811 stru_721530.height = pParty->uPartyHeight - 32; | |
1812 while ( 1 ) | |
1813 { | |
1814 new_party_z = party_z; | |
1815 stru_721530.position.x = new_party_x; | |
1816 stru_721530.normal.x = new_party_x; | |
1817 stru_721530.velocity.x = v2; | |
1818 stru_721530.position.y = new_party_y; | |
1819 stru_721530.normal.y = new_party_y; | |
1820 stru_721530.velocity.y = v1; | |
1821 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1; | |
1822 stru_721530.position.z = stru_721530.height + party_z + 1; | |
1823 stru_721530.velocity.z = pParty->uFallSpeed; | |
1824 stru_721530.uSectorID = uSectorID; | |
1825 v38 = 0; | |
1826 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3 ) | |
1827 v38 = 13312; | |
1828 if ( stru_721530._47050A(v38) ) | |
1829 break; | |
1830 v73 = 0; | |
1831 do | |
1832 { | |
1833 _46E44E_collide_against_faces_and_portals(1u); | |
1834 _46E0B2_collide_against_decorations(); | |
1835 for ( v80 = 0; v80 < (signed int)uNumActors; ++v80 ) | |
1836 Actor::_46DF1A_collide_against_actor(v80, 0); | |
1837 if ( _46F04E_collide_against_portals() ) | |
1838 break; | |
1839 ++v73; | |
1840 } | |
1841 while ( v73 < 100 ); | |
1842 if ( stru_721530.field_7C >= stru_721530.field_6C ) | |
1843 { | |
1844 v39 = stru_721530.normal2.x; | |
1845 uSectorID = stru_721530.normal2.y; | |
1846 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
1847 } | |
1848 else | |
1849 { | |
1850 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16) + new_party_x; | |
1851 uSectorID = new_party_y + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16); | |
1852 v40 = new_party_z + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16); | |
1853 } | |
1854 v42 = collide_against_floor(v39, uSectorID, v40 + 40, &stru_721530.uSectorID, &uFaceID); | |
1855 if ( v42 == -30000 || v42 - new_party_z > 128 ) | |
1856 return; | |
1857 if ( stru_721530.field_7C >= stru_721530.field_6C ) | |
1858 { | |
1859 new_party_x = stru_721530.normal2.x; | |
1860 new_party_y = stru_721530.normal2.y; | |
1861 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
1862 break; | |
1863 } | |
1864 new_party_x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; | |
1865 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; | |
1866 v43 = stru_721530.uFaceID; | |
1867 uSectorID = stru_721530.uSectorID; | |
1868 stru_721530.field_70 += stru_721530.field_7C; | |
1869 unsigned long long v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16) + new_party_z; | |
1870 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor) | |
1871 { | |
1872 if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0 | |
1873 && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)) ) | |
1874 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
1875 viewparams->bRedrawGameUI = 1; | |
1876 } | |
1877 else if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) | |
1878 { | |
1879 v53 = integer_sqrt(v2 * v2 + v1 * v1); | |
1880 v80 = v53; | |
1881 v54 = stru_5C6E00->Atan2(new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, | |
1882 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y); | |
1883 v2 = (unsigned __int64)(stru_5C6E00->Cos(v54) * (signed __int64)v53) >> 16; | |
1884 v55 = stru_5C6E00->Sin(v54); | |
1885 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; | |
1886 } | |
1887 else | |
1888 { | |
1889 if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) | |
1890 { | |
1891 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3]; | |
1892 v45 = v44->uPolygonType; | |
1893 if ( v45 == 3 ) | |
1894 { | |
1895 if ( pParty->uFallSpeed < 0 ) | |
1896 pParty->uFallSpeed = 0; | |
1897 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1; | |
1898 if ( pParty->uFallStartY - v87 < 512 ) | |
1899 pParty->uFallStartY = v87; | |
1900 if ( v2 * v2 + v1 * v1 < 400 ) | |
1901 { | |
1902 v1 = 0; | |
1903 v2 = 0; | |
1904 } | |
1905 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 ) | |
1906 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; | |
1907 } | |
1908 else | |
1909 { | |
1910 v46 = pParty->uFallSpeed * v44->pFacePlane_old.vNormal.z; | |
1911 v47 = v45 == 4; | |
1912 v48 = v44->pFacePlane_old.vNormal.x; | |
1913 if ( !v47 ) | |
1914 { | |
1915 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | |
1916 if ((stru_721530.speed >> 3) > v80 ) | |
1917 v80 = stru_721530.speed >> 3; | |
1918 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | |
1919 v81 = v44->pFacePlane_old.vNormal.y; | |
1920 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; | |
1921 v82 = v44->pFacePlane_old.vNormal.z; | |
1922 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; | |
1923 v2 += v50; | |
1924 pParty->uFallSpeed += v82; | |
1925 v74 = v44->pFacePlane_old.vNormal.z; | |
1926 v51 = v44->pFacePlane_old.vNormal.y; | |
1927 v69 = v44->pFacePlane_old.vNormal.x; | |
1928 v80 = v51; | |
1929 v1 += v81; | |
1930 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + new_party_y * v51 + new_party_x * v69) >> 16); | |
1931 if ( v52 > 0 ) | |
1932 { | |
1933 new_party_x += v52 * v69 >> 16; | |
1934 new_party_y += v52 * v80 >> 16; | |
1935 v87 += v52 * v74 >> 16; | |
1936 } | |
1937 v43 = stru_721530.uFaceID; | |
1938 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 ) | |
1939 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; | |
1940 } | |
1941 else | |
1942 { | |
1943 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | |
1944 if ((stru_721530.speed >> 3) > v80 ) | |
1945 v80 = stru_721530.speed >> 3; | |
1946 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | |
1947 v81 = v44->pFacePlane_old.vNormal.y; | |
1948 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; | |
1949 v82 = v44->pFacePlane_old.vNormal.z; | |
1950 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; | |
1951 v2 += v49; | |
1952 v1 += v81; | |
1953 pParty->uFallSpeed += v82; | |
1954 if ( v2 * v2 + v1 * v1 >= 400 ) | |
1955 { | |
1956 v43 = stru_721530.uFaceID; | |
1957 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 ) | |
1958 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; | |
1959 } | |
1960 else | |
1961 { | |
1962 v2 = 0; | |
1963 v1 = 0; | |
1964 pParty->uFallSpeed = 0; | |
1965 } | |
1966 } | |
1967 } | |
1968 } | |
1969 } | |
1970 v2 = (unsigned __int64)(58500i64 * v2) >> 16; | |
1971 v1 = (unsigned __int64)(58500i64 * v1) >> 16; | |
1972 ++v83; | |
1973 pParty->uFallSpeed = (unsigned __int64)(58500i64 * pParty->uFallSpeed) >> 16; | |
1974 if ( v83 >= 100 ) | |
1975 { | |
1976 new_party_z = v87; | |
1977 break; | |
1978 } | |
1979 } | |
1980 if ( bWalkSound && !pParty->walk_sound_timer) | |
1981 { | |
1982 if ( integer_sqrt((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y) | |
1983 * (pParty->vPosition.y - new_party_y) + (pParty->vPosition.z - new_party_z) | |
1984 * (pParty->vPosition.z - new_party_z)) <= 16 ) | |
1985 { | |
1986 pAudioPlayer->_4AA258(804); | |
1987 pParty->walk_sound_timer = 64; | |
1988 } | |
1989 else if ( v72 && (!bJumping || jumping_up) ) | |
1990 { | |
1991 v66 = 0; | |
1992 v64 = 0; | |
1993 v62 = 0; | |
1994 v61 = 0; | |
1995 v60 = -1; | |
1996 v59 = 1; | |
1997 v58 = 804; | |
1998 if ( !on_water ) | |
1999 { | |
2000 v56 = pAudioPlayer; | |
2001 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 ) | |
2002 v57 = (SoundID)50; | |
2003 else | |
2004 v57 = (SoundID)64; | |
2005 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66); | |
2006 } | |
2007 else | |
2008 { | |
2009 v57 = (SoundID)63; | |
2010 v56 = pAudioPlayer; | |
2011 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66); | |
2012 } | |
2013 } | |
2014 else if ( v78 && (!bJumping || jumping_up) ) | |
2015 { | |
2016 v66 = 0; | |
2017 v64 = 0; | |
2018 v62 = 0; | |
2019 v61 = 0; | |
2020 v60 = -1; | |
2021 v59 = 1; | |
2022 v58 = 804; | |
2023 if ( on_water ) | |
2024 { | |
2025 v57 = (SoundID)102; | |
2026 v56 = pAudioPlayer; | |
2027 } | |
2028 else | |
2029 { | |
2030 v56 = pAudioPlayer; | |
2031 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 ) | |
2032 v57 = (SoundID)89; | |
2033 else | |
2034 v57 = (SoundID)103; | |
2035 } | |
2036 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66); | |
2037 } | |
2038 else | |
2039 { | |
2040 pAudioPlayer->_4AA258(804); | |
2041 pParty->walk_sound_timer = 64; | |
2042 } | |
2043 } | |
2044 if ( !bJumping || jumping_up ) | |
2045 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; | |
2046 else | |
2047 pParty->uFlags |= PARTY_FLAGS_1_FALLING; | |
2048 pParty->uFlags &= ~0x200; | |
2049 pParty->vPosition.x = new_party_x; | |
2050 pParty->vPosition.z = new_party_z; | |
2051 pParty->vPosition.y = new_party_y; | |
2052 //pParty->uFallSpeed = v89; | |
2053 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 ) | |
2054 pParty->uFlags |= 0x200; | |
2055 if (uFaceEvent) | |
2056 EventProcessor(uFaceEvent, 0, 1); | |
2057 } | |
2058 | |
2059 //----- (0047531C) -------------------------------------------------------- | 1454 //----- (0047531C) -------------------------------------------------------- |
2060 bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10) | 1455 bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10) |
2061 { | 1456 { |
2062 BLVFace *v10; // ebx@1 | 1457 BLVFace *v10; // ebx@1 |
2063 int v11; // ST1C_4@3 | 1458 int v11; // ST1C_4@3 |