Advertisement
ywkls

Dimitri

Jun 13th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.31 KB | None | 0 0
  1. ffc script Dimitri{
  2. void run(int enemyID){
  3. npc ghost = Ghost_InitAutoGhost(this,enemyID);
  4. bool MovingLeft;
  5. bool MovingDown;
  6. int Direction;
  7. int combo= ghost->Attributes[10];
  8. if((Ghost_CanMove(DIR_DOWN,1,0))){
  9. Ghost_Data = combo+1;
  10. Ghost_SetSize(this,ghost,1,2);
  11. MovingDown = true;
  12. MovingLeft = false;
  13. }
  14. else{
  15. Ghost_SetSize(this,ghost,2,1);
  16. Ghost_Data = combo+3;
  17. MovingDown= true;
  18. MovingLeft = true;
  19. }
  20. bool Cornered = false;
  21. eweapon fireball;
  22. Ghost_SetFlag(GHF_STUN);
  23. int SPR = ghost->Attributes[0];
  24. int SFX = ghost->Attributes[1];
  25. bool attackCond;
  26. int attackCooldown = Rand(100,200);
  27. float angle;
  28. float Speed = ghost->Step/100;
  29. float Step= Speed;
  30. int MaxHP = Ghost_HP;
  31. Gen_Explode_Waitframes(this,ghost,32);
  32. while(true){
  33. if(!Cornered){
  34. if(MovingDown && !MovingLeft){
  35. Ghost_Data = combo+1;
  36. Ghost_SetSize(this,ghost,1,2);
  37. Ghost_ForceDir(DIR_DOWN);
  38. if(Ghost_CanMove(DIR_DOWN,1,0))
  39. Ghost_Move(DIR_DOWN, Speed, 0);
  40. else
  41. Cornered = true;
  42. }
  43. else if(!MovingDown && MovingLeft){
  44. Ghost_Data = combo+2;
  45. Ghost_SetSize(this,ghost,2,1);
  46. Ghost_ForceDir(DIR_LEFT);
  47. if(Ghost_CanMove(DIR_LEFT,1,0))
  48. Ghost_Move(DIR_LEFT, Speed, 0);
  49. else
  50. Cornered = true;
  51. }
  52. else if(!MovingDown && !MovingLeft){
  53. Ghost_Data = combo;
  54. Ghost_SetSize(this,ghost,1,2);
  55. Ghost_ForceDir(DIR_UP);
  56. if(Ghost_CanMove(DIR_UP,1,0))
  57. Ghost_Move(DIR_UP, Speed, 0);
  58. else
  59. Cornered = true;
  60. }
  61. else if(MovingDown && MovingLeft){
  62. Ghost_Data = combo+3;
  63. Ghost_SetSize(this,ghost,2,1);
  64. Ghost_ForceDir(DIR_RIGHT);
  65. if(Ghost_CanMove(DIR_RIGHT,1,0))
  66. Ghost_Move(DIR_RIGHT, Speed, 0);
  67. else
  68. Cornered = true;
  69. }
  70. Direction = Ghost_Dir;
  71. }
  72. else{
  73. if(Direction == DIR_DOWN){
  74. if(Screen->isSolid(ghost->X-1,ghost->Y+24)
  75. && !Screen->isSolid(ghost->X+17,ghost->Y+24)){
  76. Ghost_Data = combo+3;
  77. Ghost_SetSize(this,ghost,2,1);
  78. Ghost_ForceDir(DIR_RIGHT);
  79. Ghost_Y+=16;
  80. MovingDown = true;
  81. MovingLeft = true;
  82. Cornered = false;
  83. }
  84. else if(!Screen->isSolid(ghost->X-1,ghost->Y+24)
  85. && Screen->isSolid(ghost->X+17,ghost->Y+24)){
  86. Ghost_Data = combo+2;
  87. Ghost_SetSize(this,ghost,2,1);
  88. Ghost_ForceDir(DIR_LEFT);
  89. Ghost_Y+=16;
  90. Ghost_X-=16;
  91. MovingDown = false;
  92. MovingLeft = true;
  93. Cornered = false;
  94. }
  95. else if(!Screen->isSolid(ghost->X-1,ghost->Y+24)
  96. && !Screen->isSolid(ghost->X+17,ghost->Y+24)){
  97. Direction = Choose(DIR_LEFT,DIR_RIGHT);
  98. Ghost_SetSize(this,ghost,2,1);
  99. Ghost_Y+=16;
  100. if(Direction==DIR_LEFT){
  101. Ghost_Data = combo+2;
  102. Ghost_ForceDir(DIR_LEFT);
  103. Ghost_X-=16;
  104. MovingDown = false;
  105. MovingLeft = true;
  106. }
  107. else{
  108. Ghost_Data = combo+3;
  109. Ghost_ForceDir(DIR_RIGHT);
  110. MovingDown = true;
  111. MovingLeft = true;
  112. }
  113. Cornered = false;
  114. }
  115. else{
  116. Ghost_Data = combo;
  117. Ghost_ForceDir(DIR_UP);
  118. MovingDown = false;
  119. MovingLeft = false;
  120. Cornered = false;
  121. }
  122. }
  123. else if(Direction == DIR_UP){
  124. if(Screen->isSolid(ghost->X-1,ghost->Y+8)
  125. && !Screen->isSolid(ghost->X+17,ghost->Y+8)){
  126. Ghost_Data = combo+3;
  127. Ghost_SetSize(this,ghost,2,1);
  128. Ghost_ForceDir(DIR_RIGHT);
  129. MovingDown = true;
  130. MovingLeft = true;
  131. Cornered = false;
  132. }
  133. else if(!Screen->isSolid(ghost->X-1,ghost->Y+8)
  134. && Screen->isSolid(ghost->X+17,ghost->Y+8)){
  135. Ghost_Data = combo+2;
  136. Ghost_SetSize(this,ghost,2,1);
  137. Ghost_ForceDir(DIR_LEFT);
  138. Ghost_X-=16;
  139. MovingDown = false;
  140. MovingLeft = true;
  141. Cornered = false;
  142. }
  143. else if(!Screen->isSolid(ghost->X-1,ghost->Y+8)
  144. && !Screen->isSolid(ghost->X+17,ghost->Y+8)){
  145. Direction = Choose(DIR_LEFT,DIR_RIGHT);
  146. Ghost_SetSize(this,ghost,2,1);
  147. if(Direction==DIR_LEFT){
  148. Ghost_Data = combo+2;
  149. Ghost_ForceDir(DIR_LEFT);
  150. Ghost_X-=16;
  151. MovingDown = false;
  152. MovingLeft = true;
  153. }
  154. else{
  155. Ghost_Data = combo+3;
  156. Ghost_ForceDir(DIR_RIGHT);
  157. MovingDown = true;
  158. MovingLeft = true;
  159. }
  160. Cornered = false;
  161. }
  162. else{
  163. Ghost_Data = combo+1;
  164. Ghost_ForceDir(DIR_DOWN);
  165. MovingDown = true;
  166. MovingLeft = false;
  167. Cornered = false;
  168. }
  169. }
  170. else if(Direction == DIR_LEFT){
  171. if(Screen->isSolid(ghost->X+8,ghost->Y+17)
  172. && !Screen->isSolid(ghost->X+8,ghost->Y-1)){
  173. Ghost_Data = combo;
  174. Ghost_SetSize(this,ghost,1,2);
  175. Ghost_ForceDir(DIR_UP);
  176. Ghost_Y-=16;
  177. MovingDown = false;
  178. MovingLeft = false;
  179. Cornered = false;
  180. }
  181. else if(!Screen->isSolid(ghost->X+8,ghost->Y+17)
  182. && Screen->isSolid(ghost->X+8,ghost->Y-1)){
  183. Ghost_Data = combo+1;
  184. Ghost_SetSize(this,ghost,1,2);
  185. Ghost_ForceDir(DIR_DOWN);
  186. MovingDown = true;
  187. MovingLeft = false;
  188. Cornered = false;
  189. }
  190. else if(!Screen->isSolid(ghost->X+8,ghost->Y+17)
  191. && !Screen->isSolid(ghost->X+8,ghost->Y-1)){
  192. Direction = Choose(DIR_UP,DIR_DOWN);
  193. Ghost_SetSize(this,ghost,1,2);
  194. if(Direction==DIR_UP){
  195. Ghost_Data = combo;
  196. Ghost_ForceDir(DIR_UP);
  197. Ghost_Y-=16;
  198. MovingDown = false;
  199. MovingLeft = false;
  200. }
  201. else{
  202. Ghost_Data = combo+1;
  203. Ghost_ForceDir(DIR_DOWN);
  204. MovingDown = true;
  205. MovingLeft = false;
  206. }
  207. Cornered = false;
  208. }
  209. else{
  210. Ghost_Data = combo+3;
  211. MovingDown = true;
  212. MovingLeft = true;
  213. Cornered = false;
  214. }
  215. }
  216. else if(Direction == DIR_RIGHT){
  217. if(Screen->isSolid(ghost->X+24,ghost->Y+17)
  218. && !Screen->isSolid(ghost->X+24,ghost->Y-1)){
  219. Ghost_Data = combo;
  220. Ghost_SetSize(this,ghost,1,2);
  221. Ghost_X+=16;
  222. Ghost_Y-=16;
  223. Ghost_ForceDir(DIR_UP);
  224. MovingDown = false;
  225. MovingLeft = false;
  226. Cornered = false;
  227. }
  228. else if(!Screen->isSolid(ghost->X+24,ghost->Y+17)
  229. && Screen->isSolid(ghost->X+24,ghost->Y-1)){
  230. Ghost_Data = combo+1;
  231. Ghost_SetSize(this,ghost,1,2);
  232. Ghost_ForceDir(DIR_DOWN);
  233. Ghost_X+=16;
  234. MovingDown = true;
  235. MovingLeft = false;
  236. Cornered = false;
  237. }
  238. else if(!Screen->isSolid(ghost->X+24,ghost->Y+17)
  239. && !Screen->isSolid(ghost->X+24,ghost->Y-1)){
  240. Direction = Choose(DIR_UP,DIR_DOWN);
  241. Ghost_SetSize(this,ghost,1,2);
  242. Ghost_X+=16;
  243. if(Direction==DIR_UP){
  244. Ghost_Data = combo;
  245. Ghost_ForceDir(DIR_UP);
  246. Ghost_Y-=16;
  247. MovingDown = false;
  248. MovingLeft = false;
  249. }
  250. else{
  251. Ghost_Data = combo+1;
  252. Ghost_ForceDir(DIR_DOWN);
  253. MovingDown = true;
  254. MovingLeft = false;
  255. }
  256. Cornered = false;
  257. }
  258. else{
  259. Ghost_Data = combo+2;
  260. MovingDown = false;
  261. MovingLeft = true;
  262. Cornered = false;
  263. }
  264. }
  265. }
  266. if(attackCooldown>0)
  267. attackCooldown--;
  268. else if(attackCooldown<=0)
  269. attackCond = true;
  270. if(attackCond){
  271. for(int i=0; i<24; i++){
  272. angle = DirAngle(Ghost_Dir);
  273. if(Ghost_Dir==DIR_UP)
  274. fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y,
  275. DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
  276. else if(Ghost_Dir==DIR_DOWN)
  277. fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y+32,
  278. DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
  279. else if(Ghost_Dir==DIR_LEFT)
  280. fireball = FireEWeapon(EW_SCRIPT1,Ghost_X, Ghost_Y,
  281. DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
  282. else if(Ghost_Dir==DIR_RIGHT)
  283. fireball = FireEWeapon(EW_SCRIPT1,Ghost_X+32, Ghost_Y,
  284. DegtoRad(angle+Rand(-25,25)), 250, ghost->WeaponDamage, SPR, SFX,EWF_ROTATE_360);
  285. Gen_Explode_Waitframes(this,ghost,4);
  286. }
  287. attackCond = false;
  288. attackCooldown = Rand(100,200);
  289. }
  290. if(Ghost_HP<=(MaxHP/2))
  291. Speed = Step*2;
  292. Gen_Explode_Waitframe(this,ghost);
  293. }
  294. }
  295. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement