/**********************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("Ship fabricator

") dat += text("Current ammount of Metal: [metal_amount]

") if (currentShuttleArea) dat += text("Currently building

[currentShuttleName]

") dat += text("Build the shuttle to your liking.
This shuttle will be sent to the station in the event of an emergency along with a centcom emergency shuttle.") dat += text("


Scrap current shuttle") else dat += text("Available ships to build:

") dat += text("Planet hopper - Tiny, Slow, 25000 metal
") dat += text("Blunder Bus - Small, Decent speed, 60000 metal
") dat += text("Space dinghy - Medium size, Decent speed, 100000 metal
") dat += text("Boxvan MMDLVIr - Medium size, Decent speed, 120000 metal
") dat += text("Boxvan MMDLVI - Security eidition - Large, Rather slow, 125000 metal
") dat += text("Space station 4 - Huge, Slow, 250000 metal
") 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