another batch. MAJOR: chem_master, pandemic
This commit is contained in:
@@ -11,8 +11,6 @@
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/circuitboard/computer/powermonitor
|
||||
tgui_id = "PowerMonitor"
|
||||
ui_x = 550
|
||||
ui_y = 700
|
||||
|
||||
var/obj/structure/cable/attached_wire
|
||||
var/obj/machinery/power/apc/local_apc
|
||||
@@ -84,11 +82,10 @@
|
||||
if(demand.len > record_size)
|
||||
demand.Cut(1, 2)
|
||||
|
||||
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/monitor/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PowerMonitor", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "PowerMonitor", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/monitor/ui_data()
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
density = TRUE
|
||||
anchored = FALSE
|
||||
use_power = NO_POWER_USE
|
||||
ui_x = 450
|
||||
ui_y = 340
|
||||
|
||||
var/active = FALSE
|
||||
var/power_gen = 5000
|
||||
@@ -27,6 +25,9 @@
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/port_gen/should_have_node() //remove if runtimed
|
||||
return anchored
|
||||
|
||||
/obj/machinery/power/port_gen/connect_to_network()
|
||||
if(!anchored)
|
||||
return FALSE
|
||||
@@ -219,11 +220,10 @@
|
||||
/obj/machinery/power/port_gen/pacman/attack_paw(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/power/port_gen/pacman/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PortableGenerator", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "PortableGenerator", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/ui_data()
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
active_power_usage = 10000
|
||||
dir = NORTH
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
ui_x = 350
|
||||
ui_y = 185
|
||||
var/strength_upper_limit = 2
|
||||
var/interface_control = TRUE
|
||||
var/list/obj/structure/particle_accelerator/connected_parts
|
||||
@@ -276,11 +274,10 @@
|
||||
return ..()
|
||||
return UI_CLOSE
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/particle_accelerator/control_box/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ParticleAccelerator", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "ParticleAccelerator", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/ui_data(mob/user)
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
circuit = /obj/item/circuitboard/machine/smes
|
||||
ui_x = 340
|
||||
ui_y = 350
|
||||
|
||||
var/capacity = 5e6 // maximum charge
|
||||
var/charge = 0 // actual charge
|
||||
@@ -77,6 +75,9 @@
|
||||
if(!initial(charge) && !charge)
|
||||
charge = C / 15000 * 1e6
|
||||
|
||||
/obj/machinery/power/smes/should_have_node() //remove if runtimed.
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/smes/attackby(obj/item/I, mob/user, params)
|
||||
//opening using screwdriver
|
||||
if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I))
|
||||
@@ -202,7 +203,7 @@
|
||||
|
||||
/obj/machinery/power/smes/update_overlays()
|
||||
. = ..()
|
||||
if((stat & BROKEN) || panel_open)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
@@ -318,11 +319,10 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Smes", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "Smes", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/smes/ui_data()
|
||||
|
||||
@@ -115,9 +115,6 @@
|
||||
panel.icon_state = "solar_panel-b"
|
||||
else
|
||||
panel.icon_state = "solar_panel"
|
||||
#if DM_VERSION <= 512
|
||||
. += new /mutable_appearance(panel)
|
||||
#endif
|
||||
|
||||
/obj/machinery/power/solar/proc/queue_turn(azimuth)
|
||||
needs_to_turn = TRUE
|
||||
@@ -346,11 +343,10 @@
|
||||
else
|
||||
. += mutable_appearance(icon, icon_screen)
|
||||
|
||||
/obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/power/solar_control/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "SolarControl", name, 380, 230, master_ui, state)
|
||||
ui = new(user, src, "SolarControl", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/solar_control/ui_data()
|
||||
|
||||
@@ -56,8 +56,6 @@
|
||||
resistance_flags = FIRE_PROOF
|
||||
CanAtmosPass = ATMOS_PASS_DENSITY
|
||||
circuit = /obj/item/circuitboard/machine/power_turbine
|
||||
ui_x = 310
|
||||
ui_y = 150
|
||||
var/opened = 0
|
||||
var/obj/machinery/power/compressor/compressor
|
||||
var/turf/outturf
|
||||
@@ -249,11 +247,10 @@
|
||||
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/power/turbine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/power/turbine/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "TurbineComputer", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "TurbineComputer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/turbine/ui_data(mob/user)
|
||||
@@ -292,8 +289,6 @@
|
||||
icon_screen = "turbinecomp"
|
||||
icon_keyboard = "tech_key"
|
||||
circuit = /obj/item/circuitboard/computer/turbine_computer
|
||||
ui_x = 310
|
||||
ui_y = 150
|
||||
var/obj/machinery/power/compressor/compressor
|
||||
var/id = 0
|
||||
|
||||
@@ -313,11 +308,10 @@
|
||||
else
|
||||
compressor = locate(/obj/machinery/power/compressor) in range(7, src)
|
||||
|
||||
/obj/machinery/computer/turbine_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/turbine_computer/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "TurbineComputer", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "TurbineComputer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/turbine_computer/ui_data(mob/user)
|
||||
|
||||
@@ -177,11 +177,10 @@
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ChemDispenser", name, 565, 550, master_ui, state)
|
||||
ui = new(user, src, "ChemDispenser", name)
|
||||
if(user.hallucinating())
|
||||
ui.set_autoupdate(FALSE) //to not ruin the immersion by constantly changing the fake chemicals
|
||||
ui.open()
|
||||
@@ -216,7 +215,7 @@
|
||||
data["beakerTransferAmounts"] = null
|
||||
data["beakerCurrentpH"] = null
|
||||
|
||||
var/list/chemicals = list()
|
||||
var/chemicals[0]
|
||||
var/is_hallucinating = FALSE
|
||||
if(user.hallucinating())
|
||||
is_hallucinating = TRUE
|
||||
@@ -275,7 +274,7 @@
|
||||
. = TRUE
|
||||
if("eject")
|
||||
replace_beaker(usr)
|
||||
. = TRUE //no afterattack
|
||||
. = TRUE
|
||||
if("dispense_recipe")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
@@ -326,9 +325,9 @@
|
||||
for(var/reagent in recording_recipe)
|
||||
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
|
||||
if(!dispensable_reagents.Find(reagent_id))
|
||||
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
|
||||
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='hear'>You hear a faint buzz.</span>")
|
||||
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, TRUE)
|
||||
return
|
||||
saved_recipes[name] = recording_recipe
|
||||
recording_recipe = null
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
idle_power_usage = 40
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
circuit = /obj/item/circuitboard/machine/chem_heater
|
||||
|
||||
var/obj/item/reagent_containers/beaker = null
|
||||
var/target_temperature = 300
|
||||
var/heater_coefficient = 0.1
|
||||
@@ -30,22 +31,20 @@
|
||||
|
||||
/obj/machinery/chem_heater/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(!can_interact(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(!user)
|
||||
return FALSE
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
if(user && Adjacent(user) && user.can_hold_items())
|
||||
user.put_in_hands(beaker)
|
||||
user.put_in_hands(beaker)
|
||||
beaker = null
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_heater/RefreshParts()
|
||||
heater_coefficient = 0.1
|
||||
@@ -63,6 +62,7 @@
|
||||
return
|
||||
if(on)
|
||||
if(beaker && beaker.reagents.total_volume)
|
||||
//keep constant with the chemical acclimator please
|
||||
beaker.reagents.adjust_thermal_energy((target_temperature - beaker.reagents.chem_temp) * heater_coefficient * SPECIFIC_HEAT_DEFAULT * beaker.reagents.total_volume)
|
||||
beaker.reagents.handle_reactions()
|
||||
|
||||
@@ -83,27 +83,16 @@
|
||||
updateUsrDialog()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(beaker)
|
||||
if(istype(I, /obj/item/reagent_containers/dropper))
|
||||
var/obj/item/reagent_containers/dropper/D = I
|
||||
D.afterattack(beaker, user, 1)
|
||||
|
||||
if(istype(I, /obj/item/reagent_containers/syringe))
|
||||
var/obj/item/reagent_containers/syringe/S = I
|
||||
S.afterattack(beaker, user, 1)
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_heater/on_deconstruction()
|
||||
replace_beaker()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/chem_heater/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ChemHeater", name, 300, 400, master_ui, state)
|
||||
ui = new(user, src, "ChemHeater", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chem_heater/ui_data()
|
||||
@@ -140,14 +129,7 @@
|
||||
. = TRUE
|
||||
if("temperature")
|
||||
var/target = params["target"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(target == "input")
|
||||
target = input("New target temperature:", name, target_temperature) as num|null
|
||||
if(!isnull(target) && !..())
|
||||
. = TRUE
|
||||
else if(adjust)
|
||||
target = target_temperature + adjust
|
||||
else if(text2num(target) != null)
|
||||
if(text2num(target) != null)
|
||||
target = text2num(target)
|
||||
. = TRUE
|
||||
if(.)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
idle_power_usage = 20
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
circuit = /obj/item/circuitboard/machine/chem_master
|
||||
|
||||
var/obj/item/reagent_containers/beaker = null
|
||||
var/obj/item/storage/pill_bottle/bottle = null
|
||||
var/mode = 1
|
||||
@@ -154,19 +155,15 @@
|
||||
bottle?.forceMove(A)
|
||||
return ..()
|
||||
|
||||
//Insert our custom spritesheet css link into the html
|
||||
/obj/machinery/chem_master/ui_base_html(html)
|
||||
var/datum/asset/spritesheet/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
|
||||
. = replacetext(html, "<!--customheadhtml-->", assets.css_tag())
|
||||
/obj/machinery/chem_master/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/simple/pills),
|
||||
)
|
||||
|
||||
/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/chem_master/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, "ChemMaster", name, 520, 550, master_ui, state)
|
||||
ui = new(user, src, "ChemMaster", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chem_master/ui_data(mob/user)
|
||||
@@ -183,8 +180,8 @@
|
||||
data["isPillBottleLoaded"] = bottle ? 1 : 0
|
||||
if(bottle)
|
||||
var/datum/component/storage/STRB = bottle.GetComponent(/datum/component/storage)
|
||||
data["pillBotContent"] = bottle.contents.len
|
||||
data["pillBotMaxContent"] = STRB.max_items
|
||||
data["pillBottleCurrentAmount"] = bottle.contents.len
|
||||
data["pillBottleMaxAmount"] = STRB.max_items
|
||||
|
||||
var/beakerContents[0]
|
||||
if(beaker)
|
||||
@@ -206,213 +203,219 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("eject")
|
||||
replace_beaker(usr)
|
||||
. = TRUE
|
||||
if(action == "eject")
|
||||
replace_beaker(usr)
|
||||
return TRUE
|
||||
|
||||
if("ejectPillBottle")
|
||||
replace_pillbottle(usr)
|
||||
. = TRUE
|
||||
|
||||
if("transfer")
|
||||
if(!beaker)
|
||||
return FALSE
|
||||
var/reagent = GLOB.name2reagent[params["id"]]
|
||||
var/amount = text2num(params["amount"])
|
||||
var/to_container = params["to"]
|
||||
// Custom amount
|
||||
if (amount == -1)
|
||||
amount = text2num(input(
|
||||
"Enter the amount you want to transfer:",
|
||||
name, ""))
|
||||
if (amount == null || amount <= 0)
|
||||
return FALSE
|
||||
if (to_container == "buffer")
|
||||
end_fermi_reaction()
|
||||
beaker.reagents.trans_id_to(src, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && mode)
|
||||
end_fermi_reaction()
|
||||
reagents.trans_id_to(beaker, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && !mode)
|
||||
end_fermi_reaction()
|
||||
reagents.remove_reagent(reagent, amount)
|
||||
return TRUE
|
||||
if(action == "ejectPillBottle")
|
||||
if(!bottle)
|
||||
return FALSE
|
||||
bottle.forceMove(drop_location())
|
||||
adjust_item_drop_location(bottle)
|
||||
bottle = null
|
||||
return TRUE
|
||||
|
||||
if("toggleMode")
|
||||
mode = !mode
|
||||
. = TRUE
|
||||
if(action == "transfer")
|
||||
if(!beaker)
|
||||
return FALSE
|
||||
var/reagent = GLOB.name2reagent[params["id"]]
|
||||
var/amount = text2num(params["amount"])
|
||||
var/to_container = params["to"]
|
||||
// Custom amount
|
||||
if (amount == -1)
|
||||
amount = text2num(input(
|
||||
"Enter the amount you want to transfer:",
|
||||
name, ""))
|
||||
if (amount == null || amount <= 0)
|
||||
return FALSE
|
||||
if (to_container == "buffer")
|
||||
end_fermi_reaction()
|
||||
beaker.reagents.trans_id_to(src, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && mode)
|
||||
end_fermi_reaction()
|
||||
reagents.trans_id_to(beaker, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && !mode)
|
||||
end_fermi_reaction()
|
||||
reagents.remove_reagent(reagent, amount)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
if("pillStyle")
|
||||
var/id = text2num(params["id"])
|
||||
chosenPillStyle = id
|
||||
if(action == "toggleMode")
|
||||
mode = !mode
|
||||
return TRUE
|
||||
|
||||
if(action == "pillStyle")
|
||||
var/id = text2num(params["id"])
|
||||
chosenPillStyle = id
|
||||
return TRUE
|
||||
|
||||
if(action == "create")
|
||||
if(reagents.total_volume == 0)
|
||||
return FALSE
|
||||
var/item_type = params["type"]
|
||||
// Get amount of items
|
||||
var/amount = text2num(params["amount"])
|
||||
if(amount == null)
|
||||
amount = text2num(input(usr,
|
||||
"Max 10. Buffer content will be split evenly.",
|
||||
"How many to make?", 1))
|
||||
amount = clamp(round(amount), 0, 10)
|
||||
if (amount <= 0)
|
||||
return FALSE
|
||||
// Get units per item
|
||||
var/vol_each = text2num(params["volume"])
|
||||
var/vol_each_text = params["volume"]
|
||||
var/vol_each_max = reagents.total_volume / amount
|
||||
if (item_type == "pill")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else if (item_type == "patch")
|
||||
vol_each_max = min(40, vol_each_max)
|
||||
else if (item_type == "bottle")
|
||||
vol_each_max = min(30, vol_each_max)
|
||||
else if (item_type == "condimentPack")
|
||||
vol_each_max = min(10, vol_each_max)
|
||||
else if (item_type == "condimentBottle")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else if (item_type == "hypoVial")
|
||||
vol_each_max = min(60, vol_each_max)
|
||||
else if (item_type == "smartDart")
|
||||
vol_each_max = min(20, vol_each_max)
|
||||
else
|
||||
return FALSE
|
||||
if(vol_each_text == "auto")
|
||||
vol_each = vol_each_max
|
||||
if(vol_each == null)
|
||||
vol_each = text2num(input(usr,
|
||||
"Maximum [vol_each_max] units per item.",
|
||||
"How many units to fill?",
|
||||
vol_each_max))
|
||||
vol_each = clamp(vol_each, 0, vol_each_max)
|
||||
if(vol_each <= 0)
|
||||
return FALSE
|
||||
// Get item name
|
||||
var/name = params["name"]
|
||||
var/name_has_units = item_type == "pill" || item_type == "patch"
|
||||
if(!name)
|
||||
var/name_default = reagents.get_master_reagent_name()
|
||||
if (name_has_units)
|
||||
name_default += " ([vol_each]u)"
|
||||
name = stripped_input(usr,
|
||||
"Name:",
|
||||
"Give it a name!",
|
||||
name_default,
|
||||
MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
return FALSE
|
||||
// Start filling
|
||||
if(item_type == "pill")
|
||||
var/obj/item/reagent_containers/pill/P
|
||||
var/target_loc = drop_location()
|
||||
var/drop_threshold = INFINITY
|
||||
if(bottle)
|
||||
var/datum/component/storage/STRB = bottle.GetComponent(
|
||||
/datum/component/storage)
|
||||
if(STRB)
|
||||
drop_threshold = STRB.max_items - bottle.contents.len
|
||||
for(var/i = 0; i < amount; i++)
|
||||
if(i < drop_threshold)
|
||||
P = new/obj/item/reagent_containers/pill(target_loc)
|
||||
else
|
||||
P = new/obj/item/reagent_containers/pill(drop_location())
|
||||
P.name = trim("[name] pill")
|
||||
if(chosenPillStyle == RANDOM_PILL_STYLE)
|
||||
P.icon_state ="pill[rand(1,21)]"
|
||||
else
|
||||
P.icon_state = "pill[chosenPillStyle]"
|
||||
if(P.icon_state == "pill4")
|
||||
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "patch")
|
||||
var/obj/item/reagent_containers/pill/patch/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/pill/patch(drop_location())
|
||||
P.name = trim("[name] patch")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "bottle")
|
||||
var/obj/item/reagent_containers/glass/bottle/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
|
||||
P.name = trim("[name] bottle")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "condimentPack")
|
||||
var/obj/item/reagent_containers/food/condiment/pack/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] pack")
|
||||
P.desc = "A small condiment pack. The label says it contains [name]."
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "condimentBottle")
|
||||
var/obj/item/reagent_containers/food/condiment/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] bottle")
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "hypoVial")
|
||||
var/obj/item/reagent_containers/glass/bottle/vial/small/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
|
||||
P.name = trim("[name] hypovial")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "smartDart")
|
||||
var/obj/item/reagent_containers/syringe/dart/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new /obj/item/reagent_containers/syringe/dart(drop_location())
|
||||
P.name = trim("[name] SmartDart")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
P.mode=!mode
|
||||
P.update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
if(action == "analyze")
|
||||
// var/datum/reagent/R = GLOB.name2reagent[params["id"]]
|
||||
var/reagent = GLOB.name2reagent[params["id"]]
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
|
||||
if(R)
|
||||
var/state = "Unknown"
|
||||
if(initial(R.reagent_state) == 1)
|
||||
state = "Solid"
|
||||
else if(initial(R.reagent_state) == 2)
|
||||
state = "Liquid"
|
||||
else if(initial(R.reagent_state) == 3)
|
||||
state = "Gas"
|
||||
var/const/P = 3 //The number of seconds between life ticks
|
||||
var/T = initial(R.metabolization_rate) * (60 / P)
|
||||
if(istype(R, /datum/reagent/fermi))
|
||||
fermianalyze = TRUE
|
||||
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
|
||||
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
|
||||
else
|
||||
fermianalyze = FALSE
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
|
||||
screen = "analyze"
|
||||
return TRUE
|
||||
|
||||
if("create")
|
||||
if(reagents.total_volume == 0)
|
||||
return FALSE
|
||||
var/item_type = params["type"]
|
||||
// Get amount of items
|
||||
var/amount = text2num(params["amount"])
|
||||
if(amount == null)
|
||||
amount = text2num(input(usr,
|
||||
"Max 20. Buffer content will be split evenly.",
|
||||
"How many to make?", 1))
|
||||
amount = clamp(round(amount), 0, 20)
|
||||
if (amount <= 0)
|
||||
return FALSE
|
||||
// Get units per item
|
||||
var/vol_each = text2num(params["volume"])
|
||||
var/vol_each_text = params["volume"]
|
||||
var/vol_each_max = reagents.total_volume / amount
|
||||
if (item_type == "pill")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else if (item_type == "patch")
|
||||
vol_each_max = min(40, vol_each_max)
|
||||
else if (item_type == "bottle")
|
||||
vol_each_max = min(30, vol_each_max)
|
||||
else if (item_type == "condimentPack")
|
||||
vol_each_max = min(10, vol_each_max)
|
||||
else if (item_type == "condimentBottle")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else if (item_type == "hypoVial")
|
||||
vol_each_max = min(60, vol_each_max)
|
||||
else if (item_type == "smartDart")
|
||||
vol_each_max = min(20, vol_each_max)
|
||||
else
|
||||
return FALSE
|
||||
if(vol_each_text == "auto")
|
||||
vol_each = vol_each_max
|
||||
if(vol_each == null)
|
||||
vol_each = text2num(input(usr,
|
||||
"Maximum [vol_each_max] units per item.",
|
||||
"How many units to fill?",
|
||||
vol_each_max))
|
||||
vol_each = clamp(vol_each, 0, vol_each_max)
|
||||
if(vol_each <= 0)
|
||||
return FALSE
|
||||
// Get item name
|
||||
var/name = params["name"]
|
||||
var/name_has_units = item_type == "pill" || item_type == "patch"
|
||||
if(!name)
|
||||
var/name_default = reagents.get_master_reagent_name()
|
||||
if (name_has_units)
|
||||
name_default += " ([vol_each]u)"
|
||||
name = stripped_input(usr,
|
||||
"Name:",
|
||||
"Give it a name!",
|
||||
name_default,
|
||||
MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
return FALSE
|
||||
// Start filling
|
||||
if(item_type == "pill")
|
||||
var/obj/item/reagent_containers/pill/P
|
||||
var/target_loc = drop_location()
|
||||
var/drop_threshold = INFINITY
|
||||
if(bottle)
|
||||
var/datum/component/storage/STRB = bottle.GetComponent(
|
||||
/datum/component/storage)
|
||||
if(STRB)
|
||||
drop_threshold = STRB.max_items - bottle.contents.len
|
||||
for(var/i = 0; i < amount; i++)
|
||||
if(i < drop_threshold)
|
||||
P = new/obj/item/reagent_containers/pill(target_loc)
|
||||
else
|
||||
P = new/obj/item/reagent_containers/pill(drop_location())
|
||||
P.name = trim("[name] pill")
|
||||
if(chosenPillStyle == RANDOM_PILL_STYLE)
|
||||
P.icon_state ="pill[rand(1,21)]"
|
||||
else
|
||||
P.icon_state = "pill[chosenPillStyle]"
|
||||
if(P.icon_state == "pill4")
|
||||
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "patch")
|
||||
var/obj/item/reagent_containers/pill/patch/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/pill/patch(drop_location())
|
||||
P.name = trim("[name] patch")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "bottle")
|
||||
var/obj/item/reagent_containers/glass/bottle/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
|
||||
P.name = trim("[name] bottle")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "condimentPack")
|
||||
var/obj/item/reagent_containers/food/condiment/pack/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] pack")
|
||||
P.desc = "A small condiment pack. The label says it contains [name]."
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "condimentBottle")
|
||||
var/obj/item/reagent_containers/food/condiment/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] bottle")
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "hypoVial")
|
||||
var/obj/item/reagent_containers/glass/bottle/vial/small/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
|
||||
P.name = trim("[name] hypovial")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each)
|
||||
return TRUE
|
||||
if(item_type == "smartDart")
|
||||
var/obj/item/reagent_containers/syringe/dart/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new /obj/item/reagent_containers/syringe/dart(drop_location())
|
||||
P.name = trim("[name] SmartDart")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each)
|
||||
P.mode=!mode
|
||||
P.update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
if(action == "goScreen")
|
||||
screen = params["screen"]
|
||||
return TRUE
|
||||
|
||||
if("analyze")
|
||||
var/reagent = GLOB.name2reagent[params["id"]]
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[reagent]
|
||||
if(R)
|
||||
var/state = "Unknown"
|
||||
if(initial(R.reagent_state) == 1)
|
||||
state = "Solid"
|
||||
else if(initial(R.reagent_state) == 2)
|
||||
state = "Liquid"
|
||||
else if(initial(R.reagent_state) == 3)
|
||||
state = "Gas"
|
||||
var/const/P = 3 //The number of seconds between life ticks
|
||||
var/T = initial(R.metabolization_rate) * (60 / P)
|
||||
if(istype(R, /datum/reagent/fermi))
|
||||
fermianalyze = TRUE
|
||||
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
|
||||
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
|
||||
else
|
||||
fermianalyze = FALSE
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
|
||||
screen = "analyze"
|
||||
return TRUE
|
||||
|
||||
if("goScreen")
|
||||
screen = params["screen"]
|
||||
. = TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
"tricord" = /datum/reagent/medicine/tricordrazine
|
||||
)
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ChemDebugSynthesizer", name, 390, 330, master_ui, state)
|
||||
ui = new(user, src, "ChemDebugSynthesizer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chem_dispenser/chem_synthesizer/ui_act(action, params)
|
||||
@@ -31,7 +30,11 @@
|
||||
beaker = null
|
||||
. = TRUE
|
||||
if("input")
|
||||
var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text), " ", "") //95% of the time, the reagent types is a lowercase, no spaces / underscored version of the name
|
||||
var/input_reagent = replacetext(lowertext(input("Enter the name of any reagent", "Input") as text|null), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
|
||||
|
||||
if (isnull(input_reagent))
|
||||
return
|
||||
|
||||
if(shortcuts[input_reagent])
|
||||
input_reagent = shortcuts[input_reagent]
|
||||
else
|
||||
@@ -51,7 +54,7 @@
|
||||
beaker = new /obj/item/reagent_containers/glass/beaker/bluespace(src)
|
||||
visible_message("<span class='notice'>[src] dispenses a bluespace beaker.</span>")
|
||||
if("amount")
|
||||
var/input = input("Units to dispense", "Units") as num|null
|
||||
var/input = text2num(params["amount"])
|
||||
if(input)
|
||||
amount = input
|
||||
update_icon()
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
density = TRUE
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "mixer0"
|
||||
circuit = /obj/item/circuitboard/computer/pandemic
|
||||
use_power = TRUE
|
||||
idle_power_usage = 20
|
||||
resistance_flags = ACID_PROOF
|
||||
circuit = /obj/item/circuitboard/computer/pandemic
|
||||
|
||||
var/wait
|
||||
var/datum/symptom/selected_symptom
|
||||
var/obj/item/reagent_containers/beaker
|
||||
@@ -23,11 +24,27 @@
|
||||
QDEL_NULL(beaker)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/pandemic/handle_atom_del(atom/A)
|
||||
/obj/machinery/computer/pandemic/examine(mob/user)
|
||||
. = ..()
|
||||
if(beaker)
|
||||
var/is_close
|
||||
if(Adjacent(user)) //don't reveal exactly what's inside unless they're close enough to see the UI anyway.
|
||||
. += "It contains \a [beaker]."
|
||||
is_close = TRUE
|
||||
else
|
||||
. += "It has a beaker inside it."
|
||||
. += "<span class='info'>Alt-click to eject [is_close ? beaker : "the beaker"].</span>"
|
||||
|
||||
/obj/machinery/computer/pandemic/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
eject_beaker()
|
||||
|
||||
/obj/machinery/computer/pandemic/handle_atom_del(atom/A)
|
||||
if(A == beaker)
|
||||
beaker = null
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/pandemic/proc/get_by_index(thing, index)
|
||||
if(!beaker || !beaker.reagents)
|
||||
@@ -107,7 +124,7 @@
|
||||
/obj/machinery/computer/pandemic/proc/reset_replicator_cooldown()
|
||||
wait = FALSE
|
||||
update_icon()
|
||||
playsound(loc, 'sound/machines/ping.ogg', 30, 1)
|
||||
playsound(src, 'sound/machines/ping.ogg', 30, TRUE)
|
||||
|
||||
/obj/machinery/computer/pandemic/update_icon_state()
|
||||
if(stat & BROKEN)
|
||||
@@ -117,13 +134,19 @@
|
||||
|
||||
/obj/machinery/computer/pandemic/update_overlays()
|
||||
. = ..()
|
||||
if(!(stat & BROKEN) && wait)
|
||||
if(wait)
|
||||
. += "waitlight"
|
||||
|
||||
/obj/machinery/computer/pandemic/ui_interact(mob/user, ui_key = "main", datum/tgui/ui, force_open = FALSE, datum/tgui/master_ui, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/pandemic/proc/eject_beaker()
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/pandemic/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Pandemic", name, 520, 550, master_ui, state)
|
||||
ui = new(user, src, "Pandemic", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/pandemic/ui_data(mob/user)
|
||||
@@ -135,9 +158,9 @@
|
||||
var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list
|
||||
if(B)
|
||||
data["has_blood"] = TRUE
|
||||
data[/datum/reagent/blood] = list()
|
||||
data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none"
|
||||
data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none"
|
||||
data["blood"] = list() //wha why the fuck are we sending pathtypes to tgui frontend?
|
||||
data["blood"]["dna"] = B.data["blood_DNA"] || "none"
|
||||
data["blood"]["type"] = B.data["blood_type"] || "none"
|
||||
data["viruses"] = get_viruses_data(B)
|
||||
data["resistances"] = get_resistance_data(B)
|
||||
else
|
||||
@@ -153,7 +176,7 @@
|
||||
return
|
||||
switch(action)
|
||||
if("eject_beaker")
|
||||
replace_beaker(usr)
|
||||
eject_beaker()
|
||||
. = TRUE
|
||||
if("empty_beaker")
|
||||
if(beaker)
|
||||
@@ -162,7 +185,7 @@
|
||||
if("empty_eject_beaker")
|
||||
if(beaker)
|
||||
beaker.reagents.clear_reagents()
|
||||
replace_beaker(usr)
|
||||
eject_beaker()
|
||||
. = TRUE
|
||||
if("rename_disease")
|
||||
var/id = get_virus_id_by_index(text2num(params["index"]))
|
||||
@@ -170,75 +193,62 @@
|
||||
if(!A.mutable)
|
||||
return
|
||||
if(A)
|
||||
var/new_name = sanitize_name(html_encode(trim(params["name"], 50)))
|
||||
var/new_name = sanitize_name(html_encode(params["name"]), allow_numbers = TRUE)
|
||||
if(!new_name || ..())
|
||||
return
|
||||
A.AssignName(new_name)
|
||||
. = TRUE
|
||||
if("create_culture_bottle")
|
||||
if (wait)
|
||||
return
|
||||
var/id = get_virus_id_by_index(text2num(params["index"]))
|
||||
var/datum/disease/advance/A = SSdisease.archive_diseases[id]
|
||||
if(!istype(A) || !A.mutable)
|
||||
to_chat(usr, "<span class='warning'>ERROR: Cannot replicate virus strain.</span>")
|
||||
return
|
||||
wait = TRUE
|
||||
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 50)
|
||||
A = A.Copy()
|
||||
var/list/data = list("blood_DNA" = "UNKNOWN DNA", "blood_type" = "SY", "viruses" = list(A))
|
||||
var/list/data = list("viruses" = list(A))
|
||||
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
|
||||
B.name = "[A.name] culture bottle"
|
||||
B.desc = "A small bottle. Contains [A.agent] culture in synthblood medium."
|
||||
B.reagents.add_reagent(/datum/reagent/blood/synthetics, 10, data)
|
||||
wait = TRUE
|
||||
update_icon()
|
||||
var/turf/source_turf = get_turf(src)
|
||||
log_virus("A culture bottle was printed for the virus [A.admin_details()] at [loc_name(source_turf)] by [key_name(usr)]")
|
||||
|
||||
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 50)
|
||||
. = TRUE
|
||||
if("create_vaccine_bottle")
|
||||
wait = TRUE
|
||||
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 400)
|
||||
if (wait)
|
||||
return
|
||||
var/id = params["index"]
|
||||
var/datum/disease/D = SSdisease.archive_diseases[id]
|
||||
var/obj/item/reagent_containers/glass/bottle/B = new(drop_location())
|
||||
B.name = "[D.name] vaccine bottle"
|
||||
B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id))
|
||||
|
||||
wait = TRUE
|
||||
update_icon()
|
||||
|
||||
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 200)
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
. = TRUE //no afterattack
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
var/obj/item/reagent_containers/B = I
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
if(beaker)
|
||||
to_chat(user, "<span class='warning'>A container is already loaded into [src]!</span>")
|
||||
return
|
||||
replace_beaker(user, B)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
|
||||
beaker = I
|
||||
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/pandemic/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/pandemic/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
|
||||
if(beaker)
|
||||
if(user && Adjacent(user) && user.can_hold_items())
|
||||
if(!user.put_in_hands(beaker))
|
||||
beaker.forceMove(drop_location())
|
||||
if(new_beaker)
|
||||
beaker = new_beaker
|
||||
else
|
||||
beaker = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/pandemic/on_deconstruction()
|
||||
replace_beaker(usr)
|
||||
eject_beaker()
|
||||
. = ..()
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
icon_state = "smoke0"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/smoke_machine
|
||||
|
||||
var/efficiency = 10
|
||||
var/on = FALSE
|
||||
var/cooldown = 0
|
||||
@@ -31,6 +32,7 @@
|
||||
/obj/machinery/smoke_machine/Initialize()
|
||||
. = ..()
|
||||
create_reagents(REAGENTS_BASE_VOLUME)
|
||||
// AddComponent(/datum/component/plumbing/simple_demand)
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
|
||||
|
||||
@@ -81,10 +83,9 @@
|
||||
add_fingerprint(user)
|
||||
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
|
||||
var/obj/item/reagent_containers/RC = I
|
||||
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
|
||||
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user)
|
||||
if(units)
|
||||
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to [src].</span>")
|
||||
log_combat(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]")
|
||||
return
|
||||
if(default_unfasten_wrench(user, I, 40))
|
||||
on = FALSE
|
||||
@@ -100,11 +101,10 @@
|
||||
reagents.clear_reagents()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/smoke_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/smoke_machine/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "SmokeMachine", name, 350, 350, master_ui, state)
|
||||
ui = new(user, src, "SmokeMachine", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/smoke_machine/ui_data(mob/user)
|
||||
|
||||
@@ -299,13 +299,15 @@
|
||||
|
||||
// handle machine interaction
|
||||
|
||||
/obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
/obj/machinery/disposal/bin/ui_state(mob/user)
|
||||
return GLOB.notcontained_state
|
||||
|
||||
/obj/machinery/disposal/bin/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "DisposalUnit", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "DisposalUnit", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/disposal/bin/ui_data(mob/user)
|
||||
|
||||
@@ -33,11 +33,13 @@
|
||||
var/inaccuracy_percentage = 1.5
|
||||
var/positive_cash_offset = 0
|
||||
var/negative_cash_offset = 0
|
||||
var/minor_rewards = list(/obj/item/stack/circuit_stack/full, //To add a new minor reward, add it here.
|
||||
/obj/item/flashlight/flashdark,
|
||||
/obj/item/pen/survival,
|
||||
/obj/item/circuitboard/machine/sleeper/party,
|
||||
/obj/item/toy/sprayoncan)
|
||||
var/list/minor_rewards = list(
|
||||
//To add a new minor reward, add it here.
|
||||
/obj/item/stack/circuit_stack/full,
|
||||
/obj/item/pen/survival,
|
||||
/obj/item/circuitboard/machine/sleeper/party,
|
||||
/obj/item/toy/sprayoncan,
|
||||
)
|
||||
var/static/list/item_list = list()
|
||||
|
||||
/obj/machinery/rnd/bepis/attackby(obj/item/O, mob/user, params)
|
||||
@@ -101,6 +103,7 @@
|
||||
return
|
||||
account.adjust_money(-deposit_value) //The money vanishes, not paid to any accounts.
|
||||
SSblackbox.record_feedback("amount", "BEPIS_credits_spent", deposit_value)
|
||||
log_econ("[deposit_value] credits were inserted into [src] by [account.account_holder]")
|
||||
banked_cash += deposit_value
|
||||
use_power(1000 * power_saver)
|
||||
say("Cash deposit successful. There is [banked_cash] in the chamber.")
|
||||
@@ -179,10 +182,10 @@
|
||||
icon_state = "chamber"
|
||||
return
|
||||
|
||||
/obj/machinery/rnd/bepis/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/rnd/bepis/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Bepis", name, 500, 480, master_ui, state)
|
||||
ui = new(user, src, "Bepis", name)
|
||||
ui.open()
|
||||
RefreshParts()
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
var/obj/item/disk/nanite_program/disk
|
||||
icon_screen = "nanite_chamber_control"
|
||||
circuit = /obj/item/circuitboard/computer/nanite_chamber_control
|
||||
ui_x = 380
|
||||
ui_y = 570
|
||||
|
||||
/obj/machinery/computer/nanite_chamber_control/Initialize()
|
||||
. = ..()
|
||||
@@ -25,10 +23,10 @@
|
||||
find_chamber()
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/nanite_chamber_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/nanite_chamber_control/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NaniteChamberControl", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "NaniteChamberControl", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/nanite_chamber_control/ui_data()
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
/obj/machinery/computer/nanite_cloud_controller
|
||||
name = "nanite cloud controller"
|
||||
desc = "Stores and controls nanite cloud backups."
|
||||
circuit = /obj/item/circuitboard/computer/nanite_cloud_controller
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
icon_state = "nanite_cloud_controller"
|
||||
ui_x = 375
|
||||
ui_y = 700
|
||||
circuit = /obj/item/circuitboard/computer/nanite_cloud_controller
|
||||
|
||||
var/obj/item/disk/nanite_program/disk
|
||||
var/list/datum/nanite_cloud_backup/cloud_backups = list()
|
||||
@@ -20,15 +18,21 @@
|
||||
/obj/machinery/computer/nanite_cloud_controller/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/disk/nanite_program))
|
||||
var/obj/item/disk/nanite_program/N = I
|
||||
if(disk)
|
||||
eject(user)
|
||||
if(user.transferItemToLoc(N, src))
|
||||
if (user.transferItemToLoc(N, src))
|
||||
to_chat(user, "<span class='notice'>You insert [N] into [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(disk)
|
||||
eject(user)
|
||||
disk = N
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/nanite_cloud_controller/AltClick(mob/user)
|
||||
if(disk && user.canUseTopic(src, !issilicon(user)))
|
||||
to_chat(user, "<span class='notice'>You take out [disk] from [src].</span>")
|
||||
eject(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/nanite_cloud_controller/proc/eject(mob/living/user)
|
||||
if(!disk)
|
||||
return
|
||||
@@ -53,10 +57,10 @@
|
||||
backup.nanites = cloud_copy
|
||||
investigate_log("[key_name(user)] created a new nanite cloud backup with id #[cloud_id]", INVESTIGATE_NANITES)
|
||||
|
||||
/obj/machinery/computer/nanite_cloud_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/nanite_cloud_controller/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NaniteCloudControl", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "NaniteCloudControl", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/nanite_cloud_controller/ui_data()
|
||||
|
||||
@@ -3,26 +3,24 @@
|
||||
desc = "Compiles nanite programs from the techweb servers and downloads them into disks."
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
icon_state = "nanite_program_hub"
|
||||
circuit = /obj/item/circuitboard/machine/nanite_program_hub
|
||||
use_power = IDLE_POWER_USE
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
ui_x = 500
|
||||
ui_y = 700
|
||||
circuit = /obj/item/circuitboard/machine/nanite_program_hub
|
||||
|
||||
var/obj/item/disk/nanite_program/disk
|
||||
var/datum/techweb/linked_techweb
|
||||
var/current_category = "Main"
|
||||
var/detail_view = TRUE
|
||||
var/categories = list(
|
||||
list(name = "Utility Nanites"),
|
||||
list(name = "Medical Nanites"),
|
||||
list(name = "Sensor Nanites"),
|
||||
list(name = "Augmentation Nanites"),
|
||||
list(name = "Suppression Nanites"),
|
||||
list(name = "Weaponized Nanites"),
|
||||
list(name = "Protocols") //Moved to default techweb from B.E.P.I.S. research, for now
|
||||
)
|
||||
list(name = "Utility Nanites"),
|
||||
list(name = "Medical Nanites"),
|
||||
list(name = "Sensor Nanites"),
|
||||
list(name = "Augmentation Nanites"),
|
||||
list(name = "Suppression Nanites"),
|
||||
list(name = "Weaponized Nanites"),
|
||||
list(name = "Protocols"),
|
||||
)
|
||||
|
||||
/obj/machinery/nanite_program_hub/Initialize()
|
||||
. = ..()
|
||||
@@ -31,15 +29,27 @@
|
||||
/obj/machinery/nanite_program_hub/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/disk/nanite_program))
|
||||
var/obj/item/disk/nanite_program/N = I
|
||||
if(disk)
|
||||
eject(user)
|
||||
if(user.transferItemToLoc(N, src))
|
||||
to_chat(user, "<span class='notice'>You insert [N] into [src].</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(disk)
|
||||
eject(user)
|
||||
disk = N
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/nanite_program_hub/screwdriver_act(mob/living/user, obj/item/I) //remove when runtimed
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
return default_deconstruction_screwdriver(user, "nanite_program_hub_t", "nanite_program_hub", I)
|
||||
|
||||
/obj/machinery/nanite_program_hub/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
return default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/nanite_program_hub/proc/eject(mob/living/user)
|
||||
if(!disk)
|
||||
return
|
||||
@@ -47,10 +57,16 @@
|
||||
disk.forceMove(drop_location())
|
||||
disk = null
|
||||
|
||||
/obj/machinery/nanite_program_hub/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/nanite_program_hub/AltClick(mob/user)
|
||||
if(disk && user.canUseTopic(src, !issilicon(user)))
|
||||
to_chat(user, "<span class='notice'>You take out [disk] from [src].</span>")
|
||||
eject(user)
|
||||
return
|
||||
|
||||
/obj/machinery/nanite_program_hub/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NaniteProgramHub", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "NaniteProgramHub", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/nanite_program_hub/ui_data()
|
||||
@@ -123,9 +139,3 @@
|
||||
disk.program = null
|
||||
disk.name = initial(disk.name)
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/machinery/nanite_program_hub/admin/Initialize()
|
||||
. = ..()
|
||||
linked_techweb = SSresearch.admin_tech
|
||||
|
||||
|
||||
@@ -3,29 +3,39 @@
|
||||
desc = "A device that can edit nanite program disks to adjust their functionality."
|
||||
var/obj/item/disk/nanite_program/disk
|
||||
var/datum/nanite_program/program
|
||||
circuit = /obj/item/circuitboard/machine/nanite_programmer
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
icon_state = "nanite_programmer"
|
||||
use_power = IDLE_POWER_USE
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
flags_1 = HEAR_1
|
||||
ui_x = 420
|
||||
ui_y = 550
|
||||
circuit = /obj/item/circuitboard/machine/nanite_programmer
|
||||
|
||||
/obj/machinery/nanite_programmer/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/disk/nanite_program))
|
||||
var/obj/item/disk/nanite_program/N = I
|
||||
if(disk)
|
||||
eject(user)
|
||||
if(user.transferItemToLoc(N, src))
|
||||
to_chat(user, "<span class='notice'>You insert [N] into [src]</span>")
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
if(disk)
|
||||
eject(user)
|
||||
disk = N
|
||||
program = N.program
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/nanite_programmer/screwdriver_act(mob/living/user, obj/item/I) //ditto
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
return default_deconstruction_screwdriver(user, "nanite_programmer_t", "nanite_programmer", I)
|
||||
|
||||
/obj/machinery/nanite_programmer/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
return default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/nanite_programmer/proc/eject(mob/living/user)
|
||||
if(!disk)
|
||||
return
|
||||
@@ -34,10 +44,16 @@
|
||||
disk = null
|
||||
program = null
|
||||
|
||||
/obj/machinery/nanite_programmer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/nanite_programmer/AltClick(mob/user)
|
||||
if(disk && user.canUseTopic(src, !issilicon(user)))
|
||||
to_chat(user, "<span class='notice'>You take out [disk] from [src].</span>")
|
||||
eject(user)
|
||||
return
|
||||
|
||||
/obj/machinery/nanite_programmer/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NaniteProgrammer", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "NaniteProgrammer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/nanite_programmer/ui_data()
|
||||
@@ -131,7 +147,7 @@
|
||||
program.timer_trigger_delay = timer
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/nanite_programmer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
/obj/machinery/nanite_programmer/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods = list())
|
||||
. = ..()
|
||||
var/static/regex/when = regex("(?:^\\W*when|when\\W*$)", "i") //starts or ends with when
|
||||
if(findtext(raw_message, when) && !istype(speaker, /obj/machinery/nanite_programmer))
|
||||
|
||||
@@ -80,10 +80,13 @@
|
||||
var/datum/nanite_program/relay/N = X
|
||||
N.relay_signal(code, relay_code, source)
|
||||
|
||||
/obj/item/nanite_remote/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/nanite_remote/ui_state(mob/user)
|
||||
return GLOB.hands_state
|
||||
|
||||
/obj/item/nanite_remote/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "NaniteRemote", name, 420, 500, master_ui, state)
|
||||
ui = new(user, src, "NaniteRemote", name)
|
||||
ui.open()
|
||||
|
||||
/obj/item/nanite_remote/ui_data()
|
||||
@@ -94,7 +97,6 @@
|
||||
data["locked"] = locked
|
||||
data["saved_settings"] = saved_settings
|
||||
data["program_name"] = current_program_name
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/nanite_remote/ui_act(action, params)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
desc = "Looks like someone started shakily writing a will in space common, but were interrupted by something bloody..."
|
||||
info = "__Objectives #1__: Find out what is hidden in Kosmicheskaya Stantsiya 13s Vault"
|
||||
|
||||
|
||||
/// Vault controller for use on the derelict/KS13.
|
||||
/obj/machinery/computer/vaultcontroller
|
||||
name = "vault controller"
|
||||
@@ -35,15 +34,10 @@
|
||||
var/siphoned_power = 0
|
||||
var/siphon_max = 1e7
|
||||
|
||||
ui_x = 300
|
||||
ui_y = 120
|
||||
|
||||
|
||||
/obj/machinery/computer/monitor/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It appears to be powered via a cable connector.</span>"
|
||||
|
||||
|
||||
//Checks for cable connection, charges if possible.
|
||||
/obj/machinery/computer/vaultcontroller/process()
|
||||
if(siphoned_power >= siphon_max)
|
||||
@@ -52,13 +46,11 @@
|
||||
if(attached_cable)
|
||||
attempt_siphon()
|
||||
|
||||
|
||||
///Looks for a cable connection beneath the machine.
|
||||
/obj/machinery/computer/vaultcontroller/proc/update_cable()
|
||||
var/turf/T = get_turf(src)
|
||||
attached_cable = locate(/obj/structure/cable) in T
|
||||
|
||||
|
||||
///Initializes airlock links.
|
||||
/obj/machinery/computer/vaultcontroller/proc/find_airlocks()
|
||||
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
|
||||
@@ -70,7 +62,6 @@
|
||||
door2 = A
|
||||
break
|
||||
|
||||
|
||||
///Tries to charge from powernet excess, no upper limit except max charge.
|
||||
/obj/machinery/computer/vaultcontroller/proc/attempt_siphon()
|
||||
var/surpluspower = clamp(attached_cable.surplus(), 0, (siphon_max - siphoned_power))
|
||||
@@ -78,7 +69,6 @@
|
||||
attached_cable.add_load(surpluspower)
|
||||
siphoned_power += surpluspower
|
||||
|
||||
|
||||
///Handles the doors closing
|
||||
/obj/machinery/computer/vaultcontroller/proc/cycle_close(obj/machinery/door/airlock/A)
|
||||
A.safe = FALSE //Make sure its forced closed, always
|
||||
@@ -86,14 +76,12 @@
|
||||
A.close()
|
||||
A.bolt()
|
||||
|
||||
|
||||
///Handles the doors opening
|
||||
/obj/machinery/computer/vaultcontroller/proc/cycle_open(obj/machinery/door/airlock/A)
|
||||
A.unbolt()
|
||||
A.open()
|
||||
A.bolt()
|
||||
|
||||
|
||||
///Attempts to lock the vault doors
|
||||
/obj/machinery/computer/vaultcontroller/proc/lock_vault()
|
||||
if(door1 && !door1.density)
|
||||
@@ -103,7 +91,6 @@
|
||||
if(door1.density && door1.locked && door2.density && door2.locked)
|
||||
locked = TRUE
|
||||
|
||||
|
||||
///Attempts to unlock the vault doors
|
||||
/obj/machinery/computer/vaultcontroller/proc/unlock_vault()
|
||||
if(door1 && door1.density)
|
||||
@@ -113,7 +100,6 @@
|
||||
if(!door1.density && door1.locked && !door2.density && door2.locked)
|
||||
locked = FALSE
|
||||
|
||||
|
||||
///Attempts to lock/unlock vault doors, if machine is charged.
|
||||
/obj/machinery/computer/vaultcontroller/proc/activate_lock()
|
||||
if(siphoned_power < siphon_max)
|
||||
@@ -125,15 +111,12 @@
|
||||
else
|
||||
lock_vault()
|
||||
|
||||
|
||||
/obj/machinery/computer/vaultcontroller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/machinery/computer/vaultcontroller/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "VaultController", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, "VaultController", name)
|
||||
ui.open()
|
||||
|
||||
|
||||
/obj/machinery/computer/vaultcontroller/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
@@ -141,7 +124,6 @@
|
||||
if("togglelock")
|
||||
activate_lock()
|
||||
|
||||
|
||||
/obj/machinery/computer/vaultcontroller/ui_data()
|
||||
var/list/data = list()
|
||||
data["stored"] = siphoned_power
|
||||
@@ -149,7 +131,6 @@
|
||||
data["doorstatus"] = locked
|
||||
return data
|
||||
|
||||
|
||||
///Airlock that can't be deconstructed, broken or hacked.
|
||||
/obj/machinery/door/airlock/vault/derelict
|
||||
locked = TRUE
|
||||
@@ -158,16 +139,13 @@
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
id_tag = "derelictvault"
|
||||
|
||||
|
||||
///Overrides screwdriver attack to prevent all deconstruction and hacking.
|
||||
/obj/machinery/door/airlock/vault/derelict/attackby(obj/item/C, mob/user, params)
|
||||
if(C.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
// So drones can teach borgs and AI dronespeak. For best effect, combine with mother drone lawset.
|
||||
|
||||
/obj/item/dronespeak_manual
|
||||
name = "dronespeak manual"
|
||||
desc = "The book's cover reads: \"Understanding Dronespeak - An exercise in futility.\""
|
||||
@@ -181,7 +159,7 @@
|
||||
to_chat(user, "<span class='boldannounce'>You start skimming through [src], but you already know dronespeak.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='boldannounce'>You start skimming through [src], and suddenly the drone chittering makes sense.</span>")
|
||||
user.grant_language(/datum/language/drone, TRUE, TRUE)
|
||||
user.grant_language(/datum/language/drone, TRUE, TRUE)//, LANGUAGE_MIND)
|
||||
return
|
||||
|
||||
if(user.has_language(/datum/language/drone))
|
||||
@@ -202,7 +180,7 @@
|
||||
M.visible_message("<span class='danger'>[user] beats [M] over the head with [src]!</span>", "<span class='userdanger'>[user] beats you over the head with [src]!</span>", "<span class='hear'>You hear smacking.</span>")
|
||||
else
|
||||
M.visible_message("<span class='notice'>[user] teaches [M] by beating [M.p_them()] over the head with [src]!</span>", "<span class='boldnotice'>As [user] hits you with [src], chitters resonate in your mind.</span>", "<span class='hear'>You hear smacking.</span>")
|
||||
M.grant_language(/datum/language/drone, TRUE, TRUE)
|
||||
M.grant_language(/datum/language/drone, TRUE, TRUE) //, LANGUAGE_MIND)
|
||||
return
|
||||
|
||||
/obj/structure/fluff/oldturret
|
||||
|
||||
Reference in New Issue
Block a user