Advertisement
Guest User

Untitled

a guest
Sep 5th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.02 KB | None | 0 0
  1. #define init
  2. global.gce = 0;
  3. if array_length_1d(instances_matching(CustomEnemy,"name","freakcont")) > 0{
  4. arena_create();
  5. }
  6. init_part2();
  7.  
  8. #macro mode_freak 0
  9. #macro mode_idpd 1
  10. #macro mode_palace 2
  11. #macro mode_sewer 3
  12.  
  13. #define init_part2
  14. // For some reason, defining multiple macros before init is causing the mod to not work
  15. // Therefore, this is necessary(?)
  16. global.namelist = ds_map_create();
  17. var nl = global.namelist;
  18. nl[? mode_freak] = "THUNDERDOME";
  19. nl[? mode_idpd] = "STING OPERATION";
  20. nl[? mode_palace] = "RADIOACTIVE REGALIA";
  21. nl[? mode_sewer] = "THE UNDERBELLY";
  22.  
  23. #define game_start
  24. wait 5;
  25. sound_stop_all();
  26. sound_loop(amb0);
  27. #define range
  28. if argument0 >= argument1 && argument0 <= argument2{
  29. return true;
  30. }else return false;
  31.  
  32. #define mutator_create
  33. with(instance_create(argument0,argument1,CustomObject)){
  34. var d = 0;
  35. muts = [];
  36. for(var i = 0;i<=28;i++){
  37. if !skill_get(i){
  38. muts[d] = i;
  39. d++;
  40. }
  41. }
  42. if array_length_1d(muts) = 0{
  43. muts[0] = mut_last_wish;
  44. }
  45. mut = muts[irandom_range(1,array_length_1d(muts)-1)];
  46. timer = 30;
  47. sprite_index = sprSkillIcon
  48. image_index = mut;
  49. image_speed = 0;
  50. z = 1;
  51. zspd = 20;
  52. on_step = script_ref_create(mutator_step);
  53. }
  54. #define mutator_step
  55. if abs(image_xscale) < 0.05{
  56. var d = 0;
  57. do{
  58. mut = muts[irandom_range(1,array_length_1d(muts)-1)];
  59. if skill_get(mut) = 0{
  60. break;
  61. }
  62. d ++;
  63. }until d >= 29;
  64. if d = 29 mut = mut_last_wish;
  65.  
  66. timer = 30;
  67. image_index = mut;
  68. }
  69. image_xscale = 0.75 * sin(current_frame/10);
  70. image_yscale = 0.75;
  71. if current_time mod 30 = 0{
  72. var wid = sprite_get_width(sprite_index) * image_xscale,hig = sprite_get_height(sprite_index) * image_yscale;
  73. with(instance_create(x + random_range(wid/-2,wid/2),y+random_range(hig/-2,hig/2),CaveSparkle)) depth = other.depth - choose(1,-1)
  74. }
  75. if z > 16 mask_index = mskNone
  76. else mask_index = sprSkillIcon;
  77. if z + zspd > 0{
  78. zspd -= 0.5;
  79. }else{
  80. z = 0;
  81. zspd *= -0.33;
  82. }
  83. z += zspd;
  84. y = ystart - z;
  85. with(Player){
  86. if place_meeting(x,y,other) && button_pressed(index,"pick"){
  87. skill_set(other.mut,1);
  88. sound_play(sndMutLastWish);
  89. var _mut = other.mut,_other = other;
  90. instance_create(x,y,RoguePickup);
  91. with(instances_matching_ne(CustomObject,"mut",undefined)){
  92. muts = [];
  93. var d = 0;
  94. for(var i = 1;i<=28;i++){
  95. if !skill_get(i){
  96. muts[d] = i;
  97. d++;
  98. }
  99. }
  100. if mut = _mut{
  101. with(instance_create(x,y,RecycleGland)){
  102. sprite_index = sprShieldDisappear;
  103. image_index = 2;
  104. }
  105. if array_length_1d(muts) > 0{
  106. mut = muts[irandom_range(1,array_length_1d(muts) - 1)]
  107. }else mut = mut_last_wish;
  108. image_index = mut;
  109. }
  110. if self = _other instance_delete(self);
  111. }
  112. }
  113. }
  114. #define deletestage
  115. with(Floor) instance_destroy();
  116. with(Wall) instance_destroy();
  117. with(Top) instance_destroy();
  118. with(TopSmall) instance_destroy();
  119. with(TopPot) instance_destroy();
  120. with(Bones) instance_destroy();
  121. with(Detail) instance_destroy();
  122. with(enemy){
  123. if object_index != CustomEnemy{
  124. instance_change(Wind,false);
  125. }else{
  126. if ("donotdelete" not in self)
  127. instance_destroy();
  128. }
  129. }
  130. with(BecomeNothing2) instance_change(Wind,false);
  131. with(prop) instance_change(Wind,false);
  132. with(Portal) instance_change(Wind,false);
  133. wait 1;
  134. with(IDPDSpawn) instance_destroy();
  135.  
  136. #define statue_dead
  137. with(instance_create(x,y,Explosion)){
  138. team = 2;
  139. }
  140. repeat(3){
  141. with(instance_create(x,y,BigRad)){
  142. speed = 3 + random(3);
  143. direction = random(360);
  144. }
  145. }
  146. repeat(12){
  147. with(instance_create(x,y,Rad)){
  148. speed = 3 + random(3);
  149. direction = random(360);
  150. }
  151. }
  152. if name = "slave"{
  153. switch(irandom(12)){
  154. case 0:
  155. case 1:
  156. case 2:
  157. case 3:
  158. campfire_show_message("INFINITE AMMO! USE IT WISELY...");
  159. with(Player) infammo = 30 * 7;
  160. break;
  161. case 4:
  162. case 5:
  163. case 6:
  164. campfire_show_message("RACING MIND! SWING LIKE A MADMAN!");
  165. with(instances_matching(CustomEnemy,"name","freakcont")) quickload = 30 * 7;
  166. break;
  167. case 7:
  168. case 8:
  169. campfire_show_message("A LIMITED TIME OFFER FROM THE GUN GOD!");
  170. with(instance_create(10016,10016 + 32,WepPickup)){
  171. repeat(32){
  172. with(instance_create(x,y,Dust)){
  173. direction = random(360);
  174. speed = 3 + random(2);
  175. }
  176. }
  177. wep = wep_golden_nuke_launcher;
  178. }
  179. break;
  180. case 9:
  181. case 10:
  182. campfire_show_message("INFINITE HEALTH! @qT@qI@qM@qE@q@qT@qO@q@qL@qE@qT@q@qL@qO@qO@qS@qE@q!@q!@q!")
  183. with(instances_matching(CustomEnemy,"name","freakcont")) infhp = 30 * 7;
  184. break;
  185. case 11:
  186. case 12:
  187. campfire_show_message("AN UNEXPECTED ALLY!")
  188. lilhunter_create();
  189. break;
  190. }
  191. with(instances_matching(CustomEnemy,"name","slave")) my_health = 250;
  192. }
  193.  
  194. #define lilhunter_create
  195. with(instance_create(10016,10016,CustomHitme)){
  196. name = "customhunter";
  197.  
  198. // Sprites
  199. spr_idle = sprLilHunterWalk;
  200. spr_walk = sprLilHunterWalk;
  201. spr_hurt = sprLilHunterHurt;
  202. spr_dead = sprLilHunterDead;
  203. spr_gunn = sprLilHunterGun2;
  204. sprite_index = spr_idle;
  205. friction = 0.40;
  206. image_speed = 0.40;
  207.  
  208. snd_woao = sndLilHunterLaunch;
  209. snd_land = sndLilHunterLand;
  210. snd_hurt = sndLilHunterHurt;
  211. snd_dead = sndLilHunterDeath;
  212.  
  213. // Max values
  214. maxspeed = 3;
  215. maxhealth = 100;
  216. maxrange = 200;
  217. minrange = 84;
  218.  
  219. // Enemy values
  220. my_health = maxhealth;
  221. gunangle = random(360);
  222. aimtarget = -1;
  223. team = 2;
  224. walk = 0;
  225. fly = 1;
  226. canfly = true;
  227. ded = 0;
  228. bounce = 0;
  229.  
  230. // Misc values
  231. right = 1;
  232. depth = -2;
  233.  
  234. // alrm0: walking
  235. // alrm1: aimtargeting
  236. // alrm2: firing
  237. alrm0 = 30;
  238. alrm1 = 120;
  239. alrm2 = 0;
  240.  
  241. z = 0;
  242. zspd = 0;
  243.  
  244. on_hurt = lilhunter_hurt;
  245. on_step = lilhunter_step;
  246. on_draw = lilhunter_draw;
  247.  
  248. return self;
  249. }
  250.  
  251. #define lilhunter_hurt
  252. sprite_index = spr_hurt;
  253. image_index = 0;
  254. sound_play(snd_hurt);
  255.  
  256. my_health -= argument0;
  257. motion_add(argument2,argument1);
  258.  
  259. if my_health <= 0 && ded = 0{
  260. sound_play(sndLilHunterBreak);
  261. ded = 1;
  262. speed = 4;
  263. }
  264. #define hunter_aimtarget
  265. // Edit this as you see fit to match the complexity of your enemy
  266. if !is_array(argument0){
  267. if instance_exists(argument0){
  268. return instance_nearest(x,y,argument0);
  269. }else return -4;
  270. }else{
  271. var dist = 10000,obj = -4;
  272. with(argument0){
  273. if point_distance(x,y,other.x,other.y) < dist{
  274. dist = point_distance(x,y,other.x,other.y);
  275. obj = self;
  276. }
  277. }
  278. return obj;
  279. }
  280.  
  281. #define lilhunter_step
  282. if !(ded){
  283. // Event 0: Used for walking here.
  284. if (alrm0 > 0){
  285. if z = 0 alrm0 -= current_time_scale;
  286. if alrm0 <= 0{
  287. if instance_exists(aimtarget){
  288. if distance_to_object(aimtarget) < maxrange{
  289. direction = point_direction(x,y,aimtarget.x,aimtarget.y) + random_range(-30,30);;
  290. }else{
  291. if random(10) < 1 + (4 * (my_health/maxhealth)) && z = 0{
  292. fly = 1;
  293. sound_play(snd_woao);
  294. }else direction = point_direction(x,y,aimtarget.x,aimtarget.y) + random_range(-30,30);
  295. }
  296. }else{
  297. direction = random(360);
  298. gunangle = direction;
  299. }
  300.  
  301. // Do these regardless of aimtarget-related variables
  302. walk = 15 + irandom(30);
  303. alrm0 = walk + 10 - irandom(12);
  304. }
  305. }
  306.  
  307. // Event 1: Used for aimtargeting and priming its weapon
  308. if (alrm1 > 0){
  309. if z = 0 alrm1 -= current_time_scale;
  310. if alrm1 <= 0{
  311. aimtarget = hunter_aimtarget(instances_matching_ne(enemy,"team",0));
  312. if instance_exists(aimtarget) && aimtarget != -4{
  313. // Shooting
  314. if random(2) < 1{
  315. gunangle = point_direction(x,y,aimtarget.x,aimtarget.y);
  316. instance_create(x,y,AssassinNotice);
  317. alrm2 = 10;
  318. alrm1 = -1;
  319. walk = 0;
  320. }
  321. }
  322. alrm1 = 10;
  323. }
  324. }
  325.  
  326. // Event 2: Firing the weapon
  327. if (alrm2 > 0){
  328. if z = 0 alrm2 -= current_time_scale;
  329. if alrm2 <= 0{
  330. if instance_exists(aimtarget) && aimtarget != -4{
  331. if distance_to_object(aimtarget) < minrange{
  332. repeat(8){
  333. with(instance_create(x,y,EnemyBullet1)){
  334. creator = other.id;
  335. team = other.team;
  336. speed = 8 + random(4);
  337. direction = other.gunangle;
  338. image_angle = direction;
  339. }
  340. }
  341. sound_play(sndLilHunterSniper);
  342. alrm2 += 8;
  343. }else{
  344. player_fire_ext(gunangle, wep_bouncer_shotgun,x,y,team,self);
  345. alrm2 += weapon_get_load(wep_bouncer_shotgun);
  346. }
  347. walk = 0;
  348. }else alrm1 = 30;
  349. }
  350. }
  351.  
  352. if (walk > 0){
  353. walk -= current_time_scale;
  354. speed += 1;
  355. }else{
  356. if speed > 0 speed *= 0.90
  357. else speed = 0;
  358. }
  359. speed = clamp(speed, 0, maxspeed);
  360.  
  361. // Animation handler
  362. if speed > 0.10 && sprite_index != spr_hurt
  363. sprite_index = spr_walk;
  364. if (image_index + image_speed >= image_number){
  365. if sprite_index = spr_hurt || sprite_index = spr_walk{
  366. if abs(speed) < 0.10 sprite_index = spr_idle;
  367. else sprite_index = spr_walk;
  368. }
  369. image_index = 0;
  370. }
  371.  
  372. if fly = 1{
  373. if zspd != 7{
  374. zspd = 7;
  375. sound_play(snd_woao);
  376. }
  377. if z >= 256 fly = -1;
  378. mask_index = mskNone;
  379. }else{
  380. if zspd != -7 && z != 0{
  381. mask_index = mskLilHunter;
  382. var i = irandom(instance_number(Floor));
  383. with(Floor){
  384. i --;
  385. if i <= 0{
  386. other.x = x + 16;
  387. other.y = y + 16;
  388. break;
  389. }
  390. }
  391. zspd = -7;
  392. }
  393. if z + zspd <= 0 && z != 0{
  394. zspd = 0;
  395. z = 0;
  396. fly = 0;
  397. sound_play(snd_land);
  398. for(var i = 0;i<=32;i++){
  399. with(instance_create(x,y,TrapFire)){
  400. direction = (360/32) * i;
  401. team = 2;
  402. speed = 3;
  403. sprite_index = sprFireLilHunter
  404. }
  405. }
  406. }
  407. }
  408. z += zspd;
  409. }else{
  410. sprite_index = spr_hurt;
  411. image_index = min(image_index,image_number - 1);
  412. speed = 8;
  413. direction += 5 * right;
  414. image_angle = direction - 90;
  415. instance_create(x,y,Smoke)
  416. if place_meeting(x,y,CustomEnemy) && image_index = image_number - 1{
  417. direction += 90 * right;
  418. image_index = 0;
  419. bounce ++;
  420. if bounce > 5{
  421. repeat(3){
  422. with(instance_create(x,y,Explosion)) team = 2;
  423. sound_play(snd_dead);
  424. with(instance_create(x,y,Corpse)) sprite_index = other.spr_dead;
  425. }
  426. instance_delete(self);
  427. }
  428. }
  429. }
  430. #define lilhunter_draw
  431. // Flips the sprite based on aim direction
  432. if (((gunangle+270) mod 360)>180) right = 1 else right = -1;
  433. var _flip = fly;
  434. if fly = 0 _flip = 1;
  435. // Draws sprites
  436. if gunangle < 180 draw_sprite_ext(spr_gunn,0,x,y-z,1,1*right,gunangle,image_blend,1);
  437. draw_sprite_ext(sprite_index,image_index,x,y-z - 4,right,1 * _flip,image_angle,image_blend,1);
  438. if gunangle >= 180 draw_sprite_ext(spr_gunn,0,x,y-z,1,1*right,gunangle,image_blend,1);
  439.  
  440. #define campfire_step
  441. with(instances_matching(PopoFreak,"kills",0)){
  442. kills = 1;
  443. }
  444. with(Player){
  445. if "wepinfo" not in self{
  446. wepinfo = [wep,bwep];
  447. timer_godblessing = -1;
  448. }
  449. if wep != wep_golden_nuke_launcher && ((race != "chicken" && my_health <= 0) || (race = "chicken" && bleed >= 120)){
  450. wepinfo = [wep,bwep,skill_get(mut_boiling_veins)];
  451. }
  452. if skill_get(mut_boiling_veins) && wep != wep_golden_nuke_launcher wepinfo[3] = 1
  453. else wepinfo[3] = 0;
  454. if other.quickload > 0 || wep = wep_golden_nuke_launcher{
  455. reload = min(reload,weapon_get_load(wep)/5);
  456. }
  457. if other.infhp > 0{
  458. nexthurt = current_frame + 5;
  459. my_health = max(my_health,1);
  460. }
  461. if wep = wep_golden_nuke_launcher{
  462. if timer_godblessing = -1{
  463. timer_godblessing = 30 * 15;
  464. canpick = false;
  465. bwep = 0;
  466. skill_set(mut_boiling_veins,1);
  467. sound_play(sndVenuz);
  468. }else{
  469. infammo = 2;
  470. timer_godblessing -= current_time_scale;
  471. if timer_godblessing <= 0{
  472. timer_godblessing = -1;
  473. canpick = true;
  474. wep = lastwep[0];
  475. bwep = lastwep[1];
  476. skill_set(mut_boiling_veins,wepinfo[3]);
  477. reload = weapon_get_load(wep);
  478. sound_play(sndMutant6Dead);
  479. repeat(32){
  480. with(instance_create(x,y,Dust)){
  481. direction = random(360);
  482. speed = 3 + random(2);
  483. }
  484. }
  485. }
  486. }
  487. }else{
  488. if timer_godblessing != -1{
  489. timer_godblessing = -1;
  490. canpick = true;
  491. wep = wepinfo[0];
  492. bwep = wepinfo[1];
  493. skill_set(mut_boiling_veins,wepinfo[3]);
  494. }
  495. }
  496. }
  497. if quickload > 0{
  498. quickload -= current_time_scale;
  499. }
  500. if infhp > 0{
  501. infhp -= current_time_scale;
  502. }
  503. for(var i = 0;i<=7;i++){
  504. if !instance_exists(slave[i]){
  505. timer_purchaseslaves -= current_time_scale;
  506. if !(active) || timer_purchaseslaves <= 0{
  507. slave[i] = instance_create(0,0,CustomEnemy)
  508. with(slave[i]){
  509. spr_idle = sprThroneStatue;
  510. spr_hurt = sprThroneStatue;
  511. spr_dead = sprThroneStatueDead;
  512. sprite_index = spr_idle;
  513. my_health = 250;
  514. size = 9999;
  515. candie = true;
  516. canfly = true;
  517. team = 0;
  518. name = "slave";
  519. on_death = script_ref_create(statue_dead);
  520. }
  521. timer_purchaseslaves = 30 * 30;
  522. }
  523. }else{
  524. with(slave[i]){
  525. var _mod = 0.75,dirmod = 0.75;
  526. x = other.x + lengthdir_x(84 * 2 * _mod,((360/8) * i) + ((current_frame/4) mod 360) * dirmod);
  527. y = other.y + lengthdir_y(64 * 2 * _mod,((360/8) * i) + ((current_frame/4) mod 360) * dirmod);
  528. }
  529. }
  530. }
  531. for(var i = 8;i<array_length_1d(slave);i++){
  532. if !instance_exists(slave[i]){
  533. if !(active){
  534. slave[i] = instance_create(0,0,CustomEnemy)
  535. with(slave[i]){
  536. spr_idle = sprThroneStatue;
  537. spr_hurt = sprThroneStatue;
  538. spr_dead = sprThroneStatueDead;
  539. sprite_index = spr_idle;
  540. my_health = 200;
  541. size = 9999;
  542. candie = true;
  543. canfly = true;
  544. team = 0;
  545. name = "slavewall";
  546. on_death = script_ref_create(statue_dead);
  547. }
  548. }
  549. }else{
  550. with(slave[i]){
  551. _mod = 1.5;
  552. dirmod = -4//-15;
  553. ii = i/(array_length_1d(other.slave)-8);
  554. x = other.x + lengthdir_x(72 * 2 * _mod,(360* ii) + (current_frame/4 mod 360) * dirmod);
  555. y = other.y + lengthdir_y(56 * 2 * _mod,(360* ii) + (current_frame/4 mod 360) * dirmod);
  556. }
  557. }
  558. }
  559. if my_health < maxhealth my_health = maxhealth;
  560. x = xstart + 16;
  561. y = ystart + 16;
  562. with(Floor){
  563. if sprite_index != sprFloor6 sprite_index = sprFloor0;
  564. }
  565. with(Player){
  566. candie = false;
  567. if "temparray" not in self{
  568. temparray = [spr_idle,spr_walk,spr_hurt,spr_dead]
  569. }
  570. if GameCont.skillpoints > 0{
  571. repeat(GameCont.skillpoints) mutator_create(x,y);
  572. GameCont.skillpoints = 0;
  573. }
  574. if my_health <= 0 && canwalk = true{
  575. if (skill_get(mut_strong_spirit) = false || (skill_get(mut_strong_spirit) = true && nexthurt <= current_frame)) && (race != "chicken" || race = "chicken" && bleed >= 120){
  576. spr_idle = spr_dead;
  577. spr_walk = spr_dead;
  578. spr_hurt = spr_dead;
  579. sprite_index = spr_dead;
  580. mask_index = mskNone;
  581. sound_play(snd_dead);
  582. lastwep = [wep,bwep];
  583. wep = 0;
  584. bwep = 0;
  585. canwalk = false;
  586. canspec = false;
  587. canaim = false;
  588. reload = 9999;
  589. can_shoot = false;
  590. image_index = 0;
  591. rogueammo = 1;
  592. if array_length_1d(instances_matching(Player,"canwalk",true)) = 0{
  593. sound_stop_all();
  594. with(PopoFreak){
  595. alarm0 = 0;
  596. alarm1 = 0;
  597. alarm2 = 0;
  598. alarm3 = 0;
  599. alarm4 = 0;
  600. }
  601. if(fork()){
  602. wait (sprite_get_number(spr_dead)-1) / 0.40;
  603. image_speed = 0;
  604. wait 90;
  605. while(other.fade < 1){
  606. other.fade += 0.1;
  607. wait 1;
  608. }
  609. with(WantRevivePopoFreak) instance_delete(self);
  610. with(IDPDSpawn) instance_delete(self);
  611. with(CustomHitme) instance_delete(self);
  612. with(FrogEgg) instance_delete(self);
  613. with(instances_matching_ne(enemy,"name","freakcont")) instance_delete(self);
  614. sound_stop_all();
  615. x = other.x;
  616. y = other.y + 64;
  617. other.mask_index = mskPlayer;
  618. other.sprite_index = sprCampfire;
  619. GameCont.level = 1;
  620. GameCont.rad = 0;
  621. with(WepPickup) instance_destroy();
  622. with(Pickup) instance_destroy();
  623. with(projectile) instance_delete(self);
  624. with(CustomObject) instance_delete(self);
  625. with(Corpse) instance_destroy();
  626. with(Scorch) instance_destroy();
  627. with(ScorchTop) instance_destroy();
  628. for(var i = 0;i<=28;i++){
  629. skill_set(i,0);
  630. }
  631. while(other.fade > 0){
  632. other.fade -= 0.1;
  633. wait 1;
  634. }
  635. sound_loop(amb0);
  636. other.sprite_index = sprCampfire
  637. other.spawns = 0;
  638. other.loops = 0;
  639. campfire_show_message(string(GameCont.kills) + " FREAKS KILLED!");
  640. wait 30;
  641. with(Player){
  642. canwalk = true;
  643. canspec = true;
  644. canaim = true;
  645. canspirit = true;
  646. if race = "chicken" maxhealth = 8;
  647. mask_index = mskPlayer;
  648. my_health = maxhealth;
  649. spr_idle = temparray[0];
  650. spr_walk = temparray[1];
  651. spr_hurt = temparray[2];
  652. wep = lastwep[0];
  653. bwep = lastwep[1];
  654. ammo[weapon_get_type(wep)] = max(typ_ammo[weapon_get_type(wep)]*3,ammo[weapon_get_type(wep)]);
  655. ammo[weapon_get_type(bwep)] = max(typ_ammo[weapon_get_type(bwep)]*3,ammo[weapon_get_type(bwep)]);
  656. reload = weapon_get_load(wep);
  657. image_index = 0;
  658. image_speed = 0.40;
  659. }
  660. other.active = false;
  661. other.xoff = 1;
  662. exit;
  663. }
  664. }
  665. }
  666. }
  667. }
  668. with(projectile){
  669. if distance_to_object(other) > 500 instance_delete(self);
  670. }
  671. with(instances_matching_ne(hitme,"name","customhunter")){
  672. if !place_meeting(x+hspeed,y+vspeed+((sprite_get_width(sprite_index)/3)*sign(vspeed)),Floor){
  673. vspeed = 0;
  674. }
  675. if !place_meeting(x+hspeed+((sprite_get_height(sprite_index)/3)*sign(hspeed)),y,Floor){
  676. hspeed = 0;
  677. }
  678. }
  679. with(Corpse){
  680. if !place_meeting(x+hspeed,y+vspeed+((sprite_get_width(sprite_index)/3)*sign(vspeed)),Floor){
  681. vspeed = 0;
  682. }
  683. if !place_meeting(x+hspeed+((sprite_get_height(sprite_index)/3)*sign(hspeed)),y,Floor){
  684. hspeed = 0;
  685. }
  686. }
  687. if(active){
  688. if xoff > 0{
  689. xoff *= 0.8;
  690. }
  691. if (timer > 0){
  692. // Pause timer when a boss monster appears
  693. if array_length_1d(instances_matching_ne(enemy,"intro",undefined)) = 0{
  694. timer -= current_time_scale;
  695. }
  696. if timer <= 0{
  697. timer = 30 * 15;
  698. if mode = mode_freak{
  699. if spawns <= 0{
  700. repeat(3){
  701. with(instance_create(x,y,RevivePopoFreak)){
  702. var cont = other;
  703. if(fork()){
  704. var _x = x;
  705. var _y = y;
  706. while(instance_exists(self)){
  707. wait 1;
  708. if !instance_exists(self){
  709. if cont.sprite_index = sprCampfireOff{
  710. instance_create(_x,_y,PopoFreak);
  711. }else{
  712. instance_delete(self);
  713. exit;
  714. }
  715. }
  716. }
  717. exit;
  718. }
  719. }
  720. }
  721. spawns ++;
  722. }else{
  723. with(instance_create(x,y,RevivePopoFreak)){
  724. repeat(2){
  725. if(fork()){
  726. var cont = other;
  727. with(instance_create(x,y,RevivePopoFreak)){
  728. if(fork()){
  729. var _x = x;
  730. var _y = y;
  731. while(instance_exists(self)){
  732. wait 1;
  733. if !instance_exists(self){
  734. if cont.sprite_index = sprCampfireOff{
  735. instance_create(_x,_y,PopoFreak);
  736. }else{
  737. instance_delete(self);
  738. exit;
  739. }
  740. }
  741. }
  742. exit;
  743. }
  744. }
  745. }
  746. }
  747. }
  748. }
  749. }else if mode = mode_idpd{
  750. spawns ++;
  751. if spawns mod 20 != 0{
  752. var imax = 5;
  753. for(var i = 1;i<imax;i++){
  754. wait 15;
  755. with(instance_create(10016,10016,IDPDSpawn)){
  756. p = i;
  757. if i = 0 && random(50) < min(other.spawns/5,10) elite = 1;
  758. x = 10016;
  759. y = 10016;
  760. if(fork()){
  761. while instance_exists(self){
  762. wait 1;
  763. if !other.active instance_delete(self);
  764. }
  765. exit;
  766. }
  767. }
  768. with(IDPDSpawn){
  769. /// Sets their alarms to max so that they all come at once. Staggered spawns is solely for sake of audio effect.
  770. alarm0 = 43;
  771. other.timer = 30 * 7;
  772. if i = imax-1{
  773. direction = (360/(imax-1)) * p;
  774. speed = 1;
  775. }
  776. }
  777. }
  778. }else{
  779. campfire_show_message("A BOSS MONSTER APPROACHES!");
  780. if(fork()){
  781. while instance_exists(self){
  782. timer = 30 * 6;
  783. wait 1;
  784. if timer2 <= 0{
  785. with(instance_create(10016,10016,Last)){
  786. team = 3;
  787. }
  788. break;
  789. }
  790. }
  791. exit;
  792. }
  793. }
  794. }else if mode = mode_palace{
  795. spawns ++;
  796. if spawns mod 10 = 0{
  797. campfire_show_message("BOSS MONSTERS APPROACH!");
  798. if(fork()){
  799. while instance_exists(self){
  800. wait 1;
  801. timer = 30 * 12;
  802. if sprite_index != sprCampfireOff || active = false exit;
  803. if timer2 <= 0{
  804. for(var o = -1;o<=1;o+=2){
  805. for(var i = -1;i<=1;i+=2){
  806. with(instance_create(10016 + (48 * i),10016 + (48 * o),CrownGuardian)){
  807. spr_idle = sprCrownGuardianAppear;
  808. sound_play(sndCrownGuardianAppear);
  809. canfly = true;
  810. }
  811. }
  812. }
  813. exit;
  814. }
  815. }
  816. exit;
  817. }
  818. }else if spawns mod 7 = 0 || spawns mod 5 = 0{
  819. if (active){
  820. if random(10) < 1{
  821. with(instance_create(10016,10016,DogGuardian)){
  822. mask_index = mskNone;
  823. canfly = true;
  824. zz = 256;
  825. y = ystart - zz;
  826. if(fork()){
  827. while instance_exists(self){
  828. wait 1;
  829. y = ystart - zz;
  830. zz -= 8
  831. if zz <= 0{
  832. mask_index = mskDogGuardian;
  833. canfly = false;
  834. sound_play(sndWallBreakBrick);
  835. repeat(32){
  836. with(instance_create(x,y,Debris)){
  837. direction = random(360);
  838. vspeed = random_range(-4,4);
  839. hspeed = random_range(-8,8);
  840. }
  841. }
  842. exit;
  843. }
  844. }
  845.  
  846. }
  847. }
  848. }else{
  849. repeat(2) instance_create(10016,10016,ExploGuardian);
  850. }
  851. }
  852. }
  853. // Spawn Guardians on all waves EXCEPT for Crown Guardian waves
  854. if spawns mod 10 != 0{
  855. if (active){
  856. repeat(6){
  857. repeat(2){
  858. with(instance_create(10016 + random_range(-64,64),10016 + random_range(-64,64),Guardian)){
  859. spr_idle = sprGuardianAppear;
  860. sound_play(sndGuardianAppear);
  861. canfly = true;
  862. }
  863. }
  864. wait 10;
  865. if !(active) break;
  866. }
  867. }
  868. }
  869. }else if mode = mode_sewer{
  870. spawns ++;
  871. timer = 30 * 6;
  872. if spawns mod 12 != 0{
  873. var cont = self;
  874. repeat(3 + loops){
  875. repeat(2){
  876. with(instance_create(10016 + random_range(-60,60),10016 + random_range(-60,60),FrogEgg)){
  877. alarm0 = 120;
  878. team = 0;
  879. if(fork()){
  880. var _x = x;
  881. var _y = y;
  882. while(instance_exists(self)){
  883. wait 1;
  884. cont.timer = 30;
  885. if !instance_exists(self){
  886. if random(8) < 3 instance_create(_x,_y,AmmoPickup);
  887. exit;
  888. }
  889. if alarm0 <= 5{
  890. if cont.sprite_index = sprCampfireOff{
  891. if random(3) < 2 obj = choose(Gator,Gator,Gator,Gator,Gator,Gator,Gator,Gator,Gator,Gator,GatorSmoke,GatorSmoke,SuperFireBaller)
  892. else obj = Exploder
  893. if obj = SuperFireBaller && instance_number(SuperFireBaller) > 1{
  894. obj = choose(Gator,GatorSmoke,GatorSmoke);
  895. }
  896. with(instance_create(_x,_y,obj)){
  897. //my_health *= 2;
  898. }
  899. sound_play(sndFrogEggOpen1);
  900. if random(8) < 1 instance_create(_x,_y,AmmoPickup);
  901. with(instance_create(_x,_y,Corpse)){
  902. sprite_index = other.spr_dead;
  903. }
  904. instance_delete(self);
  905. exit;
  906. }else{
  907. instance_delete(self);
  908. exit;
  909. }
  910. }
  911. }
  912. exit;
  913. }
  914. }
  915. }
  916. wait 15;
  917. }
  918. }else{
  919. campfire_show_message("A BOSS MONSTER APPROACHES!");
  920. loops ++;
  921. if(fork()){
  922. while instance_exists(self){
  923. timer = 30 * 12;
  924. wait 1;
  925. if timer2 <= 0{
  926. with(instance_create(10016,10016,FrogQueen)){
  927. //
  928. }
  929. break;
  930. }
  931. }
  932. exit;
  933. }
  934. }
  935. }
  936. }
  937. }
  938. // Creates raindrops
  939. var i = irandom(instance_number(Floor));
  940. with(Floor){
  941. i --;
  942. if i <= 0{
  943. instance_create(x + random(32),y+random(32),RainDrop);
  944. break;
  945. }
  946. }
  947. }
  948.  
  949. #define campfire_hit
  950. if !(active){
  951. sound_stop_all();
  952. sound_play(sndCursedReminder);
  953. mask_index = mskNone;
  954. GameCont.kills = 0;
  955. with(Player){
  956. if my_health > 0{
  957. canwalk = true;
  958. canaim = true;
  959. canspec = true;
  960. }
  961. lastwep = [wep,bwep];
  962. }
  963. repeat(32){
  964. with(instance_create(x,y,Smoke)){
  965. direction = argument2 + random_range(-30,30);
  966. speed = 3 + random(3);
  967. }
  968. }
  969. sprite_index = sprCampfireOff;
  970. if(fork()){
  971. wait 90;
  972. //trace("PARTY TIME!");
  973. var snd;
  974. switch(mode){
  975. case mode_freak:
  976. snd = musBoss1;
  977. break;
  978. case mode_idpd:
  979. snd = mus106;
  980. break;
  981. case mode_sewer:
  982. snd = musBoss5;
  983. break;
  984. default:
  985. snd = musBoss1;
  986. break;
  987. }
  988. sound_loop(snd);
  989. active = true;
  990. timer = 30 * 3;
  991. timer_thunder = (30 * 3) + 20;
  992. exit;
  993. }
  994. }
  995.  
  996. #define campfire_show_message
  997. with(instances_matching(CustomEnemy,"name","freakcont")){
  998. text2 = argument0;
  999. xoff2 = 1;
  1000. timer2 = 90;
  1001. }
  1002.  
  1003. #define campfire_draw
  1004. draw_sprite(sprite_index,image_index,x,y);
  1005. if sprite_index = sprCampfire{
  1006. var nl = global.namelist;
  1007. draw_set_halign(fa_center);
  1008. with(Player){
  1009. if "weppick" not in self weppick = 0;
  1010. if distance_to_object(other) < 48{
  1011. if button_released(index,"pick"){
  1012. canwalk = false;
  1013. canaim = false;
  1014. canspec = false;
  1015. }
  1016. if !(canwalk){
  1017. if button_pressed(index,"east"){
  1018. weppick = (weppick + 1) mod array_length_1d(other.weps);
  1019. }
  1020. if button_pressed(index,"west"){
  1021. weppick --;
  1022. if weppick < 0
  1023. weppick = array_length_1d(other.weps) - 1;
  1024. }
  1025. if button_pressed(index,"pick"){
  1026. var _wep = other.weps[weppick];
  1027. with(instance_create(x,y+84,WepPickup)){
  1028. wep = _wep;
  1029. ammo = 1;
  1030. }
  1031. sound_play(sndMutLastWish);
  1032. canwalk = true;
  1033. canaim = true;
  1034. canspec = true;
  1035. }
  1036. if button_pressed(index,"spec"){
  1037. canwalk = true;
  1038. canaim = true;
  1039. canspec = true;
  1040. }
  1041. if button_pressed(index,"swap"){
  1042. other.mode = (other.mode + 1) mod 4;
  1043. }
  1044. //draw_sprite(weapon_get_sprite(other.weps[weppick]),(current_frame * 0.40) mod sprite_get_number(other.weps[weppick]),other.x,other.y-48);
  1045. draw_text_nt(other.x,other.y-48,"[A] @("+string(weapon_get_sprite(other.weps[weppick]))+") [D]");
  1046. draw_text_nt(other.x,other.y-32,weapon_get_name(other.weps[weppick]));
  1047. }else{
  1048. draw_text_nt(other.x,other.y-36,"CHOOSE WEAPON");
  1049. draw_sprite(sprEPickup,0,other.x,other.y-12);
  1050. }
  1051. draw_text_nt(other.x,other.y+32,"[SPACE]#" + nl[? other.mode]);
  1052. }
  1053. }
  1054. draw_set_halign(fa_left);
  1055. }
  1056. #define nothingfloors
  1057. with(Floor){
  1058. if other.depth = 11{
  1059. draw_sprite_ext(sprBackFloor,0,x,y,1,1,0,image_blend,1)
  1060. }else{
  1061.  
  1062. if !place_meeting(x,y+33,Floor) && point_distance(x+16,y+16,10016,10016) < 32 * 6{
  1063. draw_sprite_ext(sprBackFloor2,0,x,y+48,1,1,0,merge_color(image_blend,c_black,0.6),1)
  1064.  
  1065. }
  1066. if !place_meeting(x,y+33,Floor) && place_meeting(x-1,y,Floor) && place_meeting(x+33,y,Floor){
  1067. draw_sprite_ext(sprBackFloor2,0,x,y+32,1,1,0,merge_color(image_blend,c_black,0.3),1)
  1068. }
  1069. draw_sprite_ext(sprBackFloor2,0,x,y,1,1,0,image_blend,1)
  1070. }
  1071. }
  1072. #define draw_gui
  1073. with(instances_matching(CustomEnemy,"name","freakcont")){
  1074. if(fade != 0){
  1075. draw_set_color(c_black);
  1076. draw_set_alpha(fade);
  1077. draw_rectangle(0,0,game_width,game_height,0);
  1078. draw_set_alpha(1);
  1079. draw_set_color(c_white);
  1080. }
  1081. if text2 != ""{
  1082. draw_text_nt(8 + (game_width * xoff2),game_height - 26,text2);
  1083. timer2 -= current_time_scale;
  1084. if timer2 <= 0{
  1085. text2 = "";
  1086. }
  1087. if xoff2 > 0 xoff2 *= 0.66;
  1088. }
  1089. if(active){
  1090. draw_text_nt(8 + (game_width * xoff),game_height - 16,"KILLS: " + string(GameCont.kills));
  1091. if (timer_thunder > 0){
  1092. timer_thunder -= current_time_scale;
  1093. if timer_thunder <= 0{
  1094. thunder_alpha = 1;
  1095.  
  1096. sound_play_pitchvol(sndLightningCannonEnd,random_range(0.5,0.8),0.5)
  1097. timer_thunder = 30 * irandom_range(2,6);
  1098. }
  1099. }
  1100. }
  1101. if (thunder_alpha > 0){
  1102. thunder_alpha -= 0.025 * current_time_scale;
  1103. background_color = merge_color(c_black,c_white,thunder_alpha);
  1104. with(hitme){
  1105. image_blend = merge_color(c_white,c_gray,other.thunder_alpha);
  1106. }
  1107. with(Floor){
  1108. image_blend = merge_color(c_white,c_black,other.thunder_alpha);
  1109. }
  1110. }
  1111. }
  1112.  
  1113. #define arena_create
  1114. deletestage();
  1115. with(enemy) instance_delete(self);
  1116. with(ThroneStatue) instance_delete(self);
  1117. with(instances_matching(CustomDraw,"name","nothingfloors")) instance_delete(self);
  1118. with(instance_create(10000,10000,CustomEnemy)){
  1119. sprite_index = sprCampfire;
  1120. mask_index = mskPlayer;
  1121. donotdelete = true;
  1122. team = 0;
  1123. name = "freakcont";
  1124. my_health = 9999;
  1125. maxhealth = 9999;
  1126. candie = false;
  1127. size = 9999;
  1128. image_speed = 0.40;
  1129. timer = 30 * 15;
  1130. timer_purchaseslaves = 30 * 30;
  1131. spawns = 0;
  1132. loops = 0;
  1133. active = false;
  1134. fade = 0;
  1135. xoff = 1;
  1136. xoff2 = 1;
  1137. text2 = "";
  1138. quickload = 0;
  1139. infhp = 0;
  1140. timer_thunder = 30;
  1141. thunder_alpha = 0;
  1142. mode = mode_freak;
  1143. slave = [-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4];
  1144. for(var i = -6;i<=6;i++){
  1145. for(var o = -3;o<=3;o++){
  1146. with(instance_create(x + (i * 32),y + (o * 32),Floor)){
  1147. if range(i,-2,2) && range(o,-2,2)
  1148. sprite_index = sprFloor6;
  1149. }
  1150. }
  1151. }
  1152. for(var i = -3;i<=3;i++){
  1153. for(var o = -4;o<=4;o++){
  1154. with(instance_create(x + (i * 32),y + (o * 32),Floor)){
  1155. if range(i,-3,3) && range(o,-3,3)
  1156. sprite_index = sprFloor6;
  1157. }
  1158. }
  1159. }
  1160. weps = [];
  1161. var d = 0;
  1162. for(var i = 1;i<=126;i++){
  1163. if weapon_get_area(i) <= 6{
  1164. weps[d] = i;
  1165. d++;
  1166. }
  1167. }
  1168. with(script_bind_draw(nothingfloors,11)){
  1169. persistent = true;
  1170. name = "nothingfloors";
  1171. }
  1172. with(script_bind_draw(nothingfloors,12)){
  1173. persistent = true;
  1174. name = "nothingfloors";
  1175. }
  1176. background_color = c_black;
  1177. on_step = script_ref_create(campfire_step);
  1178. on_draw = script_ref_create(campfire_draw);
  1179. on_hurt = script_ref_create(campfire_hit);
  1180. }
  1181.  
  1182. #define step
  1183. if instance_exists(GenCont) || instance_exists(menubutton){
  1184. global.gce = 1;
  1185. }else{
  1186. if global.gce = 1{
  1187. arena_create();
  1188. GameCont.area = 0;
  1189. global.gce = 0;
  1190. }
  1191. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement