Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.70 KB | None | 0 0
  1. #define init
  2. /*
  3. Bandit
  4. Active: Bash Attack
  5. * A bash attack
  6. Passive: Low Capacity
  7. * Lower max level
  8. * Bandit Blaster Only
  9.  
  10. Thronebutt
  11. * Crow Blaster
  12.  
  13. Ultra A
  14. * Decrease level to 4 + (Times Ultra A is taken)
  15. * Increases Bash Base Damage by 2 when taken more than three times
  16.  
  17. Ultra B
  18. * Increases base Bash damage
  19. * Big Bandit Gun found, but only if Ultra A is taken < 3 times
  20. */
  21. global.Ultra[1] = 0;
  22. global.Ultra[2] = 0;
  23. global.holiday = 0;
  24. #define race_name
  25. return "Bandit";
  26.  
  27. #define race_mapicon
  28. return sprBanditIdle
  29.  
  30. #define race_text
  31. return "Low Capacity#High Hopes"
  32.  
  33. #define race_swep
  34. return 0;
  35.  
  36. #define race_tb_text
  37. return "Improved Bandit Blaster"
  38.  
  39. #define race_tb_take
  40. //
  41. #define race_ultra_name
  42. switch (argument0) {
  43. case 1: return "High Capacity";
  44. case 2: return "Big Bash";
  45. default: return "";
  46. }
  47.  
  48. #define race_ultra_text
  49. switch (argument0) {
  50. case 1: if global.Ultra[1] <= 3
  51. return "More Levelups"
  52. else return "Minor Buff to Bash Attack";
  53. /// Buff to Passive ability. Reduces your current level from 7 to 4 to gain
  54. /// 5 more mutations in total. Current Rads are also reduced to 0.
  55. case 2: if global.Ultra[1] >= 2 return "Improved Bash attack"
  56. else return "Improved Bash Attack#Free Blaster Upgrade"
  57. /// Buff to Active ability. Functions exactly as Big Bandit's attack.
  58. default: return "";
  59. }
  60.  
  61. #define race_ultra_take
  62. global.Ultra[argument0] += 1;
  63. if global.Ultra[1] > 0 && argument0 = 1{
  64. if global.Ultra[1] <= 3 {
  65. GameCont.level = 2 + instance_number(Player) + global.Ultra[1];//4 + Ultra, 5 + Ultra with 2p
  66. GameCont.rad = 0;
  67. GameCont.skillpoints = 0;
  68. }else{
  69. dmg_bash_base = 6;
  70. }
  71. }
  72. if global.Ultra[2] > 0{
  73. if global.Ultra[1] < 3 global.Ultra[2]++;
  74. dmg_bash_base = 12;
  75. }
  76.  
  77. #define race_ttip
  78. return choose("FHO'FAASHYN");
  79.  
  80. #define obj_create
  81. // obj_create(x,y)
  82. // type added when necessary, but only when
  83. // (it is not necessary here)
  84. ID = instance_create(argument0,argument1,CustomObject);
  85. with(ID){
  86. on_step = script_ref_create(bullet_step);
  87. on_draw = script_ref_create(bullet_draw);
  88. on_destroy = script_ref_create(bullet_destroy);
  89.  
  90. if skill_get(17) = 0{
  91. col1 = make_color_rgb(165,25,60)
  92. col2 = make_color_rgb(252,56,0)
  93. col3 = make_color_rgb(255,133,99)
  94. col4 = c_white;
  95. }else{
  96. col1 = make_color_rgb(60,25,165)
  97. col2 = make_color_rgb(0,56,252)
  98. col3 = make_color_rgb(99,133,255)
  99. col4 = c_white;
  100.  
  101. if random(10) < 1{
  102. with(instance_create(x+4-random(8),y+4-random(8),PortalL)){
  103. depth = other.depth + choose(1,-1,-1);
  104. image_blend = c_aqua;
  105. }
  106. }
  107. }
  108. len = 0;
  109. lifetime = 0;
  110. queuedestroy = 0;
  111. recycled = 0;
  112. if skill_get(15) bounce = 3 else bounce = 0;
  113. }
  114. return ID;
  115.  
  116. #define bullet_step
  117. if instance_exists(self){
  118. lifetime++;
  119. if lifetime > 30*6 queuedestroy = 1;
  120. if speed > 6 speed -= 0.25;
  121. var nearestEnemy = instance_nearest(x,y,enemy);
  122. if place_meeting(x+hspeed,y+vspeed,Wall){//collision_point(x+hspeed,y+vspeed,Wall,0,1){
  123. if bounce > 0{
  124. direction = (direction + 180 + 45 - random(90)) mod 360;
  125. bounce--;
  126. if bounce <= 0 queuedestroy = 1;
  127. }else{
  128. instance_create(x,y,EBulletHit);
  129. queuedestroy = 1;
  130. }
  131. x -= hspeed;
  132. y -= vspeed;
  133. }
  134. if place_meeting(x,y,hitme){//collision_circle(x,y,6,hitme,0,1){
  135. var targ = collision_circle(x,y,6,hitme,0,1);
  136. if instance_exists(targ) && targ.team != team{
  137. if skill_get(16) = 1 && targ.my_health - dmg <= 0{
  138. queuedestroy = 0;
  139. if instance_exists(enemy){
  140. var nearestEnemy = instance_nearest(x,y,enemy);
  141. //direction = point_direction(x,y,nearestEnemy.x,nearestEnemy.y);
  142. speed = 10;
  143. sound_play(sndExplosion)//sndRecGlandProc);
  144. recycled = 1;
  145. }
  146. }else queuedestroy = 1;
  147. with(targ){
  148. my_health -= other.dmg;
  149. sprite_index = spr_hurt;
  150. image_index = 0;
  151. sound_play(snd_hurt);
  152. }
  153. }
  154. }
  155. if ((skill_get(19) && distance_to_object(enemy) < 56) || recycled = 1) && instance_exists(enemy){
  156. var aimDir = point_direction(x,y,nearestEnemy.x,nearestEnemy.y);
  157. var diff = cycle(aimDir - direction, -180, 180);
  158. if (abs(diff) < 2){
  159. direction = aimDir;
  160. }else{
  161. direction += diff * (0.20 + (0.10*recycled));
  162. }
  163. }
  164. if skill_get(21){
  165. if distance_to_object(enemy) < 32{
  166. var oldx = x;
  167. var oldy = y;
  168. move_snap(nearestEnemy.x,nearestEnemy.y);
  169. for(i=1;i<=10;i++){
  170. instance_create(x - (x - oldx) / i,y - (y - oldy)/i,DiscTrail);
  171. if skill_get(17) with(instance_create(x - (x - oldx) / i,y - (y - oldy)/i,PortalL)) image_blend = c_aqua;
  172. }
  173. }
  174. }
  175. if queuedestroy = 1{
  176. if skill_get(17) = 1{
  177. {
  178. with(instance_create(x,y,Lightning)){
  179. ammo = 1 + random(2);
  180. direction = random(360);
  181. alarm0 = 1;
  182. dmg = 1;
  183. damage = 1;
  184. team = other.team;
  185. }
  186. }
  187. }
  188. instance_destroy();
  189. }
  190. }
  191. #define bullet_draw
  192. if distance_to_object(Player) < 200{
  193. draw_set_alpha(0.1);
  194. draw_set_color(col1);
  195. draw_circle(x,y,10,0);
  196. draw_set_color(col2);
  197. draw_circle(x,y,9,0);
  198. draw_set_color(col3);
  199. draw_circle(x+lengthdir_x(2,direction),y+lengthdir_y(2,direction),9,0);
  200. draw_set_color(col4);
  201. draw_circle(x+lengthdir_x(2,direction),y+lengthdir_y(2,direction),8,0);
  202. draw_set_alpha(1);
  203.  
  204. draw_set_color(col1);
  205. draw_circle(x,y,6,0);
  206. draw_set_color(col2);
  207. draw_circle(x,y,5,0);
  208. draw_set_color(col3);
  209. draw_circle(x+lengthdir_x(2,direction),y+lengthdir_y(2,direction),5,0);
  210. draw_set_color(col4);
  211. draw_circle(x+lengthdir_x(2,direction),y+lengthdir_y(2,direction),4,0);
  212. }else exit;
  213. #define bullet_destroy
  214. //derp
  215. #define create
  216. if global.Ultra[2] = 1{
  217. dmg_bash_base = 12;
  218. }else{
  219. dmg_bash_base = 4;
  220. }
  221.  
  222. bandit_reloadTime = 0;
  223. bandit_burstRepeat = 0;
  224. bandit_rushTime = 0;
  225. bandit_rushSpd = 0;
  226. bandit_time = 0;
  227.  
  228. if global.holiday = 0{
  229. spr_idle = sprBanditIdle;
  230. spr_walk = sprBanditWalk;
  231. spr_hurt = sprBanditHurt;
  232. spr_dead = sprBanditDead;
  233. }else if global.holiday = 1{
  234. spr_idle = sprSpookyBanditIdle;
  235. spr_walk = sprSpookyBanditWalk;
  236. spr_hurt = sprSpookyBanditHurt;
  237. spr_dead = sprSpookyBanditDead;
  238. }else{
  239. spr_idle = sprSnowBanditIdle;
  240. spr_walk = sprSnowBanditWalk;
  241. spr_hurt = sprSnowBanditHurt;
  242. spr_dead = sprSnowBanditDead;
  243. }
  244.  
  245. snd_hurt = sndBanditHit;
  246. snd_dead = sndBanditDie;
  247. snd_lowh = sndBanditHit;
  248. snd_lowa = sndBanditHit;
  249.  
  250. snd_wrld = sndSkillPick;
  251.  
  252. snd_cptn = sndSkillPick;
  253. snd_thrn = sndSkillPick;
  254. snd_valt = sndSkillPick;
  255. snd_wrld = sndSkillPick;
  256. snd_chst = sndSkillPick;
  257. snd_spch = sndSkillPick;
  258. snd_idpd = sndSkillPick;
  259.  
  260. maxhealth = 4;
  261. healthlock = maxhealth;
  262.  
  263. #define scrBanditFire
  264. var obj;
  265. var dir = point_direction(x,y,mouse_x[index],mouse_y[index]) + sin(bandit_time);
  266. ID = obj_create(x,y);
  267. ID.direction = dir;
  268. ID.speed = 6;
  269. ID.team = team;
  270. ID.dmg = 3 + (GameCont.level * 0.50) - 0.50;
  271. ID.mask_index = sprEnemyBullet1
  272. wkick = 8;
  273.  
  274. if bandit_burstRepeat > 0{
  275. bandit_reloadTime = 5
  276. }else{
  277. bandit_reloadTime = 15;
  278. }
  279. if skill_get(22) = 1{
  280. bandit_reloadTime = max((bandit_reloadTime * ((my_health * 100)/maxhealth)/100),4);
  281. }
  282. sound_play(sndEnemyFire)
  283.  
  284. #define cycle
  285. /// cycle(value, min, max)
  286. /// Thanks yal
  287. var result, delta;
  288. delta = (argument2 - argument1);
  289. result = (argument0 - argument1) mod delta;
  290. if (result < 0) result += delta;
  291. return result + argument1;
  292.  
  293. #define game_start
  294. global.Ultra[1] = 0;
  295. global.Ultra[2] = 0;
  296. #define step
  297. if button_pressed(index,"horn"){
  298. for(i=14;i<=23;i++){
  299. skill_set(i,1);
  300. }
  301. global.Ultra[2] = 2;
  302. GameCont.level = 10;
  303. }
  304. if skill_get(23) = 1{
  305. with(enemy){
  306. if my_health <= 1{
  307. other.bandit_reloadTime *= 0.50;
  308. instance_destroy();
  309. }
  310. }
  311. }
  312. if skill_get(17) = 1 && random(10) < 1{
  313. with(instance_create(x+sprite_get_width(sprite_index)/2-random(sprite_get_width(sprite_index)),y+sprite_get_height(sprite_index)/2-random(sprite_get_height(sprite_index)),PortalL)){
  314. depth = other.depth + choose(1,-1);
  315. image_blend = c_aqua;
  316. }
  317. }
  318. /// Local replacement for current_time
  319. bandit_time++;
  320. if bandit_time > 360 bandit_time = 0;
  321. if bandit_rushTime > 0 bandit_rushTime--;
  322.  
  323. // Max level cap. Increased with more players.
  324. if GameCont.level > 5 + instance_number(Player) && GameCont.level < 10{//1P: 7, 2P: 8
  325. GameCont.level = 10;
  326. GameCont.endpoints = 1;
  327. }
  328. /// Assumed to have restarted your run, resets stats
  329. /// Temporary fix until yal fixes this
  330.  
  331. if my_health > healthlock{
  332. if bandit_rushTime <= 0{
  333. healthlock = my_health;
  334. }else{
  335. my_health = healthlock;
  336. }
  337. }
  338.  
  339. /// One curse, on the house ;)
  340. if GameCont.crown = 11
  341. curse = 1;
  342. if (curse = 1){
  343. if random(10)<3{
  344. var width = sprite_get_width(sprite_index)/2;
  345. var height = sprite_get_height(sprite_index)/3;
  346. with(instance_create(x+width-random(width*2),y+height-random(height*2),Curse)){
  347. depth = choose(3,-3,-3)
  348. }
  349. }
  350. }
  351.  
  352. if bandit_reloadTime > 0 bandit_reloadTime--;
  353. //Firing
  354. if button_check(index,"fire") && bandit_reloadTime <= 0{
  355. bandit_burstRepeat = 0 + (skill_get(5) * 2) + global.Ultra[2];
  356. scrBanditFire();
  357. }
  358. if bandit_burstRepeat > 0 && bandit_reloadTime <= 1{
  359. bandit_burstRepeat--;
  360. scrBanditFire();
  361. }
  362.  
  363. //Special
  364. if button_pressed(index,"spec") && bandit_rushTime <= 0{
  365. bandit_rushTime = 25;
  366. }
  367.  
  368. if (bandit_rushTime > 0){
  369. sprite_index = spr_walk;
  370. var ratio = ((bandit_rushTime * 100)/25)/175;
  371. image_blend = make_color_rgb(255,255*ratio,255*ratio);
  372. if bandit_rushTime < 15{
  373. speed = bandit_rushSpd + (skill_get(14) * 2);
  374. if skill_get(14) = 1 && bandit_rushTime < 12{
  375. with(instance_create(x,y,Flame)){
  376. team = other.team;
  377. }
  378. }
  379. if collision_circle(x+lengthdir_x(8,direction),y+lengthdir_y(8,direction),4,Wall,0,1) && bandit_rushSpd > 3{
  380. with(collision_circle(x+lengthdir_x(8,direction),y+lengthdir_y(8,direction),4,Wall,0,1)){
  381. if global.Ultra[2] = 0{
  382. with(other){
  383. direction += 180 - 15 + random(30);
  384. bandit_rushSpd = 3;
  385. }
  386. }
  387. instance_create(x,y,FloorExplo);
  388. instance_destroy();
  389. }
  390. }
  391. if collision_circle(x,y,16,hitme,0,1){
  392. with(collision_circle(x,y,16,hitme,0,1)){
  393. if (team != other.team && (sprite_index != spr_hurt || (sprite_index = spr_hurt && image_index > 1))){
  394. my_health -= other.dmg_bash_base + floor(GameCont.level * 0.5);
  395. sprite_index = spr_hurt;
  396. image_index = 0;
  397. }
  398. }
  399. }
  400. }else if bandit_rushTime > 15{
  401. speed *= 0.50;
  402. }else{
  403. direction = point_direction(x,y,mouse_x[index],mouse_y[index]);
  404. bandit_rushSpd = 6;
  405. }
  406. }else{
  407. image_blend = c_white;
  408. }
  409. if bandit_rushTime > 15{
  410. healthlock = my_health;
  411. }else{
  412. if bandit_rushTime > 0 my_health = healthlock;
  413. }
  414.  
  415. //Discards weapon
  416. if (wep != "#0"){//weapon_get_name(0)
  417. with(instance_create(x,y,ThrownWep)){
  418. wep = other.wep//weapon_get_name(other.wep);
  419. team = other.team;
  420. direction = point_direction(x,y,mouse_x[other.index],mouse_y[other.index]);
  421. speed = 6;
  422. team = other.team;
  423. sprite_index = weapon_get_sprite(other.wep)
  424. other.wep = "#0"//weapon_get_name(0);
  425. }
  426. }
  427.  
  428. #define draw
  429. with(PlayerSit) visible = 0;
  430. with(SitDown) visible = 0;
  431. if instance_exists(PlayerSit) sprite_index = spr_idle;
  432.  
  433. if back = 1
  434. draw_sprite_ext(sprBanditGun,0,x-lengthdir_x(wkick,aimDirection),y-lengthdir_y(wkick,aimDirection),1,right,aimDirection,image_blend,1)
  435. draw_sprite_ext(sprite_index,-1,x,y,right,1,angle,image_blend,1)
  436. if back = -1
  437. draw_sprite_ext(sprBanditGun,0,x-lengthdir_x(wkick,aimDirection),y-lengthdir_y(wkick,aimDirection),1,right,aimDirection,image_blend,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement