Advertisement
Guest User

Untitled

a guest
Mar 7th, 2018
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  // On Mod Load:
  2. #define init
  3.  
  4.     global.newLevel = instance_exists(GenCont);
  5.  
  6.     /// Define Sprites : sprite_add("path/to/sprite/starting/from/mod/location.png", frames, x-offset, y-offset) \\\
  7.      // A-Skin:
  8.     global.spr_idle = sprite_add("sprBardIdle.png", 4, 12, 12);
  9.     global.spr_walk = sprite_add("sprBardWalk.png", 6, 12, 12);
  10.     global.spr_hurt = sprite_add("sprBardHurt.png", 3, 12, 12);
  11.     global.spr_dead = sprite_add("sprBardDead.png", 6, 12, 12);
  12.     global.spr_sit1 = sprite_add("sprBardGoSit.png",    3, 12, 12);
  13.     global.spr_sit2 = sprite_add("sprBardSit.png",  1, 12, 12);
  14.    
  15.      // Character Selection / Loading Screen:
  16.     global.spr_slct = sprite_add("sprCharSelect.png",   1,              0,  0);
  17.     global.spr_port = sprite_add("sprBigPortrait.png",  0,  40, 243);
  18.     global.spr_skin = sprite_add("sprLoadoutSkin.png",  0,  16, 16);
  19.     global.spr_icon = sprite_add("sprMapIcon.png",      0,  10, 10);
  20.  
  21.      // Ultras:
  22.     global.spr_ult_slct = sprite_add("sprEGSkillIcon.png",  ultra_count("bard"), 12, 16);
  23.     global.spr_ult_icon[1] = sprite_add("sprEGIconHUDA.png", 1, 8, 9);
  24.     global.spr_ult_icon[2] = sprite_add("sprEGIconHUDB.png", 1, 8, 9);
  25.    
  26.      // Bard Sprites
  27.     global.sprBardNotes = sprite_add("bardnotes.png",3,5,5);
  28.     global.sprBardShield = sprite_add("bardshield.png",0,16,16);
  29.  
  30.      // Bard Sounds
  31.     global.sndBardAbility = sound_add("ability.ogg");
  32.    
  33.     bardResetGlobals();
  34.  
  35.     var _race = []; // Array of all players' races
  36.     for(var i = 0; i < maxp; i++) _race[i] = player_get_race(i);
  37.     while(true){
  38.    
  39.         /// Character Select
  40.         for(var i = 0; i < maxp; i++){
  41.             var r = player_get_race(i); // this player's race
  42.             if(_race[i] != r && r == "bard"){
  43.                 sound_play(sndMutant1Slct); // Select Sound
  44.             }
  45.             _race[i] = r;
  46.         }
  47.    
  48.      // Call level_start At The Start Of Every Level:
  49.         if(instance_exists(GenCont)) global.newLevel = 1;
  50.         else if(global.newLevel){
  51.             global.newLevel = 0;
  52.             level_start();
  53.         }
  54.         wait 1;
  55.  
  56.     }
  57.  
  58. #define array_create_ext(size, value)
  59.   var arr = array_create(size);
  60.   array_clear(arr, value);
  61.   return arr;
  62.  
  63.  // On Run Start
  64. #define game_start
  65.   sound_play(sndMutant1Cnfm); // Play Confirm Sound
  66.   bardResetGlobals();
  67.  
  68. #define bardResetGlobals
  69.   global.bardLevel = 0;
  70.   global.bardBrill = array_create_ext(maxp, 0);
  71.   global.bardAmmo = array_create_ext(maxp, 0);
  72.   bardLuteDmg = 2;
  73.   bardWeapon = 0;
  74.   bardHealAmount = 3;
  75.   bardHealCost = 3;
  76.   bardHasPassive = 0;
  77.  
  78.   //
  79.   #macro bardWeapon global.bardWeapon
  80.   #macro bardHealAmount global.bardHealAmount
  81.   #macro bardHealCost global.bardHealCost
  82.   #macro bardHasPassive global.bardHasPassive
  83.   #macro bardLuteDmg global.bardLuteDmg
  84.  
  85.  // Used to update globals
  86. #define bardSetGlobals
  87.   global.bardBrill[index] = bardBrill;
  88.   global.bardAmmo[index] = bardAmmo;
  89.  
  90.  // On Character's Creation (Starting a run, getting revived in co-op, etc.):
  91. #define create
  92.  
  93.    // Starting weapons
  94.   wep = "BardLute";
  95.  
  96.    // Variables
  97.   bardNotePlay=0; // Note effect
  98.   bardNoteDuration=0;
  99.   bardNoteWhich=0;
  100.   bardNotePos0=[];
  101.   bardNotePos1=[];
  102.   bardNotePos2=[];
  103.   bardLuteReload=0;
  104.   bardLuteReloadMax=5;
  105.   bardCanFire=1;
  106.   bardBrill=global.bardBrill[index]; // Brilliance
  107.   bardBrillMax=10;
  108.   bardShield=0; // Shield
  109.   bardShieldMax=60;
  110.   bardShieldHp=0;
  111.   bardPassiveMax=90; //Passive Brilliance gain
  112.   bardPassive=bardPassiveMax;
  113.   bardAmmo=global.bardAmmo[index]; // Ammo to get 1 brilliance
  114.   bardAmmoMax=3;
  115.  
  116.      // Set Sprites:
  117.     spr_idle = global.spr_idle;
  118.     spr_walk = global.spr_walk;
  119.     spr_hurt = global.spr_hurt;
  120.     spr_dead = global.spr_dead;
  121.     spr_sit1 = global.spr_sit1;
  122.     spr_sit2 = global.spr_sit2;
  123.  
  124.      // Set Sounds:
  125.     snd_wrld = sndMutant1Wrld;  // FLÄSHYN
  126.     snd_hurt = sndMutant1Hurt;  // THE WIND HURTS
  127.     snd_dead = sndMutant1Dead;  // THE STRUGGLE CONTINUES
  128.     snd_lowa = sndMutant1LowA;  // ALWAYS KEEP ONE EYE ON YOUR AMMO
  129.     snd_lowh = sndMutant1LowH;  // THIS ISN'T GOING TO END WELL
  130.     snd_chst = sndMutant1Chst;  // TRY NOT OPENING WEAPON CHESTS
  131.     snd_valt = sndMutant1Valt;  // AWWW YES
  132.     snd_crwn = sndMutant1Crwn;  // CROWNS ARE LOYAL
  133.     snd_spch = sndMutant1Spch;  // YOU REACHED THE NUCLEAR THRONE
  134.     snd_idpd = sndMutant1IDPD;  // BEYOND THE PORTAL
  135.     snd_cptn = sndMutant1Cptn;  // THE STRUGGLE IS OVER
  136.  
  137.  // On Level Start
  138. #define level_start
  139.    // Scale lute damage with level
  140.   if (global.bardLevel <= 16) {
  141.     global.bardLevel++;
  142.     bardLuteDmg+=0.2;
  143.   }
  144.  
  145. #define draw
  146.   draw_set_font(fntSmall);
  147.     draw_set_color($FFFFFF);
  148.     draw_set_halign(fa_left);
  149.     draw_set_valign(fa_top);
  150.    // Brilliance counter
  151.     var s = string(bardBrill)+"/"+string(bardBrillMax);
  152.     var w = string_width(s);
  153.     var h = string_height(s);
  154.   var _x = x - w div 2;
  155.   var _y = bbox_bottom + 8;
  156.     draw_rect_ext(_x - 1, _y - 1, w + 1, h + 1, $222222, 0.75);
  157.     draw_text(_x, _y, s);
  158.     draw_set_font(fntM);
  159.    // Shield
  160.   if (bardShield >0) {
  161.     with(Player){
  162.       draw_set_alpha(0.5);
  163.       draw_sprite(global.sprBardShield,0,x,y);
  164.       draw_set_alpha(1);
  165.     }
  166.   }
  167.    // Play note effect
  168.   if (bardNotePlay == 1) {
  169.     if (bardNoteDuration <=10){
  170.       draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos0[0],y+bardNotePos0[1]);
  171.       draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos1[0],y+bardNotePos1[1]);
  172.       draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos2[0],y+bardNotePos2[1]);
  173.     } else {
  174.       bardNotePlay=0; bardNoteDuration=0; bardNoteWhich=0;
  175.       bardNotePos0=[]; bardNotePos1=[]; bardNotePos2=[];
  176.     }
  177.   }
  178.  
  179.  // Special ability note effect
  180. #define bardNoteEffect
  181.   bardNotePlay=1; bardNoteDuration=0;
  182.   bardNotePos0=[random(30)-15,random(30)-15];
  183.   bardNotePos1=[random(30)-15,random(30)-15];
  184.   bardNotePos2=[random(30)-15,random(30)-15];
  185.  
  186.  // Cap Brilliance (under max and above -1)
  187. #define bardCapBrilliance
  188.   if (bardBrill > bardBrillMax) { bardBrill=bardBrillMax; }
  189.   else if (bardBrill < 0) { bardBrill=0; }
  190.  
  191.  // Display popup
  192. #define gotbrillmsg(brill)
  193.   with(instance_create(x, y, PopupText)) {
  194.     target = other.index;
  195.     mytext = "+" + string(brill) + " BRILLIANCE";
  196.   }
  197.  
  198. #define step
  199.  
  200.    // Reset ammo counts
  201.   for(i=1; i<=5; i++){
  202.     while (ammo[i] > typ_ammo[i]) {
  203.       ammo[i] -= typ_ammo[i];
  204.       bardAmmo += 1;
  205.     }
  206.   }
  207.  
  208.    // Thronebutt
  209.   if(skill_get(5)) { bardAmmoMax=3; }
  210.  
  211.    // Ultras
  212.   if(ultra_get("bard", 1) || ultra_get("bard", 2)) { bardHasPassive=1; }
  213.  
  214.    // Ability note effect
  215.   if (button_pressed(index, "swap") && bardBrill >=bardHealCost) { bardNoteEffect(); } //Heal
  216.   else if (button_pressed(index, "spec") && bardBrill >=1) { bardNoteEffect(); } //Blast
  217.   else if (button_pressed(index, "horn") && bardBrill >=2) { bardNoteEffect(); } //Shield
  218.  
  219.    // Passive Brilliance gain
  220.   if (bardPassive <=0){
  221.     bardPassive=bardPassiveMax;
  222.     bardBrill++;
  223.     gotbrillmsg(1);
  224.     bardCapBrilliance();
  225.   }
  226.  
  227.    // Cant fire if on top of weapon
  228.   with(WepPickup) {
  229.     if(point_distance(other.x,other.y , x,y) <=20) {
  230.       other.bardCanFire=0;
  231.       if(other.reload >0) { other.reload++; }
  232.     }
  233.   }
  234.  
  235.    // Bard ammo
  236.   var added = 0;
  237.   while(bardAmmo >=bardAmmoMax) {
  238.     bardBrill++; bardAmmo-=bardAmmoMax;
  239.     added++;
  240.     bardCapBrilliance();
  241.   }
  242.   if(added > 0) gotbrillmsg(added);
  243.  
  244.    // Eat weapons for Brilliance
  245.   if(bardWeapon ==2){ bardWeaponName="BardGuitar"; }
  246.   else if(bardWeapon ==1){ bardWeaponName="BardViolin"; }
  247.   else{ bardWeaponName="BardLute"; }
  248.   if (wep != bardWeaponName) {
  249.      // Eat
  250.     wep=bardWeaponName; bwep=0;
  251.     sound_play(sndConfetti1);
  252.     repeat(20) instance_create(x+random(26)-13,y+random(26)-13,Confetti);
  253.     with(Player) { if(player_get_race(index) =="bard") { bardBrill++; gotbrillmsg(1); } }
  254.     bardCapBrilliance();
  255.   }
  256.  
  257.    // Lute
  258.   if (button_check(index, "fire")) {
  259.     if (bardLuteReload == 0 && bardCanFire ==1){
  260.       var __angle = gunangle;
  261.       var __x = x + lengthdir_x(4, __angle);
  262.       var __y = y + lengthdir_y(4, __angle);
  263.       mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
  264.                       gunangle + (random(16) - 8) * other.accuracy, bardLuteDmg);
  265.        // Recycle Gland
  266.       if (skill_get(16) && round(random(3))==0) {
  267.         mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
  268.                         gunangle + (random(16) - 8) * other.accuracy, round(bardLuteDmg/3));
  269.       }
  270.        // Normal reload time
  271.       else { bardLuteReload=bardLuteReloadMax; }
  272.        // Guitar
  273.       if (bardWeapon == 2){
  274.         mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
  275.                         gunangle + (random(34) - 17) * other.accuracy, round(bardLuteDmg/3));
  276.       }
  277.     } else if (bardCanFire ==0) {
  278.       bardCanFire=1; // Reset can fire
  279.     }
  280.   }
  281.  
  282.    // Heal
  283.   if (button_pressed(index, "swap")) {
  284.     if (bardBrill >=bardHealCost){
  285.       sound_play(global.sndBardAbility);
  286.       bardBrill-=bardHealCost;
  287.        // Note effect
  288.       bardNoteWhich=0;
  289.        // Visual effects
  290.       bardHealCenter=[mouse_x[index],mouse_y[index]]; bardHealRadius=37;
  291.       if (bardWeapon == 1) { bardHealRadius=round(bardHealRadius*1.5); }
  292.       repeat(bardHealRadius*2) { instance_create(bardHealCenter[0]+random(bardHealRadius*2)-bardHealRadius, bardHealCenter[1]+random(bardHealRadius*2)-bardHealRadius, Confetti); }
  293.       repeat(round(bardHealRadius*0.19)) { instance_create(bardHealCenter[0]+random(bardHealRadius*2)-bardHealRadius, bardHealCenter[1]+random(bardHealRadius*2)-bardHealRadius, SmokeOLD); }
  294.        // Heal all in radius
  295.       with(Player){
  296.         if(distance_to_point(other.bardHealCenter[0], other.bardHealCenter[1]) <=other.bardHealRadius){
  297.            // Heal
  298.           my_health+=bardHealAmount;
  299.           if (my_health >maxhealth){ my_health=maxhealth; }
  300.            // Heal effect
  301.           sound_play(sndHPPickup);
  302.           instance_create(x,y,HealFX);
  303.         }
  304.       }
  305.     } else {
  306.        // Not enough Brilliance
  307.       sound_play(sndClickBack);
  308.     }
  309.   }
  310.  
  311.    // Blast
  312.   if (button_pressed(index, "spec")) {
  313.     if (bardBrill >=1){
  314.       sound_play(global.sndBardAbility);
  315.       bardBrill-=1;
  316.        // Note effect
  317.       bardNoteWhich=1;
  318.        // Shoot blast
  319.       mod_script_call("mod", "brillianceball", "scr_create", x, y,
  320.                       gunangle + random_range(-1, 1) * 5 * accuracy, bardLuteDmg);
  321.     } else {
  322.        // Not enough Brilliance
  323.       sound_play(sndClickBack);
  324.     }
  325.   }
  326.  
  327.    // Shield
  328.   if (button_pressed(index, "horn")) {
  329.     if (bardBrill >=2){
  330.       sound_play(global.sndBardAbility);
  331.       bardBrill-=2;
  332.        // Begin shield duration
  333.       bardShield=bardShieldMax;
  334.        // Note effect
  335.       bardNoteWhich=2;
  336.     } else {
  337.        // Not enough Brilliance
  338.       sound_play(sndClickBack);
  339.     }
  340.   }
  341.  
  342.    // Shield functionality
  343.   if (bardShield >0){
  344.     with(projectile){
  345.       if (team == 1) {
  346.         if(distance_to_object(Player) <=18){
  347.           sound_play(sndLightningPistol);
  348.           instance_create(x,y,PortalL);
  349.           instance_destroy();
  350.         }
  351.       }
  352.     }
  353.   } if (bardShield == 1) {
  354.     with(Player){
  355.       repeat(5) { instance_create(x+random(16)-8,y+random(16)-8,PortalL); }
  356.       repeat(2) { instance_create(x+random(16)-8,y+random(16)-8,SmokeOLD); }
  357.     }
  358.   }
  359.  
  360.    // Add to note effect duration
  361.   if (bardNotePlay==1) { bardNoteDuration++; }
  362.    // Reload lute
  363.   if (bardLuteReload >0) { bardLuteReload--; }
  364.    // Shield duration
  365.   if (bardShield >0) { bardShield--; }
  366.    // Passive Brilliance gain
  367.   if (bardBrill >= bardBrillMax){
  368.     bardPassive=bardPassiveMax;
  369.   } else if (bardPassive >0 && bardHasPassive==1) { bardPassive--; }
  370.  
  371.   bardSetGlobals()
  372.  
  373.  // Name:
  374. #define race_name
  375.     return "BARD";
  376.  
  377.  
  378.  // Description:
  379. #define race_text
  380.     return "LOVES MUSIC"+
  381.          "#CASTS MUSICAL SPELLS";
  382.  
  383.  // Throne Butt Description:
  384. #define race_tb_text
  385.     return "@sHIGHER @yBRILLIANCE @sGENERATION";
  386.  
  387.  
  388.  // Character Selection Icon:
  389. #define race_menu_button
  390.     sprite_index = global.spr_slct;
  391.  
  392.  
  393.  // Portrait:
  394. #define race_portrait
  395.     return global.spr_port;
  396.  
  397.  
  398.  // Loading Screen Map Icon:
  399. #define race_mapicon
  400.     return global.spr_icon;
  401.  
  402.  
  403.  // Skin Count:
  404. #define race_skins
  405.     return 1;
  406.  
  407. #define race_swep
  408.     return "BardLute";
  409.  
  410.  // Skin Icons:
  411. #define race_skin_button
  412.     sprite_index = global.spr_skin;
  413.     image_index = argument0;
  414.  
  415.  
  416.  // Ultra Names:
  417. #define race_ultra_name
  418.     switch(argument0){
  419.         case 1: return "TREBLE";
  420.         case 2: return "BASS";
  421.         /// Add more cases if you have more ultras!
  422.     }
  423.  
  424.  
  425.  // Ultra Descriptions:
  426. #define race_ultra_text
  427.     switch(argument0){
  428.         case 1: return "@wPASSIVELY @sGAIN @yBRILLIANCE"+
  429.                    "#@sGAIN A @wVIOLIN";
  430.         case 2: return "@wPASSIVELY @sGAIN @yBRILLIANCE"+
  431.                    "#@sGAIN A @wGUITAR";
  432.         /// Add more cases if you have more ultras!
  433.     }
  434.  
  435.  
  436.  // On Taking An Ultra:
  437. #define race_ultra_take
  438.     if(instance_exists(mutbutton)) switch(argument0){
  439.     // ULTRA A (TREBLE)
  440.         case 1:
  441.        // Play Sound
  442.       sound_play(sndFishUltraA);
  443.        // Passives
  444.       bardWeapon=1;
  445.       bardHasPassive=1;
  446.       bardHealAmount++;
  447.       bardHealCost--;
  448.        // Break
  449.       break;
  450.     // ULTRA B (BASS)
  451.         case 2:
  452.        // Play Sound
  453.       sound_play(sndFishUltraB);
  454.        // Passive
  455.       bardWeapon=2;
  456.       bardHasPassive=1;
  457.        // Break
  458.       break;
  459.     }
  460.  
  461.  
  462.  // Ultra Button Portraits:
  463. #define race_ultra_button
  464.     sprite_index = global.spr_ult_slct;
  465.     image_index = argument0 + 1;
  466.  
  467.  
  468.  // Ultra HUD Icons:
  469. #define race_ultra_icon
  470.     return global.spr_ult_icon[argument0];
  471.  
  472.  
  473.  // Loading Screen Tips:
  474. #define race_ttip
  475.     return ["la dee da",">.<",":)",":D","woo!","this is fun!"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement