/obj/item/weapon/book/manual/engineering_construction name = "Station Repairs and Construction" icon = 'library.dmi' icon_state ="bookEngineering" due_date = 0 // Game time in 1/10th seconds author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned unique = 1 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified //big pile of shit below. dat = {"

Construction

Advanced Materials

Rods

Use metal and click "2x metal rods" (makes two sets of rods)

Floor tiles

Use metal and click "4x floor tiles" (makes 4 floor tiles)

Reinforced Glass

Use rods on glass

Reinforced Metal

Click the metal in your hand to open the construction panel,
Choose 'Reinforced sheets' form the list

Floor

Use the rods on space
Use the floor tile on space with lattice
Use another floor tile on the plating
Alternate method - Click on
floor tile in hand while on top of an area of space. No need for rods with this method.

Walls

Click the metal in your hand to open the construction panel,
Choose 'Build wall girders' form the list
Use the remaining 2 sheets of metal on the girders

Reinforced walls

Click the metal in your hand to open the construction panel,
Choose 'Build wall girders' form the list
Use the reinforced metal on the girders to reinforce them
Use the last reinforced metal sheet reinforced girders to finish the wall

Grille

Stand where you wish the grille to be placed
Click on the stack of 2 rods with the hand you have them in

Glass panels

One directional

Click the glass pane
Click the "one direct" button
Right-click the new pane and rotate it
Use the screwdriver to fasten it down

Full

Click the glass pane
Click the "full" button
Use the screwdriver to fasten it down

Reinforced glass panels

One directional

Click the reinforced glass pane
Click the "one direct" button
Right-click the new pane and rotate it
Screwdriver (Unsecure pane.)
Crowbar (Pane out of frame.)
Screwdriver (Secure frame to floor.)
Crowbar (Pop pane in.)
Screwdriver (Secure pane.)

Full

Click the reinforced glass pane
Click the "full" button
Screwdriver
Crowbar
Screwdriver

Hidden Door

Click the metal in your hand to open the construction panel,
Choose 'Build wall girders' form the list
Use crowbar on girders and wait a few seconds for the girders to dislodge.
Use the remaining 2 sheets of metal on the girders To turn a wall into a hidden door, follow the deconstruction guide for the wall type until the final wrenching, and instead proceed from the "Use crowbar on girders" line above.

Reinforced

Click the metal in your hand to open the construction panel,
Choose 'Build wall girders' form the list
Use crowbar on girders and wait a few seconds for the girders to dislodge.
Use the reinforced metal on the dislodged girders twice to finish it

APC

Use the metal and make an APC Assembly
Use the assembly on the wall you want the APC on.
Fit it with the wire coil.
Fit it with the Power Control Module.
Screwdriver the electronics into place.
Add the Power Cell.
Crowbar shut. It starts ID locked, with the cover engaged and the main switch turned off.

Airlock

Use the metal and make an Airlock Assembly
Wrench it inplace
Add reinforced glass (Only if you wish to make a glass airlock)
Add wires
Unlock the airlock electronic board with an ID
Use the airlock electronic board and set the access level
Add the airlock electronic board to the airlock frame.
Screwdriver to finish

Computers

Use the metal to open the construction panel
Choose Computer frame
Wrench it inplace
Insert Circuitboard
Screwdriver
Wires
glass
Screwdriver to finish

AI Core

Build Frame from 4 reinforced sheets
Wrench into place
Add Circuit board
Screwdriver
Add wires
Add brain (only if you want a NEW AI)
Add reinforced glass
Screwdriver

Deconstruction

Walls

Wdlder
Wrench

Reinforced walls

Wirecutters.
Screwdriver.
Welder.
Crowbar.
Wrench.
Welder.
Crowbar.
Screwdriver.
Wirecutters.
Wrench.

Grille

Wirecutters
Welder (to destroy it)
or
screwdriver (to unfasten it)

Glass panels

The first method destroys it, the second gives a pullable pane of glass.
Welding glass shards creates a pane of glass.

Reinforced glass panels

Screwdriver to loosen the pane.
Crowbar to pop it out.
Screwdriver to unscrew the frame.
Crowbar to pop the pane in.
Screwdriver to secure it. Hitting the pane repeatedly with a blunt item will smash it into one set of metal rods and a glass shard.

Hidden Door (Regular or Reinforced)

Screwdriver
Welder
Wrench

APC

Swipe Card to unlock APC.
Remove Power Cell.
Screwdriver to unsecure electronics.
Wirecutters to remove cables.
Crowbar to remove Power Control Board.
Welder to remover from wall.
Wrenching the frame that is now detached from the wall de-constructs it to two metal sheets.

Airlock

Screwdriver the door.
Use multitool and wirecutters to disable everything except the doorbolts as detailed in books on hacking. Doorbolts must be up for this to work.
Weld the door shut.
Crowbar the electronics out.
Wirecut the wires out.
Unsecure it with a wrench.
Weld it to deconstruct to metal plates. Cannot be done to emagged airlock. RCD deconstruction must be used for that.

Computers

Screwdriver.
Crowbar.
Wirecutters.
Screwdriver.
Wrench.
Welder. "} /obj/item/weapon/book/manual/engineering_hacking name = "Hacking" icon = 'library.dmi' icon_state ="bookHacking" due_date = 0 // Game time in 1/10th seconds author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned unique = 1 // 0 - Normal book, 1 - Should not be treated as normal book, unable to be copied, unable to be modified //big pile of shit below. dat = {"

What you'll need

Important Hackables

Airlocks

Both internal and external access airlocks are hackable, despite the fact that external ones look a lot like firelocks, which are not hackable. Wires are randomized at the start of each round, but are standardized throughout the station, e.g., every orange wire might toggle the bolts. This is probably where you'll be doing the most of your hacking. Remember, cutting power to the door will stop everything else from working.
  1. Screwdriver in hand, click on the airlock to open the panel and expose the wiring
  2. With multitool, wirecutters, or an empty hand, click on the airlock to access the wiring.
  3. Fiddle with the wires by pulsing to test each one and cutting what you need to.
  4. Screwdriver the door again to shut the panel. Otherwise, trying to open the door will always give you the wiring popup.

Airlock Strategies

APCs

Used to control power to a certain room. Nice to know when a rogue AI or douchebag engineers keep turning off your power. All APC breakers can be accessed via Power Monitoring Computers regardless of the lock status, so hope that whoever's fucking with the power isn't paying attention
  1. Screwdriver in hand, click on APC to open the panel and expose the wiring
  2. Click with an empty hand to access the wiring
  3. Fiddle with the wires by pulsing to test each one and cutting what you need to.
  4. Screwdriver it back up to toggle lighting, equipment, and atmospherics as you see fit (unless you've killed the power)

Autolathe

  1. Click on the autolathe to open it
  2. Click on the autolathe with an empty hand to access the wiring, then get a tool in your hand
  3. The window is glitched and won't show what wires are cut, so you better track what wires you modify. There are three important wires, which are randomized. Cutting them toggles their light permanently, pulsing does so temporarily(30 secs or something). Red light is power, green light is electrocution and blue is hacked options.
  4. Have fun accessing some new options

Air alarm/Fire alarm/Cameras

Use wirecutters to enable/disable. Disabled air alarms will show no lights, fire alarms will not automatically trigger firelocks, and cameras will show a red light and prevent anyone from viewing the room through a console (including AI).

MULE

No better way to get away from it all with a joyride on a MULE! And run over some people with it too.
  1. Unlock the controls with a Quartermaster's ID.
  2. Unscrew the maintenance panel with the screwdriver.
  3. Pulse various wires with a multitool. Pay attention to the reaction the MULE gives.
    1. Cutting the wire that causes the loading bay to thunk will remove cargo restrictions.
    2. Cutting the wire that leads to the safety light will awaken its thirst for blood and cause it to run over people in its path. DO NOT DO THIS UNLESS YOU ARE A TRAITOR OR LOVE GETTING THE SHIT ROBUSTED OUT OF YOU.
    3. Cutting one of the wires that makes the motor whine will safely speed up the MULE. Cutting both will immobilize it.
  4. Screw the panel back on.

Minor Hackables

I haven't a clue why you'd ever want to hack any of these things, but you can!

Radio/Signaler

  1. Screwdriver in hand, click on the offending radio so it can be modified or attached
  2. The usual radio use panel will pop up, but now with access to the wiring. If you've closed it by accident, just click on the radio as if you were going to change the settings on it.
  3. There are three wires. Two have apparent uses; the third is pretty much useless.
Interestingly, tracking beacons and station intercoms also count as radios.

Secure Briefcase, Safes

seriously who is dumb enough to use these things anyway god damn
  1. Screwdriver in hand, click on the (briefcase/safe) to open the panel and expose the wiring
  2. Multi-tool-spam the (briefcase/safe) until you get a confirmation that the memory is reset.
  3. The memory is now reset. Punch in your favorite code and hit E to set it.
  4. Screwdriver the panel shut.

Vending machines

The only thing worth hacking! Four wires
  1. Firing wire when cut fires stuff at people. When pulsed will do so. Controlled by the blinking light.
  2. Contraband wire does nothing when cut, when pulsed unlocks illegal or rare goods. Wire is unknown.
  3. Access wire when cut it turns on a yellow light, allowing for ID restricted machines(med machines, sec machines, possibly botany machines) to be used by anyone.
  4. Shock wire Like the firing wire in effects from hacking, except it shocks instead of shoots.
"} /**********************Light************************/ //this item is intended to give the effect of entering the mine, so that light gradually fades /obj/light_emitter name = "Light-emtter" anchored = 1 unacidable = 1 luminosity = 8 /**********************Random mine generator************************/ //this item is intended to give the effect of entering the mine, so that light gradually fades /obj/mine_generator name = "Random mine generator" anchored = 1 unacidable = 1 var/turf/last_loc var/turf/target_loc var/turf/start_loc var/randXParam //the value of these two parameters are generated by the code itself and used to var/randYParam //determine the random XY parameters var/mineDirection = 3 /* 0 = none 1 = N 2 = NNW 3 = NW 4 = WNW 5 = W 6 = WSW 7 = SW 8 = SSW 9 = S 10 = SSE 11 = SE 12 = ESE 13 = E 14 = ENE 15 = NE 16 = NNE */ /obj/mine_generator/New() last_loc = src.loc var/i for(i = 0; i < 50; i++) gererateTargetLoc() //target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z) fillWithAsteroids() del(src) return /obj/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end. switch(mineDirection) if(1) randXParam = 0 randYParam = 4 if(2) randXParam = 1 randYParam = 3 if(3) randXParam = 2 randYParam = 2 if(4) randXParam = 3 randYParam = 1 if(5) randXParam = 4 randYParam = 0 if(6) randXParam = 3 randYParam = -1 if(7) randXParam = 2 randYParam = -2 if(8) randXParam = 1 randYParam = -3 if(9) randXParam = 0 randYParam = -4 if(10) randXParam = -1 randYParam = -3 if(11) randXParam = -2 randYParam = -2 if(12) randXParam = -3 randYParam = -1 if(13) randXParam = -4 randYParam = 0 if(14) randXParam = -3 randYParam = 1 if(15) randXParam = -2 randYParam = 2 if(16) randXParam = -1 randYParam = 3 target_loc = last_loc if (randXParam > 0) target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z) if (randYParam > 0) target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z) if (randXParam < 0) target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z) if (randYParam < 0) target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z) if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly if(prob(50)) mineDirection += 2 else mineDirection -= 2 if(mineDirection < 1) mineDirection += 16 else if(prob(50)) if(prob(50)) mineDirection += 1 else mineDirection -= 1 if(mineDirection < 1) mineDirection += 16 return /obj/mine_generator/proc/fillWithAsteroids() if(last_loc) start_loc = last_loc if(start_loc && target_loc) var/x1 var/y1 var/turf/line_start = start_loc var/turf/column = line_start if(start_loc.x <= target_loc.x) if(start_loc.y <= target_loc.y) //GOING NORTH-EAST for(y1 = start_loc.y; y1 <= target_loc.y; y1++) for(x1 = start_loc.x; x1 <= target_loc.x; x1++) new/turf/simulated/floor/airless/asteroid(column) column = get_step(column,EAST) line_start = get_step(line_start,NORTH) column = line_start last_loc = target_loc return else //GOING NORTH-WEST for(y1 = start_loc.y; y1 >= target_loc.y; y1--) for(x1 = start_loc.x; x1 <= target_loc.x; x1++) new/turf/simulated/floor/airless/asteroid(column) column = get_step(column,WEST) line_start = get_step(line_start,NORTH) column = line_start last_loc = target_loc return else if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST for(y1 = start_loc.y; y1 <= target_loc.y; y1++) for(x1 = start_loc.x; x1 >= target_loc.x; x1--) new/turf/simulated/floor/airless/asteroid(column) column = get_step(column,EAST) line_start = get_step(line_start,SOUTH) column = line_start last_loc = target_loc return else //GOING SOUTH-WEST for(y1 = start_loc.y; y1 >= target_loc.y; y1--) for(x1 = start_loc.x; x1 >= target_loc.x; x1--) new/turf/simulated/floor/airless/asteroid(column) column = get_step(column,WEST) line_start = get_step(line_start,SOUTH) column = line_start last_loc = target_loc return return /**********************Mine areas**************************/ /area/mine/explored name = "Mine" icon_state = "janitor" music = null /area/mine/unexplored name = "Mine" icon_state = "captain" music = null /area/mine/lobby name = "Mining station" icon_state = "mine" /**********************Mineral deposits**************************/ /turf/simulated/mineral //wall piece name = "Rock" icon = 'walls.dmi' icon_state = "rock" oxygen = 0 nitrogen = 0 opacity = 1 density = 1 blocks_air = 1 temperature = TCMB var/mineralName = "" var/mineralAmt = 0 var/spread = 0 //will the seam spread? var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles /turf/simulated/mineral/Del() return /turf/simulated/mineral/ex_act(severity) switch(severity) if(3.0) return if(2.0) if (prob(70)) src.mineralAmt -= 1 //some of the stuff gets blown up src.gets_drilled() if(1.0) src.mineralAmt -= 2 //some of the stuff gets blown up src.gets_drilled() return /turf/simulated/mineral/New() if (mineralName && mineralAmt && spread && spreadChance) if(prob(spreadChance)) if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random)) new src.type(get_step(src, SOUTH)) if(prob(spreadChance)) if(istype(get_step(src, NORTH), /turf/simulated/mineral/random)) new src.type(get_step(src, NORTH)) if(prob(spreadChance)) if(istype(get_step(src, WEST), /turf/simulated/mineral/random)) new src.type(get_step(src, WEST)) if(prob(spreadChance)) if(istype(get_step(src, EAST), /turf/simulated/mineral/random)) new src.type(get_step(src, EAST)) return /turf/simulated/mineral/random name = "Mineral deposit" var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5) var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25) var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit /turf/simulated/mineral/random/New() if (prob(mineralChance)) var/mName = pickweight(mineralSpawnChanceList) //temp mineral name //spawn(5) if (mName) var/turf/simulated/mineral/M switch(mName) if("Uranium") M = new/turf/simulated/mineral/uranium(src) if("Iron") M = new/turf/simulated/mineral/iron(src) if("Diamond") M = new/turf/simulated/mineral/diamond(src) if("Gold") M = new/turf/simulated/mineral/gold(src) if("Silver") M = new/turf/simulated/mineral/silver(src) if("Plasma") M = new/turf/simulated/mineral/plasma(src) if(M) src = M M.levelupdate() return /turf/simulated/mineral/random/Del() return /turf/simulated/mineral/uranium name = "Uranium deposit" icon_state = "rock_Uranium" mineralName = "Uranium" mineralAmt = 5 spreadChance = 10 spread = 1 /turf/simulated/mineral/iron name = "Iron deposit" icon_state = "rock_Iron" mineralName = "Iron" mineralAmt = 5 spreadChance = 25 spread = 1 /turf/simulated/mineral/diamond name = "Diamond deposit" icon_state = "rock_Diamond" mineralName = "Diamond" mineralAmt = 5 spreadChance = 10 spread = 1 /turf/simulated/mineral/gold name = "Gold deposit" icon_state = "rock_Gold" mineralName = "Gold" mineralAmt = 5 spreadChance = 10 spread = 1 /turf/simulated/mineral/silver name = "Silver deposit" icon_state = "rock_Silver" mineralName = "Silver" mineralAmt = 5 spreadChance = 10 spread = 1 /turf/simulated/mineral/plasma name = "Plasma deposit" icon_state = "rock_Plasma" mineralName = "Plasma" mineralAmt = 5 spreadChance = 25 spread = 1 /turf/simulated/mineral/clown name = "Bananium deposit" icon_state = "rock_Clown" mineralName = "Clown" mineralAmt = 3 spreadChance = 0 spread = 0 /turf/simulated/mineral/ReplaceWithFloor() if(!icon_old) icon_old = icon_state var/turf/simulated/floor/airless/asteroid/W var/old_dir = dir W = new /turf/simulated/floor/airless/asteroid( locate(src.x, src.y, src.z) ) W.dir = old_dir W.fullUpdateMineralOverlays() /* W.icon_old = old_icon if(old_icon) W.icon_state = old_icon */ W.opacity = 1 W.sd_SetOpacity(0) W.levelupdate() return W /turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob) 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/weapon/pickaxe)) var/turf/T = user.loc if (!( istype(T, /turf) )) return user << "\red You start picking." //playsound(src.loc, 'Welder.ogg', 100, 1) sleep(40) if ((user.loc == T && user.equipped() == W)) user << "\blue You finish cutting into the rock." gets_drilled() else return attack_hand(user) return /turf/simulated/mineral/proc/gets_drilled() if ((src.mineralName != "") && (src.mineralAmt > 0) && (src.mineralAmt < 11)) var/i for (i=0;i 0) && (src.seedAmt < 11)) var/i for (i=0;iCONNECTED") else dat += text("NOT CONNECTED") dat += text("
output connection status: ") if (output) dat += text("CONNECTED") else dat += text("NOT CONNECTED") dat += text("

Purify") dat += text("

found: [processed]") user << browse("[dat]", "window=purifier") /obj/machinery/mineral/purifier/Topic(href, href_list) if(..()) return usr.machine = src src.add_fingerprint(usr) if(href_list["purify"]) if (src.output) processing = 1; var/obj/item/weapon/ore/O processed = 0; while(locate(/obj/item/weapon/ore, input.loc)) O = locate(/obj/item/weapon/ore, input.loc) if (istype(O,/obj/item/weapon/ore/iron)) new /obj/item/stack/sheet/metal(output.loc) del(O) if (istype(O,/obj/item/weapon/ore/diamond)) new /obj/item/stack/sheet/diamond(output.loc) del(O) if (istype(O,/obj/item/weapon/ore/plasma)) new /obj/item/stack/sheet/plasma(output.loc) del(O) if (istype(O,/obj/item/weapon/ore/gold)) new /obj/item/stack/sheet/gold(output.loc) del(O) if (istype(O,/obj/item/weapon/ore/silver)) new /obj/item/stack/sheet/silver(output.loc) del(O) if (istype(O,/obj/item/weapon/ore/uranium)) new /obj/item/weapon/ore/uranium(output.loc) del(O) processed++ sleep(5); processing = 0; src.updateUsrDialog() return /obj/machinery/mineral/purifier/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, WEST)) src.output = locate(/obj/machinery/mineral/output, get_step(src, EAST)) return return /**********************Mineral processing unit console**************************/ /obj/machinery/mineral/processing_unit_console name = "Produciton machine console" icon = 'terminals.dmi' icon_state = "production_console" density = 1 anchored = 1 var/obj/machinery/mineral/processing_unit/machine = null /obj/machinery/mineral/processing_unit_console/New() ..() spawn(7) src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, EAST)) if (machine) machine.CONSOLE = src else del(src) /obj/machinery/mineral/processing_unit_console/attack_hand(user as mob) var/dat = "Smelter control console

" //iron if (machine.selected_iron==1) dat += text("Y ") else dat += text("N ") dat += text("Iron: [machine.ore_iron]
") //plasma if (machine.selected_plasma==1) dat += text("Y ") else dat += text("N ") dat += text("Plasma: [machine.ore_plasma]
") //uranium if (machine.selected_uranium==1) dat += text("Y ") else dat += text("N ") dat += text("Uranium: [machine.ore_uranium]
") //gold if (machine.selected_gold==1) dat += text("Y ") else dat += text("N ") dat += text("Gold: [machine.ore_gold]
") //silver if (machine.selected_silver==1) dat += text("Y ") else dat += text("N ") dat += text("Silver: [machine.ore_silver]
") //diamond if (machine.selected_diamond==1) dat += text("Y ") else dat += text("N ") dat += text("Diamond: [machine.ore_diamond]
") //bananium if (machine.selected_clown==1) dat += text("Y ") else dat += text("N ") dat += text("Bananium: [machine.ore_clown]
") //On or off dat += text("Machine is currently ") if (machine.on==1) dat += text("On ") else dat += text("Off ") user << browse("[dat]", "window=console_processing_unit") /obj/machinery/mineral/processing_unit_console/Topic(href, href_list) if(..()) return usr.machine = src src.add_fingerprint(usr) if(href_list["sel_iron"]) if (href_list["sel_iron"] == "yes") machine.selected_iron = 1 else machine.selected_iron = 0 if(href_list["sel_plasma"]) if (href_list["sel_plasma"] == "yes") machine.selected_plasma = 1 else machine.selected_plasma = 0 if(href_list["sel_uranium"]) if (href_list["sel_uranium"] == "yes") machine.selected_uranium = 1 else machine.selected_uranium = 0 if(href_list["sel_gold"]) if (href_list["sel_gold"] == "yes") machine.selected_gold = 1 else machine.selected_gold = 0 if(href_list["sel_silver"]) if (href_list["sel_silver"] == "yes") machine.selected_silver = 1 else machine.selected_silver = 0 if(href_list["sel_diamond"]) if (href_list["sel_diamond"] == "yes") machine.selected_diamond = 1 else machine.selected_diamond = 0 if(href_list["sel_clown"]) if (href_list["sel_clown"] == "yes") machine.selected_clown = 1 else machine.selected_clown = 0 if(href_list["set_on"]) if (href_list["set_on"] == "on") machine.on = 1 else machine.on = 0 src.updateUsrDialog() return /**********************Mineral processing unit**************************/ /obj/machinery/mineral/processing_unit name = "Furnace" icon = 'stationobjs.dmi' icon_state = "controller" density = 1 anchored = 1.0 var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null var/obj/machinery/mineral/CONSOLE = null var/ore_gold = 0; var/ore_silver = 0; var/ore_diamond = 0; var/ore_plasma = 0; var/ore_uranium = 0; var/ore_iron = 0; var/ore_clown = 0; var/selected_gold = 0 var/selected_silver = 0 var/selected_diamond = 0 var/selected_plasma = 0 var/selected_uranium = 0 var/selected_iron = 0 var/selected_clown = 0 var/on = 0 //0 = off, 1 =... oh you know! /obj/machinery/mineral/processing_unit/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, NORTH)) src.output = locate(/obj/machinery/mineral/output, get_step(src, SOUTH)) processing_items.Add(src) return return /obj/machinery/mineral/processing_unit/process() if (src.output && src.input) var/i for (i = 0; i < 10; i++) if (on) if (selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0) if (ore_gold > 0) ore_gold--; new /obj/item/stack/sheet/gold(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0) if (ore_silver > 0) ore_silver--; new /obj/item/stack/sheet/silver(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0) if (ore_diamond > 0) ore_diamond--; new /obj/item/stack/sheet/diamond(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0) if (ore_plasma > 0) ore_plasma--; new /obj/item/stack/sheet/plasma(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0) if (ore_uranium > 0) ore_uranium--; new /obj/item/weapon/ore/uranium(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0) if (ore_iron > 0) ore_iron--; new /obj/item/stack/sheet/metal(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0) if (ore_iron > 0) ore_iron--; new /obj/item/stack/sheet/metal(output.loc) else on = 0 continue if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1) if (ore_clown > 0) ore_clown--; new /obj/item/stack/sheet/metal(output.loc) else on = 0 continue //if a non valid combination is selected var/b = 1 //this part checks if all required ores are available if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron)) b = 0 if (selected_gold == 1) if (ore_gold <= 0) b = 0 if (selected_silver == 1) if (ore_silver <= 0) b = 0 if (selected_diamond == 1) if (ore_diamond <= 0) b = 0 if (selected_uranium == 1) if (ore_uranium <= 0) b = 0 if (selected_plasma == 1) if (ore_plasma <= 0) b = 0 if (selected_iron == 1) if (ore_iron <= 0) b = 0 if (selected_clown == 1) if (ore_clown <= 0) b = 0 if (b) //if they are, deduct one from each, produce slag and shut the machine off if (selected_gold == 1) ore_gold-- if (selected_silver == 1) ore_silver-- if (selected_diamond == 1) ore_diamond-- if (selected_uranium == 1) ore_uranium-- if (selected_plasma == 1) ore_plasma-- if (selected_iron == 1) ore_iron-- if (selected_clown == 1) ore_clown-- new /obj/item/weapon/ore/slag(output.loc) on = 0 else on = 0 break break else break for (i = 0; i < 10; i++) var/obj/item/O O = locate(/obj/item, input.loc) if (O) if (istype(O,/obj/item/weapon/ore/iron)) ore_iron++; //new /obj/item/stack/sheet/metal(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/diamond)) ore_diamond++; //new /obj/item/stack/sheet/diamond(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/plasma)) ore_plasma++ //new /obj/item/stack/sheet/plasma(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/gold)) ore_gold++ //new /obj/item/stack/sheet/gold(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/silver)) ore_silver++ //new /obj/item/stack/sheet/silver(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/uranium)) ore_uranium++ del(O) continue if (istype(O,/obj/item/weapon/ore/clown)) ore_clown++ del(O) continue O.loc = src.output.loc else break return /**********************Mineral stacking unit console**************************/ /obj/machinery/mineral/stacking_unit_console name = "Stacking machine console" icon = 'terminals.dmi' icon_state = "production_console" density = 1 anchored = 1 var/obj/machinery/mineral/stacking_machine/machine = null /obj/machinery/mineral/stacking_unit_console/New() ..() spawn(7) src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, SOUTHEAST)) if (machine) machine.CONSOLE = src else del(src) /obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob) var/dat dat += text("Stacking unit console

") dat += text("Iron: [machine.ore_iron] Release
") dat += text("Plasma: [machine.ore_plasma] Release
") dat += text("Gold: [machine.ore_gold] Release
") dat += text("Silver: [machine.ore_silver] Release
") dat += text("Damond: [machine.ore_diamond] Release

") dat += text("Bananium: [machine.ore_clown] Release

") dat += text("Stacking: [machine.stack_amt]

") user << browse("[dat]", "window=console_stacking_machine") /obj/machinery/mineral/stacking_unit_console/Topic(href, href_list) if(..()) return usr.machine = src src.add_fingerprint(usr) if(href_list["release"]) switch(href_list["release"]) if ("plasma") if (machine.ore_plasma > 0) var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma G.amount = machine.ore_plasma G.loc = machine.output.loc machine.ore_plasma = 0 if ("gold") if (machine.ore_gold > 0) var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold G.amount = machine.ore_gold G.loc = machine.output.loc machine.ore_gold = 0 if ("silver") if (machine.ore_silver > 0) var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver G.amount = machine.ore_silver G.loc = machine.output.loc machine.ore_silver = 0 if ("diamond") if (machine.ore_diamond > 0) var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond G.amount = machine.ore_diamond G.loc = machine.output.loc machine.ore_diamond = 0 if ("iron") if (machine.ore_iron > 0) var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal G.amount = machine.ore_iron G.loc = machine.output.loc machine.ore_iron = 0 if ("clown") if (machine.ore_clown > 0) var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown G.amount = machine.ore_clown G.loc = machine.output.loc machine.ore_iron = 0 src.updateUsrDialog() return /**********************Mineral stacking unit**************************/ /obj/machinery/mineral/stacking_machine name = "Stacking machine" icon = 'stationobjs.dmi' icon_state = "controller" density = 1 anchored = 1.0 var/obj/machinery/mineral/stacking_unit_console/CONSOLE var/stk_types = list() var/stk_amt = list() var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null var/ore_gold = 0; var/ore_silver = 0; var/ore_diamond = 0; var/ore_plasma = 0; var/ore_iron = 0; var/ore_clown = 0; var/stack_amt = 50; //ammount to stack before releassing /obj/machinery/mineral/stacking_machine/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, EAST)) src.output = locate(/obj/machinery/mineral/output, get_step(src, WEST)) processing_items.Add(src) return return /obj/machinery/mineral/stacking_machine/process() if (src.output && src.input) var/obj/item/O while (locate(/obj/item, input.loc)) O = locate(/obj/item, input.loc) if (istype(O,/obj/item/stack/sheet/metal)) ore_iron++; //new /obj/item/stack/sheet/metal(output.loc) del(O) continue if (istype(O,/obj/item/stack/sheet/diamond)) ore_diamond++; //new /obj/item/stack/sheet/diamond(output.loc) del(O) continue if (istype(O,/obj/item/stack/sheet/plasma)) ore_plasma++ //new /obj/item/stack/sheet/plasma(output.loc) del(O) continue if (istype(O,/obj/item/stack/sheet/gold)) ore_gold++ //new /obj/item/stack/sheet/gold(output.loc) del(O) continue if (istype(O,/obj/item/stack/sheet/silver)) ore_silver++ //new /obj/item/stack/sheet/silver(output.loc) del(O) continue if (istype(O,/obj/item/stack/sheet/clown)) ore_clown++ //new /obj/item/stack/sheet/silver(output.loc) del(O) continue if (istype(O,/obj/item/weapon/ore/slag)) del(O) continue O.loc = src.output.loc if (ore_gold >= stack_amt) var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold G.amount = stack_amt G.loc = output.loc ore_gold -= stack_amt return if (ore_silver >= stack_amt) var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver G.amount = stack_amt G.loc = output.loc ore_silver -= stack_amt return if (ore_diamond >= stack_amt) var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond G.amount = stack_amt G.loc = output.loc ore_diamond -= stack_amt return if (ore_plasma >= stack_amt) var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma G.amount = stack_amt G.loc = output.loc ore_plasma -= stack_amt return if (ore_iron >= stack_amt) var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal G.amount = stack_amt G.loc = output.loc ore_iron -= stack_amt return if (ore_clown >= stack_amt) var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown G.amount = stack_amt G.loc = output.loc ore_clown -= stack_amt return return /**********************Unloading unit**************************/ /obj/machinery/mineral/unloading_machine name = "Unloading machine" icon = 'stationobjs.dmi' icon_state = "controller" density = 1 anchored = 1.0 var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null /obj/machinery/mineral/unloading_machine/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, SOUTH)) src.output = locate(/obj/machinery/mineral/output, get_step(src, NORTH)) processing_items.Add(src) return return /obj/machinery/mineral/unloading_machine/process() if (src.output && src.input) if (locate(/obj/ore_box, input.loc)) var/obj/ore_box/BOX = locate(/obj/ore_box, input.loc) var/i = 0 for (var/obj/item/weapon/ore/O in BOX.contents) BOX.contents -= O O.loc = output.loc i++ if (i>=10) return if (locate(/obj/item, input.loc)) var/obj/item/O var/i for (i = 0; i<10; i++) O = locate(/obj/item, input.loc) if (O) O.loc = src.output.loc else return return /**********************Mint**************************/ /obj/machinery/mineral/mint name = "Coin press" icon = 'stationobjs.dmi' icon_state = "controller" density = 1 anchored = 1.0 var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null var/amt_silver = 0 //amount of silver var/amt_gold = 0 //amount of gold var/amt_diamond = 0 var/amt_iron = 0 var/amt_plasma = 0 var/amt_uranium = 0 var/amt_clown = 0 var/newCoins = 0 //how many coins the machine made in it's last load var/processing = 0 /obj/machinery/mineral/mint/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, NORTH)) src.output = locate(/obj/machinery/mineral/output, get_step(src, SOUTH)) processing_items.Add(src) return return /obj/machinery/mineral/mint/process() if (src.output && src.input) var/obj/item/stack/sheet/O O = locate(/obj/item/stack/sheet, input.loc) if(O) if (istype(O,/obj/item/stack/sheet/gold)) amt_gold += 100 del(O) if (istype(O,/obj/item/stack/sheet/silver)) amt_silver += 100 del(O) if (istype(O,/obj/item/stack/sheet/diamond)) amt_diamond += 100 del(O) if (istype(O,/obj/item/stack/sheet/plasma)) amt_plasma += 100 del(O) if (istype(O,/obj/item/weapon/ore/uranium)) amt_uranium += 100 del(O) if (istype(O,/obj/item/stack/sheet/metal)) amt_iron += 100 del(O) if (istype(O,/obj/item/stack/sheet/clown)) amt_clown += 100 del(O) /obj/machinery/mineral/mint/attack_hand(user as mob) var/dat dat = text("input connection status: ") if (input) dat += text("CONNECTED") else dat += text("NOT CONNECTED") dat += text("
output connection status: ") if (output) dat += text("CONNECTED") else dat += text("NOT CONNECTED") dat += text("

Gold inserterd: [amt_gold]") dat += text("

Silver inserterd: [amt_silver]") dat += text("

Iron inserterd: [amt_iron]") dat += text("

Diamond inserterd: [amt_diamond]") dat += text("

Plasma inserterd: [amt_plasma]") dat += text("

Uranium inserterd: [amt_uranium]") dat += text("

Bananium inserterd: [amt_clown]") dat += text("

Make coins") dat += text("

found: [newCoins]") user << browse("[dat]", "window=mint") /obj/machinery/mineral/mint/Topic(href, href_list) if(..()) return if(processing==1) return usr.machine = src src.add_fingerprint(usr) if(href_list["makeCoins"]) if (src.output) processing = 1; while(amt_gold > 0) new /obj/item/weapon/coin/gold(output.loc) amt_gold -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_silver > 0) new /obj/item/weapon/coin/silver(output.loc) amt_silver -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_diamond > 0) new /obj/item/weapon/coin/diamond(output.loc) amt_diamond -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_iron > 0) new /obj/item/weapon/coin/iron(output.loc) amt_iron -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_plasma > 0) new /obj/item/weapon/coin/plasma(output.loc) amt_plasma -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_uranium > 0) new /obj/item/weapon/coin/uranium(output.loc) amt_uranium -= 20 newCoins++ src.updateUsrDialog() sleep(5); while(amt_clown > 0) new /obj/item/weapon/coin/clown(output.loc) amt_clown -= 20 newCoins++ src.updateUsrDialog() sleep(5); processing = 0; src.updateUsrDialog() return /*****************************Coin********************************/ /obj/item/weapon/coin icon = 'items.dmi' name = "Coin" icon_state = "coin" flags = FPRINT | TABLEPASS| CONDUCT force = 5.0 throwforce = 7.0 w_class = 2.0 m_amt = 50 /obj/item/weapon/coin/New() pixel_x = rand(0,16)-8 pixel_y = rand(0,8)-8 /obj/item/weapon/coin/gold name = "Gold coin" icon_state = "coin_gold" /obj/item/weapon/coin/silver name = "Silver coin" icon_state = "coin_silver" /obj/item/weapon/coin/diamond name = "Diamond coin" icon_state = "coin_diamond" /obj/item/weapon/coin/iron name = "Iron coin" icon_state = "coin_iron" /obj/item/weapon/coin/plasma name = "Solid plasma coin" icon_state = "coin_plasma" /obj/item/weapon/coin/uranium name = "Uranium coin" icon_state = "coin_uranium" /obj/item/weapon/coin/clown name = "Bananaium coin" icon_state = "coin_clown" /**********************Gas extractor**************************/ /obj/machinery/mineral/gasextractor name = "Gas extractor" desc = "A machine which extracts gasses from ores" icon = 'computer.dmi' icon_state = "aiupload" var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null var/message = ""; var/processing = 0 var/newtoxins = 0 density = 1 anchored = 1.0 /obj/machinery/mineral/gasextractor/New() ..() spawn( 5 ) src.input = locate(/obj/machinery/mineral/input, get_step(src, NORTH)) src.output = locate(/obj/machinery/mineral/output, get_step(src, SOUTH)) return return /obj/machinery/mineral/gasextractor/attack_hand(user as mob) if(processing == 1) user << "The machine is processing" return var/dat dat = text("input connection status: ") if (input) dat += text("CONNECTED") else dat += text("NOT CONNECTED") dat += text("
output connection status: ") if (output) dat += text("CONNECTED") else dat += text("NOT CONNECTED") dat += text("

Extract gas") dat += text("

Message: [message]") user << browse("[dat]", "window=purifier") /obj/machinery/mineral/gasextractor/Topic(href, href_list) if(..()) return usr.machine = src src.add_fingerprint(usr) if(href_list["extract"]) if (src.output) if (locate(/obj/machinery/portable_atmospherics/canister,output.loc)) newtoxins = 0 processing = 1 var/obj/item/weapon/ore/O while(locate(/obj/item/weapon/ore/plasma, input.loc) && locate(/obj/machinery/portable_atmospherics/canister,output.loc)) O = locate(/obj/item/weapon/ore/plasma, input.loc) if (istype(O,/obj/item/weapon/ore/plasma)) var/obj/machinery/portable_atmospherics/canister/C C = locate(/obj/machinery/portable_atmospherics/canister,output.loc) C.air_contents.toxins += 100 newtoxins += 100 del(O) sleep(5); processing = 0; message = "Canister filled with [newtoxins] units of toxins" else message = "No canister found" src.updateUsrDialog() return /******************************Lantern*******************************/ /obj/item/device/flashlight/lantern name = "Mining Lantern" icon = 'lighting.dmi' icon_state = "lantern-off" desc = "A miner's lantern" anchored = 0 var/brightness = 12 // luminosity when on /obj/item/device/flashlight/lantern/New() luminosity = 0 on = 0 return /obj/item/device/flashlight/lantern/attack_self(mob/user) ..() if (on == 1) icon_state = "lantern-on" else icon_state = "lantern-off" /*****************************Pickaxe********************************/ /obj/item/weapon/pickaxe name = "Miner's pickaxe" icon = 'items.dmi' icon_state = "pickaxe" flags = FPRINT | TABLEPASS| CONDUCT | ONBELT force = 15.0 throwforce = 4.0 item_state = "wrench" w_class = 4.0 m_amt = 50 /*****************************Shovel********************************/ /obj/item/weapon/shovel name = "Shovel" icon = 'items.dmi' icon_state = "shovel" flags = FPRINT | TABLEPASS| CONDUCT | ONBELT force = 8.0 throwforce = 4.0 item_state = "wrench" w_class = 4.0 m_amt = 50 /******************************Materials****************************/ /obj/item/stack/sheet/gold name = "gold" icon_state = "sheet-gold" force = 5.0 g_amt = 3750 throwforce = 5 w_class = 3.0 throw_speed = 3 throw_range = 3 /obj/item/stack/sheet/gold/New() pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 /obj/item/stack/sheet/silver name = "silver" icon_state = "sheet-silver" force = 5.0 g_amt = 3750 throwforce = 5 w_class = 3.0 throw_speed = 3 throw_range = 3 /obj/item/stack/sheet/silver/New() pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 /obj/item/stack/sheet/diamond name = "diamond" icon_state = "sheet-diamond" force = 5.0 g_amt = 3750 throwforce = 5 w_class = 3.0 throw_speed = 3 throw_range = 3 /obj/item/stack/sheet/diamond/New() pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 /obj/item/stack/sheet/plasma name = "solid plasma" icon_state = "sheet-plasma" force = 5.0 g_amt = 3750 throwforce = 5 w_class = 3.0 throw_speed = 3 throw_range = 3 /obj/item/stack/sheet/clown name = "bananium" icon_state = "sheet-clown" force = 5.0 g_amt = 3750 throwforce = 5 w_class = 3.0 throw_speed = 3 throw_range = 3 /obj/item/stack/sheet/diamond/New() pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 /**********************Rail track**************************/ /obj/machinery/rail_track name = "Rail track" icon = 'Mining.dmi' icon_state = "rail" dir = 2 var/id = null //this is needed for switches to work Set to the same on the whole length of the track anchored = 1 /**********************Rail intersection**************************/ /obj/machinery/rail_track/intersections name = "Rail track intersection" icon_state = "rail_intersection" /obj/machinery/rail_track/intersections/attack_hand(user as mob) switch (dir) if (1) dir = 5 if (5) dir = 4 if (4) dir = 9 if (9) dir = 2 if (2) dir = 10 if (10) dir = 8 if (8) dir = 6 if (6) dir = 1 return /obj/machinery/rail_track/intersections/NSE name = "Rail track T intersection" icon_state = "rail_intersection_NSE" dir = 2 /obj/machinery/rail_track/intersections/NSE/attack_hand(user as mob) switch (dir) if (1) dir = 5 if (2) dir = 5 if (5) dir = 9 if (9) dir = 2 return /obj/machinery/rail_track/intersections/SEW name = "Rail track T intersection" icon_state = "rail_intersection_SEW" dir = 8 /obj/machinery/rail_track/intersections/SEW/attack_hand(user as mob) switch (dir) if (8) dir = 6 if (4) dir = 6 if (6) dir = 5 if (5) dir = 8 return /obj/machinery/rail_track/intersections/NSW name = "Rail track T intersection" icon_state = "rail_intersection_NSW" dir = 2 /obj/machinery/rail_track/intersections/NSW/attack_hand(user as mob) switch (dir) if (1) dir = 10 if (2) dir = 10 if (10) dir = 6 if (6) dir = 2 return /obj/machinery/rail_track/intersections/NEW name = "Rail track T intersection" icon_state = "rail_intersection_NEW" dir = 8 /obj/machinery/rail_track/intersections/NEW/attack_hand(user as mob) switch (dir) if (4) dir = 9 if (8) dir = 9 if (9) dir = 10 if (10) dir = 8 return /**********************Rail switch**************************/ /obj/machinery/rail_switch name = "Rail switch" icon = 'Mining.dmi' icon_state = "rail" dir = 2 icon = 'recycling.dmi' icon_state = "switch-off" var/obj/machinery/rail_track/track = null var/id //used for to change the track pieces /obj/machinery/rail_switch/New() spawn(10) src.track = locate(/obj/machinery/rail_track, get_step(src, NORTH)) if(track) id = track.id return /obj/machinery/rail_switch/attack_hand(user as mob) user << "You switch the rail track's direction" for (var/obj/machinery/rail_track/T in world) if (T.id == src.id) var/obj/machinery/rail_car/C = locate(/obj/machinery/rail_car, T.loc) if (C) switch (T.dir) if(1) switch(C.direction) if("N") C.direction = "S" if("S") C.direction = "N" if("E") C.direction = "S" if("W") C.direction = "S" if(2) switch(C.direction) if("N") C.direction = "S" if("S") C.direction = "N" if("E") C.direction = "S" if("W") C.direction = "S" if(4) switch(C.direction) if("N") C.direction = "E" if("S") C.direction = "E" if("E") C.direction = "W" if("W") C.direction = "E" if(8) switch(C.direction) if("N") C.direction = "E" if("S") C.direction = "E" if("E") C.direction = "W" if("W") C.direction = "E" if(5) switch(C.direction) if("N") C.direction = "S" if("S") C.direction = "E" if("E") C.direction = "S" if("W") C.direction = "S" if(6) switch(C.direction) if("N") C.direction = "S" if("S") C.direction = "W" if("E") C.direction = "S" if("W") C.direction = "S" if(9) switch(C.direction) if("N") C.direction = "E" if("S") C.direction = "E" if("E") C.direction = "N" if("W") C.direction = "E" if(10) switch(C.direction) if("N") C.direction = "W" if("S") C.direction = "W" if("E") C.direction = "W" if("W") C.direction = "N" return /**********************Mining car (Crate like thing, not the rail car)**************************/ /obj/crate/miningcar desc = "A mining car. This one doesn't work on rails, but has to be dragged." name = "Mining car (not for rails)" icon = 'storage.dmi' icon_state = "miningcar" density = 1 openicon = "miningcaropen" closedicon = "miningcar" /**********************Rail car**************************/ /obj/machinery/rail_car name = "Rail car" icon = 'Storage.dmi' icon_state = "miningcar" var/direction = "S" //S = south, N = north, E = east, W = west. Determines whichw ay it'll look first var/moving = 0; anchored = 1 density = 1 var/speed = 0 var/slowing = 0 var/atom/movable/load = null //what it's carrying /obj/machinery/rail_car/attack_hand(user as mob) if (moving == 0) processing_items.Add(src) moving = 1 else processing_items.Remove(src) moving = 0 return /* for (var/client/C) C << "Dela." */ /obj/machinery/rail_car/MouseDrop_T(var/atom/movable/C, mob/user) if(user.stat) return if (!istype(C) || C.anchored || get_dist(user, src) > 1 || get_dist(src,C) > 1 ) return if(ismob(C)) load(C) /obj/machinery/rail_car/proc/load(var/atom/movable/C) if(get_dist(C, src) > 1) return //mode = 1 C.loc = src.loc sleep(2) C.loc = src load = C C.pixel_y += 9 if(C.layer < layer) C.layer = layer + 0.1 overlays += C if(ismob(C)) var/mob/M = C if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src //mode = 0 //send_status() /obj/machinery/rail_car/proc/unload(var/dirn = 0) if(!load) return overlays = null load.loc = src.loc load.pixel_y -= 9 load.layer = initial(load.layer) if(ismob(load)) var/mob/M = load if(M.client) M.client.perspective = MOB_PERSPECTIVE M.client.eye = src if(dirn) step(load, dirn) load = null // in case non-load items end up in contents, dump every else too // this seems to happen sometimes due to race conditions // with items dropping as mobs are loaded for(var/atom/movable/AM in src) AM.loc = src.loc AM.layer = initial(AM.layer) AM.pixel_y = initial(AM.pixel_y) if(ismob(AM)) var/mob/M = AM if(M.client) M.client.perspective = MOB_PERSPECTIVE M.client.eye = src /obj/machinery/rail_car/relaymove(var/mob/user) if(user.stat) return if(load == user) unload(0) return /obj/machinery/rail_car/process() if (moving == 1) if (slowing == 1) if (speed > 0) speed--; if (speed == 0) slowing = 0 else if (speed < 10) speed++; var/i = 0 for (i = 0; i < speed; i++) if (moving == 1) switch (direction) if ("S") for (var/obj/machinery/rail_track/R in locate(src.x,src.y-1,src.z)) if (R.dir == 10) direction = "W" if (R.dir == 9) direction = "E" if (R.dir == 2 || R.dir == 1 || R.dir == 10 || R.dir == 9) for (var/mob/living/M in locate(src.x,src.y-1,src.z)) step(M,get_dir(src,R)) step(src,get_dir(src,R)) break else moving = 0 speed = 0 if ("N") for (var/obj/machinery/rail_track/R in locate(src.x,src.y+1,src.z)) if (R.dir == 5) direction = "E" if (R.dir == 6) direction = "W" if (R.dir == 5 || R.dir == 1 || R.dir == 6 || R.dir == 2) for (var/mob/living/M in locate(src.x,src.y+1,src.z)) step(M,get_dir(src,R)) step(src,get_dir(src,R)) break else moving = 0 speed = 0 if ("E") for (var/obj/machinery/rail_track/R in locate(src.x+1,src.y,src.z)) if (R.dir == 6) direction = "S" if (R.dir == 10) direction = "N" if (R.dir == 4 || R.dir == 8 || R.dir == 10 || R.dir == 6) for (var/mob/living/M in locate(src.x+1,src.y,src.z)) step(M,get_dir(src,R)) step(src,get_dir(src,R)) break else moving = 0 speed = 0 if ("W") for (var/obj/machinery/rail_track/R in locate(src.x-1,src.y,src.z)) if (R.dir == 9) direction = "N" if (R.dir == 5) direction = "S" if (R.dir == 8 || R.dir == 9 || R.dir == 5 || R.dir == 4) for (var/mob/living/M in locate(src.x-1,src.y,src.z)) step(M,get_dir(src,R)) step(src,get_dir(src,R)) break else moving = 0 speed = 0 sleep(1) else processing_items.Remove(src) moving = 0 return /**********************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 = '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