JcdShrimp

code from tetrode 0.16 by julian drake

Feb 6th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //TETRODE 1.6 CODE BY JULIAN DRAKE
  2. //DEMONSTRATION PURPOSES ONLY!!
  3.  
  4. ///Override me for each option
  5.  
  6. switch(selected)
  7. {
  8.     case 0:
  9.         room_goto(NSelect_Room)
  10.         break;
  11.     case 1:
  12.         room_goto(ISelect_Room);
  13.         break;
  14.     case 2:
  15.         global.inv[global.ss] = get_string("Give what item?", "")
  16.         break;
  17.     case 3:
  18.         health = get_integer("Change health to what?", 100)
  19.         break;
  20.     case 4:
  21.         global.newgrav = get_integer("Change gravity to what?", 1)
  22.         global.gravupdate = true
  23.         break;
  24.     default: break;
  25. }
  26.  
  27. instance_destroy();
  28.  
  29.  
  30. if global.c2e = "DR4G0N"
  31.     {
  32.     global.dragon = true
  33.     health = 500
  34.     output = "Enjoy your dragonic powers!"
  35.     }
  36. if global.c2e = "Give"
  37.     {
  38.     global.inv[global.ss] = get_string("Replace selected slot with: ","")
  39.     output = "Thank you for shopping at Cheatymart!"
  40.     }
  41. if global.c2e = "IHateFun"
  42.     {
  43.     health = 1000000
  44.     output = "So do we!"
  45.     }
  46. if global.c2e = "Kill"
  47.     {
  48.     health = -1
  49.     output = "RIP"
  50.     }
  51. if global.c2e = "HEYEAYYEA"
  52.     {
  53.     url_open( 'https://www.youtube.com/watch?v=ZZ5LpwO-An4' );
  54.     }
  55. if global.c2e = "CLEV"
  56.     {
  57.     level = get_string("Level to change to: ","")
  58.     room_goto(level)
  59.     }
  60. if global.c2e = "Items"
  61.     {
  62.     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")
  63.     }
  64. if global.c2e = "Changename"
  65.     {
  66.     arg1 = get_string("New Name: ","")
  67.     name = arg1
  68.     }
  69. if global.c2e = "Changegrid"
  70.     {
  71.     arg1 = get_integer("New Grid Size: (Default is 32)",32)
  72.     global.grid = arg1
  73.     }
  74. if global.c2e = "Changeweather"
  75.     {
  76.     arg1 = get_string("New Weather: ","Clear")
  77.     global.weather = arg1
  78.     }
  79. if global.c2e = "Seed"
  80.     {
  81.     show_message(string(global.sd))
  82.     }
  83. if global.c2e = "NO NOT THE BEES!"
  84.     {
  85.     global.bees = true
  86.     }
  87. if global.c2e = "Giveammo"
  88.     {
  89.     global.ammo = 9999999999999
  90.     }
  91. if global.c2e = "Spawnobj"
  92.     {
  93.     arg1 = get_string("Object to spawn: ","")
  94.     global.ots = arg1
  95.     }
  96. if global.c2e = "Giveslot"
  97.     {
  98.     level = get_integer("Slot to give to: ","")
  99.     arg1 = get_string("Item to give in slot: ","")
  100.     global.inv[level] = arg1
  101.     }
  102. if global.c2e = "Enablesbox"
  103.     {
  104.     global.sbox = 1
  105.     }
  106. level = ""
  107. global.c2e = ""
  108. arg1 = ""
  109.  
  110. randomize()
  111. if global.sd = 0
  112.     {
  113.     global.sd = irandom(999999)
  114.     random_set_seed(global.sd)
  115.     }
  116. else
  117.     {
  118.     random_set_seed(global.sd)
  119.     }
  120. p=10 // POSITION // START GENERATES FROM THIS HEIGHT // 10
  121. v=2 // VELOCITY // THIS WILL INCREASE THE HEIGHT BY 2 //
  122. a=-1 // ACCELERATION // THIS WILL DECREASE VELOCITY BY 1 // -1
  123.  
  124.             // TOP (GRASS) //
  125. for(i=0;i<room_width;i+=32){ // THIS WILL KEEP GENERATE THE WORLD UNTIL IT REACHES ITS END //
  126.     instance_create(i,room_height-(p*32),object30) // THIS WILL CREATE THE TOP LAYER //  
  127.             // MIDDLE (DIRT) //
  128.     for(m=room_height-((p-1)*32);m<room_height;m+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //
  129.         if m<room_height-((p-4)*32){
  130.             instance_create(i,m,DirtBlock)
  131.         }
  132.     }
  133.             // BOTTOM (STONE) //
  134.     for(b=room_height-((p)*32);b<room_height;b+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //]
  135.     num = irandom(14)
  136.         if num = 0
  137.             {
  138.             instance_create(i,b,oil)
  139.             }
  140.         if num = 1
  141.             {
  142.             instance_create(i,b,iore)
  143.             }
  144.         if num > 1
  145.             {
  146.             instance_create(i,b,object29)
  147.             }
  148.     }
  149.     p+=v
  150.     v+=a
  151.     a=choose(-2,-1,0,1,2)
  152.    
  153.         // TERRAIN SHAPE //
  154.     if p>12{p=12 v=0 a=-abs(a)}
  155.     if p<7{p=7 v=0 a=abs(a)}
  156. }
  157. instance_destroy()
  158.  
  159.  
  160. /*
  161. I think, therefore I am.
  162. */
  163.  
  164.  
  165.  
  166. //Make random truly random
  167. randomize()
  168.  
  169. //Initialize Physics
  170. grav = 1;
  171. hsp = 0;
  172. vsp = 0;
  173. movespeed = 7
  174. jumpspeed = 14
  175.  
  176. //Initialize Variables
  177. global.sx = 96
  178. global.sy = 256
  179. global.jdraw = false
  180. global.jetpack = ""
  181. global.lt = "no"
  182. global.ltouch = ""
  183. global.name = ""
  184. global.dubsong = 0
  185. global.dubstep = false
  186. global.c2e = ""
  187. global.cheat = false
  188. global.dragon = false
  189. global.grid = 32
  190. global.spawned = false
  191. global.bees = false
  192. global.recording = true
  193. global.msgclose = false
  194. global.mtext = ""
  195. global.time = 0
  196. global.held = "Empty"
  197. global.empty2 = "";
  198. global.cs = 0
  199. global.crafted = false
  200. global.s = 0
  201. global.jc = 0
  202. global.pc = 0
  203. global.slotcount = 0
  204. global.slotcount2 = 0
  205. global.wt = false
  206. global.we = true
  207. global.dx = 0
  208. global.dy = 0
  209. global.dc = 0
  210. global.cdisplay = false
  211. myheight = 0
  212. mywidth = 0
  213. global.woolcolor = -1
  214. global.cpick = false
  215. global.boom = false
  216. global.ammo = 10
  217. global.ammodisplay = false
  218. global.dmg = 0
  219. global.money = 0
  220. global.mobspawn = 0
  221. global.ots = "none"
  222. global.drawnslot = 0
  223. global.contrib = 0
  224. global.flashstate = 0
  225. global.sbox = 1
  226. global.npctospawn = ""
  227. global.nspawnupdate = false
  228. global.itemtospawn = ""
  229. global.ispawnupdate = false
  230. global.newgrav = 0
  231. global.gravupdate = false
  232.  
  233. snum = 0
  234. global.pause = 0
  235. alarm[3] = 5
  236. alarm[4] = 5
  237. alarm[5] = 2
  238. alarm[6] = 1800
  239. alarm[7] = 120
  240.  
  241. global.attackcooldown = 10
  242. global.canattack = false
  243.  
  244. x = 96
  245. y = 256
  246. //Physics Settings and Inv Init
  247.  
  248.  
  249. global.builddist = 180
  250. global.build = false
  251. global.destroy = false
  252. global.attack = false
  253. global.wdestroy = false
  254.  
  255. //QuickBar init
  256. global.inv[0] = "Handgun"
  257. global.inv[1] = "Magazine"
  258. global.inv[2] = "Magazine"
  259. global.inv[3] = "Medkit"
  260. global.inv[4] = "Pocket Knife"
  261. global.inv[5] = "None"
  262. global.ss = 0
  263.  
  264. //QuickBar count init
  265. global.invcount[0] = 3
  266. global.invcount[1] = 1
  267. global.invcount[2] = 1
  268. global.invcount[3] = 1
  269. global.invcount[4] = 1
  270. global.invcount[5] = 1
  271.  
  272. //Inv init (3x3 grid)
  273. global.inv2[0,0] = "Empty"
  274. global.inv2[1,0] = "Empty"
  275. global.inv2[2,0] = "Mining Laser"
  276. global.inv2[0,1] = "Empty"
  277. global.inv2[1,1] = "Empty"
  278. global.inv2[2,1] = "Jetpack"
  279. global.inv2[0,2] = "Empty"
  280. global.inv2[1,2] = "Empty"
  281. global.inv2[2,2] = "Empty"
  282.  
  283. //Inv count init (3x3 grid)
  284. global.invcount2[0,0] = 0
  285. global.invcount2[1,0] = 0
  286. global.invcount2[2,0] = 1
  287. global.invcount2[0,1] = 0
  288. global.invcount2[1,1] = 0
  289. global.invcount2[2,1] = 1
  290. global.invcount2[0,2] = 0
  291. global.invcount2[1,2] = 0
  292. global.invcount2[2,2] = 0
  293.  
  294. //Crafting init
  295. //1st Num = id
  296. //2nd Num = plastic needed
  297. global.c[0] = "Standard Pickaxe"
  298. global.c[1] = "wallblock"
  299. global.c[2] = "Paper"
  300. global.c[3] = "Eerie Gemstone"
  301. global.c[4] = "Brick"
  302. global.c[5] = "Drill"
  303. global.c[6] = "Jetpack"
  304. global.c[7] = "Pocket Knife"
  305. global.c[8] = "Camera"
  306. global.c[9] = "Handgun"
  307. global.c[10] = "Label Maker"
  308. global.c[11] = "Assault Rifle"
  309. global.c[12] = "Shotgun"
  310. global.c[13] = "Dubstep Gun"
  311. global.c[14] = "ADS Kit"
  312. global.c[15] = "Water Bucket"
  313. global.c[16] = "Bucket"
  314. global.c[17] = "Stone"
  315. global.c[18] = "Grass"
  316. global.c[19] = "Sand"
  317. global.c[20] = "Glass"
  318. global.c[21] = "Bed"
  319. global.c[22] = "Glass Wall"
  320. global.c[23] = "Bloodstone"
  321. global.c[24] = "Metal"
  322. global.c[25] = "Metal Wall"
  323. global.c[26] = "Ladder"
  324. global.c[27] = "Wood Wall"
  325. global.c[28] = "Lava Bucket"
  326. global.c[29] = "Chest"
  327. global.c[30] = "Door"
  328. global.c[31] = "Medkit"
  329. global.c[32] = "Wilson"
  330. global.c[33] = "Mining Laser"
  331. global.c[34] = "Volcanite Rifle"
  332. global.c[35] = "Bacon"
  333. global.c[36] = "Clock"
  334. global.c[37] = "Plasma RPG"
  335. global.c[38] = "Log"
  336. global.c[39] = "Leaves"
  337. global.c[40] = "Emerald Dust"
  338. global.c[41] = "Torch"
  339. global.c[42] = "Dynamite"
  340. global.c[43] = "Magazine"
  341. global.c[44] = "Dagger"
  342. global.c[45] = "Bamboo Wall"
  343. global.c[46] = "Bamboo Planks"
  344. global.c[47] = "Bamboo Reed"
  345. global.c[48] = "Atom Destabilizer"
  346. global.c[49] = "Monster Spawner"
  347. global.c[50] = "Light"
  348. global.c[51] = "Dyanmite Launcher"
  349. global.c[52] = "Chaingun"
  350. global.c[53] = "Longsword"
  351. global.c[54] = "Plasma Gun"
  352. global.c[55] = "Baseball Bat"
  353. global.c[56] = "Pumpkin"
  354. global.c[57] = "Carved Pumpkin"
  355. global.c[58] = "Jack O' Lantern"
  356. global.c[59] = "Gyrojet Gun"
  357. global.c[60] = "Gyrojet Gun Mk II"
  358. dmsg = false
  359.  
  360. audio_group_set_gain(SFX,global.agg1,0)
  361.  
  362. last_chat_id = 0
  363. chat_text = ""
  364. chat_count = 1
  365.  
  366. view_wview[0] = 1680;
  367. view_hview[0] = 1050;
  368.  
  369. show_debug_message("Debug Console Code is 882246469713. USE RESPONSIBLY!");
  370.  
  371.  
  372. cursor_sprite = sprite74
  373. global.melee = false
  374. global.ammodisplay = false
  375. global.dmg = 0
  376. global.bdmg = 0
  377. //Check Build/Destroy Validity
  378. if point_in_circle(mouse_x,mouse_y,x,y,global.builddist)
  379.    {
  380.    if global.inv[global.ss] = "Brick"
  381.        {
  382.        global.build = true
  383.        global.destroy = false
  384.        global.wdestroy = false
  385.        global.attack = false
  386.        }
  387.    if global.inv[global.ss] = "Dirt"
  388.        {
  389.        global.build = true
  390.        global.destroy = false
  391.        global.wdestroy = false
  392.        global.attack = false
  393.        }
  394.    if global.inv[global.ss] = "Glass"
  395.        {
  396.        global.build = true
  397.        global.destroy = false
  398.        global.wdestroy = false
  399.        global.attack = false
  400.        }
  401.    if global.inv[global.ss] = "wallblock"
  402.        {
  403.        global.build = true
  404.        global.destroy = false
  405.        global.wdestroy = false
  406.        global.attack = false
  407.        }
  408.    else if global.inv[global.ss] = "Stone"
  409.        {
  410.        global.build = true
  411.        global.destroy = false
  412.        global.wdestroy = false
  413.        global.attack = false
  414.        }
  415.    else
  416.        {
  417.        global.build = false
  418.        }
  419.    if global.inv[global.ss] = "Water Bucket"
  420.        {
  421.        global.build = true
  422.        global.destroy = false
  423.        global.wdestroy = false
  424.        global.attack = false
  425.        }
  426.    else
  427.        {
  428.        global.wdestroy = false
  429.        }
  430.    if global.inv[global.ss] = "Drill"
  431.        {
  432.        global.build = false
  433.        global.destroy = true
  434.        global.wdestroy = false
  435.        global.attack = false
  436.        //draw_text(0,0,"Can destroy.")
  437.        }
  438.    else if global.inv[global.ss] = "Standard Pickaxe"
  439.        {
  440.        global.build = false
  441.        global.destroy = true
  442.        global.wdestroy = false
  443.        global.attack = false
  444.        //draw_text(0,0,"Can destroy.")
  445.        }
  446.    else
  447.        {
  448.        global.destroy = false
  449.        }
  450.    if global.inv[global.ss] = "Pocket Knife"
  451.        {
  452.        global.build = false
  453.        global.destroy = false
  454.        global.attack = true
  455.        //draw_text(0,0,"Can destroy.")
  456.        }
  457.    else
  458.        {
  459.        global.attack = false
  460.        }
  461.    if global.inv[global.ss] = "Bucket"
  462.        {
  463.        global.build = false
  464.        global.destroy = false
  465.        global.attack = false
  466.        global.wdestroy = true
  467.        }
  468.    else
  469.        {
  470.        global.wdestroy = false
  471.        }
  472.    }
  473. else
  474.    {
  475.    global.destroy = false
  476.    global.build = false
  477.    global.attack = false
  478.    //draw_text(0,0,"Cannot build.")
  479.    }
  480. //Draw Selected Inv Slot
  481. draw_text(view_xview[0]+0,view_yview[0]+32,global.inv[global.ss])
  482. draw_text(view_xview[0]+0,view_yview[0]+50,"Slot "+string(global.drawnslot))
  483.  
  484. if global.ss = 0
  485.    {
  486.    global.drawnslot = 1
  487.    }
  488. if global.ss = 1
  489.    {
  490.    global.drawnslot = 2
  491.    }
  492. if global.ss = 2
  493.    {
  494.    global.drawnslot = 3
  495.    }
  496. if global.ss = 3
  497.    {
  498.    global.drawnslot = 4
  499.    }
  500. if global.ss = 4
  501.    {
  502.    global.drawnslot = 5
  503.    }
  504. if global.ss = 5
  505.    {
  506.    global.drawnslot = 6
  507.    }
  508. //Draw Inv Item Sprites
  509. if global.inv[global.ss] = "Standard Pickaxe"
  510.    {
  511.    draw_sprite(sprite4,-1,view_xview[0]+0,view_yview[0]+0)
  512.    }
  513. if global.inv[global.ss] = "wallblock"
  514.    {
  515.    draw_sprite(sprite67,-1,view_xview[0]+16,view_yview[0]+16)
  516.    }
  517. if global.inv[global.ss] = "Paper"
  518.    {
  519.    draw_sprite(sprite7,-1,view_xview[0]+0,view_yview[0]+0)
  520.    }
  521. if global.inv[global.ss] = "Eerie Gemstone"
  522.    {
  523.    draw_sprite(sprite21,-1,view_xview[0]+0,view_yview[0]+0)
  524.    }
  525. if global.inv[global.ss] = "Brick"
  526.    {
  527.    draw_sprite(sprite20,-1,view_xview[0]+16,view_yview[0]+16)
  528.    }
  529. if global.inv[global.ss] = "Drill"
  530.    {
  531.    draw_sprite(sprite22,-1,view_xview[0]+0,view_yview[0]+0)
  532.    }
  533. if global.inv[global.ss] = "Jetpack"
  534.    {
  535.    draw_sprite(sprite72,-1,view_xview[0]+0,view_yview[0]+0)
  536.    }
  537. if global.inv[global.ss] = "Pocket Knife"
  538.    {
  539.    global.dmg = 10
  540.    global.melee = true
  541.    draw_sprite(sprite27,-1,view_xview[0]+0,view_yview[0]+0)
  542.    }
  543. if global.inv[global.ss] = "Atom Destabilizer"
  544.    {
  545.    global.dmg = 40
  546.    global.melee = true
  547.    draw_sprite(ns,-1,view_xview[0]+0,view_yview[0]+0)
  548.    }
  549. if global.inv[global.ss] = "Camera"
  550.    {
  551.    draw_sprite(sprite31,-1,view_xview[0]+0,view_yview[0]+0)
  552.    }
  553. if global.inv[global.ss] = "Handgun"
  554.    {
  555.    global.bdmg = 10
  556.    global.ammodisplay = true
  557.    draw_sprite(sprite28,-1,view_xview[0]+0,view_yview[0]+0)
  558.    }
  559. if global.inv[global.ss] = "Gyrojet Gun"
  560.    {
  561.    global.bdmg = 20
  562.    global.ammodisplay = true
  563.    draw_sprite(gj1,-1,view_xview[0]+0,view_yview[0]+0)
  564.    }
  565. if global.inv[global.ss] = "Gyrojet Gun Mk II"
  566.    {
  567.    global.bdmg = 22
  568.    global.ammodisplay = true
  569.    draw_sprite(gj2,-1,view_xview[0]+0,view_yview[0]+0)
  570.    }
  571. if global.inv[global.ss] = "Label Maker"
  572.    {
  573.    draw_sprite(sprite43,-1,view_xview[0]+0,view_yview[0]+0)
  574.    }
  575. if global.inv[global.ss] = "Assault Rifle"
  576.    {
  577.    global.bdmg = 5
  578.    global.ammodisplay = true
  579.    draw_sprite(sprite39,-1,view_xview[0]+0,view_yview[0]+0)
  580.    }
  581. if global.inv[global.ss] = "Shotgun"
  582.    {
  583.    global.bdmg = 12
  584.    global.ammodisplay = true
  585.    draw_sprite(sprite45,-1,view_xview[0]+0,view_yview[0]+0)
  586.    }
  587. if global.inv[global.ss] = "Dubstep Gun"
  588.    {
  589.    global.bdmg = 2
  590.    draw_sprite(sprite52,-1,view_xview[0]+0,view_yview[0]+0)
  591.    draw_text(view_xview[0]+0,view_yview[0]+70,global.dubname)
  592.    }
  593. if global.inv[global.ss] = "ADS Kit"
  594.    {
  595.    draw_sprite(sprite54,-1,view_xview[0]+0,view_yview[0]+0)
  596.    }
  597. if global.inv[global.ss] = "Water Bucket"
  598.    {
  599.    draw_sprite(sprite63,-1,view_xview[0]+0,view_yview[0]+0)
  600.    }
  601. if global.inv[global.ss] = "Bucket"
  602.    {
  603.    draw_sprite(sprite64,-1,view_xview[0]+0,view_yview[0]+0)
  604.    }
  605. if global.inv[global.ss] = "Stone"
  606.    {
  607.    global.build = true
  608.    draw_sprite(sprite34,-1,view_xview[0]+16,view_yview[0]+16)
  609.    }
  610. if global.inv[global.ss] = "Dirt"
  611.    {
  612.    global.build = true
  613.    draw_sprite(Dirt,-1,view_xview[0]+16,view_yview[0]+16)
  614.    }
  615. if global.inv[global.ss] = "Grass"
  616.    {
  617.    global.build = true
  618.    draw_sprite(sprite36,-1,view_xview[0]+16,view_yview[0]+16)
  619.    }
  620. if global.inv[global.ss] = "Sand"
  621.    {
  622.    global.build = true
  623.    draw_sprite(sprite62,-1,view_xview[0]+16,view_yview[0]+16)
  624.    }
  625. if global.inv[global.ss] = "Light"
  626.    {
  627.    global.build = true
  628.    draw_sprite(sprite159,-1,view_xview[0]+16,view_yview[0]+16)
  629.    }
  630. if global.inv[global.ss] = "Glass"
  631.    {
  632.    global.build = true
  633.    draw_sprite(sprite65,-1,view_xview[0]+16,view_yview[0]+16)
  634.    }
  635. if global.inv[global.ss] = "Glass Wall"
  636.    {
  637.    global.build = true
  638.    draw_sprite(sprite66,-1,view_xview[0]+16,view_yview[0]+16)
  639.    }
  640. if global.inv[global.ss] = "Bed"
  641.    {
  642.    global.build = true
  643.    draw_sprite(beditem,-1,view_xview[0]+16,view_yview[0]+16)
  644.    }
  645. if global.inv[global.ss] = "Metal"
  646.    {
  647.    global.build = true
  648.    draw_sprite(sprite89,-1,view_xview[0]+16,view_yview[0]+16)
  649.    }
  650. if global.inv[global.ss] = "Metal Wall"
  651.    {
  652.    global.build = true
  653.    draw_sprite(sprite90,-1,view_xview[0]+16,view_yview[0]+16)
  654.    }
  655. if global.inv[global.ss] = "Ladder"
  656.    {
  657.    global.build = true
  658.    draw_sprite(sprite70,-1,view_xview[0]+16,view_yview[0]+16)
  659.    }
  660. if global.inv[global.ss] = "Pumpkin"
  661.    {
  662.    global.build = true
  663.    draw_sprite(pplain,-1,view_xview[0]+16,view_yview[0]+16)
  664.    }
  665. if global.inv[global.ss] = "Carved Pumpkin"
  666.    {
  667.    global.build = true
  668.    draw_sprite(pcarved,-1,view_xview[0]+16,view_yview[0]+16)
  669.    }
  670. if global.inv[global.ss] = "Jack O' Lantern"
  671.     {
  672.     global.build = true
  673.     draw_sprite(plight,-1,view_xview[0]+16,view_yview[0]+16)
  674.     }
  675. if global.inv[global.ss] = "Bloodstone"
  676.     {
  677.     global.build = true
  678.     draw_sprite(sprite101,-1,view_xview[0]+16,view_yview[0]+16)
  679.     }
  680. if global.inv[global.ss] = "Chest"
  681.     {
  682.     global.build = true
  683.     draw_sprite(sprite46,-1,view_xview[0]+16,view_yview[0]+16)
  684.     }
  685. if global.inv[global.ss] = "Wood Wall"
  686.     {
  687.     global.build = true
  688.     draw_sprite(sprite2,-1,view_xview[0]+16,view_yview[0]+16)
  689.     }
  690. if global.inv[global.ss] = "Iron Ore"
  691.     {
  692.     global.build = true
  693.     draw_sprite(sprite153,-1,view_xview[0]+16,view_yview[0]+16)
  694.     }
  695. if global.inv[global.ss] = "Log"
  696.     {
  697.     global.build = true
  698.     draw_sprite(sprite121,-1,view_xview[0]+16,view_yview[0]+16)
  699.     }
  700. if global.inv[global.ss] = "Leaves"
  701.     {
  702.     global.build = true
  703.     draw_sprite(sprite120,-1,view_xview[0]+16,view_yview[0]+16)
  704.     }
  705. if global.inv[global.ss] = "Bamboo Wall"
  706.     {
  707.     global.build = true
  708.     draw_sprite(sprite146,-1,view_xview[0]+16,view_yview[0]+16)
  709.     }
  710. if global.inv[global.ss] = "Bamboo Planks"
  711.     {
  712.     global.build = true
  713.     draw_sprite(sprite145,-1,view_xview[0]+16,view_yview[0]+16)
  714.     }
  715. if global.inv[global.ss] = "Barrel"
  716.     {
  717.     global.build = true
  718.     draw_sprite(barrelico,-1,view_xview[0]+16,view_yview[0]+16)
  719.     }
  720. if global.inv[global.ss] = "Bamboo Reed"
  721.     {
  722.     global.build = true
  723.     draw_sprite(sprite147,-1,view_xview[0]+16,view_yview[0]+16)
  724.     }
  725. if global.inv[global.ss] = "Lava Bucket"
  726.     {
  727.     global.build = true
  728.     draw_sprite(sprite69,-1,view_xview[0]+0,view_yview[0]+0)
  729.     }
  730. if global.inv[global.ss] = "Door"
  731.     {
  732.     global.build = true
  733.     draw_sprite(sprite76,-1,view_xview[0]+16,view_yview[0]+16)
  734.     }
  735. if global.inv[global.ss] = "Oil Pump"
  736.     {
  737.     global.build = true
  738.     draw_sprite(opidle,-1,view_xview[0]+16,view_yview[0]+16)
  739.     }
  740. if global.inv[global.ss] = "Wool"
  741.     {
  742.     global.build = true
  743.     draw_sprite(wsprite,-1,view_xview[0]+16,view_yview[0]+16)
  744.     }
  745. if global.inv[global.ss] = "3D Printer"
  746.     {
  747.     global.build = true
  748.     draw_sprite(sprite114,-1,view_xview[0]+16,view_yview[0]+16)
  749.     }
  750. if global.inv[global.ss] = "Medkit"
  751.     {
  752.     draw_sprite(sprite93,-1,view_xview[0]+0,view_yview[0]+0)
  753.     }
  754. if global.inv[global.ss] = "Wilson"
  755.     {
  756.     draw_sprite(wilson,-1,view_xview[0]+0,view_yview[0]+0)
  757.     }
  758. if global.inv[global.ss] = "Mining Laser"
  759.     {
  760.     draw_sprite(ml,-1,view_xview[0]+0,view_yview[0]+0)
  761.     }
  762. if global.inv[global.ss] = "Bacon"
  763.     {
  764.     draw_sprite(sprite99,-1,view_xview[0]+0,view_yview[0]+0)
  765.     }    
  766. if global.inv[global.ss] = "Volcanite Rifle"
  767.     {
  768.     global.bdmg = 7
  769.     global.ammodisplay = true
  770.     draw_sprite(sprite103,-1,view_xview[0]+0,view_yview[0]+0)
  771.     }
  772. if global.inv[global.ss] = "Plasma Gun"
  773.     {
  774.     global.bdmg = 7
  775.     global.ammodisplay = true
  776.     draw_sprite(prifle,-1,view_xview[0]+0,view_yview[0]+0)
  777.     }
  778. if global.inv[global.ss] = "Video Camera"
  779.     {
  780.     draw_sprite(sprite105,-1,view_xview[0]+0,view_yview[0]+0)
  781.     }    
  782. if global.inv[global.ss] = "Plastic"
  783.     {
  784.     draw_sprite(sprite100,-1,view_xview[0]+0,view_yview[0]+0)
  785.     }    
  786. if global.inv[global.ss] = "Emerald Dust"
  787.     {
  788.     draw_sprite(esprite,-1,view_xview[0]+0,view_yview[0]+0)
  789.     }      
  790. if global.inv[global.ss] = "Clock"
  791.     {
  792.     draw_sprite(clock,-1,view_xview[0]+0,view_yview[0]+0)
  793.     }      
  794. if global.inv[global.ss] = "Plasma RPG"
  795.     {
  796.     global.bdmg = 20
  797.     draw_sprite(rpg,-1,view_xview[0]+0,view_yview[0]+0)
  798.     }
  799. if global.inv[global.ss] = "Dynamite"
  800.     {
  801.     draw_sprite(sprite137,-1,view_xview[0]+0,view_yview[0]+0)
  802.     }      
  803. if global.inv[global.ss] = "Dagger"
  804.     {
  805.     global.melee = true
  806.     global.dmg = 13
  807.     draw_sprite(dagger,-1,view_xview[0]+0,view_yview[0]+0)
  808.     }    
  809. if global.inv[global.ss] = "Longsword"
  810.     {
  811.     global.melee = true
  812.     global.dmg = 15
  813.     draw_sprite(longsword,-1,view_xview[0]+0,view_yview[0]+0)
  814.     }  
  815. if global.inv[global.ss] = "Monster Spawner"
  816.     {
  817.     global.build = true
  818.     draw_sprite(mspr,-1,view_xview[0]+16,view_yview[0]+16)
  819.     }
  820. if global.inv[global.ss] = "Barbed Wire"
  821.     {
  822.     global.build = true
  823.     draw_sprite(bws,-1,view_xview[0]+16,view_yview[0]+16)
  824.     }
  825. if global.inv[global.ss] = "Dynamite Launcher"
  826.     {
  827.     draw_sprite(dl,-1,view_xview[0]+0,view_yview[0]+0)
  828.     }
  829. if global.inv[global.ss] = "Chaingun"
  830.     {
  831.     global.bdmg = 3
  832.     global.ammodisplay = true
  833.     draw_sprite(chaingun,-1,view_xview[0]+0,view_yview[0]+0)
  834.     }
  835. if global.inv[global.ss] = "Calandar"
  836.     {
  837.     draw_sprite(sprite226,-1,view_xview[0]+0,view_yview[0]+0)
  838.     }
  839. if global.inv[global.ss] = "Baseball Bat"
  840.     {
  841.     global.dmg = 11
  842.     global.melee = true
  843.     draw_sprite(bb,-1,view_xview[0]+0,view_yview[0]+0)
  844.     }
  845. if global.inv[global.ss] = "Magazine"
  846.     {
  847.     global.ammodisplay = true
  848.     draw_sprite(magazine,-1,view_xview[0]+0,view_yview[0]+0)
  849.     }      
  850.  
  851. draw_set_color(c_red);
  852. draw_text(view_xview[0]+35,view_yview[0]+0,"HP: "+string(health))
  853.  
  854. draw_set_color(c_black);
  855. if health < 0
  856.     {
  857.     //effect_create_above(ef_explosion, x, y, 1, c_red);
  858.     //replaced with ka_freaking_boom(); (in step event, line 88)
  859.     }
  860.  
  861. if dmsg = true
  862.     {
  863.     health = 100
  864.     draw_text(view_xview[0]+250,view_yview[0]+250,"You died.")
  865.     }
  866.    
  867. if global.fpsnum = 1
  868.     {
  869.     draw_text(view_xview[0]+400,view_yview[0]+64,"FPS: "+string(fps))
  870.     }
  871. if global.ammodisplay = true
  872.     {
  873.     draw_text(view_xview[0]+400,view_yview[0]+32,"Ammo: "+string(global.ammo))
  874.     }
  875. //draw_sprite(bc,-1,view_xview[0]+408,view_yview[0]+0)
  876.  
  877. //draw_text(view_xview[0]+438,view_yview[0]+0,"World Contrib: "+string(global.contrib))
  878. //draw_set_color(-1)
  879. //Name Effects
  880. if global.name = "sans"
  881.     {
  882.     draw_set_font(sans)
  883.     }
  884. if global.name = "Sanic"
  885.     {
  886.     hsp = 5
  887.     }
  888.  
  889. //Time to spawn spawnmenu NPC's!
  890. if global.nspawnupdate = true
  891.     {
  892.     cursor_sprite = ncursor
  893.     draw_text(mouse_x,mouse_y," #Press SPACE to spawn.#Press X to cancel.")
  894.     if keyboard_check_pressed(vk_space)
  895.         {
  896.         instance_create(mouse_x,mouse_y,global.npctospawn)
  897.         }
  898.     if keyboard_check_pressed(ord('X'))
  899.         {
  900.         global.nspawnupdate = false
  901.         }
  902.     }
  903. //Give the items duuuuuuuuuude
  904. if global.ispawnupdate = true
  905.     {
  906.     global.inv[global.ss] = global.itemtospawn
  907.     global.ispawnupdate = false
  908.     }
  909. //change grav
  910. if global.gravupdate = true
  911.     {
  912.     grav = global.newgrav
  913.     global.gravupdate = false
  914.     }
  915. //Get the player's input
  916. key_right = keyboard_check(global.key_right);
  917. key_left = -keyboard_check(global.key_left);
  918. key_jump = keyboard_check_pressed(global.key_jump);
  919.  
  920. //React to inputs
  921. move = key_left + key_right;
  922. hsp = move * movespeed;
  923. if (vsp < 10) vsp += grav;
  924.  
  925. if (place_meeting(x,y+1,wbase))
  926. {
  927.    vsp = key_jump * -jumpspeed
  928. }
  929.  
  930. //Horizontal Collision
  931. if (place_meeting(x+hsp,y,wbase))
  932. {
  933.    while(!place_meeting(x+sign(hsp),y,wbase))
  934.    {
  935.        x += sign(hsp);
  936.    }
  937.    hsp = 0;
  938. }
  939. x += hsp;
  940.  
  941. //Vertical Collision
  942. if (place_meeting(x,y+vsp,wbase))
  943. {
  944.    while(!place_meeting(x,y+sign(vsp),wbase))
  945.    {
  946.        y += sign(vsp);
  947.    }
  948.    vsp = 0;
  949. }
  950. y += vsp;
  951.  
  952. if global.dragon = true
  953.    {
  954.    easy_platform_set_sprites(Def,S1,JA,Def,1)
  955.  
  956.    }
  957. else
  958. if (move!=0) image_xscale = move;
  959. if (place_meeting(x,y+1,wbase))
  960. {
  961.     if global.skin = 0
  962.        {if (move!=0) sprite_index = walk; else sprite_index = player}
  963.     if global.skin = 1
  964.        {if (move!=0) sprite_index = walkcamo; else sprite_index = playercamo}
  965.     if global.skin = 2
  966.        {if (move!=0) sprite_index = walkgold; else sprite_index = playergold}
  967. }
  968. else
  969. {
  970.     if global.skin = 0
  971.         {if (vsp < 0) sprite_index = jump; else sprite_index = fall}
  972.     if global.skin = 1
  973.         {if (vsp < 0) sprite_index = jumpcamo; else sprite_index = fallcamo}
  974.     if global.skin = 2
  975.        {if (move!=0) sprite_index = jumpgold; else sprite_index = fallgold}
  976. }
  977.    
  978.  
  979. if global.ltouch = "lactive"
  980.     {
  981.     }
  982.  
  983.  
  984.  
  985. if global.dragon = true
  986.     {
  987.  
  988.     }
  989.  
  990. else
  991.     {
  992.  
  993.     }
  994.    
  995. //Delete on Death
  996. if health < 0
  997.     {
  998.  
  999.     }
  1000. if health < 0
  1001.     {
  1002.     ka_freaking_boom();
  1003.     alarm[1] = 5
  1004.     dmsg = true
  1005.     health = 100
  1006.     }
  1007.    
  1008. //Maintain Pause Boolean
  1009. if global.pause > 1
  1010.     {
  1011.     global.pause = 0
  1012.     }
  1013.    
  1014. //Pause Room Switch
  1015. if global.pause = 1
  1016.     {
  1017.     room_goto(Pause_Menu)
  1018.     global.pause = 0
  1019.     }
  1020. if mouse_check_button(mb_left)
  1021.     {
  1022.     global.dubstep = true
  1023.     }
  1024. else
  1025.     {
  1026.     global.dubstep = false
  1027.     }
  1028.  
  1029. if global.dubstep = false
  1030.     {
  1031.     audio_stop_sound(sound5)
  1032.     audio_stop_sound(sound6)
  1033.     audio_stop_sound(sound10)
  1034.     audio_stop_sound(DUB)
  1035.     }
  1036. if audio_is_playing(sound5) = false
  1037.     {
  1038.     if audio_is_playing(sound1) = false
  1039.         {
  1040.         audio_play_sound(sound1,10,true)        
  1041.         }
  1042.     }
  1043. if audio_is_playing(sound10) = false
  1044.     {
  1045.     if audio_is_playing(sound1) = false
  1046.         {
  1047.         audio_play_sound(sound1,10,true)        
  1048.         }
  1049.     }
  1050. if audio_is_playing(sound6) = false
  1051.     {
  1052.     if audio_is_playing(sound1) = false
  1053.         {
  1054.         audio_play_sound(sound1,10,true)        
  1055.         }
  1056.     }
  1057. if audio_is_playing(DUB) = false
  1058.     {
  1059.     if audio_is_playing(sound1) = false
  1060.         {
  1061.         audio_play_sound(sound1,10,true)        
  1062.         }
  1063.     }
  1064. //if global.dubstep = true
  1065.     //{
  1066.     //instance_create(x,y,dubbullet)
  1067.     //}
  1068. if global.inv[global.ss] = "Dubstep Gun" = false
  1069.     {
  1070.     global.dubstep = false
  1071.     }
  1072. if global.dubsong > 3
  1073.     {
  1074.     global.dubsong = 0
  1075.     }
  1076. if global.dubsong = 0
  1077.     {
  1078.     global.dubname = "Vexare - The Clockmaker"
  1079.     }
  1080. if global.dubsong = 1
  1081.     {
  1082.     global.dubname = "Virtual Riot - Energy Drink"
  1083.     }
  1084. if global.dubsong = 2
  1085.     {
  1086.     global.dubname = "DJ Nate - Theory of Everything 2"
  1087.     }
  1088. if global.dubsong = 3
  1089.     {
  1090.     global.dubname = "Robokill and Benickerson - Fusion"
  1091.     }
  1092. if y > 1024
  1093.     {
  1094.     health = -1
  1095.     }
  1096. if !place_meeting(x,y,ladder)
  1097.     {
  1098.     if global.lt = "yes"
  1099.         {
  1100.         global.ltouch = "lactive"
  1101.         global.lt = "no"
  1102.         }
  1103.     }
  1104.    
  1105. if keyboard_check(ord("W"))
  1106.     {
  1107.     if global.inv[global.ss] = "Jetpack"
  1108.         {
  1109.         global.jetpack = "on"
  1110.         }
  1111.     }
  1112. else
  1113.     {
  1114.     global.jetpack = "off"
  1115.     }
  1116. if global.jetpack = "on"
  1117.     {
  1118.     global.jetpack = "set"
  1119.     easy_platform_init(0,20,20)
  1120.     }
  1121. if !global.inv[global.ss] = "Jetpack"
  1122.     {
  1123.     global.jetpack = "off"
  1124.     }
  1125. //Find Empty Slots
  1126. if global.inv[0] = "Empty"
  1127.     {
  1128.     global.empty = 0
  1129.     global.empty2 = false
  1130.     }
  1131. if global.inv[1] = "Empty"
  1132.     {
  1133.     global.empty = 1
  1134.     global.empty2 = false
  1135.     }
  1136. if global.inv[2] = "Empty"
  1137.     {
  1138.     global.empty = 2
  1139.     global.empty2 = false
  1140.     }
  1141. if global.inv[3] = "Empty"
  1142.     {
  1143.     global.empty = 3
  1144.     global.empty2 = false
  1145.     }
  1146. if global.inv[4] = "Empty"
  1147.     {
  1148.     global.empty = 4
  1149.     global.empty2 = false
  1150.     }
  1151. if global.inv[5] = "Empty"
  1152.     {
  1153.     global.empty = 5
  1154.     global.empty2 = false
  1155.     }
  1156. if global.inv2[0,0] = "Empty"
  1157.     {
  1158.     global.empty = 0
  1159.     global.empty2 = 0
  1160.     }
  1161. if global.inv2[1,0] = "Empty"
  1162.     {
  1163.     global.empty = 1
  1164.     global.empty2 = 0
  1165.     }
  1166. if global.inv2[2,0] = "Empty"
  1167.     {
  1168.     global.empty = 2
  1169.     global.empty2 = 0
  1170.     }
  1171. if global.inv2[0,1] = "Empty"
  1172.     {
  1173.     global.empty = 0
  1174.     global.empty2 = 1
  1175.     }
  1176. if global.inv2[1,1] = "Empty"
  1177.     {
  1178.     global.empty = 1
  1179.     global.empty2 = 1
  1180.     }
  1181. if global.inv2[2,1] = "Empty"
  1182.     {
  1183.     global.empty = 2
  1184.     global.empty2 = 1
  1185.     }
  1186. if global.inv2[0,2] = "Empty"
  1187.     {
  1188.     global.empty = 0
  1189.     global.empty2 = 2
  1190.     }
  1191. if global.inv2[1,2] = "Empty"
  1192.     {
  1193.     global.empty = 1
  1194.     global.empty2 = 2
  1195.     }
  1196. else if global.inv2[2,2] = "Empty"
  1197.     {
  1198.     global.empty = 2
  1199.     global.empty2 = 2
  1200.     }
  1201. else
  1202.     {
  1203.     global.empty = false
  1204.     global.empty2 = false
  1205.     }
  1206.    
  1207. if !instance_exists(bed)
  1208.     {
  1209.     global.sx = 96
  1210.     global.sy = 256
  1211.     }
  1212. if global.spawned = false
  1213.     {
  1214.     if place_empty(x, y+32)
  1215.         {
  1216.         y = y+32
  1217.         }
  1218.     if !place_empty(x, y+32)
  1219.         {
  1220.         global.spawned = true
  1221.         }
  1222.     }
  1223. if position_meeting(x,y+1,bs)
  1224.     {
  1225.     health = -1
  1226.     }
  1227. //Optimize
  1228. //instance_deactivate_region(view_xview[0], view_wview[0], view_hview[0], false, true, true);
  1229. //instance_activate_region(view_xview[0], view_yview[0], view_wview[0], view_hview[0], false);
  1230. if global.bees = true
  1231.     {
  1232.     sprite_index = sprite102
  1233.     }
  1234. //Half of View Set
  1235. global.offset_x=view_wview[0]/2
  1236. global.offset_y=view_hview[0]/2
  1237. //Advance Time
  1238. global.time = global.time + 1
  1239. //Keep Time below 245760
  1240. if global.time > 245760
  1241.     {
  1242.     global.time = 0
  1243.     }
  1244. background_color = make_color_rgb(202,122,121)
  1245.  
  1246.    
  1247. //Crafting
  1248. if global.crafted != false
  1249.     {
  1250.     item_create(x,y,global.c[global.cs],true)
  1251.     global.crafted = false
  1252.     }
  1253.    
  1254. //Jump Achievement
  1255. if global.jc = 1
  1256.     {
  1257.     audio_play_sound(sucess,10,false)
  1258.     global.jc = 2
  1259.     show_message_async("Achivement Unlocked: Get Over It#Jumped for the very first time!")
  1260.     }
  1261. //Build Achievement
  1262. if global.pc = 1
  1263.     {
  1264.     audio_play_sound(sucess,10,false)
  1265.     global.pc = 2
  1266.     show_message_async("Achivement Unlocked: Placement Test#Place your first block!")
  1267.     }
  1268. //Keep Player In Room
  1269. x=clamp(x, 0, room_width);
  1270. y=clamp(y, 0, room_height);
  1271. //Slot thing
  1272. global.slotcount = global.slotcount + 1
  1273. if global.slotcount > 5
  1274.     {//noscope
  1275.     global.slotcount = 0
  1276.     }
  1277. //Slot thing 2
  1278. global.slotcount2 = global.slotcount2 + 1
  1279. if global.slotcount > 2
  1280.     {
  1281.     global.slotcount2 = 0
  1282.     }
  1283. global.slotcount3 = irandom(2)
  1284. //If no more items are in stack, make stack Empty
  1285. if global.invcount[global.slotcount] = 0
  1286.     {
  1287.     global.inv[global.slotcount] = "Empty"
  1288.     }
  1289. //Revert to 1 item count
  1290. //If no more items are in stack, make stack Empty
  1291. if global.inv[global.slotcount] != "Empty"
  1292.     {
  1293.     global.invcount[global.slotcount] = 1
  1294.     }
  1295. if global.cpick = false
  1296.     {
  1297.     cursor_sprite = sprite74
  1298.     }
  1299. if global.wt = true
  1300.     {
  1301.     if !position_meeting(x,y,staticw)
  1302.         {
  1303.         global.wt = false
  1304.         global.we = true
  1305.         }
  1306.     }
  1307. if global.we = true
  1308.     {
  1309.     grav = 1
  1310.     global.we = false
  1311.     }
  1312. if global.fs > 1
  1313.     {
  1314.     global.fs = 0
  1315.     }
  1316. if global.crafted = true
  1317.     {
  1318.     item_create(x,y,global.c[global.cs],false)
  1319.     global.crafted = false
  1320.     }
  1321. if global.mobspawn > 1
  1322.     {
  1323.     global.mobspawn = 0
  1324.     }
  1325. instance_deactivate_object(wbase); //Deactivate blocks
  1326. instance_deactivate_object(wbase2); //Deactivate walls
  1327. instance_deactivate_object(ntest); //Deactivate npcs
  1328. instance_deactivate_object(fluid); //Deactivate lava/water
  1329. instance_activate_region(view_xview[0],view_yview[0],view_wview[0],view_hview[0],true); //Activate all instances inside view
  1330.  
  1331. if global.ots != "none"
  1332.     {
  1333.     instance_create(x,y,global.ots)
  1334.     global.ots = "none"
  1335.     }
  1336. if global.dubstep = true
  1337.     {
  1338.     view_xview[0] =  x - irandom(50) + irandom(50)
  1339.     view_yview[0] = y - irandom(50) + irandom(50)
  1340.     }
  1341. if global.lighting = 1
  1342.     {
  1343.     if !instance_exists(sun)
  1344.         {
  1345.         instance_create(0,96,sun)
  1346.         }
  1347.     }
  1348. if global.flashstate > 1
  1349.     {
  1350.     global.flashstate = 0
  1351.     }
  1352.    
  1353. if !instance_exists(oDropDownTester)
  1354.     {
  1355.     if global.sboxint = 1
  1356.         {
  1357.         instance_create(x,y,oDropDownTester);
  1358.         }
  1359.     }
Add Comment
Please, Sign In to add comment