diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 39e9e44da2..d66ebc100c 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -34,8 +34,8 @@ Pipelines + Other Objects -> Pipe network var/obj/machinery/atmospherics/node1 var/obj/machinery/atmospherics/node2 -/obj/machinery/atmospherics/New(loc, newdir) - ..() +/obj/machinery/atmospherics/Initialize(var/ml, newdir) + . = ..() if(!icon_manager) icon_manager = new() if(!isnull(newdir)) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index cc280d97cc..6b49555a3a 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -9,8 +9,8 @@ var/datum/pipe_network/network1 var/datum/pipe_network/network2 -/obj/machinery/atmospherics/binary/New() - ..() +/obj/machinery/atmospherics/binary/Initialize() + . = ..() air1 = new air2 = new diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index c09c482cc1..071593f7d6 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -23,8 +23,8 @@ density = 1 -/obj/machinery/atmospherics/binary/circulator/New() - ..() +/obj/machinery/atmospherics/binary/circulator/Initialize() + . = ..() desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." air1.volume = 400 diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 86a87223eb..bf675c1e12 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -42,8 +42,10 @@ //2: Do not pass input_pressure_min //4: Do not pass output_pressure_max -/obj/machinery/atmospherics/binary/dp_vent_pump/New() - ..() +/obj/machinery/atmospherics/binary/dp_vent_pump/Initialize() + . = ..() + if(frequency) + set_frequency(frequency) air1.volume = ATMOS_DEFAULT_VOLUME_PUMP air2.volume = ATMOS_DEFAULT_VOLUME_PUMP icon = null @@ -55,8 +57,8 @@ /obj/machinery/atmospherics/binary/dp_vent_pump/high_volume name = "Large Dual Port Air Vent" -/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/New() - ..() +/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/Initialize() + . = ..() air1.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800 air2.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800 @@ -194,11 +196,6 @@ return 1 -/obj/machinery/atmospherics/binary/dp_vent_pump/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - /obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user) . = ..() if(Adjacent(user)) diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 8d30c946ca..46b82e3b6f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -27,10 +27,12 @@ var/id = null var/datum/radio_frequency/radio_connection -/obj/machinery/atmospherics/binary/passive_gate/New() - ..() +/obj/machinery/atmospherics/binary/passive_gate/Initialize() + . = ..() air1.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5 air2.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5 + if(frequency) + set_frequency(frequency) /obj/machinery/atmospherics/binary/passive_gate/Destroy() unregister_radio(src, frequency) @@ -166,14 +168,8 @@ ) radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA) - return 1 -/obj/machinery/atmospherics/binary/passive_gate/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - /obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal) if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command")) return 0 diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 05922103ff..c767679f3e 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -37,10 +37,12 @@ Thus, the two variables affect pump operation are set in New(): var/id = null var/datum/radio_frequency/radio_connection -/obj/machinery/atmospherics/binary/pump/New() - ..() +/obj/machinery/atmospherics/binary/pump/Initialize() + . = ..() air1.volume = ATMOS_DEFAULT_VOLUME_PUMP air2.volume = ATMOS_DEFAULT_VOLUME_PUMP + if(frequency) + set_frequency(frequency) /obj/machinery/atmospherics/binary/pump/Destroy() unregister_radio(src, frequency) @@ -166,11 +168,6 @@ Thus, the two variables affect pump operation are set in New(): return data -/obj/machinery/atmospherics/binary/pump/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - /obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal) if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command")) return 0 diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 6ef7879f2b..3e93b457af 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -20,8 +20,8 @@ var/list/filtering_outputs = list() //maps gasids to gas_mixtures -/obj/machinery/atmospherics/omni/atmos_filter/New() - ..() +/obj/machinery/atmospherics/omni/atmos_filter/Initialize() + . = ..() rebuild_filtering_list() for(var/datum/omni_port/P in ports) P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index 077be63b30..7f422df44a 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -24,8 +24,8 @@ var/list/mixing_inputs = list() -/obj/machinery/atmospherics/omni/mixer/New() - ..() +/obj/machinery/atmospherics/omni/mixer/Initialize() + . = ..() if(mapper_set()) var/con = 0 for(var/datum/omni_port/P in ports) diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index cca6155eb4..bc772ba8c6 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -25,8 +25,8 @@ var/list/ports = new() -/obj/machinery/atmospherics/omni/New() - ..() +/obj/machinery/atmospherics/omni/Initialize() + . = ..() icon_state = "base" ports = new() diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index a787aa1873..7892c02b9a 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -39,8 +39,8 @@ if(frequency) radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA) -/obj/machinery/atmospherics/trinary/atmos_filter/New() - ..() +/obj/machinery/atmospherics/trinary/atmos_filter/Initialize() + . = ..() switch(filter_type) if(0) //removing hydrocarbons filtered_out = list("phoron") @@ -56,6 +56,8 @@ air1.volume = ATMOS_DEFAULT_VOLUME_FILTER air2.volume = ATMOS_DEFAULT_VOLUME_FILTER air3.volume = ATMOS_DEFAULT_VOLUME_FILTER + if(frequency) + set_frequency(frequency) /obj/machinery/atmospherics/trinary/atmos_filter/Destroy() unregister_radio(src, frequency) @@ -106,11 +108,6 @@ return 1 -/obj/machinery/atmospherics/trinary/atmos_filter/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - /obj/machinery/atmospherics/trinary/atmos_filter/attack_hand(user) // -- TLE if(..()) return diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 7344a3e732..b90983cdbf 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -37,8 +37,8 @@ icon_state += "off" update_use_power(USE_POWER_OFF) -/obj/machinery/atmospherics/trinary/mixer/New() - ..() +/obj/machinery/atmospherics/trinary/mixer/Initialize() + . = ..() air1.volume = ATMOS_DEFAULT_VOLUME_MIXER air2.volume = ATMOS_DEFAULT_VOLUME_MIXER air3.volume = ATMOS_DEFAULT_VOLUME_MIXER * 1.5 diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 10d7403541..4570b95dda 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -17,8 +17,8 @@ var/datum/pipe_network/network2 var/datum/pipe_network/network3 -/obj/machinery/atmospherics/trinary/New() - ..() +/obj/machinery/atmospherics/trinary/Initialize() + . = ..() air1 = new air2 = new diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index 5eeab2c8e4..fa77c7b7ab 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -24,9 +24,11 @@ level = 1 -/obj/machinery/atmospherics/unary/outlet_injector/New() - ..() +/obj/machinery/atmospherics/unary/outlet_injector/Initialize() + . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more. + if(frequency) + set_frequency(frequency) /obj/machinery/atmospherics/unary/outlet_injector/Destroy() unregister_radio(src, frequency) @@ -122,11 +124,6 @@ return 1 -/obj/machinery/atmospherics/unary/outlet_injector/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - /obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal) if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command")) return 0 diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 12d6822ad4..a20a860b02 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -13,8 +13,8 @@ var/welded = 0 //defining this here for ventcrawl stuff -/obj/machinery/atmospherics/unary/New() - ..() +/obj/machinery/atmospherics/unary/Initialize() + . = ..() air_contents = new air_contents.volume = 200 diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index dacb3700bd..926521ad00 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -78,9 +78,6 @@ /obj/machinery/atmospherics/unary/vent_pump/Initialize() . = ..() soundloop = new(list(src), FALSE) - -/obj/machinery/atmospherics/unary/vent_pump/New() - ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP icon = null @@ -108,8 +105,8 @@ icon_connect_type = "-aux" connect_types = CONNECT_TYPE_AUX //connects to aux pipes -/obj/machinery/atmospherics/unary/vent_pump/high_volume/New() - ..() +/obj/machinery/atmospherics/unary/vent_pump/high_volume/Initialize() + . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800 /obj/machinery/atmospherics/unary/vent_pump/engine @@ -117,8 +114,8 @@ power_channel = ENVIRON power_rating = 30000 //15 kW ~ 20 HP -/obj/machinery/atmospherics/unary/vent_pump/engine/New() - ..() +/obj/machinery/atmospherics/unary/vent_pump/engine/Initialize() + . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //meant to match air injector /obj/machinery/atmospherics/unary/vent_pump/update_icon(var/safety = 0) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 1443b296d0..495d7d0428 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -32,8 +32,8 @@ use_power = USE_POWER_IDLE icon_state = "map_scrubber_on" -/obj/machinery/atmospherics/unary/vent_scrubber/New() - ..() +/obj/machinery/atmospherics/unary/vent_scrubber/Initialize() + . = ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_FILTER icon = null diff --git a/code/ATMOSPHERICS/pipes/he_pipes.dm b/code/ATMOSPHERICS/pipes/he_pipes.dm index 8b1b800830..445b44a146 100644 --- a/code/ATMOSPHERICS/pipes/he_pipes.dm +++ b/code/ATMOSPHERICS/pipes/he_pipes.dm @@ -23,8 +23,8 @@ buckle_lying = 1 // BubbleWrap -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New() - ..() +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/Initialize() + . = ..() // BubbleWrap END color = "#404040" //we don't make use of the fancy overlay system for colours, use this to set the default. diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index a17f78e50d..ad270148da 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -19,8 +19,8 @@ level = 1 -/obj/machinery/atmospherics/pipe/manifold/New() - ..() +/obj/machinery/atmospherics/pipe/manifold/Initialize() + . = ..() alpha = 255 icon = null diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 7273ac5288..8a67a6ad1c 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -20,8 +20,8 @@ level = 1 -/obj/machinery/atmospherics/pipe/manifold4w/New() - ..() +/obj/machinery/atmospherics/pipe/manifold4w/Initialize() + . = ..() alpha = 255 icon = null diff --git a/code/ATMOSPHERICS/pipes/pipe_base.dm b/code/ATMOSPHERICS/pipes/pipe_base.dm index f95948868d..22ceb272f6 100644 --- a/code/ATMOSPHERICS/pipes/pipe_base.dm +++ b/code/ATMOSPHERICS/pipes/pipe_base.dm @@ -24,10 +24,10 @@ /obj/machinery/atmospherics/pipe/drain_power() return -1 -/obj/machinery/atmospherics/pipe/New() +/obj/machinery/atmospherics/pipe/Initialize() if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall)) level = 1 - ..() + . = ..() /obj/machinery/atmospherics/pipe/hides_under_flooring() return level != 2 diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm index e0f6f7d951..f70c7ea63e 100644 --- a/code/ATMOSPHERICS/pipes/simple.dm +++ b/code/ATMOSPHERICS/pipes/simple.dm @@ -26,8 +26,8 @@ level = 1 -/obj/machinery/atmospherics/pipe/simple/New() - ..() +/obj/machinery/atmospherics/pipe/simple/Initialize() + . = ..() // Pipe colors and icon states are handled by an image cache - so color and icon should // be null. For mapping purposes color is defined in the object definitions. diff --git a/code/ATMOSPHERICS/pipes/tank.dm b/code/ATMOSPHERICS/pipes/tank.dm index 838279a35c..b975cf2016 100644 --- a/code/ATMOSPHERICS/pipes/tank.dm +++ b/code/ATMOSPHERICS/pipes/tank.dm @@ -18,9 +18,9 @@ pipe_flags = PIPING_DEFAULT_LAYER_ONLY density = 1 -/obj/machinery/atmospherics/pipe/tank/New() +/obj/machinery/atmospherics/pipe/tank/Initialize() icon_state = "air" - ..() + . = ..() /obj/machinery/atmospherics/pipe/tank/init_dir() initialize_directions = dir @@ -74,58 +74,49 @@ name = "Pressure Tank (Air)" icon_state = "air_map" -/obj/machinery/atmospherics/pipe/tank/air/New() +/obj/machinery/atmospherics/pipe/tank/air/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T20C - air_temporary.adjust_multi("oxygen", (start_pressure*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature), \ "nitrogen",(start_pressure*N2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - - ..() + . = ..() icon_state = "air" /obj/machinery/atmospherics/pipe/tank/oxygen name = "Pressure Tank (Oxygen)" icon_state = "o2_map" -/obj/machinery/atmospherics/pipe/tank/oxygen/New() +/obj/machinery/atmospherics/pipe/tank/oxygen/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T20C - air_temporary.adjust_gas("oxygen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - ..() + . = ..() icon_state = "o2" /obj/machinery/atmospherics/pipe/tank/nitrogen name = "Pressure Tank (Nitrogen)" icon_state = "n2_map" -/obj/machinery/atmospherics/pipe/tank/nitrogen/New() +/obj/machinery/atmospherics/pipe/tank/nitrogen/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T20C - air_temporary.adjust_gas("nitrogen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - ..() + . = ..() icon_state = "n2" /obj/machinery/atmospherics/pipe/tank/carbon_dioxide name = "Pressure Tank (Carbon Dioxide)" icon_state = "co2_map" -/obj/machinery/atmospherics/pipe/tank/carbon_dioxide/New() +/obj/machinery/atmospherics/pipe/tank/carbon_dioxide/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T20C - air_temporary.adjust_gas("carbon_dioxide", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - ..() + . = ..() icon_state = "co2" /obj/machinery/atmospherics/pipe/tank/phoron @@ -133,26 +124,22 @@ icon_state = "phoron_map" connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_FUEL -/obj/machinery/atmospherics/pipe/tank/phoron/New() +/obj/machinery/atmospherics/pipe/tank/phoron/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T20C - air_temporary.adjust_gas("phoron", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - ..() + . = ..() icon_state = "phoron" /obj/machinery/atmospherics/pipe/tank/nitrous_oxide name = "Pressure Tank (Nitrous Oxide)" icon_state = "n2o_map" -/obj/machinery/atmospherics/pipe/tank/nitrous_oxide/New() +/obj/machinery/atmospherics/pipe/tank/nitrous_oxide/Initialize() air_temporary = new air_temporary.volume = volume air_temporary.temperature = T0C - air_temporary.adjust_gas("nitrous_oxide", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature)) - - ..() + . = ..() icon_state = "n2o" diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 9c8ec74d4d..8728f0c4c3 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -180,8 +180,8 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin animate(src, color = fire_color(air_contents.temperature), 5) set_light(l_color = color) -/obj/fire/New(newLoc,fl) - ..() +/obj/fire/Initialize(var/ml, fl) + . = ..() if(!istype(loc, /turf)) qdel(src) diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index e5deaa36e4..82621adb2c 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -55,8 +55,8 @@ #define COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE "atom_init_success" ///from base of atom/attackby(): (/obj/item, /mob/living, params) #define COMSIG_PARENT_ATTACKBY "atom_attackby" -///Return this in response if you don't want afterattack to be called - #define COMPONENT_NO_AFTERATTACK (1<<0) +///Return this in response if you don't want later item attack procs to be called. + #define COMPONENT_CANCEL_ATTACK_CHAIN (1<<0) ///from base of atom/attack_hulk(): (/mob/living/carbon/human) #define COMSIG_ATOM_HULK_ATTACK "hulk_attack" ///from base of atom/animal_attack(): (/mob/user) @@ -89,6 +89,7 @@ #define COMSIG_ATOM_BUMPED "atom_bumped" ///from base of atom/ex_act(): (severity, target) #define COMSIG_ATOM_EX_ACT "atom_ex_act" + #define COMPONENT_IGNORE_EXPLOSION (1<<0) ///from base of atom/emp_act(): (severity) #define COMSIG_ATOM_EMP_ACT "atom_emp_act" ///from base of atom/fire_act(): (exposed_temperature, exposed_volume) @@ -218,7 +219,7 @@ // /atom/movable signals -///from base of atom/movable/Moved(): (/atom) +///from base of atom/movable/Move(): (atom/newloc, dir, movetime) #define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move" #define COMPONENT_MOVABLE_BLOCK_PRE_MOVE (1<<0) ///from base of atom/movable/Moved(): (/atom, dir) @@ -735,4 +736,7 @@ #define COMSIG_TRIGGERED_ALARM "ssalarm_triggered" #define COMSIG_CANCELLED_ALARM "ssalarm_cancelled" -#define COMSIG_REAGENTS_CRAFTING_PING "reagents_crafting_ping" \ No newline at end of file +#define COMSIG_REAGENTS_CRAFTING_PING "reagents_crafting_ping" + +//From reagents touch_x. +#define COMSIG_REAGENTS_TOUCH "reagent_touch" \ No newline at end of file diff --git a/code/__defines/materials.dm b/code/__defines/materials.dm index 8a8a337eeb..8c36cd1335 100644 --- a/code/__defines/materials.dm +++ b/code/__defines/materials.dm @@ -43,6 +43,10 @@ #define MAT_PAINITE "painite" #define MAT_BOROSILICATE "borosilicate glass" #define MAT_SANDSTONE "sandstone" +#define MAT_PLATINUM "platinum" +#define MAT_TRITIUM "tritium" +#define MAT_DEUTERIUM "deuterium" + #define DEFAULT_TABLE_MATERIAL MAT_PLASTIC #define DEFAULT_WALL_MATERIAL MAT_STEEL diff --git a/code/__defines/species_languages.dm b/code/__defines/species_languages.dm index 57cdc5b147..8dace69083 100644 --- a/code/__defines/species_languages.dm +++ b/code/__defines/species_languages.dm @@ -37,9 +37,10 @@ #define ALLERGEN_COFFEE 0x200 // Mostly here for tajara. #define ALLERGEN_SUGARS 0x400 // For unathi-like reactions #define ALLERGEN_EGGS 0x800 // For Skrell eggs allergy +#define ALLERGEN_STIMULANT 0x1000 // Stimulants are what makes the Tajaran heart go ruh roh - not just coffee! // Allergen reactions -#define AG_TOX_DMG 0x1 // the classic +#define AG_TOX_DMG 0x1 // the classic #define AG_OXY_DMG 0x2 // intense airway reactions #define AG_EMOTE 0x4 // general emote reactions based on affect type #define AG_PAIN 0x8 // short-lived hurt diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index f7b4a574f7..5f63680b20 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -19,9 +19,10 @@ #define TIMER_ID_NULL -1 -#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize -#define INITIALIZATION_INNEW_MAPLOAD 1 //New should call Initialize(TRUE) -#define INITIALIZATION_INNEW_REGULAR 2 //New should call Initialize(FALSE) +#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize +#define INITIALIZATION_INSSATOMS_LATE 1 //New should not call Initialize; after the first pass is complete (handled differently) +#define INITIALIZATION_INNEW_MAPLOAD 2 //New should call Initialize(TRUE) +#define INITIALIZATION_INNEW_REGULAR 3 //New should call Initialize(FALSE) #define INITIALIZE_HINT_NORMAL 0 //Nothing happens #define INITIALIZE_HINT_LATELOAD 1 //Call LateInitialize diff --git a/code/_helpers/turfs.dm b/code/_helpers/turfs.dm index b3318647a0..7211010b72 100644 --- a/code/_helpers/turfs.dm +++ b/code/_helpers/turfs.dm @@ -108,7 +108,7 @@ if(istype(T,/turf/simulated/shuttle)) shuttlework = 1 var/turf/simulated/shuttle/SS = T - if(!SS.landed_holder) SS.landed_holder = new(turf = SS) + if(!SS.landed_holder) SS.landed_holder = new(SS) X = SS.landed_holder.land_on(B) //Generic non-shuttle turf move. diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 0541b7bed7..52b3e7762b 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -803,7 +803,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(istype(T,/turf/simulated/shuttle)) shuttlework = 1 var/turf/simulated/shuttle/SS = T - if(!SS.landed_holder) SS.landed_holder = new(turf = SS) + if(!SS.landed_holder) SS.landed_holder = new(SS) X = SS.landed_holder.land_on(B) //Generic non-shuttle turf move. @@ -1310,8 +1310,9 @@ var/mob/dview/dview_mob = new color = origin.color set_light(origin.light_range, origin.light_power, origin.light_color) -/mob/dview/New() - ..() +INITIALIZE_IMMEDIATE(/mob/dview) +/mob/dview/Initialize() + . = ..() // We don't want to be in any mob lists; we're a dummy not a mob. mob_list -= src if(stat == DEAD) diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index d7b6dafa44..49c25650b3 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -12,12 +12,13 @@ var/mob/my_mob = null // The mob that possesses this hud object. -/obj/screen/movable/ability_master/New(owner) +/obj/screen/movable/ability_master/Initialize(ml, owner) + . = ..() if(owner) my_mob = owner update_abilities(0, owner) else - message_admins("ERROR: ability_master's New() was not given an owner argument. This is a bug.") + message_admins("ERROR: ability_master's Initialize() was not given an owner argument. This is a bug.") /obj/screen/movable/ability_master/Destroy() . = ..() @@ -178,9 +179,9 @@ ability_master.toggle_open(1) client.screen -= ability_master -/mob/New() - ..() - ability_master = new /obj/screen/movable/ability_master(src) +/mob/Initialize() + . = ..() + ability_master = new /obj/screen/movable/ability_master(null, src) ///////////ACTUAL ABILITIES//////////// //This is what you click to do things// diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 0c6d7e0322..858f1d4773 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -191,6 +191,11 @@ The box in your backpack has an oxygen tank and gas mask in it." desc = "Your battery is about to die! Charge it ASAP!" icon_state = "c_starving" +/obj/screen/alert/warm + name = "Too Warm" + desc = "You're uncomfortably warm. Take off some clothes or tweak the thermostat a few degrees cooler." + icon_state = "mildhot" + /obj/screen/alert/hot name = "Too Hot" desc = "You're flaming hot! Get somewhere cooler and take off any insulating clothing like a fire suit." @@ -199,6 +204,11 @@ The box in your backpack has an oxygen tank and gas mask in it." /obj/screen/alert/hot/robot desc = "The air around you is too hot for a humanoid. Be careful to avoid exposing them to this enviroment." +/obj/screen/alert/chilly + name = "Too Chilly" + desc = "You're uncomfortably cold. Rug up or tweak the thermostat a few degrees higher." + icon_state = "mildcold" + /obj/screen/alert/cold name = "Too Cold" desc = "You're freezing cold! Get somewhere warmer and take off any insulating clothing like a space suit." diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 9d6da07f0b..51a06da47d 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -622,8 +622,9 @@ plane = PLANE_PLAYER_HUD_ABOVE var/client/holder -/obj/screen/splash/New(client/C, visible) - . = ..() +INITIALIZE_IMMEDIATE(/obj/screen/splash) +/obj/screen/splash/Initialize(var/ml, client/C, visible) + . = ..(ml) holder = C @@ -691,6 +692,9 @@ var/obj/screen/mapper/extras_holder/extras_holder /obj/screen/movable/mapper_holder/Initialize(mapload, newowner) + + . = ..() + owner = newowner mask_full = new(src) // Full white square mask @@ -778,8 +782,8 @@ mouse_opacity = 0 var/obj/screen/movable/mapper_holder/parent -/obj/screen/mapper/New() - ..() +/obj/screen/mapper/Initialize() + . = ..() parent = loc /obj/screen/mapper/Destroy() diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 8aca3bd1a4..fc35ade227 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -25,27 +25,46 @@ avoid code duplication. This includes items that may sometimes act as a standard return return -// Called at the start of resolve_attackby(), before the actual attack. -/obj/item/proc/pre_attack(atom/a, mob/user) - return +/** + * Called at the start of resolve_attackby(), before the actual attack. + * + * Arguments: + * * atom/A - The atom about to be hit + * * mob/living/user - The mob doing the htting + * * params - click params such as alt/shift etc + * + * See: [/obj/item/proc/melee_attack_chain] + */ + +/obj/item/proc/pre_attack(atom/A, mob/user, params) //do stuff before attackby! + if(SEND_SIGNAL(src, COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_CANCEL_ATTACK_CHAIN) + return TRUE + return FALSE //return TRUE to avoid calling attackby after this proc does stuff //I would prefer to rename this to attack(), but that would involve touching hundreds of files. /obj/item/proc/resolve_attackby(atom/A, mob/user, var/attack_modifier = 1, var/click_parameters) - pre_attack(A, user) add_fingerprint(user) + . = pre_attack(A, user, click_parameters) + if(.) // We're returning the value of pre_attack, important if it has a special return. + return return A.attackby(src, user, attack_modifier, click_parameters) // No comment /atom/proc/attackby(obj/item/W, mob/user, var/attack_modifier, var/click_parameters) - if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, click_parameters) & COMPONENT_NO_AFTERATTACK) + if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, click_parameters) & COMPONENT_CANCEL_ATTACK_CHAIN) return TRUE return FALSE /mob/living/attackby(obj/item/I, mob/user, var/attack_modifier, var/click_parameters) if(!ismob(user)) - return 0 + return FALSE + + if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, I, user, click_parameters) & COMPONENT_CANCEL_ATTACK_CHAIN) + return FALSE + if(can_operate(src, user) && I.do_surgery(src,user)) - return 1 + return TRUE + return I.attack(src, user, user.zone_sel.selecting, attack_modifier) // Used to get how fast a mob should attack, and influences click delay. diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 3bd1a0afb2..5351139540 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -26,7 +26,9 @@ A.attack_hand(src) /atom/proc/attack_hand(mob/user as mob) - return + if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_CANCEL_ATTACK_CHAIN) + return TRUE + return FALSE /mob/living/carbon/human/RestrainedClickOn(var/atom/A) return diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index d6e272f9c9..fde8227376 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -251,8 +251,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new layer = TURF_LAYER plane = TURF_PLANE -/obj/effect/bgstar/New() - ..() +/obj/effect/bgstar/Initialize() + . = ..() pixel_x += rand(-2,30) pixel_y += rand(-2,30) var/starnum = pick("1", "1", "1", "2", "3", "4") diff --git a/code/controllers/subsystems/atoms.dm b/code/controllers/subsystems/atoms.dm index 25052d7c7f..5ddc4b3c2a 100644 --- a/code/controllers/subsystems/atoms.dm +++ b/code/controllers/subsystems/atoms.dm @@ -8,70 +8,66 @@ SUBSYSTEM_DEF(atoms) init_order = INIT_ORDER_ATOMS flags = SS_NO_FIRE - var/static/initialized = INITIALIZATION_INSSATOMS - // var/list/created_atoms // This is never used, so don't bother. ~Leshana - var/static/old_initialized + // override and GetArguments() exists for mod-override/downstream hook functionality. + // Useful for total-overhaul type modifications. + var/adjust_init_arguments = FALSE + + var/atom_init_stage = INITIALIZATION_INSSATOMS + var/old_init_stage var/list/late_loaders - var/list/created_atoms - var/list/BadInitializeCalls = list() /datum/controller/subsystem/atoms/Initialize(timeofday) if(!plant_controller) // Initialize seed repo for /obj/item/seed and /obj/item/weapon/grown plant_controller = new setupgenetics() //to set the mutations' place in structural enzymes, so initializers know where to put mutations. - initialized = INITIALIZATION_INNEW_MAPLOAD - to_world_log("Initializing objects") - admin_notice("Initializing objects", R_DEBUG) + atom_init_stage = INITIALIZATION_INNEW_MAPLOAD InitializeAtoms() return ..() -/datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms) - if(initialized == INITIALIZATION_INSSATOMS) +/datum/controller/subsystem/atoms/proc/InitializeAtoms(var/list/supplied_atoms) + + if(atom_init_stage <= INITIALIZATION_INSSATOMS_LATE) return - initialized = INITIALIZATION_INNEW_MAPLOAD + atom_init_stage = INITIALIZATION_INNEW_MAPLOAD LAZYINITLIST(late_loaders) - var/count var/list/mapload_arg = list(TRUE) - if(atoms) - created_atoms = list() - count = atoms.len - for(var/I in atoms) - var/atom/A = I + var/count = LAZYLEN(supplied_atoms) + if(count) + while(supplied_atoms.len) + var/atom/A = supplied_atoms[supplied_atoms.len] + supplied_atoms.len-- if(!A.initialized) - if(InitAtom(I, mapload_arg)) - atoms -= I + InitAtom(A, GetArguments(A, mapload_arg)) CHECK_TICK - else - count = 0 - for(var/atom/A in world) // This must be world, since this operation adds all the atoms to their specific lists. + else if(!subsystem_initialized) + // If wondering why not just store all atoms in a list and use the block above: that turns out unbearably expensive. + // Instead, atoms without extra arguments in New created on server start are fished out of world directly. + // We do this exactly once. + + for(var/atom/A in world) if(!A.initialized) - InitAtom(A, mapload_arg) + InitAtom(A, GetArguments(A, mapload_arg, FALSE)) ++count CHECK_TICK - log_world("Initialized [count] atoms") + report_progress("Initialized [count] atom\s") - initialized = INITIALIZATION_INNEW_REGULAR + atom_init_stage = INITIALIZATION_INNEW_REGULAR if(late_loaders.len) for(var/I in late_loaders) var/atom/A = I - A.LateInitialize() - CHECK_TICK - testing("Late initialized [late_loaders.len] atoms") + A.LateInitialize(arglist(late_loaders[A])) + report_progress("Late initialized [late_loaders.len] atom\s") late_loaders.Cut() - // Nothing ever checks return value of this proc, so don't bother. If this ever changes fix code in /atom/New() ~Leshana - // if(atoms) - // . = created_atoms + atoms - // created_atoms = null - /datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments) + LAZYREMOVE(global.pre_init_created_atoms, A) var/the_type = A.type if(QDELING(A)) BadInitializeCalls[the_type] |= BAD_INIT_QDEL_BEFORE @@ -90,9 +86,9 @@ SUBSYSTEM_DEF(atoms) switch(result) if(INITIALIZE_HINT_LATELOAD) if(arguments[1]) //mapload - late_loaders += A + late_loaders[A] = arguments else - A.LateInitialize() + A.LateInitialize(arglist(arguments)) if(INITIALIZE_HINT_QDEL) qdel(A) qdeleted = TRUE @@ -106,18 +102,37 @@ SUBSYSTEM_DEF(atoms) return qdeleted || QDELING(A) +// override and GetArguments() exists for mod-override/downstream hook functionality. +// Useful for total-overhaul type modifications. +/atom/proc/AdjustInitializeArguments(list/arguments) + // Lists are passed by reference so can simply modify the arguments list without returning it + +/datum/controller/subsystem/atoms/proc/GetArguments(atom/A, list/mapload_arg, created=TRUE) + if(!created && !adjust_init_arguments) + return mapload_arg // Performance optimization. Nothing to do. + var/list/arguments = mapload_arg.Copy() + var/extra_args = LAZYACCESS(global.pre_init_created_atoms, A) + if(created && extra_args) + arguments += extra_args + if(adjust_init_arguments) + A.AdjustInitializeArguments(arguments) + return arguments + +/datum/controller/subsystem/atoms/stat_entry(msg) + ..("Bad Initialize Calls:[BadInitializeCalls.len]") + /datum/controller/subsystem/atoms/proc/map_loader_begin() - old_initialized = initialized - initialized = INITIALIZATION_INSSATOMS + old_init_stage = atom_init_stage + atom_init_stage = INITIALIZATION_INSSATOMS_LATE /datum/controller/subsystem/atoms/proc/map_loader_stop() - initialized = old_initialized + atom_init_stage = old_init_stage /datum/controller/subsystem/atoms/Recover() - initialized = SSatoms.initialized - if(initialized == INITIALIZATION_INNEW_MAPLOAD) + atom_init_stage = SSatoms.atom_init_stage + if(atom_init_stage == INITIALIZATION_INNEW_MAPLOAD) InitializeAtoms() - old_initialized = SSatoms.old_initialized + old_init_stage = SSatoms.old_init_stage BadInitializeCalls = SSatoms.BadInitializeCalls /datum/controller/subsystem/atoms/proc/InitLog() diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index 59cc936da6..cb686e5030 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -26,6 +26,10 @@ SUBSYSTEM_DEF(mapping) maploader = new() load_map_templates() + #if UNIT_TEST + config.generate_map = TRUE + #endif + if(config.generate_map) // Load the engine and other submaps. load_static_submaps(static_submap_landmarks) diff --git a/code/controllers/subsystems/open_space.dm b/code/controllers/subsystems/open_space.dm index 4e96dbfda4..735a221f56 100644 --- a/code/controllers/subsystems/open_space.dm +++ b/code/controllers/subsystems/open_space.dm @@ -87,17 +87,6 @@ SUBSYSTEM_DEF(open_space) // log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src].update_icon()") SSopen_space.add_turf(T, 1) -// Ouch... this is painful. But is there any other way? -/* - No for now -/obj/New() - . = ..() - if(open_space_initialised && !invisibility) - var/turf/T = GetAbove(src) - if(isopenspace(T)) - // log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src]New()") - OS_controller.add_turf(T, 1) -*/ - // We probably should hook Destroy() If we can think of something more efficient, lets hear it. /obj/Destroy() if(GLOB.open_space_initialised && !invisibility && isturf(loc)) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index 12609a2eee..a11ab41f23 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -425,7 +425,7 @@ var/global/datum/controller/subsystem/ticker/ticker if(new_char) qdel(player) if(new_char.client) - var/obj/screen/splash/S = new(new_char.client, TRUE) + var/obj/screen/splash/S = new(null, new_char.client, TRUE) S.Fade(TRUE) // If they're a carbon, they can get manifested diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index df1aa91ea3..ddde7224c8 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -6,8 +6,9 @@ name = "Initializing..." var/target -/obj/effect/statclick/New(loc, text, target) //Don't port this to Initialize it's too critical - ..() +INITIALIZE_IMMEDIATE(/obj/effect/statclick) +/obj/effect/statclick/Initialize(ml, text, target) + . = ..(ml) name = text src.target = target diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index d4d71d5f3c..c6cf642f8a 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -344,7 +344,7 @@ amt-- // Prepare to stuff inside product, don't delete it - if(is_path_in_list(path_key, parts)) + if(is_path_in_list(path_key, R.parts)) parts["items"] += I amt_to_transfer-- continue diff --git a/code/datums/outfits/costumes/halloween.dm b/code/datums/outfits/costumes/halloween.dm index 807c964a98..f6651d733a 100644 --- a/code/datums/outfits/costumes/halloween.dm +++ b/code/datums/outfits/costumes/halloween.dm @@ -25,8 +25,7 @@ var/obj/item/weapon/storage/briefcase/new_briefcase = new(H) for(var/obj/item/briefcase_item in new_briefcase) qdel(briefcase_item) - new_briefcase.contents += new /obj/item/toy/crossbow - new_briefcase.contents += new /obj/item/weapon/gun/projectile/revolver/capgun + new_briefcase.contents += new /obj/item/weapon/gun/projectile/pistol/toy new_briefcase.contents += new /obj/item/clothing/mask/gas/clown_hat H.equip_to_slot_or_del(new_briefcase, slot_l_hand) @@ -103,7 +102,7 @@ suit = /obj/item/clothing/suit/storage/toggle/brown_jacket/sleeveless shoes = /obj/item/clothing/shoes/boots/jackboots gloves = /obj/item/clothing/gloves/fingerless - l_pocket = /obj/item/toy/crossbow + l_pocket = /obj/item/weapon/gun/projectile/revolver/toy/crossbow r_pocket = /obj/item/device/flashlight/color/red /decl/hierarchy/outfit/costume/pirate @@ -120,4 +119,12 @@ shoes = /obj/item/clothing/shoes/white suit = /obj/item/clothing/suit/storage/hooded/chaplain_hoodie/whiteout gloves = /obj/item/clothing/gloves/white - mask = /obj/item/clothing/mask/surgical \ No newline at end of file + mask = /obj/item/clothing/mask/surgical + +/decl/hierarchy/outfit/costume/marine + name = OUTFIT_COSTUME("Ruin Marine") + uniform = /obj/item/clothing/under/color/grey + shoes = /obj/item/clothing/shoes/brown + head = /obj/item/clothing/head/marine + suit = /obj/item/clothing/suit/marine + r_hand = /obj/item/weapon/gun/projectile/revolver/toy/sawnoff \ No newline at end of file diff --git a/code/datums/outfits/jobs/engineering.dm b/code/datums/outfits/jobs/engineering.dm index a2aba61a96..86bf9fa8cf 100644 --- a/code/datums/outfits/jobs/engineering.dm +++ b/code/datums/outfits/jobs/engineering.dm @@ -1,6 +1,6 @@ /decl/hierarchy/outfit/job/engineering hierarchy_type = /decl/hierarchy/outfit/job/engineering - belt = /obj/item/weapon/storage/belt/utility/full + belt = /obj/item/weapon/storage/belt/utility/full/multitool l_ear = /obj/item/device/radio/headset/headset_eng shoes = /obj/item/clothing/shoes/boots/workboots r_pocket = /obj/item/device/t_scanner diff --git a/code/datums/outfits/jobs/science.dm b/code/datums/outfits/jobs/science.dm index 7f0853b41c..4a6392d61f 100644 --- a/code/datums/outfits/jobs/science.dm +++ b/code/datums/outfits/jobs/science.dm @@ -33,7 +33,7 @@ name = OUTFIT_JOB_NAME("Roboticist") uniform = /obj/item/clothing/under/rank/roboticist shoes = /obj/item/clothing/shoes/black - belt = /obj/item/weapon/storage/belt/utility/full + belt = /obj/item/weapon/storage/belt/utility/full/multitool id_type = /obj/item/weapon/card/id/science pda_slot = slot_r_store pda_type = /obj/item/device/pda/roboticist diff --git a/code/datums/supplypacks/recreation.dm b/code/datums/supplypacks/recreation.dm index a3b6ad30d5..2ce0248e0d 100644 --- a/code/datums/supplypacks/recreation.dm +++ b/code/datums/supplypacks/recreation.dm @@ -23,6 +23,13 @@ containertype = /obj/structure/closet/crate/allico containername = "foam weapon crate" +/datum/supply_pack/recreation/donksoftvend + name = "Donk-Soft Vendor Crate" + contains = list() + cost = 75 + containertype = /obj/structure/largecrate/donksoftvendor + containername = "\improper Donk-Soft vendor crate" + /datum/supply_pack/recreation/lasertag name = "Lasertag equipment" contains = list( diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 6ad710e976..26531d1eb2 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -47,9 +47,9 @@ /obj/item/weapon/soap/deluxe icon_state = "soapdeluxe" -/obj/item/weapon/soap/deluxe/New() +/obj/item/weapon/soap/deluxe/Initialize() desc = "A deluxe Waffle Co. brand bar of soap. Smells of [pick("lavender", "vanilla", "strawberry", "chocolate" ,"space")]." - ..() + . = ..() /obj/item/weapon/soap/syndie desc = "An untrustworthy bar of soap. Smells of fear." @@ -363,10 +363,10 @@ drop_sound = 'sound/items/drop/component.ogg' pickup_sound = 'sound/items/pickup/component.ogg' -/obj/item/weapon/stock_parts/New() +/obj/item/weapon/stock_parts/Initialize() src.pixel_x = rand(-5.0, 5) src.pixel_y = rand(-5.0, 5) - ..() + . = ..() /obj/item/weapon/stock_parts/get_rating() return rating @@ -390,7 +390,7 @@ var/charge = 0 var/max_charge = 1000 -/obj/item/weapon/stock_parts/capacitor/New() +/obj/item/weapon/stock_parts/capacitor/Initialize() . = ..() max_charge *= rating diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 154f496be1..7d27dda017 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -1831,24 +1831,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "Tactical" ambience = AMBIENCE_HIGHSEC - -/* - New() - ..() - - spawn(10) //let objects set up first - for(var/turf/turfToGrayscale in src) - if(turfToGrayscale.icon) - var/icon/newIcon = icon(turfToGrayscale.icon) - newIcon.GrayScale() - turfToGrayscale.icon = newIcon - for(var/obj/objectToGrayscale in turfToGrayscale) //1 level deep, means tables, apcs, locker, etc, but not locker contents - if(objectToGrayscale.icon) - var/icon/newIcon = icon(objectToGrayscale.icon) - newIcon.GrayScale() - objectToGrayscale.icon = newIcon -*/ - /area/security/nuke_storage name = "\improper Vault" icon_state = "nuke_storage" diff --git a/code/game/area/ai_monitored.dm b/code/game/area/ai_monitored.dm index 84f2c8eb4e..fc218150d5 100644 --- a/code/game/area/ai_monitored.dm +++ b/code/game/area/ai_monitored.dm @@ -2,17 +2,12 @@ name = "AI Monitored Area" var/obj/machinery/camera/motioncamera = null - -/area/ai_monitored/New() - ..() - // locate and store the motioncamera - spawn (20) // spawn on a delay to let turfs/objs load - for (var/obj/machinery/camera/M in src) - if(M.isMotion()) - motioncamera = M - M.area_motion = src - return - return +/area/ai_monitored/LateInitialize() + . = ..() + for(var/obj/machinery/camera/M in src) + if(M.isMotion()) + motioncamera = M + M.area_motion = src /area/ai_monitored/Entered(atom/movable/O) ..() @@ -22,5 +17,3 @@ /area/ai_monitored/Exited(atom/movable/O) if (ismob(O) && motioncamera) motioncamera.lostTarget(O) - - diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index a54cf6c1f4..b14e4d5719 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -19,7 +19,7 @@ var/debug = 0 var/requires_power = 1 - var/always_unpowered = 0 //this gets overriden to 1 for space in area/New() + var/always_unpowered = 0 //this gets overriden to 1 for space in area/Initialize() // Power channel status - Is it currently energized? var/power_equip = TRUE @@ -52,10 +52,13 @@ var/no_spoilers = FALSE // If true, makes it much more difficult to see what is inside an area with things like mesons. var/soundproofed = FALSE // If true, blocks sounds from other areas and prevents hearers on other areas from hearing the sounds within. +/area/New() + icon_state = "" + luminosity = !dynamic_lighting + ..() + /area/Initialize() . = ..() - luminosity = !(dynamic_lighting) - icon_state = "" return INITIALIZE_HINT_LATELOAD // Areas tradiationally are initialized AFTER other atoms. /area/LateInitialize() @@ -67,6 +70,10 @@ if(no_spoilers) set_spoiler_obfuscation(TRUE) + icon = 'icons/turf/areas.dmi' + icon_state = "white" + blend_mode = BLEND_MULTIPLY + // Changes the area of T to A. Do not do this manually. // Area is expected to be a non-null instance. /proc/ChangeArea(var/turf/T, var/area/A) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 2a765f34e5..29632a7bfb 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -43,27 +43,22 @@ /// The chat color var, without alpha. var/chat_color_hover +var/global/list/pre_init_created_atoms // atom creation ordering means some stuff is trying to init before SSatoms exists, temp workaround /atom/New(loc, ...) - // Don't call ..() unless /datum/New() ever exists - - // During dynamic mapload (reader.dm) this assigns the var overrides from the .dmm file - // Native BYOND maploading sets those vars before invoking New(), by doing this FIRST we come as close to that behavior as we can. - if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() - _preloader.load(src) - - // Pass our arguments to InitAtom so they can be passed to initialize(), but replace 1st with if-we're-during-mapload. - var/do_initialize = SSatoms.initialized - if(do_initialize > INITIALIZATION_INSSATOMS) - args[1] = (do_initialize == INITIALIZATION_INNEW_MAPLOAD) - if(SSatoms.InitAtom(src, args)) - // We were deleted. No sense continuing - return - - // Uncomment if anything ever uses the return value of SSatoms.InitializeAtoms ~Leshana - // If a map is being loaded, it might want to know about newly created objects so they can be handled. - // var/list/created = SSatoms.created_atoms - // if(created) - // created += src + //atom creation method that preloads variables at creation + if(global.use_preloader && (src.type == global._preloader.target_path))//in case the instanciated atom is creating other atoms in New() + global._preloader.load(src) + + var/do_initialize = SSatoms?.atom_init_stage + if(do_initialize > INITIALIZATION_INSSATOMS_LATE) + args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD + SSatoms.InitAtom(src, args) + else + var/list/argument_list + if(length(args) > 1) + argument_list = args.Copy(2) + if(length(argument_list)) + LAZYSET(global.pre_init_created_atoms, src, argument_list) // Note: I removed "auto_init" feature (letting types disable auto-init) since it shouldn't be needed anymore. // You can replicate the same by checking the value of the first parameter to initialize() ~Leshana @@ -75,6 +70,8 @@ // Other parameters are passed from New (excluding loc), this does not happen if mapload is TRUE // Must return an Initialize hint. Defined in code/__defines/subsystems.dm /atom/proc/Initialize(mapload, ...) + SHOULD_CALL_PARENT(TRUE) + SHOULD_NOT_SLEEP(TRUE) if(QDELETED(src)) crash_with("GC: -- [type] had initialize() called after qdel() --") if(initialized) @@ -111,6 +108,8 @@ /atom/proc/Bumped(AM as mob|obj) set waitfor = FALSE + SEND_SIGNAL(src, COMSIG_ATOM_BUMPED, AM) + // Convenience proc to see if a container is open for chemistry handling // returns true if open // false if closed @@ -157,6 +156,9 @@ return /atom/proc/bullet_act(obj/item/projectile/P, def_zone) + if(SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone) & COMPONENT_CANCEL_ATTACK_CHAIN) + return + P.on_hit(src, 0, def_zone) . = 0 @@ -237,8 +239,8 @@ . = new_dir != dir dir = new_dir -/atom/proc/ex_act() - return +/atom/proc/ex_act(var/strength = 3) + return (SEND_SIGNAL(src, COMSIG_ATOM_EX_ACT, strength, src) & COMPONENT_IGNORE_EXPLOSION) /atom/proc/emag_act(var/remaining_charges, var/mob/user, var/emag_source) return -1 diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 2a2a4e93a6..0f86402b84 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -60,6 +60,9 @@ if(!loc || !newloc) return FALSE + if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, newloc, direct, movetime) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE) + return FALSE + // Store this early before we might move, it's used several places var/atom/oldloc = loc @@ -205,6 +208,9 @@ if(riding_datum) riding_datum.handle_vehicle_layer() riding_datum.handle_vehicle_offsets() + + SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, old_loc, direction) + return TRUE /atom/movable/set_dir(newdir) @@ -247,6 +253,9 @@ throwing = 0 if(QDELETED(A)) return + + SEND_SIGNAL(src, COMSIG_MOVABLE_BUMP, A) + A.Bumped(src) A.last_bumped = world.time @@ -404,6 +413,7 @@ src.throw_impact(A,speed) /atom/movable/proc/throw_at(atom/target, range, speed, thrower) + set waitfor = FALSE if(!target || !src) return 0 if(target.z != src.z) @@ -495,10 +505,10 @@ var/atom/master = null anchored = 1 -/atom/movable/overlay/New() +/atom/movable/overlay/Initialize() for(var/x in src.verbs) src.verbs -= x - ..() + . = ..() /atom/movable/overlay/attackby(a, b) if (src.master) diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index f6d6695b19..64b469706f 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -88,7 +88,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E verbs.Add(P.verbpath) if(P.make_hud_button) if(!src.ability_master) - src.ability_master = new /obj/screen/movable/ability_master(src) + src.ability_master = new /obj/screen/movable/ability_master(null, src) src.ability_master.add_ling_ability( object_given = src, verb_given = P.verbpath, @@ -102,7 +102,8 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E var/mob/living/carbon/human/H = src if(istype(H)) - var/datum/absorbed_dna/newDNA = new(H.real_name, H.dna, H.species.name, H.languages, H.identifying_gender, H.flavor_texts) + var/saved_dna = H.dna.Clone() /// Prevent transform from breaking. + var/datum/absorbed_dna/newDNA = new(H.real_name, saved_dna, H.species.name, H.languages, H.identifying_gender, H.flavor_texts, H.modifiers) absorbDNA(newDNA) return 1 diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index c6af89ad75..a010028270 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -344,7 +344,7 @@ var/list/datum/power/changeling/powerinstances = list() if(Thepower.make_hud_button && Thepower.isVerb) if(!M.current.ability_master) - M.current.ability_master = new /obj/screen/movable/ability_master(M.current) + M.current.ability_master = new /obj/screen/movable/ability_master(null, M.current) M.current.ability_master.add_ling_ability( object_given = M.current, verb_given = Thepower.verbpath, diff --git a/code/game/gamemodes/changeling/powers/armblade.dm b/code/game/gamemodes/changeling/powers/armblade.dm index 4a84fde371..0652280ce7 100644 --- a/code/game/gamemodes/changeling/powers/armblade.dm +++ b/code/game/gamemodes/changeling/powers/armblade.dm @@ -65,8 +65,8 @@ defend_chance = 40 // The base chance for the weapon to parry. projectile_parry_chance = 15 // The base chance for a projectile to be deflected. -/obj/item/weapon/melee/changeling/New(location) - ..() +/obj/item/weapon/melee/changeling/Initialize() + . = ..() START_PROCESSING(SSobj, src) if(ismob(loc)) visible_message("A grotesque weapon forms around [loc.name]\'s arm!", @@ -88,11 +88,6 @@ creator = null ..() -/obj/item/weapon/melee/changeling/suicide_act(mob/user) - var/datum/gender/T = gender_datums[user.get_visible_gender()] - user.visible_message("[user] is impaling [T.himself] with the [src.name]! It looks like [T.he] [T.is] trying to commit suicide.") - return(BRUTELOSS) - /obj/item/weapon/melee/changeling/process() //Stolen from ninja swords. if(!creator || loc != creator || !creator.item_is_in_hands(src)) // Tidy up a bit. diff --git a/code/game/gamemodes/changeling/powers/armor.dm b/code/game/gamemodes/changeling/powers/armor.dm index aa6e2bf0b0..a6928dff2a 100644 --- a/code/game/gamemodes/changeling/powers/armor.dm +++ b/code/game/gamemodes/changeling/powers/armor.dm @@ -41,8 +41,8 @@ armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) //No armor at all. canremove = 0 -/obj/item/clothing/suit/space/changeling/New() - ..() +/obj/item/clothing/suit/space/changeling/Initialize() + . = ..() if(ismob(loc)) loc.visible_message("[loc.name]\'s flesh rapidly inflates, forming a bloated mass around their body!", "We inflate our flesh, creating a spaceproof suit!", @@ -105,8 +105,8 @@ max_heat_protection_temperature = FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE slowdown = 1.5 -/obj/item/clothing/suit/space/changeling/armored/New() - ..() +/obj/item/clothing/suit/space/changeling/armored/Initialize() + . = ..() if(ismob(loc)) loc.visible_message("[loc.name]\'s flesh turns black, quickly transforming into a hard, chitinous mass!", "We harden our flesh, creating a suit of armor!", diff --git a/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm b/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm index ca92d67ff7..d35a2f2161 100644 --- a/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm +++ b/code/game/gamemodes/changeling/powers/bioelectrogenesis.dm @@ -113,7 +113,8 @@ agony_amount = 80 electrocute_amount = 20 -/obj/item/weapon/electric_hand/New() +/obj/item/weapon/electric_hand/Initialize() + . = ..() if(ismob(loc)) visible_message("Electrical arcs form around [loc.name]\'s hand!", "We store a charge of electricity in our hand.", diff --git a/code/game/gamemodes/changeling/powers/electric_lockpick.dm b/code/game/gamemodes/changeling/powers/electric_lockpick.dm index 262d90429f..40ba101f4e 100644 --- a/code/game/gamemodes/changeling/powers/electric_lockpick.dm +++ b/code/game/gamemodes/changeling/powers/electric_lockpick.dm @@ -32,7 +32,8 @@ icon_state = "electric_hand" show_examine = FALSE -/obj/item/weapon/finger_lockpick/New() +/obj/item/weapon/finger_lockpick/Initialize() + . = ..() if(ismob(loc)) to_chat(loc, "We shape our finger to fit inside electronics, and are ready to force them open.") diff --git a/code/game/gamemodes/changeling/powers/extract_dna_sting.dm b/code/game/gamemodes/changeling/powers/extract_dna_sting.dm index 35ce94daf0..baf80140f1 100644 --- a/code/game/gamemodes/changeling/powers/extract_dna_sting.dm +++ b/code/game/gamemodes/changeling/powers/extract_dna_sting.dm @@ -37,7 +37,8 @@ add_attack_logs(src,T,"DNA extraction sting (changeling)") - var/datum/absorbed_dna/newDNA = new(T.real_name, T.dna, T.species.name, T.languages) + var/saved_dna = T.dna.Clone() /// Prevent transforming bugginess. + var/datum/absorbed_dna/newDNA = new(T.real_name, saved_dna, T.species.name, T.languages, T.identifying_gender, T.flavor_text, T.modifiers) absorbDNA(newDNA) feedback_add_details("changeling_powers","ED") diff --git a/code/game/gamemodes/changeling/powers/fabricate_clothing.dm b/code/game/gamemodes/changeling/powers/fabricate_clothing.dm index b90b402e78..04a09d65d1 100644 --- a/code/game/gamemodes/changeling/powers/fabricate_clothing.dm +++ b/code/game/gamemodes/changeling/powers/fabricate_clothing.dm @@ -264,12 +264,10 @@ var/global/list/changeling_fabricated_clothing = list( access = null canremove = 0 -/obj/item/weapon/card/id/syndicate/changeling/New(mob/user as mob) - ..() - registered_user = user - /obj/item/weapon/card/id/syndicate/changeling/Initialize() . = ..() + if(ismob(loc)) + registered_user = loc access = null /obj/item/weapon/card/id/syndicate/changeling/verb/shred() diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm index 29361f9741..408b11d09b 100644 --- a/code/game/gamemodes/cult/construct_spells.dm +++ b/code/game/gamemodes/cult/construct_spells.dm @@ -439,16 +439,9 @@ toggled = 0 // Mainly used for overlays. cooldown = 0 // If set, will add a cooldown overlay and adjust click delay. Must be a multiple of 5 for overlays. cast_sound = null // Sound file played when this is used. + needs_core = FALSE // Does not need a core. var/last_castcheck = null // The last time this spell was cast. -/obj/item/weapon/spell/construct/New() - //..() //This kills the spell, because super on this calls the default spell's New, which checks for a core. Can't have that. - if(isliving(loc)) - owner = loc - if(!owner) - qdel(src) - update_icon() - /obj/item/weapon/spell/construct/adjust_instability(var/amount) //The only drawback to the boons of the geometer is the use of a mortal's blood as fuel. Constructs have already paid that price long ago. return diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index 241d613275..601a891707 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -154,6 +154,7 @@ return /obj/effect/gateway/active/Initialize() + . = ..() addtimer(CALLBACK(src, .proc/spawn_and_qdel), rand(30, 60) SECONDS) /obj/effect/gateway/active/proc/spawn_and_qdel() diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index 58684bb2a2..8e95c4c43a 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -16,8 +16,8 @@ var/global/list/narsie_list = list() consume_range = 3 //How many tiles out do we eat -/obj/singularity/narsie/New() - ..() +/obj/singularity/narsie/Initialize() + . = ..() narsie_list.Add(src) /obj/singularity/narsie/Destroy() @@ -40,8 +40,8 @@ var/global/list/narsie_list = list() var/announce=1 var/cause_hell = 1 -/obj/singularity/narsie/large/New() - ..() +/obj/singularity/narsie/large/Initialize() + . = ..() if(announce) to_world("[uppertext(name)] HAS RISEN") world << sound('sound/effects/weather/wind/wind_5_1.ogg') @@ -358,6 +358,7 @@ var/global/list/narsie_list = list() consume(T) /obj/singularity/narsie/proc/narsie_spawn_animation() + set waitfor = FALSE icon = 'icons/obj/narsie_spawn_anim.dmi' dir = SOUTH move_self = 0 diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index 88da43257d..af29065f96 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -21,7 +21,7 @@ /turf/unsimulated/wall/supermatter/Destroy() STOP_PROCESSING(SSturfs, src) - ..() + return ..() /turf/unsimulated/wall/supermatter/process() // Only check infrequently. diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm index 996fc225b4..44b64b2691 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm @@ -14,9 +14,9 @@ consume_range = 6 -/obj/singularity/narsie/large/exit/New() - ..() - START_PROCESSING(SSobj, src) +/obj/singularity/narsie/large/exit/Initialize() + . = ..() + START_PROCESSING(SSobj, src) /obj/singularity/narsie/large/exit/update_icon() overlays = 0 diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm index a8b0071f65..0b2e8e660d 100644 --- a/code/game/gamemodes/events/black_hole.dm +++ b/code/game/gamemodes/events/black_hole.dm @@ -8,9 +8,9 @@ density = 0 anchored = 1 -/obj/effect/bhole/New() - spawn(4) - controller() +/obj/effect/bhole/Initialize() + . = ..() + addtimer(CALLBACK(src, .proc/controller), 4) /obj/effect/bhole/proc/controller() while(src) diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm index c34f370a33..8ab73bafc8 100644 --- a/code/game/gamemodes/events/holidays/Christmas.dm +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -23,9 +23,6 @@ desc = "Directions for use: Requires two people, one to pull each end." var/cracked = 0 -/obj/item/weapon/toy/xmas_cracker/New() - ..() - /obj/item/weapon/toy/xmas_cracker/attack(mob/target, mob/user) if( !cracked && (istype(target,/mob/living/silicon) || (istype(target,/mob/living/carbon/human) && !target.get_active_hand())) && target.stat == CONSCIOUS) target.visible_message("[user] and [target] pop \an [src]! *pop*", "You pull \an [src] with [target]! *pop*", "You hear a *pop*.") diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 18d90bc545..376388efeb 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -130,6 +130,7 @@ . = ..() z_original = z GLOB.meteor_list += src + SpinAnimation() /obj/effect/meteor/Move() if(z != z_original || loc == dest) @@ -151,10 +152,6 @@ GLOB.meteor_list -= src return ..() -/obj/effect/meteor/New() - ..() - SpinAnimation() - /obj/effect/meteor/Bump(atom/A) if(A) if(A.handle_meteor_impact(src)) // Used for special behaviour when getting hit specifically by a meteor, like a shield. diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index f86f89779b..beed8b6e21 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -62,8 +62,8 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - // Proc: New() // Parameters: 0 // Description: Sets up the catalog, as shown below. -/obj/item/weapon/technomancer_catalog/New() - ..() +/obj/item/weapon/technomancer_catalog/Initialize() + . = ..() set_up() // Proc: set_up() diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index a0d1d0d360..c181c4e438 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -36,8 +36,8 @@ var/list/wards_in_use = list() // Wards don't count against the cap for other summons. var/max_summons = 10 // Maximum allowed summoned entities. Some cores will have different caps. -/obj/item/weapon/technomancer_core/New() - ..() +/obj/item/weapon/technomancer_core/Initialize() + . = ..() START_PROCESSING(SSobj, src) /obj/item/weapon/technomancer_core/Destroy() @@ -141,9 +141,10 @@ var/obj/item/weapon/technomancer_core/core = null var/ability_icon_state = null -/obj/spellbutton/New(loc, var/path, var/new_name, var/new_icon_state) +/obj/spellbutton/Initialize(var/ml, var/path, var/new_name, var/new_icon_state) + . = ..() if(!path || !ispath(path)) - message_admins("ERROR: /obj/spellbutton/New() was not given a proper path!") + message_admins("ERROR: /obj/spellbutton/Initialize() was not given a proper path!") qdel(src) src.name = new_name src.spellpath = path diff --git a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm index 9d78afe0b2..26dda90524 100644 --- a/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm +++ b/code/game/gamemodes/technomancer/devices/gloves_of_regen.dm @@ -36,9 +36,9 @@ wearer.custom_pain("Your hands hurt like hell!",1) wearer = null -/obj/item/clothing/gloves/regen/New() +/obj/item/clothing/gloves/regen/Initialize() START_PROCESSING(SSobj, src) - ..() + . = ..() /obj/item/clothing/gloves/regen/Destroy() wearer = null diff --git a/code/game/gamemodes/technomancer/devices/shield_armor.dm b/code/game/gamemodes/technomancer/devices/shield_armor.dm index 7618708aad..6d667be001 100644 --- a/code/game/gamemodes/technomancer/devices/shield_armor.dm +++ b/code/game/gamemodes/technomancer/devices/shield_armor.dm @@ -24,8 +24,8 @@ var/datum/effect/effect/system/spark_spread/spark_system = null var/block_percentage = 75 -/obj/item/clothing/suit/armor/shield/New() - ..() +/obj/item/clothing/suit/armor/shield/Initialize() + . = ..() spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src) diff --git a/code/game/gamemodes/technomancer/equipment.dm b/code/game/gamemodes/technomancer/equipment.dm index b96895a644..b2a657e383 100644 --- a/code/game/gamemodes/technomancer/equipment.dm +++ b/code/game/gamemodes/technomancer/equipment.dm @@ -108,7 +108,7 @@ name = "hypo belt" desc = "A medical belt designed to carry autoinjectors and other medical equipment." -/obj/item/weapon/storage/belt/medical/technomancer/New() +/obj/item/weapon/storage/belt/medical/technomancer/Initialize() new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/brute(src) new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/burn(src) new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/toxin(src) @@ -117,7 +117,7 @@ new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/pain(src) new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ(src) new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat(src) - ..() + . = ..() /datum/technomancer/equipment/belt_of_holding name = "Belt of Holding" diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index 1c2ed98e36..d9017227ec 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -18,6 +18,7 @@ var/toggled = 0 // Mainly used for overlays. var/cooldown = 0 // If set, will add a cooldown overlay and adjust click delay. Must be a multiple of 5 for overlays. var/cast_sound = null // Sound file played when this is used. + var/needs_core = TRUE // Does this spell need a core to be usable? // Proc: on_use_cast() // Parameters: 1 (user - the technomancer casting the spell) @@ -110,18 +111,18 @@ // Proc: New() // Parameters: 0 // Description: Sets owner to equal its loc, links to the owner's core, then applies overlays if needed. -/obj/item/weapon/spell/New() - ..() +/obj/item/weapon/spell/Initialize() + . = ..() if(isliving(loc)) owner = loc if(owner) core = owner.get_technomancer_core() - if(!core) + if(!core && needs_core) to_chat(owner, "You need a Core to do that.") - qdel(src) - return -// if(istype(/obj/item/weapon/technomancer_core, owner.back)) -// core = owner.back + return INITIALIZE_HINT_QDEL + else + return INITIALIZE_HINT_QDEL + update_icon() // Proc: Destroy() diff --git a/code/game/gamemodes/technomancer/spells/aspect_aura.dm b/code/game/gamemodes/technomancer/spells/aspect_aura.dm index 0619f07ef6..85a3a4492e 100644 --- a/code/game/gamemodes/technomancer/spells/aspect_aura.dm +++ b/code/game/gamemodes/technomancer/spells/aspect_aura.dm @@ -41,8 +41,8 @@ aspect = ASPECT_CHROMATIC var/glow_color = "#FFFFFF" -/obj/item/weapon/spell/aura/New() - ..() +/obj/item/weapon/spell/aura/Initialize() + . = ..() set_light(7, 4, l_color = glow_color) START_PROCESSING(SSobj, src) diff --git a/code/game/gamemodes/technomancer/spells/aura/aura.dm b/code/game/gamemodes/technomancer/spells/aura/aura.dm index be986bb7ee..9bdffceac1 100644 --- a/code/game/gamemodes/technomancer/spells/aura/aura.dm +++ b/code/game/gamemodes/technomancer/spells/aura/aura.dm @@ -6,8 +6,8 @@ aspect = null var/glow_color = "#FFFFFF" -/obj/item/weapon/spell/aura/New() - ..() +/obj/item/weapon/spell/aura/Initialize() + . = ..() set_light(calculate_spell_power(7), calculate_spell_power(4), l_color = glow_color) START_PROCESSING(SSobj, src) log_and_message_admins("has started casting [src].") diff --git a/code/game/gamemodes/technomancer/spells/chroma.dm b/code/game/gamemodes/technomancer/spells/chroma.dm index b87a82a0ae..dff834f668 100644 --- a/code/game/gamemodes/technomancer/spells/chroma.dm +++ b/code/game/gamemodes/technomancer/spells/chroma.dm @@ -14,8 +14,8 @@ aspect = ASPECT_LIGHT var/color_to_use = "#FFFFFF" -/obj/item/weapon/spell/chroma/New() - ..() +/obj/item/weapon/spell/chroma/Initialize() + . = ..() set_light(6, 5, l_color = color_to_use) /obj/effect/temporary_effect/chroma diff --git a/code/game/gamemodes/technomancer/spells/energy_siphon.dm b/code/game/gamemodes/technomancer/spells/energy_siphon.dm index 9bf8dd578f..0b46dc8dee 100644 --- a/code/game/gamemodes/technomancer/spells/energy_siphon.dm +++ b/code/game/gamemodes/technomancer/spells/energy_siphon.dm @@ -20,8 +20,8 @@ var/list/things_to_siphon = list() //Things which are actually drained as a result of the above not being null. var/flow_rate = 1000 // Limits how much electricity can be drained per second. Measured by default in god knows what. -/obj/item/weapon/spell/energy_siphon/New() - ..() +/obj/item/weapon/spell/energy_siphon/Initialize() + . = ..() START_PROCESSING(SSobj, src) /obj/item/weapon/spell/energy_siphon/Destroy() diff --git a/code/game/gamemodes/technomancer/spells/flame_tongue.dm b/code/game/gamemodes/technomancer/spells/flame_tongue.dm index 9a52c5d82f..a0471fe4ad 100644 --- a/code/game/gamemodes/technomancer/spells/flame_tongue.dm +++ b/code/game/gamemodes/technomancer/spells/flame_tongue.dm @@ -14,8 +14,8 @@ aspect = ASPECT_FIRE var/obj/item/weapon/weldingtool/spell/welder = null -/obj/item/weapon/spell/flame_tongue/New() - ..() +/obj/item/weapon/spell/flame_tongue/Initialize() + . = ..() set_light(3, 2, l_color = "#FF6A00") visible_message("\The [loc]'s hand begins to emit a flame.") welder = new /obj/item/weapon/weldingtool/spell(src) diff --git a/code/game/gamemodes/technomancer/spells/insert/insert.dm b/code/game/gamemodes/technomancer/spells/insert/insert.dm index 9ac0295e2b..0d537b35a9 100644 --- a/code/game/gamemodes/technomancer/spells/insert/insert.dm +++ b/code/game/gamemodes/technomancer/spells/insert/insert.dm @@ -11,8 +11,8 @@ var/obj/item/weapon/inserted_spell/inserting = null var/allow_stacking = 0 -/obj/item/weapon/spell/insert/New() - ..() +/obj/item/weapon/spell/insert/Initialize() + . = ..() set_light(spell_light_range, spell_light_intensity, l_color = light_color) /obj/item/weapon/inserted_spell @@ -20,9 +20,9 @@ var/mob/living/host = null var/spell_power_at_creation = 1.0 // This is here because the spell object that made this object probably won't exist. -/obj/item/weapon/inserted_spell/New(var/newloc, var/user, var/obj/item/weapon/spell/insert/inserter) - ..(newloc) - host = newloc +/obj/item/weapon/inserted_spell/Initialize(var/ml, var/user, var/obj/item/weapon/spell/insert/inserter) + . = ..() + host = loc origin = user if(light_color) spawn(1) diff --git a/code/game/gamemodes/technomancer/spells/instability_tap.dm b/code/game/gamemodes/technomancer/spells/instability_tap.dm index ad2c72518b..e5a80fdafc 100644 --- a/code/game/gamemodes/technomancer/spells/instability_tap.dm +++ b/code/game/gamemodes/technomancer/spells/instability_tap.dm @@ -14,8 +14,8 @@ cast_methods = CAST_USE aspect = ASPECT_UNSTABLE -/obj/item/weapon/spell/instability_tap/New() - ..() +/obj/item/weapon/spell/instability_tap/Initialize() + . = ..() set_light(3, 2, l_color = "#FA58F4") /obj/item/weapon/spell/instability_tap/on_use_cast(mob/user) diff --git a/code/game/gamemodes/technomancer/spells/modifier/modifier.dm b/code/game/gamemodes/technomancer/spells/modifier/modifier.dm index 3ea278286e..f612f00d3f 100644 --- a/code/game/gamemodes/technomancer/spells/modifier/modifier.dm +++ b/code/game/gamemodes/technomancer/spells/modifier/modifier.dm @@ -9,8 +9,8 @@ var/spell_light_intensity = 2 var/spell_light_range = 3 -/obj/item/weapon/spell/modifier/New() - ..() +/obj/item/weapon/spell/modifier/Initialize() + . = ..() set_light(spell_light_range, spell_light_intensity, l_color = light_color) /obj/item/weapon/spell/modifier/on_melee_cast(atom/hit_atom, mob/user) diff --git a/code/game/gamemodes/technomancer/spells/phase_shift.dm b/code/game/gamemodes/technomancer/spells/phase_shift.dm index 7cee437685..0a64aec0b6 100644 --- a/code/game/gamemodes/technomancer/spells/phase_shift.dm +++ b/code/game/gamemodes/technomancer/spells/phase_shift.dm @@ -15,8 +15,8 @@ cast_methods = CAST_USE aspect = ASPECT_TELE -/obj/item/weapon/spell/phase_shift/New() - ..() +/obj/item/weapon/spell/phase_shift/Initialize() + . = ..() set_light(3, 2, l_color = "#FA58F4") /obj/effect/phase_shift @@ -28,8 +28,8 @@ /obj/effect/phase_shift/ex_act() return -/obj/effect/phase_shift/New() - ..() +/obj/effect/phase_shift/Initialize() + . = ..() set_light(3, 5, l_color = "#FA58F4") START_PROCESSING(SSobj, src) diff --git a/code/game/gamemodes/technomancer/spells/radiance.dm b/code/game/gamemodes/technomancer/spells/radiance.dm index d86428354e..80a7d76ec9 100644 --- a/code/game/gamemodes/technomancer/spells/radiance.dm +++ b/code/game/gamemodes/technomancer/spells/radiance.dm @@ -16,8 +16,8 @@ var/power = 250 toggled = 1 -/obj/item/weapon/spell/radiance/New() - ..() +/obj/item/weapon/spell/radiance/Initialize() + . = ..() set_light(7, 4, l_color = "#D9D900") START_PROCESSING(SSobj, src) log_and_message_admins("has casted [src].") diff --git a/code/game/gamemodes/technomancer/spells/reflect.dm b/code/game/gamemodes/technomancer/spells/reflect.dm index 07f3595eda..b5ca6047a4 100644 --- a/code/game/gamemodes/technomancer/spells/reflect.dm +++ b/code/game/gamemodes/technomancer/spells/reflect.dm @@ -16,8 +16,8 @@ var/damage_to_energy_multiplier = 60.0 //Determines how much energy to charge for blocking, e.g. 20 damage attack = 1200 energy cost var/datum/effect/effect/system/spark_spread/spark_system = null -/obj/item/weapon/spell/reflect/New() - ..() +/obj/item/weapon/spell/reflect/Initialize() + . = ..() set_light(3, 2, l_color = "#006AFF") spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src) diff --git a/code/game/gamemodes/technomancer/spells/shield.dm b/code/game/gamemodes/technomancer/spells/shield.dm index b11d5590b0..849ea56fbc 100644 --- a/code/game/gamemodes/technomancer/spells/shield.dm +++ b/code/game/gamemodes/technomancer/spells/shield.dm @@ -18,8 +18,8 @@ var/damage_to_energy_multiplier = 30.0 //Determines how much energy to charge for blocking, e.g. 20 damage attack = 600 energy cost var/datum/effect/effect/system/spark_spread/spark_system = null -/obj/item/weapon/spell/shield/New() - ..() +/obj/item/weapon/spell/shield/Initialize() + . = ..() set_light(3, 2, l_color = "#006AFF") spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src) diff --git a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm index d83602aa68..c28080043f 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm @@ -18,8 +18,8 @@ adjust_instability(4) ..() -/obj/item/weapon/spell/spawner/darkness/New() - ..() +/obj/item/weapon/spell/spawner/darkness/Initialize() + . = ..() set_light(6, -20, l_color = "#FFFFFF") /obj/effect/temporary_effect/darkness diff --git a/code/game/gamemodes/technomancer/spells/spawner/destablize.dm b/code/game/gamemodes/technomancer/spells/spawner/destablize.dm index aee8d2557b..59ccf41e5d 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/destablize.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/destablize.dm @@ -14,8 +14,8 @@ aspect = ASPECT_UNSTABLE spawner_type = /obj/effect/temporary_effect/destablize -/obj/item/weapon/spell/spawner/destablize/New() - ..() +/obj/item/weapon/spell/spawner/destablize/Initialize() + . = ..() set_light(3, 2, l_color = "#C26DDE") /obj/item/weapon/spell/spawner/destablize/on_ranged_cast(atom/hit_atom, mob/user) diff --git a/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm b/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm index b56ea64e9c..1594286377 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm @@ -13,8 +13,8 @@ aspect = ASPECT_EMP spawner_type = /obj/effect/temporary_effect/pulse/pulsar -/obj/item/weapon/spell/spawner/pulsar/New() - ..() +/obj/item/weapon/spell/spawner/pulsar/Initialize() + . = ..() set_light(3, 2, l_color = "#2ECCFA") /obj/item/weapon/spell/spawner/pulsar/on_ranged_cast(atom/hit_atom, mob/user) diff --git a/code/game/gamemodes/technomancer/spells/warp_strike.dm b/code/game/gamemodes/technomancer/spells/warp_strike.dm index 83a2336ab6..b0f7712cfa 100644 --- a/code/game/gamemodes/technomancer/spells/warp_strike.dm +++ b/code/game/gamemodes/technomancer/spells/warp_strike.dm @@ -14,8 +14,8 @@ aspect = ASPECT_TELE var/datum/effect/effect/system/spark_spread/sparks -/obj/item/weapon/spell/warp_strike/New() - ..() +/obj/item/weapon/spell/warp_strike/Initialize() + . = ..() sparks = new /datum/effect/effect/system/spark_spread() sparks.set_up(5, 0, src) sparks.attach(loc) diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index 596f078eca..2138298e6d 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -23,7 +23,10 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) economic_modifier = 20 minimum_character_age = 25 + min_age_by_species = list(SPECIES_HUMAN_VATBORN = 14) ideal_character_age = 70 // Old geezer captains ftw + ideal_age_by_species = list(SPECIES_HUMAN_VATBORN = 55) /// Vatborn live shorter, no other race eligible for captain besides human/skrell + banned_job_species = list(SPECIES_UNATHI, SPECIES_TAJ, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "mechanical", "digital") outfit_type = /decl/hierarchy/outfit/job/captain job_description = "The Site Manager manages the other Command Staff, and through them the rest of the station. Though they have access to everything, \ @@ -31,6 +34,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) have an understanding of Standard Operating Procedure, and is subject to it, and legal action, in the same way as every other crew member." alt_titles = list("Overseer"= /datum/alt_title/overseer) + /* /datum/job/captain/equip(var/mob/living/carbon/human/H) . = ..() @@ -66,7 +70,10 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) economic_modifier = 10 minimum_character_age = 25 + min_age_by_species = list(SPECIES_UNATHI = 70, SPECIES_TESHARI = 20, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 14) ideal_character_age = 50 + ideal_age_by_species = list(SPECIES_UNATHI = 140, SPECIES_TESHARI = 27, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20) + banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital", SPECIES_DIONA) outfit_type = /decl/hierarchy/outfit/job/hop job_description = "The Head of Personnel manages the Service department, the Exploration team, and most other civilians. They also \ diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index d08ba39915..10e231f10b 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -99,6 +99,7 @@ economic_modifier = 5 access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station) minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station) + banned_job_species = list("digital", SPECIES_PROMETHEAN) ideal_character_age = 40 @@ -231,6 +232,7 @@ access = list(access_lawyer, access_sec_doors, access_maint_tunnels, access_heads) minimal_access = list(access_lawyer, access_sec_doors, access_heads) minimal_player_age = 7 + banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_UNATHI, SPECIES_DIONA, SPECIES_TESHARI, SPECIES_ZADDAT, "digital") outfit_type = /decl/hierarchy/outfit/job/internal_affairs_agent job_description = "An Internal Affairs Agent makes sure that the crew is following Standard Operating Procedure. They also \ diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index ae937d106b..95bfd63f7f 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -17,7 +17,10 @@ economic_modifier = 10 minimum_character_age = 25 + min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 14) ideal_character_age = 50 + ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20) + banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital") access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, @@ -55,6 +58,7 @@ "Engine Technician" = /datum/alt_title/engine_tech, "Electrician" = /datum/alt_title/electrician) minimal_player_age = 3 + min_age_by_species = list(SPECIES_PROMETHEAN = 2) outfit_type = /decl/hierarchy/outfit/job/engineering/engineer job_description = "An Engineer keeps the station running. They repair damages, keep the atmosphere stable, and ensure that power is being \ @@ -94,6 +98,7 @@ minimal_access = list(access_eva, access_engine, access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction, access_external_airlocks) minimal_player_age = 3 + min_age_by_species = list(SPECIES_PROMETHEAN = 2) outfit_type = /decl/hierarchy/outfit/job/engineering/atmos job_description = "An Atmospheric Technician is primarily concerned with keeping the station's atmosphere breathable. They are expected to have a good \ diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index b78fc5f74a..007dcad8da 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -22,7 +22,10 @@ var/department_accounts = null // Which department accounts should people with this position be given the pin for? var/assignable = TRUE // Should it show up on things like the ID computer? var/minimum_character_age = 0 + var/list/min_age_by_species = null var/ideal_character_age = 30 + var/list/ideal_age_by_species = null + var/list/banned_job_species = null var/has_headset = TRUE //Do people with this job need to be given headsets and told how to use them? E.g. Cyborgs don't. var/account_allowed = 1 // Does this job type come with a station account? @@ -158,4 +161,20 @@ if(mannequin.back) var/obj/O = mannequin.back mannequin.drop_from_inventory(O) - qdel(O) \ No newline at end of file + qdel(O) + +///Assigns minimum age by race & brain type. Code says Positronic = mechanical and Drone = digital because nothing can be simple. +///Will first check based on brain type, then based on species. +/datum/job/proc/get_min_age(species_name, brain_type) + return (brain_type && LAZYACCESS(min_age_by_species, brain_type)) || LAZYACCESS(min_age_by_species, species_name) || minimum_character_age + +/datum/job/proc/get_ideal_age(species_name, brain_type) + return (brain_type && LAZYACCESS(ideal_age_by_species, brain_type)) || LAZYACCESS(ideal_age_by_species, brain_type) || ideal_character_age + +/datum/job/proc/is_species_banned(species_name, brain_type) + if(banned_job_species == null) + return + if(species_name in banned_job_species) + return TRUE + if(brain_type in banned_job_species) + return TRUE \ No newline at end of file diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index e74b0798b6..7594ade21f 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -23,8 +23,11 @@ access_keycard_auth, access_sec_doors, access_psychiatrist, access_eva, access_external_airlocks, access_maint_tunnels) minimum_character_age = 25 + min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 14) minimal_player_age = 10 ideal_character_age = 50 + ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20) + banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital") outfit_type = /decl/hierarchy/outfit/job/medical/cmo job_description = "The CMO manages the Medical department and is a position requiring experience and skill; their goal is to ensure that their \ @@ -58,6 +61,8 @@ "Nurse" = /datum/alt_title/nurse, "Virologist" = /datum/alt_title/virologist) + min_age_by_species = list(SPECIES_PROMETHEAN = 3) + //Medical Doctor Alt Titles /datum/alt_title/surgeon title = "Surgeon" @@ -103,6 +108,7 @@ access = list(access_medical, access_medical_equip, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics) minimal_access = list(access_medical, access_medical_equip, access_chemistry) minimal_player_age = 3 + min_age_by_species = list(SPECIES_PROMETHEAN = 3) outfit_type = /decl/hierarchy/outfit/job/medical/chemist job_description = "A Chemist produces and maintains a stock of basic to advanced chemicals for medical and occasionally research use. \ @@ -157,6 +163,7 @@ job_description = "A Psychiatrist provides mental health services to crew members in need. They may also be called upon to determine whatever \ ails the mentally unwell, frequently under Security supervision. They understand the effects of various psychoactive drugs." alt_titles = list("Psychologist" = /datum/alt_title/psychologist) + banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_DIONA) //Psychiatrist Alt Titles /datum/alt_title/psychologist @@ -185,6 +192,9 @@ job_description = "A Paramedic is primarily concerned with the recovery of patients who are unable to make it to the Medical Department on their own. \ They may also be called upon to keep patients stable when Medical is busy or understaffed." alt_titles = list("Emergency Medical Technician" = /datum/alt_title/emt) + banned_job_species = list(SPECIES_DIONA) + + min_age_by_species = list(SPECIES_PROMETHEAN = 2) // Paramedic Alt Titles /datum/alt_title/emt diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 4edc848d0e..989c13092a 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -26,7 +26,10 @@ minimum_character_age = 25 minimal_player_age = 14 + min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 14) ideal_character_age = 50 + ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20) + banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital") outfit_type = /decl/hierarchy/outfit/job/science/rd job_description = "The Research Director manages and maintains the Research department. They are required to ensure the safety of the entire crew, \ @@ -35,6 +38,7 @@ are encouraged to allow their staff to perform their own duties." alt_titles = list("Research Supervisor" = /datum/alt_title/research_supervisor) + // Research Director Alt Titles /datum/alt_title/research_supervisor title = "Research Supervisor" @@ -55,6 +59,8 @@ economic_modifier = 7 access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_xenoarch) minimal_access = list(access_tox, access_tox_storage, access_research, access_xenoarch) + min_age_by_species = list(SPECIES_PROMETHEAN = 2) + banned_job_species = list("digital") minimal_player_age = 14 @@ -98,8 +104,10 @@ economic_modifier = 7 access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_hydroponics) minimal_access = list(access_research, access_xenobiology, access_hydroponics, access_tox_storage) + banned_job_species = list("digital") minimal_player_age = 14 + min_age_by_species = list(SPECIES_PROMETHEAN = 2) outfit_type = /decl/hierarchy/outfit/job/science/xenobiologist job_description = "A Xenobiologist studies esoteric lifeforms, usually in the relative safety of their lab. They attempt to find ways to benefit \ @@ -129,6 +137,8 @@ access = list(access_robotics, access_tox, access_tox_storage, access_tech_storage, access_morgue, access_research) //As a job that handles so many corpses, it makes sense for them to have morgue access. minimal_access = list(access_robotics, access_tech_storage, access_morgue, access_research) //As a job that handles so many corpses, it makes sense for them to have morgue access. minimal_player_age = 7 + min_age_by_species = list(SPECIES_PROMETHEAN = 2) + banned_job_species = list("digital") outfit_type = /decl/hierarchy/outfit/job/science/roboticist job_description = "A Roboticist maintains and repairs the station's synthetics, including crew with prosthetic limbs. \ diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 52f0d71006..3f751dd9e3 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -24,7 +24,11 @@ access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting, access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_external_airlocks) minimum_character_age = 25 + min_age_by_species = list(SPECIES_HUMAN_VATBORN = 14) minimal_player_age = 14 + ideal_character_age = 50 + ideal_age_by_species = list(SPECIES_HUMAN_VATBORN = 20) + banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital", SPECIES_UNATHI, "mechanical") outfit_type = /decl/hierarchy/outfit/job/security/hos job_description = " The Head of Security manages the Security Department, keeping the station safe and making sure the rules are followed. They are expected to \ @@ -32,6 +36,7 @@ perform the duties of absent Security roles, such as distributing gear from the Armory." alt_titles = list("Security Commander" = /datum/alt_title/sec_commander, "Chief of Security" = /datum/alt_title/sec_chief) + // Head of Security Alt Titles /datum/alt_title/sec_commander title = "Security Commander" @@ -57,6 +62,7 @@ access = list(access_security, access_eva, access_sec_doors, access_brig, access_armory, access_maint_tunnels, access_morgue, access_external_airlocks) minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_armory, access_maint_tunnels, access_external_airlocks) minimal_player_age = 5 + banned_job_species = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN, SPECIES_TESHARI, SPECIES_DIONA) outfit_type = /decl/hierarchy/outfit/job/security/warden job_description = "The Warden watches over the physical Security Department, making sure the Brig and Armoury are secure and in order at all times. They oversee \ @@ -81,6 +87,7 @@ minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_eva, access_external_airlocks) economic_modifier = 5 minimal_player_age = 3 + banned_job_species = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN, SPECIES_DIONA) outfit_type = /decl/hierarchy/outfit/job/security/detective job_description = "A Detective works to help Security find criminals who have not properly been identified, through interviews and forensic work. \ @@ -110,6 +117,7 @@ access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_morgue, access_external_airlocks) minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_external_airlocks) minimal_player_age = 3 + banned_job_species = list(SPECIES_ZADDAT, SPECIES_TESHARI, SPECIES_DIONA) outfit_type = /decl/hierarchy/outfit/job/security/officer job_description = "A Security Officer is concerned with maintaining the safety and security of the station as a whole, dealing with external threats and \ @@ -117,6 +125,8 @@ No one is above the Law, not Security or Command." alt_titles = list("Junior Officer" = /datum/alt_title/junior_officer) + min_age_by_species = list(SPECIES_PROMETHEAN = 3) + // Security Officer Alt Titles /datum/alt_title/junior_officer title = "Junior Officer" diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 5eaede945a..a6891ea628 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -54,7 +54,7 @@ var/global/datum/controller/occupations/job_master var/datum/job/job = GetJob(rank) if(!job) return 0 - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) return 0 if(jobban_isbanned(player, rank)) return 0 @@ -91,9 +91,12 @@ var/global/datum/controller/occupations/job_master if(!job.player_old_enough(player.client)) Debug("FOC player not old enough, Player: [player]") continue - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + if(job.minimum_character_age && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) Debug("FOC character not old enough, Player: [player]") continue + if(job.is_species_banned(player.client.prefs.species, player.client.prefs.organ_data["brain"]) == TRUE) + Debug("FOC character species invalid for job, Player: [player]") + continue if(flag && !(player.client.prefs.be_special & flag)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue @@ -108,7 +111,10 @@ var/global/datum/controller/occupations/job_master if(!job) continue - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) + continue + + if(job.is_species_banned(player.client.prefs.species, player.client.prefs.organ_data["brain"]) == TRUE) continue if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! @@ -157,20 +163,18 @@ var/global/datum/controller/occupations/job_master if(!V.client) continue var/age = V.client.prefs.age - if(age < job.minimum_character_age) // Nope. + if(age < job.get_min_age(V.client.prefs.species, V.client.prefs.organ_data["brain"])) // Nope. continue - switch(age) - if(job.minimum_character_age to (job.minimum_character_age+10)) - weightedCandidates[V] = 3 // Still a bit young. - if((job.minimum_character_age+10) to (job.ideal_character_age-10)) - weightedCandidates[V] = 6 // Better. - if((job.ideal_character_age-10) to (job.ideal_character_age+10)) - weightedCandidates[V] = 10 // Great. - if((job.ideal_character_age+10) to (job.ideal_character_age+20)) - weightedCandidates[V] = 6 // Still good. - if((job.ideal_character_age+20) to INFINITY) - weightedCandidates[V] = 3 // Geezer. + var/idealage = job.get_ideal_age(V.client.prefs.species, V.client.prefs.organ_data["brain"]) + var/agediff = abs(idealage - age) // Compute the absolute difference in age from target + switch(agediff) /// If the math sucks, it's because I almost failed algebra in high school. + if(20 to INFINITY) + weightedCandidates[V] = 3 // Too far off + if(10 to 20) + weightedCandidates[V] = 6 // Nearer the mark, but not quite + if(0 to 10) + weightedCandidates[V] = 10 // On the mark else // If there's ABSOLUTELY NOBODY ELSE if(candidates.len == 1) weightedCandidates[V] = 1 diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index b6f6cb25ac..eb13608ae1 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -10,8 +10,8 @@ idle_power_usage = 0 var/obj/item/device/radio/beacon/Beacon -/obj/machinery/bluespace_beacon/New() - ..() +/obj/machinery/bluespace_beacon/Initialize() + . = ..() var/turf/T = src.loc Beacon = new /obj/item/device/radio/beacon Beacon.invisibility = INVISIBILITY_MAXIMUM diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index 8edc131ac8..ed99b6e72c 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -8,10 +8,10 @@ var/max_cable = 100 var/on = 0 -/obj/machinery/cablelayer/New() +/obj/machinery/cablelayer/Initialize() cable = new(src) cable.amount = 100 - ..() + . = ..() /obj/machinery/cablelayer/Moved(atom/old_loc, direction, forced = FALSE) . = ..() diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 0d67a00651..c0a817df2f 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -14,8 +14,8 @@ var/strapped = 0.0 var/obj/machinery/computer/operating/computer = null -/obj/machinery/optable/New() - ..() +/obj/machinery/optable/Initialize() + . = ..() for(var/direction in list(NORTH,EAST,SOUTH,WEST)) computer = locate(/obj/machinery/computer/operating, get_step(src, direction)) if(computer) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 519257a254..d4b1ead2ec 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -539,8 +539,8 @@ circuit = /obj/item/weapon/circuitboard/scanner_console var/printing = null -/obj/machinery/body_scanconsole/New() - ..() +/obj/machinery/body_scanconsole/Initialize() + . = ..() findscanner() /obj/machinery/body_scanconsole/Destroy() diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index aead0c79f1..8a07a3a416 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -14,8 +14,8 @@ var/cooldown_on = 0 req_access = list(access_ai_upload) -/obj/machinery/ai_slipper/New() - ..() +/obj/machinery/ai_slipper/Initialize() + . = ..() update_icon() /obj/machinery/ai_slipper/power_change() diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 5e831188d1..908809ae72 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -103,6 +103,9 @@ /obj/machinery/alarm/Initialize(mapload) . = ..() first_run() + set_frequency(frequency) + if(!master_is_operating()) + elect_master() /obj/machinery/alarm/Destroy() unregister_radio(src, frequency) @@ -131,12 +134,6 @@ TLV["pressure"] = list(ONE_ATMOSPHERE * 0.80, ONE_ATMOSPHERE * 0.90, ONE_ATMOSPHERE * 1.10, ONE_ATMOSPHERE * 1.20) /* kpa */ TLV["temperature"] = list(T0C - 26, T0C, T0C + 40, T0C + 66) // K -/obj/machinery/alarm/Initialize() - . = ..() - set_frequency(frequency) - if(!master_is_operating()) - elect_master() - /obj/machinery/alarm/process() if((stat & (NOPOWER|BROKEN)) || shorted) return diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm index bfe95bada7..82f23e72a6 100644 --- a/code/game/machinery/atmoalter/area_atmos_computer.dm +++ b/code/game/machinery/atmoalter/area_atmos_computer.dm @@ -14,7 +14,7 @@ //Simple variable to prevent me from doing attack_hand in both this and the child computer var/zone = "This computer is working on a wireless range, the range is currently limited to " -/obj/machinery/computer/area_atmos/Initialize() +/obj/machinery/computer/area_atmos/LateInitialize() . = ..() scanscrubbers() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 6fe30aeaab..585a62a5fa 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -368,30 +368,30 @@ update_flag add_fingerprint(usr) update_icon() -/obj/machinery/portable_atmospherics/canister/phoron/New() - ..() +/obj/machinery/portable_atmospherics/canister/phoron/Initialize() + . = ..() src.air_contents.adjust_gas("phoron", MolesForPressure()) src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/oxygen/New() - ..() +/obj/machinery/portable_atmospherics/canister/oxygen/Initialize() + . = ..() src.air_contents.adjust_gas("oxygen", MolesForPressure()) src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/New() - ..() +/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/Initialize() + . = ..() src.air_contents.adjust_gas("oxygen", MolesForPressure()) src.air_contents.temperature = 80 src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/nitrous_oxide/New() - ..() +/obj/machinery/portable_atmospherics/canister/nitrous_oxide/Initialize() + . = ..() air_contents.adjust_gas("nitrous_oxide", MolesForPressure()) src.update_icon() @@ -407,23 +407,20 @@ update_flag air_contents = new return 1 -/obj/machinery/portable_atmospherics/canister/nitrogen/New() - - ..() - +/obj/machinery/portable_atmospherics/canister/nitrogen/Initialize() + . = ..() src.air_contents.adjust_gas("nitrogen", MolesForPressure()) src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/carbon_dioxide/New() - ..() +/obj/machinery/portable_atmospherics/canister/carbon_dioxide/Initialize() + . = ..() src.air_contents.adjust_gas("carbon_dioxide", MolesForPressure()) src.update_icon() return 1 - -/obj/machinery/portable_atmospherics/canister/air/New() - ..() +/obj/machinery/portable_atmospherics/canister/air/Initialize() + . = ..() var/list/air_mix = StandardAirMix() src.air_contents.adjust_multi("oxygen", air_mix["oxygen"], "nitrogen", air_mix["nitrogen"]) @@ -432,20 +429,20 @@ update_flag //R-UST port // Special types used for engine setup admin verb, they contain double amount of that of normal canister. -/obj/machinery/portable_atmospherics/canister/nitrogen/engine_setup/New() - ..() +/obj/machinery/portable_atmospherics/canister/nitrogen/engine_setup/Initialize() + . = ..() src.air_contents.adjust_gas("nitrogen", MolesForPressure()) src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/carbon_dioxide/engine_setup/New() - ..() +/obj/machinery/portable_atmospherics/canister/carbon_dioxide/engine_setup/Initialize() + . = ..() src.air_contents.adjust_gas("carbon_dioxide", MolesForPressure()) src.update_icon() return 1 -/obj/machinery/portable_atmospherics/canister/phoron/engine_setup/New() - ..() +/obj/machinery/portable_atmospherics/canister/phoron/engine_setup/Initialize() + . = ..() src.air_contents.adjust_gas("phoron", MolesForPressure()) src.update_icon() return 1 diff --git a/code/game/machinery/atmoalter/clamp.dm b/code/game/machinery/atmoalter/clamp.dm index 318145c229..8667d4c50c 100644 --- a/code/game/machinery/atmoalter/clamp.dm +++ b/code/game/machinery/atmoalter/clamp.dm @@ -14,8 +14,8 @@ var/datum/pipe_network/network_node1 var/datum/pipe_network/network_node2 -/obj/machinery/clamp/New(loc, var/obj/machinery/atmospherics/pipe/simple/to_attach = null) - ..() +/obj/machinery/clamp/Initialize(var/ml, var/obj/machinery/atmospherics/pipe/simple/to_attach = null) + . = ..() if(istype(to_attach)) target = to_attach else @@ -23,7 +23,6 @@ if(target) update_networks() dir = target.dir - return 1 /obj/machinery/clamp/proc/update_networks() if(!target) diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index dc530ecc2f..e334a3f3c2 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -13,16 +13,10 @@ var/start_pressure = ONE_ATMOSPHERE var/maximum_pressure = 90 * ONE_ATMOSPHERE -/obj/machinery/portable_atmospherics/New() - ..() - - air_contents.volume = volume - air_contents.temperature = T20C - - return 1 - /obj/machinery/portable_atmospherics/Initialize() ..() + air_contents.volume = volume + air_contents.temperature = T20C return INITIALIZE_HINT_LATELOAD /obj/machinery/portable_atmospherics/LateInitialize() diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 74e4804661..378d8965a0 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -21,8 +21,8 @@ /obj/machinery/portable_atmospherics/powered/pump/filled start_pressure = 90 * ONE_ATMOSPHERE -/obj/machinery/portable_atmospherics/powered/pump/New() - ..() +/obj/machinery/portable_atmospherics/powered/pump/Initialize() + . = ..() cell = new/obj/item/weapon/cell/apc(src) var/list/air_mix = StandardAirMix() diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 794383001c..f6cadfbff1 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -20,8 +20,8 @@ var/list/scrubbing_gas = list("phoron", "carbon_dioxide", "nitrous_oxide", "volatile_fuel") -/obj/machinery/portable_atmospherics/powered/scrubber/New() - ..() +/obj/machinery/portable_atmospherics/powered/scrubber/Initialize() + . = ..() cell = new/obj/item/weapon/cell/apc(src) /obj/machinery/portable_atmospherics/powered/scrubber/emp_act(severity) @@ -162,8 +162,8 @@ var/global/gid = 1 var/id = 0 -/obj/machinery/portable_atmospherics/powered/scrubber/huge/New() - ..() +/obj/machinery/portable_atmospherics/powered/scrubber/huge/Initialize() + . = ..() cell = null id = gid diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 6405a9f254..7749d967d9 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -335,7 +335,7 @@ var/matter_amount_per_sheet = 10 var/matter_type = MAT_STEEL -/obj/machinery/organ_printer/robot/full/New() +/obj/machinery/organ_printer/robot/full/Initialize() . = ..() stored_matter = max_stored_matter diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 625a4d6d55..d22ab1c9d1 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -42,7 +42,7 @@ var/list/camera_computers_using_this = list() -/obj/machinery/camera/New() +/obj/machinery/camera/Initialize() wires = new(src) assembly = new(src) assembly.state = 4 @@ -61,7 +61,7 @@ error("[src.name] in [get_area(src)]has errored. [src.network?"Empty network list":"Null network list"]") ASSERT(src.network) ASSERT(src.network.len > 0) - ..() + . = ..() /obj/machinery/camera/Destroy() if(isMotion()) @@ -180,7 +180,7 @@ else assembly.state = 1 to_chat(user, "You cut \the [src] free from the wall.") - new /obj/item/stack/cable_coil(src.loc, length=2) + new /obj/item/stack/cable_coil(src.loc, 2) assembly = null //so qdel doesn't eat it. qdel(src) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 5e463b0a78..42233501c4 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -106,8 +106,8 @@ var/global/list/engineering_networks = list( // EMP -/obj/machinery/camera/emp_proof/New() - ..() +/obj/machinery/camera/emp_proof/Initialize() + . = ..() upgradeEmpProof() // X-RAY @@ -127,14 +127,14 @@ var/global/list/engineering_networks = list( /obj/machinery/camera/xray/research network = list(NETWORK_RESEARCH) -/obj/machinery/camera/xray/New() - ..() +/obj/machinery/camera/xray/Initialize() + . = ..() upgradeXRay() // MOTION -/obj/machinery/camera/motion/New() - ..() +/obj/machinery/camera/motion/Initialize() + . = ..() upgradeMotion() /obj/machinery/camera/motion/engineering_outpost @@ -149,8 +149,8 @@ var/global/list/engineering_networks = list( /obj/machinery/camera/all/command network = list(NETWORK_COMMAND) -/obj/machinery/camera/all/New() - ..() +/obj/machinery/camera/all/Initialize() + . = ..() upgradeEmpProof() upgradeXRay() upgradeMotion() diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index d06a0080b0..a41ccad3a0 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -456,8 +456,8 @@ icon_state = "pod_g" -/obj/machinery/clonepod/full/New() - ..() +/obj/machinery/clonepod/full/Initialize() + . = ..() for(var/i = 1 to container_limit) containers += new /obj/item/weapon/reagent_containers/glass/bottle/biomass(src) @@ -499,7 +499,8 @@ name = "data disk - 'God Emperor of Mankind'" read_only = 1 -/obj/item/weapon/disk/data/demo/New() +/obj/item/weapon/disk/data/demo/Initialize() + . = ..() initializeDisk() buf.types=DNA2_BUF_UE|DNA2_BUF_UI //data = "066000033000000000AF00330660FF4DB002690" @@ -514,8 +515,8 @@ name = "data disk - 'Mr. Muggles'" read_only = 1 -/obj/item/weapon/disk/data/monkey/New() - ..() +/obj/item/weapon/disk/data/monkey/Initialize() + . = ..() initializeDisk() buf.types=DNA2_BUF_SE var/list/new_SE=list(0x098,0x3E8,0x403,0x44C,0x39F,0x4B0,0x59D,0x514,0x5FC,0x578,0x5DC,0x640,0x6A4) @@ -524,8 +525,8 @@ buf.dna.SE=new_SE buf.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF) -/obj/item/weapon/disk/data/New() - ..() +/obj/item/weapon/disk/data/Initialize() + . = ..() var/diskcolor = pick(0,1,2) icon_state = "datadisk[diskcolor]" @@ -545,8 +546,8 @@ name = "Diskette Box" icon_state = "disk_kit" -/obj/item/weapon/storage/box/disks/New() - ..() +/obj/item/weapon/storage/box/disks/Initialize() + . = ..() new /obj/item/weapon/disk/data(src) new /obj/item/weapon/disk/data(src) new /obj/item/weapon/disk/data(src) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index c965a54b15..dd94e6c8a9 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -20,8 +20,8 @@ var/healthAlarm = 50 var/oxy = 1 //oxygen beeping toggle -/obj/machinery/computer/operating/New() - ..() +/obj/machinery/computer/operating/Initialize() + . = ..() for(var/direction in list(NORTH,EAST,SOUTH,WEST)) table = locate(/obj/machinery/optable, get_step(src, direction)) if(table) diff --git a/code/game/machinery/computer/RCON_Console.dm b/code/game/machinery/computer/RCON_Console.dm index d6df0d2d6d..156f74ffa5 100644 --- a/code/game/machinery/computer/RCON_Console.dm +++ b/code/game/machinery/computer/RCON_Console.dm @@ -15,8 +15,8 @@ var/current_tag = null var/datum/tgui_module/rcon/rcon -/obj/machinery/computer/rcon/New() - ..() +/obj/machinery/computer/rcon/Initialize() + . = ..() rcon = new(src) /obj/machinery/computer/rcon/Destroy() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index a6b2c5d8bc..737b10f350 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -4,24 +4,24 @@ icon_state = "arcade1" icon_keyboard = null clicksound = null //Gets too spammy and makes no sense for arcade to have the console keyboard noise anyway - var/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2, - /obj/item/toy/blink = 2, - /obj/item/clothing/under/syndicate/tacticool = 2, - /obj/item/toy/sword = 2, - /obj/item/weapon/gun/projectile/revolver/capgun = 2, - /obj/item/toy/crossbow = 2, - /obj/item/clothing/suit/syndicatefake = 2, - /obj/item/weapon/storage/fancy/crayons = 2, - /obj/item/toy/spinningtoy = 2, - /obj/random/mech_toy = 1, - /obj/item/weapon/reagent_containers/spray/waterflower = 1, - /obj/random/action_figure = 1, - /obj/random/plushie = 1, - /obj/item/toy/cultsword = 1, - /obj/item/toy/bouquet/fake = 1, - /obj/item/clothing/accessory/badge/sheriff = 2, - /obj/item/clothing/head/cowboy_hat/small = 2, - /obj/item/toy/stickhorse = 2 + var/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2, + /obj/item/toy/blink = 2, + /obj/item/clothing/under/syndicate/tacticool = 2, + /obj/item/toy/sword = 2, + /obj/item/weapon/gun/projectile/revolver/capgun = 2, + /obj/item/weapon/gun/projectile/revolver/toy/crossbow = 2, + /obj/item/clothing/suit/syndicatefake = 2, + /obj/item/weapon/storage/fancy/crayons = 2, + /obj/item/toy/spinningtoy = 2, + /obj/random/mech_toy = 1, + /obj/item/weapon/reagent_containers/spray/waterflower = 1, + /obj/random/action_figure = 1, + /obj/random/plushie = 1, + /obj/item/toy/cultsword = 1, + /obj/item/toy/bouquet/fake = 1, + /obj/item/clothing/accessory/badge/sheriff = 2, + /obj/item/clothing/head/cowboy_hat/small = 2, + /obj/item/toy/stickhorse = 2 ) var/list/special_prizes = list() // Holds instanced objects, intended for admins to shove surprises inside or something. @@ -40,7 +40,7 @@ var/atom/movable/AM = pick_n_take(special_prizes) AM.forceMove(get_turf(src)) special_prizes -= AM - + else if(LAZYLEN(prizes)) var/prizeselect = pickweight(prizes) new prizeselect(src.loc) @@ -94,8 +94,8 @@ var/blocked = 0 //Player cannot attack/heal while set var/turtle = 0 -/obj/machinery/computer/arcade/battle/New() - ..() +/obj/machinery/computer/arcade/battle/Initialize() + . = ..() var/name_action var/name_part1 var/name_part2 @@ -347,8 +347,8 @@ var/gameStatus = ORION_STATUS_START var/canContinueEvent = 0 -/obj/machinery/computer/arcade/orion_trail/New() - ..() +/obj/machinery/computer/arcade/orion_trail/Initialize() + . = ..() // Sets up the main trail stops = list("Pluto","Asteroid Belt","Proxima Centauri","Dead Space","Rigel Prime","Tau Ceti Beta","Black Hole","Space Outpost Beta-9","Orion Prime") stopblurbs = list( @@ -1237,8 +1237,8 @@ /// End Payment -/obj/machinery/computer/arcade/clawmachine/New() - ..() +/obj/machinery/computer/arcade/clawmachine/Initialize() + . = ..() /obj/machinery/computer/arcade/clawmachine/attack_hand(mob/living/user) if(..()) @@ -1325,7 +1325,7 @@ gameStatus = "CLAWMACHINE_NEW" emagged = 1 return 1 - + /obj/machinery/computer/arcade/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/stack/arcadeticket)) var/obj/item/stack/arcadeticket/T = O diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 24a7d21a5f..9bc132c7f1 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -12,8 +12,8 @@ var/global/list/minor_air_alarms = list() icon_screen = "alert:0" light_color = "#e6ffff" -/obj/machinery/computer/atmos_alert/New() - ..() +/obj/machinery/computer/atmos_alert/Initialize() + . = ..() atmosphere_alarm.register_alarm(src, /atom/proc/update_icon) /obj/machinery/computer/atmos_alert/Destroy() diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 73dc0ec4b4..9c386c60bd 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -15,15 +15,13 @@ var/list/monitored_alarm_ids = null var/datum/tgui_module/atmos_control/atmos_control -/obj/machinery/computer/atmoscontrol/New() - ..() - /obj/machinery/computer/atmoscontrol/laptop //[TO DO] Change name to PCU and update mapdata to include replacement computers name = "\improper Atmospherics PCU" desc = "A personal computer unit. It seems to have only the Atmosphereics Control program installed." icon_screen = "pcu_atmo" - icon_state = "pcu" + icon_state = "pcu_engi" icon_keyboard = "pcu_key" + light_color = "#00cc00" density = 0 /obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 8c4fa55868..caad22f319 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -16,9 +16,6 @@ clicksound = "keyboard" -/obj/machinery/computer/New() - ..() - /obj/machinery/computer/Initialize() . = ..() power_change() diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 1af31afe80..fa73834f6f 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -10,9 +10,9 @@ circuit = /obj/item/weapon/circuitboard/crew var/datum/tgui_module/crew_monitor/crew_monitor -/obj/machinery/computer/crew/New() +/obj/machinery/computer/crew/Initialize() crew_monitor = new(src) - ..() + . = ..() /obj/machinery/computer/crew/Destroy() qdel(crew_monitor) diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index 3360647321..f32858d8fa 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -96,8 +96,8 @@ var/list/internal_log = list() var/mode = 0 // 0 - making pass, 1 - viewing logs -/obj/machinery/computer/guestpass/New() - ..() +/obj/machinery/computer/guestpass/Initialize() + . = ..() uid = "[rand(100,999)]-G[rand(10,99)]" diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 419e4d1ffe..ed975b4b29 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -497,9 +497,9 @@ name = "\improper Medical Laptop" desc = "A personal computer unit. It seems to have only the medical records program installed." icon_screen = "pcu_generic" - icon_state = "pcu" + icon_state = "pcu_med" icon_keyboard = "pcu_key" - light_color = "#00b000" + light_color = "#5284e7" circuit = /obj/item/weapon/circuitboard/med_data/pcu density = 0 diff --git a/code/game/machinery/computer/shutoff_monitor.dm b/code/game/machinery/computer/shutoff_monitor.dm index 8cc101d804..37eb2060a7 100644 --- a/code/game/machinery/computer/shutoff_monitor.dm +++ b/code/game/machinery/computer/shutoff_monitor.dm @@ -7,8 +7,8 @@ circuit = /obj/item/weapon/circuitboard/shutoff_monitor var/datum/tgui_module/shutoff_monitor/monitor -/obj/machinery/computer/shutoff_monitor/New() - ..() +/obj/machinery/computer/shutoff_monitor/Initialize() + . = ..() monitor = new(src) /obj/machinery/computer/shutoff_monitor/Destroy() diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index e8c69e000b..0f86eff151 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -12,7 +12,7 @@ icon_screen = "pcu_generic" icon_state = "pcu" icon_keyboard = "pcu_key" - light_color = "#00b000" + light_color = "#5284e7" req_one_access = list(access_heads) circuit = /obj/item/weapon/circuitboard/skills/pcu density = 0 diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index b1c6d68615..72cf643415 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -27,24 +27,24 @@ var/image/fluid -/obj/machinery/atmospherics/unary/cryo_cell/New() - ..() +/obj/machinery/atmospherics/unary/cryo_cell/Initialize() + . = ..() icon = 'icons/obj/cryogenics_split.dmi' icon_state = "base" initialize_directions = dir -/obj/machinery/atmospherics/unary/cryo_cell/Initialize() - . = ..() var/image/tank = image(icon,"tank") tank.alpha = 200 tank.pixel_y = 18 tank.plane = MOB_PLANE tank.layer = MOB_LAYER+0.2 //Above fluid + fluid = image(icon, "tube_filler") fluid.pixel_y = 18 fluid.alpha = 200 fluid.plane = MOB_PLANE fluid.layer = MOB_LAYER+0.1 //Below glass, above mob + add_overlay(tank) update_icon() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 476d7a51ba..b0fbc15939 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -67,7 +67,14 @@ name = "gateway oversight console" desc = "An interface between visitors and the gateway oversight systems tasked with keeping track of all visitors who enter or exit from the gateway." circuit = "/obj/item/weapon/circuitboard/robotstoragecontrol" + storage_type = "visitors" + storage_name = "Travel Oversight Control" + allow_items = 1 +/obj/machinery/computer/cryopod/checkpoint + name = "travel oversight console" + desc = "An interface between visitors and the checkpoint systems tasked with keeping track of all visitors who enter or exit from the area." + circuit = "/obj/item/weapon/circuitboard/robotstoragecontrol" storage_type = "visitors" storage_name = "Travel Oversight Control" allow_items = 1 @@ -290,9 +297,20 @@ time_till_despawn = 60 //1 second, because gateway. -/obj/machinery/cryopod/New() +/obj/machinery/cryopod/robot/door/checkpoint + name = "automated checkpoint" + desc = "A reinforced, automated checkpoint tracking arrivals and departures from the outpost. Beyond this vault is a small airstrip, then nothing but untamed wilderness." + on_store_message = "has departed from the colony." + on_store_name = "Travel Oversight" + on_enter_occupant_message = "The checkpoint unseals and grinds open, and you step through." + on_store_visible_message_1 = "grinds closed after" + on_store_visible_message_2 = "passes through it." + time_till_despawn = 10 // 1 second, because math + +/obj/machinery/cryopod/Initialize() + . = ..() announce = new /obj/item/device/radio/intercom(src) - ..() + find_control_computer() /obj/machinery/cryopod/Destroy() if(occupant) @@ -300,11 +318,6 @@ occupant.resting = 1 return ..() -/obj/machinery/cryopod/Initialize() - . = ..() - - find_control_computer() - /obj/machinery/cryopod/proc/find_control_computer(urgent=0) control_computer = null diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 9b14dc68bb..a8f0d94c96 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -21,8 +21,8 @@ Deployable items var/locked = 0.0 // req_access = list(access_maint_tunnels) -/obj/machinery/deployable/barrier/New() - ..() +/obj/machinery/deployable/barrier/Initialize() + . = ..() icon_state = "barrier[locked]" diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 01ece0eaa9..d34778210f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1375,8 +1375,16 @@ About the new airlock wires panel: return 0 return ..(M) -/obj/machinery/door/airlock/New(var/newloc, var/obj/structure/door_assembly/assembly=null) - ..() +/obj/machinery/door/airlock/Initialize(var/ml, var/obj/structure/door_assembly/assembly=null) + + if(src.closeOtherId != null) + for (var/obj/machinery/door/airlock/A in machines) + if(A.closeOtherId == src.closeOtherId && A != src) + src.closeOther = A + break + name = "\improper [name]" + + . = ..() //if assembly is given, create the new door from the assembly if (assembly && istype(assembly)) @@ -1404,7 +1412,7 @@ About the new airlock wires panel: set_dir(assembly.dir) //wires - var/turf/T = get_turf(newloc) + var/turf/T = get_turf(src) if(T && (T.z in using_map.admin_levels)) secured_wires = 1 if (secured_wires) @@ -1412,14 +1420,9 @@ About the new airlock wires panel: else wires = new/datum/wires/airlock(src) -/obj/machinery/door/airlock/Initialize() - if(src.closeOtherId != null) - for (var/obj/machinery/door/airlock/A in machines) - if(A.closeOtherId == src.closeOtherId && A != src) - src.closeOther = A - break - name = "\improper [name]" - . = ..() + if(frequency) + set_frequency(frequency) + update_icon() /obj/machinery/door/airlock/Destroy() qdel(wires) diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 36c054ec24..ad83f7bc82 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -128,14 +128,6 @@ frequency = new_frequency radio_connection = radio_controller.add_object(src, frequency, RADIO_AIRLOCK) - -/obj/machinery/door/airlock/Initialize() - . = ..() - if(frequency) - set_frequency(frequency) - - update_icon() - /obj/machinery/door/airlock/Destroy() if(frequency && radio_controller) radio_controller.remove_object(src,frequency) diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm index f7dda48feb..7508f559a8 100644 --- a/code/game/machinery/doors/alarmlock.dm +++ b/code/game/machinery/doors/alarmlock.dm @@ -9,10 +9,6 @@ var/air_frequency = 1437 autoclose = 0 -/obj/machinery/door/airlock/alarmlock/New() - ..() - air_connection = new - /obj/machinery/door/airlock/alarmlock/Destroy() if(radio_controller) radio_controller.remove_object(src,air_frequency) @@ -22,8 +18,7 @@ . = ..() radio_controller.remove_object(src, air_frequency) air_connection = radio_controller.add_object(src, air_frequency, RADIO_TO_AIRALARM) - open() - + addtimer(CALLBACK(src, .proc/open), 0) /obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal) ..() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index fca9a04f5a..04e5002776 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -49,7 +49,7 @@ visible_message("\The [user] bonks \the [src] harmlessly.") user.do_attack_animation(src) -/obj/machinery/door/New() +/obj/machinery/door/Initialize() . = ..() if(density) layer = closed_layer diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index 7c1d83036e..b635cd86ec 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -7,8 +7,8 @@ open_sound_powered = 'sound/machines/door/WideOpen.ogg' close_sound_powered = 'sound/machines/door/WideClose.ogg' -/obj/machinery/door/airlock/multi_tile/New() - ..() +/obj/machinery/door/airlock/multi_tile/Initialize() + . = ..() SetBounds() if(opacity) create_fillers() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index a50e54ba75..0caabe8b75 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -17,8 +17,8 @@ can_atmos_pass = ATMOS_PASS_PROC air_properties_vary_with_direction = 1 -/obj/machinery/door/window/New() - ..() +/obj/machinery/door/window/Initialize() + . = ..() update_nearby_tiles() if(LAZYLEN(req_access)) src.icon_state = "[src.icon_state]" diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index cab4f5c37f..6e21fd60c4 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -9,8 +9,8 @@ var/list/doppler_arrays = list() icon_state = "doppler" -/obj/machinery/doppler_array/New() - ..() +/obj/machinery/doppler_array/Initialize() + . = ..() doppler_arrays += src /obj/machinery/doppler_array/Destroy() diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 84aa62b155..10ad623bf9 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -11,9 +11,9 @@ var/open = 0 var/brightness_on = 8 //can't remember what the maxed out value is -/obj/machinery/floodlight/New() +/obj/machinery/floodlight/Initialize() + . = ..() cell = new(src) - ..() /obj/machinery/floodlight/update_icon() overlays.Cut() diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index d8a2b463e2..5dcfe90d6e 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -8,9 +8,9 @@ var/obj/item/stack/tile/T var/list/mode = list("dismantle"=0,"laying"=0,"collect"=0) -/obj/machinery/floorlayer/New() +/obj/machinery/floorlayer/Initialize() + . = ..() T = new/obj/item/stack/tile/floor(src) - ..() /obj/machinery/floorlayer/Moved(atom/old_loc, direction, forced = FALSE) . = ..() diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index 5e794cf2ae..867d9858c6 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -273,8 +273,8 @@ var/obj/ct = A req_component_names[A] = initial(ct.name) -/obj/structure/frame/New(var/loc, var/dir, var/building = 0, var/datum/frame/frame_types/type, mob/user as mob) - ..() +/obj/structure/frame/Initialize(var/ml, var/dir, var/building = 0, var/datum/frame/frame_types/type, mob/user as mob) + . = ..() if(building) frame_type = type state = FRAME_PLACED diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 70a2e3ce4c..a478d3a416 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -30,8 +30,8 @@ location.hotspot_expose(1000,500,1) return 1 -/obj/machinery/igniter/New() - ..() +/obj/machinery/igniter/Initialize() + . = ..() icon_state = "igniter[on]" /obj/machinery/igniter/power_change() @@ -58,9 +58,6 @@ idle_power_usage = 2 active_power_usage = 4 -/obj/machinery/sparker/New() - ..() - /obj/machinery/sparker/power_change() ..() if(!(stat & NOPOWER) && disable == 0) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index dfd65de258..5ee2d246d0 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -114,15 +114,12 @@ Class Procs: var/speed_process = FALSE //If false, SSmachines. If true, SSfastprocess. -/obj/machinery/New(l, d=0) - ..(l) +/obj/machinery/Initialize(var/ml, d=0) + . = ..() if(d) set_dir(d) if(ispath(circuit)) circuit = new circuit(src) - -/obj/machinery/Initialize(var/mapload) - . = ..() global.machines += src if(ispath(circuit)) circuit = new circuit(src) @@ -130,7 +127,7 @@ Class Procs: START_MACHINE_PROCESSING(src) else START_PROCESSING(SSfastprocess, src) - if(!mapload) + if(!ml) power_change() /obj/machinery/Destroy() diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index d702a300b5..0aa583e1a2 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -27,8 +27,8 @@ var/center_y = 0 var/max_dist = 20 // absolute value of center_x,y cannot exceed this integer -/obj/machinery/magnetic_module/New() - ..() +/obj/machinery/magnetic_module/Initialize() + . = ..() var/turf/T = loc hide(!T.is_plating()) center = T @@ -209,8 +209,8 @@ var/datum/radio_frequency/radio_connection -/obj/machinery/magnetic_controller/New() - ..() +/obj/machinery/magnetic_controller/Initialize() + . = ..() if(autolink) for(var/obj/machinery/magnetic_module/M in machines) diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index 25805c694e..40c23cda40 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -16,7 +16,7 @@ var/id = 1.0 var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess. -/obj/machinery/mass_driver/New() +/obj/machinery/mass_driver/Initialize() . = ..() default_apply_parts() diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 6d4453d1f2..6d08389065 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -18,8 +18,8 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w var/list/codes = list() // assoc. list of transponder codes req_access = list(access_engine) -/obj/machinery/navbeacon/New() - ..() +/obj/machinery/navbeacon/Initialize() + . = ..() set_codes_from_txt(codes_txt) if(freq) warning("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") @@ -233,6 +233,6 @@ Transponder Codes: