Mercurial > mm7
comparison Actor.cpp @ 862:f4394e320312
* PID mistake fixed
* Actor::GetDirectionInfo mistake fixed
author | zipi |
---|---|
date | Sun, 31 Mar 2013 13:20:58 +0100 |
parents | fea81e031484 |
children | b7b67485ec43 |
comparison
equal
deleted
inserted
replaced
861:fea81e031484 | 862:f4394e320312 |
---|---|
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 = PID(LODWORD(v120),OBJECT_Actor); | 784 v116 = PID(OBJECT_Actor,LODWORD(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 918 LOBYTE(v40) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 971 LOBYTE(v43) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1010 LOBYTE(v46) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1053 LOBYTE(v50) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1105 LOBYTE(v65) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1134 LOBYTE(v52) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1188 LOBYTE(v55) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1231 LOBYTE(v97) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1275 LOBYTE(v95) = PID(OBJECT_Actor,LOBYTE(v120)); |
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) = PID(LOBYTE(v120),OBJECT_Actor); | 1322 LOBYTE(v69) = PID(OBJECT_Actor,LOBYTE(v120)); |
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 } |
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); | 1761 v5 = PID_TYPE(uObj1ID); |
1762 v6 = uObj2ID; | 1762 v6 = uObj2ID; |
1763 v20 = v6; | |
1764 v21 = PID_TYPE(v6); | |
1765 v22 = PID_ID(v20); | |
1766 switch(v5) | 1763 switch(v5) |
1767 { | 1764 { |
1768 case OBJECT_Item: | 1765 case OBJECT_Item: |
1769 { | 1766 { |
1770 v19 = v4; | 1767 v19 = v4; |
1771 outx = pSpriteObjects[v19].vPosition.x; | 1768 outx = pSpriteObjects[v19].vPosition.x; |
1772 v13 = pSpriteObjects[v19].vPosition.y; | 1769 v13 = pSpriteObjects[v19].vPosition.y; |
1773 v14 = pSpriteObjects[v19].vPosition.z; | 1770 v14 = pSpriteObjects[v19].vPosition.z; |
1774 outy = v13; | 1771 outy = v13; |
1775 outz = v14; | 1772 outz = v14; |
1776 v30 = v22; | |
1777 LODWORD(v45) = pSpriteObjects[v30].vPosition.x; | |
1778 v27 = pSpriteObjects[v30].vPosition.y; | |
1779 v28 = pSpriteObjects[v30].vPosition.z; | |
1780 LODWORD(v44) = v27; | |
1781 a4 = v28; | |
1782 break; | 1773 break; |
1783 } | 1774 } |
1784 case OBJECT_Actor: | 1775 case OBJECT_Actor: |
1785 { | 1776 { |
1786 outx = pActors[v4].vPosition.x; | 1777 outx = pActors[v4].vPosition.x; |
1787 outy = pActors[v4].vPosition.y; | 1778 outy = pActors[v4].vPosition.y; |
1788 LODWORD(v42) = pActors[v4].uActorHeight; | 1779 LODWORD(v42) = pActors[v4].uActorHeight; |
1789 v11 = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)SLODWORD(v42) * -0.75); | 1780 v11 = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)SLODWORD(v42) * -0.75); |
1790 outz = v11; | 1781 outz = v11; |
1791 LODWORD(v45) = pActors[v22].vPosition.x; | |
1792 LODWORD(v44) = pActors[v22].vPosition.y; | |
1793 v25 = pActors[v22].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v22].uActorHeight * -0.75); | |
1794 a4 = v25; | |
1795 break; | 1782 break; |
1796 } | 1783 } |
1797 case OBJECT_Player: | 1784 case OBJECT_Player: |
1798 { | 1785 { |
1799 if ( !v4 ) | 1786 if ( !v4 ) |
1854 v36 = 0; | 1841 v36 = 0; |
1855 v35 = 24; | 1842 v35 = 24; |
1856 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40); | 1843 Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40); |
1857 break; | 1844 break; |
1858 } | 1845 } |
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 } | 1846 } |
1867 case OBJECT_Decoration: | 1847 case OBJECT_Decoration: |
1868 { | 1848 { |
1869 v12 = v4; | 1849 v12 = v4; |
1870 outx = pLevelDecorations[v12].vPosition.x; | 1850 outx = pLevelDecorations[v12].vPosition.x; |
1871 v13 = pLevelDecorations[v12].vPosition.y; | 1851 v13 = pLevelDecorations[v12].vPosition.y; |
1872 v14 = pLevelDecorations[v12].vPosition.z; | 1852 v14 = pLevelDecorations[v12].vPosition.z; |
1873 outy = v13; | 1853 outy = v13; |
1874 outz = v14; | 1854 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; | 1855 break; |
1882 } | 1856 } |
1883 default: | 1857 default: |
1884 { | 1858 { |
1885 outz = 0; | 1859 outz = 0; |
1886 outy = 0; | 1860 outy = 0; |
1887 outx = 0; | 1861 outx = 0; |
1888 a4 = 0; | |
1889 v44 = 0.0; | |
1890 v45 = 0.0; | |
1891 break; | 1862 break; |
1892 } | 1863 } |
1893 case OBJECT_BModel: | 1864 case OBJECT_BModel: |
1894 { | 1865 { |
1895 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 1866 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
1897 v10 = &pIndoor->pFaces[v4]; | 1868 v10 = &pIndoor->pFaces[v4]; |
1898 outx = (v10->pBounding.x1 + v10->pBounding.x2) >> 1; | 1869 outx = (v10->pBounding.x1 + v10->pBounding.x2) >> 1; |
1899 outy = (v10->pBounding.y1 + v10->pBounding.y2) >> 1; | 1870 outy = (v10->pBounding.y1 + v10->pBounding.y2) >> 1; |
1900 v11 = (v10->pBounding.z1 + v10->pBounding.z2) >> 1; | 1871 v11 = (v10->pBounding.z1 + v10->pBounding.z2) >> 1; |
1901 outz = v11; | 1872 outz = v11; |
1873 } | |
1874 break; | |
1875 } | |
1876 } | |
1877 v20 = v6; | |
1878 v21 = PID_TYPE(v6); | |
1879 v22 = PID_ID(v20); | |
1880 switch(v6) | |
1881 { | |
1882 case OBJECT_Item: | |
1883 { | |
1884 v30 = v22; | |
1885 LODWORD(v45) = pSpriteObjects[v30].vPosition.x; | |
1886 v27 = pSpriteObjects[v30].vPosition.y; | |
1887 v28 = pSpriteObjects[v30].vPosition.z; | |
1888 LODWORD(v44) = v27; | |
1889 a4 = v28; | |
1890 break; | |
1891 } | |
1892 case OBJECT_Actor: | |
1893 { | |
1894 LODWORD(v45) = pActors[v22].vPosition.x; | |
1895 LODWORD(v44) = pActors[v22].vPosition.y; | |
1896 v25 = pActors[v22].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v22].uActorHeight * -0.75); | |
1897 a4 = v25; | |
1898 break; | |
1899 } | |
1900 case OBJECT_Player: | |
1901 { | |
1902 LODWORD(v45) = pParty->vPosition.x; | |
1903 LODWORD(v44) = pParty->vPosition.y; | |
1904 v29 = a4; | |
1905 if ( !a4 ) | |
1906 v29 = pParty->sEyelevel; | |
1907 v28 = pParty->vPosition.z + v29; | |
1908 a4 = v28; | |
1909 } | |
1910 case OBJECT_Decoration: | |
1911 { | |
1912 v26 = v22; | |
1913 LODWORD(v45) = pLevelDecorations[v26].vPosition.x; | |
1914 v27 = pLevelDecorations[v26].vPosition.y; | |
1915 v28 = pLevelDecorations[v26].vPosition.z; | |
1916 LODWORD(v44) = v27; | |
1917 a4 = v28; | |
1918 break; | |
1919 } | |
1920 default: | |
1921 { | |
1922 a4 = 0; | |
1923 v44 = 0.0; | |
1924 v45 = 0.0; | |
1925 break; | |
1926 } | |
1927 case OBJECT_BModel: | |
1928 { | |
1929 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
1930 { | |
1902 v23 = &pIndoor->pFaces[v22]; | 1931 v23 = &pIndoor->pFaces[v22]; |
1903 v24 = v23->pBounding.y1; | 1932 v24 = v23->pBounding.y1; |
1904 LODWORD(v45) = (v23->pBounding.x1 + v23->pBounding.x2) >> 1; | 1933 LODWORD(v45) = (v23->pBounding.x1 + v23->pBounding.x2) >> 1; |
1905 LODWORD(v44) = (v24 + v23->pBounding.y2) >> 1; | 1934 LODWORD(v44) = (v24 + v23->pBounding.y2) >> 1; |
1906 v25 = (v23->pBounding.z1 + v23->pBounding.z2) >> 1; | 1935 v25 = (v23->pBounding.z1 + v23->pBounding.z2) >> 1; |
1907 a4 = v25; | 1936 a4 = v25; |
1908 } | 1937 } |
1909 break; | 1938 break; |
1910 } | 1939 } |
1911 } | 1940 } |
1941 | |
1912 v31 = (double)SLODWORD(v45) - (double)outx; | 1942 v31 = (double)SLODWORD(v45) - (double)outx; |
1913 v42 = v31; | 1943 v42 = v31; |
1914 v32 = (double)SLODWORD(v44) - (double)outy; | 1944 v32 = (double)SLODWORD(v44) - (double)outy; |
1915 v43 = v32; | 1945 v43 = v32; |
1916 a4a = (double)a4 - (double)outz; | 1946 a4a = (double)a4 - (double)outz; |
2210 int v7; // [sp-Ch] [bp-10h]@3 | 2240 int v7; // [sp-Ch] [bp-10h]@3 |
2211 int v8; // [sp-8h] [bp-Ch]@3 | 2241 int v8; // [sp-8h] [bp-Ch]@3 |
2212 __int16 v9; // [sp-4h] [bp-8h]@3 | 2242 __int16 v9; // [sp-4h] [bp-8h]@3 |
2213 | 2243 |
2214 result = a2 - 1; | 2244 result = a2 - 1; |
2215 v4 = PID(uActorID,OBJECT_Actor); | 2245 v4 = PID(OBJECT_Actor,uActorID); |
2216 switch ( a2 ) | 2246 switch ( a2 ) |
2217 { | 2247 { |
2218 case 1: | 2248 case 1: |
2219 if ( a3 ) | 2249 if ( a3 ) |
2220 { | 2250 { |
2261 return; | 2291 return; |
2262 case 5: | 2292 case 5: |
2263 v9 = 4; | 2293 v9 = 4; |
2264 v8 = 65536; | 2294 v8 = 65536; |
2265 v7 = 0; | 2295 v7 = 0; |
2266 v6 = PID(uActorID,OBJECT_Actor); | 2296 v6 = PID(OBJECT_Actor,uActorID); |
2267 v5 = 901; | 2297 v5 = 901; |
2268 goto LABEL_16; | 2298 goto LABEL_16; |
2269 case 6: | 2299 case 6: |
2270 v9 = 4; | 2300 v9 = 4; |
2271 v8 = 65536; | 2301 v8 = 65536; |
2272 v7 = 0; | 2302 v7 = 0; |
2273 v6 = PID(uActorID,OBJECT_Actor); | 2303 v6 = PID(OBJECT_Actor,uActorID); |
2274 v5 = 902; | 2304 v5 = 902; |
2275 goto LABEL_16; | 2305 goto LABEL_16; |
2276 case 7: | 2306 case 7: |
2277 v9 = 4; | 2307 v9 = 4; |
2278 v8 = 65536; | 2308 v8 = 65536; |
2279 v7 = 0; | 2309 v7 = 0; |
2280 v6 = PID(uActorID,OBJECT_Actor); | 2310 v6 = PID(OBJECT_Actor,uActorID); |
2281 v5 = 903; | 2311 v5 = 903; |
2282 goto LABEL_16; | 2312 goto LABEL_16; |
2283 case 8: | 2313 case 8: |
2284 v9 = 4; | 2314 v9 = 4; |
2285 v8 = 65536; | 2315 v8 = 65536; |
2286 v7 = 0; | 2316 v7 = 0; |
2287 v6 = PID(uActorID,OBJECT_Actor); | 2317 v6 = PID(OBJECT_Actor,uActorID); |
2288 v5 = 900; | 2318 v5 = 900; |
2289 goto LABEL_16; | 2319 goto LABEL_16; |
2290 case 9: | 2320 case 9: |
2291 v9 = 4; | 2321 v9 = 4; |
2292 v8 = 65536; | 2322 v8 = 65536; |
2293 v7 = 0; | 2323 v7 = 0; |
2294 v6 = PID(uActorID,OBJECT_Actor); | 2324 v6 = PID(OBJECT_Actor,uActorID); |
2295 v5 = 909; | 2325 v5 = 909; |
2296 goto LABEL_16; | 2326 goto LABEL_16; |
2297 case 10: | 2327 case 10: |
2298 v9 = 4; | 2328 v9 = 4; |
2299 v8 = 65536; | 2329 v8 = 65536; |
2300 v7 = 0; | 2330 v7 = 0; |
2301 v6 = PID(uActorID,OBJECT_Actor); | 2331 v6 = PID(OBJECT_Actor,uActorID); |
2302 v5 = 908; | 2332 v5 = 908; |
2303 LABEL_16: | 2333 LABEL_16: |
2304 result = pOtherOverlayList->_4418B6(v5, v6, v7, v8, v9); | 2334 result = pOtherOverlayList->_4418B6(v5, v6, v7, v8, v9); |
2305 break; | 2335 break; |
2306 default: | 2336 default: |
2492 { | 2522 { |
2493 v9 = pDir; | 2523 v9 = pDir; |
2494 v10 = 0; | 2524 v10 = 0; |
2495 if ( !pDir ) | 2525 if ( !pDir ) |
2496 { | 2526 { |
2497 v11 = Actor::GetDirectionInfo(PID(v22,OBJECT_Actor), a2, &a3, 0); | 2527 v11 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v22), a2, &a3, 0); |
2498 v9 = &v18; | 2528 v9 = &v18; |
2499 memcpy(&v18, v11, sizeof(v18)); | 2529 memcpy(&v18, v11, sizeof(v18)); |
2500 v10 = 0; | 2530 v10 = 0; |
2501 } | 2531 } |
2502 v12 = pSpriteFrameTable->pSpriteSFrames; | 2532 v12 = pSpriteFrameTable->pSpriteSFrames; |
2598 { | 2628 { |
2599 v9 = pDir; | 2629 v9 = pDir; |
2600 v10 = 0; | 2630 v10 = 0; |
2601 if ( !pDir ) | 2631 if ( !pDir ) |
2602 { | 2632 { |
2603 v11 = Actor::GetDirectionInfo(PID(v22,OBJECT_Actor), sTargetPid, &a3, 0); | 2633 v11 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v22), sTargetPid, &a3, 0); |
2604 v9 = &v18; | 2634 v9 = &v18; |
2605 memcpy(&v18, v11, sizeof(v18)); | 2635 memcpy(&v18, v11, sizeof(v18)); |
2606 v10 = 0; | 2636 v10 = 0; |
2607 } | 2637 } |
2608 v12 = pSpriteFrameTable->pSpriteSFrames; | 2638 v12 = pSpriteFrameTable->pSpriteSFrames; |
2703 { | 2733 { |
2704 v9 = pDir; | 2734 v9 = pDir; |
2705 v10 = 0; | 2735 v10 = 0; |
2706 if ( !pDir ) | 2736 if ( !pDir ) |
2707 { | 2737 { |
2708 v11 = Actor::GetDirectionInfo(PID(v21,OBJECT_Actor), sTargetPid, &a3, 0); | 2738 v11 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v21), sTargetPid, &a3, 0); |
2709 v9 = &v17; | 2739 v9 = &v17; |
2710 memcpy(&v17, v11, sizeof(v17)); | 2740 memcpy(&v17, v11, sizeof(v17)); |
2711 v10 = 0; | 2741 v10 = 0; |
2712 } | 2742 } |
2713 v12 = pSpriteFrameTable->pSpriteSFrames; | 2743 v12 = pSpriteFrameTable->pSpriteSFrames; |
2803 { | 2833 { |
2804 v10 = pDir; | 2834 v10 = pDir; |
2805 v11 = 0; | 2835 v11 = 0; |
2806 if ( !pDir ) | 2836 if ( !pDir ) |
2807 { | 2837 { |
2808 v12 = Actor::GetDirectionInfo(PID(v21,OBJECT_Actor), sTargetPid, &a3, 0); | 2838 v12 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v21), sTargetPid, &a3, 0); |
2809 v10 = &v18; | 2839 v10 = &v18; |
2810 memcpy(&v18, v12, sizeof(v18)); | 2840 memcpy(&v18, v12, sizeof(v18)); |
2811 v11 = 0; | 2841 v11 = 0; |
2812 } | 2842 } |
2813 v13 = pSpriteFrameTable->pSpriteSFrames; | 2843 v13 = pSpriteFrameTable->pSpriteSFrames; |
3013 && v4->uAIState != 12 | 3043 && v4->uAIState != 12 |
3014 && v4->uAIState != 13 | 3044 && v4->uAIState != 13 |
3015 && v4->uAIState != 18 | 3045 && v4->uAIState != 18 |
3016 && v4->uAIState != 2)) | 3046 && v4->uAIState != 2)) |
3017 { | 3047 { |
3018 memcpy(&v10, Actor::GetDirectionInfo(PID(v3,OBJECT_Actor), a2, &a3, 0), sizeof(v10)); | 3048 memcpy(&v10, Actor::GetDirectionInfo(PID(OBJECT_Actor,v3), a2, &a3, 0), sizeof(v10)); |
3019 v6 = pSpriteFrameTable->pSpriteSFrames; | 3049 v6 = pSpriteFrameTable->pSpriteSFrames; |
3020 v4->uYawAngle = LOWORD(v10.uYawAngle); | 3050 v4->uYawAngle = LOWORD(v10.uYawAngle); |
3021 v7 = v6[v4->pSpriteIDs[ANIM_GotHit]].uAnimLength; | 3051 v7 = v6[v4->pSpriteIDs[ANIM_GotHit]].uAnimLength; |
3022 v8 = v11; | 3052 v8 = v11; |
3023 v4->uCurrentActionTime = 0; | 3053 v4->uCurrentActionTime = 0; |
3037 assert(uActorID < uNumActors); | 3067 assert(uActorID < uNumActors); |
3038 auto actor = pActors + uActorID; | 3068 auto actor = pActors + uActorID; |
3039 | 3069 |
3040 AIDirection a3; // [sp+Ch] [bp-5Ch]@2 | 3070 AIDirection a3; // [sp+Ch] [bp-5Ch]@2 |
3041 if (!a4) | 3071 if (!a4) |
3042 a4 = Actor::GetDirectionInfo(PID(uActorID,OBJECT_Actor), uObjID, &a3, 0); | 3072 a4 = Actor::GetDirectionInfo(PID(OBJECT_Actor,uActorID), uObjID, &a3, 0); |
3043 | 3073 |
3044 actor->uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[actor->pSpriteIDs[ANIM_Bored]].uAnimLength; | 3074 actor->uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[actor->pSpriteIDs[ANIM_Bored]].uAnimLength; |
3045 | 3075 |
3046 v7 = stru_5C6E00->Atan2(actor->vPosition.x - pIndoorCamera->pos.x, actor->vPosition.y - pIndoorCamera->pos.y); | 3076 v7 = stru_5C6E00->Atan2(actor->vPosition.x - pIndoorCamera->pos.x, actor->vPosition.y - pIndoorCamera->pos.y); |
3047 v9 = stru_5C6E00->uIntegerPi + actor->uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v7; | 3077 v9 = stru_5C6E00->uIntegerPi + actor->uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v7; |
3223 | 3253 |
3224 v5 = uActorID; | 3254 v5 = uActorID; |
3225 v6 = 0; | 3255 v6 = 0; |
3226 v7 = &pActors[uActorID]; | 3256 v7 = &pActors[uActorID]; |
3227 v18 = a2; | 3257 v18 = a2; |
3228 v8 = PID(uActorID,OBJECT_Actor); | 3258 v8 = PID(OBJECT_Actor,uActorID); |
3229 v9 = v7->pMonsterInfo.uFlying == 0; | 3259 v9 = v7->pMonsterInfo.uFlying == 0; |
3230 v17 = v5; | 3260 v17 = v5; |
3231 if ( !v9 && !pParty->bFlying ) | 3261 if ( !v9 && !pParty->bFlying ) |
3232 { | 3262 { |
3233 if ( v7->pMonsterInfo.uMissleAttack1Type ) | 3263 if ( v7->pMonsterInfo.uMissleAttack1Type ) |
3306 v15 = uActorID; | 3336 v15 = uActorID; |
3307 v5 = &pActors[uActorID]; | 3337 v5 = &pActors[uActorID]; |
3308 //result = pActors[uActorID].CanAct(); | 3338 //result = pActors[uActorID].CanAct(); |
3309 if ( pActors[uActorID].CanAct() ) | 3339 if ( pActors[uActorID].CanAct() ) |
3310 { | 3340 { |
3311 v7 = PID(v4,OBJECT_Actor); | 3341 v7 = PID(OBJECT_Actor,v4); |
3312 a1 = PID(v4,OBJECT_Actor); | 3342 a1 = PID(OBJECT_Actor,v4); |
3313 if ( !a4 ) | 3343 if ( !a4 ) |
3314 { | 3344 { |
3315 a4 = &v12; | 3345 a4 = &v12; |
3316 memcpy(&v12, Actor::GetDirectionInfo(v7, sTargetPid, &a3, v5->pMonsterInfo.uFlying), sizeof(v12)); | 3346 memcpy(&v12, Actor::GetDirectionInfo(v7, sTargetPid, &a3, v5->pMonsterInfo.uFlying), sizeof(v12)); |
3317 v7 = a1; | 3347 v7 = a1; |
3366 | 3396 |
3367 v5 = uActorID; | 3397 v5 = uActorID; |
3368 v6 = 0; | 3398 v6 = 0; |
3369 v7 = &pActors[uActorID]; | 3399 v7 = &pActors[uActorID]; |
3370 v19 = a2; | 3400 v19 = a2; |
3371 v8 = PID(uActorID,OBJECT_Actor); | 3401 v8 = PID(OBJECT_Actor,uActorID); |
3372 v9 = v7->pMonsterInfo.uFlying == 0; | 3402 v9 = v7->pMonsterInfo.uFlying == 0; |
3373 v20 = v5; | 3403 v20 = v5; |
3374 if ( !v9 && !pParty->bFlying ) | 3404 if ( !v9 && !pParty->bFlying ) |
3375 { | 3405 { |
3376 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | 3406 if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
3451 //unsigned int v22; // [sp+48h] [bp-4h]@1 | 3481 //unsigned int v22; // [sp+48h] [bp-4h]@1 |
3452 | 3482 |
3453 v5 = 0; | 3483 v5 = 0; |
3454 v6 = &pActors[uActorID]; | 3484 v6 = &pActors[uActorID]; |
3455 v21 = a2; | 3485 v21 = a2; |
3456 v7 = PID(uActorID,OBJECT_Actor); | 3486 v7 = PID(OBJECT_Actor,uActorID); |
3457 v8 = v6->pMonsterInfo.uFlying == 0; | 3487 v8 = v6->pMonsterInfo.uFlying == 0; |
3458 if ( !v8 && !pParty->bFlying ) | 3488 if ( !v8 && !pParty->bFlying ) |
3459 { | 3489 { |
3460 if ( v6->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | 3490 if ( v6->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
3461 v5 = v6->uActorRadius + 512; | 3491 v5 = v6->uActorRadius + 512; |
3561 //v8 = v7->uAIState; | 3591 //v8 = v7->uAIState; |
3562 if (actor->uAIState == Dead || actor->uAIState == Dying || | 3592 if (actor->uAIState == Dead || actor->uAIState == Dying || |
3563 actor->uAIState == Removed || actor->uAIState == Summoned || actor->uAIState == Disabled || uActorID == i ) | 3593 actor->uAIState == Removed || actor->uAIState == Summoned || actor->uAIState == Disabled || uActorID == i ) |
3564 continue; | 3594 continue; |
3565 | 3595 |
3566 if (_this->uLastCharacterIDToHit == 0 || (v9 = 8 * v5, LOBYTE(v9) = PID(v5,OBJECT_Actor), _this->uLastCharacterIDToHit != v9) ) | 3596 if (_this->uLastCharacterIDToHit == 0 || (v9 = 8 * v5, LOBYTE(v9) = PID(OBJECT_Actor,v5), _this->uLastCharacterIDToHit != v9) ) |
3567 { | 3597 { |
3568 v10 = _this->GetActorsRelation(actor); | 3598 v10 = _this->GetActorsRelation(actor); |
3569 if ( v10 == 0 ) | 3599 if ( v10 == 0 ) |
3570 continue; | 3600 continue; |
3571 } | 3601 } |
3607 | 3637 |
3608 } | 3638 } |
3609 if ( v25 != -1 ) | 3639 if ( v25 != -1 ) |
3610 { | 3640 { |
3611 //v13 = 8 * v21; | 3641 //v13 = 8 * v21; |
3612 //LOBYTE(v13) = PID(v21,OBJECT_Actor); | 3642 //LOBYTE(v13) = PID(OBJECT_Actor,v21); |
3613 *a2 = PID(OBJECT_Actor, v21); | 3643 *a2 = PID(OBJECT_Actor, v21); |
3614 } | 3644 } |
3615 | 3645 |
3616 if (pParty->Invisible()) | 3646 if (pParty->Invisible()) |
3617 can_target_party = false; | 3647 can_target_party = false; |
4046 ++uNumActors; | 4076 ++uNumActors; |
4047 ++v23->pMonsterInfo.uSpecialAbilityDamageDiceBonus; | 4077 ++v23->pMonsterInfo.uSpecialAbilityDamageDiceBonus; |
4048 if ( v23->uAttributes & 0x80000 ) | 4078 if ( v23->uAttributes & 0x80000 ) |
4049 v8->uAttributes |= 0x80000u; | 4079 v8->uAttributes |= 0x80000u; |
4050 result = 8 * v24; | 4080 result = 8 * v24; |
4051 LOBYTE(result) = PID(v24,OBJECT_Actor); | 4081 LOBYTE(result) = PID(OBJECT_Actor,v24); |
4052 v8->uSummonerID = result; | 4082 v8->uSummonerID = result; |
4053 } | 4083 } |
4054 return result; | 4084 return result; |
4055 } | 4085 } |