Guest User

Untitled

a guest
Apr 22nd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.28 KB | None | 0 0
  1. Audio.Play()
  2. tim = 0
  3. timer = 0
  4. timer2 = 0
  5. timer3 = 200
  6. bullets = {}
  7. bullets2 = {}
  8. bullets3 = {}
  9. bullets4 = {}
  10. bullets5 = {}
  11. bones = {}
  12. bones2 = {}
  13. Corners = {}
  14. Blasters = {}
  15. Poles = {}
  16. Beams = {}
  17. Rbullets = {}
  18. Ubullets = {}
  19.  
  20. R1 = 0
  21. R2 = 0
  22. Arena.ResizeImmediate(150, 150)
  23. Player.MoveTo(0,0,false)
  24. Warning1 = CreateProjectile('CircleWarning', Arena.width/2-30, -Arena.height/2+30)
  25. Warning1.sprite.xscale = 2
  26. Warning1.sprite.yscale = 2
  27. Warning1.SetVar("Type", 0)
  28. Ex1 = CreateProjectile('!', Arena.width/2-30, -Arena.height/2+30)
  29.  
  30. Warning2 = CreateProjectile('CircleWarning', -Arena.width/2+30, Arena.height/2-30)
  31. Warning2.sprite.xscale = 2
  32. Warning2.sprite.yscale = 2
  33. Warning2.sprite.rotation = 180
  34. Warning2.SetVar("Type", 0)
  35. Ex2 = CreateProjectile('!', -Arena.width/2+30, Arena.height/2-30)
  36.  
  37. Warning3 = CreateProjectile('CircleWarning', -Arena.width/2+30, -Arena.height/2+30)
  38. Warning3.sprite.xscale = 2
  39. Warning3.sprite.yscale = 2
  40. Warning3.sprite.rotation = -90
  41. Warning3.SetVar("Type", 0)
  42. Ex3 = CreateProjectile('!', -Arena.width/2+30, -Arena.height/2+30)
  43.  
  44. Warning4 = CreateProjectile('CircleWarning', Arena.width/2-30, Arena.height/2-30)
  45. Warning4.sprite.xscale = 2
  46. Warning4.sprite.yscale = 2
  47. Warning4.sprite.rotation = 90
  48. Warning4.SetVar("Type", 0)
  49. Ex4 = CreateProjectile('!', Arena.width/2-30, Arena.height/2-30)
  50.  
  51. Warnings = {Warning1, Warning2, Warning3, Warning4, Ex1, Ex2, Ex3, Ex4}
  52. Exs = {Ex1, Ex2, Ex3, Ex4}
  53.  
  54. Flash = 1
  55.  
  56. function Update()
  57. timer = timer + 1
  58. if timer%8 == 0 then
  59. Flash = Flash*(-1)
  60. end
  61. if timer >= 100 then
  62. for i=1,#Warnings do
  63. local bullet = Warnings[i]
  64. if bullet.isactive then
  65. bullet.Remove()
  66. end
  67. end
  68. else
  69. for i=1,#Exs do
  70. local bullet = Exs[i]
  71. if Flash == 1 then
  72. bullet.sprite.Set("!")
  73. elseif Flash == -1 then
  74. bullet.sprite.Set("!1")
  75. end
  76. end
  77. end
  78. if timer < 100 then
  79. if timer%16 == 0 then
  80. Audio.PlaySound("alarm")
  81. end
  82. end
  83. if timer%1 == 0 and timer <= 142 and timer > 100 then
  84. local bullet1 = CreateProjectile('pixel', ((60) * math.sin((timer+15) / 25) + Arena.width/2),((-(60)) * math.cos((timer+15) / 25) + Arena.height/2))
  85. bullet1.SetVar('Type', 1)
  86. table.insert(bullets, bullet1)
  87. local bullet2 = CreateProjectile('pixel', (-(60) * math.cos((timer-23) / 25) - Arena.width/2), ((60)) * math.sin((timer-23) / 25) + Arena.height/2)
  88. bullet2.SetVar('Type', 1)
  89. table.insert(bullets, bullet2)
  90. local bullet3 = CreateProjectile('pixel', (-(60) * math.cos((timer-102) / 25) + Arena.width/2),(((60)) * math.sin((timer-102) / 25) - Arena.height/2))
  91. bullet3.SetVar('Type', 1)
  92. table.insert(bullets, bullet3)
  93. local bullet4 = CreateProjectile('pixel', (-(60) * math.cos((timer-23) / 25) - Arena.width/2),((-(60)) * math.sin((timer-23) / 25) - Arena.height/2))
  94. bullet4.SetVar('Type', 1)
  95. table.insert(bullets, bullet4)
  96. elseif timer == 143 then
  97. Corner1 = CreateProjectile('CircleQ', Arena.width/2-30, -Arena.height/2+30)
  98. Corner1.sprite.xscale = 2
  99. Corner1.sprite.yscale = 2
  100. Corner2 = CreateProjectile('CircleQ', -Arena.width/2+30, Arena.height/2-30)
  101. Corner2.sprite.xscale = 2
  102. Corner2.sprite.yscale = 2
  103. Corner2.sprite.rotation = 180
  104. Corner3 = CreateProjectile('CircleQ', -Arena.width/2+30, -Arena.height/2+30)
  105. Corner3.sprite.xscale = 2
  106. Corner3.sprite.yscale = 2
  107. Corner3.sprite.rotation = -90
  108. Corner4 = CreateProjectile('CircleQ', Arena.width/2-30, Arena.height/2-30)
  109. Corner4.sprite.xscale = 2
  110. Corner4.sprite.yscale = 2
  111. Corner4.sprite.rotation = 90
  112. Corners = {Corner1, Corner2, Corner3, Corner4}
  113. elseif timer > 143 and timer < 2000 then
  114. if (timer)%60 == 0 and timer < 1000 then
  115. D = (math.random()*8)
  116. if D > 0 and D < 1 then
  117. local Bone = CreateProjectile('bone', Arena.width/2+50, 0)
  118. table.insert(bones, Bone)
  119. Bone.SetVar("Move", 1)
  120. Bone.SetVar("Type", 1)
  121. Bone.ppcollision = true
  122. elseif D > 1 and D < 2 then
  123. local Bone = CreateProjectile('bone', -Arena.width/2-50, 0)
  124. table.insert(bones, Bone)
  125. Bone.SetVar("Move", 2)
  126. Bone.SetVar("Type", 1)
  127. Bone.ppcollision = true
  128. elseif D > 2 and D < 3 then
  129. local Bone = CreateProjectile('bone', 0, Arena.height/2+50)
  130. Bone.sprite.rotation = 90
  131. table.insert(bones, Bone)
  132. Bone.SetVar("Move", 3)
  133. Bone.SetVar("Type", 1)
  134. Bone.ppcollision = true
  135. elseif D > 3 and D < 4 then
  136. local Bone = CreateProjectile('bone', 0, -Arena.height/2-50)
  137. Bone.sprite.rotation = 90
  138. table.insert(bones, Bone)
  139. Bone.SetVar("Move", 4)
  140. Bone.SetVar("Type", 1)
  141. Bone.ppcollision = true
  142. elseif D > 4 and D < 5 then
  143. local Bone = CreateProjectile('bone', -Arena.width/2-50, -Arena.height/2-50)
  144. Bone.sprite.rotation = 45
  145. table.insert(bones, Bone)
  146. Bone.SetVar("Move", 5)
  147. Bone.SetVar("Type", 1)
  148. Bone.ppcollision = true
  149. elseif D > 5 and D < 6 then
  150. local Bone = CreateProjectile('bone', -Arena.width/2-50, Arena.height/2+50)
  151. Bone.sprite.rotation = -45
  152. table.insert(bones, Bone)
  153. Bone.SetVar("Move", 6)
  154. Bone.SetVar("Type", 1)
  155. Bone.ppcollision = true
  156. elseif D > 6 and D < 7 then
  157. local Bone = CreateProjectile('bone', Arena.width/2+50, -Arena.height/2-50)
  158. Bone.sprite.rotation = -45
  159. table.insert(bones, Bone)
  160. Bone.SetVar("Move", 7)
  161. Bone.SetVar("Type", 1)
  162. Bone.ppcollision = true
  163. elseif D > 7 and D < 8 then
  164. local Bone = CreateProjectile('bone', Arena.width/2+50, Arena.height/2+50)
  165. Bone.sprite.rotation = 45
  166. table.insert(bones, Bone)
  167. Bone.SetVar("Move", 8)
  168. Bone.SetVar("Type", 1)
  169. Bone.ppcollision = true
  170. end
  171. end
  172. for i=1,#bones do
  173. bullet = bones[i]
  174. if bullet.GetVar("Move") == 1 then
  175. bullet.MoveTo(bullet.x - 1, bullet.y)
  176. elseif bullet.GetVar("Move") == 2 then
  177. bullet.MoveTo(bullet.x + 1, bullet.y)
  178. elseif bullet.GetVar("Move") == 3 then
  179. bullet.MoveTo(bullet.x, bullet.y - 1)
  180. elseif bullet.GetVar("Move") == 4 then
  181. bullet.MoveTo(bullet.x, bullet.y + 1)
  182. elseif bullet.GetVar("Move") == 5 then
  183. bullet.MoveTo(bullet.x + 1, bullet.y + 1)
  184. elseif bullet.GetVar("Move") == 6 then
  185. bullet.MoveTo(bullet.x + 1, bullet.y - 1)
  186. elseif bullet.GetVar("Move") == 7 then
  187. bullet.MoveTo(bullet.x - 1, bullet.y + 1)
  188. elseif bullet.GetVar("Move") == 8 then
  189. bullet.MoveTo(bullet.x - 1, bullet.y - 1)
  190. end
  191. end
  192. if timer == 1000 then
  193. a = CreateProjectile('Arrow05',-200,200)
  194. b = CreateProjectile('Arrow05',200,200)
  195. a.sprite.xscale = 2
  196. a.sprite.yscale = 2
  197. b.sprite.xscale = 2
  198. b.sprite.yscale = 2
  199. elseif timer > 1000 then
  200. if (timer)%80 == 0 and timer < 1950 then
  201. D = (math.random()*8)
  202. if D > 0 and D < 1 then
  203. local Bone = CreateProjectile('bone', Arena.width/2+50, 0)
  204. table.insert(bones, Bone)
  205. Bone.SetVar("Move", 1)
  206. Bone.ppcollision = true
  207. local O_Or_Not = math.random()*2
  208. if O_Or_Not > 0 and O_Or_Not <= 1 then
  209. Bone.SetVar("Type", 2)
  210. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  211. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  212. Bone.SetVar("Type", 3)
  213. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  214. end
  215. elseif D > 1 and D < 2 then
  216. local Bone = CreateProjectile('bone', -Arena.width/2-50, 0)
  217. table.insert(bones, Bone)
  218. Bone.SetVar("Move", 2)
  219. Bone.ppcollision = true
  220. local O_Or_Not = math.random()*2
  221. if O_Or_Not > 0 and O_Or_Not <= 1 then
  222. Bone.SetVar("Type", 2)
  223. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  224. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  225. Bone.SetVar("Type", 3)
  226. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  227. end
  228. elseif D > 2 and D < 3 then
  229. local Bone = CreateProjectile('bone', 0, Arena.height/2+50)
  230. Bone.sprite.rotation = 90
  231. table.insert(bones, Bone)
  232. Bone.SetVar("Move", 3)
  233. Bone.ppcollision = true
  234. local O_Or_Not = math.random()*2
  235. if O_Or_Not > 0 and O_Or_Not <= 1 then
  236. Bone.SetVar("Type", 2)
  237. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  238. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  239. Bone.SetVar("Type", 3)
  240. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  241. end
  242. elseif D > 3 and D < 4 then
  243. local Bone = CreateProjectile('bone', 0, -Arena.height/2-50)
  244. Bone.sprite.rotation = 90
  245. table.insert(bones, Bone)
  246. Bone.SetVar("Move", 4)
  247. Bone.ppcollision = true
  248. local O_Or_Not = math.random()*2
  249. if O_Or_Not > 0 and O_Or_Not <= 1 then
  250. Bone.SetVar("Type", 2)
  251. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  252. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  253. Bone.SetVar("Type", 3)
  254. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  255. end
  256. elseif D > 4 and D < 5 then
  257. local Bone = CreateProjectile('bone', -Arena.width/2-50, -Arena.height/2-50)
  258. Bone.sprite.rotation = 45
  259. table.insert(bones, Bone)
  260. Bone.SetVar("Move", 5)
  261. Bone.ppcollision = true
  262. local O_Or_Not = math.random()*2
  263. if O_Or_Not > 0 and O_Or_Not <= 1 then
  264. Bone.SetVar("Type", 2)
  265. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  266. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  267. Bone.SetVar("Type", 3)
  268. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  269. end
  270. elseif D > 5 and D < 6 then
  271. local Bone = CreateProjectile('bone', -Arena.width/2-50, Arena.height/2+50)
  272. Bone.sprite.rotation = -45
  273. table.insert(bones, Bone)
  274. Bone.SetVar("Move", 6)
  275. Bone.ppcollision = true
  276. local O_Or_Not = math.random()*2
  277. if O_Or_Not > 0 and O_Or_Not <= 1 then
  278. Bone.SetVar("Type", 2)
  279. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  280. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  281. Bone.SetVar("Type", 3)
  282. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  283. end
  284. elseif D > 6 and D < 7 then
  285. local Bone = CreateProjectile('bone', Arena.width/2+50, -Arena.height/2-50)
  286. Bone.sprite.rotation = -45
  287. table.insert(bones, Bone)
  288. Bone.SetVar("Move", 7)
  289. Bone.ppcollision = true
  290. local O_Or_Not = math.random()*2
  291. if O_Or_Not > 0 and O_Or_Not <= 1 then
  292. Bone.SetVar("Type", 2)
  293. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  294. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  295. Bone.SetVar("Type", 3)
  296. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  297. end
  298. elseif D > 7 and D < 8 then
  299. local Bone = CreateProjectile('bone', Arena.width/2+50, Arena.height/2+50)
  300. Bone.sprite.rotation = 45
  301. table.insert(bones, Bone)
  302. Bone.SetVar("Move", 8)
  303. Bone.ppcollision = true
  304. local O_Or_Not = math.random()*2
  305. if O_Or_Not > 0 and O_Or_Not <= 1 then
  306. Bone.SetVar("Type", 2)
  307. Bone.sprite.color = { 1.00, 0.65, 0.00 }
  308. elseif O_Or_Not > 1 and O_Or_Not <= 2 then
  309. Bone.SetVar("Type", 3)
  310. Bone.sprite.color = { 0.02, 0.37, 0.97 }
  311. end
  312. end
  313. end
  314. for i=1,#bones2 do
  315. bullet = bones2[i]
  316. if bullet.GetVar("Move") == 1 then
  317. bullet.MoveTo(bullet.x - 1, bullet.y)
  318. elseif bullet.GetVar("Move") == 2 then
  319. bullet.MoveTo(bullet.x + 1, bullet.y)
  320. elseif bullet.GetVar("Move") == 3 then
  321. bullet.MoveTo(bullet.x, bullet.y - 1)
  322. elseif bullet.GetVar("Move") == 4 then
  323. bullet.MoveTo(bullet.x, bullet.y + 1)
  324. elseif bullet.GetVar("Move") == 5 then
  325. bullet.MoveTo(bullet.x + 1, bullet.y + 1)
  326. elseif bullet.GetVar("Move") == 6 then
  327. bullet.MoveTo(bullet.x + 1, bullet.y - 1)
  328. elseif bullet.GetVar("Move") == 7 then
  329. bullet.MoveTo(bullet.x - 1, bullet.y + 1)
  330. elseif bullet.GetVar("Move") == 8 then
  331. bullet.MoveTo(bullet.x - 1, bullet.y - 1)
  332. end
  333. end
  334. if (timer+10)%100 == 0 and timer < 1800 and timer > 1050 then
  335. local bullet = CreateProjectile('bulletA', a.x, a.y)
  336. bullet.SetVar("btimer",0)
  337. bullet.SetVar("RL",(a.x-Player.x))
  338. bullet.SetVar("UD",(a.y-Player.y))
  339. bullet.SetVar("Creator",a)
  340. Audio.PlaySound("00002a24")
  341. table.insert(bullets2, bullet)
  342. end
  343. if (timer+10)%100 == 0 and timer < 1800 and timer > 1050 then
  344. local bullet = CreateProjectile('bulletA', b.x, b.y)
  345. bullet.SetVar("btimer",0)
  346. bullet.SetVar("RL",(b.x-Player.x))
  347. bullet.SetVar("UD",(b.y-Player.y))
  348. bullet.SetVar("Creator",b)
  349. table.insert(bullets2, bullet)
  350. end
  351. if timer > 1800 then
  352. a.sprite.alpha = 10/(timer-1800)
  353. b.sprite.alpha = 10/(timer-1800)
  354. if a.sprite.alpha < 0.01 then
  355. a.sprite.alpha = 0
  356. b.sprite.alpha = 0
  357. end
  358. end
  359. a.sprite.rotation = -70*(math.atan((b.x+Player.x)/(Player.y-b.y)))-100
  360. b.sprite.rotation = -70*(math.atan((b.x-Player.x)/(b.y-Player.y)))-80
  361. for i=1,#bullets2 do
  362. local bullet = bullets2[i]
  363. bullet.SetVar("Type", 1)
  364. local UD = bullet.GetVar("UD")
  365. local RL = bullet.GetVar("RL")
  366. local Creator = bullet.GetVar("Creator")
  367. if Creator.x > Player.x then
  368. X = -1
  369. elseif Creator.x < Player.x then
  370. X = 1
  371. end
  372. if Creator.y > Player.y then
  373. Y = 1
  374. elseif Creator.y < Player.y then
  375. Y = -1
  376. end
  377. bullet.SetVar("btimer",(bullet.GetVar("btimer")+1))
  378. bullet.MoveTo(((Creator.x)+((bullet.GetVar("btimer")*X))),((b.y)+((bullet.GetVar("btimer"))*((UD/RL)*Y*X)))/1)
  379. bullet.sprite.rotation = timer
  380. bullet.sprite.xscale = 1.6
  381. bullet.sprite.yscale = 1.6
  382. end
  383. end
  384. elseif timer > 2000 and timer < 2680 then
  385. for i=1,#bones do
  386. bullet = bones[i]
  387. if bullet.isactive == true then
  388. bullet.remove()
  389. end
  390. end
  391. for i=1,#bullets do
  392. bullet = bullets[i]
  393. if bullet.isactive == true then
  394. bullet.remove()
  395. end
  396. end
  397. for i=1,#bullets2 do
  398. bullet = bullets2[i]
  399. if bullet.isactive == true then
  400. bullet.remove()
  401. end
  402. end
  403. for i=1,#Corners do
  404. bullet = Corners[i]
  405. if bullet.isactive == true then
  406. bullet.remove()
  407. end
  408. end
  409. if a.isactive == true then
  410. Arena.ResizeImmediate(16, 16)
  411. a.remove()
  412. end
  413. if b.isactive == true then
  414. Arena.ResizeImmediate(16, 16)
  415. b.remove()
  416. end
  417. if (timer)%120 == 0 and timer >= 20 and timer <= 2600 then
  418. R1 = math.random()*2
  419. R2 = math.random()*2
  420. R3 = math.random()*4
  421. if R1 > 0 and R1 <= 1 then
  422. Arena.ResizeImmediate(52, 52)
  423. Player.MoveTo(0,0,false)
  424. local bullet = CreateProjectile('Knife_Left', 100, 0)
  425. bullet.SetVar("Move", 1)
  426. table.insert(bullets3, bullet)
  427. Audio.PlaySound("000029a2")
  428. elseif R1 > 1 and R1 <= 2 then
  429. Arena.ResizeImmediate(52, 52)
  430. Player.MoveTo(0,0,false)
  431. local bullet = CreateProjectile('Knife_Right', -100, 0)
  432. bullet.SetVar("Move", 3)
  433. table.insert(bullets3, bullet)
  434. Audio.PlaySound("000029a2")
  435. end
  436. if R2 > 0 and R2 <= 1 then
  437. Arena.ResizeImmediate(52, 52)
  438. Player.MoveTo(0,0,false)
  439. local bullet = CreateProjectile('Knife_Down', 0, 100)
  440. bullet.SetVar("Move", 2)
  441. table.insert(bullets3, bullet)
  442. elseif R2 > 1 and R2 <= 2 then
  443. Arena.ResizeImmediate(52, 52)
  444. Player.MoveTo(0,0,false)
  445. local bullet = CreateProjectile('Knife_Up', 0, -100)
  446. bullet.SetVar("Move", 4)
  447. table.insert(bullets3, bullet)
  448. end
  449. if R3 > 0 and R3 <= 1 then
  450. local bullet = CreateProjectile('Knife_Up', 100, 100)
  451. bullet.sprite.rotation = 135
  452. bullet.SetVar("Move", 5)
  453. table.insert(bullets3, bullet)
  454. elseif R3 > 1 and R3 <= 2 then
  455. local bullet = CreateProjectile('Knife_Up', 100, -100)
  456. bullet.sprite.rotation = 45
  457. bullet.SetVar("Move", 6)
  458. table.insert(bullets3, bullet)
  459. elseif R3 > 2 and R3 <= 3 then
  460. local bullet = CreateProjectile('Knife_Up', -100, 100)
  461. bullet.sprite.rotation = -135
  462. bullet.SetVar("Move", 7)
  463. table.insert(bullets3, bullet)
  464. elseif R3 > 3 and R3 <= 4 then
  465. local bullet = CreateProjectile('Knife_Up', -100, -100)
  466. bullet.sprite.rotation = -45
  467. bullet.SetVar("Move", 8)
  468. table.insert(bullets3, bullet)
  469. end
  470. end
  471. for i=1,#bullets3 do
  472. bullet = bullets3[i]
  473. bullet.SetVar("Type", 1)
  474. if bullet.GetVar("Move") == 1 then
  475. bullet.MoveTo(bullet.x-1.5, bullet.y)
  476. elseif bullet.GetVar("Move") == 2 then
  477. bullet.MoveTo(bullet.x, bullet.y-1.5)
  478. elseif bullet.GetVar("Move") == 3 then
  479. bullet.MoveTo(bullet.x+1.5, bullet.y)
  480. elseif bullet.GetVar("Move") == 4 then
  481. bullet.MoveTo(bullet.x, bullet.y+1.5)
  482. elseif bullet.GetVar("Move") == 5 then
  483. bullet.MoveTo(bullet.x-1.5, bullet.y-1.5)
  484. elseif bullet.GetVar("Move") == 6 then
  485. bullet.MoveTo(bullet.x-1.5, bullet.y+1.5)
  486. elseif bullet.GetVar("Move") == 7 then
  487. bullet.MoveTo(bullet.x+1.5, bullet.y-1.5)
  488. elseif bullet.GetVar("Move") == 8 then
  489. bullet.MoveTo(bullet.x+1.5, bullet.y+1.5)
  490. end
  491. end
  492. elseif timer > 2680 then
  493. Arena.Resize(300, 40)
  494. for i=1,#bullets3 do
  495. bullet = bullets3[i]
  496. if bullet.isactive == true then
  497. bullet.remove()
  498. end
  499. end
  500. if timer == 2800 then
  501. XCountDown1 = 0
  502. YCountDown1 = 0
  503. Bullet1 = CreateProjectile('bulletA',150,0)
  504. XMove1 = (1.65*math.random()) + 0.7
  505. YMove1 = (1.2*math.random()) + 0.7
  506. Bullet1.SetVar("Type", 1)
  507.  
  508. XCountDown2 = 0
  509. YCountDown2 = 0
  510. Bullet2 = CreateProjectile('bulletA',-150,0)
  511. XMove2 = (-1.65*math.random()) - 0.7
  512. YMove2 = (-1.2*math.random()) - 0.7
  513. Bullet2.SetVar("Type", 1)
  514. elseif timer > 2800 and timer < 5000 then
  515. Bullet1.MoveTo((Bullet1.x + XMove1), (Bullet1.y + YMove1))
  516. if ((-Arena.currentwidth) / 2 > Bullet1.x or Arena.currentwidth / 2 < Bullet1.x) and XCountDown1 == 0 then
  517. XMove1 = XMove1 * (-1)
  518. XCountDown1 = 10
  519. end
  520. if ((-Arena.currentheight ) / 2 > Bullet1.y or Arena.currentheight / 2 < Bullet1.y) and YCountDown1 == 0 then
  521. YMove1 = YMove1 * (-1)
  522. YCountDown1 = 10
  523. end
  524. if XCountDown1 > 0 then
  525. XCountDown1 = XCountDown1 - 1
  526. end
  527. if YCountDown1 > 0 then
  528. YCountDown1 = YCountDown1 - 1
  529. end
  530. Bullet2.MoveTo((Bullet2.x + XMove2), (Bullet2.y + YMove2))
  531. if ((-Arena.currentwidth) / 2 > Bullet2.x or Arena.currentwidth / 2 < Bullet2.x) and XCountDown2 == 0 then
  532. XMove2 = XMove2 * (-1)
  533. XCountDown2 = 10
  534. end
  535. if ((-Arena.currentheight ) / 2 > Bullet2.y or Arena.currentheight / 2 < Bullet2.y) and YCountDown2 == 0 then
  536. YMove2 = YMove2 * (-1)
  537. YCountDown2 = 10
  538. end
  539. if XCountDown2 > 0 then
  540. XCountDown2 = XCountDown2 - 1
  541. end
  542. if YCountDown2 > 0 then
  543. YCountDown2 = YCountDown2 - 1
  544. end
  545. if timer >= 3950 then
  546. Bullet3.MoveTo((Bullet3.x + XMove3), (Bullet3.y + YMove3))
  547. if ((-Arena.currentwidth) / 2 > Bullet3.x or Arena.currentwidth / 2 < Bullet3.x) and XCountDown3 == 0 then
  548. XMove3 = XMove3 * (-1)
  549. XCountDown3 = 10
  550. end
  551. if ((-Arena.currentheight ) / 2 > Bullet3.y or Arena.currentheight / 2 < Bullet3.y) and YCountDown3 == 0 then
  552. YMove3 = YMove3 * (-1)
  553. YCountDown3 = 10
  554. end
  555. if XCountDown3 > 0 then
  556. XCountDown3 = XCountDown3 - 1
  557. end
  558. if YCountDown3 > 0 then
  559. YCountDown3 = YCountDown3 - 1
  560. end
  561. Bullet4.MoveTo((Bullet4.x + XMove4), (Bullet4.y + YMove4))
  562. if ((-Arena.currentwidth) / 2 > Bullet4.x or Arena.currentwidth / 2 < Bullet4.x) and XCountDown4 == 0 then
  563. XMove4 = XMove4 * (-1)
  564. XCountDown4 = 10
  565. end
  566. if ((-Arena.currentheight ) / 2 > Bullet4.y or Arena.currentheight / 2 < Bullet4.y) and YCountDown4 == 0 then
  567. YMove4 = YMove4 * (-1)
  568. YCountDown4 = 10
  569. end
  570. if XCountDown4 > 0 then
  571. XCountDown4 = XCountDown4 - 1
  572. end
  573. if YCountDown4 > 0 then
  574. YCountDown4 = YCountDown4 - 1
  575. end
  576. end
  577. if timer == 3000 then
  578. Blaster = CreateProjectile('Blank', 0, 400)
  579. Blaster.sprite.rotation = -90
  580. pole = CreateProjectile('Blank',Blaster.x,Blaster.y+240)
  581. Blaster.sprite.SendToTop()
  582. table.insert(Blasters, Blaster)
  583. table.insert(Poles, pole)
  584. end
  585. if timer > 3000 and timer < 3900 then
  586. if (timer-60)%110 == 0 then
  587. Blaster = CreateProjectile('Blaster', 0, 400)
  588. Blaster.sprite.rotation = -90
  589. pole = CreateProjectile('Pole1',Blaster.x,Blaster.y+240)
  590. Blaster.sprite.SendToTop()
  591. table.insert(Blasters, Blaster)
  592. table.insert(Poles, pole)
  593. Audio.PlaySound("00002a2e")
  594. end
  595. if pole.isactive then
  596. pole.MoveTo(Blaster.x,Blaster.y+240)
  597. end
  598. if Blaster.y >= 200 then
  599. Blaster.MoveTo(Player.x,Blaster.y-8)
  600. end
  601. if Blaster.y <= 200 then
  602. if timer%110 == 0 then
  603. Beam = CreateProjectile('FastBeam', Blaster.x, Blaster.y-28)
  604. table.insert(Beams, Beam)
  605. Audio.PlaySound("00002a30")
  606. end
  607. end
  608. if timer >= 3110 then
  609. if Beam.isactive then
  610. X = Beam.x
  611. Y = Beam.y - 24
  612. Beam = CreateProjectile('FastBeam', X, Y)
  613. Beam.sprite.rotation = 90
  614. table.insert(Beams, Beam)
  615. end
  616. end
  617. for i=1,#Poles do
  618. local bullet = Poles[i]
  619. if bullet ~= pole and bullet.y <= 640 then
  620. bullet.MoveTo(bullet.x,bullet.y+8)
  621. elseif bullet ~= pole and bullet.isactive == true then
  622. bullet.remove()
  623. end
  624. end
  625. for i=1,#Blasters do
  626. local bullet = Blasters[i]
  627. if bullet ~= Blaster and bullet.y <= 400 then
  628. bullet.MoveTo(bullet.x,bullet.y+8)
  629. elseif bullet ~= Blaster and bullet.isactive == true then
  630. bullet.remove()
  631. end
  632. end
  633. for i=1,#Beams do
  634. local bullet = Beams[i]
  635. bullet.SetVar("Type", 4)
  636. if bullet.isactive then
  637. bullet.MoveTo(bullet.x,bullet.y-8)
  638. if bullet.y <= -350 then
  639. bullet.remove()
  640. end
  641. end
  642. end
  643. elseif timer == 3900 then
  644. Warning = CreateProjectile("WarningBoxRed3",0,131)
  645. Warn1 = CreateProjectile("WarningRed",69,131)
  646. Warn2 = CreateProjectile("WarningRed",-69,131)
  647. Ex = CreateProjectile("!",0,131)
  648. elseif timer >= 3900 and timer < 5000 then
  649. Arena.Resize(300, 300)
  650. for i=1,#Blasters do
  651. bullet = Blasters[i]
  652. if bullet.isactive == true then
  653. bullet.remove()
  654. end
  655. end
  656. for i=1,#Poles do
  657. bullet = Poles[i]
  658. if bullet.isactive == true then
  659. bullet.remove()
  660. end
  661. end
  662. if timer <= 3948 then
  663. if Flash == 1 then
  664. Warning.sprite.Set("WarningBoxRed3")
  665. Ex.sprite.Set("!")
  666. Warn1.sprite.Set("WarningRed")
  667. Warn2.sprite.Set("WarningRed")
  668. Audio.PlaySound("alarm")
  669. elseif Flash == -1 then
  670. Warning.sprite.Set("WarningBoxYellow3")
  671. Ex.sprite.Set("!1")
  672. Warn1.sprite.Set("WarningYellow")
  673. Warn2.sprite.Set("WarningYellow")
  674. end
  675. elseif timer == 3949 then
  676. if Warning.isactive then
  677. Warning.remove()
  678. end
  679. Bullet3 = CreateProjectile("bulletA",Warn1.x,Warn1.y)
  680. Warn1.remove()
  681. XCountDown3 = 0
  682. YCountDown3 = 0
  683. XMove3 = (-1.5*math.random()) - 0.6
  684. YMove3 = (-1.5*math.random()) - 0.6
  685. Bullet3.SetVar("Type", 1)
  686.  
  687. Bullet4 = CreateProjectile("bulletA",Warn2.x,Warn2.y)
  688. Warn2.remove()
  689. XCountDown4 = 0
  690. YCountDown4 = 0
  691. XMove4 = (2.8*math.random()) + 1
  692. YMove4 = (-2.8*math.random()) - 1
  693. Bullet4.SetVar("Type", 1)
  694. for i=0,21 do
  695. local bullet = CreateProjectile('bulletB', 0, 0)
  696. bullet.SetVar('angle', 90)
  697. bullet.SetVar('offset', i)
  698. bullet.SetVar("Type", 1)
  699. table.insert(bullets4, bullet)
  700. bullet = CreateProjectile('bulletB', 0, 0)
  701. bullet.SetVar('angle', 90)
  702. bullet.SetVar('offset', -i)
  703. bullet.SetVar("Type", 1)
  704. table.insert(bullets4, bullet)
  705. end
  706. elseif timer >= 3950 then
  707. for i=1,#bullets4 do
  708. local bullet = bullets4[i]
  709. local angle = bullet.GetVar('angle')
  710. local offset = bullet.GetVar('offset')
  711. local accel = bullet.GetVar('accel')
  712. local ydiff = bullet.y-(0-offset*10)
  713. if (timer-3950)<20 and ydiff!=0 then
  714. bullet.MoveTo(bullet.x,bullet.y-ydiff/10)
  715. elseif (timer-3950)>=20 then
  716. bullet.MoveTo(math.cos(angle)*offset*10,math.sin(angle)*offset*10)
  717. bullet.SetVar('angle',angle-0.025)
  718. end
  719. end
  720. Bullet3.MoveTo((Bullet3.x + XMove3), (Bullet3.y + YMove3))
  721. if ((-Arena.currentwidth) / 2 > Bullet3.x or Arena.currentwidth / 2 < Bullet3.x) and XCountDown3 == 0 then
  722. XMove3 = XMove3 * (-1)
  723. XCountDown3 = 10
  724. end
  725. if ((-Arena.currentheight ) / 2 > Bullet3.y or Arena.currentheight / 2 < Bullet3.y) and YCountDown3 == 0 then
  726. YMove3 = YMove3 * (-1)
  727. YCountDown1 = 10
  728. end
  729. if XCountDown3 > 0 then
  730. XCountDown3 = XCountDown3 - 1
  731. end
  732. if YCountDown3 > 0 then
  733. YCountDown3 = YCountDown3 - 1
  734. end
  735.  
  736. Bullet4.MoveTo((Bullet4.x + XMove4), (Bullet4.y + YMove4))
  737. if ((-Arena.currentwidth) / 2 > Bullet4.x or Arena.currentwidth / 2 < Bullet4.x) and XCountDown4 == 0 then
  738. XMove4 = XMove4 * (-1)
  739. XCountDown4 = 10
  740. end
  741. if ((-Arena.currentheight ) / 2 > Bullet4.y or Arena.currentheight / 2 < Bullet4.y) and YCountDown4 == 0 then
  742. YMove4 = YMove4 * (-1)
  743. YCountDown4 = 10
  744. end
  745. if XCountDown4 > 0 then
  746. XCountDown4 = XCountDown4 - 1
  747. end
  748. if YCountDown4 > 0 then
  749. YCountDown4 = YCountDown4 - 1
  750. end
  751. end
  752. end
  753. elseif timer == 5000 then
  754. Knife = CreateProjectile('Knife_right',(80 * math.cos((16) / 15))+ 200,(-80 * math.sin((18) / 14) + 100))
  755. Knife.sprite.rotation = 0
  756. elseif timer > 5000 and timer < 5900 then
  757. Arena.Resize(155, 130)
  758. if Bullet1.isactive then
  759. Bullet1.remove()
  760. end
  761. if Bullet2.isactive then
  762. Bullet2.remove()
  763. end
  764. if Bullet3.isactive then
  765. Bullet3.remove()
  766. end
  767. if Bullet4.isactive then
  768. Bullet4.remove()
  769. end
  770. for i=1,#bullets4 do
  771. bullet = bullets4[i]
  772. if bullet.isactive == true then
  773. bullet.remove()
  774. end
  775. end
  776. if (timer+20)%30 == 0 then
  777. local posx = 300
  778. local posy = 50
  779. local bullet = CreateProjectile('Spike', posx, posy)
  780. bullet.SetVar('velx', 0)
  781. bullet.SetVar('vely', 70 - 130*math.random())
  782. table.insert(Rbullets, bullet)
  783. end
  784.  
  785. for i=1,#Rbullets do
  786. local bullet = Rbullets[i]
  787. local vely = bullet.GetVar('vely')
  788. local newposx = bullet.x - 2
  789. bullet.MoveTo(newposx, vely)
  790. bullet.SetVar('vely', vely)
  791. bullet.SetVar("Type",1)
  792. end
  793.  
  794. if (timer+20)%30 == 0 then -- 20 is how many frames it takes to create another bullet
  795. local posx = 0
  796. local posy = -200
  797. local bullet = CreateProjectile('Spike_up', posx, posy)
  798. bullet.SetVar('vely', -140)
  799. bullet.SetVar('velx', 70 - 145*math.random())
  800. table.insert(Ubullets, bullet)
  801. Audio.PlaySound("000029a2")
  802. end
  803. for i=1,#Ubullets do
  804. local bullet = Ubullets[i]
  805. local vely = bullet.GetVar('vely')
  806. local velx = bullet.GetVar('velx')
  807. local newposy = bullet.y + 2
  808. bullet.MoveTo(velx, newposy)
  809. bullet.SetVar('newposy', vely)
  810. bullet.SetVar("Type",1)
  811. end
  812. timer2 = timer2 + 1
  813. if timer2 >= 251 then
  814. timer2 = 0
  815. end
  816. if timer2 > 30 and timer2 <= 50 then
  817. Knife.sprite.alpha = 1
  818. Knife.sprite.rotation = 180 - (timer2-30)
  819. Knife.MoveTo((80 * math.cos((timer2-90) / 15)) + 200,(-80 * math.sin((timer2-90) / 14)) + 100)
  820. local bullet = CreateProjectile('bulletB',(100 * math.cos((timer2-90) / 15)) + 200,(-100 * math.sin((timer2-90) / 14)) + 100)
  821. bullet.sprite.color = { 1.00, 0.00, 0.00 }
  822. table.insert(bullets, bullet)
  823. if timer2 == 35 then
  824. Audio.PlaySound("slice")
  825. end
  826. elseif timer2 >= 60 and timer2 <= 140 then
  827. Knife.sprite.alpha = 1
  828. for i=1,#bullets do
  829. local bullet = bullets[i]
  830. if bullet.isactive then
  831. bullet.SetVar("Type",4)
  832. bullet.MoveTo(bullet.x-8,bullet.y)
  833. end
  834. end
  835. if timer2 == 60 then
  836. Audio.PlaySound("000029a2")
  837. end
  838. elseif timer2 > 140 and timer2 <= 160 then
  839. Knife.sprite.rotation = 0 - (timer2-170)
  840. Knife.MoveTo((80 * math.cos((timer2-156) / 15)) - 200,(-80 * math.sin((timer2-158) / 14)) - 100)
  841. local bullet = CreateProjectile('bulletB',(100 * math.cos((timer2-156) / 15)) - 200,(-100 * math.sin((timer2-158) / 14) - 100))
  842. bullet.sprite.color = { 1.00, 0.00, 0.00 }
  843. table.insert(bullets2, bullet)
  844. if timer2 == 145 then
  845. Audio.PlaySound("slice")
  846. end
  847. elseif timer2 > 170 then
  848. for i=1,#bullets2 do
  849. local bullet = bullets2[i]
  850. if bullet.isactive then
  851. bullet.SetVar("Type",4)
  852. bullet.MoveTo(bullet.x+8,bullet.y)
  853. end
  854. end
  855. if timer2 == 60 then
  856. Audio.PlaySound("000029a2")
  857. end
  858. end
  859. elseif timer == 5900 then
  860. timer2 = 0
  861. for i=1,#bullets2 do
  862. local bullet = bullets2[i]
  863. if bullet.isactive == true then
  864. bullet.remove()
  865. end
  866. end
  867. for i=1,#Ubullets do
  868. local bullet = Ubullets[i]
  869. if bullet.isactive == true then
  870. bullet.remove()
  871. end
  872. end
  873. for i=1,#Rbullets do
  874. local bullet = Rbullets[i]
  875. if bullet.isactive == true then
  876. bullet.remove()
  877. end
  878. end
  879. if Knife.isactive then
  880. Knife.remove()
  881. end
  882. elseif timer > 5900 then
  883. timer2 = timer2 + 1
  884. Arena.Resize(30, 30)
  885. if timer2%2 == 0 and timer < 6065 and timer > 6000 then
  886. local bullet = CreateProjectile("bulletA",(200 * math.cos((timer2)/10)),(-200 * math.sin((timer2)/10)))
  887. bullet.SetVar("tim", timer2)
  888. table.insert(bullets5, bullet)
  889. end
  890. if timer > 6200 then
  891. for i=1,#bullets5 do
  892. local bullet = bullets5[i]
  893. timer3 = timer3 - 0.5
  894. local tim = bullet.GetVar("tim")
  895. bullet.MoveTo((timer3 * math.cos((tim)/10)),(-timer3 * math.sin((tim)/10)))
  896. end
  897. end
  898. if timer == 6201 then
  899. Audio.PlaySound("000029a2")
  900. end
  901. end
  902. end
  903. function OnHit(bullet)
  904. if bullet.isactive then
  905. if bullet.GetVar("Type") == 1 then
  906. Player.Hurt(3)
  907. elseif bullet.GetVar("Type") == 2 and not Player.isMoving then
  908. Player.Hurt(2)
  909. elseif bullet.GetVar("Type") == 3 and Player.isMoving then
  910. Player.Hurt(2)
  911. elseif bullet.GetVar("Type") == 4 then
  912. Player.Hurt(5)
  913. end
  914. end
  915. end
  916. if timer >= 6211 then
  917. SetGlobal("Y",0)
  918. SetGlobal("Finished",true)
  919. SetGlobal("Turn",26)
  920. if GetGlobal("attack") >= 20 then
  921. SetGlobal("Death",1)
  922. end
  923. if GetGlobal("attack") <= 1 then
  924. SetGlobal("Live",1)
  925. end
  926. EndWave()
  927. end
  928. end
Advertisement
Add Comment
Please, Sign In to add comment