Recycling Added, and fixed some admin things.

+ Bomb-deletion-related stuff, which was removed for some fucking reason.
 + Added recycling machines
 + Added recycling procs to atoms
 + Restructured disposals for a proper recycling plant.
 + Fixed a few typos I noticed.
This commit is contained in:
Rob Nelson
2013-08-21 21:26:01 -07:00
parent 5e78acd794
commit 692d673dc9
15 changed files with 8555 additions and 8024 deletions

View File

@@ -315,6 +315,19 @@ obj/machinery/atmospherics/pipe
level = 1
icon_state = "intact-y-f"
simple/filtering
name="Pipe"
color="green"
icon_state = ""
simple/filtering/visible
level = 2
icon_state = "intact-g"
simple/filtering/hidden
level = 1
icon_state = "intact-g-f"
simple/insulated
@@ -329,6 +342,10 @@ obj/machinery/atmospherics/pipe
level = 2
hidden
level=1
icon_state="intact-f"
tank
icon = 'icons/obj/atmospherics/pipe_tank.dmi'
@@ -792,6 +809,11 @@ obj/machinery/atmospherics/pipe
color="yellow"
icon_state = ""
manifold/filtering
name="Air filtering pipe"
color="green"
icon_state = ""
manifold/scrubbers/visible
level = 2
icon_state = "manifold-r"
@@ -832,6 +854,15 @@ obj/machinery/atmospherics/pipe
level = 1
icon_state = "manifold-y-f"
manifold/filtering/visible
level = 2
icon_state = "manifold-g"
manifold/filtering/hidden
level = 1
icon_state = "manifold-g-f"
manifold4w
icon = 'icons/obj/atmospherics/pipe_manifold.dmi'
icon_state = "manifold4w-f"

View File

@@ -306,6 +306,10 @@
flags = FPRINT | TABLEPASS| CONDUCT
m_amt = 3750
recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
rec.iron++
return 1
/obj/item/weapon/shard
name = "shard"
icon = 'icons/obj/shards.dmi'
@@ -323,6 +327,10 @@
"\red <b>[user] is slitting \his throat with the shard of glass! It looks like \he's trying to commit suicide.</b>")
return (BRUTELOSS)
/obj/item/weapon/shard/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
rec.glass++
return 1
/obj/item/weapon/shard/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
@@ -408,6 +416,10 @@
flags = FPRINT | TABLEPASS| CONDUCT
attack_verb = list("slammed", "bashed", "battered", "bludgeoned", "thrashed", "whacked")
recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
rec.iron+=2
return 1
/obj/item/weapon/table_parts/reinforced
name = "reinforced table parts"
desc = "Hard table parts. Well...harder..."
@@ -416,6 +428,11 @@
m_amt = 7500
flags = FPRINT | TABLEPASS| CONDUCT
recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
// 2 metal + 4 rods (0.5 metal ea)
rec.iron+=4
return 1
/obj/item/weapon/table_parts/wood
name = "wooden table parts"
desc = "Keep away from fire."

View File

@@ -646,7 +646,7 @@ proc/process_ghost_teleport_locs()
icon_state = "disposal"
/area/maintenance/disposal
name = "Waste Disposal"
name = "Recycling"
icon_state = "disposal"
//Hallway

View File

@@ -22,6 +22,9 @@
src.last_move = get_dir(A, src.loc)
return
/atom/movable/proc/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
return 0
/atom/movable/Bump(var/atom/A as mob|obj|turf|area, yes)
if(src.throwing)
src.throw_impact(A)

View File

@@ -28,7 +28,7 @@
usr << "\red APC cannot be placed in this area."
return
if (A.get_apc())
usr << "\red This area already has APC."
usr << "\red This area already has an APC."
return //only one APC per area
for(var/obj/machinery/power/terminal/T in loc)
if (T.master)

View File

@@ -13,6 +13,10 @@
max_amount = 60
attack_verb = list("hit", "bludgeoned", "whacked")
/obj/item/stack/rods/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
rec.iron += amount/2
return 1
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
..()
if (istype(W, /obj/item/weapon/weldingtool))

View File

@@ -20,7 +20,17 @@ AI MODULES
throw_range = 15
origin_tech = "programming=3"
//Recycling
g_amt=2000 // Glass
var/gold_amt=0
var/diamond_amt=0
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
rec.glass += g_amt
rec.gold += gold_amt
rec.diamond += diamond_amt
return 1
/obj/item/weapon/aiModule/attack_ai(mob/user as mob)
// Keep MoMMIs from picking them up.
@@ -105,6 +115,11 @@ AI MODULES
desc = "A 'safeguard' AI module: 'Safeguard <name>. Individuals that threaten <name> are not human and are a threat to humans.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
@@ -134,6 +149,11 @@ AI MODULES
desc = "A 'one human' AI module: 'Only <name> is human.'"
origin_tech = "programming=3;materials=6" //made with diamonds!
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
diamond_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)
@@ -165,6 +185,11 @@ AI MODULES
desc = "A 'protect station' AI module: 'Protect the space station against damage. Anyone you see harming the station is to be no longer considered human, and is a threat to the station which must be neutralized.'"
origin_tech = "programming=3;materials=4" //made of gold
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/protectStation/attack_self(var/mob/user as mob)
..()
@@ -181,6 +206,11 @@ AI MODULES
desc = "A 'prototype engine offline' AI module: 'Keep the prototype engine offline at all costs. This overrides rules 1-3 if necessary.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/prototypeEngineOffline/attack_self(var/mob/user as mob)
..()
@@ -197,6 +227,11 @@ AI MODULES
desc = "A 'teleporter offline' AI module: 'Keep the teleporter offline at all costs. Anything attempting to access or activate the teleporter is not human.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/teleporterOffline/attack_self(var/mob/user as mob)
..()
@@ -213,6 +248,11 @@ AI MODULES
desc = "A 'quarantine' AI module: 'The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, humans from leaving. It is impossible to harm a human while preventing them from leaving.'"
origin_tech = "programming=3;biotech=2;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/quarantine/attack_self(var/mob/user as mob)
..()
@@ -229,6 +269,11 @@ AI MODULES
desc = "A 'OxygenIsToxicToHumans' AI module: 'Oxygen is highly toxic to humans, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a human.'"
origin_tech = "programming=3;biotech=2;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/oxygen/attack_self(var/mob/user as mob)
..()
@@ -268,6 +313,11 @@ AI MODULES
desc = "A 'freeform' AI module: '<freeform>'"
origin_tech = "programming=4;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob)
..()
lawpos = 0
@@ -302,6 +352,11 @@ AI MODULES
desc = "A 'reset' AI module: 'Clears all laws except for the core three.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/reset/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
if (!is_special_character(target))
@@ -318,6 +373,11 @@ AI MODULES
desc = "A 'purge' AI Module: 'Purges all laws.'"
origin_tech = "programming=3;materials=6"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
diamond_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/purge/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
if (!is_special_character(target))
@@ -334,6 +394,11 @@ AI MODULES
desc = "An 'Asimov' Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/asimov/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
@@ -350,6 +415,11 @@ AI MODULES
desc = "An 'NT Default' Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/nanotrasen/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
@@ -368,6 +438,11 @@ AI MODULES
desc = "A 'Corporate' Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=3;materials=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/corp/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
@@ -385,6 +460,11 @@ AI MODULES
desc = "A P.A.L.A.D.I.N. Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=3;materials=6"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
diamond_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/paladin/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
target.clear_inherent_laws()
@@ -402,6 +482,11 @@ AI MODULES
desc = "A T.Y.R.A.N.T. Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=3;materials=6;syndicate=2"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
diamond_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/tyrant/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
target.clear_inherent_laws()
@@ -420,6 +505,11 @@ AI MODULES
desc = "A 'freeform' Core AI module: '<freeform>'"
origin_tech = "programming=3;materials=6"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
diamond_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
@@ -476,6 +566,11 @@ AI MODULES
desc = "A 'Robocop' Core AI Module: 'Reconfigures the AI's core three laws.'"
origin_tech = "programming=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/robocop/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
@@ -493,6 +588,11 @@ AI MODULES
desc = "An 'Antimov' Core AI Module: 'Reconfigures the AI's core laws.'"
origin_tech = "programming=4"
// Recycling
g_amt=2000/CC_PER_SHEET_GLASS // Glass
gold_amt=100/CC_PER_SHEET_MISC
// Don't specify sulfuric, as that's renewable and is used up in the etching process anyway.
/obj/item/weapon/aiModule/antimov/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
..()
target.clear_inherent_laws()

View File

@@ -18,6 +18,14 @@
/obj/item/proc/is_used_on(obj/O, mob/user)
/obj/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
if (src.m_amt == 0 && src.g_amt == 0)
return 0
rec.iron += src.m_amt/CC_PER_SHEET_METAL
rec.glass += src.g_amt/CC_PER_SHEET_GLASS
return 1
/obj/proc/process()
processing_objects.Remove(src)
return 0

View File

@@ -545,7 +545,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretsfun=spiders'>Trigger a Spider infestation</A><BR>
<A href='?src=\ref[src];secretsfun=spaceninja'>Send in a space ninja</A><BR>
<A href='?src=\ref[src];secretsfun=striketeam'>Send in a strike team</A><BR>
<A href='?src=\ref[src];secretsfun=carp'>Trigger an Carp migration</A><BR>
<A href='?src=\ref[src];secretsfun=carp'>Trigger a Carp migration</A><BR>
<A href='?src=\ref[src];secretsfun=radiation'>Irradiate the station</A><BR>
<A href='?src=\ref[src];secretsfun=prison_break'>Trigger a Prison Break</A><BR>
<A href='?src=\ref[src];secretsfun=virus'>Trigger a Virus Outbreak</A><BR>

View File

@@ -2120,7 +2120,19 @@
var/ok = 0
switch(href_list["secretsadmin"])
if("clear_bombs")
//I do nothing
var/num=0
for(var/obj/item/device/transfer_valve/TV in world)
if(TV.tank_one||TV.tank_two)
del(TV)
TV++
message_admins("[key_name_admin(usr)] has removed [num] bombs", 1)
if("detonate_bombs")
var/num=0
for(var/obj/item/device/transfer_valve/TV in world)
if(TV.tank_one||TV.tank_two)
TV.toggle_valve()
message_admins("[key_name_admin(usr)] has toggled valves on [num] bombs", 1)
if("list_bombers")
var/dat = "<B>Bombing List<HR>"
for(var/l in bombers)

View File

@@ -15,5 +15,15 @@
name = "Output area"
density = 0
anchored = 1.0
New()
icon_state = "blank"
/obj/machinery/mineral/selected_output
icon = 'icons/mob/screen1.dmi'
icon_state = "x3"
name = "Selected Output area"
desc = "Where we put things that we wanted."
density = 0
anchored = 1.0
New()
icon_state = "blank"

View File

@@ -405,4 +405,148 @@
O.loc = src.output.loc
else
break
return
return
/////////////////////////////////////////////////
// Recycling Furnace
/obj/machinery/mineral/processing_unit/recycle
name = "recycling furnace"
var/gold = 0;
var/silver = 0;
var/diamond = 0;
var/glass = 0;
var/plasma = 0;
var/uranium = 0;
var/iron = 0;
var/clown = 0;
var/adamantine = 0;
var/list/ALLOWED_TYPES=list(
/obj/item,
/obj/machinery/portable_atmospherics/canister,
)
/obj/machinery/mineral/processing_unit/recycle/process()
if (src.output && src.input)
var/i
//if(!(stat & (BROKEN|UNPOWERED)))
for (i = 0; i < 10; i++)
if (glass >= 1)
glass--;
new /obj/item/stack/sheet/glass(output.loc)
if (gold >= 1)
gold--;
new /obj/item/stack/sheet/mineral/gold(output.loc)
if (silver >= 1)
silver--;
new /obj/item/stack/sheet/mineral/silver(output.loc)
if (diamond >= 1)
diamond--;
new /obj/item/stack/sheet/mineral/diamond(output.loc)
if (plasma >= 1)
plasma--;
new /obj/item/stack/sheet/mineral/plasma(output.loc)
if (uranium >= 1)
uranium--;
new /obj/item/stack/sheet/mineral/uranium(output.loc)
if (iron >= 1)
iron--;
new /obj/item/stack/sheet/metal(output.loc)
if (clown >= 1)
clown--;
new /obj/item/stack/sheet/mineral/clown(output.loc)
for (i = 0; i < 10; i++)
var/obj/O
for(O in input.loc.contents)
var/allowed=0
for(var/T in ALLOWED_TYPES)
if(istype(O,T))
allowed=1
break
if(O && allowed)
if (O.recycle(src))
del(O)
else
O.loc = src.output.loc
/obj/machinery/mineral/processing_unit/recycle/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/mineral/processing_unit/recycle/attack_paw(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/mineral/processing_unit/recycle/attack_hand(var/mob/user as mob)
return src.interact(user)
/obj/machinery/mineral/processing_unit/recycle/interact(var/mob/user as mob)
user.set_machine(src)
var/found=0
var/html = {"<html>
<head>
<title>Recyk Processor</title>
</head>
<body>
<h1>Recyk PRO-1000</h1>
<p><b>Current Status:</b> (<a href='?src=\ref[user];mach_close=recyk_furnace'>Close</a>)</p>
<ul>
"}
if(adamantine > 0.0)
html += "<li><b>Adamantine:</b> [adamantine]</li>"
found=1
if(clown > 0.0)
html += "<li><b>Bananaium:</b> [clown]</li>"
found=1
if(diamond > 0.0)
html += "<li><b>Diamond:</b> [diamond]</li>"
found=1
if(glass > 0.0)
html += "<li><b>Glass:</b> [glass]</li>"
found=1
if(gold > 0.0)
html += "<li><b>Gold:</b> [gold]</li>"
found=1
if(iron > 0.0)
html += "<li><b>Iron:</b> [iron]</li>"
found=1
if(plasma > 0.0)
html += "<li><b>Plasma:</b> [plasma]</li>"
found=1
if(silver > 0.0)
html += "<li><b>Silver:</b> [silver]</li>"
found=1
if(uranium > 0.0)
html += "<li><b>Uranium:</b> [uranium]</li>"
found=1
if(!found)
html += "<li><i>(Nothing loaded yet!)</i></li>"
html +={"
</ul>
<p><i>(Units are sheets)</i></p>
</body>
</html>
"}
//"<A href='?src=\ref[src];toggle=1'>[valve_open?("Open"):("Closed")]</A><BR>
user << browse(html, "window=recyk_furnace;size=600x300")
onclose(user, "canister")
return
/obj/machinery/mineral/processing_unit/recycle/Topic(href, href_list)
//Do not use "if(..()) return" here, canisters will stop working in unpowered areas like space or on the derelict.
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(1)//if(!isAdminGhost(usr))
usr << browse(null, "window=recyk_furnace")
onclose(usr, "recyk_furnace")
return

View File

@@ -304,3 +304,195 @@
else
user << "You need more welding fuel to complete this task."
return
/obj/machinery/sorting_machine
name = "Sorting Machine"
desc = "Sorts stuff."
density = 1
icon = 'icons/obj/recycling.dmi'
icon_state = "grinder-b1"
anchored=1
var/select_txt
var/list/selection=list()
var/list/selected_types=list()
var/list/types=list(
"Carcasses" = list(
/mob/living/carbon,
/mob/living/simple_animal
),
"Glasses" = list(
/obj/item/weapon/shard,
/obj/item/stack/sheet/glass,
/obj/item/stack/sheet/rglass,
/obj/item/stack/tile/light,
/obj/item/weapon/broken_bottle,
/obj/item/weapon/reagent_containers/glass/bucket,
/obj/item/clothing/head/welding,
/obj/item/weapon/stock_parts/console_screen,
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/syringe,
/obj/item/weapon/light/tube,
/obj/item/weapon/light/bulb,
),
"Electronics" = list(
/obj/item/weapon/circuitboard,
/obj/item/weapon/aiModule,
/obj/item/device/flashlight,
/obj/item/device/multitool,
/obj/item/device/t_scanner,
/obj/item/weapon/airlock_electronics,
/obj/item/weapon/airalarm_electronics,
/obj/item/weapon/firealarm_electronics,
/obj/item/device/taperecorder,
/obj/item/device/assembly/igniter,
/obj/item/device/assembly/signaler,
/obj/item/device/radio/headset,
/obj/item/device/radio,
/obj/item/device/assembly/infra,
/obj/item/device/assembly/timer,
/obj/item/weapon/camera_assembly
),
"Metals/Minerals" = list(
/obj/item/stack/rods,
/obj/item/stack/sheet/plasteel,
/obj/item/stack/sheet/metal,
/obj/item/stack/sheet/metal/cyborg,
/obj/item/stack/sheet/mineral,
/obj/item/apc_frame,
/obj/item/alarm_frame,
/obj/item/firealarm_frame,
/obj/item/weapon/table_parts,
/obj/item/weapon/table_parts/reinforced,
/obj/item/weapon/rack_parts,
/obj/item/weapon/crowbar,
/obj/item/weapon/extinguisher,
/obj/item/weapon/weldingtool,
/obj/item/weapon/screwdriver,
/obj/item/weapon/wirecutters,
/obj/item/weapon/wrench,
/obj/item/weapon/rcd_ammo,
/obj/item/weapon/kitchenknife,
/obj/item/weapon/scalpel,
/obj/item/weapon/circular_saw,
/obj/item/weapon/surgicaldrill,
/obj/item/weapon/retractor,
/obj/item/weapon/cautery,
/obj/item/ammo_casing/shotgun/blank,
/obj/item/ammo_casing/shotgun/beanbag,
/obj/item/ammo_magazine/c38,
/obj/structure/closet, // 2 sheets
/obj/machinery/portable_atmospherics/canister, //10 sheets
/obj/item/stack/tile/plasteel, //1/4 of a sheet
/obj/item/weapon/grenade/chem_grenade,
)
)
var/obj/machinery/mineral/input = null
var/obj/machinery/mineral/output = null
var/obj/machinery/mineral/selected_output = null
/obj/machinery/sorting_machine/New()
..()
spawn( 5 )
var i = 0;
for (var/dir in cardinal)
var/turf/T=get_step(src, dir)
if(!input)
src.input = locate(/obj/machinery/mineral/input, T)
i++
if(!output)
src.output = locate(/obj/machinery/mineral/output, T)
i++
if(!selected_output)
src.selected_output = locate(/obj/machinery/mineral/selected_output, T)
i++
if(src.output && src.input && src.selected_output)
break
if(i<3)
diary << "\a [src] couldn't find an input or output plate."
if(select_txt)
for(var/n in text2list(select_txt," "))
selected_types += n
selection += types[n]
return
/obj/machinery/sorting_machine/process()
if(stat & (BROKEN | NOPOWER))
return
use_power(100)
var/affecting = input.loc.contents // moved items will be all in loc
spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(A.loc == input.loc) // prevents the object from being affected if it's not currently here.
var/found=0
for(var/t in selection)
if(istype(A,t))
A.loc=selected_output.loc
found=1
break
if(!found)
A.loc=output.loc
items_moved++
if(items_moved >= 10)
break
/obj/machinery/sorting_machine/proc/openwindow(mob/user as mob)
var/dat = {"
<html>
<head>
<style type="text/css">
html,body {
font-family:sans-serif,verdana;
font-size:smaller;
color:#666;
}
h1 {
border-bottom:1px solid maroon;
}
table {
width:100%;
padding:4px;
}
</style>
</head>
<body>
<h1>SortMaster 5000</h1><br>
<p>Select the desired items to sort from the line.</p>"}
dat += "<ul>"
for (var/n in types)
dat += "<li>"
var/selected = (n in selected_types)
if(selected)
dat+="<b>"
dat+="<a href='?src=\ref[src];set_types=[n]'>[n]</a>"
if(selected)
dat+="</b>"
dat+="</li>"
dat += "</ul></body></html>"
user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")
/obj/machinery/sorting_machine/attack_hand(mob/user as mob)
openwindow(user)
return
/obj/machinery/sorting_machine/Topic(href, href_list)
src.add_fingerprint(usr)
if(href_list["set_types"])
var/n = href_list["set_types"]
if(n in selected_types)
selected_types -= n
selection -= types[n]
else
selected_types += n
selection += types[n]
openwindow(usr)

View File

@@ -398,6 +398,10 @@ var/MAX_EXPLOSION_RANGE = 14
#define GAS_CO2 (1 << 3)
#define GAS_N2O (1 << 4)
#define CC_PER_SHEET_METAL 3750
#define CC_PER_SHEET_GLASS 3750
#define CC_PER_SHEET_MISC 2000
#define INV_SLOT_SIGHT "sight_slot"
#define INV_SLOT_TOOL "tool_slot"

File diff suppressed because it is too large Load Diff