comparison Actor.cpp @ 849:8fafe3645f36

* PID replaces * Actor::GetDirectionInfo cleaning
author zipi
date Sun, 31 Mar 2013 11:46:28 +0100
parents ceef50611567
children 48c230c37d74
comparison
equal deleted inserted replaced
848:ceef50611567 849:8fafe3645f36
779 if ( v23 > 0 ) 779 if ( v23 > 0 )
780 { 780 {
781 v24 = (double)v118; 781 v24 = (double)v118;
782 v118 = v23; 782 v118 = v23;
783 v112 = v24; 783 v112 = v24;
784 v116 = 8 * LODWORD(v120) | 3; 784 v116 = PID(LODWORD(v120),OBJECT_Actor);
785 do 785 do
786 { 786 {
787 v26 = rand(); 787 v26 = rand();
788 v27 = (double)spellnumb; 788 v27 = (double)spellnumb;
789 v110 = v27; 789 v110 = v27;
913 v104 = 0; 913 v104 = 0;
914 v103 = 0; 914 v103 = 0;
915 v102 = 0; 915 v102 = 0;
916 v40 = 8 * LODWORD(v120); 916 v40 = 8 * LODWORD(v120);
917 v101 = -1; 917 v101 = -1;
918 LOBYTE(v40) = 8 * LOBYTE(v120) | 3; 918 LOBYTE(v40) = PID(LOBYTE(v120),OBJECT_Actor);
919 v100 = 0; 919 v100 = 0;
920 v99 = v40; 920 v99 = v40;
921 v98 = (SoundID)10040; 921 v98 = (SoundID)10040;
922 LABEL_222: 922 LABEL_222:
923 pAudioPlayer->PlaySound(v98, v99, v100, v101, v102, v103, v104, v106); 923 pAudioPlayer->PlaySound(v98, v99, v100, v101, v102, v103, v104, v106);
966 v104 = 0; 966 v104 = 0;
967 v103 = 0; 967 v103 = 0;
968 v102 = 0; 968 v102 = 0;
969 v43 = 8 * LODWORD(v120); 969 v43 = 8 * LODWORD(v120);
970 v101 = -1; 970 v101 = -1;
971 LOBYTE(v43) = 8 * LOBYTE(v120) | 3; 971 LOBYTE(v43) = PID(LOBYTE(v120),OBJECT_Actor);
972 v100 = 0; 972 v100 = 0;
973 v99 = v43; 973 v99 = v43;
974 v98 = (SoundID)14010; 974 v98 = (SoundID)14010;
975 goto LABEL_222; 975 goto LABEL_222;
976 } 976 }
1005 v104 = 0; 1005 v104 = 0;
1006 v103 = 0; 1006 v103 = 0;
1007 v102 = 0; 1007 v102 = 0;
1008 v46 = 8 * LODWORD(v120); 1008 v46 = 8 * LODWORD(v120);
1009 v101 = -1; 1009 v101 = -1;
1010 LOBYTE(v46) = 8 * LOBYTE(v120) | 3; 1010 LOBYTE(v46) = PID(LOBYTE(v120),OBJECT_Actor);
1011 v100 = 0; 1011 v100 = 0;
1012 v99 = v46; 1012 v99 = v46;
1013 v98 = (SoundID)13040; 1013 v98 = (SoundID)13040;
1014 goto LABEL_222; 1014 goto LABEL_222;
1015 } 1015 }
1048 v104 = v47; 1048 v104 = v47;
1049 v103 = v47; 1049 v103 = v47;
1050 v50 = 8 * LODWORD(v120); 1050 v50 = 8 * LODWORD(v120);
1051 v102 = v47; 1051 v102 = v47;
1052 v101 = -1; 1052 v101 = -1;
1053 LOBYTE(v50) = 8 * LOBYTE(v120) | 3; 1053 LOBYTE(v50) = PID(LOBYTE(v120),OBJECT_Actor);
1054 v100 = v47; 1054 v100 = v47;
1055 v99 = v50; 1055 v99 = v50;
1056 v98 = (SoundID)14020; 1056 v98 = (SoundID)14020;
1057 goto LABEL_222; 1057 goto LABEL_222;
1058 } 1058 }
1100 v104 = 0; 1100 v104 = 0;
1101 v103 = 0; 1101 v103 = 0;
1102 v65 = 8 * LODWORD(v120); 1102 v65 = 8 * LODWORD(v120);
1103 v102 = 0; 1103 v102 = 0;
1104 v101 = -1; 1104 v101 = -1;
1105 LOBYTE(v65) = 8 * LOBYTE(v120) | 3; 1105 LOBYTE(v65) = PID(LOBYTE(v120),OBJECT_Actor);
1106 v100 = 0; 1106 v100 = 0;
1107 v99 = v65; 1107 v99 = v65;
1108 v22 = (SoundID)word_4EE088_sound_ids[80]; 1108 v22 = (SoundID)word_4EE088_sound_ids[80];
1109 goto LABEL_202; 1109 goto LABEL_202;
1110 } 1110 }
1129 v104 = 0; 1129 v104 = 0;
1130 v103 = 0; 1130 v103 = 0;
1131 v102 = 0; 1131 v102 = 0;
1132 v52 = 8 * LODWORD(v120); 1132 v52 = 8 * LODWORD(v120);
1133 v101 = -1; 1133 v101 = -1;
1134 LOBYTE(v52) = 8 * LOBYTE(v120) | 3; 1134 LOBYTE(v52) = PID(LOBYTE(v120),OBJECT_Actor);
1135 v100 = 0; 1135 v100 = 0;
1136 v99 = v52; 1136 v99 = v52;
1137 v98 = (SoundID)16060; 1137 v98 = (SoundID)16060;
1138 goto LABEL_222; 1138 goto LABEL_222;
1139 } 1139 }
1183 v104 = 0; 1183 v104 = 0;
1184 v103 = 0; 1184 v103 = 0;
1185 v102 = 0; 1185 v102 = 0;
1186 v55 = 8 * LODWORD(v120); 1186 v55 = 8 * LODWORD(v120);
1187 v101 = -1; 1187 v101 = -1;
1188 LOBYTE(v55) = 8 * LOBYTE(v120) | 3; 1188 LOBYTE(v55) = PID(LOBYTE(v120),OBJECT_Actor);
1189 v100 = 0; 1189 v100 = 0;
1190 v99 = v55; 1190 v99 = v55;
1191 v98 = (SoundID)14060; 1191 v98 = (SoundID)14060;
1192 goto LABEL_222; 1192 goto LABEL_222;
1193 } 1193 }
1226 v104 = 0; 1226 v104 = 0;
1227 v103 = 0; 1227 v103 = 0;
1228 v102 = 0; 1228 v102 = 0;
1229 v97 = 8 * LODWORD(v120); 1229 v97 = 8 * LODWORD(v120);
1230 v101 = -1; 1230 v101 = -1;
1231 LOBYTE(v97) = 8 * LOBYTE(v120) | 3; 1231 LOBYTE(v97) = PID(LOBYTE(v120),OBJECT_Actor);
1232 v100 = 0; 1232 v100 = 0;
1233 v99 = v97; 1233 v99 = v97;
1234 v98 = (SoundID)17070; 1234 v98 = (SoundID)17070;
1235 goto LABEL_222; 1235 goto LABEL_222;
1236 } 1236 }
1270 v104 = 0; 1270 v104 = 0;
1271 v103 = 0; 1271 v103 = 0;
1272 v102 = 0; 1272 v102 = 0;
1273 v95 = 8 * LODWORD(v120); 1273 v95 = 8 * LODWORD(v120);
1274 v101 = -1; 1274 v101 = -1;
1275 LOBYTE(v95) = 8 * LOBYTE(v120) | 3; 1275 LOBYTE(v95) = PID(LOBYTE(v120),OBJECT_Actor);
1276 v100 = 0; 1276 v100 = 0;
1277 v99 = v95; 1277 v99 = v95;
1278 v98 = (SoundID)17080; 1278 v98 = (SoundID)17080;
1279 goto LABEL_222; 1279 goto LABEL_222;
1280 } 1280 }
1317 v104 = 0; 1317 v104 = 0;
1318 v103 = 0; 1318 v103 = 0;
1319 v102 = 0; 1319 v102 = 0;
1320 v69 = 8 * LODWORD(v120); 1320 v69 = 8 * LODWORD(v120);
1321 v101 = -1; 1321 v101 = -1;
1322 LOBYTE(v69) = 8 * LOBYTE(v120) | 3; 1322 LOBYTE(v69) = PID(LOBYTE(v120),OBJECT_Actor);
1323 v100 = 0; 1323 v100 = 0;
1324 v99 = v69; 1324 v99 = v69;
1325 v98 = (SoundID)18060; 1325 v98 = (SoundID)18060;
1326 goto LABEL_222; 1326 goto LABEL_222;
1327 } 1327 }
1756 int outy; // [sp+44h] [bp-8h]@6 1756 int outy; // [sp+44h] [bp-8h]@6
1757 int outx; // [sp+48h] [bp-4h]@6 1757 int outx; // [sp+48h] [bp-4h]@6
1758 float a4a; // [sp+58h] [bp+Ch]@45 1758 float a4a; // [sp+58h] [bp+Ch]@45
1759 1759
1760 v4 = PID_ID(uObj1ID); 1760 v4 = PID_ID(uObj1ID);
1761 v5 = PID_TYPE(uObj1ID) - 2; 1761 v5 = PID_TYPE(uObj1ID);
1762 v6 = uObj2ID; 1762 v6 = uObj2ID;
1763 if ( !v5 )
1764 {
1765 v19 = v4;
1766 outx = pSpriteObjects[v19].vPosition.x;
1767 v13 = pSpriteObjects[v19].vPosition.y;
1768 v14 = pSpriteObjects[v19].vPosition.z;
1769 goto LABEL_26;
1770 }
1771 v7 = v5 - 1;
1772 if ( !v7 )
1773 {
1774 outx = pActors[v4].vPosition.x;
1775 outy = pActors[v4].vPosition.y;
1776 LODWORD(v42) = pActors[v4].uActorHeight;
1777 v11 = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)SLODWORD(v42) * -0.75);
1778 goto LABEL_24;
1779 }
1780 v8 = v7 - 1;
1781 if ( !v8 )
1782 {
1783 if ( !v4 )
1784 {
1785 outx = pParty->vPosition.x;
1786 outy = pParty->vPosition.y;
1787 v14 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1788 LABEL_27:
1789 outz = v14;
1790 goto LABEL_28;
1791 }
1792 v15 = v4 - 1;
1793 if ( v15 )
1794 {
1795 v16 = v15 - 1;
1796 if ( v16 )
1797 {
1798 v17 = v16 - 1;
1799 if ( v17 )
1800 {
1801 if ( v17 != 1 )
1802 goto LABEL_28;
1803 v40 = &outz;
1804 v39 = &outy;
1805 v38 = &outx;
1806 v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
1807 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1808 goto LABEL_20;
1809 }
1810 v40 = &outz;
1811 v39 = &outy;
1812 v38 = &outx;
1813 v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
1814 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1815 }
1816 else
1817 {
1818 v40 = &outz;
1819 v39 = &outy;
1820 v38 = &outx;
1821 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1822 v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
1823 }
1824 *(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
1825 v36 = 0;
1826 v35 = 8;
1827 LABEL_21:
1828 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
1829 goto LABEL_28;
1830 }
1831 v40 = &outz;
1832 v39 = &outy;
1833 v38 = &outx;
1834 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1835 v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
1836 LABEL_20:
1837 *(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
1838 v36 = 0;
1839 v35 = 24;
1840 goto LABEL_21;
1841 }
1842 v9 = v8 - 1;
1843 if ( !v9 )
1844 {
1845 v12 = v4;
1846 outx = pLevelDecorations[v12].vPosition.x;
1847 v13 = pLevelDecorations[v12].vPosition.y;
1848 v14 = pLevelDecorations[v12].vPosition.z;
1849 LABEL_26:
1850 outy = v13;
1851 goto LABEL_27;
1852 }
1853 if ( v9 != 1 )
1854 {
1855 outz = 0;
1856 outy = 0;
1857 outx = 0;
1858 goto LABEL_28;
1859 }
1860 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1861 {
1862 v10 = &pIndoor->pFaces[v4];
1863 outx = (v10->pBounding.x1 + v10->pBounding.x2) >> 1;
1864 outy = (v10->pBounding.y1 + v10->pBounding.y2) >> 1;
1865 v11 = (v10->pBounding.z1 + v10->pBounding.z2) >> 1;
1866 LABEL_24:
1867 outz = v11;
1868 }
1869 LABEL_28:
1870 v20 = v6; 1763 v20 = v6;
1871 v21 = PID_TYPE(v6); 1764 v21 = PID_TYPE(v6);
1872 v22 = PID_ID(v20); 1765 v22 = PID_ID(v20);
1873 if ( v21 == 2 ) 1766 switch(v5)
1874 { 1767 {
1875 v30 = v22; 1768 case OBJECT_Item:
1876 LODWORD(v45) = pSpriteObjects[v30].vPosition.x; 1769 {
1877 v27 = pSpriteObjects[v30].vPosition.y; 1770 v19 = v4;
1878 v28 = pSpriteObjects[v30].vPosition.z; 1771 outx = pSpriteObjects[v19].vPosition.x;
1879 goto LABEL_43; 1772 v13 = pSpriteObjects[v19].vPosition.y;
1880 } 1773 v14 = pSpriteObjects[v19].vPosition.z;
1881 if ( v21 == 3 ) 1774 outy = v13;
1882 { 1775 outz = v14;
1883 LODWORD(v45) = pActors[v22].vPosition.x; 1776 v30 = v22;
1884 LODWORD(v44) = pActors[v22].vPosition.y; 1777 LODWORD(v45) = pSpriteObjects[v30].vPosition.x;
1885 v25 = pActors[v22].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v22].uActorHeight * -0.75); 1778 v27 = pSpriteObjects[v30].vPosition.y;
1886 goto LABEL_41; 1779 v28 = pSpriteObjects[v30].vPosition.z;
1887 } 1780 LODWORD(v44) = v27;
1888 if ( v21 == 4 ) 1781 a4 = v28;
1889 { 1782 break;
1890 LODWORD(v45) = pParty->vPosition.x; 1783 }
1891 LODWORD(v44) = pParty->vPosition.y; 1784 case OBJECT_Actor:
1892 v29 = a4; 1785 {
1893 if ( !a4 ) 1786 outx = pActors[v4].vPosition.x;
1894 v29 = pParty->sEyelevel; 1787 outy = pActors[v4].vPosition.y;
1895 v28 = pParty->vPosition.z + v29; 1788 LODWORD(v42) = pActors[v4].uActorHeight;
1896 goto LABEL_44; 1789 v11 = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)SLODWORD(v42) * -0.75);
1897 } 1790 outz = v11;
1898 if ( v21 == 5 ) 1791 LODWORD(v45) = pActors[v22].vPosition.x;
1899 { 1792 LODWORD(v44) = pActors[v22].vPosition.y;
1900 v26 = v22; 1793 v25 = pActors[v22].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v22].uActorHeight * -0.75);
1901 LODWORD(v45) = pLevelDecorations[v26].vPosition.x; 1794 a4 = v25;
1902 v27 = pLevelDecorations[v26].vPosition.y; 1795 break;
1903 v28 = pLevelDecorations[v26].vPosition.z; 1796 }
1904 LABEL_43: 1797 case OBJECT_Player:
1905 LODWORD(v44) = v27; 1798 {
1906 LABEL_44: 1799 if ( !v4 )
1907 a4 = v28; 1800 {
1908 goto LABEL_45; 1801 outx = pParty->vPosition.x;
1909 } 1802 outy = pParty->vPosition.y;
1910 if ( v21 != 6 ) 1803 v14 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1911 { 1804 outz = v14;
1912 a4 = 0; 1805 break;;
1913 v44 = 0.0; 1806 }
1914 v45 = 0.0; 1807 if ( v4 == 4 )
1915 goto LABEL_45; 1808 {
1916 } 1809 v40 = &outz;
1917 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 1810 v39 = &outy;
1918 { 1811 v38 = &outx;
1919 v23 = &pIndoor->pFaces[v22]; 1812 v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
1920 v24 = v23->pBounding.y1; 1813 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1921 LODWORD(v45) = (v23->pBounding.x1 + v23->pBounding.x2) >> 1; 1814 *(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
1922 LODWORD(v44) = (v24 + v23->pBounding.y2) >> 1; 1815 v36 = 0;
1923 v25 = (v23->pBounding.z1 + v23->pBounding.z2) >> 1; 1816 v35 = 24;
1924 LABEL_41: 1817 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
1925 a4 = v25; 1818 break;
1926 } 1819 }
1927 LABEL_45: 1820 if ( v4 == 3 )
1821 {
1822 v40 = &outz;
1823 v39 = &outy;
1824 v38 = &outx;
1825 v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
1826 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1827 *(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
1828 v36 = 0;
1829 v35 = 8;
1830 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
1831 break;
1832 }
1833 if ( v4 == 2 )
1834 {
1835 v40 = &outz;
1836 v39 = &outy;
1837 v38 = &outx;
1838 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1839 v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
1840 *(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
1841 v36 = 0;
1842 v35 = 8;
1843 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
1844 break;
1845 }
1846 if ( v4 == 1 )
1847 {
1848 v40 = &outz;
1849 v39 = &outy;
1850 v38 = &outx;
1851 v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
1852 v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
1853 *(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
1854 v36 = 0;
1855 v35 = 24;
1856 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
1857 break;
1858 }
1859 LODWORD(v45) = pParty->vPosition.x;
1860 LODWORD(v44) = pParty->vPosition.y;
1861 v29 = a4;
1862 if ( !a4 )
1863 v29 = pParty->sEyelevel;
1864 v28 = pParty->vPosition.z + v29;
1865 a4 = v28;
1866 }
1867 case OBJECT_Decoration:
1868 {
1869 v12 = v4;
1870 outx = pLevelDecorations[v12].vPosition.x;
1871 v13 = pLevelDecorations[v12].vPosition.y;
1872 v14 = pLevelDecorations[v12].vPosition.z;
1873 outy = v13;
1874 outz = v14;
1875 v26 = v22;
1876 LODWORD(v45) = pLevelDecorations[v26].vPosition.x;
1877 v27 = pLevelDecorations[v26].vPosition.y;
1878 v28 = pLevelDecorations[v26].vPosition.z;
1879 LODWORD(v44) = v27;
1880 a4 = v28;
1881 break;
1882 }
1883 default:
1884 {
1885 outz = 0;
1886 outy = 0;
1887 outx = 0;
1888 a4 = 0;
1889 v44 = 0.0;
1890 v45 = 0.0;
1891 break;
1892 }
1893 case OBJECT_BModel:
1894 {
1895 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1896 {
1897 v10 = &pIndoor->pFaces[v4];
1898 outx = (v10->pBounding.x1 + v10->pBounding.x2) >> 1;
1899 outy = (v10->pBounding.y1 + v10->pBounding.y2) >> 1;
1900 v11 = (v10->pBounding.z1 + v10->pBounding.z2) >> 1;
1901 outz = v11;
1902 }
1903 else if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
1904 {
1905 v23 = &pIndoor->pFaces[v22];
1906 v24 = v23->pBounding.y1;
1907 LODWORD(v45) = (v23->pBounding.x1 + v23->pBounding.x2) >> 1;
1908 LODWORD(v44) = (v24 + v23->pBounding.y2) >> 1;
1909 v25 = (v23->pBounding.z1 + v23->pBounding.z2) >> 1;
1910 a4 = v25;
1911 }
1912 break;
1913 }
1914 }
1928 v31 = (double)SLODWORD(v45) - (double)outx; 1915 v31 = (double)SLODWORD(v45) - (double)outx;
1929 v42 = v31; 1916 v42 = v31;
1930 v32 = (double)SLODWORD(v44) - (double)outy; 1917 v32 = (double)SLODWORD(v44) - (double)outy;
1931 v43 = v32; 1918 v43 = v32;
1932 a4a = (double)a4 - (double)outz; 1919 a4a = (double)a4 - (double)outz;
2085 Actor::AI_Stand(uActorID, sTargetPid, 0, arg0); 2072 Actor::AI_Stand(uActorID, sTargetPid, 0, arg0);
2086 return; 2073 return;
2087 } 2074 }
2088 2075
2089 if ( PID_TYPE(sTargetPid) == OBJECT_Actor) 2076 if ( PID_TYPE(sTargetPid) == OBJECT_Actor)
2090 { 2077 {
2091 v8 = PID_ID(sTargetPid); 2078 v8 = PID_ID(sTargetPid);
2092 v6 = (AIDirection *)pActors[v8].vPosition.x; 2079 v6 = (AIDirection *)pActors[v8].vPosition.x;
2093 v7 = (AIDirection *)pActors[v8].vPosition.y; 2080 v7 = (AIDirection *)pActors[v8].vPosition.y;
2094 v23 = (signed __int64)((double)pActors[v8].uActorHeight * 0.75 + (double)pActors[v8].vPosition.z); 2081 v23 = (signed __int64)((double)pActors[v8].uActorHeight * 0.75 + (double)pActors[v8].vPosition.z);
2095 } 2082 }
2096 else 2083 else if ( PID_TYPE(sTargetPid) == OBJECT_Player)
2097 { 2084 {
2098 if ( PID_TYPE(sTargetPid) == OBJECT_Player) 2085 v6 = (AIDirection *)pParty->vPosition.x;
2099 { 2086 v7 = (AIDirection *)pParty->vPosition.y;
2100 v6 = (AIDirection *)pParty->vPosition.x; 2087 v23 = pParty->vPosition.z + pParty->sEyelevel;
2101 v7 = (AIDirection *)pParty->vPosition.y; 2088 }
2102 v23 = pParty->vPosition.z + pParty->sEyelevel; 2089 else
2103 } 2090 {
2104 else 2091 v6 = arg0;
2105 { 2092 v7 = arg0;
2106 v6 = arg0; 2093 }
2107 v7 = arg0; 2094 v21 = v3->uActorHeight;
2108 } 2095 v9 = (double)(signed int)v21 * 0.75;
2109 } 2096 v21 = v3->vPosition.z;
2110 v21 = v3->uActorHeight; 2097 v10.z = (signed __int64)(v9 + (double)(signed int)v21);
2111 v9 = (double)(signed int)v21 * 0.75; 2098 v10.y = v3->vPosition.y;
2112 v21 = v3->vPosition.z; 2099 v10.x = v3->vPosition.x;
2113 v10.z = (signed __int64)(v9 + (double)(signed int)v21); 2100 if ( sub_407A1C((int)v6, (int)v7, v23, v10) )
2114 v10.y = v3->vPosition.y; 2101 {
2115 v10.x = v3->vPosition.x; 2102 v12 = arg0;
2116 if ( sub_407A1C((int)v6, (int)v7, v23, v10) ) 2103 v13 = 0;
2117 { 2104 if ( !arg0 )
2118 v12 = arg0; 2105 {
2119 v13 = 0; 2106 v14 = Actor::GetDirectionInfo(PID(OBJECT_Actor, v24), sTargetPid, &a3, 0);
2120 if ( !arg0 )
2121 {
2122 v14 = Actor::GetDirectionInfo(PID(OBJECT_Actor, v24), sTargetPid, &a3, 0);
2123 v12 = &v20; 2107 v12 = &v20;
2124 memcpy(&v20, v14, sizeof(v20)); 2108 memcpy(&v20, v14, sizeof(v20));
2125 v13 = 0; 2109 v13 = 0;
2126 } 2110 }
2127 v15 = pSpriteFrameTable->pSpriteSFrames; 2111 v15 = pSpriteFrameTable->pSpriteSFrames;
2128 v3->uYawAngle = LOWORD(v12->uYawAngle); 2112 v3->uYawAngle = LOWORD(v12->uYawAngle);
2129 v16 = v15[v3->pSpriteIDs[ANIM_AtkMelee]].uAnimLength; 2113 v16 = v15[v3->pSpriteIDs[ANIM_AtkMelee]].uAnimLength;
2130 v17 = v24; 2114 v17 = v24;
2131 v3->uCurrentActionLength = 8 * v16; 2115 v3->uCurrentActionLength = 8 * v16;
2132 v3->uCurrentActionTime = v13; 2116 v3->uCurrentActionTime = v13;
2133 v3->uAIState = AttackingMelee; 2117 v3->uAIState = AttackingMelee;
2134 Actor::PlaySound(v17, 0); 2118 Actor::PlaySound(v17, 0);
2135 LODWORD(v18) = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime; 2119 LODWORD(v18) = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
2136 v25 = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime; 2120 v25 = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime;
2137 if ( SHIDWORD(v3->pActorBuffs[7].uExpireTime) >= (signed int)v13 2121 if ( SHIDWORD(v3->pActorBuffs[7].uExpireTime) >= (signed int)v13
2138 && (SHIDWORD(v3->pActorBuffs[7].uExpireTime) > (signed int)v13 || LODWORD(v3->pActorBuffs[7].uExpireTime) > v13) ) 2122 && (SHIDWORD(v3->pActorBuffs[7].uExpireTime) > (signed int)v13 || LODWORD(v3->pActorBuffs[7].uExpireTime) > v13) )
2139 { 2123 {
2140 LODWORD(v18) = 2 * v18; 2124 LODWORD(v18) = 2 * v18;
2141 v25 = v18; 2125 v25 = v18;
2142 } 2126 }
2143 if ( pParty->bTurnBasedModeOn != 1 ) 2127 if ( pParty->bTurnBasedModeOn != 1 )
2144 v18 = (signed __int64)(flt_6BE3A8_debug_recmod2 * (double)(signed int)v25 * 2.133333333333333); 2128 v18 = (signed __int64)(flt_6BE3A8_debug_recmod2 * (double)(signed int)v25 * 2.133333333333333);
2145 v3->pMonsterInfo.uRecoveryTime = v18; 2129 v3->pMonsterInfo.uRecoveryTime = v18;
2146 v3->vVelocity.z = v13; 2130 v3->vVelocity.z = v13;
2147 v3->vVelocity.y = v13; 2131 v3->vVelocity.y = v13;
2148 v3->vVelocity.x = v13; 2132 v3->vVelocity.x = v13;
2149 v3->UpdateAnimation(); 2133 v3->UpdateAnimation();
2150 } 2134 }
2151 else 2135 else
2152 Actor::_402AD7(v24, sTargetPid, rand() % 2, 64, arg0); 2136 Actor::_402AD7(v24, sTargetPid, rand() % 2, 64, arg0);
2153 } 2137 }
2154 2138
2155 //----- (00438CF3) -------------------------------------------------------- 2139 //----- (00438CF3) --------------------------------------------------------
2156 void Actor::ApplyFineForKillingPeasant(unsigned int uActorID) 2140 void Actor::ApplyFineForKillingPeasant(unsigned int uActorID)
2157 { 2141 {
2229 int v7; // [sp-Ch] [bp-10h]@3 2213 int v7; // [sp-Ch] [bp-10h]@3
2230 int v8; // [sp-8h] [bp-Ch]@3 2214 int v8; // [sp-8h] [bp-Ch]@3
2231 __int16 v9; // [sp-4h] [bp-8h]@3 2215 __int16 v9; // [sp-4h] [bp-8h]@3
2232 2216
2233 result = a2 - 1; 2217 result = a2 - 1;
2234 v4 = 8 * uActorID | 3; 2218 v4 = PID(uActorID,OBJECT_Actor);
2235 switch ( a2 ) 2219 switch ( a2 )
2236 { 2220 {
2237 case 1: 2221 case 1:
2238 if ( a3 ) 2222 if ( a3 )
2239 { 2223 {
2280 return; 2264 return;
2281 case 5: 2265 case 5:
2282 v9 = 4; 2266 v9 = 4;
2283 v8 = 65536; 2267 v8 = 65536;
2284 v7 = 0; 2268 v7 = 0;
2285 v6 = 8 * uActorID | 3; 2269 v6 = PID(uActorID,OBJECT_Actor);
2286 v5 = 901; 2270 v5 = 901;
2287 goto LABEL_16; 2271 goto LABEL_16;
2288 case 6: 2272 case 6:
2289 v9 = 4; 2273 v9 = 4;
2290 v8 = 65536; 2274 v8 = 65536;
2291 v7 = 0; 2275 v7 = 0;
2292 v6 = 8 * uActorID | 3; 2276 v6 = PID(uActorID,OBJECT_Actor);
2293 v5 = 902; 2277 v5 = 902;
2294 goto LABEL_16; 2278 goto LABEL_16;
2295 case 7: 2279 case 7:
2296 v9 = 4; 2280 v9 = 4;
2297 v8 = 65536; 2281 v8 = 65536;
2298 v7 = 0; 2282 v7 = 0;
2299 v6 = 8 * uActorID | 3; 2283 v6 = PID(uActorID,OBJECT_Actor);
2300 v5 = 903; 2284 v5 = 903;
2301 goto LABEL_16; 2285 goto LABEL_16;
2302 case 8: 2286 case 8:
2303 v9 = 4; 2287 v9 = 4;
2304 v8 = 65536; 2288 v8 = 65536;
2305 v7 = 0; 2289 v7 = 0;
2306 v6 = 8 * uActorID | 3; 2290 v6 = PID(uActorID,OBJECT_Actor);
2307 v5 = 900; 2291 v5 = 900;
2308 goto LABEL_16; 2292 goto LABEL_16;
2309 case 9: 2293 case 9:
2310 v9 = 4; 2294 v9 = 4;
2311 v8 = 65536; 2295 v8 = 65536;
2312 v7 = 0; 2296 v7 = 0;
2313 v6 = 8 * uActorID | 3; 2297 v6 = PID(uActorID,OBJECT_Actor);
2314 v5 = 909; 2298 v5 = 909;
2315 goto LABEL_16; 2299 goto LABEL_16;
2316 case 10: 2300 case 10:
2317 v9 = 4; 2301 v9 = 4;
2318 v8 = 65536; 2302 v8 = 65536;
2319 v7 = 0; 2303 v7 = 0;
2320 v6 = 8 * uActorID | 3; 2304 v6 = PID(uActorID,OBJECT_Actor);
2321 v5 = 908; 2305 v5 = 908;
2322 LABEL_16: 2306 LABEL_16:
2323 result = pOtherOverlayList->_4418B6(v5, v6, v7, v8, v9); 2307 result = pOtherOverlayList->_4418B6(v5, v6, v7, v8, v9);
2324 break; 2308 break;
2325 default: 2309 default:
3032 && v4->uAIState != 12 3016 && v4->uAIState != 12
3033 && v4->uAIState != 13 3017 && v4->uAIState != 13
3034 && v4->uAIState != 18 3018 && v4->uAIState != 18
3035 && v4->uAIState != 2)) 3019 && v4->uAIState != 2))
3036 { 3020 {
3037 memcpy(&v10, Actor::GetDirectionInfo(8 * v3 | 3, a2, &a3, 0), sizeof(v10)); 3021 memcpy(&v10, Actor::GetDirectionInfo(PID(v3,OBJECT_Actor), a2, &a3, 0), sizeof(v10));
3038 v6 = pSpriteFrameTable->pSpriteSFrames; 3022 v6 = pSpriteFrameTable->pSpriteSFrames;
3039 v4->uYawAngle = LOWORD(v10.uYawAngle); 3023 v4->uYawAngle = LOWORD(v10.uYawAngle);
3040 v7 = v6[v4->pSpriteIDs[ANIM_GotHit]].uAnimLength; 3024 v7 = v6[v4->pSpriteIDs[ANIM_GotHit]].uAnimLength;
3041 v8 = v11; 3025 v8 = v11;
3042 v4->uCurrentActionTime = 0; 3026 v4->uCurrentActionTime = 0;
3242 3226
3243 v5 = uActorID; 3227 v5 = uActorID;
3244 v6 = 0; 3228 v6 = 0;
3245 v7 = &pActors[uActorID]; 3229 v7 = &pActors[uActorID];
3246 v18 = a2; 3230 v18 = a2;
3247 v8 = 8 * uActorID | 3; 3231 v8 = PID(uActorID,OBJECT_Actor);
3248 v9 = v7->pMonsterInfo.uFlying == 0; 3232 v9 = v7->pMonsterInfo.uFlying == 0;
3249 v17 = v5; 3233 v17 = v5;
3250 if ( !v9 && !pParty->bFlying ) 3234 if ( !v9 && !pParty->bFlying )
3251 { 3235 {
3252 if ( v7->pMonsterInfo.uMissleAttack1Type ) 3236 if ( v7->pMonsterInfo.uMissleAttack1Type )
3325 v15 = uActorID; 3309 v15 = uActorID;
3326 v5 = &pActors[uActorID]; 3310 v5 = &pActors[uActorID];
3327 //result = pActors[uActorID].CanAct(); 3311 //result = pActors[uActorID].CanAct();
3328 if ( pActors[uActorID].CanAct() ) 3312 if ( pActors[uActorID].CanAct() )
3329 { 3313 {
3330 v7 = 8 * v4 | 3; 3314 v7 = PID(v4,OBJECT_Actor);
3331 a1 = 8 * v4 | 3; 3315 a1 = PID(v4,OBJECT_Actor);
3332 if ( !a4 ) 3316 if ( !a4 )
3333 { 3317 {
3334 a4 = &v12; 3318 a4 = &v12;
3335 memcpy(&v12, Actor::GetDirectionInfo(v7, sTargetPid, &a3, v5->pMonsterInfo.uFlying), sizeof(v12)); 3319 memcpy(&v12, Actor::GetDirectionInfo(v7, sTargetPid, &a3, v5->pMonsterInfo.uFlying), sizeof(v12));
3336 v7 = a1; 3320 v7 = a1;
3385 3369
3386 v5 = uActorID; 3370 v5 = uActorID;
3387 v6 = 0; 3371 v6 = 0;
3388 v7 = &pActors[uActorID]; 3372 v7 = &pActors[uActorID];
3389 v19 = a2; 3373 v19 = a2;
3390 v8 = 8 * uActorID | 3; 3374 v8 = PID(uActorID,OBJECT_Actor);
3391 v9 = v7->pMonsterInfo.uFlying == 0; 3375 v9 = v7->pMonsterInfo.uFlying == 0;
3392 v20 = v5; 3376 v20 = v5;
3393 if ( !v9 && !pParty->bFlying ) 3377 if ( !v9 && !pParty->bFlying )
3394 { 3378 {
3395 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) 3379 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor )
3471 3455
3472 v4 = uActorID; 3456 v4 = uActorID;
3473 v5 = 0; 3457 v5 = 0;
3474 v6 = &pActors[uActorID]; 3458 v6 = &pActors[uActorID];
3475 v21 = a2; 3459 v21 = a2;
3476 v7 = 8 * uActorID | 3; 3460 v7 = PID(uActorID,OBJECT_Actor);
3477 v8 = v6->pMonsterInfo.uFlying == 0; 3461 v8 = v6->pMonsterInfo.uFlying == 0;
3478 v22 = v4; 3462 v22 = v4;
3479 if ( !v8 && !pParty->bFlying ) 3463 if ( !v8 && !pParty->bFlying )
3480 { 3464 {
3481 if ( v6->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) 3465 if ( v6->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor )
3592 //v8 = v7->uAIState; 3576 //v8 = v7->uAIState;
3593 if (actor->uAIState == Dead || actor->uAIState == Dying || 3577 if (actor->uAIState == Dead || actor->uAIState == Dying ||
3594 actor->uAIState == Removed || actor->uAIState == Summoned || actor->uAIState == Disabled || uActorID == i ) 3578 actor->uAIState == Removed || actor->uAIState == Summoned || actor->uAIState == Disabled || uActorID == i )
3595 continue; 3579 continue;
3596 3580
3597 if (_this->uLastCharacterIDToHit == 0 || (v9 = 8 * v5, LOBYTE(v9) = 8 * v5 | 3, _this->uLastCharacterIDToHit != v9) ) 3581 if (_this->uLastCharacterIDToHit == 0 || (v9 = 8 * v5, LOBYTE(v9) = PID(v5,OBJECT_Actor), _this->uLastCharacterIDToHit != v9) )
3598 { 3582 {
3599 v10 = _this->GetActorsRelation(actor); 3583 v10 = _this->GetActorsRelation(actor);
3600 if ( v10 == 0 ) 3584 if ( v10 == 0 )
3601 continue; 3585 continue;
3602 } 3586 }
4077 ++uNumActors; 4061 ++uNumActors;
4078 ++v23->pMonsterInfo.uSpecialAbilityDamageDiceBonus; 4062 ++v23->pMonsterInfo.uSpecialAbilityDamageDiceBonus;
4079 if ( v23->uAttributes & 0x80000 ) 4063 if ( v23->uAttributes & 0x80000 )
4080 v8->uAttributes |= 0x80000u; 4064 v8->uAttributes |= 0x80000u;
4081 result = 8 * v24; 4065 result = 8 * v24;
4082 LOBYTE(result) = 8 * v24 | 3; 4066 LOBYTE(result) = PID(v24,OBJECT_Actor);
4083 v8->uSummonerID = result; 4067 v8->uSummonerID = result;
4084 } 4068 }
4085 return result; 4069 return result;
4086 } 4070 }