mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
All credits to the author for this handy little script. I Committed the modified python script to tool directory. Although it needs to be in the root folder of your repo to work. To notice the improved compile times, in dreammaker go to Build > Preferences > and untick "automatically set file_dir for subfolders" If this commit inteferes with any large projects just revert it, do your thing, then rerun the script. Easy-peasy. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4488 316c924e-a436-60f5-8080-3fe189b3f50e
173 lines
4.8 KiB
Plaintext
173 lines
4.8 KiB
Plaintext
/**********************Spaceship builder area definitions**************************/
|
|
|
|
/area/shipbuilder
|
|
requires_power = 0
|
|
luminosity = 1
|
|
sd_lighting = 0
|
|
|
|
/area/shipbuilder/station
|
|
name = "shipbuilder station"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship1
|
|
name = "shipbuilder ship1"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship2
|
|
name = "shipbuilder ship2"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship3
|
|
name = "shipbuilder ship3"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship4
|
|
name = "shipbuilder ship4"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship5
|
|
name = "shipbuilder ship5"
|
|
icon_state = "teleporter"
|
|
|
|
/area/shipbuilder/ship6
|
|
name = "shipbuilder ship6"
|
|
icon_state = "teleporter"
|
|
|
|
|
|
/**********************Spaceship builder**************************/
|
|
|
|
/obj/machinery/spaceship_builder
|
|
name = "Robotic Fabricator"
|
|
icon = 'icons/obj/surgery.dmi'
|
|
icon_state = "fab-idle"
|
|
density = 1
|
|
anchored = 1
|
|
var/metal_amount = 0
|
|
var/operating = 0
|
|
var/area/currentShuttleArea = null
|
|
var/currentShuttleName = null
|
|
|
|
/obj/machinery/spaceship_builder/proc/buildShuttle(var/shuttle)
|
|
|
|
var/shuttleat = null
|
|
var/shuttleto = "/area/shipbuilder/station"
|
|
|
|
var/req_metal = 0
|
|
switch(shuttle)
|
|
if("hopper")
|
|
shuttleat = "/area/shipbuilder/ship1"
|
|
currentShuttleName = "Planet hopper"
|
|
req_metal = 25000
|
|
if("bus")
|
|
shuttleat = "/area/shipbuilder/ship2"
|
|
currentShuttleName = "Blnder Bus"
|
|
req_metal = 60000
|
|
if("dinghy")
|
|
shuttleat = "/area/shipbuilder/ship3"
|
|
currentShuttleName = "Space dinghy"
|
|
req_metal = 100000
|
|
if("van")
|
|
shuttleat = "/area/shipbuilder/ship4"
|
|
currentShuttleName = "Boxvan MMDLVI"
|
|
req_metal = 120000
|
|
if("secvan")
|
|
shuttleat = "/area/shipbuilder/ship5"
|
|
currentShuttleName = "Boxvan MMDLVI - Security edition"
|
|
req_metal = 125000
|
|
if("station4")
|
|
shuttleat = "/area/shipbuilder/ship6"
|
|
currentShuttleName = "Space station 4"
|
|
req_metal = 250000
|
|
|
|
if (metal_amount - req_metal < 0)
|
|
return
|
|
|
|
if (!shuttleat)
|
|
return
|
|
|
|
var/area/from = locate(shuttleat)
|
|
var/area/dest = locate(shuttleto)
|
|
|
|
if(!from || !dest)
|
|
return
|
|
|
|
currentShuttleArea = shuttleat
|
|
from.move_contents_to(dest)
|
|
return
|
|
|
|
/obj/machinery/spaceship_builder/proc/scrapShuttle()
|
|
|
|
var/shuttleat = "/area/shipbuilder/station"
|
|
var/shuttleto = currentShuttleArea
|
|
|
|
if (!shuttleto)
|
|
return
|
|
|
|
var/area/from = locate(shuttleat)
|
|
var/area/dest = locate(shuttleto)
|
|
|
|
if(!from || !dest)
|
|
return
|
|
|
|
currentShuttleArea = null
|
|
currentShuttleName = null
|
|
from.move_contents_to(dest)
|
|
return
|
|
|
|
/obj/machinery/spaceship_builder/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
|
|
if(operating == 1)
|
|
user << "The machine is processing"
|
|
return
|
|
|
|
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
|
usr << "\red You don't have the dexterity to do this!"
|
|
return
|
|
|
|
if (istype(W, /obj/item/stack/sheet/metal))
|
|
|
|
var/obj/item/stack/sheet/metal/M = W
|
|
user << "\blue You insert all the metal into the machine."
|
|
metal_amount += M.amount * 100
|
|
del(M)
|
|
|
|
else
|
|
return attack_hand(user)
|
|
return
|
|
|
|
/obj/machinery/spaceship_builder/attack_hand(user as mob)
|
|
if(operating == 1)
|
|
user << "The machine is processing"
|
|
return
|
|
|
|
var/dat
|
|
dat = text("<b>Ship fabricator</b><br><br>")
|
|
dat += text("Current ammount of <font color='gray'>Metal: <b>[metal_amount]</b></font><br><hr>")
|
|
|
|
if (currentShuttleArea)
|
|
dat += text("<b>Currently building</b><br><br>[currentShuttleName]<br><br>")
|
|
dat += text("<b>Build the shuttle to your liking.</b><br>This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.")
|
|
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
|
|
else
|
|
dat += text("<b>Available ships to build:</b><br><br>")
|
|
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
|
|
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
|
|
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
|
|
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
|
|
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
|
|
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
|
|
|
|
user << browse("[dat]", "window=shipbuilder")
|
|
|
|
|
|
/obj/machinery/spaceship_builder/Topic(href, href_list)
|
|
if(..())
|
|
return
|
|
usr.machine = src
|
|
src.add_fingerprint(usr)
|
|
if(href_list["ship"])
|
|
buildShuttle(href_list["ship"])
|
|
if(href_list["scrap"])
|
|
scrapShuttle(href_list["ship"])
|
|
src.updateUsrDialog()
|
|
return |