Advertisement
scroton

Untitled

Dec 27th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.17 KB | None | 0 0
  1. //Get pVel Functions
  2. //Get, Set, and Clear pVel and PushVel Functions based off parts of "GFD_PlatformFriction" script by GFD
  3.  
  4. function int GetLastPVelX(int aTID)
  5. {
  6. int pVelPrev;
  7. if(aTID == 0){
  8. pVelPrev = CheckInventory("GFD_pVelxPrev");
  9. if(CheckInventory("GFD_pVelxPrevNegative")){
  10. pVelPrev = -pVelPrev;}}
  11. else{
  12. pVelPrev = CheckActorInventory(aTID,"GFD_pVelxPrev");
  13. if(CheckActorInventory(aTID,"GFD_pVelxPrevNegative")){
  14. pVelPrev = -pVelPrev;}}
  15. return pVelPrev;
  16. }
  17.  
  18. function int GetLastPVelY(int aTID)
  19. {
  20. int pVelPrev;
  21. if(aTID == 0){
  22. pVelPrev = CheckInventory("GFD_pVelyPrev");
  23. if(CheckInventory("GFD_pVelyPrevNegative")){
  24. pVelPrev = -pVelPrev;}}
  25. else{
  26. pVelPrev = CheckActorInventory(aTID,"GFD_pVelyPrev");
  27. if(CheckActorInventory(aTID,"GFD_pVelyPrevNegative")){
  28. pVelPrev = -pVelPrev;}}
  29. return pVelPrev;
  30. }
  31.  
  32. function int GetLastPVelZ(int aTID)
  33. {
  34. int pVelPrev;
  35. if(aTID == 0){
  36. pVelPrev = CheckInventory("GFD_pVelzPrev");
  37. if(CheckInventory("GFD_pVelzPrevNegative")){
  38. pVelPrev = -pVelPrev;}}
  39. else{
  40. pVelPrev = CheckActorInventory(aTID,"GFD_pVelzPrev");
  41. if(CheckActorInventory(aTID,"GFD_pVelzPrevNegative")){
  42. pVelPrev = -pVelPrev;}}
  43. return pVelPrev;
  44. }
  45.  
  46. //Set pVel Functions
  47.  
  48. function void SetLastPVelX(int aTID, int pVel)
  49. {
  50. if(aTID == 0){
  51. TakeInventory("GFD_pVelxPrevNegative", 0x7FFFFFFF);
  52. TakeInventory("GFD_pVelxPrev", MAX_SIGNED_LONG);
  53. GiveInventory("GFD_pVelxPrev", abs(pVel));
  54. if(pVel < 0){GiveInventory("GFD_pVelxPrevNegative", 1);}}
  55. else {
  56. TakeActorInventory(aTID,"GFD_pVelxPrevNegative", 0x7FFFFFFF);
  57. TakeActorInventory(aTID,"GFD_pVelxPrev", MAX_SIGNED_LONG);
  58. GiveActorInventory(aTID,"GFD_pVelxPrev", abs(pVel));
  59. if(pVel < 0){GiveActorInventory(aTID,"GFD_pVelxPrevNegative", 1);}}
  60. }
  61.  
  62. function void SetLastPVelY(int aTID, int pVel)
  63. {
  64. if(aTID == 0){
  65. TakeInventory("GFD_pVelyPrevNegative", 0x7FFFFFFF);
  66. TakeInventory("GFD_pVelyPrev", MAX_SIGNED_LONG);
  67. GiveInventory("GFD_pVelyPrev", abs(pVel));
  68. if(pVel < 0){GiveInventory("GFD_pVelyPrevNegative", 1);}}
  69. else {
  70. TakeActorInventory(aTID,"GFD_pVelyPrevNegative", 0x7FFFFFFF);
  71. TakeActorInventory(aTID,"GFD_pVelyPrev", MAX_SIGNED_LONG);
  72. GiveActorInventory(aTID,"GFD_pVelyPrev", abs(pVel));
  73. if(pVel < 0){GiveActorInventory(aTID,"GFD_pVelyPrevNegative", 1);}}
  74. }
  75.  
  76. function void SetLastPVelZ(int aTID, int pVel)
  77. {
  78. if(aTID == 0){
  79. TakeInventory("GFD_pVelzPrevNegative", 0x7FFFFFFF);
  80. TakeInventory("GFD_pVelzPrev", MAX_SIGNED_LONG);
  81. GiveInventory("GFD_pVelzPrev", abs(pVel));
  82. if(pVel < 0){GiveInventory("GFD_pVelzPrevNegative", 1);}}
  83. else {
  84. TakeActorInventory(aTID,"GFD_pVelzPrevNegative", 0x7FFFFFFF);
  85. TakeActorInventory(aTID,"GFD_pVelzPrev", MAX_SIGNED_LONG);
  86. GiveActorInventory(aTID,"GFD_pVelzPrev", abs(pVel));
  87. if(pVel < 0){GiveActorInventory(aTID,"GFD_pVelzPrevNegative", 1);}}
  88. }
  89.  
  90. //Clear pVel Functions
  91.  
  92. function void ClearLastPVelX(int aTID)
  93. {
  94. if(aTID == 0){
  95. TakeInventory("GFD_pVelxPrevNegative", 0x7FFFFFFF);
  96. TakeInventory("GFD_pVelxPrev", MAX_SIGNED_LONG);}
  97. else {
  98. TakeActorInventory(aTID,"GFD_pVelxPrevNegative", 0x7FFFFFFF);
  99. TakeActorInventory(aTID,"GFD_pVelxPrev", MAX_SIGNED_LONG);}
  100. }
  101.  
  102. function void ClearLastPVelY(int aTID)
  103. {
  104. if(aTID == 0){
  105. TakeInventory("GFD_pVelyPrevNegative", 0x7FFFFFFF);
  106. TakeInventory("GFD_pVelyPrev", MAX_SIGNED_LONG);}
  107. else {
  108. TakeActorInventory(aTID,"GFD_pVelyPrevNegative", 0x7FFFFFFF);
  109. TakeActorInventory(aTID,"GFD_pVelyPrev", MAX_SIGNED_LONG);}
  110. }
  111.  
  112. function void ClearLastPVelZ(int aTID)
  113. {
  114. if(aTID == 0){
  115. TakeInventory("GFD_pVelzPrevNegative", 0x7FFFFFFF);
  116. TakeInventory("GFD_pVelzPrev", MAX_SIGNED_LONG);}
  117. else {
  118. TakeActorInventory(aTID,"GFD_pVelzPrevNegative", 0x7FFFFFFF);
  119. TakeActorInventory(aTID,"GFD_pVelzPrev", MAX_SIGNED_LONG);}
  120. }
  121.  
  122. function void ClearLastPVels(int aTID)
  123. {
  124. if(aTID == 0){
  125. TakeInventory("GFD_pVelxPrevNegative", 0x7FFFFFFF);
  126. TakeInventory("GFD_pVelxPrev", MAX_SIGNED_LONG);
  127. TakeInventory("GFD_pVelyPrevNegative", 0x7FFFFFFF);
  128. TakeInventory("GFD_pVelyPrev", MAX_SIGNED_LONG);
  129. TakeInventory("GFD_pVelzPrevNegative", 0x7FFFFFFF);
  130. TakeInventory("GFD_pVelzPrev", MAX_SIGNED_LONG);}
  131. else {
  132. TakeActorInventory(aTID,"GFD_pVelxPrevNegative", 0x7FFFFFFF);
  133. TakeActorInventory(aTID,"GFD_pVelxPrev", MAX_SIGNED_LONG);
  134. TakeActorInventory(aTID,"GFD_pVelyPrevNegative", 0x7FFFFFFF);
  135. TakeActorInventory(aTID,"GFD_pVelyPrev", MAX_SIGNED_LONG);
  136. TakeActorInventory(aTID,"GFD_pVelzPrevNegative", 0x7FFFFFFF);
  137. TakeActorInventory(aTID,"GFD_pVelzPrev", MAX_SIGNED_LONG);}
  138. }
  139.  
  140. //Get PushVel Functions
  141.  
  142. function int GetLastPushVelX(int aTID)
  143. {
  144. int PushVelPrev;
  145. if(aTID == 0){
  146. PushVelPrev = CheckInventory("GFD_PushVelxPrev");
  147. if(CheckInventory("GFD_PushVelxPrevNegative")){
  148. PushVelPrev = -PushVelPrev;}}
  149. else{
  150. PushVelPrev = CheckActorInventory(aTID,"GFD_PushVelxPrev");
  151. if(CheckActorInventory(aTID,"GFD_PushVelxPrevNegative")){
  152. PushVelPrev = -PushVelPrev;}}
  153. return PushVelPrev;
  154. }
  155.  
  156. function int GetLastPushVelY(int aTID)
  157. {
  158. int PushVelPrev;
  159. if(aTID == 0){
  160. PushVelPrev = CheckInventory("GFD_PushVelyPrev");
  161. if(CheckInventory("GFD_PushVelyPrevNegative")){
  162. PushVelPrev = -PushVelPrev;}}
  163. else{
  164. PushVelPrev = CheckActorInventory(aTID,"GFD_PushVelyPrev");
  165. if(CheckActorInventory(aTID,"GFD_PushVelyPrevNegative")){
  166. PushVelPrev = -PushVelPrev;}}
  167. return PushVelPrev;
  168. }
  169.  
  170. function int GetLastPushVelZ(int aTID)
  171. {
  172. int PushVelPrev;
  173. if(aTID == 0){
  174. PushVelPrev = CheckInventory("GFD_PushVelzPrev");
  175. if(CheckInventory("GFD_PushVelzPrevNegative")){
  176. PushVelPrev = -PushVelPrev;}}
  177. else{
  178. PushVelPrev = CheckActorInventory(aTID,"GFD_PushVelzPrev");
  179. if(CheckActorInventory(aTID,"GFD_PushVelzPrevNegative")){
  180. PushVelPrev = -PushVelPrev;}}
  181. return PushVelPrev;
  182. }
  183.  
  184. //Set PushVel Functions
  185.  
  186. function void SetLastPushVelX(int aTID, int PushVel)
  187. {
  188. if(aTID == 0){
  189. TakeInventory("GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  190. TakeInventory("GFD_PushVelxPrev", MAX_SIGNED_LONG);
  191. GiveInventory("GFD_PushVelxPrev", abs(PushVel));
  192. if(PushVel < 0){GiveInventory("GFD_PushVelxPrevNegative", 1);}}
  193. else {
  194. TakeActorInventory(aTID,"GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  195. TakeActorInventory(aTID,"GFD_PushVelxPrev", MAX_SIGNED_LONG);
  196. GiveActorInventory(aTID,"GFD_PushVelxPrev", abs(PushVel));
  197. if(PushVel < 0){GiveActorInventory(aTID,"GFD_PushVelxPrevNegative", 1);}}
  198. }
  199.  
  200. function void SetLastPushVelY(int aTID, int PushVel)
  201. {
  202. if(aTID == 0){
  203. TakeInventory("GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  204. TakeInventory("GFD_PushVelyPrev", MAX_SIGNED_LONG);
  205. GiveInventory("GFD_PushVelyPrev", abs(PushVel));
  206. if(PushVel < 0){GiveInventory("GFD_PushVelyPrevNegative", 1);}}
  207. else {
  208. TakeActorInventory(aTID,"GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  209. TakeActorInventory(aTID,"GFD_PushVelyPrev", MAX_SIGNED_LONG);
  210. GiveActorInventory(aTID,"GFD_PushVelyPrev", abs(PushVel));
  211. if(PushVel < 0){GiveActorInventory(aTID,"GFD_PushVelyPrevNegative", 1);}}
  212. }
  213.  
  214. function void SetLastPushVelZ(int aTID, int PushVel)
  215. {
  216. if(aTID == 0){
  217. TakeInventory("GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  218. TakeInventory("GFD_PushVelzPrev", MAX_SIGNED_LONG);
  219. GiveInventory("GFD_PushVelzPrev", abs(PushVel));
  220. if(PushVel < 0){GiveInventory("GFD_PushVelzPrevNegative", 1);}}
  221. else {
  222. TakeActorInventory(aTID,"GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  223. TakeActorInventory(aTID,"GFD_PushVelzPrev", MAX_SIGNED_LONG);
  224. GiveActorInventory(aTID,"GFD_PushVelzPrev", abs(PushVel));
  225. if(PushVel < 0){GiveActorInventory(aTID,"GFD_PushVelzPrevNegative", 1);}}
  226. }
  227.  
  228. //Clear PushVel Functions
  229.  
  230. function void ClearLastPushVelX(int aTID)
  231. {
  232. if(aTID == 0){
  233. TakeInventory("GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  234. TakeInventory("GFD_PushVelxPrev", MAX_SIGNED_LONG);}
  235. else {
  236. TakeActorInventory(aTID,"GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  237. TakeActorInventory(aTID,"GFD_PushVelxPrev", MAX_SIGNED_LONG);}
  238. }
  239.  
  240. function void ClearLastPushVelY(int aTID)
  241. {
  242. if(aTID == 0){
  243. TakeInventory("GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  244. TakeInventory("GFD_PushVelyPrev", MAX_SIGNED_LONG);}
  245. else {
  246. TakeActorInventory(aTID,"GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  247. TakeActorInventory(aTID,"GFD_PushVelyPrev", MAX_SIGNED_LONG);}
  248. }
  249.  
  250. function void ClearLastPushVelZ(int aTID)
  251. {
  252. if(aTID == 0){
  253. TakeInventory("GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  254. TakeInventory("GFD_PushVelzPrev", MAX_SIGNED_LONG);}
  255. else {
  256. TakeActorInventory(aTID,"GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  257. TakeActorInventory(aTID,"GFD_PushVelzPrev", MAX_SIGNED_LONG);}
  258. }
  259.  
  260. function void ClearLastPushVels(int aTID)
  261. {
  262. if(aTID == 0){
  263. TakeInventory("GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  264. TakeInventory("GFD_PushVelxPrev", MAX_SIGNED_LONG);
  265. TakeInventory("GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  266. TakeInventory("GFD_PushVelyPrev", MAX_SIGNED_LONG);
  267. TakeInventory("GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  268. TakeInventory("GFD_PushVelzPrev", MAX_SIGNED_LONG);}
  269. else {
  270. TakeActorInventory(aTID,"GFD_PushVelxPrevNegative", 0x7FFFFFFF);
  271. TakeActorInventory(aTID,"GFD_PushVelxPrev", MAX_SIGNED_LONG);
  272. TakeActorInventory(aTID,"GFD_PushVelyPrevNegative", 0x7FFFFFFF);
  273. TakeActorInventory(aTID,"GFD_PushVelyPrev", MAX_SIGNED_LONG);
  274. TakeActorInventory(aTID,"GFD_PushVelzPrevNegative", 0x7FFFFFFF);
  275. TakeActorInventory(aTID,"GFD_PushVelzPrev", MAX_SIGNED_LONG);}
  276. }
  277.  
  278. //Other Functions
  279.  
  280. function int GetAirF(void)
  281. {
  282. int AirFriction = 1.0004 - FixedMul(0.941, GetCVar("sv_aircontrol"));
  283. return AirFriction;
  284. }
  285.  
  286. function int GetAirFD(void)
  287. {
  288. int AirFriction = 1.0004 - FixedMul(0.941, GetCVar("sv_aircontrol"));
  289. AirFriction = FixedDiv(1.0, AirFriction);
  290. return AirFriction;
  291. }
  292.  
  293. function int GetPreAirFVel(int pVel)
  294. {
  295. int AirFriction = 1.0004 - FixedMul(0.941, GetCVar("sv_aircontrol"));
  296. AirFriction = FixedDiv(1.0, AirFriction);
  297. pVel = FixedMul(pVel, AirFriction);
  298. return pVel;
  299. }
  300.  
  301. function int FixedAngMod(int fAngle)
  302. {
  303. if (fAngle > 1.0){
  304. fAngle %= 65536; }
  305. else if (fAngle < 0){
  306. fAngle %= (-65536);
  307. fAngle = fAngle + 65536;}
  308. return fAngle;
  309. }
  310.  
  311. function int LineIntCheck(int p0_x, int p0_y, int p1_x, int p1_y,
  312. int p2_x, int p2_y, int p3_x, int p3_y)
  313. {
  314. int s02_x, s02_y, s10_x, s10_y, s32_x, s32_y, s_numer, t_numer, denom, t;
  315. s10_x = p1_x - p0_x;
  316. s10_y = p1_y - p0_y;
  317. s32_x = p3_x - p2_x;
  318. s32_y = p3_y - p2_y;
  319.  
  320. denom = FixedMul(s10_x, s32_y) - FixedMul(s32_x, s10_y);
  321. if ((denom == 0) &&
  322. ( ((p0_x > p2_x) && (p1_x > p2_x) && (p0_x > p3_x) && (p1_x > p3_x)) ||
  323. ((p0_x < p2_x) && (p1_x < p2_x) && (p0_x < p3_x) && (p1_x < p3_x)) )){
  324. return 0;} // Collinear, non intersecting
  325. else if (denom == 0){
  326. return 1;} // Collinear, intersecting
  327. bool denomPositive = denom > 0;
  328.  
  329. s02_x = p0_x - p2_x;
  330. s02_y = p0_y - p2_y;
  331. s_numer = FixedMul(s10_x,s02_y) - FixedMul(s10_y,s02_x);
  332. if ((s_numer < 0) == denomPositive){
  333. return 0;} // No collision
  334.  
  335. t_numer = FixedMul(s32_x,s02_y) - FixedMul(s32_y,s02_x);
  336. if ((t_numer < 0) == denomPositive){
  337. return 0;} // No collision
  338.  
  339. if (((s_numer > denom) == denomPositive) || ((t_numer > denom) == denomPositive)){
  340. return 0;} // No collision
  341. // Collision detected
  342. //t = t_numer / denom;
  343. //int i_x = p0_x + FixedMul(t,s10_x);
  344. //int i_y = p0_y + FixedMul(t,s10_y);
  345. return 1;
  346. }
  347.  
  348. function int LineIntGetX(int p0_x, int p0_y, int p1_x, int p1_y,
  349. int p2_x, int p2_y, int p3_x, int p3_y)
  350. {
  351. int s02_x, s02_y, s10_x, s10_y, s32_x, s32_y, s_numer, t_numer, denom, t;
  352. s10_x = p1_x - p0_x;
  353. s10_y = p1_y - p0_y;
  354. s32_x = p3_x - p2_x;
  355. s32_y = p3_y - p2_y;
  356.  
  357. denom = FixedMul(s10_x, s32_y) - FixedMul(s32_x, s10_y);
  358. if ((denom == 0) &&
  359. ( ((p0_x > p2_x) && (p1_x > p2_x) && (p0_x > p3_x) && (p1_x > p3_x)) ||
  360. ((p0_x < p2_x) && (p1_x < p2_x) && (p0_x < p3_x) && (p1_x < p3_x)) )){
  361. return 0;} // Collinear, non intersecting
  362. else if (denom == 0){
  363. return 1;} // Collinear, intersecting
  364. bool denomPositive = denom > 0;
  365.  
  366. s02_x = p0_x - p2_x;
  367. s02_y = p0_y - p2_y;
  368. s_numer = FixedMul(s10_x,s02_y) - FixedMul(s10_y,s02_x);
  369. if ((s_numer < 0) == denomPositive){
  370. return 0;} // No collision
  371.  
  372. t_numer = FixedMul(s32_x,s02_y) - FixedMul(s32_y,s02_x);
  373. if ((t_numer < 0) == denomPositive){
  374. return 0;} // No collision
  375.  
  376. if (((s_numer > denom) == denomPositive) || ((t_numer > denom) == denomPositive)){
  377. return 0;} // No collision
  378. // Collision detected
  379. t = t_numer / denom;
  380. int i_x = p0_x + FixedMul(t,s10_x);
  381. //int i_y = p0_y + FixedMul(t,s10_y);
  382. return i_x;
  383. }
  384.  
  385. function int LineIntGetY(int p0_x, int p0_y, int p1_x, int p1_y,
  386. int p2_x, int p2_y, int p3_x, int p3_y)
  387. {
  388. int s02_x, s02_y, s10_x, s10_y, s32_x, s32_y, s_numer, t_numer, denom, t;
  389. s10_x = p1_x - p0_x;
  390. s10_y = p1_y - p0_y;
  391. s32_x = p3_x - p2_x;
  392. s32_y = p3_y - p2_y;
  393.  
  394. denom = FixedMul(s10_x, s32_y) - FixedMul(s32_x, s10_y);
  395. if ((denom == 0) &&
  396. ( ((p0_x > p2_x) && (p1_x > p2_x) && (p0_x > p3_x) && (p1_x > p3_x)) ||
  397. ((p0_x < p2_x) && (p1_x < p2_x) && (p0_x < p3_x) && (p1_x < p3_x)) )){
  398. return 0;} // Collinear, non intersecting
  399. else if (denom == 0){
  400. return 1;} // Collinear, intersecting
  401. bool denomPositive = denom > 0;
  402.  
  403. s02_x = p0_x - p2_x;
  404. s02_y = p0_y - p2_y;
  405. s_numer = FixedMul(s10_x,s02_y) - FixedMul(s10_y,s02_x);
  406. if ((s_numer < 0) == denomPositive){
  407. return 0;} // No collision
  408.  
  409. t_numer = FixedMul(s32_x,s02_y) - FixedMul(s32_y,s02_x);
  410. if ((t_numer < 0) == denomPositive){
  411. return 0;} // No collision
  412.  
  413. if (((s_numer > denom) == denomPositive) || ((t_numer > denom) == denomPositive)){
  414. return 0;} // No collision
  415. // Collision detected
  416. t = t_numer / denom;
  417. //int i_x = p0_x + FixedMul(t,s10_x);
  418. int i_y = p0_y + FixedMul(t,s10_y);
  419. return i_y;
  420. }
  421.  
  422.  
  423.  
  424.  
  425.  
  426. //Remove this prolly
  427. function int FixedVectorLength (int FixedX, int FixedY)
  428. {
  429. int FixedLength = FixedMul(FixedX,FixedY);
  430. FixedLength = FixedSqrt(FixedLength);
  431. return FixedLength;
  432. }
  433.  
  434. script 110 enter
  435. {
  436. Delay(1);
  437. TakeInventory("OnPlatform",1);
  438. TakeInventory("OnPlatformTimer",1);
  439. if(CheckInventory("OnPlatform") == 0){
  440. ClearLastPVels(0);}
  441. TakeInventory("OnPlatformTimer",0x7FFFFFFF);
  442. Restart;
  443. }
  444.  
  445. script "PlatformTID" (int WhichPlatform)
  446. {
  447. int PlatformTID = ActivatorTID();
  448. if ((PlatformTID > 0) && (PlatformTID == PlatTIDArray[WhichPlatform])){ }
  449. else if (PlatformTID > 0){ PlatTIDArray[WhichPlatform] = PlatformTID; }
  450. else { PlatformTID = UniqueTID();
  451. PlatTIDArray[WhichPlatform] = PlatformTID;
  452. Thing_ChangeTID(0, PlatformTID);}
  453. SetActorState(0,"LoopState");
  454. }
  455.  
  456. script "PlatMethod1" (int WhichPlat, int ZTolerance)
  457. {
  458. if (ZTolerance == 0){ ZTolerance = 4.0; }
  459.  
  460. //Platform Info
  461. int PVelX = GetActorVelX(PlatTIDArray[WhichPlat]);
  462. int PVelY = GetActorVelY(PlatTIDArray[WhichPlat]);
  463. int PVelZ = GetActorVelZ(PlatTIDArray[WhichPlat]);
  464. int PlatHeight = GetActorProperty(PlatTIDArray[WhichPlat], APROP_Height);
  465. PlatHeight = PlatHeight << 16;
  466. int PlatRadius = GetActorProperty(PlatTIDArray[WhichPlat], APROP_Radius);
  467. PlatRadius = PlatRadius << 16;
  468. int PlatBigRadius = VectorLength(PlatRadius,PlatRadius);
  469. int PlatX = GetActorX(PlatTIDArray[WhichPlat]);
  470. int PlatY = GetActorY(PlatTIDArray[WhichPlat]);
  471. int PlatZ = GetActorZ(PlatTIDArray[WhichPlat]);
  472. int PlatAng = GetActorAngle(PlatTIDArray[WhichPlat]);
  473.  
  474. //Actor Info
  475. int ActorVelX = GetActorVelX(0);
  476. int ActorVelY = GetActorVelY(0);
  477. int ActorVelZ = GetActorVelZ(0);
  478. int ActorHeight = GetActorProperty(0, APROP_Height);
  479. ActorHeight = ActorHeight << 16;
  480. int ActorRadius = GetActorProperty(0, APROP_Radius);
  481. ActorRadius = ActorRadius << 16;
  482. int ActorBigRadius = VectorLength(ActorRadius,ActorRadius);
  483. int ActorX = GetActorX(0);
  484. int ActorY = GetActorX(0);
  485. int ActorZ = GetActorX(0);
  486. int ActorAng = GetActorAngle(0);
  487. int ActorJumpH = (FixedMul(GetActorProperty(0,APROP_JumpZ),GetActorProperty(0,APROP_JumpZ)) / 2) + (GetActorProperty(0,APROP_Accuracy) << 16);
  488.  
  489. //Collision Info
  490. int DistBet = VectorLength(PlatX - ActorX, PlatY - ActorY);
  491. int AngPlatOr = VectorAngle(ActorX - PlatX, ActorY - PlatY);
  492. int AngActOr = VectorAngle(PlatX - ActorX, PlatY - ActorY);
  493.  
  494. int ActorBoxClosestX = ActorX;
  495. int ActorBoxClosestY = ActorY;
  496. int ActorClosestL = DistBet;
  497.  
  498. for (int FindAngle = FixedAngMod(AngActOr - 0.25); FindAngle < FixedAngMod(AngActOr + 0.25); FindAngle = FixedAngMod(FindAngle + 0.001))
  499. {
  500. int RelAng = FixedAngMod(FindAngle - ActorAng);
  501. RelAng = (RelAng % 0.25);
  502. if (Relang > 0.125){ RelAng = 0.25 - RelAng; }
  503. int ActorArcL = FixedMul(cos(RelAng), ActorRadius);
  504. int ActorCheckX = FixedMul(sin(FindAngle), ActorArcL) + ActorX;
  505. int ActorCheckY = FixedMul(cos(FindAngle), ActorArcL) + ActorY;
  506. int ActorCheckL = VectorLength(PlatX - ActorCheckX, PlatY - ActorCheckY);
  507. if (ActorCheckL < ActorClosestL){
  508. ActorClosestL = ActorCheckL;
  509. ActorBoxClosestX = ActorCheckX;
  510. ActorBoxClosestY = ActorCheckY;}
  511. }
  512.  
  513. int ActorUpLeftX = FixedMul(sin(FixedAngMod(ActorAng + 0.125)), ActorBigRadius) + ActorX;
  514. int ActorUpLeftY = FixedMul(cos(FixedAngMod(ActorAng + 0.125)), ActorBigRadius) + ActorY;
  515.  
  516. int ActorUpRightX = FixedMul(sin(FixedAngMod(ActorAng + 0.875)), ActorBigRadius) + ActorX;
  517. int ActorUpRightY = FixedMul(cos(FixedAngMod(ActorAng + 0.875)), ActorBigRadius) + ActorY;
  518.  
  519. int ActorBotLeftX = FixedMul(sin(FixedAngMod(ActorAng + 0.375)), ActorBigRadius) + ActorX;
  520. int ActorBotLeftY = FixedMul(cos(FixedAngMod(ActorAng + 0.375)), ActorBigRadius) + ActorY;
  521.  
  522. int ActorBotRightX = FixedMul(sin(FixedAngMod(ActorAng + 0.625)), ActorBigRadius) + ActorX;
  523. int ActorBotRightY = FixedMul(cos(FixedAngMod(ActorAng + 0.625)), ActorBigRadius) + ActorY;
  524.  
  525. int ActorGX = ActorUpLeftX;
  526. int ActorLX = ActorUpLeftX;
  527. if (ActorUpRightX > ActorGX){ ActorGX = ActorUpRightX; }
  528. else if (ActorUpRightX < ActorLX){ ActorLX = ActorUpRightX; }
  529. if (ActorBotLeftX > ActorGX){ ActorGX = ActorBotLeftX; }
  530. else if (ActorBotLeftX < ActorLX){ ActorLX = ActorBotLeftX; }
  531. if (ActorBotRightX > ActorGX){ ActorGX = ActorBotRightX; }
  532. else if (ActorBotRightX < ActorLX){ ActorLX = ActorBotRightX; }
  533.  
  534. int ActorGY = ActorUpLeftY;
  535. int ActorLY = ActorUpLeftY;
  536. if (ActorUpRightY > ActorGY){ ActorGY = ActorUpRightY; }
  537. else if (ActorUpRightY < ActorLY){ ActorLY = ActorUpRightY; }
  538. if (ActorBotLeftY > ActorGY){ ActorGY = ActorBotLeftY; }
  539. else if (ActorBotLeftY < ActorLY){ ActorLY = ActorBotLeftY; }
  540. if (ActorBotRightY > ActorGY){ ActorGY = ActorBotRightY; }
  541. else if (ActorBotRightY < ActorLY){ ActorLY = ActorBotRightY; }
  542.  
  543. int PlatBoxClosestX = PlatX;
  544. int PlatBoxClosestY = PlatY;
  545. int PlatClosestL = DistBet;
  546.  
  547. for (FindAngle = FixedAngMod(AngPlatOr - 0.25); FindAngle < FixedAngMod(AngPlatOr + 0.25); FindAngle = FixedAngMod(FindAngle + 0.001))
  548. {
  549. RelAng = FixedAngMod(FindAngle - PlatAng);
  550. RelAng = (RelAng % 0.25);
  551. if (Relang > 0.125){ RelAng = 0.25 - RelAng; }
  552. int PlatArcL = FixedMul(cos(RelAng), PlatRadius);
  553. int PlatCheckX = FixedMul(sin(FindAngle), PlatArcL) + PlatX;
  554. int PlatCheckY = FixedMul(cos(FindAngle), PlatArcL) + PlatY;
  555. int PlatCheckL = VectorLength(ActorX - PlatCheckX, ActorY - PlatCheckY);
  556. if (PlatCheckL < PlatClosestL){
  557. PlatClosestL = PlatCheckL;
  558. PlatBoxClosestX = PlatCheckX;
  559. PlatBoxClosestY = PlatCheckY;}
  560. }
  561.  
  562. int PlatUpLeftX = FixedMul(sin(FixedAngMod(PlatAng + 0.125)), PlatBigRadius) + PlatX;
  563. int PlatUpLeftY = FixedMul(cos(FixedAngMod(PlatAng + 0.125)), PlatBigRadius) + PlatY;
  564.  
  565. int PlatUpRightX = FixedMul(sin(FixedAngMod(PlatAng + 0.875)), PlatBigRadius) + PlatX;
  566. int PlatUpRightY = FixedMul(cos(FixedAngMod(PlatAng + 0.875)), PlatBigRadius) + PlatY;
  567.  
  568. int PlatBotLeftX = FixedMul(sin(FixedAngMod(PlatAng + 0.375)), PlatBigRadius) + PlatX;
  569. int PlatBotLeftY = FixedMul(cos(FixedAngMod(PlatAng + 0.375)), PlatBigRadius) + PlatY;
  570.  
  571. int PlatBotRightX = FixedMul(sin(FixedAngMod(PlatAng + 0.625)), PlatBigRadius) + PlatX;
  572. int PlatBotRightY = FixedMul(cos(FixedAngMod(PlatAng + 0.625)), PlatBigRadius) + PlatY;
  573.  
  574. int PlatGX = PlatUpLeftX;
  575. int PlatLX = PlatUpLeftX;
  576. if (PlatUpRightX > PlatGX){ PlatGX = PlatUpRightX; }
  577. else if (PlatUpRightX < PlatLX){ PlatLX = PlatUpRightX; }
  578. if (PlatBotLeftX > PlatGX){ PlatGX = PlatBotLeftX; }
  579. else if (PlatBotLeftX < PlatLX){ PlatLX = PlatBotLeftX; }
  580. if (PlatBotRightX > PlatGX){ PlatGX = PlatBotRightX; }
  581. else if (PlatBotRightX < PlatLX){ PlatLX = PlatBotRightX; }
  582.  
  583. int PlatGY = PlatUpLeftY;
  584. int PlatLY = PlatUpLeftY;
  585. if (PlatUpRightY > PlatGY){ PlatGY = PlatUpRightY; }
  586. else if (PlatUpRightY < PlatLY){ PlatLY = PlatUpRightY; }
  587. if (PlatBotLeftY > PlatGY){ PlatGY = PlatBotLeftY; }
  588. else if (PlatBotLeftY < PlatLY){ PlatLY = PlatBotLeftY; }
  589. if (PlatBotRightY > PlatGY){ PlatGY = PlatBotRightY; }
  590. else if (PlatBotRightY < PlatLY){ PlatLY = PlatBotRightY; }
  591.  
  592. //Overlap Checks
  593. if ( (VectorAngle(ActorBoxClosestX - PlatUpLeftX, ActorBoxClosestY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  594. (VectorAngle(ActorBoxClosestX - PlatUpLeftX, ActorBoxClosestY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  595. (VectorAngle(ActorBoxClosestX - PlatBotRightX, ActorBoxClosestY - PlatBotRightY) >= (PlatAng)) &&
  596. (VectorAngle(ActorBoxClosestX - PlatBotRightX, ActorBoxClosestY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  597. int ACloseInPlat = TRUE; } else{ ACloseInPlat = FALSE; }
  598.  
  599. if ( (VectorAngle(ActorX - PlatUpLeftX, ActorY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  600. (VectorAngle(ActorX - PlatUpLeftX, ActorY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  601. (VectorAngle(ActorX - PlatBotRightX, ActorY - PlatBotRightY) >= (PlatAng)) &&
  602. (VectorAngle(ActorX - PlatBotRightX, ActorY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  603. int ACentInPlat = TRUE; } else{ ACentInPlat = FALSE; }
  604.  
  605.  
  606. if ( (VectorAngle(PlatBoxClosestX - ActorUpLeftX, PlatBoxClosestY - ActorUpLeftY) >= FixedAngMod(ActorAng + 0.5)) &&
  607. (VectorAngle(PlatBoxClosestX - ActorUpLeftX, PlatBoxClosestY - ActorUpLeftY) <= FixedAngMod(ActorAng + 0.75)) &&
  608. (VectorAngle(PlatBoxClosestX - ActorBotRightX, PlatBoxClosestY - ActorBotRightY) >= (ActorAng)) &&
  609. (VectorAngle(PlatBoxClosestX - ActorBotRightX, PlatBoxClosestY - ActorBotRightY) <= FixedAngMod(ActorAng + 0.25)) ){
  610. int PCloseInActor = TRUE; } else{ PCloseInActor = FALSE; }
  611.  
  612. if ( (VectorAngle(PlatX - ActorUpLeftX, PlatY - ActorUpLeftY) >= FixedAngMod(ActorAng + 0.5)) &&
  613. (VectorAngle(PlatX - ActorUpLeftX, PlatY - ActorUpLeftY) <= FixedAngMod(ActorAng + 0.75)) &&
  614. (VectorAngle(PlatX - ActorBotRightX, PlatY - ActorBotRightY) >= (ActorAng)) &&
  615. (VectorAngle(PlatX - ActorBotRightX, PlatY - ActorBotRightY) <= FixedAngMod(ActorAng + 0.25)) ){
  616. int PCentInActor = TRUE; } else{ PCentInActor = FALSE; }
  617.  
  618.  
  619. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY, PlatUpRightX, PlatUpRightY,
  620. ActorUpLeftX, ActorUpLeftY, ActorUpRightX, ActorUpRightY)){
  621. int AB_hit_EF = TRUE; } else{ AB_hit_EF = FALSE; }
  622. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY, PlatUpRightX, PlatUpRightY,
  623. ActorUpRightX,ActorUpRightY, ActorBotRightX, ActorBotRightY)){
  624. int AB_hit_FG = TRUE; } else{ AB_hit_FG = FALSE; }
  625. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY, PlatUpRightX, PlatUpRightY,
  626. ActorBotRightX, ActorBotRightY, ActorBotLeftX, ActorBotLeftY)){
  627. int AB_hit_GH = TRUE; } else{ AB_hit_GH = FALSE; }
  628. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY, PlatUpRightX, PlatUpRightY,
  629. ActorBotLeftX, ActorBotLeftY, ActorUpLeftX, ActorUpLeftY)){
  630. int AB_hit_HE = TRUE; } else{ AB_hit_HE = FALSE; }
  631.  
  632.  
  633. if(LineIntCheck(PlatUpRightX, PlatUpRightY, PlatBotRightX, PlatBotRightY,
  634. ActorUpLeftX, ActorUpLeftY, ActorUpRightX, ActorUpRightY)){
  635. int BC_hit_EF = TRUE; } else{ BC_hit_EF = FALSE; }
  636. if(LineIntCheck(PlatUpRightX, PlatUpRightY, PlatBotRightX, PlatBotRightY,
  637. ActorUpRightX,ActorUpRightY, ActorBotRightX, ActorBotRightY)){
  638. int BC_hit_FG = TRUE; } else{ BC_hit_FG = FALSE; }
  639. if(LineIntCheck(PlatUpRightX, PlatUpRightY, PlatBotRightX, PlatBotRightY,
  640. ActorBotRightX, ActorBotRightY, ActorBotLeftX, ActorBotLeftY)){
  641. int BC_hit_GH = TRUE; } else{ BC_hit_GH = FALSE; }
  642. if(LineIntCheck(PlatUpRightX, PlatUpRightY, PlatBotRightX, PlatBotRightY,
  643. ActorBotLeftX, ActorBotLeftY, ActorUpLeftX, ActorUpLeftY)){
  644. int BC_hit_HE = TRUE; } else{ BC_hit_HE = FALSE; }
  645.  
  646.  
  647. if(LineIntCheck(PlatBotRightX, PlatBotRightY, PlatBotLeftX, PlatBotLeftY,
  648. ActorUpLeftX, ActorUpLeftY, ActorUpRightX, ActorUpRightY)){
  649. int CD_hit_EF = TRUE; } else{ CD_hit_EF = FALSE; }
  650. if(LineIntCheck(PlatBotRightX, PlatBotRightY, PlatBotLeftX, PlatBotLeftY,
  651. ActorUpRightX,ActorUpRightY, ActorBotRightX, ActorBotRightY)){
  652. int CD_hit_FG = TRUE; } else{ CD_hit_FG = FALSE; }
  653. if(LineIntCheck(PlatBotRightX, PlatBotRightY, PlatBotLeftX, PlatBotLeftY,
  654. ActorBotRightX, ActorBotRightY, ActorBotLeftX, ActorBotLeftY)){
  655. int CD_hit_GH = TRUE; } else{ CD_hit_GH = FALSE; }
  656. if(LineIntCheck(PlatBotRightX, PlatBotRightY, PlatBotLeftX, PlatBotLeftY,
  657. ActorBotLeftX, ActorBotLeftY, ActorUpLeftX, ActorUpLeftY)){
  658. int CD_hit_HE = TRUE; } else{ CD_hit_HE = FALSE; }
  659.  
  660.  
  661. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY, PlatUpLeftX, PlatUpLeftY,
  662. ActorUpLeftX, ActorUpLeftY, ActorUpRightX, ActorUpRightY)){
  663. int DA_hit_EF = TRUE; } else{ DA_hit_EF = FALSE; }
  664. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY, PlatUpLeftX, PlatUpLeftY,
  665. ActorUpRightX,ActorUpRightY, ActorBotRightX, ActorBotRightY)){
  666. int DA_hit_FG = TRUE; } else{ DA_hit_FG = FALSE; }
  667. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY, PlatUpLeftX, PlatUpLeftY,
  668. ActorBotRightX, ActorBotRightY, ActorBotLeftX, ActorBotLeftY)){
  669. int DA_hit_GH = TRUE; } else{ DA_hit_GH = FALSE; }
  670. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY, PlatUpLeftX, PlatUpLeftY,
  671. ActorBotLeftX, ActorBotLeftY, ActorUpLeftX, ActorUpLeftY)){
  672. int DA_hit_HE = TRUE; } else{ DA_hit_HE = FALSE; }
  673.  
  674.  
  675. //Collision Checks
  676.  
  677. if ( (VectorAngle(ActorBoxClosestX - PlatUpLeftX - PVelX + ActorVelX, ActorBoxClosestY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  678. (VectorAngle(ActorBoxClosestX - PlatUpLeftX - PVelX + ActorVelX, ActorBoxClosestY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  679. (VectorAngle(ActorBoxClosestX - PlatBotRightX - PVelX + ActorVelX, ActorBoxClosestY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  680. (VectorAngle(ActorBoxClosestX - PlatBotRightX - PVelX + ActorVelX, ActorBoxClosestY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  681. int PHitPlat1 = TRUE; } else{ PHitPlat1 = FALSE; }
  682.  
  683. if ( (VectorAngle(ActorUpLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorUpLeftY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  684. (VectorAngle(ActorUpLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorUpLeftY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  685. (VectorAngle(ActorUpLeftX - PlatBotRightX - PVelX + ActorVelX, ActorUpLeftY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  686. (VectorAngle(ActorUpLeftX - PlatBotRightX - PVelX + ActorVelX, ActorUpLeftY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  687. int PHitPlat2 = TRUE; } else{ PHitPlat2 = FALSE; }
  688.  
  689. if ( (VectorAngle(ActorUpRightX - PlatUpLeftX - PVelX + ActorVelX, ActorUpRightY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  690. (VectorAngle(ActorUpRightX - PlatUpLeftX - PVelX + ActorVelX, ActorUpRightY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  691. (VectorAngle(ActorUpRightX - PlatBotRightX - PVelX + ActorVelX, ActorUpRightY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  692. (VectorAngle(ActorUpRightX - PlatBotRightX - PVelX + ActorVelX, ActorUpRightY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  693. int PHitPlat3 = TRUE; } else{ PHitPlat3 = FALSE; }
  694.  
  695. if ( (VectorAngle(ActorBotLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorBotLeftY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  696. (VectorAngle(ActorBotLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorBotLeftY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  697. (VectorAngle(ActorBotLeftX - PlatBotRightX - PVelX + ActorVelX, ActorBotLeftY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  698. (VectorAngle(ActorBotLeftX - PlatBotRightX - PVelX + ActorVelX, ActorBotLeftY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  699. int PHitPlat4 = TRUE; } else{ PHitPlat4 = FALSE; }
  700.  
  701. if ( (VectorAngle(ActorBotRightX - PlatUpLeftX - PVelX + ActorVelX, ActorBotRightY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  702. (VectorAngle(ActorBotRightX - PlatUpLeftX - PVelX + ActorVelX, ActorBotRightY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  703. (VectorAngle(ActorBotRightX - PlatBotRightX - PVelX + ActorVelX, ActorBotRightY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  704. (VectorAngle(ActorBotRightX - PlatBotRightX - PVelX + ActorVelX, ActorBotRightY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  705. int PHitPlat5 = TRUE; } else{ PHitPlat5 = FALSE; }
  706.  
  707.  
  708. if ( (VectorAngle(ActorUpLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorUpLeftY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  709. (VectorAngle(ActorUpLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorUpLeftY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  710. (VectorAngle(ActorUpLeftX - PlatBotRightX - PVelX + ActorVelX, ActorUpLeftY - PlatBotRightY) >= (PlatAng)) &&
  711. (VectorAngle(ActorUpLeftX - PlatBotRightX - PVelX + ActorVelX, ActorUpLeftY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  712. int PHitPlatX1 = TRUE; } else{ PHitPlatX1 = FALSE; }
  713.  
  714. if ( (VectorAngle(ActorUpRightX - PlatUpLeftX - PVelX + ActorVelX, ActorUpRightY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  715. (VectorAngle(ActorUpRightX - PlatUpLeftX - PVelX + ActorVelX, ActorUpRightY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  716. (VectorAngle(ActorUpRightX - PlatBotRightX - PVelX + ActorVelX, ActorUpRightY - PlatBotRightY) >= (PlatAng)) &&
  717. (VectorAngle(ActorUpRightX - PlatBotRightX - PVelX + ActorVelX, ActorUpRightY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  718. int PHitPlatX2 = TRUE; } else{ PHitPlatX2 = FALSE; }
  719.  
  720. if ( (VectorAngle(ActorBotLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorBotLeftY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  721. (VectorAngle(ActorBotLeftX - PlatUpLeftX - PVelX + ActorVelX, ActorBotLeftY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  722. (VectorAngle(ActorBotLeftX - PlatBotRightX - PVelX + ActorVelX, ActorBotLeftY - PlatBotRightY) >= (PlatAng)) &&
  723. (VectorAngle(ActorBotLeftX - PlatBotRightX - PVelX + ActorVelX, ActorBotLeftY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  724. int PHitPlatX3 = TRUE; } else{ PHitPlatX3 = FALSE; }
  725.  
  726. if ( (VectorAngle(ActorBotRightX - PlatUpLeftX - PVelX + ActorVelX, ActorBotRightY - PlatUpLeftY) >= FixedAngMod(PlatAng + 0.5)) &&
  727. (VectorAngle(ActorBotRightX - PlatUpLeftX - PVelX + ActorVelX, ActorBotRightY - PlatUpLeftY) <= FixedAngMod(PlatAng + 0.75)) &&
  728. (VectorAngle(ActorBotRightX - PlatBotRightX - PVelX + ActorVelX, ActorBotRightY - PlatBotRightY) >= (PlatAng)) &&
  729. (VectorAngle(ActorBotRightX - PlatBotRightX - PVelX + ActorVelX, ActorBotRightY - PlatBotRightY) <= FixedAngMod(PlatAng + 0.25)) ){
  730. int PHitPlatX4 = TRUE; } else{ PHitPlatX4 = FALSE; }
  731.  
  732.  
  733. if ( (VectorAngle(ActorUpLeftX - PlatUpLeftX, ActorUpLeftY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  734. (VectorAngle(ActorUpLeftX - PlatUpLeftX, ActorUpLeftY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  735. (VectorAngle(ActorUpLeftX - PlatBotRightX, ActorUpLeftY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  736. (VectorAngle(ActorUpLeftX - PlatBotRightX, ActorUpLeftY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  737. int PHitPlatY1 = TRUE; } else{ PHitPlatY1 = FALSE; }
  738.  
  739. if ( (VectorAngle(ActorUpRightX - PlatUpLeftX, ActorUpRightY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  740. (VectorAngle(ActorUpRightX - PlatUpLeftX, ActorUpRightY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  741. (VectorAngle(ActorUpRightX - PlatBotRightX, ActorUpRightY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  742. (VectorAngle(ActorUpRightX - PlatBotRightX, ActorUpRightY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  743. int PHitPlatY2 = TRUE; } else{ PHitPlatY2 = FALSE; }
  744.  
  745. if ( (VectorAngle(ActorBotLeftX - PlatUpLeftX, ActorBotLeftY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  746. (VectorAngle(ActorBotLeftX - PlatUpLeftX, ActorBotLeftY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  747. (VectorAngle(ActorBotLeftX - PlatBotRightX, ActorBotLeftY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  748. (VectorAngle(ActorBotLeftX - PlatBotRightX, ActorBotLeftY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  749. int PHitPlatY3 = TRUE; } else{ PHitPlatY3 = FALSE; }
  750.  
  751. if ( (VectorAngle(ActorBotRightX - PlatUpLeftX, ActorBotRightY - PlatUpLeftY - PVelY + ActorVelY) >= FixedAngMod(PlatAng + 0.5)) &&
  752. (VectorAngle(ActorBotRightX - PlatUpLeftX, ActorBotRightY - PlatUpLeftY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.75)) &&
  753. (VectorAngle(ActorBotRightX - PlatBotRightX, ActorBotRightY - PlatBotRightY - PVelY + ActorVelY) >= (PlatAng)) &&
  754. (VectorAngle(ActorBotRightX - PlatBotRightX, ActorBotRightY - PlatBotRightY - PVelY + ActorVelY) <= FixedAngMod(PlatAng + 0.25)) ){
  755. int PHitPlatY4 = TRUE; } else{ PHitPlatY4 = FALSE; }
  756.  
  757.  
  758. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY + PVelY, PlatUpRightX + PVelX, PlatUpRightY + PVelY,
  759. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  760. int AB_hitXY_EF = TRUE; } else{ AB_hitXY_EF = FALSE; }
  761. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY + PVelY, PlatUpRightX + PVelX, PlatUpRightY + PVelY,
  762. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  763. int AB_hitXY_FG = TRUE; } else{ AB_hitXY_FG = FALSE; }
  764. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY + PVelY, PlatUpRightX + PVelX, PlatUpRightY + PVelY,
  765. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  766. int AB_hitXY_GH = TRUE; } else{ AB_hitXY_GH = FALSE; }
  767. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY + PVelY, PlatUpRightX + PVelX, PlatUpRightY + PVelY,
  768. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  769. int AB_hitXY_HE = TRUE; } else{ AB_hitXY_HE = FALSE; }
  770.  
  771. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY + PVelY, PlatBotRightX + PVelX, PlatBotRightY + PVelY,
  772. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  773. int BC_hitXY_EF = TRUE; } else{ BC_hitXY_EF = FALSE; }
  774. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY + PVelY, PlatBotRightX + PVelX, PlatBotRightY + PVelY,
  775. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  776. int BC_hitXY_FG = TRUE; } else{ BC_hitXY_FG = FALSE; }
  777. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY + PVelY, PlatBotRightX + PVelX, PlatBotRightY + PVelY,
  778. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  779. int BC_hitXY_GH = TRUE; } else{ BC_hitXY_GH = FALSE; }
  780. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY + PVelY, PlatBotRightX + PVelX, PlatBotRightY + PVelY,
  781. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  782. int BC_hitXY_HE = TRUE; } else{ BC_hitXY_HE = FALSE; }
  783.  
  784. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY + PVelY, PlatBotLeftX + PVelX, PlatBotLeftY + PVelY,
  785. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  786. int CD_hitXY_EF = TRUE; } else{ CD_hitXY_EF = FALSE; }
  787. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY + PVelY, PlatBotLeftX + PVelX, PlatBotLeftY + PVelY,
  788. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  789. int CD_hitXY_FG = TRUE; } else{ CD_hitXY_FG = FALSE; }
  790. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY + PVelY, PlatBotLeftX + PVelX, PlatBotLeftY + PVelY,
  791. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  792. int CD_hitXY_GH = TRUE; } else{ CD_hitXY_GH = FALSE; }
  793. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY + PVelY, PlatBotLeftX + PVelX, PlatBotLeftY + PVelY,
  794. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  795. int CD_hitXY_HE = TRUE; } else{ CD_hitXY_HE = FALSE; }
  796.  
  797. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY + PVelY, PlatUpLeftX + PVelX, PlatUpLeftY + PVelY,
  798. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  799. int DA_hitXY_EF = TRUE; } else{ DA_hitXY_EF = FALSE; }
  800. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY + PVelY, PlatUpLeftX + PVelX, PlatUpLeftY + PVelY,
  801. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  802. int DA_hitXY_FG = TRUE; } else{ DA_hitXY_FG = FALSE; }
  803. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY + PVelY, PlatUpLeftX + PVelX, PlatUpLeftY + PVelY,
  804. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  805. int DA_hitXY_GH = TRUE; } else{ DA_hitXY_GH = FALSE; }
  806. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY + PVelY, PlatUpLeftX + PVelX, PlatUpLeftY,
  807. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  808. int DA_hitXY_HE = TRUE; } else{ DA_hitXY_HE = FALSE; }
  809.  
  810.  
  811.  
  812. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY, PlatUpRightX + PVelX, PlatUpRightY,
  813. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  814. int AB_hitX_EF = TRUE; } else{ AB_hitX_EF = FALSE; }
  815. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY, PlatUpRightX + PVelX, PlatUpRightY,
  816. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  817. int AB_hitX_FG = TRUE; } else{ AB_hitX_FG = FALSE; }
  818. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY, PlatUpRightX + PVelX, PlatUpRightY,
  819. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  820. int AB_hitX_GH = TRUE; } else{ AB_hitX_GH = FALSE; }
  821. if(LineIntCheck(PlatUpLeftX + PVelX, PlatUpLeftY, PlatUpRightX + PVelX, PlatUpRightY,
  822. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  823. int AB_hitX_HE = TRUE; } else{ AB_hitX_HE = FALSE; }
  824.  
  825. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY, PlatBotRightX + PVelX, PlatBotRightY,
  826. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  827. int BC_hitX_EF = TRUE; } else{ BC_hitX_EF = FALSE; }
  828. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY, PlatBotRightX + PVelX, PlatBotRightY,
  829. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  830. int BC_hitX_FG = TRUE; } else{ BC_hitX_FG = FALSE; }
  831. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY, PlatBotRightX + PVelX, PlatBotRightY,
  832. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  833. int BC_hitX_GH = TRUE; } else{ BC_hitX_GH = FALSE; }
  834. if(LineIntCheck(PlatUpRightX + PVelX, PlatUpRightY, PlatBotRightX + PVelX, PlatBotRightY,
  835. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  836. int BC_hitX_HE = TRUE; } else{ BC_hitX_HE = FALSE; }
  837.  
  838. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY, PlatBotLeftX + PVelX, PlatBotLeftY,
  839. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  840. int CD_hitX_EF = TRUE; } else{ CD_hitX_EF = FALSE; }
  841. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY, PlatBotLeftX + PVelX, PlatBotLeftY,
  842. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  843. int CD_hitX_FG = TRUE; } else{ CD_hitX_FG = FALSE; }
  844. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY, PlatBotLeftX + PVelX, PlatBotLeftY,
  845. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  846. int CD_hitX_GH = TRUE; } else{ CD_hitX_GH = FALSE; }
  847. if(LineIntCheck(PlatBotRightX + PVelX, PlatBotRightY, PlatBotLeftX + PVelX, PlatBotLeftY,
  848. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  849. int CD_hitX_HE = TRUE; } else{ CD_hitX_HE = FALSE; }
  850.  
  851. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY, PlatUpLeftX + PVelX, PlatUpLeftY,
  852. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  853. int DA_hitX_EF = TRUE; } else{ DA_hitX_EF = FALSE; }
  854. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY, PlatUpLeftX + PVelX, PlatUpLeftY,
  855. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  856. int DA_hitX_FG = TRUE; } else{ DA_hitX_FG = FALSE; }
  857. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY, PlatUpLeftX + PVelX, PlatUpLeftY,
  858. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  859. int DA_hitX_GH = TRUE; } else{ DA_hitX_GH = FALSE; }
  860. if(LineIntCheck(PlatBotLeftX + PVelX, PlatBotLeftY, PlatUpLeftX + PVelX, PlatUpLeftY,
  861. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  862. int DA_hitX_HE = TRUE; } else{ DA_hitX_HE = FALSE; }
  863.  
  864.  
  865.  
  866. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY + PVelY, PlatUpRightX, PlatUpRightY + PVelY,
  867. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  868. int AB_hitY_EF = TRUE; } else{ AB_hitY_EF = FALSE; }
  869. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY + PVelY, PlatUpRightX, PlatUpRightY + PVelY,
  870. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  871. int AB_hitY_FG = TRUE; } else{ AB_hitY_FG = FALSE; }
  872. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY + PVelY, PlatUpRightX, PlatUpRightY + PVelY,
  873. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  874. int AB_hitY_GH = TRUE; } else{ AB_hitY_GH = FALSE; }
  875. if(LineIntCheck(PlatUpLeftX, PlatUpLeftY + PVelY, PlatUpRightX, PlatUpRightY + PVelY,
  876. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  877. int AB_hitY_HE = TRUE; } else{ AB_hitY_HE = FALSE; }
  878.  
  879. if(LineIntCheck(PlatUpRightX, PlatUpRightY + PVelY, PlatBotRightX, PlatBotRightY + PVelY,
  880. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  881. int BC_hitY_EF = TRUE; } else{ BC_hitY_EF = FALSE; }
  882. if(LineIntCheck(PlatUpRightX, PlatUpRightY + PVelY, PlatBotRightX, PlatBotRightY + PVelY,
  883. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  884. int BC_hitY_FG = TRUE; } else{ BC_hitY_FG = FALSE; }
  885. if(LineIntCheck(PlatUpRightX, PlatUpRightY + PVelY, PlatBotRightX, PlatBotRightY + PVelY,
  886. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  887. int BC_hitY_GH = TRUE; } else{ BC_hitY_GH = FALSE; }
  888. if(LineIntCheck(PlatUpRightX, PlatUpRightY + PVelY, PlatBotRightX, PlatBotRightY + PVelY,
  889. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  890. int BC_hitY_HE = TRUE; } else{ BC_hitY_HE = FALSE; }
  891.  
  892. if(LineIntCheck(PlatBotRightX, PlatBotRightY + PVelY, PlatBotLeftX, PlatBotLeftY + PVelY,
  893. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  894. int CD_hitY_EF = TRUE; } else{ CD_hitY_EF = FALSE; }
  895. if(LineIntCheck(PlatBotRightX, PlatBotRightY + PVelY, PlatBotLeftX, PlatBotLeftY + PVelY,
  896. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  897. int CD_hitY_FG = TRUE; } else{ CD_hitY_FG = FALSE; }
  898. if(LineIntCheck(PlatBotRightX, PlatBotRightY + PVelY, PlatBotLeftX, PlatBotLeftY + PVelY,
  899. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  900. int CD_hitY_GH = TRUE; } else{ CD_hitY_GH = FALSE; }
  901. if(LineIntCheck(PlatBotRightX, PlatBotRightY + PVelY, PlatBotLeftX, PlatBotLeftY + PVelY,
  902. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  903. int CD_hitY_HE = TRUE; } else{ CD_hitY_HE = FALSE; }
  904.  
  905. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY + PVelY, PlatUpLeftX, PlatUpLeftY + PVelY,
  906. ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY, ActorUpRightX + ActorVelX, ActorUpRightY + ActorVelY)){
  907. int DA_hitY_EF = TRUE; } else{ DA_hitY_EF = FALSE; }
  908. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY + PVelY, PlatUpLeftX, PlatUpLeftY + PVelY,
  909. ActorUpRightX + ActorVelX,ActorUpRightY + ActorVelY, ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY)){
  910. int DA_hitY_FG = TRUE; } else{ DA_hitY_FG = FALSE; }
  911. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY + PVelY, PlatUpLeftX, PlatUpLeftY + PVelY,
  912. ActorBotRightX + ActorVelX, ActorBotRightY + ActorVelY, ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY)){
  913. int DA_hitY_GH = TRUE; } else{ DA_hitY_GH = FALSE; }
  914. if(LineIntCheck(PlatBotLeftX, PlatBotLeftY + PVelY, PlatUpLeftX, PlatUpLeftY,
  915. ActorBotLeftX + ActorVelX, ActorBotLeftY + ActorVelY, ActorUpLeftX + ActorVelX, ActorUpLeftY + ActorVelY)){
  916. int DA_hitY_HE = TRUE; } else{ DA_hitY_HE = FALSE; }
  917.  
  918. //The actual script purpose
  919.  
  920. if( ((ActorZ >= (PlatZ - PVelZ)) && (ActorZ <= (PlatZ - PVelZ + ZTolerance)) )
  921. && ((ACloseInPlat || ACentInPlat || PCloseInActor || PCentInActor) ||
  922. (AB_hit_EF || AB_hit_FG || AB_hit_GH || AB_hit_HE
  923. || BC_hit_EF || BC_hit_FG || BC_hit_GH || BC_hit_HE
  924. || CD_hit_EF || CD_hit_FG || CD_hit_GH || CD_hit_HE
  925. || DA_hit_EF || DA_hit_FG || DA_hit_GH || DA_hit_HE)) ){
  926.  
  927. GiveInventory("OnPlatform",2);
  928. GiveInventory("OnPlatformTimer",2);
  929.  
  930. int NewActorVelX = PVelX - FixedMul(GetLastPVelX(0) , FLOOR_FRICTION);
  931. int NewActorVelY = PVelY - FixedMul(GetLastPVelY(0) , FLOOR_FRICTION);
  932. int NewActorVelZ = PVelZ - FixedMul(GetLastPVelZ(0) , FLOOR_FRICTION);
  933.  
  934. SetLastPVelX(0, PVelX);
  935. SetLastPVelY(0, PVelY);
  936. SetLastPVelZ(0, PVelZ);}
  937.  
  938. else if( ( (ActorZ > (PlatZ - PVelZ + ZTolerance)) && (ActorZ <= (PlatZ - PVelZ + ZTolerance + ActorJumpH)) )
  939. && (ACloseInPlat || ACentInPlat || PCloseInActor || PCentInActor)
  940. && ( (ClassifyActor(0) & ACTOR_PLAYER) ) ){
  941.  
  942. GiveInventory("OnPlatform",2);
  943.  
  944. NewActorVelX = 0;
  945. NewActorVelY = 0;
  946. NewActorVelZ = 0;
  947.  
  948. SetLastPVelX(0, FixedMul(GetLastPVelX(0) , FLOOR_FRICTION));
  949. SetLastPVelY(0, FixedMul(GetLastPVelY(0) , FLOOR_FRICTION));
  950. SetLastPVelZ(0, FixedMul(GetLastPVelZ(0) , FLOOR_FRICTION));}
  951.  
  952. else if( (((ActorZ + ActorHeight + 1.0) > (PlatZ - PVelZ)) && (ActorZ < (PlatZ - PVelZ + ZTolerance)) )
  953. && ((PHitPlat1 || PHitPlat2 || PHitPlat3 || PHitPlat4 || PHitPlat5) ||
  954. (AB_hitXY_EF || AB_hitXY_FG || AB_hitXY_GH || AB_hitXY_HE
  955. || BC_hitXY_EF || BC_hitXY_FG || BC_hitXY_GH || BC_hitXY_HE
  956. || CD_hitXY_EF || CD_hitXY_FG || CD_hitXY_GH || CD_hitXY_HE
  957. || DA_hitXY_EF || DA_hitXY_FG || DA_hitXY_GH || DA_hitXY_HE)) ){
  958.  
  959. if( (PVelX == !0) && (PVelY == !0)
  960. && ( ((PHitPlatX1 || PHitPlatX2 || PHitPlatX3 || PHitPlatX4)
  961. && (PHitPlatY1 || PHitPlatY2 || PHitPlatY3 || PHitPlatY4)) ||
  962. (AB_hitX_EF || AB_hitX_FG || AB_hitX_GH || AB_hitX_HE
  963. || BC_hitX_EF || BC_hitX_FG || BC_hitX_GH || BC_hitX_HE
  964. || CD_hitX_EF || CD_hitX_FG || CD_hitX_GH || CD_hitX_HE
  965. || DA_hitX_EF || DA_hitX_FG || DA_hitX_GH || DA_hitX_HE) &&
  966. (AB_hitY_EF || AB_hitY_FG || AB_hitY_GH || AB_hitY_HE
  967. || BC_hitY_EF || BC_hitY_FG || BC_hitY_GH || BC_hitY_HE
  968. || CD_hitY_EF || CD_hitY_FG || CD_hitY_GH || CD_hitY_HE
  969. || DA_hitY_EF || DA_hitY_FG || DA_hitY_GH || DA_hitY_HE)) ){
  970.  
  971. }
  972.  
  973. else if( (PVelX == !0)
  974. && ( (PHitPlatX1 || PHitPlatX2 || PHitPlatX3 || PHitPlatX4) ||
  975. (AB_hitX_EF || AB_hitX_FG || AB_hitX_GH || AB_hitX_HE
  976. || BC_hitX_EF || BC_hitX_FG || BC_hitX_GH || BC_hitX_HE
  977. || CD_hitX_EF || CD_hitX_FG || CD_hitX_GH || CD_hitX_HE
  978. || DA_hitX_EF || DA_hitX_FG || DA_hitX_GH || DA_hitX_HE) ) ){
  979.  
  980.  
  981.  
  982.  
  983. }
  984.  
  985. else if( (PVelY == !0)
  986. && ( (PHitPlatY1 || PHitPlatY2 || PHitPlatY3 || PHitPlatY4) ||
  987. (AB_hitY_EF || AB_hitY_FG || AB_hitY_GH || AB_hitY_HE
  988. || BC_hitY_EF || BC_hitY_FG || BC_hitY_GH || BC_hitY_HE
  989. || CD_hitY_EF || CD_hitY_FG || CD_hitY_GH || CD_hitY_HE
  990. || DA_hitY_EF || DA_hitY_FG || DA_hitY_GH || DA_hitY_HE) ) ){
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998. }
  999.  
  1000.  
  1001. }
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. SetActorVelocity(0,NewActorVelX,NewActorVelY,NewActorVelZ,TRUE,FALSE);
  1011. Terminate;
  1012. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement