Adds the Chemistry Smoke Machine (#30920)

* Smoke Machine

* Tweak

* More responsive smoke timing

* Antur Review and Admin Logs

* Cboss review

* More logging

* Removes analyze, streamlines logs

* r-e-a

* no s in reagents_list

* Cyberboss Review

* woops

* Cboss nitpicking
This commit is contained in:
Robustin
2017-10-10 14:12:40 -04:00
committed by CitadelStationBot
parent f8d0646b09
commit a570ec8610
12 changed files with 191 additions and 15 deletions
@@ -27778,6 +27778,7 @@
/obj/structure/table,
/obj/item/folder/white,
/obj/item/device/radio/headset/headset_med,
/obj/item/circuitboard/machine/smoke_machine,
/turf/open/floor/plasteel/white,
/area/medical/chemistry)
"boe" = (
@@ -77224,6 +77224,7 @@
/obj/structure/table/glass,
/obj/item/clipboard,
/obj/item/toy/figure/chemist,
/obj/item/circuitboard/machine/smoke_machine,
/turf/open/floor/plasteel/whiteyellow/corner{
dir = 1
},
@@ -59764,6 +59764,7 @@
dir = 1;
pixel_y = -24
},
/obj/item/circuitboard/machine/smoke_machine,
/turf/open/floor/plasteel/whiteyellow{
dir = 4
},
@@ -32792,6 +32792,7 @@
/obj/item/hand_labeler,
/obj/item/device/radio/headset/headset_med,
/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/obj/item/circuitboard/machine/smoke_machine,
/turf/open/floor/plasteel/white,
/area/medical/chemistry)
"bwW" = (
@@ -598,6 +598,17 @@
/obj/item/stock_parts/cell = 1)
def_components = list(/obj/item/stock_parts/cell = /obj/item/stock_parts/cell/high)
/obj/item/circuitboard/machine/smoke_machine
name = "Smoke Machine (Machine Board)"
build_path = /obj/machinery/smoke_machine
origin_tech = "materials=4;engineering=3;biotech=3"
req_components = list(
/obj/item/stock_parts/matter_bin = 2,
/obj/item/stock_parts/capacitor = 1,
/obj/item/stock_parts/manipulator = 1,
/obj/item/stock_parts/console_screen = 1,
/obj/item/stock_parts/cell = 1)
/obj/item/circuitboard/machine/chem_heater
name = "Chemical Heater (Machine Board)"
build_path = /obj/machinery/chem_heater
@@ -393,4 +393,4 @@
"cryoxadone",
"ammonia",
"ash",
"diethylamine")
"diethylamine")
@@ -0,0 +1,113 @@
/obj/machinery/smoke_machine
name = "Smoke Machine"
icon = 'icons/obj/chemical.dmi'
icon_state = "smoke0"
density = TRUE
anchored = TRUE
circuit = /obj/item/circuitboard/machine/smoke_machine
var/efficiency = 10
var/on = FALSE
var/cooldown = 0
var/screen = "home"
var/useramount = 30 // Last used amount
var/volume = 1000
var/setting = 3
var/list/possible_settings = list(3,6,9,12,15)
/datum/effect_system/smoke_spread/chem/smoke_machine/set_up(datum/reagents/carry, setting = 3, efficiency = 10, loc)
amount = setting
carry.copy_to(chemholder, 20)
carry.remove_any(setting * 16 / efficiency)
location = loc
/obj/machinery/smoke_machine/Initialize()
. = ..()
create_reagents(volume)
/obj/machinery/smoke_machine/update_icon()
if((!is_operational()) || (!on) || (reagents.total_volume == 0))
icon_state = "smoke0"
else
icon_state = "smoke1"
. = ..()
/obj/machinery/smoke_machine/RefreshParts()
efficiency = 6
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
efficiency += B.rating
for(var/obj/item/stock_parts/capacitor/C in component_parts)
efficiency += C.rating
for(var/obj/item/stock_parts/manipulator/M in component_parts)
efficiency += M.rating
/obj/machinery/smoke_machine/process()
..()
update_icon()
if(!is_operational())
return
if(reagents.total_volume == 0)
on = FALSE
return
var/turf/T = get_turf(src)
var/smoke_test = locate(/obj/effect/particle_effect/smoke) in T
if(on && !smoke_test)
var/datum/effect_system/smoke_spread/chem/smoke_machine/smoke = new()
smoke.set_up(reagents, setting, efficiency, T)
smoke.start()
/obj/machinery/smoke_machine/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(istype(I, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RC = I
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
if(units)
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to [src].</span>")
add_logs(usr, src, "has added [english_list(RC.reagents.reagent_list)] to [src]")
return
if(default_unfasten_wrench(user, I))
return
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)
if(!ui)
ui = new(user, src, ui_key, "smoke_machine", name, 450, 350, master_ui, state)
ui.open()
/obj/machinery/smoke_machine/ui_data(mob/user)
var/data = list()
var/TankContents[0]
var/TankCurrentVolume = 0
for(var/datum/reagent/R in reagents.reagent_list)
TankContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list...
TankCurrentVolume += R.volume
data["TankContents"] = TankContents
data["isTankLoaded"] = reagents.total_volume ? TRUE : FALSE
data["TankCurrentVolume"] = reagents.total_volume ? reagents.total_volume : null
data["TankMaxVolume"] = reagents.maximum_volume
data["active"] = on
data["setting"] = setting
data["screen"] = screen
return data
/obj/machinery/smoke_machine/ui_act(action, params)
if(..() || !anchored)
return
switch(action)
if("purge")
reagents.clear_reagents()
. = TRUE
if("setting")
var/amount = text2num(params["amount"])
if (locate(amount) in possible_settings)
setting = amount
. = TRUE
if("power")
on = !on
if(on)
log_admin("[key_name(usr)] activated a smoke machine that contains [english_list(reagents.reagent_list)] at [COORD(src)].")
add_logs(usr, src, "has activated [src] which contains [english_list(reagents.reagent_list)].")
if("goScreen")
screen = params["screen"]
. = TRUE
@@ -154,6 +154,14 @@
build_path = /obj/item/circuitboard/machine/chem_heater
category = list ("Medical Machinery")
/datum/design/board/smoke_machine
name = "Machine Design (Smoke Machine)"
desc = "The circuit board for a smoke machine."
id = "smoke_machine"
req_tech = list("materials" = 4, "biotech" = 3, "engineering" = 3)
build_path = /obj/item/circuitboard/machine/smoke_machine
category = list ("Medical Machinery")
/datum/design/board/clonecontrol
name = "Computer Design (Cloning Machine Console)"
desc = "Allows for the construction of circuit boards used to build a new Cloning Machine console."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 36 KiB

+1
View File
@@ -2075,6 +2075,7 @@
#include "code\modules\reagents\chemistry\machinery\chem_master.dm"
#include "code\modules\reagents\chemistry\machinery\pandemic.dm"
#include "code\modules\reagents\chemistry\machinery\reagentgrinder.dm"
#include "code\modules\reagents\chemistry\machinery\smoke_machine.dm"
#include "code\modules\reagents\chemistry\reagents\alcohol_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\blob_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\drink_reagents.dm"
+15 -14
View File
File diff suppressed because one or more lines are too long
+38
View File
@@ -0,0 +1,38 @@
{{#if data.screen == "home"}}
<ui-display title='Dispersal Tank'>
<ui-section label='Power'>
<ui-button icon='{{data.active ? "power-off" : "close"}}'
style='{{data.active ? "selected" : null}}'
state='{{data.isTankLoaded ? null : "disabled"}}'
action='power'>{{data.active ? "On" : "Off"}}
</ui-button>
</ui-section>
<ui-section label='Smoke Radius Setting'>
<div class='content' style='float:left'>
<ui-button icon='plus' state='{{data.setting == 3 ? "selected" : null}}' action='setting' params='{"amount": 3}'>3</ui-button>
<ui-button icon='plus' state='{{data.setting == 6 ? "selected" : null}}' action='setting' params='{"amount": 6}'>6</ui-button>
<ui-button icon='plus' state='{{data.setting == 9 ? "selected" : null}}' action='setting' params='{"amount": 9}'>9</ui-button>
<ui-button icon='plus' state='{{data.setting == 12 ? "selected" : null}}' action='setting' params='{"amount": 12}'>12</ui-button>
<ui-button icon='plus' state='{{data.setting == 15 ? "selected" : null}}' action='setting' params='{"amount": 15}'>15</ui-button>
</div>
</ui-section>
<ui-section label='Contents'>
{{#if data.isTankLoaded}}
<span>{{Math.round(adata.TankCurrentVolume)}}/{{data.TankMaxVolume}} Units</span>
<br/>
<br/>
{{#each adata.TankContents}}
<span class='highlight' intro-outro='fade'>{{Math.fixed(volume, 2)}} units of {{name}}</span><br/>
{{/each}}
{{else}}
<span class='bad'>Tank Empty</span>
{{/if}}
<ui-button icon='{{data.isTankLoaded ? "Eject" : "Close"}}'
style='{{data.isTankLoaded ? "selected" : null}}'
state='{{data.isTankLoaded ? null : "disabled"}}'
action='purge'>{{data.isTankLoaded ? "Purge Contents" : "No chemicals detected"}}
</ui-button>
</ui-section>
</ui-display>
{{/if}}