mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Machines now store their components in their contents. (#966)
* Machines now store their components in their contents. (#52970) Machine parts are now located in the machine instead of nullspace. * Machines now store their components in their contents. Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
/obj/machinery/sleeper/Initialize(mapload)
|
||||
. = ..()
|
||||
if(mapload)
|
||||
component_parts -= circuit
|
||||
LAZYREMOVE(component_parts, circuit)
|
||||
QDEL_NULL(circuit)
|
||||
occupant_typecache = GLOB.typecache_living
|
||||
update_icon()
|
||||
@@ -267,12 +267,18 @@
|
||||
|
||||
/obj/machinery/sleeper/syndie/fullupgrade/Initialize()
|
||||
. = ..()
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stack/cable_coil(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 2)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/sleeper/old
|
||||
|
||||
@@ -135,7 +135,7 @@ Class Procs:
|
||||
GLOB.machines += src
|
||||
|
||||
if(ispath(circuit, /obj/item/circuitboard))
|
||||
circuit = new circuit
|
||||
circuit = new circuit(src)
|
||||
circuit.apply_default_parts(src)
|
||||
|
||||
if(processing_flags & START_PROCESSING_ON_INIT)
|
||||
@@ -164,7 +164,7 @@ Class Procs:
|
||||
/obj/machinery/Destroy()
|
||||
GLOB.machines.Remove(src)
|
||||
end_processing()
|
||||
dropContents()
|
||||
drop_contents()
|
||||
QDEL_LIST(component_parts)
|
||||
QDEL_NULL(circuit)
|
||||
return ..()
|
||||
@@ -203,24 +203,63 @@ Class Procs:
|
||||
use_power(7500/severity)
|
||||
new /obj/effect/temp_visual/emp(loc)
|
||||
|
||||
/**
|
||||
* Opens the machine.
|
||||
*
|
||||
* Will update the machine icon and any user interfaces currently open.
|
||||
* Arguments:
|
||||
* * drop - Boolean. Whether to drop any stored items in the machine. Does not include components.
|
||||
*/
|
||||
/obj/machinery/proc/open_machine(drop = TRUE)
|
||||
state_open = TRUE
|
||||
density = FALSE
|
||||
if(drop)
|
||||
dropContents()
|
||||
drop_stored_items()
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/proc/dropContents(list/subset = null)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/atom/movable/A in contents)
|
||||
if(subset && !(A in subset))
|
||||
continue
|
||||
A.forceMove(T)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
L.update_mobility()
|
||||
/**
|
||||
* Drop every movable atom in the machine's contents list.
|
||||
*/
|
||||
/obj/machinery/proc/drop_contents()
|
||||
// Start by calling the drop_stored_items proc. Will allow machines with special contents
|
||||
// to handle their dropping.
|
||||
drop_stored_items()
|
||||
|
||||
// Then we can clean up and drop everything else.
|
||||
var/turf/this_turf = get_turf(src)
|
||||
for(var/atom/movable/movable_atom in contents)
|
||||
movable_atom.forceMove(this_turf)
|
||||
|
||||
// We'll have dropped the occupant, circuit and component parts as part of this.
|
||||
occupant = null
|
||||
circuit = null
|
||||
LAZYCLEARLIST(component_parts)
|
||||
|
||||
/**
|
||||
* Drop every movable atom in the machine's contents list.
|
||||
*
|
||||
* Proc does not drop components and will skip over anything in the component_parts list.
|
||||
* Call drop_contents() to drop all contents including components.
|
||||
* Arguments:
|
||||
* * subset - If this is not null, only atoms that are also contained within the subset list will be dropped.
|
||||
*/
|
||||
/obj/machinery/proc/drop_stored_items(list/subset = null)
|
||||
var/turf/this_turf = get_turf(src)
|
||||
for(var/atom/movable/movable_atom in contents)
|
||||
if(subset && !(movable_atom in subset))
|
||||
continue
|
||||
|
||||
if(movable_atom in component_parts)
|
||||
continue
|
||||
|
||||
movable_atom.forceMove(this_turf)
|
||||
if(isliving(movable_atom))
|
||||
var/mob/living/living_mob = movable_atom
|
||||
living_mob.update_mobility()
|
||||
|
||||
if(occupant == movable_atom)
|
||||
occupant = null
|
||||
|
||||
/**
|
||||
* Puts passed object in to user's hand
|
||||
@@ -397,8 +436,6 @@ Class Procs:
|
||||
var/damage = damage_deflection / 10
|
||||
arm.receive_damage(brute=damage, wound_bonus = CANT_WOUND)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/attack_robot(mob/user)
|
||||
if(!(interaction_flags_machine & INTERACT_MACHINE_ALLOW_SILICON) && !isAdminGhostAI(user))
|
||||
return FALSE
|
||||
@@ -448,12 +485,11 @@ Class Procs:
|
||||
/obj/machinery/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
on_deconstruction()
|
||||
if(component_parts && component_parts.len)
|
||||
if(LAZYLEN(component_parts))
|
||||
spawn_frame(disassembled)
|
||||
for(var/obj/item/I in component_parts)
|
||||
I.forceMove(loc)
|
||||
component_parts.Cut()
|
||||
circuit = null
|
||||
LAZYCLEARLIST(component_parts)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/proc/spawn_frame(disassembled)
|
||||
@@ -484,8 +520,15 @@ Class Procs:
|
||||
occupant = null
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return ..()
|
||||
|
||||
// The circuit should also be in component parts, so don't early return.
|
||||
if(A == circuit)
|
||||
circuit = null
|
||||
if((A in component_parts) && !QDELETED(src))
|
||||
component_parts.Remove(A)
|
||||
// It would be unusual for a component_part to be qdel'd ordinarily.
|
||||
deconstruct(FALSE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
@@ -579,7 +622,7 @@ Class Procs:
|
||||
else
|
||||
if(SEND_SIGNAL(W, COMSIG_TRY_STORAGE_TAKE, B, src))
|
||||
component_parts += B
|
||||
B.moveToNullspace()
|
||||
B.forceMove(src)
|
||||
SEND_SIGNAL(W, COMSIG_TRY_STORAGE_INSERT, A, null, null, TRUE)
|
||||
component_parts -= A
|
||||
to_chat(user, "<span class='notice'>[capitalize(A.name)] replaced with [B.name].</span>")
|
||||
@@ -641,7 +684,7 @@ Class Procs:
|
||||
|
||||
/obj/machinery/Exited(atom/movable/AM, atom/newloc)
|
||||
. = ..()
|
||||
if (AM == occupant)
|
||||
if(AM == occupant)
|
||||
occupant = null
|
||||
if(AM == circuit)
|
||||
circuit = null
|
||||
|
||||
@@ -17,11 +17,8 @@
|
||||
|
||||
/obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C)
|
||||
. = ..()
|
||||
|
||||
power_change()
|
||||
if(!QDELETED(C))
|
||||
qdel(circuit)
|
||||
circuit = C
|
||||
C.moveToNullspace()
|
||||
|
||||
/obj/machinery/computer/process()
|
||||
if(machine_stat & (NOPOWER|BROKEN))
|
||||
@@ -96,6 +93,7 @@
|
||||
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
|
||||
A.setDir(dir)
|
||||
A.circuit = circuit
|
||||
circuit.forceMove(A)
|
||||
A.set_anchored(TRUE)
|
||||
if(machine_stat & BROKEN)
|
||||
if(user)
|
||||
|
||||
@@ -69,18 +69,16 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
|
||||
return
|
||||
|
||||
/obj/machinery/computer/arcade/Initialize()
|
||||
. = ..()
|
||||
// If it's a generic arcade machine, pick a random arcade
|
||||
// circuit board for it and make the new machine
|
||||
// circuit board for it
|
||||
if(!circuit)
|
||||
var/list/gameodds = list(/obj/item/circuitboard/computer/arcade/battle = 49,
|
||||
/obj/item/circuitboard/computer/arcade/orion_trail = 49,
|
||||
/obj/item/circuitboard/computer/arcade/amputation = 2)
|
||||
var/thegame = pickweight(gameodds)
|
||||
var/obj/item/circuitboard/new_board = new thegame()
|
||||
var/obj/new_cabinet = new new_board.build_path(loc, new_board)
|
||||
new_cabinet.setDir(dir)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
circuit = pickweight(gameodds)
|
||||
|
||||
. = ..()
|
||||
|
||||
Reset()
|
||||
|
||||
/obj/machinery/computer/arcade/proc/prizevend(mob/user, prizes = 1)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
if(P.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
|
||||
var/obj/B = new circuit.build_path (loc, circuit)
|
||||
var/obj/B = new circuit.build_path(loc)
|
||||
B.setDir(dir)
|
||||
transfer_fingerprints_to(B)
|
||||
qdel(src)
|
||||
|
||||
@@ -176,28 +176,33 @@
|
||||
return
|
||||
|
||||
if(P.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
var/component_check = 1
|
||||
var/component_check = TRUE
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
component_check = FALSE
|
||||
break
|
||||
if(component_check)
|
||||
P.play_tool_sound(src)
|
||||
var/obj/potential_machine = new circuit.build_path(loc)
|
||||
if(ismachinery(potential_machine))
|
||||
var/obj/machinery/new_machine = potential_machine
|
||||
var/obj/machinery/new_machine = new circuit.build_path(loc)
|
||||
if(istype(new_machine))
|
||||
// Machines will init with a set of default components. Move to nullspace to we don't trigger handle_atom_del, then qdel.
|
||||
// Finally, replace with this frame's parts.
|
||||
if(new_machine.circuit)
|
||||
// Move to nullspace and delete.
|
||||
new_machine.circuit.moveToNullspace()
|
||||
QDEL_NULL(new_machine.circuit)
|
||||
circuit.forceMove(new_machine)
|
||||
new_machine.circuit = circuit
|
||||
new_machine.set_anchored(anchored)
|
||||
new_machine.on_construction()
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
qdel(O)
|
||||
for(var/obj/old_part in new_machine.component_parts)
|
||||
// Move to nullspace and delete.
|
||||
old_part.moveToNullspace()
|
||||
qdel(old_part)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
O.moveToNullspace()
|
||||
new_machine.component_parts += O
|
||||
circuit.moveToNullspace()
|
||||
for(var/obj/new_part in src)
|
||||
new_part.forceMove(new_machine)
|
||||
new_machine.component_parts += new_part
|
||||
new_machine.RefreshParts()
|
||||
qdel(src)
|
||||
return
|
||||
@@ -238,6 +243,7 @@
|
||||
S.merge(NS)
|
||||
if(!QDELETED(part)) //If we're a stack and we merged we might not exist anymore
|
||||
components += part
|
||||
part.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>[part.name] applied.</span>")
|
||||
if(added_components.len)
|
||||
replacer.play_rped_sound()
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
/obj/machinery/electrolyzer/on_deconstruction()
|
||||
if(cell)
|
||||
component_parts += cell
|
||||
LAZYADD(component_parts, cell)
|
||||
cell = null
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/obj/machinery/space_heater/on_deconstruction()
|
||||
if(cell)
|
||||
component_parts += cell
|
||||
LAZYADD(component_parts, cell)
|
||||
cell = null
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -190,8 +190,8 @@
|
||||
dump_contents()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/dump_contents()
|
||||
dropContents()
|
||||
/obj/machinery/suit_storage_unit/drop_stored_items()
|
||||
. = ..()
|
||||
helmet = null
|
||||
suit = null
|
||||
mask = null
|
||||
|
||||
@@ -99,10 +99,10 @@
|
||||
|
||||
/obj/machinery/teleport/hub/syndicate/Initialize()
|
||||
. = ..()
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/super(null)
|
||||
var/obj/item/stock_parts/matter_bin/super/super_bin = new(src)
|
||||
LAZYADD(component_parts, super_bin)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/teleport/station
|
||||
name = "teleporter station"
|
||||
desc = "The power control station for a bluespace teleporter. Used for toggling power, and can activate a test-fire to prevent malfunctions."
|
||||
|
||||
@@ -37,7 +37,7 @@ micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
|
||||
return
|
||||
|
||||
M.component_parts = list(src) // List of components always contains a board
|
||||
moveToNullspace()
|
||||
forceMove(M)
|
||||
|
||||
for(var/comp_path in req_components)
|
||||
var/comp_amt = req_components[comp_path]
|
||||
@@ -48,10 +48,10 @@ micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
|
||||
comp_path = def_components[comp_path]
|
||||
|
||||
if(ispath(comp_path, /obj/item/stack))
|
||||
M.component_parts += new comp_path(null, comp_amt)
|
||||
M.component_parts += new comp_path(M, comp_amt)
|
||||
else
|
||||
for(var/i in 1 to comp_amt)
|
||||
M.component_parts += new comp_path(null)
|
||||
M.component_parts += new comp_path(M)
|
||||
|
||||
M.RefreshParts()
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
SSair.stop_processing_machine(src)
|
||||
SSair.pipenets_needing_rebuilt -= src
|
||||
|
||||
dropContents()
|
||||
if(pipe_vision_img)
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
density = TRUE
|
||||
|
||||
circuit = /obj/item/circuitboard/machine/circulator
|
||||
|
||||
var/flipped = 0
|
||||
var/mode = CIRCULATOR_HOT
|
||||
@@ -24,10 +25,6 @@
|
||||
/obj/machinery/atmospherics/components/binary/circulator/cold
|
||||
mode = CIRCULATOR_COLD
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/circulator/Initialize(mapload)
|
||||
.=..()
|
||||
component_parts = list(new /obj/item/circuitboard/machine/circulator)
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/circulator/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS )
|
||||
|
||||
@@ -32,6 +32,7 @@ God bless America.
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 5
|
||||
layer = BELOW_OBJ_LAYER
|
||||
circuit = /obj/item/circuitboard/machine/deep_fryer
|
||||
var/obj/item/food/deepfryholder/frying //What's being fried RIGHT NOW?
|
||||
var/cook_time = 0
|
||||
var/oil_use = 0.025 //How much cooking oil is used per second
|
||||
@@ -57,10 +58,6 @@ God bless America.
|
||||
. = ..()
|
||||
create_reagents(50, OPENCONTAINER)
|
||||
reagents.add_reagent(/datum/reagent/consumable/cooking_oil, 25)
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/deep_fryer(null)
|
||||
component_parts += new /obj/item/stock_parts/micro_laser(null)
|
||||
RefreshParts()
|
||||
fry_loop = new(list(src), FALSE)
|
||||
|
||||
/obj/machinery/deepfryer/RefreshParts()
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/proc/go_out()
|
||||
dropContents()
|
||||
drop_stored_items()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/gibber/proc/startgibbing(mob/user)
|
||||
|
||||
@@ -327,11 +327,14 @@
|
||||
if(prob(max(metal / 2, 33)))
|
||||
explosion(loc, 0, 1, 2)
|
||||
else
|
||||
dropContents(ingredients)
|
||||
ingredients.Cut()
|
||||
drop_stored_items()
|
||||
|
||||
after_finish_loop()
|
||||
|
||||
/obj/machinery/microwave/drop_stored_items()
|
||||
. = ..()
|
||||
ingredients.Cut()
|
||||
|
||||
/obj/machinery/microwave/proc/pre_fail()
|
||||
broken = 2
|
||||
operating = FALSE
|
||||
|
||||
@@ -153,11 +153,7 @@
|
||||
/obj/machinery/processor/slime
|
||||
name = "slime processor"
|
||||
desc = "An industrial grinder with a sticker saying appropriated for science department. Keep hands clear of intake area while operating."
|
||||
|
||||
/obj/machinery/processor/slime/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/circuitboard/machine/B = new /obj/item/circuitboard/machine/processor/slime(null)
|
||||
B.apply_default_parts(src)
|
||||
circuit = /obj/item/circuitboard/machine/processor/slime
|
||||
|
||||
/obj/machinery/processor/slime/adjust_item_drop_location(atom/movable/AM)
|
||||
var/static/list/slimecores = subtypesof(/obj/item/slime_extract)
|
||||
|
||||
@@ -248,9 +248,16 @@
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/Initialize()
|
||||
. = ..()
|
||||
if(component_parts && component_parts.len)
|
||||
component_parts.Cut()
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = null
|
||||
circuit = null
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/on_deconstruction()
|
||||
new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
|
||||
|
||||
@@ -92,9 +92,15 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/skill_station/dropContents(list/subset)
|
||||
/obj/machinery/skill_station/drop_contents()
|
||||
. = ..()
|
||||
inserted_skillchip = null
|
||||
|
||||
/obj/machinery/skill_station/drop_stored_items(list/subset = null)
|
||||
// Don't drop the skillchip, it's directly inserted into the machine.
|
||||
// drop_contents() will drop everything including the skillchip.
|
||||
subset = contents - inserted_skillchip
|
||||
return ..() //This is kinda annoying
|
||||
return ..()
|
||||
|
||||
/obj/machinery/skill_station/proc/toggle_open(mob/user)
|
||||
state_open ? close_machine() : open_machine()
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
circuit = /obj/item/circuitboard/machine/generator
|
||||
|
||||
var/obj/machinery/atmospherics/components/binary/circulator/cold_circ
|
||||
var/obj/machinery/atmospherics/components/binary/circulator/hot_circ
|
||||
|
||||
@@ -19,7 +21,6 @@
|
||||
connect_to_network()
|
||||
SSair.start_processing_machine(src)
|
||||
update_icon()
|
||||
component_parts = list(new /obj/item/circuitboard/machine/generator)
|
||||
|
||||
/obj/machinery/power/generator/ComponentInitialize()
|
||||
. = ..()
|
||||
|
||||
@@ -497,14 +497,21 @@
|
||||
/obj/machinery/chem_dispenser/drinks/fullupgrade/Initialize()
|
||||
. = ..()
|
||||
dispensable_reagents |= emagged_reagents //adds emagged reagents
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser/drinks(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser/drinks(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 1)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(src)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/beer
|
||||
@@ -551,14 +558,21 @@
|
||||
/obj/machinery/chem_dispenser/drinks/beer/fullupgrade/Initialize()
|
||||
. = ..()
|
||||
dispensable_reagents |= emagged_reagents //adds emagged reagents
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser/drinks/beer(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser/drinks/beer(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 1)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(src)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/chem_dispenser/mutagen
|
||||
@@ -592,14 +606,21 @@
|
||||
|
||||
/obj/machinery/chem_dispenser/mutagensaltpeter/Initialize()
|
||||
. = ..()
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 1)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(src)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/chem_dispenser/fullupgrade //fully ugpraded stock parts, emagged
|
||||
@@ -610,14 +631,21 @@
|
||||
/obj/machinery/chem_dispenser/fullupgrade/Initialize()
|
||||
. = ..()
|
||||
dispensable_reagents |= emagged_reagents //adds emagged reagents
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 1)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(src)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/chem_dispenser/abductor
|
||||
@@ -672,12 +700,19 @@
|
||||
|
||||
/obj/machinery/chem_dispenser/abductor/Initialize()
|
||||
. = ..()
|
||||
|
||||
// Cache the old_parts first, we'll delete it after we've changed component_parts to a new list.
|
||||
// This stops handle_atom_del being called on every part when not necessary.
|
||||
var/list/old_parts = component_parts
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(null)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(null)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(null)
|
||||
component_parts += new /obj/item/stack/sheet/glass(null)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(null)
|
||||
component_parts += new /obj/item/circuitboard/machine/chem_dispenser(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/matter_bin/bluespace(src)
|
||||
component_parts += new /obj/item/stock_parts/capacitor/quadratic(src)
|
||||
component_parts += new /obj/item/stock_parts/manipulator/femto(src)
|
||||
component_parts += new /obj/item/stack/sheet/glass(src, 1)
|
||||
component_parts += new /obj/item/stock_parts/cell/bluespace(src)
|
||||
|
||||
QDEL_LIST(old_parts)
|
||||
RefreshParts()
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
. = ..()
|
||||
name += " [num2hex(rand(1,65535), -1)]" //gives us a random four-digit hex number as part of the name. Y'know, for fluff.
|
||||
SSresearch.servers |= src
|
||||
var/obj/item/circuitboard/machine/B = new /obj/item/circuitboard/machine/rdserver(null)
|
||||
B.apply_default_parts(src)
|
||||
current_temp = get_env_temp()
|
||||
|
||||
/obj/machinery/rnd/server/Destroy()
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
disintegration_effect.pixel_x = target.pixel_x
|
||||
disintegration_effect.pixel_y = target.pixel_y
|
||||
disintegration_effect.pixel_z = target.pixel_z
|
||||
target.dropContents()
|
||||
target.drop_contents()
|
||||
if(istype(target, /obj/machinery/computer))
|
||||
var/obj/machinery/computer/computer_target = target
|
||||
if(computer_target.circuit)
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
desc = "Uh oh!"
|
||||
|
||||
/obj/machinery/vending/cola/random/Initialize()
|
||||
..()
|
||||
// No need to call parent, we're not doing anything with this machine. Just picking a new type of machine to use, spawning it and deleting ourselves.
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
|
||||
var/T = pick(subtypesof(/obj/machinery/vending/cola) - /obj/machinery/vending/cola/random)
|
||||
new T(loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
desc = "Uh oh!"
|
||||
|
||||
/obj/machinery/vending/snack/random/Initialize()
|
||||
..()
|
||||
// No need to call parent, we're not doing anything with this machine. Just picking a new type of machine to use, spawning it and deleting ourselves.
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
|
||||
var/T = pick(subtypesof(/obj/machinery/vending/snack) - /obj/machinery/vending/snack/random)
|
||||
new T(loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
Reference in New Issue
Block a user