Advertisement
Guest User

Nuclear Throne Corrupted

a guest
Jun 2nd, 2017
1,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.18 KB | None | 0 0
  1. // Nuclear Throne Corrupted
  2. // Original mod by Time
  3. // Slight edit/update by YellowAfterlife
  4. // Special thanks to 9joao6
  5. global.rhinoSkin = skill_get(1);
  6. global.visuals = true;
  7. global.bosses = true;
  8. global.weapons = true;
  9. global.mutations = true;
  10. trace("Do /ntc_help for commands.");
  11.  
  12. #define game_start
  13. wait 1;
  14. if (global.mutations) with (Player) {
  15. maxhealth *= 2;
  16. my_health = maxhealth;
  17. }
  18. global.rhinoSkin = skill_get(1);
  19.  
  20. #define scr_enabled(v)
  21. return v ? "enabled" : "disabled";
  22.  
  23. #define chat_command(cmd, par, plr)
  24. switch (cmd) {
  25. case "ntc_help":
  26. trace("Mode toggle commands:");
  27. trace("/ntc_visuals: Toggle visual effects (coloring)");
  28. trace("/ntc_bosses: Toggle NTC-specific boss mixes");
  29. trace("/ntc_weapons: Toggle weapon/projectile effects");
  30. trace("/ntc_player: Toggle player effects (more health, portal heal, ...)");
  31. return true;
  32. case "ntc_visuals":
  33. global.visuals ^= 1;
  34. trace("NTC visual effects are now " + scr_enabled(global.visuals) + ".");
  35. return true;
  36. case "ntc_bosses":
  37. global.bosses ^= 1;
  38. trace("NTC bosses are now " + scr_enabled(global.bosses) + ".");
  39. return true;
  40. case "ntc_weapons":
  41. global.weapons ^= 1;
  42. trace("NTC weapon effects are now " + scr_enabled(global.weapons) + ".");
  43. return true;
  44. case "ntc_player":
  45. global.mutations ^= 1;
  46. trace("NTC player effects are now " + scr_enabled(global.mutations) + ".");
  47. return true;
  48. }
  49.  
  50. #define scr_end_step
  51. if (!global.visuals) exit;
  52. // Colors:
  53. with (PortalL) image_blend = $0000CC;
  54. with (Laser) image_blend = $0000CC;
  55. with (Explosion) image_blend = $0000CC;
  56. //
  57. scr_hue(AmmoChest, 200, 255);
  58. scr_hue(GiantAmmoChest, 200, 255);
  59. scr_hue(WeaponChest, 200, 255);
  60. scr_hue(GiantWeaponChest, 200, 255);
  61. scr_hue(RadChest, 200, 255);
  62. //
  63. scr_hue(PlasmaBall, 500, 170);
  64. scr_hue(PlasmaBig, 500, 170);
  65. scr_hue(PlasmaHuge, 500, 170);
  66. scr_hue(Laser, 200, 240);
  67. with (instances_matching(ToxicGas, "ntc_recolor", undefined)) {
  68. ntc_recolor = true;
  69. image_blend = $990099;
  70. }
  71.  
  72. #macro mcr_scale 1.05
  73.  
  74. #define step
  75. //
  76. with (Spiral) {
  77. image_xscale *= random_range(1/mcr_scale, mcr_scale);
  78. image_yscale *= random_range(1/mcr_scale, mcr_scale);
  79. }
  80. //
  81. var q;
  82. // Extra feet:
  83. if (skill_get(2)) with (Player) maxspeed = 8;
  84. if (skill_get(1) && !global.rhinoSkin) {
  85. global.rhinoSkin = true;
  86. with (Player) {
  87. maxhealth += 4;
  88. my_health += 4;
  89. }
  90. with (Revive) maxhealth += 4;
  91. }
  92.  
  93. // Rebind visual script:
  94. q = noone;
  95. with (instances_matching(CustomEndStep, "name", "ntc_end_step")) q = id;
  96. if (q == noone) with (script_bind_end_step(scr_end_step, 0)) name = "ntc_end_step";
  97.  
  98. // Heal on portals:
  99. if (global.mutations && instance_exists(Portal)) {
  100. with (Player) my_health = maxhealth;
  101. }
  102. /*with (Player) if (button_check(index, "horn")) {
  103. with (GameObject) {
  104. image_xscale *= random_range(1/mcr_scale, mcr_scale);
  105. image_yscale *= random_range(1/mcr_scale, mcr_scale);
  106. }
  107. }*/
  108. if (global.bosses) scr_bosses();
  109. if (global.weapons) scr_weapons();
  110.  
  111. #define scr_bosses
  112. // Bosses:
  113. scr_replace(Van, Last);
  114. var l2p = (GameCont.loops >= 2);
  115. if (l2p) with (scr_replace_ret(Last, ScrapBoss)) my_health = 12;
  116. with (scr_replace_ret(BanditBoss, FrogQueen)) my_health = 1000;
  117. with (LilHunter) {
  118. repeat (l2p ? 8 : 4) {
  119. with (instance_create(x, y, ScrapBoss)) my_health = l2p ? 800 : 450;
  120. }
  121. repeat (l2p ? 2 : 1) {
  122. with (instance_create(x, y, FrogQueen)) my_health = 650;
  123. }
  124. image_angle = random(360);
  125. instance_destroy();
  126. }
  127. with (HyperCrystal) {
  128. repeat (l2p ? 6 : 2) {
  129. with (instance_create(x, y, CrownGuardianOld)) my_health = 700;
  130. }
  131. instance_destroy();
  132. }
  133. with (TechnoMancer) {
  134. repeat (l2p ? 2 : 1) {
  135. with (instance_create(x, y, Nothing2)) my_health = 1500;
  136. }
  137. instance_destroy();
  138. }
  139. if (instance_exists(Generator)) {
  140. with (scr_replace_ret(ThroneStatue, Guardian)) my_health = 300;
  141. }
  142. if (GameCont.area == 2) with (FrogQueen) {
  143. with (instance_create(x, y, Turtle)) {
  144. my_health = 2000;
  145. image_xscale = 5;
  146. image_yscale = 5;
  147. speed = other.speed;
  148. direction = other.direction;
  149. image_angle = random(360);
  150. }
  151. instance_destroy();
  152. }
  153. if (GameCont.area == 3) {
  154. with (scr_replace_ret(ScrapBoss, EnemyHorror)) my_health = 2000;
  155. }
  156. scr_replace(BonePileNight, FrogQueen);
  157. scr_replace(Grunt, PopoFreak);
  158. scr_replace(Inspector, EliteInspector);
  159. scr_replace(Shielder, EliteShielder);
  160.  
  161. #define scr_weapons
  162. // Projectiles:
  163. with (scr_replace_ret(Bullet1, CarThrow)) {
  164. ntc_team = team;
  165. team = 0;
  166. }
  167. with (CarThrow) if ("ntc_team" in self) with (instance_create(x, y, Flame)) {
  168. speed = random(8);
  169. direction = other.direction + random_range(-45, 45);
  170. image_angle = other.direction;
  171. team = other.ntc_team;
  172. }
  173. with (scr_replace_ret(Bullet2, PlasmaBall)) speed = 25;
  174. scr_replace(Slash, Bolt);
  175. with (LightningBall) with (instance_create(x, y, Flame)) {
  176. speed = random(8);
  177. direction = other.direction + random_range(-45, 45);
  178. image_angle = direction;
  179. team = other.team;
  180. }
  181. scr_replace(DragonBurst, FlameBall);
  182. with (FlameBurst) {
  183. repeat (6) with (instance_create(x, y, FlameBall)) {
  184. speed = other.speed;
  185. direction = other.direction;
  186. image_angle = random(360);
  187. team = other.team;
  188. }
  189. instance_destroy();
  190. }
  191. scr_replace(Slug, PlasmaBig);
  192. with (instances_matching(Grenade, "ntc_grenade", undefined)) scr_grenade();
  193. scr_replace(BouncerBullet, Devastator);
  194. scr_replace(Bolt, FlakBullet);
  195. scr_replace(Lightning, EnemyBullet1);
  196. scr_replace(Laser, BloodBall);
  197. scr_replace(Seeker, Nuke);
  198. scr_replace(Splinter, SentryGun);
  199. with (FlameShell) {
  200. repeat (2) with (instance_create(x, y, UltraShell)) {
  201. speed = other.speed;
  202. direction = other.direction;
  203. image_angle = random(360);
  204. team = other.team;
  205. image_xscale = 2;
  206. image_yscale = 2;
  207. }
  208. instance_destroy();
  209. }
  210. scr_replace(HeavyBullet, Nuke);
  211. scr_replace(Shank, FlameBall);
  212. scr_replace_spread(UltraBolt, Disc, 7, 10);
  213. scr_replace(HeavyBolt, FlakBullet);
  214. //
  215. with (EnergyShank) {
  216. repeat (3) with (instance_create(x, y, UltraBullet)) {
  217. speed = 18;
  218. friction = 1;
  219. direction = other.direction + random_range(-15, 15);
  220. image_angle = random(360);
  221. team = other.team;
  222. scr_ultra_bullet();
  223. }
  224. instance_destroy();
  225. }
  226. scr_replace_spread(EnergySlash, EnergyShank, 3, 10);
  227. scr_replace_spread(EnergyHammerSlash, EnergySlash, 3, 10);
  228. //
  229. with (instances_matching(Rocket, "ntc_rocket", undefined)) scr_rocket();
  230. scr_replace(BloodSlash, EnergyHammerSlash);
  231. scr_replace(LightningSlash, EnergyHammerSlash);
  232. scr_replace(HeavySlug, ProtoChest);
  233. scr_replace(PlasmaHuge, GiantWeaponChest);
  234. scr_replace(ToxicBolt, GiantAmmoChest);
  235. //with (Disc) speed = 100;
  236. with (instances_matching(Disc, "ntc_disc", undefined)) {
  237. ntc_disc = true;
  238. sprite_index = sprTurtleFire;
  239. image_angle = random(360);
  240. speed = 15;
  241. alarm0 = -1;
  242. }
  243. scr_replace(HyperSlug, LastBall);
  244. with (PlasmaBall) if (team >= 0) speed = 25;
  245. with (PlasmaBig) if (team >= 0) speed = 30;
  246. scr_replace(Flare, LastBall);
  247.  
  248. #define scr_hue(obj, sat, val)
  249. with (obj) {
  250. var h = (("hue" in self) ? hue + 1 : 0) % 256;
  251. hue = h;
  252. image_blend = make_color_hsv(h, sat, val);
  253. }
  254.  
  255. #define scr_replace_ret(obj, next)
  256. var r = array_create(instance_number(obj));
  257. var i = 0;
  258. with (obj) {
  259. var q = instance_create(x, y, next);
  260. q.speed = speed;
  261. q.direction = direction;
  262. q.image_angle = random(360);
  263. if ("team" in self) q.team = team;
  264. r[i++] = q;
  265. instance_destroy();
  266. }
  267. return r;
  268.  
  269. #define scr_replace(obj, next)
  270. with (obj) {
  271. var q = instance_create(x, y, next);
  272. q.speed = speed;
  273. q.direction = direction;
  274. q.image_angle = random(360);
  275. if ("team" in self) q.team = team;
  276. instance_destroy();
  277. }
  278. #define scr_replace_spread(obj, next, count, spread)
  279. with (obj) {
  280. repeat (count) with (instance_create(x, y, next)) {
  281. speed = other.speed;
  282. direction = other.direction + random_range(-1, 1) * spread;
  283. image_angle = random(360);
  284. if ("team" in other) team = other.team;
  285. }
  286. instance_destroy();
  287. }
  288.  
  289. #define scr_grenade
  290. ntc_grenade = true;
  291. if (!fork()) exit;
  292. var r1, r2, rx, rt = 0, obj;
  293. switch (object_index) {
  294. case MiniNade:
  295. r1 = 48;
  296. r2 = 96;
  297. rx = 24;
  298. obj = SmallExplosion;
  299. break;
  300. case PopoNade: exit; // no
  301. case ToxicGrenade:
  302. r1 = 32;
  303. r2 = 96;
  304. rx = 16;
  305. obj = ToxicGas;
  306. break;
  307. case Flare: exit;
  308. case ClusterNade:
  309. r1 = 48;
  310. r2 = 160;
  311. rx = 32;
  312. obj = Explosion;
  313. break;
  314. case HeavyNade:
  315. r1 = 64;
  316. r2 = 160;
  317. rx = 32;
  318. obj = Explosion;
  319. break;
  320. case UltraGrenade:
  321. r1 = 64;
  322. r2 = r1+64;
  323. rx = 64;
  324. obj = GreenExplosion;
  325. break;
  326. case BloodGrenade:
  327. r1 = 40;
  328. r2 = 40;
  329. rx = 32;
  330. rt = team;
  331. obj = MeatExplosion;
  332. break;
  333. case BloodBall:
  334. r1 = 40;
  335. r2 = 64+8;
  336. rx = 32;
  337. rt = team;
  338. obj = MeatExplosion;
  339. break;
  340. case ConfettiBall:
  341. r1 = 24;
  342. r2 = 160;
  343. rx = 8;
  344. obj = Confetti;
  345. break;
  346. default:
  347. r1 = 48;
  348. r2 = 160;
  349. rx = 32;
  350. obj = SmallExplosion;
  351. }
  352. var q = creator, qx, qy, qz;
  353. var qz = instance_exists(q);
  354. if (qz) {
  355. qx = q.x; qy = q.y;
  356. } else {
  357. qx = x; qy = y;
  358. }
  359. for (var r = r1; r <= r2; r += rx) {
  360. var n = ceil(r * (3.141592 * 2) / rx);
  361. var d = random(360);
  362. repeat (n) {
  363. var ex = qx + lengthdir_x(r, d);
  364. var ey = qy + lengthdir_y(r, d);
  365. with (qz ? q : self) {
  366. if (collision_circle(ex, ey, 16, Floor, false, false) != noone) {
  367. with (instance_create(ex, ey, obj)) {
  368. ntc_grenade = true;
  369. creator = q;
  370. team = rt;
  371. switch (obj) {
  372. case Confetti:
  373. motion_add(d + 90, 2);
  374. break;
  375. case ToxicGas:
  376. direction = d;
  377. speed = 0.5;
  378. break;
  379. }
  380. }
  381. }
  382. break;
  383. }
  384. d += 360 / n;
  385. }
  386. wait 1;
  387. qz = instance_exists(q);
  388. if (qz) { qx = q.x; qy = q.y; }
  389. }
  390. if (instance_exists(self)) {
  391. instance_change(GameObject, false);
  392. instance_destroy();
  393. }
  394.  
  395. #define scr_rocket
  396. ntc_rocket = true;
  397. if (!fork()) exit;
  398. repeat (15) {
  399. var q = instance_create(x, y, HealthChest);
  400. q.speed = speed;
  401. q.direction = direction;
  402. q.image_angle = random(360);
  403. wait 1;
  404. if (!instance_exists(self)) exit;
  405. }
  406. instance_destroy();
  407.  
  408. #define scr_ultra_bullet
  409. if (!fork()) exit;
  410. while (instance_exists(self)) {
  411. if (speed <= 0) {
  412. with (instance_create(x, y, MeatExplosion)) {
  413. creator = other.creator;
  414. team = other.team;
  415. }
  416. instance_destroy();
  417. exit;
  418. }
  419. wait 1;
  420. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement