Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //TETRODE 1.6 CODE BY JULIAN DRAKE
- //DEMONSTRATION PURPOSES ONLY!!
- ///Override me for each option
- switch(selected)
- {
- case 0:
- room_goto(NSelect_Room)
- break;
- case 1:
- room_goto(ISelect_Room);
- break;
- case 2:
- global.inv[global.ss] = get_string("Give what item?", "")
- break;
- case 3:
- health = get_integer("Change health to what?", 100)
- break;
- case 4:
- global.newgrav = get_integer("Change gravity to what?", 1)
- global.gravupdate = true
- break;
- default: break;
- }
- instance_destroy();
- if global.c2e = "DR4G0N"
- {
- global.dragon = true
- health = 500
- output = "Enjoy your dragonic powers!"
- }
- if global.c2e = "Give"
- {
- global.inv[global.ss] = get_string("Replace selected slot with: ","")
- output = "Thank you for shopping at Cheatymart!"
- }
- if global.c2e = "IHateFun"
- {
- health = 1000000
- output = "So do we!"
- }
- if global.c2e = "Kill"
- {
- health = -1
- output = "RIP"
- }
- if global.c2e = "HEYEAYYEA"
- {
- url_open( 'https://www.youtube.com/watch?v=ZZ5LpwO-An4' );
- }
- if global.c2e = "CLEV"
- {
- level = get_string("Level to change to: ","")
- room_goto(level)
- }
- if global.c2e = "Items"
- {
- show_message("Blocks: wallblock,Brick,Stone,Dirt,Grass,Sand,Glass,Glass Wall,Metal,Metal Wall,Ladder,Wood Wall,Door#Items: Standard Pickaxe,Paper,Eerie Gemstone,Drill,Jetpack,Pocket Knife,Camera,Handgun,Label Maker,Assault Rifle,Shotgun,Dubstep Gun,ADS Kit,Water Bucket,Bucket,Lava Bucket")
- }
- if global.c2e = "Changename"
- {
- arg1 = get_string("New Name: ","")
- name = arg1
- }
- if global.c2e = "Changegrid"
- {
- arg1 = get_integer("New Grid Size: (Default is 32)",32)
- global.grid = arg1
- }
- if global.c2e = "Changeweather"
- {
- arg1 = get_string("New Weather: ","Clear")
- global.weather = arg1
- }
- if global.c2e = "Seed"
- {
- show_message(string(global.sd))
- }
- if global.c2e = "NO NOT THE BEES!"
- {
- global.bees = true
- }
- if global.c2e = "Giveammo"
- {
- global.ammo = 9999999999999
- }
- if global.c2e = "Spawnobj"
- {
- arg1 = get_string("Object to spawn: ","")
- global.ots = arg1
- }
- if global.c2e = "Giveslot"
- {
- level = get_integer("Slot to give to: ","")
- arg1 = get_string("Item to give in slot: ","")
- global.inv[level] = arg1
- }
- if global.c2e = "Enablesbox"
- {
- global.sbox = 1
- }
- level = ""
- global.c2e = ""
- arg1 = ""
- randomize()
- if global.sd = 0
- {
- global.sd = irandom(999999)
- random_set_seed(global.sd)
- }
- else
- {
- random_set_seed(global.sd)
- }
- p=10 // POSITION // START GENERATES FROM THIS HEIGHT // 10
- v=2 // VELOCITY // THIS WILL INCREASE THE HEIGHT BY 2 //
- a=-1 // ACCELERATION // THIS WILL DECREASE VELOCITY BY 1 // -1
- // TOP (GRASS) //
- for(i=0;i<room_width;i+=32){ // THIS WILL KEEP GENERATE THE WORLD UNTIL IT REACHES ITS END //
- instance_create(i,room_height-(p*32),object30) // THIS WILL CREATE THE TOP LAYER //
- // MIDDLE (DIRT) //
- for(m=room_height-((p-1)*32);m<room_height;m+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //
- if m<room_height-((p-4)*32){
- instance_create(i,m,DirtBlock)
- }
- }
- // BOTTOM (STONE) //
- for(b=room_height-((p)*32);b<room_height;b+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //]
- num = irandom(14)
- if num = 0
- {
- instance_create(i,b,oil)
- }
- if num = 1
- {
- instance_create(i,b,iore)
- }
- if num > 1
- {
- instance_create(i,b,object29)
- }
- }
- p+=v
- v+=a
- a=choose(-2,-1,0,1,2)
- // TERRAIN SHAPE //
- if p>12{p=12 v=0 a=-abs(a)}
- if p<7{p=7 v=0 a=abs(a)}
- }
- instance_destroy()
- /*
- I think, therefore I am.
- */
- //Make random truly random
- randomize()
- //Initialize Physics
- grav = 1;
- hsp = 0;
- vsp = 0;
- movespeed = 7
- jumpspeed = 14
- //Initialize Variables
- global.sx = 96
- global.sy = 256
- global.jdraw = false
- global.jetpack = ""
- global.lt = "no"
- global.ltouch = ""
- global.name = ""
- global.dubsong = 0
- global.dubstep = false
- global.c2e = ""
- global.cheat = false
- global.dragon = false
- global.grid = 32
- global.spawned = false
- global.bees = false
- global.recording = true
- global.msgclose = false
- global.mtext = ""
- global.time = 0
- global.held = "Empty"
- global.empty2 = "";
- global.cs = 0
- global.crafted = false
- global.s = 0
- global.jc = 0
- global.pc = 0
- global.slotcount = 0
- global.slotcount2 = 0
- global.wt = false
- global.we = true
- global.dx = 0
- global.dy = 0
- global.dc = 0
- global.cdisplay = false
- myheight = 0
- mywidth = 0
- global.woolcolor = -1
- global.cpick = false
- global.boom = false
- global.ammo = 10
- global.ammodisplay = false
- global.dmg = 0
- global.money = 0
- global.mobspawn = 0
- global.ots = "none"
- global.drawnslot = 0
- global.contrib = 0
- global.flashstate = 0
- global.sbox = 1
- global.npctospawn = ""
- global.nspawnupdate = false
- global.itemtospawn = ""
- global.ispawnupdate = false
- global.newgrav = 0
- global.gravupdate = false
- snum = 0
- global.pause = 0
- alarm[3] = 5
- alarm[4] = 5
- alarm[5] = 2
- alarm[6] = 1800
- alarm[7] = 120
- global.attackcooldown = 10
- global.canattack = false
- x = 96
- y = 256
- //Physics Settings and Inv Init
- global.builddist = 180
- global.build = false
- global.destroy = false
- global.attack = false
- global.wdestroy = false
- //QuickBar init
- global.inv[0] = "Handgun"
- global.inv[1] = "Magazine"
- global.inv[2] = "Magazine"
- global.inv[3] = "Medkit"
- global.inv[4] = "Pocket Knife"
- global.inv[5] = "None"
- global.ss = 0
- //QuickBar count init
- global.invcount[0] = 3
- global.invcount[1] = 1
- global.invcount[2] = 1
- global.invcount[3] = 1
- global.invcount[4] = 1
- global.invcount[5] = 1
- //Inv init (3x3 grid)
- global.inv2[0,0] = "Empty"
- global.inv2[1,0] = "Empty"
- global.inv2[2,0] = "Mining Laser"
- global.inv2[0,1] = "Empty"
- global.inv2[1,1] = "Empty"
- global.inv2[2,1] = "Jetpack"
- global.inv2[0,2] = "Empty"
- global.inv2[1,2] = "Empty"
- global.inv2[2,2] = "Empty"
- //Inv count init (3x3 grid)
- global.invcount2[0,0] = 0
- global.invcount2[1,0] = 0
- global.invcount2[2,0] = 1
- global.invcount2[0,1] = 0
- global.invcount2[1,1] = 0
- global.invcount2[2,1] = 1
- global.invcount2[0,2] = 0
- global.invcount2[1,2] = 0
- global.invcount2[2,2] = 0
- //Crafting init
- //1st Num = id
- //2nd Num = plastic needed
- global.c[0] = "Standard Pickaxe"
- global.c[1] = "wallblock"
- global.c[2] = "Paper"
- global.c[3] = "Eerie Gemstone"
- global.c[4] = "Brick"
- global.c[5] = "Drill"
- global.c[6] = "Jetpack"
- global.c[7] = "Pocket Knife"
- global.c[8] = "Camera"
- global.c[9] = "Handgun"
- global.c[10] = "Label Maker"
- global.c[11] = "Assault Rifle"
- global.c[12] = "Shotgun"
- global.c[13] = "Dubstep Gun"
- global.c[14] = "ADS Kit"
- global.c[15] = "Water Bucket"
- global.c[16] = "Bucket"
- global.c[17] = "Stone"
- global.c[18] = "Grass"
- global.c[19] = "Sand"
- global.c[20] = "Glass"
- global.c[21] = "Bed"
- global.c[22] = "Glass Wall"
- global.c[23] = "Bloodstone"
- global.c[24] = "Metal"
- global.c[25] = "Metal Wall"
- global.c[26] = "Ladder"
- global.c[27] = "Wood Wall"
- global.c[28] = "Lava Bucket"
- global.c[29] = "Chest"
- global.c[30] = "Door"
- global.c[31] = "Medkit"
- global.c[32] = "Wilson"
- global.c[33] = "Mining Laser"
- global.c[34] = "Volcanite Rifle"
- global.c[35] = "Bacon"
- global.c[36] = "Clock"
- global.c[37] = "Plasma RPG"
- global.c[38] = "Log"
- global.c[39] = "Leaves"
- global.c[40] = "Emerald Dust"
- global.c[41] = "Torch"
- global.c[42] = "Dynamite"
- global.c[43] = "Magazine"
- global.c[44] = "Dagger"
- global.c[45] = "Bamboo Wall"
- global.c[46] = "Bamboo Planks"
- global.c[47] = "Bamboo Reed"
- global.c[48] = "Atom Destabilizer"
- global.c[49] = "Monster Spawner"
- global.c[50] = "Light"
- global.c[51] = "Dyanmite Launcher"
- global.c[52] = "Chaingun"
- global.c[53] = "Longsword"
- global.c[54] = "Plasma Gun"
- global.c[55] = "Baseball Bat"
- global.c[56] = "Pumpkin"
- global.c[57] = "Carved Pumpkin"
- global.c[58] = "Jack O' Lantern"
- global.c[59] = "Gyrojet Gun"
- global.c[60] = "Gyrojet Gun Mk II"
- dmsg = false
- audio_group_set_gain(SFX,global.agg1,0)
- last_chat_id = 0
- chat_text = ""
- chat_count = 1
- view_wview[0] = 1680;
- view_hview[0] = 1050;
- show_debug_message("Debug Console Code is 882246469713. USE RESPONSIBLY!");
- cursor_sprite = sprite74
- global.melee = false
- global.ammodisplay = false
- global.dmg = 0
- global.bdmg = 0
- //Check Build/Destroy Validity
- if point_in_circle(mouse_x,mouse_y,x,y,global.builddist)
- {
- if global.inv[global.ss] = "Brick"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- if global.inv[global.ss] = "Dirt"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- if global.inv[global.ss] = "Glass"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- if global.inv[global.ss] = "wallblock"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- else if global.inv[global.ss] = "Stone"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- else
- {
- global.build = false
- }
- if global.inv[global.ss] = "Water Bucket"
- {
- global.build = true
- global.destroy = false
- global.wdestroy = false
- global.attack = false
- }
- else
- {
- global.wdestroy = false
- }
- if global.inv[global.ss] = "Drill"
- {
- global.build = false
- global.destroy = true
- global.wdestroy = false
- global.attack = false
- //draw_text(0,0,"Can destroy.")
- }
- else if global.inv[global.ss] = "Standard Pickaxe"
- {
- global.build = false
- global.destroy = true
- global.wdestroy = false
- global.attack = false
- //draw_text(0,0,"Can destroy.")
- }
- else
- {
- global.destroy = false
- }
- if global.inv[global.ss] = "Pocket Knife"
- {
- global.build = false
- global.destroy = false
- global.attack = true
- //draw_text(0,0,"Can destroy.")
- }
- else
- {
- global.attack = false
- }
- if global.inv[global.ss] = "Bucket"
- {
- global.build = false
- global.destroy = false
- global.attack = false
- global.wdestroy = true
- }
- else
- {
- global.wdestroy = false
- }
- }
- else
- {
- global.destroy = false
- global.build = false
- global.attack = false
- //draw_text(0,0,"Cannot build.")
- }
- //Draw Selected Inv Slot
- draw_text(view_xview[0]+0,view_yview[0]+32,global.inv[global.ss])
- draw_text(view_xview[0]+0,view_yview[0]+50,"Slot "+string(global.drawnslot))
- if global.ss = 0
- {
- global.drawnslot = 1
- }
- if global.ss = 1
- {
- global.drawnslot = 2
- }
- if global.ss = 2
- {
- global.drawnslot = 3
- }
- if global.ss = 3
- {
- global.drawnslot = 4
- }
- if global.ss = 4
- {
- global.drawnslot = 5
- }
- if global.ss = 5
- {
- global.drawnslot = 6
- }
- //Draw Inv Item Sprites
- if global.inv[global.ss] = "Standard Pickaxe"
- {
- draw_sprite(sprite4,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "wallblock"
- {
- draw_sprite(sprite67,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Paper"
- {
- draw_sprite(sprite7,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Eerie Gemstone"
- {
- draw_sprite(sprite21,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Brick"
- {
- draw_sprite(sprite20,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Drill"
- {
- draw_sprite(sprite22,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Jetpack"
- {
- draw_sprite(sprite72,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Pocket Knife"
- {
- global.dmg = 10
- global.melee = true
- draw_sprite(sprite27,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Atom Destabilizer"
- {
- global.dmg = 40
- global.melee = true
- draw_sprite(ns,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Camera"
- {
- draw_sprite(sprite31,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Handgun"
- {
- global.bdmg = 10
- global.ammodisplay = true
- draw_sprite(sprite28,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Gyrojet Gun"
- {
- global.bdmg = 20
- global.ammodisplay = true
- draw_sprite(gj1,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Gyrojet Gun Mk II"
- {
- global.bdmg = 22
- global.ammodisplay = true
- draw_sprite(gj2,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Label Maker"
- {
- draw_sprite(sprite43,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Assault Rifle"
- {
- global.bdmg = 5
- global.ammodisplay = true
- draw_sprite(sprite39,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Shotgun"
- {
- global.bdmg = 12
- global.ammodisplay = true
- draw_sprite(sprite45,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Dubstep Gun"
- {
- global.bdmg = 2
- draw_sprite(sprite52,-1,view_xview[0]+0,view_yview[0]+0)
- draw_text(view_xview[0]+0,view_yview[0]+70,global.dubname)
- }
- if global.inv[global.ss] = "ADS Kit"
- {
- draw_sprite(sprite54,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Water Bucket"
- {
- draw_sprite(sprite63,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Bucket"
- {
- draw_sprite(sprite64,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Stone"
- {
- global.build = true
- draw_sprite(sprite34,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Dirt"
- {
- global.build = true
- draw_sprite(Dirt,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Grass"
- {
- global.build = true
- draw_sprite(sprite36,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Sand"
- {
- global.build = true
- draw_sprite(sprite62,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Light"
- {
- global.build = true
- draw_sprite(sprite159,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Glass"
- {
- global.build = true
- draw_sprite(sprite65,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Glass Wall"
- {
- global.build = true
- draw_sprite(sprite66,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Bed"
- {
- global.build = true
- draw_sprite(beditem,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Metal"
- {
- global.build = true
- draw_sprite(sprite89,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Metal Wall"
- {
- global.build = true
- draw_sprite(sprite90,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Ladder"
- {
- global.build = true
- draw_sprite(sprite70,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Pumpkin"
- {
- global.build = true
- draw_sprite(pplain,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Carved Pumpkin"
- {
- global.build = true
- draw_sprite(pcarved,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Jack O' Lantern"
- {
- global.build = true
- draw_sprite(plight,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Bloodstone"
- {
- global.build = true
- draw_sprite(sprite101,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Chest"
- {
- global.build = true
- draw_sprite(sprite46,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Wood Wall"
- {
- global.build = true
- draw_sprite(sprite2,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Iron Ore"
- {
- global.build = true
- draw_sprite(sprite153,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Log"
- {
- global.build = true
- draw_sprite(sprite121,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Leaves"
- {
- global.build = true
- draw_sprite(sprite120,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Bamboo Wall"
- {
- global.build = true
- draw_sprite(sprite146,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Bamboo Planks"
- {
- global.build = true
- draw_sprite(sprite145,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Barrel"
- {
- global.build = true
- draw_sprite(barrelico,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Bamboo Reed"
- {
- global.build = true
- draw_sprite(sprite147,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Lava Bucket"
- {
- global.build = true
- draw_sprite(sprite69,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Door"
- {
- global.build = true
- draw_sprite(sprite76,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Oil Pump"
- {
- global.build = true
- draw_sprite(opidle,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Wool"
- {
- global.build = true
- draw_sprite(wsprite,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "3D Printer"
- {
- global.build = true
- draw_sprite(sprite114,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Medkit"
- {
- draw_sprite(sprite93,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Wilson"
- {
- draw_sprite(wilson,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Mining Laser"
- {
- draw_sprite(ml,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Bacon"
- {
- draw_sprite(sprite99,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Volcanite Rifle"
- {
- global.bdmg = 7
- global.ammodisplay = true
- draw_sprite(sprite103,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Plasma Gun"
- {
- global.bdmg = 7
- global.ammodisplay = true
- draw_sprite(prifle,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Video Camera"
- {
- draw_sprite(sprite105,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Plastic"
- {
- draw_sprite(sprite100,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Emerald Dust"
- {
- draw_sprite(esprite,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Clock"
- {
- draw_sprite(clock,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Plasma RPG"
- {
- global.bdmg = 20
- draw_sprite(rpg,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Dynamite"
- {
- draw_sprite(sprite137,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Dagger"
- {
- global.melee = true
- global.dmg = 13
- draw_sprite(dagger,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Longsword"
- {
- global.melee = true
- global.dmg = 15
- draw_sprite(longsword,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Monster Spawner"
- {
- global.build = true
- draw_sprite(mspr,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Barbed Wire"
- {
- global.build = true
- draw_sprite(bws,-1,view_xview[0]+16,view_yview[0]+16)
- }
- if global.inv[global.ss] = "Dynamite Launcher"
- {
- draw_sprite(dl,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Chaingun"
- {
- global.bdmg = 3
- global.ammodisplay = true
- draw_sprite(chaingun,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Calandar"
- {
- draw_sprite(sprite226,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Baseball Bat"
- {
- global.dmg = 11
- global.melee = true
- draw_sprite(bb,-1,view_xview[0]+0,view_yview[0]+0)
- }
- if global.inv[global.ss] = "Magazine"
- {
- global.ammodisplay = true
- draw_sprite(magazine,-1,view_xview[0]+0,view_yview[0]+0)
- }
- draw_set_color(c_red);
- draw_text(view_xview[0]+35,view_yview[0]+0,"HP: "+string(health))
- draw_set_color(c_black);
- if health < 0
- {
- //effect_create_above(ef_explosion, x, y, 1, c_red);
- //replaced with ka_freaking_boom(); (in step event, line 88)
- }
- if dmsg = true
- {
- health = 100
- draw_text(view_xview[0]+250,view_yview[0]+250,"You died.")
- }
- if global.fpsnum = 1
- {
- draw_text(view_xview[0]+400,view_yview[0]+64,"FPS: "+string(fps))
- }
- if global.ammodisplay = true
- {
- draw_text(view_xview[0]+400,view_yview[0]+32,"Ammo: "+string(global.ammo))
- }
- //draw_sprite(bc,-1,view_xview[0]+408,view_yview[0]+0)
- //draw_text(view_xview[0]+438,view_yview[0]+0,"World Contrib: "+string(global.contrib))
- //draw_set_color(-1)
- //Name Effects
- if global.name = "sans"
- {
- draw_set_font(sans)
- }
- if global.name = "Sanic"
- {
- hsp = 5
- }
- //Time to spawn spawnmenu NPC's!
- if global.nspawnupdate = true
- {
- cursor_sprite = ncursor
- draw_text(mouse_x,mouse_y," #Press SPACE to spawn.#Press X to cancel.")
- if keyboard_check_pressed(vk_space)
- {
- instance_create(mouse_x,mouse_y,global.npctospawn)
- }
- if keyboard_check_pressed(ord('X'))
- {
- global.nspawnupdate = false
- }
- }
- //Give the items duuuuuuuuuude
- if global.ispawnupdate = true
- {
- global.inv[global.ss] = global.itemtospawn
- global.ispawnupdate = false
- }
- //change grav
- if global.gravupdate = true
- {
- grav = global.newgrav
- global.gravupdate = false
- }
- //Get the player's input
- key_right = keyboard_check(global.key_right);
- key_left = -keyboard_check(global.key_left);
- key_jump = keyboard_check_pressed(global.key_jump);
- //React to inputs
- move = key_left + key_right;
- hsp = move * movespeed;
- if (vsp < 10) vsp += grav;
- if (place_meeting(x,y+1,wbase))
- {
- vsp = key_jump * -jumpspeed
- }
- //Horizontal Collision
- if (place_meeting(x+hsp,y,wbase))
- {
- while(!place_meeting(x+sign(hsp),y,wbase))
- {
- x += sign(hsp);
- }
- hsp = 0;
- }
- x += hsp;
- //Vertical Collision
- if (place_meeting(x,y+vsp,wbase))
- {
- while(!place_meeting(x,y+sign(vsp),wbase))
- {
- y += sign(vsp);
- }
- vsp = 0;
- }
- y += vsp;
- if global.dragon = true
- {
- easy_platform_set_sprites(Def,S1,JA,Def,1)
- }
- else
- if (move!=0) image_xscale = move;
- if (place_meeting(x,y+1,wbase))
- {
- if global.skin = 0
- {if (move!=0) sprite_index = walk; else sprite_index = player}
- if global.skin = 1
- {if (move!=0) sprite_index = walkcamo; else sprite_index = playercamo}
- if global.skin = 2
- {if (move!=0) sprite_index = walkgold; else sprite_index = playergold}
- }
- else
- {
- if global.skin = 0
- {if (vsp < 0) sprite_index = jump; else sprite_index = fall}
- if global.skin = 1
- {if (vsp < 0) sprite_index = jumpcamo; else sprite_index = fallcamo}
- if global.skin = 2
- {if (move!=0) sprite_index = jumpgold; else sprite_index = fallgold}
- }
- if global.ltouch = "lactive"
- {
- }
- if global.dragon = true
- {
- }
- else
- {
- }
- //Delete on Death
- if health < 0
- {
- }
- if health < 0
- {
- ka_freaking_boom();
- alarm[1] = 5
- dmsg = true
- health = 100
- }
- //Maintain Pause Boolean
- if global.pause > 1
- {
- global.pause = 0
- }
- //Pause Room Switch
- if global.pause = 1
- {
- room_goto(Pause_Menu)
- global.pause = 0
- }
- if mouse_check_button(mb_left)
- {
- global.dubstep = true
- }
- else
- {
- global.dubstep = false
- }
- if global.dubstep = false
- {
- audio_stop_sound(sound5)
- audio_stop_sound(sound6)
- audio_stop_sound(sound10)
- audio_stop_sound(DUB)
- }
- if audio_is_playing(sound5) = false
- {
- if audio_is_playing(sound1) = false
- {
- audio_play_sound(sound1,10,true)
- }
- }
- if audio_is_playing(sound10) = false
- {
- if audio_is_playing(sound1) = false
- {
- audio_play_sound(sound1,10,true)
- }
- }
- if audio_is_playing(sound6) = false
- {
- if audio_is_playing(sound1) = false
- {
- audio_play_sound(sound1,10,true)
- }
- }
- if audio_is_playing(DUB) = false
- {
- if audio_is_playing(sound1) = false
- {
- audio_play_sound(sound1,10,true)
- }
- }
- //if global.dubstep = true
- //{
- //instance_create(x,y,dubbullet)
- //}
- if global.inv[global.ss] = "Dubstep Gun" = false
- {
- global.dubstep = false
- }
- if global.dubsong > 3
- {
- global.dubsong = 0
- }
- if global.dubsong = 0
- {
- global.dubname = "Vexare - The Clockmaker"
- }
- if global.dubsong = 1
- {
- global.dubname = "Virtual Riot - Energy Drink"
- }
- if global.dubsong = 2
- {
- global.dubname = "DJ Nate - Theory of Everything 2"
- }
- if global.dubsong = 3
- {
- global.dubname = "Robokill and Benickerson - Fusion"
- }
- if y > 1024
- {
- health = -1
- }
- if !place_meeting(x,y,ladder)
- {
- if global.lt = "yes"
- {
- global.ltouch = "lactive"
- global.lt = "no"
- }
- }
- if keyboard_check(ord("W"))
- {
- if global.inv[global.ss] = "Jetpack"
- {
- global.jetpack = "on"
- }
- }
- else
- {
- global.jetpack = "off"
- }
- if global.jetpack = "on"
- {
- global.jetpack = "set"
- easy_platform_init(0,20,20)
- }
- if !global.inv[global.ss] = "Jetpack"
- {
- global.jetpack = "off"
- }
- //Find Empty Slots
- if global.inv[0] = "Empty"
- {
- global.empty = 0
- global.empty2 = false
- }
- if global.inv[1] = "Empty"
- {
- global.empty = 1
- global.empty2 = false
- }
- if global.inv[2] = "Empty"
- {
- global.empty = 2
- global.empty2 = false
- }
- if global.inv[3] = "Empty"
- {
- global.empty = 3
- global.empty2 = false
- }
- if global.inv[4] = "Empty"
- {
- global.empty = 4
- global.empty2 = false
- }
- if global.inv[5] = "Empty"
- {
- global.empty = 5
- global.empty2 = false
- }
- if global.inv2[0,0] = "Empty"
- {
- global.empty = 0
- global.empty2 = 0
- }
- if global.inv2[1,0] = "Empty"
- {
- global.empty = 1
- global.empty2 = 0
- }
- if global.inv2[2,0] = "Empty"
- {
- global.empty = 2
- global.empty2 = 0
- }
- if global.inv2[0,1] = "Empty"
- {
- global.empty = 0
- global.empty2 = 1
- }
- if global.inv2[1,1] = "Empty"
- {
- global.empty = 1
- global.empty2 = 1
- }
- if global.inv2[2,1] = "Empty"
- {
- global.empty = 2
- global.empty2 = 1
- }
- if global.inv2[0,2] = "Empty"
- {
- global.empty = 0
- global.empty2 = 2
- }
- if global.inv2[1,2] = "Empty"
- {
- global.empty = 1
- global.empty2 = 2
- }
- else if global.inv2[2,2] = "Empty"
- {
- global.empty = 2
- global.empty2 = 2
- }
- else
- {
- global.empty = false
- global.empty2 = false
- }
- if !instance_exists(bed)
- {
- global.sx = 96
- global.sy = 256
- }
- if global.spawned = false
- {
- if place_empty(x, y+32)
- {
- y = y+32
- }
- if !place_empty(x, y+32)
- {
- global.spawned = true
- }
- }
- if position_meeting(x,y+1,bs)
- {
- health = -1
- }
- //Optimize
- //instance_deactivate_region(view_xview[0], view_wview[0], view_hview[0], false, true, true);
- //instance_activate_region(view_xview[0], view_yview[0], view_wview[0], view_hview[0], false);
- if global.bees = true
- {
- sprite_index = sprite102
- }
- //Half of View Set
- global.offset_x=view_wview[0]/2
- global.offset_y=view_hview[0]/2
- //Advance Time
- global.time = global.time + 1
- //Keep Time below 245760
- if global.time > 245760
- {
- global.time = 0
- }
- background_color = make_color_rgb(202,122,121)
- //Crafting
- if global.crafted != false
- {
- item_create(x,y,global.c[global.cs],true)
- global.crafted = false
- }
- //Jump Achievement
- if global.jc = 1
- {
- audio_play_sound(sucess,10,false)
- global.jc = 2
- show_message_async("Achivement Unlocked: Get Over It#Jumped for the very first time!")
- }
- //Build Achievement
- if global.pc = 1
- {
- audio_play_sound(sucess,10,false)
- global.pc = 2
- show_message_async("Achivement Unlocked: Placement Test#Place your first block!")
- }
- //Keep Player In Room
- x=clamp(x, 0, room_width);
- y=clamp(y, 0, room_height);
- //Slot thing
- global.slotcount = global.slotcount + 1
- if global.slotcount > 5
- {//noscope
- global.slotcount = 0
- }
- //Slot thing 2
- global.slotcount2 = global.slotcount2 + 1
- if global.slotcount > 2
- {
- global.slotcount2 = 0
- }
- global.slotcount3 = irandom(2)
- //If no more items are in stack, make stack Empty
- if global.invcount[global.slotcount] = 0
- {
- global.inv[global.slotcount] = "Empty"
- }
- //Revert to 1 item count
- //If no more items are in stack, make stack Empty
- if global.inv[global.slotcount] != "Empty"
- {
- global.invcount[global.slotcount] = 1
- }
- if global.cpick = false
- {
- cursor_sprite = sprite74
- }
- if global.wt = true
- {
- if !position_meeting(x,y,staticw)
- {
- global.wt = false
- global.we = true
- }
- }
- if global.we = true
- {
- grav = 1
- global.we = false
- }
- if global.fs > 1
- {
- global.fs = 0
- }
- if global.crafted = true
- {
- item_create(x,y,global.c[global.cs],false)
- global.crafted = false
- }
- if global.mobspawn > 1
- {
- global.mobspawn = 0
- }
- instance_deactivate_object(wbase); //Deactivate blocks
- instance_deactivate_object(wbase2); //Deactivate walls
- instance_deactivate_object(ntest); //Deactivate npcs
- instance_deactivate_object(fluid); //Deactivate lava/water
- instance_activate_region(view_xview[0],view_yview[0],view_wview[0],view_hview[0],true); //Activate all instances inside view
- if global.ots != "none"
- {
- instance_create(x,y,global.ots)
- global.ots = "none"
- }
- if global.dubstep = true
- {
- view_xview[0] = x - irandom(50) + irandom(50)
- view_yview[0] = y - irandom(50) + irandom(50)
- }
- if global.lighting = 1
- {
- if !instance_exists(sun)
- {
- instance_create(0,96,sun)
- }
- }
- if global.flashstate > 1
- {
- global.flashstate = 0
- }
- if !instance_exists(oDropDownTester)
- {
- if global.sboxint = 1
- {
- instance_create(x,y,oDropDownTester);
- }
- }
Add Comment
Please, Sign In to add comment