All my changes so far.

note to self: Engineering, Perma, civil jobs, and electricity+piping
This commit is contained in:
RadiantFlash7
2018-02-02 04:57:01 -05:00
parent dc2a309c6a
commit 22d13f10c2
33 changed files with 6401 additions and 6 deletions

View File

@@ -0,0 +1,327 @@
var/global/datum/phororeactions/phororeactions
var/global/list/discovered_phororeagents //list of all phororeagents discovered so far
/obj/machinery/computer/phoronics
icon_keyboard = "rd_key_off"
icon_screen = "phoronics_screen"
circuit = /obj/item/weapon/circuitboard/phoronics
// var/turf/simulated/floor/phoronics/source
var/turf/simulated/floor/source
var/intensity = 1
var/timeLeft = 0
var/timeLeftMax = 0
var/aborting = 0
var/message = "" //57 character max message size, assuming all characters take same size, probably don't
var/obj/machinery/telepad_phoronics/source_pad
var/obj/machinery/telepad_phoronics/dest_pad
var/turf/source_loc
var/turf/dest_loc
var/field
/obj/machinery/computer/phoronics/New()
intensity = 1
timeLeft = 0
timeLeftMax = 0
aborting = 0
message = "Welcome to Phoronics"
if(!phororeactions)
phororeactions = new/datum/phororeactions
phororeactions.set_up_reactions()
if(!discovered_phororeagents)
discovered_phororeagents = list("bicordrazine")
/obj/machinery/computer/phoronics/attack_hand(var/mob/user as mob)
return src.ui_interact(user)
/obj/machinery/computer/phoronics/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
data["intensity"] = intensity
data["timeLeft"] = timeLeft
data["timeLeftMax"] = timeLeftMax
data["message"] = message
if(source)
var/datum/gas_mixture/enviro = source.return_air()
if(enviro.gas["phoron"])
data["phoron"] = round(enviro.gas["phoron"])
else
data["phoron"] = 0
else
data["phoron"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "phorochem.tmpl", "Phorochemputer", 480, 400)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1) // auto update every Master Controller tick
return
/obj/machinery/computer/phoronics/Topic(href, href_list)
if(href_list["beginTest"])
if(timeLeft == 0)
begin_test()
if(href_list["abortTest"])
if(timeLeft > 0)
aborting = 1
if(href_list["recalibrate"])
if(timeLeft == 0)
recalibrate()
if(href_list["intensity"])
intensity = min(max(text2num(href_list["intensity"]), 1), 5)
/obj/machinery/computer/phoronics/proc/recalibrate()
if(timeLeft > 0)
message = "ERROR: Cannot recalibrate while test is in progress"
else
source = null
for(var/turf/simulated/floor/phoronics/tile in range(src, 7)) //check for turf before every tile for flooring first
if(istype(tile.flooring, /decl/flooring/phoronics))
if(!source)
source = tile
else
var/distCur = sqrt(((source.x - src.x) ** 2) + ((source.y - src.y) ** 2))
var/distNew = sqrt(((tile.x - src.x) ** 2) + ((tile.y - src.y) ** 2))
if(distNew < distCur)
source = tile
//only gets here if they decide to move the phoronics tile location, or build their own phoronics for some reason
if(!source)
for(var/turf/simulated/floor/tile in range(src, 7))
if(istype(tile.flooring, /decl/flooring/phoronics))
if(!source)
source = tile
else
var/distCur = sqrt(((source.x - src.x) ** 2) + ((source.y - src.y) ** 2))
var/distNew = sqrt(((tile.x - src.x) ** 2) + ((tile.y - src.y) ** 2))
if(distNew < distCur)
source = tile
if(source)
message = "Electromagnetic tile located at: [source.x], [source.y]"
nanomanager.update_uis(src)
source_pad = null
dest_pad = null
spawn(10)
var/list/telepads = list()
for(var/obj/machinery/telepad_phoronics/T in range(src, 7))
telepads.Add(T)
switch(telepads.len)
if(0)
message = "No telepads found"
return
if(1)
message = "ERROR: Insufficient amount of telepads found, refusing link"
return
if(3 to INFINITY)
message = "ERROR: Too many telepads found, refusing link"
return
var/obj/machinery/telepad_phoronics/temp_pad = telepads[1]
var/turf/T = locate(temp_pad.x, temp_pad.y, temp_pad.z)
if(istype(T, /turf/simulated/floor) && istype(T:flooring, /decl/flooring/phoronics))
dest_pad = telepads[1]
source_pad = telepads[2]
if(!dest_pad.anchored || !source_pad.anchored)
message = "ERROR: One or both telepads not anchored to ground"
dest_pad = null
source_pad = null
return
else
temp_pad = telepads[2]
T = locate(temp_pad.x, temp_pad.y, temp_pad.z)
if(istype(T, /turf/simulated/floor) && istype(T:flooring, /decl/flooring/phoronics))
dest_pad = telepads[2]
source_pad = telepads[1]
if(!dest_pad.anchored || !source_pad.anchored)
message = "ERROR: One or both telepads not anchored to ground"
dest_pad = null
source_pad = null
return
else
message = "ERROR: No telepad located on electromagnetic tile"
return
dest_pad.dest = source_pad
source_pad.dest = dest_pad
source_loc = source_pad.loc
dest_loc = dest_pad.loc
message = "Telepads successfully linked"
else
message = "ERROR: No electromagnetic tiles located"
/obj/machinery/computer/phoronics/proc/begin_test()
if(source && istype(source.flooring, /decl/flooring/phoronics)) //make sure turf is still phoronics tile
message = "Test in progress"
else
return abort("ERROR: Recalibrate to locate electromagnetic tile and or telepads")
var/datum/reagent/reactant
var/obj/item/weapon/reagent_containers/container
//check for beaker, and that beaker contains only one reagent
var/num_containers = 0
if(source_pad)
if(source_pad.loc != source_loc)
return abort("ERROR: Input telepad not where expected, please recalibrate")
if(!source_pad.anchored)
return abort("ERROR: Input telepad not anchored")
for(var/obj/item/weapon/reagent_containers/R in source_pad.loc.contents)
num_containers++
container = R
if(container)
if(!container.is_open_container()) //container not open, insult user
var/insult = pick("idiot", "failure", "waste of space", "high school dropout", "chucklefuck", \
"asshat", "dumbass", "fucklechuck", "scrub", "moron", "typical NT worker")
return abort("ERROR: Open reagent container, you [insult]")
if(istype(container, /obj/item/weapon/reagent_containers/glass/beaker/noreact)) //container doesn't react, insult user
var/insult = pick("idiot", "failure", "ass", "scrub", "chucklefuck", \
"asshat", "dumbass", "fucklechuck", "scrub", "moron")
return abort("ERROR: Reactions don't happen in a cryostasis beaker, you [insult]")
if(container.reagents.reagent_list.len > 1)
return abort("ERROR: Too many reagents detected, aborting test")
if(container.reagents.reagent_list.len == 0)
return abort("ERROR: No reagents detected, aborting test")
var/datum/gas_mixture/enviro = source.return_air()
if(!enviro.gas["phoron"] || enviro.gas["phoron"] < 40)
return abort("ERROR: Not enough phoron to initiate reaction")
reactant = container.reagents.reagent_list[1]
if(source_pad && dest_pad)
if(dest_pad.loc != dest_loc)
return abort("ERROR: Output telepad not where expected, please recalibrate")
if(num_containers > 1)
return abort("ERROR: Too many containers detected on telepads")
else
sleep(10)
source_pad.teleport()
sleep(10) //give some time to see result of teleport
else
message = "WARNING: Telepads not detected. Beginning electrical field"
switch(intensity) //time left in seconds
if(1)
timeLeft = 1
if(2)
timeLeft = 3
if(3)
timeLeft = 6
if(4)
timeLeft = 10
if(5)
timeLeft = 15
timeLeft *= 2 //half seconds to make escape impossible from electrical fields
timeLeftMax = timeLeft
nanomanager.update_uis(src) //update progress bar with new timeLeftMax
var/obj/effect/electrical_field/small/field
var/obj/effect/electrical_field/big/field2
var/intensity2 = intensity //to ensure no shenanigans with changing intensities mid test
if(!aborting)
if(intensity != 4)
field = new/obj/effect/electrical_field/small(source)
if(intensity > 3)
field2 = new/obj/effect/electrical_field/big(source)
while(timeLeft > 0)
if(aborting)
aborting = 0
timeLeft = 0
if(stat & NOPOWER)
message = "ERROR: Test aborted due to power loss"
else
message = "Test aborted"
qdel(field)
qdel(field2)
if(dest_pad)
sleep(10)
dest_pad.anchored = 1
dest_pad.teleport()
return
if(field)
field.process_field()
if(field2)
field2.process_field()
timeLeft--
sleep(5)
if(field2) //add a little extra damage to ensure eventual death on intensity 5 electrical field center
field2.process_field()
qdel(field)
qdel(field2)
//reaction time!
var/reaction_happened = 0
var/datum/reagent/phororeagent/phororeagent = null
var/vol = 0
if(reactant)
vol = reactant.volume //must store because it gets cleared
var/datum/phororeaction/process = phororeactions.reactions[reactant.id]
if(process)
var/result = process.get_result(intensity2)
if(result == "Reaction successful")
container.reagents.clear_reagents()
container.reagents.add_reagent(process.result_id, min(vol * process.conversion_rate, container.volume))
reaction_happened = 1
phororeagent = container.reagents.reagent_list[1]
var/datum/gas_mixture/enviro = source.return_air()
enviro.adjust_gas("phoron", -0.15 * vol) //must fix to use proportion of moles with gas laws
message = result
else
message = "No significant reaction detected"
if(dest_pad)
sleep(10)
dest_pad.teleport()
if(reaction_happened && phororeagent) //phororeagent probably unnecessary check
spawn(rand(25, 50))
message = phororeagent.initial_reaction(container, container.loc, vol, message)
/obj/machinery/computer/phoronics/proc/abort(var/text)
message = text
aborting = 0
timeLeft = 0
return
/obj/machinery/computer/phoronics/power_change()
..()
if(timeLeft > 0 && (stat & NOPOWER))
aborting = 1
//Buildable computers stuff
/obj/item/weapon/circuitboard/phoronics
name = T_BOARD("phorochemputer")
build_path = /obj/machinery/computer/phoronics
origin_tech = "programming=2;bluespace=2"
/datum/design/circuit/phoronics
name = "phorochemputer"
id = "phorochemputer"
req_tech = list("programming" = 3, "bluespace" = 2)
build_path = /obj/item/weapon/circuitboard/phoronics

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -0,0 +1,67 @@
/obj/effect/electrical_field
name = "electric field"
icon = 'icons/rust.dmi'
icon_state = "emfield_s1"
pixel_x = 0
pixel_y = 0
var/last_x = -1
var/last_y = -1
/obj/effect/electrical_field/proc/process_field()
if(last_x == -1 && last_y == -1)
last_x = x
last_y = y
if(last_x != x || last_y != y)
qdel(src)
/obj/effect/electrical_field/proc/shock(var/mob/living/L, var/damage = 2.5)
for(var/datum/reagent/phororeagent/R in L.reagents.reagent_list)
if(R.id == "fulguracin")
if(prob(20))
L << "\blue Your hairs stand up, but you resist the shock for the most part."
return //no shock for you
if(L.stat != DEAD)
L.jitteriness = 140
if(!L.is_jittery)
spawn(0)
L.jittery_process()
var/isHuman = ishuman(L)
if(isHuman)
var/mob/living/carbon/human/H = L
H.apply_effect(10, STUN, 0)
H.apply_effect(10, WEAKEN, 0)
H.apply_effect(10, STUTTER, 0)
H.take_overall_damage(0, damage) //has to be high or they just heal it away instantly
else
L.Stun(10)
L.apply_damage(3, BURN)
/obj/effect/electrical_field/small
name = "small electric field"
/obj/effect/electrical_field/small/process_field()
..()
for(var/mob/living/L in loc.contents)
shock(L, 4) //more damage than big field because it's more condensed or something
/obj/effect/electrical_field/big
name = "large electric field"
icon = 'icons/effects/96x96.dmi'
icon_state = "emfield_s3"
pixel_x = -32
pixel_y = -32
/obj/effect/electrical_field/big/process_field()
..()
var/turf/T = null
for(var/i = src.x - 1 to src.x + 1)
for(var/j = src.y - 1 to src.y + 1)
T = locate(i, j, z)
for(var/mob/living/L in T.contents) //only the middle X 9
shock(L)

View File

@@ -0,0 +1,71 @@
#define REM 0.2
#define SOLID 1
#define LIQUID 2
#define GAS 3
proc/gaseous_reagent_check(var/mob/living/carbon/human/H) //protective clothing check
return (istype(H.wear_suit, /obj/item/clothing/suit/space) && istype(H.head, /obj/item/clothing/head/helmet/space)) \
|| (istype(H.wear_suit, /obj/item/clothing/suit/bio_suit) && istype(H.head, /obj/item/clothing/head/bio_hood) && H.gloves) \
|| (H.isSynthetic())
/datum/reagent/nitrate
id = "nitrate"
name = "Nitrate"
description = "Nitrate, not that interesting."
reagent_state = LIQUID
color = "#D8DFE3"
/datum/reagent/aluminum_nitrate
id = "aluminum_nitrate"
name = "Aluminum Nitrate"
description = "Aluminum Nitrate, now that's interesting!"
reagent_state = LIQUID
color = "#E1CFE3"
/datum/chemical_reaction/nitrate
name = "Nitrate"
id = "nitrate"
result = "nitrate"
required_reagents = list("nitrogen" = 1, "oxygen" = 3)
result_amount = 4
/datum/chemical_reaction/aluminum_nitrate
name = "Aluminum Nitrate"
id = "aluminum_nitrate"
result = "aluminum_nitrate"
required_reagents = list("aluminum" = 1, "nitrate" = 3)
result_amount = 4
/datum/chemical_reaction/brownies
name = "Brownies"
id = "brownies"
result = null
required_reagents = list("aluminum_nitrate" = 40, "tartrate" = 20)
result_amount = 1
on_reaction(var/datum/reagents/holder, var/created_volume)
for(var/i = 0; i < 3; i++)
new /obj/item/weapon/reagent_containers/food/snacks/brownies(get_turf(holder.my_atom))
return
/obj/item/weapon/reagent_containers/food/snacks/brownies
name = "Brownies"
icon_state = "waffles"
desc = "Ovenless Brownies!"
filling_color = "#A79459"
New()
..()
reagents.add_reagent("nutriment", 6)
/obj/item/weapon/induromol
name = "Hardened Induromol"
icon = 'icons/obj/mining.dmi'
icon_state = "ore_platinum"
desc = "Looks like it would make a great throwing weapon."
throwforce = 20
/obj/structure/closet/l3closet/scientist/phoronics/New() //two sets of chemical protection
..()
new /obj/item/clothing/suit/bio_suit/scientist( src )
new /obj/item/clothing/head/bio_hood/scientist( src )

View File

@@ -0,0 +1,45 @@
/obj/machinery/phoroanalyzer
name = "Chemical Analyzer"
density = 1
anchored = 1
icon = 'icons/obj/chemical.dmi'
icon_state = "mixer0b"
use_power = 1
idle_power_usage = 20
var/obj/item/weapon/reagent_containers/stored = null
/obj/machinery/phoroanalyzer/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob)
if(istype(B, /obj/item/weapon/reagent_containers))
stored = B
if(stored.reagents.reagent_list.len > 1)
state("Error: Multiple reagents detected")
return
if(stored.reagents.reagent_list.len == 0)
state("Error: No reagents detected")
return
var/datum/reagent/R = stored.reagents.reagent_list[1]
user.drop_item()
B.loc = src
icon_state = "mixer1b"
//say analyze stuff
spawn(0)
analyze(R)
B.loc = src.loc
icon_state = "mixer0b"
else
return
/obj/machinery/phoroanalyzer/proc/analyze(var/datum/reagent/R)
if(istype(R, /datum/reagent/phororeagent))
var/datum/reagent/phororeagent/P = R
var/description = "Analysis complete - [P.name]: [P.description]"
var/id = P.id
sleep(20)
discovered_phororeagents.Add(id)
state(description)
else
var/description = "Analysis complete - [R.name]: [R.description]"
sleep(20)
state(description)

View File

@@ -0,0 +1,142 @@
//chemistry stuff here so that it can be easily viewed/modified
/obj/item/weapon/reagent_containers/glass/solution_tray
name = "solution tray"
desc = "A small, open-topped glass container for delicate research samples. It sports a re-useable strip for labelling with a pen."
icon = 'icons/obj/device.dmi'
icon_state = "solution_tray"
matter = list("glass" = 5)
w_class = 2.0
amount_per_transfer_from_this = 1
possible_transfer_amounts = list(1, 2)
volume = 2
flags = OPENCONTAINER
unacidable = 1
/obj/item/weapon/storage/box/solution_trays
name = "solution tray box"
icon_state = "solution_trays"
New()
..()
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
new /obj/item/weapon/reagent_containers/glass/solution_tray( src )
/obj/item/weapon/reagent_containers/glass/beaker/tungsten
name = "beaker 'tungsten'"
New()
..()
reagents.add_reagent("tungsten",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/oxygen
name = "beaker 'oxygen'"
New()
..()
reagents.add_reagent("oxygen",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/sodium
name = "beaker 'sodium'"
New()
..()
reagents.add_reagent("sodium",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/lithium
name = "beaker 'lithium'"
New()
..()
reagents.add_reagent("lithium",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/water
name = "beaker 'water'"
New()
..()
reagents.add_reagent("water",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/water
name = "beaker 'water'"
New()
..()
reagents.add_reagent("water",50)
update_icon()
/obj/item/weapon/reagent_containers/glass/beaker/fuel
name = "beaker 'fuel'"
New()
..()
reagents.add_reagent("fuel",50)
update_icon()
/obj/machinery/bunsen_burner
name = "bunsen burner"
desc = "A flat, self-heating device designed for bringing chemical mixtures to boil."
icon = 'icons/obj/device.dmi'
icon_state = "bunsen0"
var/heating = 0 //whether the bunsen is turned on
var/heated = 0 //whether the bunsen has been on long enough to let stuff react
var/obj/item/weapon/reagent_containers/held_container
var/heat_time = 50
/obj/machinery/bunsen_burner/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/reagent_containers))
if(held_container)
user << "\red You must remove the [held_container] first."
else
user.drop_item(src)
held_container = W
held_container.loc = src
user << "\blue You put the [held_container] onto the [src]."
var/image/I = image("icon"=W, "layer"=FLOAT_LAYER)
underlays += I
if(heating)
spawn(heat_time)
try_heating()
else
user << "\red You can't put the [W] onto the [src]."
/obj/machinery/bunsen_burner/attack_ai()
return
/obj/machinery/bunsen_burner/attack_hand(mob/user as mob)
if(held_container)
underlays = null
user << "\blue You remove the [held_container] from the [src]."
held_container.loc = src.loc
held_container.attack_hand(user)
held_container = null
else
user << "\red There is nothing on the [src]."
/obj/machinery/bunsen_burner/proc/try_heating()
src.visible_message("\blue \icon[src] [src] hisses.")
if(held_container && heating)
heated = 1
held_container.reagents.handle_reactions()
heated = 0
spawn(heat_time)
try_heating()
/obj/machinery/bunsen_burner/verb/toggle()
set src in view(1)
set name = "Toggle bunsen burner"
set category = "IC"
heating = !heating
icon_state = "bunsen[heating]"
if(heating)
spawn(heat_time)
try_heating()

View File

@@ -0,0 +1,37 @@
//Phoronics code, courtesy of Dr. Brock.
/turf/simulated/floor/phoronics
name = "electromagnetic tile"
icon = 'icons/turf/flooring/circuit.dmi'
icon_state = "gcircuit_broken"
initial_flooring = /decl/flooring/phoronics
/decl/flooring/phoronics
name = "electromagnetic tile"
desc = "An electromagnetic tile to create an electric field."
icon = 'icons/turf/flooring/circuit.dmi'
icon_base = "gcircuit_broken"
has_damage_range = null
flags = TURF_REMOVE_CROWBAR
build_type = /obj/item/stack/tile/phoronics
//phoronics floor tile object
/obj/item/stack/tile/phoronics
name = "electromagnetic tile"
singular_name = "electromagnetic tile"
desc = "A tile for use in the creation of electromagnetic fields"
icon_state = "fr_tile"
w_class = 3.0
force = 1.0
throwforce = 1.0
throw_speed = 5
throw_range = 20
flags = CONDUCT
max_amount = 1
origin_tech = "magnets=3"
datum/design/item/phoronics_tile
name = "electromagnetic floor tile"
id = "phoronics_tile"
req_tech = list("magnets" = 3, "materials" = 3)
materials = list("$metal" = 1000)
build_path = /obj/item/stack/tile/phoronics

View File

@@ -0,0 +1,68 @@
#define PHORONICS_TESTING 1
/datum/phororeaction
var/reactant_id = ""
var/result_id = ""
var/conversion_rate = 1
var/intensity = 1
/datum/phororeaction/New(var/input, var/output, var/rate = 1, var/level = 1)
#if PHORONICS_TESTING
testing("[input]: [output], [level]")
#endif
reactant_id = input
result_id = output
conversion_rate = rate
intensity = level
/datum/phororeaction/proc/get_result(var/level) //requires that only ONE reagent be tested at at time
if(level == intensity)
return "Reaction successful"
var/difference = abs(level - intensity)
if(difference > 1) //ensure multiple tests required
return "No significant reaction detected"
if(level < intensity)
return "Slight reaction detected, it is recommended to raise intensity"
if(level > intensity)
return "Reaction highly unstable, it is recommended to lower intensity"
/datum/phororeactions
var/list/random_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine", \
"sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron", \
"copper","mercury","radium","water","sugar","sacid","tungsten", "lube", "inaprovaline", "space_drugs", \
"thermite", "tramadol", "cleaner", "kelotane", "dermaline", "anti_toxin", "synaptizine", \
"alkysine", "imidazoline", "hyperzine", "ammonia", "sodiumchloride", "sterilizine", "silicate", "mindbreaker", \
"impedrezene", "lipozine")
var/list/reactions = list()
/datum/phororeactions/proc/set_up_reactions()
reactions["tricordrazine"] = new/datum/phororeaction("tricordrazine", "bicordrazine", 1.5, 3)
reactions["mutagen"] = new/datum/phororeaction("mutagen", "mutagen_x", 0.5, 5)
reactions["ethylredoxrazine"] = new/datum/phororeaction("ethylredoxrazine", "expulsicol", 1, 2)
reactions["hyronalin"] = new/datum/phororeaction("hyronalin", "rad_x", 1, 3)
//reactions["pacid"] = new/datum/phororeaction("pacid", "phoronic_acid", 0.2, 4) removed
reactions["phoron"] = new/datum/phororeaction("phoron", "energized_phoron", 1, 5)
reactions["oxycodone"] = new/datum/phororeaction("oxycodone", "oxyphoromin", 0.5, 1)
var/list/results = typesof(/datum/reagent/phororeagent) - /datum/reagent/phororeagent - /datum/reagent/phororeagent/gaseous
var/list/reactants = list()
for(var/R in reactions)
var/datum/phororeaction/reaction = reactions[R]
reactants[reaction.result_id] = 1 //reaction found
for(var/path in results)
var/datum/reagent/phororeagent/P = new path()
if(reactants[P.id]) //recipe found
continue
else
var/id = pick(random_reagents)
random_reagents.Remove(id)
var/intens = rand(1, 5)
reactions[id] = new/datum/phororeaction(id, P.id, 1, intens)
//garbage collection should deal with reagents

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,62 @@
/obj/machinery/telepad_phoronics
name = "telepad"
desc = "A bluespace telepad used for teleporting objects to and from a location."
icon = 'icons/phoronics.dmi'
icon_state = "pad-idle"
anchored = 1
use_power = 1
idle_power_usage = 50
active_power_usage = 500
var/obj/machinery/telepad_phoronics/dest
/obj/machinery/telepad_phoronics/proc/teleport() //should be guaranteed to only contain one item
if(dest)
flick("pad-beam", src)
playsound(src.loc, 'sound/weapons/flash.ogg', 25, 1)
flick("pad-beam", dest)
playsound(dest.loc, 'sound/weapons/flash.ogg', 25, 1)
for(var/obj/O in src.loc.contents)
if(!O.anchored)
O.loc = dest.loc
for(var/mob/M in src.loc.contents)
//if(!M.restrained())
M.loc = dest.loc
/obj/machinery/telepad_phoronics/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/reagent_containers))
user.drop_item()
W.loc = src.loc
else if(istype(W, /obj/item/weapon/wrench))
var/word = "tighten"
src.anchored = !src.anchored
if(!src.anchored)
word = "undo"
user << "You [word] the telepad anchor bolts."
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
else if(istype(W, /obj/item/weapon/screwdriver) && !src.anchored)
user << "You fold the telepad."
new /obj/item/weapon/phoronics_telepad(src.loc)
del(src)
else
return ..()
/obj/item/weapon/phoronics_telepad
name = "telepad"
desc = "A bluespace telepad used for teleporting objects to and from a location."
icon = 'icons/phoronics.dmi'
icon_state = "pad-folded"
attack_self(mob/user as mob)
user << "You unfold the pad."
var/obj/machinery/telepad_phoronics/T = new /obj/machinery/telepad_phoronics(user.loc)
T.anchored = 0
del(src)
/datum/design/item/phoronics_telepad
name = "phoronics telepad"
id = "phoronics_telepad"
req_tech = list("bluespace" = 2, "materials" = 3)
materials = list("$metal" = 1000)
build_path = /obj/item/weapon/phoronics_telepad