Merge pull request #6904 from VOREStation/pol-cleanup

Clean up various things
This commit is contained in:
Atermonera
2020-04-03 00:13:32 -07:00
committed by GitHub
51 changed files with 593 additions and 659 deletions

View File

@@ -17,12 +17,9 @@
var/datum/radio_frequency/radio_connection
var/deadman = FALSE
/obj/item/device/assembly/signaler/New()
..()
spawn(40)
set_frequency(frequency)
return
/obj/item/device/assembly/signaler/Initialize()
. = ..()
set_frequency(frequency)
/obj/item/device/assembly/signaler/activate()
if(cooldown > 0) return FALSE

View File

@@ -12,56 +12,45 @@
var/access_code = 0
var/datum/money_account/linked_account
/obj/item/device/eftpos/New()
..()
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
access_code = rand(1111,111111)
spawn(0)
print_reference()
//create a short manual as well
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Steps to success: Correct EFTPOS Usage"
/*
R.info += "<b>When first setting up your EFTPOS device:</b>"
R.info += "1. Memorise your EFTPOS command code (provided with all EFTPOS devices).<br>"
R.info += "2. Confirm that your EFTPOS device is connected to your local accounts database. For additional assistance with this step, contact NanoTrasen IT Support<br>"
R.info += "3. Confirm that your EFTPOS device has been linked to the account that you wish to recieve funds for all transactions processed on this device.<br>"
R.info += "<b>When starting a new transaction with your EFTPOS device:</b>"
R.info += "1. Ensure the device is UNLOCKED so that new data may be entered.<br>"
R.info += "2. Enter a sum of money and reference message for the new transaction.<br>"
R.info += "3. Lock the transaction, it is now ready for your customer.<br>"
R.info += "4. If at this stage you wish to modify or cancel your transaction, you may simply reset (unlock) your EFTPOS device.<br>"
R.info += "5. Give your EFTPOS device to the customer, they must authenticate the transaction by swiping their ID card and entering their PIN number.<br>"
R.info += "6. If done correctly, the transaction will be logged to both accounts with the reference you have entered, the terminal ID of your EFTPOS device and the money transferred across accounts.<br>"
*/
//Temptative new manual:
R.info += "<b>First EFTPOS setup:</b><br>"
R.info += "1. Memorise your EFTPOS command code (provided with all EFTPOS devices).<br>"
R.info += "2. Connect the EFTPOS to the account in which you want to receive the funds.<br><br>"
R.info += "<b>When starting a new transaction:</b><br>"
R.info += "1. Enter the amount of money you want to charge and a purpose message for the new transaction.<br>"
R.info += "2. Lock the new transaction. If you want to modify or cancel the transaction, you simply have to reset your EFTPOS device.<br>"
R.info += "3. Give the EFTPOS device to your customer, he/she must finish the transaction by swiping their ID card or a charge card with enough funds.<br>"
R.info += "4. If everything is done correctly, the money will be transferred. To unlock the device you will have to reset the EFTPOS device.<br>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.offset_x += 0
R.offset_y += 0
R.ico += "paper_stamp-cent"
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
/obj/item/device/eftpos/Initialize()
. = ..()
//by default, connect to the station account
//the user of the EFTPOS device can change the target account though, and no-one will be the wiser (except whoever's being charged)
linked_account = station_account
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
access_code = rand(1111,111111)
print_reference()
//create a short manual as well
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Steps to success: Correct EFTPOS Usage"
//Temptative new manual:
R.info += "<b>First EFTPOS setup:</b><br>"
R.info += "1. Memorise your EFTPOS command code (provided with all EFTPOS devices).<br>"
R.info += "2. Connect the EFTPOS to the account in which you want to receive the funds.<br><br>"
R.info += "<b>When starting a new transaction:</b><br>"
R.info += "1. Enter the amount of money you want to charge and a purpose message for the new transaction.<br>"
R.info += "2. Lock the new transaction. If you want to modify or cancel the transaction, you simply have to reset your EFTPOS device.<br>"
R.info += "3. Give the EFTPOS device to your customer, he/she must finish the transaction by swiping their ID card or a charge card with enough funds.<br>"
R.info += "4. If everything is done correctly, the money will be transferred. To unlock the device you will have to reset the EFTPOS device.<br>"
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
stampoverlay.icon_state = "paper_stamp-cent"
if(!R.stamped)
R.stamped = new
R.offset_x += 0
R.offset_y += 0
R.ico += "paper_stamp-cent"
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the EFTPOS device.</i>"
/obj/item/device/eftpos/Destroy()
linked_account = null
return ..()
/obj/item/device/eftpos/proc/print_reference()
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Reference: [eftpos_name]"

View File

@@ -4322,11 +4322,10 @@
icon_state = "bagelplain"
/obj/item/weapon/reagent_containers/food/snacks/bageltwo/Initialize()
. = ..()
..() //Not returning . because asking to be qdel'd below.
spawn_bagels()
spawn_bagels()
sleep(30)
qdel(src)
return INITIALIZE_HINT_QDEL
/obj/item/weapon/reagent_containers/food/snacks/bageltwo/proc/spawn_bagels()
var/build_path = /obj/item/weapon/reagent_containers/food/snacks/bagelplain

View File

@@ -22,21 +22,27 @@
/obj/machinery/gibber/autogibber
var/turf/input_plate
/obj/machinery/gibber/autogibber/New()
..()
spawn(5)
for(var/i in cardinal)
var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) )
if(input_obj)
if(isturf(input_obj.loc))
input_plate = input_obj.loc
gib_throw_dir = i
qdel(input_obj)
break
/obj/machinery/gibber/autogibber/Initialize()
. = ..()
for(var/i in cardinal)
var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) )
if(input_obj)
if(isturf(input_obj.loc))
input_plate = input_obj.loc
gib_throw_dir = i
qdel(input_obj)
break
if(!input_plate)
log_misc("a [src] didn't find an input plate.")
return
if(!input_plate)
log_misc("a [src] didn't find an input plate.")
/obj/machinery/gibber/Destroy()
occupant = null
return ..()
/obj/machinery/gibber/autogibber/Destroy()
input_plate = null
return ..()
/obj/machinery/gibber/autogibber/Bumped(var/atom/A)
if(!input_plate) return

View File

@@ -33,16 +33,15 @@
/obj/machinery/station_map/New()
..()
holomap_datum = new()
original_zLevel = loc.z
SSholomaps.station_holomaps += src
flags |= ON_BORDER // Why? It doesn't help if its not density
/obj/machinery/station_map/Initialize()
. = ..()
holomap_datum = new()
original_zLevel = loc.z
SSholomaps.station_holomaps += src
if(SSholomaps.holomaps_initialized)
spawn(1) // Tragically we need to spawn this in order to give the frame construcing us time to set pixel_x/y
setup_holomap()
setup_holomap()
/obj/machinery/station_map/Destroy()
SSholomaps.station_holomaps -= src
@@ -64,14 +63,12 @@
holomap_datum.initialize_holomap(T, reinit = TRUE)
small_station_map = image(SSholomaps.extraMiniMaps["[HOLOMAP_EXTRA_STATIONMAPSMALL]_[original_zLevel]"], dir = dir)
// small_station_map.plane = LIGHTING_PLANE // Not until we do planes ~Leshana
// small_station_map.layer = LIGHTING_LAYER+1 // Weird things will happen!
floor_markings = image('icons/obj/machines/stationmap.dmi', "decal_station_map")
floor_markings.dir = src.dir
// floor_markings.plane = ABOVE_TURF_PLANE // Not until we do planes ~Leshana
// floor_markings.layer = DECAL_LAYER
update_icon()
spawn(1) //When built from frames, need to allow time for it to set pixel_x and pixel_y
update_icon()
/obj/machinery/station_map/attack_hand(var/mob/user)
if(watching_mob && (watching_mob != user))
@@ -172,6 +169,9 @@
update_icon()
/obj/machinery/station_map/update_icon()
if(!holomap_datum)
return //Not yet.
overlays.Cut()
if(stat & BROKEN)
icon_state = "station_mapb"

View File

@@ -13,46 +13,36 @@
var/datum/seed/seed
var/potency = -1
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc,planttype)
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/Initialize(var/mapload, var/planttype)
. = ..()
if(!dried_type)
dried_type = type
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
pixel_x = rand(-5.0, 5)
pixel_y = rand(-5.0, 5)
// Fill the object up with the appropriate reagents.
if(planttype)
plantname = planttype
/obj/item/weapon/reagent_containers/food/snacks/grown/Initialize()
..()
spawn()
if(!plantname)
return
if(!plantname)
log_debug("Plantname not provided and and [src] requires it at [x],[y],[z]")
return INITIALIZE_HINT_QDEL
if(!plant_controller)
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
to_world("<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>")
qdel(src)
return
seed = plant_controller.seeds[plantname]
seed = plant_controller.seeds[plantname]
if(!seed)
log_debug("Plant name '[plantname]' does not exist and [src] requires it at [x],[y],[z]")
return INITIALIZE_HINT_QDEL
if(!seed)
return
name = "[seed.seed_name]"
trash = seed.get_trash_type()
name = "[seed.seed_name]"
trash = seed.get_trash_type()
update_icon()
update_icon()
if(!seed.chems)
return
potency = seed.get_trait(TRAIT_POTENCY)
potency = seed.get_trait(TRAIT_POTENCY)
if(seed.chems)
for(var/rid in seed.chems)
var/list/reagent_data = seed.chems[rid]
if(reagent_data && reagent_data.len)

View File

@@ -276,60 +276,54 @@
)
cant_hold = list(/obj/item/weapon/tool/screwdriver/power)
/obj/item/weapon/storage/bag/circuits/basic/New()
..()
spawn(2 SECONDS) // So the list has time to initialize.
// for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
// if(IC.spawn_flags & IC_SPAWN_DEFAULT)
// for(var/i = 1 to 4)
// new IC.type(src)
new /obj/item/weapon/storage/bag/circuits/mini/arithmetic(src)
new /obj/item/weapon/storage/bag/circuits/mini/trig(src)
new /obj/item/weapon/storage/bag/circuits/mini/input(src)
new /obj/item/weapon/storage/bag/circuits/mini/output(src)
new /obj/item/weapon/storage/bag/circuits/mini/memory(src)
new /obj/item/weapon/storage/bag/circuits/mini/logic(src)
new /obj/item/weapon/storage/bag/circuits/mini/time(src)
new /obj/item/weapon/storage/bag/circuits/mini/reagents(src)
new /obj/item/weapon/storage/bag/circuits/mini/transfer(src)
new /obj/item/weapon/storage/bag/circuits/mini/converter(src)
new /obj/item/weapon/storage/bag/circuits/mini/power(src)
/obj/item/weapon/storage/bag/circuits/basic/Initialize()
. = ..()
new /obj/item/weapon/storage/bag/circuits/mini/arithmetic(src)
new /obj/item/weapon/storage/bag/circuits/mini/trig(src)
new /obj/item/weapon/storage/bag/circuits/mini/input(src)
new /obj/item/weapon/storage/bag/circuits/mini/output(src)
new /obj/item/weapon/storage/bag/circuits/mini/memory(src)
new /obj/item/weapon/storage/bag/circuits/mini/logic(src)
new /obj/item/weapon/storage/bag/circuits/mini/time(src)
new /obj/item/weapon/storage/bag/circuits/mini/reagents(src)
new /obj/item/weapon/storage/bag/circuits/mini/transfer(src)
new /obj/item/weapon/storage/bag/circuits/mini/converter(src)
new /obj/item/weapon/storage/bag/circuits/mini/power(src)
new /obj/item/device/electronic_assembly(src)
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/multitool(src)
new /obj/item/weapon/tool/screwdriver(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
new /obj/item/device/electronic_assembly(src)
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/assembly/electronic_assembly(src)
new /obj/item/device/multitool(src)
new /obj/item/weapon/tool/screwdriver(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
/obj/item/weapon/storage/bag/circuits/all/New()
..()
spawn(2 SECONDS) // So the list has time to initialize.
new /obj/item/weapon/storage/bag/circuits/mini/arithmetic/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/trig/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/input/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/output/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/memory/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/logic/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/smart/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/manipulation/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/time/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/reagents/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/transfer/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/converter/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/power/all(src)
/obj/item/weapon/storage/bag/circuits/all/Initialize()
. = ..()
new /obj/item/weapon/storage/bag/circuits/mini/arithmetic/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/trig/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/input/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/output/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/memory/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/logic/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/smart/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/manipulation/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/time/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/reagents/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/transfer/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/converter/all(src)
new /obj/item/weapon/storage/bag/circuits/mini/power/all(src)
new /obj/item/device/electronic_assembly(src)
new /obj/item/device/electronic_assembly/medium(src)
new /obj/item/device/electronic_assembly/large(src)
new /obj/item/device/electronic_assembly/drone(src)
new /obj/item/device/integrated_electronics/wirer(src)
new /obj/item/device/integrated_electronics/debugger(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
new /obj/item/device/electronic_assembly(src)
new /obj/item/device/electronic_assembly/medium(src)
new /obj/item/device/electronic_assembly/large(src)
new /obj/item/device/electronic_assembly/drone(src)
new /obj/item/device/integrated_electronics/wirer(src)
new /obj/item/device/integrated_electronics/debugger(src)
new /obj/item/weapon/tool/crowbar(src)
make_exact_fit()
/obj/item/weapon/storage/bag/circuits/mini/
/obj/item/weapon/storage/bag/circuits/mini
name = "circuit box"
desc = "Used to partition categories of circuits, for a neater workspace."
w_class = 2

View File

@@ -11,17 +11,16 @@
var/obj/machinery/mineral/output = null
/obj/machinery/mineral/unloading_machine/New()
..()
spawn( 5 )
for (var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(src.input) break
for (var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(src.output) break
return
return
/obj/machinery/mineral/unloading_machine/Initialize()
. = ..()
for(var/dir in cardinal)
input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input)
break
for(var/dir in cardinal)
output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
break
/obj/machinery/mineral/unloading_machine/process()
if (src.output && src.input)

View File

@@ -1,6 +1,4 @@
/**********************Mint**************************/
/obj/machinery/mineral/mint
name = "Coin press"
icon = 'icons/obj/stationobjs.dmi'
@@ -21,43 +19,43 @@
var/coinsToProduce = 10
/obj/machinery/mineral/mint/New()
..()
spawn( 5 )
for (var/dir in cardinal)
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(src.input) break
for (var/dir in cardinal)
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(src.output) break
START_PROCESSING(SSobj, src)
return
return
/obj/machinery/mineral/mint/Initialize()
. = ..()
for (var/dir in cardinal)
input = locate(/obj/machinery/mineral/input, get_step(src, dir))
if(input)
break
for (var/dir in cardinal)
output = locate(/obj/machinery/mineral/output, get_step(src, dir))
if(output)
break
/obj/machinery/mineral/mint/process()
if ( src.input)
var/obj/item/stack/O
O = locate(/obj/item/stack, input.loc)
if(O)
var/processed = 1
switch(O.get_material_name())
if("gold")
amt_gold += 100 * O.get_amount()
if("silver")
amt_silver += 100 * O.get_amount()
if("diamond")
amt_diamond += 100 * O.get_amount()
if("phoron")
amt_phoron += 100 * O.get_amount()
if("uranium")
amt_uranium += 100 * O.get_amount()
if(DEFAULT_WALL_MATERIAL)
amt_iron += 100 * O.get_amount()
else
processed = 0
if(processed)
qdel(O)
if(!input)
return
var/obj/item/stack/O = locate(/obj/item/stack, input.loc)
if(!O)
return
var/processed = 1
switch(O.get_material_name())
if("gold")
amt_gold += 100 * O.get_amount()
if("silver")
amt_silver += 100 * O.get_amount()
if("diamond")
amt_diamond += 100 * O.get_amount()
if("phoron")
amt_phoron += 100 * O.get_amount()
if("uranium")
amt_uranium += 100 * O.get_amount()
if(DEFAULT_WALL_MATERIAL)
amt_iron += 100 * O.get_amount()
else
processed = 0
if(processed)
qdel(O)
/obj/machinery/mineral/mint/attack_hand(user as mob)

View File

@@ -63,9 +63,7 @@
transform = matrix()*0.75
animate(src, transform = matrix()*1.5, time = timetoburst)
// Queue the actual bursting
spawn(timetoburst)
if(!QDELETED(src))
burst(creator)
addtimer(CALLBACK(src, ./proc/burst, creator), timetoburst)
/obj/effect/resonance/proc/burst(var/creator = null)
var/turf/T = get_turf(src)

View File

@@ -41,21 +41,23 @@
client.eye = new_eye
/mob/living/silicon/ai/proc/create_eyeobj(var/newloc)
if(eyeobj) destroy_eyeobj()
if(!newloc) newloc = src.loc
if(eyeobj)
destroy_eyeobj()
if(!newloc)
newloc = src.loc
eyeobj = new /mob/observer/eye/aiEye(newloc)
eyeobj.owner = src
eyeobj.name = "[src.name] (AI Eye)" // Give it a name
if(client) client.eye = eyeobj
if(client)
client.eye = eyeobj
SetName(src.name)
// Intiliaze the eye by assigning it's "ai" variable to us. Then set it's loc to us.
/mob/living/silicon/ai/New()
..()
/mob/living/silicon/ai/Initialize()
. = ..()
create_eyeobj()
spawn(5)
if(eyeobj)
eyeobj.loc = src.loc
if(eyeobj)
eyeobj.loc = src.loc
/mob/living/silicon/ai/Destroy()
destroy_eyeobj()

View File

@@ -394,11 +394,10 @@
var/skin = null //Same as medbot, set to tox or ointment for the respective kits.
w_class = ITEMSIZE_NORMAL
/obj/item/weapon/firstaid_arm_assembly/New()
..()
spawn(5) // Terrible. TODO: fix
if(skin)
overlays += image('icons/obj/aibots.dmi', "kit_skin_[src.skin]")
/obj/item/weapon/firstaid_arm_assembly/Initialize()
. = ..()
if(skin)
overlays += image('icons/obj/aibots.dmi', "kit_skin_[src.skin]")
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()

View File

@@ -360,8 +360,7 @@
. = ..()
reagents.add_reagent("nutriment", 4)
reagents.add_reagent("slimejelly", 1)
spawn(rand(1200,1500))//the egg takes a while to "ripen"
Grow()
addtimer(CALLBACK(src, ./proc/Grow), rand(120 SECONDS, 150 SECONDS))
/obj/item/weapon/reagent_containers/food/snacks/egg/slime/proc/Grow()
grown = 1

View File

@@ -27,9 +27,11 @@
/obj/machinery/power/generator/Initialize()
soundloop = new(list(src), FALSE)
desc = initial(desc) + " Rated for [round(max_power/1000)] kW."
spawn(1)
reconnect()
return ..()
..() //Not returned, because...
return INITIALIZE_HINT_LATELOAD
/obj/machinery/power/generator/LateInitialize()
reconnect()
/obj/machinery/power/generator/Destroy()
QDEL_NULL(soundloop)

View File

@@ -13,15 +13,13 @@
var/lastgenlev = -1
/obj/machinery/power/generator_type2/New()
..()
spawn(5)
input1 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, 90))
input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, -90))
if(!input1 || !input2)
stat |= BROKEN
updateicon()
/obj/machinery/power/generator_type2/Initialize()
. = ..()
input1 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, 90))
input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, -90))
if(!input1 || !input2)
stat |= BROKEN
updateicon()
/obj/machinery/power/generator_type2/proc/updateicon()

View File

@@ -24,27 +24,17 @@
var/effectiverange = 25
// Borrows code from cloning computer
/obj/machinery/computer/gravity_control_computer/New()
..()
spawn(5)
updatemodules()
return
return
/obj/machinery/gravity_generator/New()
..()
spawn(5)
locatelocalareas()
return
return
/obj/machinery/computer/gravity_control_computer/Initialize()
. = ..()
updatemodules()
/obj/machinery/gravity_generator/Initialize()
. = ..()
locatelocalareas()
/obj/machinery/computer/gravity_control_computer/proc/updatemodules()
src.gravity_generator = findgenerator()
/obj/machinery/gravity_generator/proc/locatelocalareas()
for(var/area/A in range(src,effectiverange))
if(A.name == "Space")

View File

@@ -56,36 +56,32 @@
charge -= smes_amt
return smes_amt / SMESRATE
/obj/machinery/power/smes/Initialize()
. = ..()
if(!powernet)
connect_to_network()
/obj/machinery/power/smes/New()
..()
spawn(5)
if(!powernet)
connect_to_network()
dir_loop:
for(var/d in cardinal)
var/turf/T = get_step(src, d)
for(var/obj/machinery/power/terminal/term in T)
if(term && term.dir == turn(d, 180))
terminal = term
break dir_loop
if(!terminal)
stat |= BROKEN
return
terminal.master = src
if(!terminal.powernet)
terminal.connect_to_network()
update_icon()
dir_loop:
for(var/d in cardinal)
var/turf/T = get_step(src, d)
for(var/obj/machinery/power/terminal/term in T)
if(term && term.dir == turn(d, 180))
terminal = term
break dir_loop
if(!terminal)
stat |= BROKEN
return
terminal.master = src
if(!terminal.powernet)
terminal.connect_to_network()
update_icon()
if(!should_be_mapped)
warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z")
return
if(!should_be_mapped)
warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z")
/obj/machinery/power/smes/Destroy()
terminal = null
return ..()
/obj/machinery/power/smes/disconnect_terminal()
if(terminal)

View File

@@ -10,11 +10,10 @@
var/deploying
var/deployed
/obj/structure/droppod_door/New(var/newloc, var/autoopen)
..(newloc)
/obj/structure/droppod_door/Initialize(var/mapload, var/autoopen)
. = ..()
if(autoopen)
spawn(100)
deploy()
addtimer(CALLBACK(src, .proc/deploy), 10 SECONDS)
/obj/structure/droppod_door/attack_ai(var/mob/user)
if(!user.Adjacent(src))

View File

@@ -29,23 +29,24 @@
// create a new disposal
// find the attached trunk (if present) and init gas resvr.
/obj/machinery/disposal/New()
..()
spawn(5)
trunk = locate() in src.loc
if(!trunk)
mode = 0
flush = 0
else
trunk.linked = src // link the pipe trunk to self
/obj/machinery/disposal/Initialize()
. = ..()
trunk = locate() in loc
if(!trunk)
mode = 0
flush = 0
else
trunk.linked = src // link the pipe trunk to self
air_contents = new/datum/gas_mixture(PRESSURE_TANK_VOLUME)
update()
air_contents = new/datum/gas_mixture(PRESSURE_TANK_VOLUME)
update()
/obj/machinery/disposal/Destroy()
eject()
if(trunk)
trunk.linked = null
trunk = null
return ..()
// attack by item places it in to disposal
@@ -1308,46 +1309,39 @@
icon_state = "pipe-t"
var/obj/linked // the linked obj/machinery/disposal or obj/disposaloutlet
/obj/structure/disposalpipe/trunk/New()
..()
/obj/structure/disposalpipe/trunk/Initialize()
..() //Lateload below
dpdir = dir
spawn(1)
getlinked()
return INITIALIZE_HINT_LATELOAD
/obj/structure/disposalpipe/trunk/LateInitialize()
if(!linked)
getlinked()
update()
return
/obj/structure/disposalpipe/trunk/Destroy()
if(linked)
if(istype(linked, /obj/machinery/disposal))
var/obj/machinery/disposal/D = linked
D.trunk = null
linked = null
return ..()
/obj/structure/disposalpipe/trunk/proc/getlinked()
linked = null
var/obj/machinery/disposal/D = locate() in src.loc
var/obj/machinery/disposal/D = locate() in loc
if(D)
linked = D
if (!D.trunk)
if(!D.trunk)
D.trunk = src
var/obj/structure/disposaloutlet/O = locate() in src.loc
var/obj/structure/disposaloutlet/O = locate() in loc
if(O)
linked = O
update()
return
// Override attackby so we disallow trunkremoval when somethings ontop
// Override attackby so we disallow trunkremoval when somethings ontop
/obj/structure/disposalpipe/trunk/attackby(var/obj/item/I, var/mob/user)
//Disposal bins or chutes
/*
These shouldn't be required
var/obj/machinery/disposal/D = locate() in src.loc
if(D && D.anchored)
return
//Disposal outlet
var/obj/structure/disposaloutlet/O = locate() in src.loc
if(O && O.anchored)
return
*/
//Disposal constructors
var/obj/structure/disposalconstruct/C = locate() in src.loc
if(C && C.anchored)
@@ -1439,72 +1433,70 @@
var/turf/target // this will be where the output objects are 'thrown' to.
var/mode = 0
New()
..()
/obj/structure/disposaloutlet/Initialize()
. = ..()
spawn(1)
target = get_ranged_target_turf(src, dir, 10)
target = get_ranged_target_turf(src, dir, 10)
var/obj/structure/disposalpipe/trunk/trunk = locate() in src.loc
if(trunk)
trunk.linked = src // link the pipe trunk to self
var/obj/structure/disposalpipe/trunk/trunk = locate() in loc
if(trunk)
trunk.linked = src // link the pipe trunk to self
// expel the contents of the holder object, then delete it
// called when the holder exits the outlet
proc/expel(var/obj/structure/disposalholder/H)
/obj/structure/disposaloutlet/proc/expel(var/obj/structure/disposalholder/H)
flick("outlet-open", src)
playsound(src, 'sound/machines/warning-buzzer.ogg', 50, 0, 0)
sleep(20) //wait until correct animation frame
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
flick("outlet-open", src)
playsound(src, 'sound/machines/warning-buzzer.ogg', 50, 0, 0)
sleep(20) //wait until correct animation frame
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
if(H)
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(dir)
if(!istype(AM,/mob/living/silicon/robot/drone)) //Drones keep smashing windows from being fired out of chutes. Bad for the station. ~Z
spawn(5)
AM.throw_at(target, 3, 1)
H.vent_gas(src.loc)
qdel(H)
if(H)
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(dir)
if(!istype(AM,/mob/living/silicon/robot/drone)) //Drones keep smashing windows from being fired out of chutes. Bad for the station. ~Z
spawn(5)
AM.throw_at(target, 3, 1)
H.vent_gas(src.loc)
qdel(H)
return
/obj/structure/disposaloutlet/attackby(var/obj/item/I, var/mob/user)
if(!I || !user)
return
attackby(var/obj/item/I, var/mob/user)
if(!I || !user)
src.add_fingerprint(user)
if(I.is_screwdriver())
if(mode==0)
mode=1
to_chat(user, "You remove the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(mode==1)
mode=0
to_chat(user, "You attach the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(istype(I, /obj/item/weapon/weldingtool) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal outlet.")
var/obj/structure/disposalconstruct/C = new (src.loc)
src.transfer_fingerprints_to(C)
C.ptype = 7 // 7 = outlet
C.update()
C.anchored = 1
C.density = 1
qdel(src)
return
else
to_chat(user, "You need more welding fuel to complete this task.")
return
src.add_fingerprint(user)
if(I.is_screwdriver())
if(mode==0)
mode=1
to_chat(user, "You remove the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(mode==1)
mode=0
to_chat(user, "You attach the screws around the power connection.")
playsound(src, I.usesound, 50, 1)
return
else if(istype(I, /obj/item/weapon/weldingtool) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal outlet.")
var/obj/structure/disposalconstruct/C = new (src.loc)
src.transfer_fingerprints_to(C)
C.ptype = 7 // 7 = outlet
C.update()
C.anchored = 1
C.density = 1
qdel(src)
return
else
to_chat(user, "You need more welding fuel to complete this task.")
return
// called when movable is expelled from a disposal pipe or outlet
// by default does nothing, override for special behaviour

View File

@@ -13,12 +13,11 @@
var/obj/machinery/artifact_scanpad/owned_scanner = null
var/last_process = 0
/obj/machinery/artifact_harvester/New()
..()
spawn(50) //Delay so the scan pad has time to actually spawn in
owned_scanner = locate(/obj/machinery/artifact_scanpad) in get_step(src, dir) //connect to a nearby scanner pad
if(!owned_scanner)
owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src)
/obj/machinery/artifact_harvester/Initialize()
. = ..()
owned_scanner = locate(/obj/machinery/artifact_scanpad) in get_step(src, dir)
if(!owned_scanner)
owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src)
/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob)
if(istype(I,/obj/item/weapon/anobattery))