Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // On Mod Load:
- #define init
- global.newLevel = instance_exists(GenCont);
- /// Define Sprites : sprite_add("path/to/sprite/starting/from/mod/location.png", frames, x-offset, y-offset) \\\
- // A-Skin:
- global.spr_idle = sprite_add("sprBardIdle.png", 4, 12, 12);
- global.spr_walk = sprite_add("sprBardWalk.png", 6, 12, 12);
- global.spr_hurt = sprite_add("sprBardHurt.png", 3, 12, 12);
- global.spr_dead = sprite_add("sprBardDead.png", 6, 12, 12);
- global.spr_sit1 = sprite_add("sprBardGoSit.png", 3, 12, 12);
- global.spr_sit2 = sprite_add("sprBardSit.png", 1, 12, 12);
- // Character Selection / Loading Screen:
- global.spr_slct = sprite_add("sprCharSelect.png", 1, 0, 0);
- global.spr_port = sprite_add("sprBigPortrait.png", 0, 40, 243);
- global.spr_skin = sprite_add("sprLoadoutSkin.png", 0, 16, 16);
- global.spr_icon = sprite_add("sprMapIcon.png", 0, 10, 10);
- // Ultras:
- global.spr_ult_slct = sprite_add("sprEGSkillIcon.png", ultra_count("bard"), 12, 16);
- global.spr_ult_icon[1] = sprite_add("sprEGIconHUDA.png", 1, 8, 9);
- global.spr_ult_icon[2] = sprite_add("sprEGIconHUDB.png", 1, 8, 9);
- // Bard Sprites
- global.sprBardNotes = sprite_add("bardnotes.png",3,5,5);
- global.sprBardShield = sprite_add("bardshield.png",0,16,16);
- // Bard Sounds
- global.sndBardAbility = sound_add("ability.ogg");
- bardResetGlobals();
- var _race = []; // Array of all players' races
- for(var i = 0; i < maxp; i++) _race[i] = player_get_race(i);
- while(true){
- /// Character Select
- for(var i = 0; i < maxp; i++){
- var r = player_get_race(i); // this player's race
- if(_race[i] != r && r == "bard"){
- sound_play(sndMutant1Slct); // Select Sound
- }
- _race[i] = r;
- }
- // Call level_start At The Start Of Every Level:
- if(instance_exists(GenCont)) global.newLevel = 1;
- else if(global.newLevel){
- global.newLevel = 0;
- level_start();
- }
- wait 1;
- }
- #define array_create_ext(size, value)
- var arr = array_create(size);
- array_clear(arr, value);
- return arr;
- // On Run Start
- #define game_start
- sound_play(sndMutant1Cnfm); // Play Confirm Sound
- bardResetGlobals();
- #define bardResetGlobals
- global.bardLevel = 0;
- global.bardBrill = array_create_ext(maxp, 0);
- global.bardAmmo = array_create_ext(maxp, 0);
- bardLuteDmg = 2;
- bardWeapon = 0;
- bardHealAmount = 3;
- bardHealCost = 3;
- bardHasPassive = 0;
- //
- #macro bardWeapon global.bardWeapon
- #macro bardHealAmount global.bardHealAmount
- #macro bardHealCost global.bardHealCost
- #macro bardHasPassive global.bardHasPassive
- #macro bardLuteDmg global.bardLuteDmg
- // Used to update globals
- #define bardSetGlobals
- global.bardBrill[index] = bardBrill;
- global.bardAmmo[index] = bardAmmo;
- // On Character's Creation (Starting a run, getting revived in co-op, etc.):
- #define create
- // Starting weapons
- wep = "BardLute";
- // Variables
- bardNotePlay=0; // Note effect
- bardNoteDuration=0;
- bardNoteWhich=0;
- bardNotePos0=[];
- bardNotePos1=[];
- bardNotePos2=[];
- bardLuteReload=0;
- bardLuteReloadMax=5;
- bardCanFire=1;
- bardBrill=global.bardBrill[index]; // Brilliance
- bardBrillMax=10;
- bardShield=0; // Shield
- bardShieldMax=60;
- bardShieldHp=0;
- bardPassiveMax=90; //Passive Brilliance gain
- bardPassive=bardPassiveMax;
- bardAmmo=global.bardAmmo[index]; // Ammo to get 1 brilliance
- bardAmmoMax=3;
- // Set Sprites:
- spr_idle = global.spr_idle;
- spr_walk = global.spr_walk;
- spr_hurt = global.spr_hurt;
- spr_dead = global.spr_dead;
- spr_sit1 = global.spr_sit1;
- spr_sit2 = global.spr_sit2;
- // Set Sounds:
- snd_wrld = sndMutant1Wrld; // FLÄSHYN
- snd_hurt = sndMutant1Hurt; // THE WIND HURTS
- snd_dead = sndMutant1Dead; // THE STRUGGLE CONTINUES
- snd_lowa = sndMutant1LowA; // ALWAYS KEEP ONE EYE ON YOUR AMMO
- snd_lowh = sndMutant1LowH; // THIS ISN'T GOING TO END WELL
- snd_chst = sndMutant1Chst; // TRY NOT OPENING WEAPON CHESTS
- snd_valt = sndMutant1Valt; // AWWW YES
- snd_crwn = sndMutant1Crwn; // CROWNS ARE LOYAL
- snd_spch = sndMutant1Spch; // YOU REACHED THE NUCLEAR THRONE
- snd_idpd = sndMutant1IDPD; // BEYOND THE PORTAL
- snd_cptn = sndMutant1Cptn; // THE STRUGGLE IS OVER
- // On Level Start
- #define level_start
- // Scale lute damage with level
- if (global.bardLevel <= 16) {
- global.bardLevel++;
- bardLuteDmg+=0.2;
- }
- #define draw
- draw_set_font(fntSmall);
- draw_set_color($FFFFFF);
- draw_set_halign(fa_left);
- draw_set_valign(fa_top);
- // Brilliance counter
- var s = string(bardBrill)+"/"+string(bardBrillMax);
- var w = string_width(s);
- var h = string_height(s);
- var _x = x - w div 2;
- var _y = bbox_bottom + 8;
- draw_rect_ext(_x - 1, _y - 1, w + 1, h + 1, $222222, 0.75);
- draw_text(_x, _y, s);
- draw_set_font(fntM);
- // Shield
- if (bardShield >0) {
- with(Player){
- draw_set_alpha(0.5);
- draw_sprite(global.sprBardShield,0,x,y);
- draw_set_alpha(1);
- }
- }
- // Play note effect
- if (bardNotePlay == 1) {
- if (bardNoteDuration <=10){
- draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos0[0],y+bardNotePos0[1]);
- draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos1[0],y+bardNotePos1[1]);
- draw_sprite(global.sprBardNotes,bardNoteWhich,x+bardNotePos2[0],y+bardNotePos2[1]);
- } else {
- bardNotePlay=0; bardNoteDuration=0; bardNoteWhich=0;
- bardNotePos0=[]; bardNotePos1=[]; bardNotePos2=[];
- }
- }
- // Special ability note effect
- #define bardNoteEffect
- bardNotePlay=1; bardNoteDuration=0;
- bardNotePos0=[random(30)-15,random(30)-15];
- bardNotePos1=[random(30)-15,random(30)-15];
- bardNotePos2=[random(30)-15,random(30)-15];
- // Cap Brilliance (under max and above -1)
- #define bardCapBrilliance
- if (bardBrill > bardBrillMax) { bardBrill=bardBrillMax; }
- else if (bardBrill < 0) { bardBrill=0; }
- // Display popup
- #define gotbrillmsg(brill)
- with(instance_create(x, y, PopupText)) {
- target = other.index;
- mytext = "+" + string(brill) + " BRILLIANCE";
- }
- #define step
- // Reset ammo counts
- for(i=1; i<=5; i++){
- while (ammo[i] > typ_ammo[i]) {
- ammo[i] -= typ_ammo[i];
- bardAmmo += 1;
- }
- }
- // Thronebutt
- if(skill_get(5)) { bardAmmoMax=3; }
- // Ultras
- if(ultra_get("bard", 1) || ultra_get("bard", 2)) { bardHasPassive=1; }
- // Ability note effect
- if (button_pressed(index, "swap") && bardBrill >=bardHealCost) { bardNoteEffect(); } //Heal
- else if (button_pressed(index, "spec") && bardBrill >=1) { bardNoteEffect(); } //Blast
- else if (button_pressed(index, "horn") && bardBrill >=2) { bardNoteEffect(); } //Shield
- // Passive Brilliance gain
- if (bardPassive <=0){
- bardPassive=bardPassiveMax;
- bardBrill++;
- gotbrillmsg(1);
- bardCapBrilliance();
- }
- // Cant fire if on top of weapon
- with(WepPickup) {
- if(point_distance(other.x,other.y , x,y) <=20) {
- other.bardCanFire=0;
- if(other.reload >0) { other.reload++; }
- }
- }
- // Bard ammo
- var added = 0;
- while(bardAmmo >=bardAmmoMax) {
- bardBrill++; bardAmmo-=bardAmmoMax;
- added++;
- bardCapBrilliance();
- }
- if(added > 0) gotbrillmsg(added);
- // Eat weapons for Brilliance
- if(bardWeapon ==2){ bardWeaponName="BardGuitar"; }
- else if(bardWeapon ==1){ bardWeaponName="BardViolin"; }
- else{ bardWeaponName="BardLute"; }
- if (wep != bardWeaponName) {
- // Eat
- wep=bardWeaponName; bwep=0;
- sound_play(sndConfetti1);
- repeat(20) instance_create(x+random(26)-13,y+random(26)-13,Confetti);
- with(Player) { if(player_get_race(index) =="bard") { bardBrill++; gotbrillmsg(1); } }
- bardCapBrilliance();
- }
- // Lute
- if (button_check(index, "fire")) {
- if (bardLuteReload == 0 && bardCanFire ==1){
- var __angle = gunangle;
- var __x = x + lengthdir_x(4, __angle);
- var __y = y + lengthdir_y(4, __angle);
- mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
- gunangle + (random(16) - 8) * other.accuracy, bardLuteDmg);
- // Recycle Gland
- if (skill_get(16) && round(random(3))==0) {
- mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
- gunangle + (random(16) - 8) * other.accuracy, round(bardLuteDmg/3));
- }
- // Normal reload time
- else { bardLuteReload=bardLuteReloadMax; }
- // Guitar
- if (bardWeapon == 2){
- mod_script_call("mod", "bardnotebullet", "scr_create", __x, __y,
- gunangle + (random(34) - 17) * other.accuracy, round(bardLuteDmg/3));
- }
- } else if (bardCanFire ==0) {
- bardCanFire=1; // Reset can fire
- }
- }
- // Heal
- if (button_pressed(index, "swap")) {
- if (bardBrill >=bardHealCost){
- sound_play(global.sndBardAbility);
- bardBrill-=bardHealCost;
- // Note effect
- bardNoteWhich=0;
- // Visual effects
- bardHealCenter=[mouse_x[index],mouse_y[index]]; bardHealRadius=37;
- if (bardWeapon == 1) { bardHealRadius=round(bardHealRadius*1.5); }
- repeat(bardHealRadius*2) { instance_create(bardHealCenter[0]+random(bardHealRadius*2)-bardHealRadius, bardHealCenter[1]+random(bardHealRadius*2)-bardHealRadius, Confetti); }
- repeat(round(bardHealRadius*0.19)) { instance_create(bardHealCenter[0]+random(bardHealRadius*2)-bardHealRadius, bardHealCenter[1]+random(bardHealRadius*2)-bardHealRadius, SmokeOLD); }
- // Heal all in radius
- with(Player){
- if(distance_to_point(other.bardHealCenter[0], other.bardHealCenter[1]) <=other.bardHealRadius){
- // Heal
- my_health+=bardHealAmount;
- if (my_health >maxhealth){ my_health=maxhealth; }
- // Heal effect
- sound_play(sndHPPickup);
- instance_create(x,y,HealFX);
- }
- }
- } else {
- // Not enough Brilliance
- sound_play(sndClickBack);
- }
- }
- // Blast
- if (button_pressed(index, "spec")) {
- if (bardBrill >=1){
- sound_play(global.sndBardAbility);
- bardBrill-=1;
- // Note effect
- bardNoteWhich=1;
- // Shoot blast
- mod_script_call("mod", "brillianceball", "scr_create", x, y,
- gunangle + random_range(-1, 1) * 5 * accuracy, bardLuteDmg);
- } else {
- // Not enough Brilliance
- sound_play(sndClickBack);
- }
- }
- // Shield
- if (button_pressed(index, "horn")) {
- if (bardBrill >=2){
- sound_play(global.sndBardAbility);
- bardBrill-=2;
- // Begin shield duration
- bardShield=bardShieldMax;
- // Note effect
- bardNoteWhich=2;
- } else {
- // Not enough Brilliance
- sound_play(sndClickBack);
- }
- }
- // Shield functionality
- if (bardShield >0){
- with(projectile){
- if (team == 1) {
- if(distance_to_object(Player) <=18){
- sound_play(sndLightningPistol);
- instance_create(x,y,PortalL);
- instance_destroy();
- }
- }
- }
- } if (bardShield == 1) {
- with(Player){
- repeat(5) { instance_create(x+random(16)-8,y+random(16)-8,PortalL); }
- repeat(2) { instance_create(x+random(16)-8,y+random(16)-8,SmokeOLD); }
- }
- }
- // Add to note effect duration
- if (bardNotePlay==1) { bardNoteDuration++; }
- // Reload lute
- if (bardLuteReload >0) { bardLuteReload--; }
- // Shield duration
- if (bardShield >0) { bardShield--; }
- // Passive Brilliance gain
- if (bardBrill >= bardBrillMax){
- bardPassive=bardPassiveMax;
- } else if (bardPassive >0 && bardHasPassive==1) { bardPassive--; }
- bardSetGlobals()
- // Name:
- #define race_name
- return "BARD";
- // Description:
- #define race_text
- return "LOVES MUSIC"+
- "#CASTS MUSICAL SPELLS";
- // Throne Butt Description:
- #define race_tb_text
- return "@sHIGHER @yBRILLIANCE @sGENERATION";
- // Character Selection Icon:
- #define race_menu_button
- sprite_index = global.spr_slct;
- // Portrait:
- #define race_portrait
- return global.spr_port;
- // Loading Screen Map Icon:
- #define race_mapicon
- return global.spr_icon;
- // Skin Count:
- #define race_skins
- return 1;
- #define race_swep
- return "BardLute";
- // Skin Icons:
- #define race_skin_button
- sprite_index = global.spr_skin;
- image_index = argument0;
- // Ultra Names:
- #define race_ultra_name
- switch(argument0){
- case 1: return "TREBLE";
- case 2: return "BASS";
- /// Add more cases if you have more ultras!
- }
- // Ultra Descriptions:
- #define race_ultra_text
- switch(argument0){
- case 1: return "@wPASSIVELY @sGAIN @yBRILLIANCE"+
- "#@sGAIN A @wVIOLIN";
- case 2: return "@wPASSIVELY @sGAIN @yBRILLIANCE"+
- "#@sGAIN A @wGUITAR";
- /// Add more cases if you have more ultras!
- }
- // On Taking An Ultra:
- #define race_ultra_take
- if(instance_exists(mutbutton)) switch(argument0){
- // ULTRA A (TREBLE)
- case 1:
- // Play Sound
- sound_play(sndFishUltraA);
- // Passives
- bardWeapon=1;
- bardHasPassive=1;
- bardHealAmount++;
- bardHealCost--;
- // Break
- break;
- // ULTRA B (BASS)
- case 2:
- // Play Sound
- sound_play(sndFishUltraB);
- // Passive
- bardWeapon=2;
- bardHasPassive=1;
- // Break
- break;
- }
- // Ultra Button Portraits:
- #define race_ultra_button
- sprite_index = global.spr_ult_slct;
- image_index = argument0 + 1;
- // Ultra HUD Icons:
- #define race_ultra_icon
- return global.spr_ult_icon[argument0];
- // Loading Screen Tips:
- #define race_ttip
- return ["la dee da",">.<",":)",":D","woo!","this is fun!"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement