MALEFOR

Admin UI

Jul 14th, 2018
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Basic Admin mod
  2. * by MALEFOR
  3. *
  4. * Here are all of my admin functions that I've used when hosting the Fighter Series mod
  5. * Note: this is a very basic mod created by a complete scrub ;D This can definately be improved / done better
  6. * Everyone, noob or professional, has full permission to use, edit and add to this mod
  7. *
  8. * Notes:
  9. * I've left code that can spawn aliens and asteroids automatically for more abusive fun
  10. * If the god ship level is 8, it WILL FORCE survival, regardless of root_mode
  11. * A ship level that isn't a whole number, eg 7.9 - 79X, will not appear on the ship tree but will still exist in game
  12. * This can be useful as nobody can directly upgrade to them.
  13. * The only way to become the ship is through ship.set or by manually setting it using the console command game.ships[n].set(type:XXX})
  14. *
  15. */
  16. var god_791 = "Your god ship code"; // I've included mine from the Fighter series at the end
  17.  
  18. var ships = []
  19.  
  20. ships.push(god,791);
  21.  
  22. var entity = { // This is the red tint that appears across the map when the god doth have been summoned, this is not necessary
  23.   id: "alert",
  24.   obj: "https://starblast.data.neuronality.com/mods/objects/plane.obj",
  25.   emissive: "https://raw.githubusercontent.com/MALEFOR27/Entity_Detected/master/Alert_BG.png"
  26.  
  27. } ;
  28.  
  29. var danger = function(game) {
  30.   game.setObject({
  31.     id:"alert",
  32.     type:entity,
  33.     position:{x:0,y:0,z:20},
  34.     scale:{x:1000,y:1000,z:1},
  35.     rotation: {x:0,y:0,z:0}
  36.   }) ;
  37. } ;
  38.  
  39. var spawnAsteroid = function(game) {
  40.   game.addAsteroid( {
  41.     x: (Math.random()-0.5)*game.options.map_size*30,
  42.     y: (Math.random()-0.5)*game.options.map_size*30,
  43.     vx: (Math.random()-.5)*.2,
  44.     vy: (Math.random()-.5)*.2,
  45.     size: 50
  46.   }) ;
  47. } ;
  48.  
  49. var spawnAlien = function(game) {
  50.   game.addAlien( {
  51.     x: 0,
  52.     y: 0,
  53.     code: 20,
  54.     level: 1,
  55.     points: 300,
  56.     crystal_drop: 30,
  57.   }) ;
  58. } ;
  59.  
  60. var immune_button = {
  61.   id: "immune",
  62.   position: [2,40,8,14],
  63.   clickable: true,
  64.   shortcut: "Z",
  65.   visible: false,
  66.   components: [] // you can add visible components if you wish
  67. } ;
  68.  
  69. var immuneShip = function(ship) {
  70.   ship.set({invulnerable:1000}) ;
  71. } ;
  72.  
  73. var god_button = {
  74.   id: "god",
  75.   position: [2,50,8,14],
  76.   clickable: true,
  77.   shortcut: "D",
  78.   visible: false,
  79.   components: [] // you can add visible components if you wish
  80. } ;
  81.  
  82. var godShip = function(ship) {
  83.   ship.set({type:791}) ;
  84. } ;
  85.  
  86. var reset_button = {
  87.   id: "reset",
  88.   position: [2,70,8,14],
  89.   clickable: true,
  90.   shortcut: "J",
  91.   visible: true,
  92.   components: [
  93.     { type:"box",position:[0,0,100,100],fill:"#456",stroke:"#CDE",width:2},
  94.     { type: "text",position:[10,35,80,30],value:"Reset",color:"#CDE"},
  95.     { type: "text",position:[20,70,60,20],value:"[J]",color:"#CDE"}
  96.     ]
  97. } ;
  98.  
  99. var resetShip = function(ship) {
  100.   ship.set({type:101}) ;
  101. } ;
  102.  
  103. this.tick = function(game) {
  104.  if (game.step % 60 == 0)
  105.   {
  106.     for (var i=0;i<game.ships.length;i++)
  107.     {
  108.       var admin = game.ships[0] ; // This is the first person to join, make sure this is you
  109.       var ship = game.ships[i] ;  // This is everyone else
  110.       if (!admin.custom.immune_button_installed)
  111.       {
  112.         admin.custom.immune_button_installed = true;
  113.         admin.setUIComponent(immune_button);
  114.       }
  115.       if (!ship.custom.reset_button_installed)
  116.       {
  117.         ship.custom.reset_button_installed = true;
  118.         ship.setUIComponent(reset_button);
  119.       }
  120.       if (!admin.custom.god_button_installed)
  121.       {
  122.         admin.custom.god_button_installed = true;
  123.         admin.setUIComponent(god_button);
  124.       }
  125.     }
  126.   }
  127. } ;
  128.  
  129. this.event = function(event,game) {
  130.   switch (event.name)
  131.   {
  132.     case "ui_component_clicked":
  133.       var ship = event.ship ;
  134.       var component = event.id ;
  135.       if (component == "immune")
  136.       {
  137.         immuneShip(ship);
  138.       }
  139.       if (component == "god")
  140.       {
  141.         godShip(ship);
  142.         danger(game);
  143.       }
  144.       if (component == "reset")
  145.       {
  146.         resetShip(ship);
  147.       break ;
  148.     }
  149.   }
  150. } ;
  151.  
  152. var Malefor_the_Supreme_Overlord_791 = '{"name":"Malefor the Supreme Overlord","level":7.9,"model":1,"size":5,"specs":{"shield":{"capacity":[9999999,9999999],"reload":[99999999,99999999]},"generator":{"capacity":[9999999,9999999],"reload":[9999999,9999999]},"ship":{"mass":9999999,"speed":[240,240],"rotation":[400,400],"acceleration":[400,400]}},"bodies":{"main":{"section_segments":8,"offset":{"x":0,"y":-70,"z":5},"position":{"x":[0,0,0,0,0,0,-6,-10,-8,4,15,5],"y":[-40,-5,40,110,215,335,375,430,480,520,580,650],"z":[0,0,-10,-40,-50,-30,-20,-10,0,10,0,-10]},"width":[0,10,50,45,65,40,35,25,20,15,10,0],"height":[0,10,45,45,60,40,35,25,20,15,10,0],"texture":[17,5,5,17,5,5,5,5,5,5,17],"propeller":false,"laser":{"damage":[1000,1000],"rate":10,"type":1,"speed":[200,200],"number":15,"recoil":0,"error":50}},"head":{"section_segments":20,"offset":{"x":0,"y":-90,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-100,-85,-70,-50,-30,-10,20,40,60,55],"z":[-15,3,10,16,20,28,38,36,30,20]},"width":[0,14,20,25,35,40,45,40,35,0],"height":[0,4,12,6,10,20,22,20,15,0],"texture":[5]},"lower_jaw":{"section_segments":20,"offset":{"x":0,"y":-90,"z":-5},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-100,-85,-70,-50,-30,-10,20,40,60,55],"z":[-22,-28,-28,-25,-15,-10,0,10,10,10]},"width":[0,14,20,25,35,40,45,40,35,0],"height":[0,4,12,6,10,20,22,20,15,0],"texture":[5]},"horns":{"section_segments":10,"offset":{"x":14,"y":-80,"z":50},"position":{"x":[0,10,15,-5],"y":[10,40,80,140],"z":[-5,10,30,70]},"width":[12,9,5,0],"height":[12,9,5,0],"texture":[63],"angle":14},"side_horns":{"section_segments":10,"offset":{"x":30,"y":-80,"z":40},"position":{"x":[0,10,15,13],"y":[5,20,50,90],"z":[-5,7,25,60]},"width":[12,9,5,0],"height":[12,9,5,0],"texture":[63],"angle":17},"inner_horns":{"section_segments":10,"offset":{"x":5,"y":-60,"z":50},"position":{"x":[3,10,12,8],"y":[10,30,50,70],"z":[0,15,30,40]},"width":[8,5,3,0],"height":[10,7,3,0],"texture":[63],"angle":5},"top_propulsors":{"section_segments":10,"offset":{"x":90,"y":165,"z":-75},"position":{"x":[-60,-30,-25,-8,-5,-10,0,2,5,0],"y":[-90,-30,-15,10,30,70,120,150,180,170],"z":[10,10,0,0,0,25,0,0,0,0]},"width":[0,25,30,18,15,8,10,15,10,0],"height":[15,15,15,15,15,10,10,15,10,0],"propeller":false,"texture":[5,5,5,5,5,17,5,17,17]},"claw_1":{"section_segments":8,"offset":{"x":95,"y":350,"z":-83},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5,10,25,45,65,85],"z":[0,-4,-6,-4,4,15,25]},"width":[5,4,4,3,2,1,0],"height":[7,5,4,3,3,1,0],"texture":[5]},"claw_2":{"section_segments":8,"offset":{"x":105,"y":345,"z":-85},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5,10,22,38,55,75],"z":[0,-4,-6,-4,4,15,25]},"width":[5,4,4,3,2,1,0],"height":[7,5,4,3,3,1,0],"texture":[5],"angle":18},"claw_3":{"section_segments":8,"offset":{"x":85,"y":345,"z":-83},"position":{"x":[0,0,0,0,0,0,0],"y":[0,5,10,22,38,55,75],"z":[0,-4,-6,-4,4,15,25]},"width":[5,4,4,3,2,1,0],"height":[7,5,4,3,3,1,0],"texture":[5],"angle":-15},"wing_support1":{"section_segments":8,"offset":{"x":70,"y":5,"z":0},"position":{"x":[-60,0,44,70],"y":[-35,7,35,-85],"z":[0,0,-25,-5]},"width":[40,20,10,0],"height":[0,10,10,0],"texture":[5]},"wing_support2":{"section_segments":8,"offset":{"x":120,"y":-5,"z":-20},"position":{"x":[0,0,0],"y":[0,85,150],"z":[-10,20,40]},"width":[5,5,0],"height":[5,5,0],"texture":[5],"angle":130}},"wings":{"eyes":{"doubleside":true,"offset":{"x":20,"y":-120,"z":35},"length":[25],"width":[30,0],"angle":[20],"position":[-10,55],"texture":[17],"bump":{"position":-40,"size":5}},"bottom":{"doubleside":true,"offset":{"x":10,"y":20,"z":-10},"length":[30,30,50,20,60,40,60,80,40,40,30,30],"width":[90,90,70,100,190,350,150,320,150,280,100,240,80],"angle":[0,0,-27,27,27,20,10,0,-10,-20,-27,-27],"position":[-10,0,30,70,60,100,45,120,70,140,90,160,100],"texture":[4],"bump":{"position":-40,"size":5}}},"typespec":{"name":"Malefor the Supreme Overlord","level":7.9,"model":1,"code":791,"specs":{"shield":{"capacity":[9999999,9999999],"reload":[99999999,99999999]},"generator":{"capacity":[9999999,9999999],"reload":[9999999,9999999]},"ship":{"mass":9999999,"speed":[240,240],"rotation":[400,400],"acceleration":[400,400]}},"shape":[19,17.835,13.989,11.883,9.826,8.73,8.463,7.922,16.125,25.586,23.711,21.12,32.811,43.804,50.89,52.337,54.031,55.44,50.152,41.208,34.644,34.865,34.194,44.525,42.257,58.002,42.257,44.525,34.194,34.865,34.644,41.208,50.152,55.44,54.031,52.337,50.89,43.804,32.811,21.12,23.711,25.586,16.125,7.922,8.463,8.73,9.826,11.883,13.989,17.835],"lasers":[{"x":0,"y":-11,"z":0.5,"angle":0,"damage":[1000,1000],"rate":10,"type":1,"speed":[200,200],"number":15,"spread":0,"error":50,"recoil":0}],"radius":58.002}}';
  153. var Baby_Dragon_792 = '{"name":"Baby Dragon","level":7.9,"model":2,"size":0.6,"specs":{"shield":{"capacity":[10000,10000],"reload":[10000,10000]},"generator":{"capacity":[6043,6043],"reload":[1381,1381]},"ship":{"mass":999999999,"speed":[300,300],"rotation":[150,150],"acceleration":[350,350]}},"bodies":{"main":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0,0,0,0,0,0,0,0],"y":[-100,-98,-95,-70,-40,0,40,70,80,90,100],"z":[0,0,0,0,0,0,0,0,0,0,0]},"width":[0,5,10,20,30,20,20,30,30,30,20,0],"height":[0,4,4,20,20,10,10,15,15,15,10,10],"texture":[4,4,17,4,4,5,17,17,5]},"front":{"section_segments":10,"offset":{"x":8,"y":-40,"z":10},"position":{"x":[3,14,18,10],"y":[10,30,50,70],"z":[0,15,30,40]},"width":[10,7,3,0],"height":[10,7,3,0],"texture":[63],"angle":14},"back":{"section_segments":10,"offset":{"x":0,"y":0,"z":0},"position":{"x":[0,0,0,0,0],"y":[90,95,100,105,90],"z":[0,0,0,0,0]},"width":[10,15,18,19,2],"height":[3,5,7,8,2],"texture":[17],"propeller":true},"cockpit":{"section_segments":8,"offset":{"x":0,"y":-25,"z":12},"position":{"x":[0,0,0,0,0,0],"y":[-45,-40,-25,0,5],"z":[0,0,0,0,0,0]},"width":[0,10,15,5,0],"height":[0,10,15,5,0],"texture":[9]},"laser":{"section_segments":10,"offset":{"x":0,"y":-50,"z":-13},"position":{"x":[0,0,0,0,0,0,0,0,0,0],"y":[-30,-25,0,10,20,25,30,40,70,60],"z":[0,0,0,0,0,0,0,0,0,0]},"width":[0,10,15,15,15,10,10,15,10,0],"height":[0,10,15,15,15,10,10,15,5,0],"texture":[6,4,10,3,4,3,2],"propeller":true,"laser":{"damage":[259,259],"rate":10,"type":1,"speed":[130,130],"number":3,"error":10}}},"wings":{"top":{"doubleside":true,"offset":{"x":10,"y":60,"z":5},"length":[40],"width":[50,40],"angle":[30],"position":[0,50],"texture":[5],"bump":{"position":10,"size":10}},"side":{"doubleside":true,"offset":{"x":10,"y":70,"z":5},"length":[30],"width":[40,20],"angle":[-13],"position":[0,60],"texture":[17],"bump":{"position":10,"size":10}},"wings_inner":{"doubleside":true,"offset":{"x":0,"y":35,"z":0},"length":[60],"width":[100,70],"angle":[0],"position":[-40,10],"texture":[4],"bump":{"position":10,"size":15}},"wings_outer":{"doubleside":true,"offset":{"x":-90,"y":35,"z":0},"length":[30],"width":[100,70],"angle":[0,0],"position":[-25,10],"texture":[4],"bump":{"position":-20,"size":15}},"wings_dropoff":{"doubleside":true,"offset":{"x":90,"y":0,"z":0},"length":[35,15,20,25],"width":[100,200,85,130,35],"angle":[-10,20,0,0],"position":[10,70,20,80,0],"texture":[4,4],"bump":{"position":-20,"size":15}}},"typespec":{"name":"Baby Dragon","level":7.9,"model":2,"code":792,"specs":{"shield":{"capacity":[10000,10000],"reload":[10000,10000]},"generator":{"capacity":[6043,6043],"reload":[1381,1381]},"ship":{"mass":999999999,"speed":[300,300],"rotation":[150,150],"acceleration":[350,350]}},"shape":[1.2,1.168,0.974,0.808,0.694,0.615,0.5,0.458,0.461,1.242,1.495,1.705,2.213,2.213,2.206,2.239,2.311,2.424,2.578,2.382,2.528,1.257,1.649,1.745,1.319,1.262,1.319,1.745,1.649,1.257,2.528,2.382,2.578,2.424,2.311,2.239,2.206,2.213,2.213,1.705,1.495,1.242,0.461,0.458,0.5,0.615,0.694,0.808,0.974,1.168],"lasers":[{"x":0,"y":-0.96,"z":-0.156,"angle":0,"damage":[259,259],"rate":10,"type":1,"speed":[130,130],"number":3,"spread":0,"error":10,"recoil":0}],"radius":2.578}}';
Add Comment
Please, Sign In to add comment