diff --git a/code/__DEFINES/assert.dm b/code/__DEFINES/assert.dm new file mode 100644 index 000000000000..cff78107714c --- /dev/null +++ b/code/__DEFINES/assert.dm @@ -0,0 +1,13 @@ +#undef ASSERT + +/// Override BYOND's native ASSERT to optionally specify a message +#define ASSERT(condition, message...) \ + if (!(condition)) { \ + CRASH(assertion_message(__FILE__, __LINE__, #condition, ##message)) \ + } + +/proc/assertion_message(file, line, condition, message) + if (!isnull(message)) + message = " - [message]" + + return "[file]:[line]:Assertion failed: [condition][message]" diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index bab6064cfdbf..32717a2115f2 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -1,3 +1,5 @@ +///from base of mob/set_stat(): (new_stat, old_stat) +#define COMSIG_MOB_STATCHANGE "mob_statchange" /// From /obj/structure/machinery/door/airlock/proc/take_damage #define COMSIG_MOB_DESTROY_AIRLOCK "mob_destroy_airlock" @@ -128,3 +130,6 @@ /// From /obj/item/proc/pickup() : (obj/item/picked_up) #define COMSIG_MOB_PICKUP_ITEM "mob_pickup_item" + +/// Cancels all running cloaking effects on target +#define COMSIG_MOB_EFFECT_CLOAK_CANCEL "mob_effect_cloak_cancel" diff --git a/code/__DEFINES/dcs/signals/atom/signals_atom.dm b/code/__DEFINES/dcs/signals/atom/signals_atom.dm index cac9861d09cb..d9bd1202c159 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_atom.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_atom.dm @@ -51,3 +51,6 @@ /// Called when an atom is mouse dropped on another atom, from /client/MouseDrop: (atom/dropped_onto) #define COMSIG_ATOM_DROP_ON "atom_drop_on" + +/// Called when an atom has emp_act called on it, from /atom/emp_act: (severity) +#define COMSIG_ATOM_EMP_ACT "atom_emp_act" diff --git a/code/__DEFINES/dcs/signals/atom/signals_cell.dm b/code/__DEFINES/dcs/signals/atom/signals_cell.dm new file mode 100644 index 000000000000..75e13d8bfdfc --- /dev/null +++ b/code/__DEFINES/dcs/signals/atom/signals_cell.dm @@ -0,0 +1,26 @@ +/// (charge_amount) +#define COMSIG_CELL_USE_CHARGE "cell_use_charge" + #define COMPONENT_CELL_NO_USE_CHARGE (1<<0) + +/// (charge_amount) +#define COMSIG_CELL_ADD_CHARGE "cell_add_charge" + +#define COMSIG_CELL_START_TICK_DRAIN "cell_start_tick_drain" + +#define COMSIG_CELL_STOP_TICK_DRAIN "cell_stop_tick_drain" + +/// (mob/living/user) +#define COMSIG_CELL_TRY_RECHARGING "cell_try_recharging" + #define COMPONENT_CELL_NO_RECHARGE (1<<0) + +#define COMSIG_CELL_OUT_OF_CHARGE "cell_out_of_charge" + +/// (charge_amount) +#define COMSIG_CELL_CHECK_CHARGE "cell_check_charge" + #define COMPONENT_CELL_CHARGE_INSUFFICIENT (1<<0) + +#define COMSIG_CELL_TRY_INSERT_CELL "cell_try_insert_cell" + #define COMPONENT_CANCEL_CELL_INSERT (1<<0) + +/// (mob/living/user) +#define COMSIG_CELL_REMOVE_CELL "cell_remove_cell" diff --git a/code/__DEFINES/dcs/signals/atom/signals_item.dm b/code/__DEFINES/dcs/signals/atom/signals_item.dm index 64f4c24798e1..6024c0524992 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_item.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_item.dm @@ -66,5 +66,5 @@ /// from /obj/item/weapon/gun/proc/load_into_chamber() : () #define COMSIG_GUN_INTERRUPT_FIRE "gun_interrupt_fire" -//Additional procs on items that will be triggered right after the human finishes spawns in +//from /datum/authority/branch/role/proc/equip_role() #define COMSIG_POST_SPAWN_UPDATE "post_spawn_update" diff --git a/code/__DEFINES/dcs/signals/atom/signals_obj.dm b/code/__DEFINES/dcs/signals/atom/signals_obj.dm index aebd0d09d0d2..93579e068ec7 100644 --- a/code/__DEFINES/dcs/signals/atom/signals_obj.dm +++ b/code/__DEFINES/dcs/signals/atom/signals_obj.dm @@ -29,3 +29,5 @@ /// from /obj/proc/afterbuckle() #define COSMIG_OBJ_AFTER_BUCKLE "signal_obj_after_buckle" + +#define COMSIG_STRUCTURE_CRATE_SQUAD_LAUNCHED "structure_crate_squad_launched" diff --git a/code/__DEFINES/job.dm b/code/__DEFINES/job.dm index 89b88f67c038..56062cb0213b 100644 --- a/code/__DEFINES/job.dm +++ b/code/__DEFINES/job.dm @@ -11,6 +11,7 @@ #define SQUAD_MARINE_CRYO "Foxtrot" #define SQUAD_MARINE_INTEL "Intel" #define SQUAD_SOF "SOF" +#define SQUAD_CBRN "CBRN" // Job name defines #define JOB_SQUAD_MARINE "Rifleman" diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index 88f194bb33df..764282d59765 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -14,6 +14,7 @@ #define COMSIG_KB_ADMIN_INVISIMINTOGGLE_DOWN "keybinding_admin_invisimintoggle_down" #define COMSIG_KB_ADMIN_DEADMIN_DOWN "keybinding_admin_deadmin_down" #define COMSIG_KB_ADMIN_READMIN_DOWN "keybinding_admin_readmin_down" +#define COMSIG_KB_ADMIN_MENTORSAY_DOWN "keybinding_admin_mentorsay_down" //Carbon #define COMSIG_KB_CARBON_HOLDRUNMOVEINTENT_DOWN "keybinding_carbon_holdrunmoveintent_down" @@ -87,6 +88,7 @@ #define COMSIG_KB_HUMAN_WEAPON_UNLOAD "keybinding_human_weapon_unload" #define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT "keybinding_human_weapon_attachment" #define COMSIG_KB_HUMAN_WEAPON_ATTACHMENT_RAIL "keybinding_human_weapon_attachment_rail" +#define COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE "keybinding_human_weapon_shotgun_tube" #define COMSIG_KB_HUMAN_WEAPON_TOGGLE_IFF "keybinding_human_weapon_toggle_iff" diff --git a/code/__DEFINES/speech_channels.dm b/code/__DEFINES/speech_channels.dm index 3f6e4720bde9..5a9a74af8ad0 100644 --- a/code/__DEFINES/speech_channels.dm +++ b/code/__DEFINES/speech_channels.dm @@ -1,6 +1,7 @@ // Used to direct channels to speak into. #define SAY_CHANNEL "Say" #define COMMS_CHANNEL "Comms" +#define WHISPER_CHANNEL "Whisper" #define ME_CHANNEL "Me" #define OOC_CHANNEL "OOC" #define LOOC_CHANNEL "LOOC" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index ef500b6af9f8..b2704fc66862 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -1,63 +1,76 @@ -//shamelessly ripped from TG #define SIGNAL_ADDTRAIT(trait_ref) "addtrait [trait_ref]" #define SIGNAL_REMOVETRAIT(trait_ref) "removetrait [trait_ref]" // trait accessor defines -//here be dragons #define ADD_TRAIT(target, trait, source) \ do { \ var/list/_L; \ - if (!target.status_traits) { \ - target.status_traits = list(); \ - _L = target.status_traits; \ + if (!target._status_traits) { \ + target._status_traits = list(); \ + _L = target._status_traits; \ _L[trait] = list(source); \ SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \ - if(trait in GLOB.traits_with_elements){ \ - target.AddElement(GLOB.traits_with_elements[trait]); \ - } \ } else { \ - _L = target.status_traits; \ + _L = target._status_traits; \ if (_L[trait]) { \ _L[trait] |= list(source); \ } else { \ _L[trait] = list(source); \ SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \ - if(trait in GLOB.traits_with_elements){ \ - target.AddElement(GLOB.traits_with_elements[trait]); \ - } \ } \ } \ } while (0) #define REMOVE_TRAIT(target, trait, sources) \ do { \ - var/list/_L = target.status_traits; \ + var/list/_L = target._status_traits; \ var/list/_S; \ if (sources && !islist(sources)) { \ _S = list(sources); \ } else { \ _S = sources\ }; \ - if (_L && _L[trait]) { \ + if (_L?[trait]) { \ for (var/_T in _L[trait]) { \ - if ((!_S && (_T != TRAIT_SOURCE_QUIRK)) || (_T in _S)) { \ + if ((!_S && (_T != ROUNDSTART_TRAIT)) || (_T in _S)) { \ _L[trait] -= _T \ } \ };\ if (!length(_L[trait])) { \ _L -= trait; \ SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \ - if(trait in GLOB.traits_with_elements) { \ - target.RemoveElement(GLOB.traits_with_elements[trait]); \ - } \ }; \ if (!length(_L)) { \ - target.status_traits = null \ + target._status_traits = null \ + }; \ + } \ + } while (0) +#define REMOVE_TRAIT_NOT_FROM(target, trait, sources) \ + do { \ + var/list/_traits_list = target._status_traits; \ + var/list/_sources_list; \ + if (sources && !islist(sources)) { \ + _sources_list = list(sources); \ + } else { \ + _sources_list = sources\ + }; \ + if (_traits_list?[trait]) { \ + for (var/_trait_source in _traits_list[trait]) { \ + if (!(_trait_source in _sources_list)) { \ + _traits_list[trait] -= _trait_source \ + } \ + };\ + if (!length(_traits_list[trait])) { \ + _traits_list -= trait; \ + SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \ + }; \ + if (!length(_traits_list)) { \ + target._status_traits = null \ }; \ } \ } while (0) #define REMOVE_TRAITS_NOT_IN(target, sources) \ do { \ - var/list/_L = target.status_traits; \ + var/list/_L = target._status_traits; \ var/list/_S = sources; \ if (_L) { \ for (var/_T in _L) { \ @@ -65,20 +78,17 @@ if (!length(_L[_T])) { \ _L -= _T; \ SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T), _T); \ - if(_T in GLOB.traits_with_elements) { \ - target.RemoveElement(GLOB.traits_with_elements[_T]); \ }; \ };\ - };\ if (!length(_L)) { \ - target.status_traits = null\ + target._status_traits = null\ };\ }\ } while (0) #define REMOVE_TRAITS_IN(target, sources) \ do { \ - var/list/_L = target.status_traits; \ + var/list/_L = target._status_traits; \ var/list/_S = sources; \ if (sources && !islist(sources)) { \ _S = list(sources); \ @@ -91,46 +101,36 @@ if (!length(_L[_T])) { \ _L -= _T; \ SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T)); \ - if(_T in GLOB.traits_with_elements) { \ - target.RemoveElement(GLOB.traits_with_elements[_T]); \ }; \ };\ - };\ if (!length(_L)) { \ - target.status_traits = null\ + target._status_traits = null\ };\ }\ } while (0) -/// Will 100% nuke a trait regardless of source. Preferably use this as little as possible -#define REMOVE_TRAIT_ALLSOURCES(target, trait) \ - do { \ - var/list/_L = target.status_traits; \ - if (_L?[trait]) { \ - if (length(_L)) { \ - _L -= trait; \ - SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \ - }; \ - else { \ - target.status_traits = null \ - }; \ - } \ - } while (0) - -#define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE) -#define HAS_TRAIT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (source in target.status_traits[trait]) : FALSE) : FALSE) -#define HAS_TRAIT_FROM_ONLY(target, trait, source) (\ - target.status_traits ?\ - (target.status_traits[trait] ?\ - ((source in target.status_traits[trait]) && (length(target.status_traits) == 1))\ - : FALSE)\ - : FALSE) -#define HAS_TRAIT_NOT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (length(target.status_traits[trait] - source) > 0) : FALSE) : FALSE) - +#define HAS_TRAIT(target, trait) (target._status_traits?[trait] ? TRUE : FALSE) +#define HAS_TRAIT_FROM(target, trait, source) (HAS_TRAIT(target, trait) && (source in target._status_traits[trait])) +#define HAS_TRAIT_FROM_ONLY(target, trait, source) (HAS_TRAIT(target, trait) && (source in target._status_traits[trait]) && (length(target._status_traits[trait]) == 1)) +#define HAS_TRAIT_NOT_FROM(target, trait, source) (HAS_TRAIT(target, trait) && (length(target._status_traits[trait] - source) > 0)) +/// Returns a list of trait sources for this trait. Only useful for wacko cases and internal futzing +/// You should not be using this +#define GET_TRAIT_SOURCES(target, trait) (target._status_traits?[trait] || list()) +/// Returns the amount of sources for a trait. useful if you don't want to have a "thing counter" stuck around all the time +#define COUNT_TRAIT_SOURCES(target, trait) length(GET_TRAIT_SOURCES(target, trait)) +/// A simple helper for checking traits in a mob's mind +#define HAS_MIND_TRAIT(target, trait) (HAS_TRAIT(target, trait) || (target.mind ? HAS_TRAIT(target.mind, trait) : FALSE)) /// Example trait // #define TRAIT_X "t_x" + +/// cannot be removed without admin intervention +#define ROUNDSTART_TRAIT "roundstart" + //-- mob traits -- +/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! +#define TRAIT_UNDENSE "undense" + // SPECIES TRAITS /// Knowledge of Yautja technology #define TRAIT_YAUTJA_TECH "t_yautja_tech" @@ -279,6 +279,7 @@ GLOBAL_LIST_INIT(mob_traits, list( */ GLOBAL_LIST_INIT(traits_by_type, list( /mob = list( + "TRAIT_UNDENSE" = TRAIT_UNDENSE, "TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH, "TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG, "TRAIT_FOREIGN_BIO" = TRAIT_FOREIGN_BIO, @@ -355,6 +356,8 @@ GLOBAL_LIST(trait_name_map) // #define TRAIT_SOURCE_Y "t_s_y" #define TRAIT_SOURCE_INHERENT "t_s_inherent" //-- mob traits -- +///Status trait coming from lying down through update_canmove() +#define LYING_TRAIT "lying" ///Status trait coming from species. .human/species_gain() #define TRAIT_SOURCE_SPECIES "t_s_species" ///Status trait coming from the hive. @@ -379,6 +382,8 @@ GLOBAL_LIST(trait_name_map) #define TRAIT_SOURCE_ABILITY(ability) "t_s_ability_[ability]" ///Status trait forced by the xeno action charge #define TRAIT_SOURCE_XENO_ACTION_CHARGE "t_s_xeno_action_charge" +///Status trait coming from a xeno nest +#define XENO_NEST_TRAIT "xeno_nest" //-- structure traits -- ///Status trait coming from being flipped or unflipped. #define TRAIT_SOURCE_FLIP_TABLE "t_s_flip_table" @@ -390,3 +395,12 @@ GLOBAL_LIST(trait_name_map) //Status trait coming from clothing. #define TRAIT_SOURCE_CLOTHING "t_s_clothing" + +/// trait effect related to active specialist gear +#define SPECIALIST_GEAR_TRAIT "specialist_gear" +/// traits associated with usage of snowflake dropship double seats +#define DOUBLE_SEATS_TRAIT "double_seats" +/// traits associated with xeno on-ground weeds +#define XENO_WEED_TRAIT "xeno_weed" +/// traits from chloroform usage +#define CHLOROFORM_TRAIT "chloroform" diff --git a/code/__HELPERS/job.dm b/code/__HELPERS/job.dm index 43902b07cfd9..89fe6877647e 100644 --- a/code/__HELPERS/job.dm +++ b/code/__HELPERS/job.dm @@ -26,13 +26,6 @@ if(I.assignment in GLOB.joblist) return I.assignment return "Unknown" -/proc/FindNameFromID(mob/living/carbon/human/H) - ASSERT(istype(H)) - var/obj/item/card/id/I = H.wear_id - if(istype(I)) return I.registered_name - I = H.get_active_hand() - if(istype(I)) return I.registered_name - /proc/get_all_job_icons() return GLOB.joblist + list("Prisoner")//For all existing HUD icons /obj/proc/GetJobName() //Used in secHUD icon generation diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm new file mode 100644 index 000000000000..ba99b2e1e7ff --- /dev/null +++ b/code/__HELPERS/traits.dm @@ -0,0 +1,43 @@ +#define TRAIT_CALLBACK_ADD(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitAdd), ##target, ##trait, ##source) +#define TRAIT_CALLBACK_REMOVE(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitRemove), ##target, ##trait, ##source) + +///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. +/proc/___TraitAdd(target,trait,source) + if(!target || !trait || !source) + return + if(islist(target)) + for(var/i in target) + if(!isatom(i)) + continue + var/atom/the_atom = i + ADD_TRAIT(the_atom,trait,source) + else if(isatom(target)) + var/atom/the_atom2 = target + ADD_TRAIT(the_atom2,trait,source) + +///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. +/proc/___TraitRemove(target,trait,source) + if(!target || !trait || !source) + return + if(islist(target)) + for(var/i in target) + if(!isatom(i)) + continue + var/atom/the_atom = i + REMOVE_TRAIT(the_atom,trait,source) + else if(isatom(target)) + var/atom/the_atom2 = target + REMOVE_TRAIT(the_atom2,trait,source) + + +/// Proc that handles adding multiple traits to a target via a list. Must have a common source and target. +/datum/proc/add_traits(list/list_of_traits, source) + ASSERT(islist(list_of_traits), "Invalid arguments passed to add_traits! Invoked on [src] with [list_of_traits], source being [source].") + for(var/trait in list_of_traits) + ADD_TRAIT(src, trait, source) + +/// Proc that handles removing multiple traits from a target via a list. Must have a common source and target. +/datum/proc/remove_traits(list/list_of_traits, source) + ASSERT(islist(list_of_traits), "Invalid arguments passed to remove_traits! Invoked on [src] with [list_of_traits], source being [source].") + for(var/trait in list_of_traits) + REMOVE_TRAIT(src, trait, source) diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index a5c5271c8d7d..8458436a53e5 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -107,6 +107,7 @@ var/const/MAX_FREQ = 1468 // --------------------------------------------------- var/const/HC_FREQ = 1471 var/const/SOF_FREQ = 1472 var/const/PVST_FREQ = 1473 +var/const/CBRN_FREQ = 1474 //Ship department channels var/const/SENTRY_FREQ = 1480 @@ -162,6 +163,7 @@ var/list/radiochannels = list( SQUAD_MARINE_5 = ECHO_FREQ, SQUAD_MARINE_CRYO = CRYO_FREQ, SQUAD_SOF = SOF_FREQ, + SQUAD_CBRN = CBRN_FREQ, RADIO_CHANNEL_ALAMO = DS1_FREQ, RADIO_CHANNEL_NORMANDY = DS2_FREQ, @@ -262,6 +264,7 @@ SUBSYSTEM_DEF(radio) "[DELTA_FREQ]" = "deltaradio", "[ECHO_FREQ]" = "echoradio", "[CRYO_FREQ]" = "cryoradio", + "[CBRN_FREQ]" = "hcradio", "[SOF_FREQ]" = "hcradio", "[HC_FREQ]" = "hcradio", "[PVST_FREQ]" = "pvstradio", diff --git a/code/controllers/subsystem/game_decorator.dm b/code/controllers/subsystem/game_decorator.dm index cfee0406f84a..dd53b647d1a8 100644 --- a/code/controllers/subsystem/game_decorator.dm +++ b/code/controllers/subsystem/game_decorator.dm @@ -20,7 +20,7 @@ SUBSYSTEM_DEF(game_decorator) var/defer_decoration = TRUE //! So map decoration is done post-setup after nightmare and spawners /datum/game_decorator/New() - if(defer_decoration) + if(defer_decoration && is_active_decor()) RegisterSignal(SSdcs, COMSIG_GLOB_MODE_POSTSETUP, PROC_REF(defered_decoration)) /datum/game_decorator/proc/is_active_decor() diff --git a/code/datums/agents/tools/chloroform.dm b/code/datums/agents/tools/chloroform.dm index 464533309bcc..cc804c1d270c 100644 --- a/code/datums/agents/tools/chloroform.dm +++ b/code/datums/agents/tools/chloroform.dm @@ -48,7 +48,7 @@ /obj/item/weapon/chloroform/proc/grab_stun(mob/living/M, mob/living/user) M.anchored = TRUE M.frozen = TRUE - M.density = FALSE + ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) M.able_to_speak = FALSE M.update_canmove() @@ -83,6 +83,7 @@ M.able_to_speak = TRUE M.layer = MOB_LAYER M.unfreeze() + REMOVE_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) QDEL_NULL(mask_item) diff --git a/code/datums/components/cell.dm b/code/datums/components/cell.dm new file mode 100644 index 000000000000..81ef3733e2e2 --- /dev/null +++ b/code/datums/components/cell.dm @@ -0,0 +1,202 @@ +#define UNLIMITED_CHARGE -1 +#define UNLIMITED_DISTANCE -1 + +/datum/component/cell + dupe_mode = COMPONENT_DUPE_UNIQUE + /// Maximum charge of the power cell, set to -1 for infinite charge + var/max_charge = 10000 + /// Initial max charge of the power cell + var/initial_max_charge + /// Current charge of power cell + var/charge = 10000 + /// If the component can be recharged by hitting its parent with a cell + var/hit_charge = FALSE + /// The maximum amount that can be recharged per tick when using a cell to recharge this component + var/max_recharge_tick = 400 + /// If draining charge on process(), how much to drain per process call + var/charge_drain = 10 + /// If the parent should show cell charge on examine + var/display_charge = TRUE + /// From how many tiles at the highest someone can examine the parent to see the charge + var/charge_examine_range = 1 + /// If the component requires a cell to be inserted to work instead of having an integrated one + var/cell_insert = FALSE + /// Ref to an inserted cell. Should only be null if cell_insert is false + var/obj/item/cell/inserted_cell + + +/datum/component/cell/Initialize( + max_charge = 10000, + hit_charge = FALSE, + max_recharge_tick = 400, + charge_drain = 10, + display_charge = TRUE, + charge_examine_range = 1, + cell_insert = FALSE, + ) + + . = ..() + if(!isatom(parent)) + return COMPONENT_INCOMPATIBLE + + src.max_charge = max_charge + charge = max_charge + src.hit_charge = hit_charge + src.max_recharge_tick = max_recharge_tick + src.charge_drain = charge_drain + src.display_charge = display_charge + src.charge_examine_range = charge_examine_range + src.cell_insert = cell_insert + +/datum/component/cell/Destroy(force, silent) + QDEL_NULL(inserted_cell) + return ..() + + +/datum/component/cell/RegisterWithParent() + ..() + RegisterSignal(parent, list(COMSIG_PARENT_ATTACKBY, COMSIG_ITEM_ATTACKED), PROC_REF(on_object_hit)) + RegisterSignal(parent, COMSIG_CELL_ADD_CHARGE, PROC_REF(add_charge)) + RegisterSignal(parent, COMSIG_CELL_USE_CHARGE, PROC_REF(use_charge)) + RegisterSignal(parent, COMSIG_CELL_CHECK_CHARGE, PROC_REF(has_charge)) + RegisterSignal(parent, COMSIG_CELL_START_TICK_DRAIN, PROC_REF(start_drain)) + RegisterSignal(parent, COMSIG_CELL_STOP_TICK_DRAIN, PROC_REF(stop_drain)) + RegisterSignal(parent, COMSIG_CELL_REMOVE_CELL, PROC_REF(remove_cell)) + RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine)) + RegisterSignal(parent, COMSIG_ATOM_EMP_ACT, PROC_REF(on_emp)) + +/datum/component/cell/process() + use_charge(null, charge_drain) + +/datum/component/cell/proc/on_emp(datum/source, severity) + SIGNAL_HANDLER + + use_charge(null, round(max_charge / severity)) + +/datum/component/cell/proc/start_drain(datum/source) + SIGNAL_HANDLER + + START_PROCESSING(SSobj, src) + +/datum/component/cell/proc/stop_drain(datum/source) + SIGNAL_HANDLER + + STOP_PROCESSING(SSobj, src) + +/datum/component/cell/proc/on_examine(datum/source, mob/examiner, list/examine_text) + SIGNAL_HANDLER + + if(!display_charge) + return + + if((charge_examine_range != UNLIMITED_DISTANCE) && get_dist(examiner, parent) > charge_examine_range) + return + + examine_text += "A small gauge in the corner reads \"Power: [round(100 * charge / max_charge)]%\"." + +/datum/component/cell/proc/on_object_hit(datum/source, obj/item/cell/attack_obj, mob/living/attacker, params) + SIGNAL_HANDLER + + if(!hit_charge || !istype(attack_obj)) + return + + if(!cell_insert) + INVOKE_ASYNC(src, PROC_REF(charge_from_cell), attack_obj, attacker) + + else + insert_cell(attack_obj, attacker) + + return COMPONENT_NO_AFTERATTACK|COMPONENT_CANCEL_ITEM_ATTACK + +/datum/component/cell/proc/insert_cell(obj/item/cell/power_cell, mob/living/user) + if(inserted_cell) + to_chat(user, SPAN_WARNING("There's already a power cell in [parent]!")) + return + + if(SEND_SIGNAL(parent, COMSIG_CELL_TRY_INSERT_CELL) & COMPONENT_CANCEL_CELL_INSERT) + return + + power_cell.drop_to_floor(user) + power_cell.forceMove(parent) + inserted_cell = power_cell + charge = power_cell.charge + max_charge = power_cell.maxcharge + +/datum/component/cell/proc/remove_cell(mob/living/user) + SIGNAL_HANDLER + + user.put_in_hands(inserted_cell, TRUE) + to_chat(user, SPAN_NOTICE("You remove [inserted_cell] from [parent].")) + inserted_cell = null + max_charge = initial_max_charge + charge = 0 + +/datum/component/cell/proc/charge_from_cell(obj/item/cell/power_cell, mob/living/user) + if(max_charge == UNLIMITED_CHARGE) + to_chat(user, SPAN_WARNING("[parent] doesn't need more power.")) + return + + while(charge < max_charge) + if(SEND_SIGNAL(parent, COMSIG_CELL_TRY_RECHARGING, user) & COMPONENT_CELL_NO_RECHARGE) + return + + if(power_cell.charge <= 0) + to_chat(user, SPAN_WARNING("[power_cell] is completely dry.")) + return + + if(!do_after(user, 1 SECONDS, (INTERRUPT_ALL & (~INTERRUPT_MOVED)), BUSY_ICON_BUILD, power_cell, INTERRUPT_DIFF_LOC)) + to_chat(user, SPAN_WARNING("You were interrupted.")) + return + + if(power_cell.charge <= 0) + return + + var/to_transfer = min(max_recharge_tick, power_cell.charge, (max_charge - charge)) + if(power_cell.use(to_transfer)) + add_charge(null, to_transfer) + to_chat(user, "You transfer some power between [power_cell] and [parent]. The gauge now reads: [round(100 * charge / max_charge)]%.") + +/datum/component/cell/proc/add_charge(datum/source, charge_add = 0) + SIGNAL_HANDLER + + if(max_charge == UNLIMITED_CHARGE) + return + + if(!charge_add) + return + + charge = clamp(charge + charge_add, 0, max_charge) + +/datum/component/cell/proc/use_charge(datum/source, charge_use = 0) + SIGNAL_HANDLER + + if(max_charge == UNLIMITED_CHARGE) + return + + if(!charge_use) + return + + if(!charge) + return COMPONENT_CELL_NO_USE_CHARGE + + charge = clamp(charge - charge_use, 0, max_charge) + + if(!charge) + on_charge_empty() + return + +/datum/component/cell/proc/has_charge(datum/source, charge_amount = 0) + SIGNAL_HANDLER + + if(!charge) + return COMPONENT_CELL_CHARGE_INSUFFICIENT + + if(charge < charge_amount) + return COMPONENT_CELL_CHARGE_INSUFFICIENT + +/datum/component/cell/proc/on_charge_empty() + stop_drain() + SEND_SIGNAL(parent, COMSIG_CELL_OUT_OF_CHARGE) + +#undef UNLIMITED_CHARGE +#undef UNLIMITED_DISTANCE diff --git a/code/datums/components/crate_tag.dm b/code/datums/components/crate_tag.dm new file mode 100644 index 000000000000..379df82a2084 --- /dev/null +++ b/code/datums/components/crate_tag.dm @@ -0,0 +1,36 @@ +/datum/component/crate_tag + dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS + /// The crate tag used for notifications and as label + var/name + +/datum/component/crate_tag/Initialize(name, obj/structure/closet/crate/masquarade_type) + var/obj/structure/closet/crate/crate = parent + if(!istype(crate)) + return COMPONENT_INCOMPATIBLE + setup(name, masquarade_type) + RegisterSignal(parent, COMSIG_STRUCTURE_CRATE_SQUAD_LAUNCHED, PROC_REF(notify_squad)) + +/datum/component/crate_tag/InheritComponent(datum/component/C, i_am_original, name, obj/structure/closet/crate/masquarade_type) + . = ..() + setup(name, masquarade_type) + +/datum/component/crate_tag/proc/setup(name, obj/structure/closet/crate/masquarade_type) + var/obj/structure/closet/crate/crate = parent + if(masquarade_type) + crate.name = initial(masquarade_type.name) + crate.desc = initial(masquarade_type.desc) + crate.icon_opened = initial(masquarade_type.icon_opened) + crate.icon_closed = initial(masquarade_type.icon_closed) + if(crate.opened) + crate.icon_state = crate.icon_opened + else + crate.icon_state = crate.icon_closed + if(name) + parent.AddComponent(/datum/component/label, name) + src.name = name // Keep it around additionally for notifications + +/// Handler to notify an overwatched squad that this crate has been dropped for them +/datum/component/crate_tag/proc/notify_squad(datum/source, datum/squad/squad) + SIGNAL_HANDLER + squad.send_message("'[name]' supply drop incoming. Heads up!") + squad.send_maptext(name, "Incoming Supply Drop:") diff --git a/code/datums/components/weed_food.dm b/code/datums/components/weed_food.dm index ce6c17e0af95..16be8665f55b 100644 --- a/code/datums/components/weed_food.dm +++ b/code/datums/components/weed_food.dm @@ -259,7 +259,7 @@ active = FALSE merged = TRUE - parent_mob.density = FALSE + ADD_TRAIT(parent_mob, TRAIT_UNDENSE, XENO_WEED_TRAIT) parent_mob.anchored = TRUE parent_mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT parent_mob.plane = FLOOR_PLANE diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index b60b20bc9026..213a959296fb 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -133,6 +133,9 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new) continue dept_flags |= FLAG_SHOW_MARINES squad_sublists[squad_name] = TRUE + ///If it is a real squad in the USCM squad list to prevent the crew manifest from breaking + if(!(squad_name in ROLES_SQUAD_ALL)) + continue LAZYSET(marines_by_squad[squad_name][real_rank], name, rank) //here we fill manifest diff --git a/code/datums/datum.dm b/code/datums/datum.dm index b26c6afe4d91..7d497785a72a 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -19,8 +19,8 @@ /// Active timers with this datum as the target var/list/active_timers - /// Status traits attached. - var/list/status_traits + /// Status traits attached to this datum. associative list of the form: list(trait name (string) = list(source1, source2, source3,...)) + var/list/_status_traits /** * Components attached to this datum diff --git a/code/datums/diseases/black_goo.dm b/code/datums/diseases/black_goo.dm index 38a26f3648c7..d4d9b6f50996 100644 --- a/code/datums/diseases/black_goo.dm +++ b/code/datums/diseases/black_goo.dm @@ -211,6 +211,15 @@ . = ..() reagents.add_reagent("antiZed", 30) +/obj/item/reagent_container/glass/bottle/labeled_black_goo_cure + name = "\"Pathogen\" cure bottle" + desc = "The bottle has a biohazard symbol on the front, and has a label, designating its use against Agent A0-3959X.91–15, colloquially known as the \"Black Goo\"." + icon_state = "bottle20" + +/obj/item/reagent_container/glass/bottle/labeled_black_goo_cure/Initialize() + . = ..() + reagents.add_reagent("antiZed", 60) + /datum/language/zombie name = "Zombie" desc = "A growling, guttural method of communication, only Zombies seem to be capable of producing these sounds." diff --git a/code/datums/emergency_calls/cbrn.dm b/code/datums/emergency_calls/cbrn.dm new file mode 100644 index 000000000000..3a6b1c640632 --- /dev/null +++ b/code/datums/emergency_calls/cbrn.dm @@ -0,0 +1,80 @@ +/datum/emergency_call/cbrn + name = "CBRN (Squad)" + arrival_message = "A CBRN squad has been dispatched to your ship. Stand by." + objectives = "Handle the chemical, biological, radiological, or nuclear threat. Further orders may be provided." + mob_min = 3 + mob_max = 5 + max_heavies = 0 + max_smartgunners = 0 + +/datum/emergency_call/cbrn/create_member(datum/mind/new_mind, turf/override_spawn_loc) + var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point() + + if(!istype(spawn_loc)) + return //Didn't find a useable spawn point. + + var/mob/living/carbon/human/mob = new(spawn_loc) + new_mind.transfer_to(mob, TRUE) + + if(!leader && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(mob.client, JOB_SQUAD_LEADER, time_required_for_job)) + leader = mob + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/leader, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are the CBRN Fireteam Leader!")) + + else if(medics < max_medics && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_MEDIC) && check_timelock(mob.client, JOB_SQUAD_MEDIC, time_required_for_job)) + medics++ + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/medic, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are the CBRN Squad Medic!")) + + else if(engineers < max_engineers && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_ENGINEER) && check_timelock(mob.client, JOB_SQUAD_ENGI, time_required_for_job)) + engineers++ + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/engineer, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are the CBRN Squad Engineer!")) + + else + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/standard, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are a CBRN Squad Rifleman!")) + + to_chat(mob, SPAN_ROLE_BODY("You are a member of the USCM's CBRN. The CBRN is a force that specializes in handling chemical, biological, radiological, and nuclear threats.")) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), mob, SPAN_BOLD("Objectives: [objectives]")), 1 SECONDS) + +/datum/emergency_call/cbrn/ert + name = "CBRN (Distress)" + arrival_message = "Your distress signal has been received and we are dispatching the nearest CBRN squad to board with you now. Stand by." + probability = 10 + +/datum/emergency_call/cbrn/ert/New() + ..() + objectives = "Investigate the distress signal aboard the [MAIN_SHIP_NAME]." + +/datum/emergency_call/cbrn/specialists + name = "CBRN (Specialists)" + mob_min = 2 + mob_max = 5 + max_engineers = 0 + max_medics = 0 + +/datum/emergency_call/cbrn/specialists/New() + var/cbrn_ship_name = "Unit [pick(nato_phonetic_alphabet)]-[rand(1, 99)]" + arrival_message = "[MAIN_SHIP_NAME], CBRN [cbrn_ship_name] has been dispatched. Follow all orders provided by [cbrn_ship_name]." + objectives = "You are a specialist team in [cbrn_ship_name] dispatched to quell a threat to [MAIN_SHIP_NAME]. Further orders may be provided." + +/datum/emergency_call/cbrn/specialists/create_member(datum/mind/new_mind, turf/override_spawn_loc) + var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point() + + if(!istype(spawn_loc)) + return //Didn't find a useable spawn point. + + var/mob/living/carbon/human/mob = new(spawn_loc) + new_mind.transfer_to(mob, TRUE) + + if(!leader && HAS_FLAG(mob.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(mob.client, JOB_SQUAD_LEADER, time_required_for_job)) + leader = mob + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/specialist/lead, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are the CBRN Specialist Squad Leader!")) + else + arm_equipment(mob, /datum/equipment_preset/uscm/cbrn/specialist, TRUE, TRUE) + to_chat(mob, SPAN_ROLE_HEADER("You are a CBRN Specialist!")) + + to_chat(mob, SPAN_ROLE_BODY("You are a member of the USCM's CBRN. The CBRN is a force that specializes in handling chemical, biological, radiological, and nuclear threats.")) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), mob, SPAN_BOLD("Objectives: [objectives]")), 1 SECONDS) diff --git a/code/datums/emergency_calls/emergency_call.dm b/code/datums/emergency_calls/emergency_call.dm index 4c3dfbbfac2b..9db46955a5ea 100644 --- a/code/datums/emergency_calls/emergency_call.dm +++ b/code/datums/emergency_calls/emergency_call.dm @@ -305,7 +305,7 @@ candidates = list() if(arrival_message && announce_incoming) - marine_announcement(arrival_message, "Intercepted Tranmission:") + marine_announcement(arrival_message, "Intercepted Transmission:") /datum/emergency_call/proc/add_candidate(mob/M) if(!M.client || (M.mind && (M.mind in candidates)) || istype(M, /mob/living/carbon/xenomorph)) diff --git a/code/datums/factions/uscm.dm b/code/datums/factions/uscm.dm index cf77142ce5d6..0a9b0cff40b9 100644 --- a/code/datums/factions/uscm.dm +++ b/code/datums/factions/uscm.dm @@ -189,6 +189,19 @@ if(JOB_CMB_OBS) marine_rk = "obs" icon_prefix = "cmb_" + // Check squad marines here too, for the unique ones + if(JOB_SQUAD_ENGI) + marine_rk = "engi" + if(JOB_SQUAD_MEDIC) + marine_rk = "med" + if(JOB_SQUAD_SPECIALIST) + marine_rk = "spec" + if(JOB_SQUAD_SMARTGUN) + marine_rk = "gun" + if(JOB_SQUAD_TEAM_LEADER) + marine_rk = "tl" + if(JOB_SQUAD_LEADER) + marine_rk = "leader" if(marine_rk) var/image/I = image('icons/mob/hud/marine_hud.dmi', current_human, "hudsquad") diff --git a/code/datums/keybinding/communication.dm b/code/datums/keybinding/communication.dm index 4164198d4818..e1ba0ab5a31e 100644 --- a/code/datums/keybinding/communication.dm +++ b/code/datums/keybinding/communication.dm @@ -32,7 +32,7 @@ /datum/keybinding/client/communication/whisper hotkey_keys = list("Unbound") classic_keys = list("Unbound") - name = "Whisper" + name = WHISPER_CHANNEL full_name = "IC Whisper" keybind_signal = COMSIG_KB_CLIENT_WHISPER_DOWN @@ -56,4 +56,4 @@ name = MENTOR_CHANNEL full_name = "Mentor Say" description = "Talk with other mentors." - keybind_signal = COMSIG_KB_ADMIN_ASAY_DOWN + keybind_signal = COMSIG_KB_ADMIN_MENTORSAY_DOWN diff --git a/code/datums/keybinding/human_combat.dm b/code/datums/keybinding/human_combat.dm index 2f37efc61438..d30414d68563 100644 --- a/code/datums/keybinding/human_combat.dm +++ b/code/datums/keybinding/human_combat.dm @@ -190,3 +190,20 @@ var/obj/item/weapon/gun/rifle/m46c/COgun = held_item COgun.toggle_iff(human) return TRUE + +/datum/keybinding/human/combat/toggle_shotgun_tube + hotkey_keys = list("Unbound") + classic_keys = list("Unbound") + name = "toggle_shotgun_tube" + full_name = "Toggle Shotgun Tube" + keybind_signal = COMSIG_KB_HUMAN_WEAPON_SHOTGUN_TUBE + +/datum/keybinding/human/combat/toggle_shotgun_tube/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human = user.mob + var/obj/item/weapon/gun/shotgun/pump/dual_tube/held_item = human.get_held_item() + if(istype(held_item)) + held_item.toggle_tube() + return TRUE diff --git a/code/datums/map_config.dm b/code/datums/map_config.dm index 1f3c265ead76..3bf5c601cec9 100644 --- a/code/datums/map_config.dm +++ b/code/datums/map_config.dm @@ -87,12 +87,14 @@ /datum/equipment_preset/synth/survivor/janitor_synth, /datum/equipment_preset/synth/survivor/chef_synth, /datum/equipment_preset/synth/survivor/teacher_synth, + /datum/equipment_preset/synth/survivor/freelancer_synth, + /datum/equipment_preset/synth/survivor/trucker_synth, /datum/equipment_preset/synth/survivor/bartender_synth, /datum/equipment_preset/synth/survivor/detective_synth, /datum/equipment_preset/synth/survivor/cmb_synth, - /datum/equipment_preset/synth/survivor/security_synth, - /datum/equipment_preset/synth/survivor/protection_synth, - /datum/equipment_preset/synth/survivor/corporate_synth, + /datum/equipment_preset/synth/survivor/wy/security_synth, + /datum/equipment_preset/synth/survivor/wy/protection_synth, + /datum/equipment_preset/synth/survivor/wy/corporate_synth, /datum/equipment_preset/synth/survivor/radiation_synth, ) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 2e56b963e88f..9e8279a843a4 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -29,9 +29,14 @@ research_objective_interface = new() /datum/mind/Destroy() + QDEL_NULL(initial_account) QDEL_NULL(objective_memory) QDEL_NULL(objective_interface) QDEL_NULL(research_objective_interface) + current = null + original = null + ghost_mob = null + player_entity = null return ..() /datum/mind/proc/transfer_to(mob/living/new_character, force = FALSE) diff --git a/code/datums/statistics/entities/caste_stats.dm b/code/datums/statistics/entities/caste_stats.dm index 639e1b4a05f5..6bfc18d124b7 100644 --- a/code/datums/statistics/entities/caste_stats.dm +++ b/code/datums/statistics/entities/caste_stats.dm @@ -3,6 +3,10 @@ var/total_hits = 0 var/list/abilities_used = list() // types of /datum/entity/statistic, "tail sweep" = 10, "screech" = 2 +/datum/entity/player_stats/caste/Destroy(force) + . = ..() + QDEL_LIST_ASSOC_VAL(abilities_used) + /datum/entity/player_stats/caste/proc/setup_ability(ability) if(!ability) return diff --git a/code/datums/statistics/entities/death_stats.dm b/code/datums/statistics/entities/death_stats.dm index cb3053a33442..35ff1769b925 100644 --- a/code/datums/statistics/entities/death_stats.dm +++ b/code/datums/statistics/entities/death_stats.dm @@ -140,16 +140,16 @@ new_death.detach() return new_death -/mob/living/carbon/human/track_mob_death(cause, cause_mob) - . = ..(cause, cause_mob, job) +/mob/living/carbon/human/track_mob_death(datum/cause_data/cause_data, turf/death_loc) + . = ..() if(statistic_exempt || !mind) return var/datum/entity/player_stats/human/human_stats = mind.setup_human_stats() if(human_stats && human_stats.death_list) human_stats.death_list.Insert(1, .) -/mob/living/carbon/xenomorph/track_mob_death(cause, cause_mob) - var/datum/entity/statistic/death/new_death = ..(cause, cause_mob, caste_type) +/mob/living/carbon/xenomorph/track_mob_death(datum/cause_data/cause_data, turf/death_loc) + var/datum/entity/statistic/death/new_death = ..() if(!new_death) return new_death.is_xeno = TRUE // this was placed beneath the if below, which meant gibbing as a xeno wouldn't track properly in stats diff --git a/code/datums/statistics/entities/human_stats.dm b/code/datums/statistics/entities/human_stats.dm index 51b07867dfd3..1e15aa1d161b 100644 --- a/code/datums/statistics/entities/human_stats.dm +++ b/code/datums/statistics/entities/human_stats.dm @@ -5,10 +5,17 @@ var/total_shots = 0 var/total_shots_hit = 0 var/total_screams = 0 - var/datum/entity/weapon_stats/top_weapon = null // reference to /datum/entity/weapon_stats (like tac-shotty) - var/list/weapon_stats_list = list() // list of types /datum/entity/weapon_stats - var/list/job_stats_list = list() // list of types /datum/entity/job_stats - var/list/datum/entity/statistic/medal/medal_list = list() // list of all medals earned + var/list/weapon_stats_list = list() //! indexed list of types /datum/entity/weapon_stats + var/list/job_stats_list = list() //! indexed list of types /datum/entity/job_stats + var/datum/entity/weapon_stats/top_weapon //! reference to /datum/entity/weapon_stats (like tac-shotty) + var/list/datum/entity/statistic/medal/medal_list = list() //! list of all medals earned + +/datum/entity/player_stats/human/Destroy(force) + . = ..() + QDEL_LIST_ASSOC_VAL(weapon_stats_list) + QDEL_LIST_ASSOC_VAL(job_stats_list) + QDEL_NULL(top_weapon) + QDEL_LIST(medal_list) /datum/entity/player_stats/human/get_playtime(type) if(!type) diff --git a/code/datums/statistics/entities/job_stats.dm b/code/datums/statistics/entities/job_stats.dm index ecde1c942082..199c2adb3160 100644 --- a/code/datums/statistics/entities/job_stats.dm +++ b/code/datums/statistics/entities/job_stats.dm @@ -1,8 +1,8 @@ /datum/entity/player_stats/job - var/name = null - var/total_friendly_fire = null - var/total_revives = null - var/total_lives_saved = null - var/total_shots = null - var/total_shots_hit = null - var/total_screams = null + var/name + var/total_friendly_fire + var/total_revives + var/total_lives_saved + var/total_shots + var/total_shots_hit + var/total_screams diff --git a/code/datums/statistics/entities/panel_stats.dm b/code/datums/statistics/entities/panel_stats.dm index d6e391e1731f..e507d5d81a8b 100644 --- a/code/datums/statistics/entities/panel_stats.dm +++ b/code/datums/statistics/entities/panel_stats.dm @@ -8,7 +8,7 @@ update_panel_data(round_statistics) ui_interact(user) -/datum/entity/player_entity/proc/ui_interact(mob/user, ui_key = "statistics", datum/nanoui/ui = null, force_open = 1) +/datum/entity/player_entity/proc/ui_interact(mob/user, ui_key = "statistics", datum/nanoui/ui, force_open = 1) data["menu"] = menu data["subMenu"] = subMenu data["dataMenu"] = dataMenu diff --git a/code/datums/statistics/entities/player_entity.dm b/code/datums/statistics/entities/player_entity.dm index 72f4d95d7aa3..f0b3d37ede7e 100644 --- a/code/datums/statistics/entities/player_entity.dm +++ b/code/datums/statistics/entities/player_entity.dm @@ -8,8 +8,8 @@ /datum/entity/player_entity var/name var/ckey // "cakey" - var/list/datum/entity/player_stats = list() - var/list/datum/entity/statistic/death/death_stats = list() + var/list/player_stats = list() //! Indeed list of /datum/entity/player_stats + var/list/death_stats = list() //! Indexed list of /datum/entity/statistic/death var/menu = 0 var/subMenu = 0 var/dataMenu = 0 @@ -18,6 +18,11 @@ var/savefile_version var/save_loaded = FALSE +/datum/entity/player_entity/Destroy(force) + QDEL_LIST_ASSOC_VAL(player_stats) + QDEL_LIST_ASSOC_VAL(death_stats) + return ..() + /datum/entity/player_entity/proc/get_playtime(branch, type) var/playtime = 0 if(player_stats["[branch]"]) diff --git a/code/datums/statistics/entities/player_stats.dm b/code/datums/statistics/entities/player_stats.dm index b378d7c2ea24..d9fbd3b11e03 100644 --- a/code/datums/statistics/entities/player_stats.dm +++ b/code/datums/statistics/entities/player_stats.dm @@ -6,13 +6,21 @@ var/total_rounds_played = 0 var/steps_walked = 0 var/round_played = FALSE - var/datum/entity/statistic/nemesis = null // "runner" = 3 + var/datum/entity/statistic/nemesis // "runner" = 3 var/list/niche_stats = list() // list of type /datum/entity/statistic, "Total Executions" = number var/list/humans_killed = list() // list of type /datum/entity/statistic, "jobname2" = number var/list/xenos_killed = list() // list of type /datum/entity/statistic, "caste" = number var/list/death_list = list() // list of type /datum/entity/death_stats var/display_stat = TRUE +/datum/entity/player_stats/Destroy(force) + QDEL_NULL(nemesis) + QDEL_LIST_ASSOC_VAL(niche_stats) + QDEL_LIST_ASSOC_VAL(humans_killed) + QDEL_LIST_ASSOC_VAL(xenos_killed) + QDEL_LIST_ASSOC_VAL(death_list) + return ..() + /datum/entity/player_stats/proc/get_playtime() return total_playtime diff --git a/code/datums/statistics/entities/round_stats.dm b/code/datums/statistics/entities/round_stats.dm index 0e1fb6e387db..baed6befa912 100644 --- a/code/datums/statistics/entities/round_stats.dm +++ b/code/datums/statistics/entities/round_stats.dm @@ -23,7 +23,7 @@ var/total_slashes = 0 // untracked data - var/datum/entity/statistic/map/current_map = null // reference to current map + var/datum/entity/statistic/map/current_map // reference to current map var/list/datum/entity/statistic/death/death_stats_list = list() var/list/abilities_used = list() // types of /datum/entity/statistic, "tail sweep" = 10, "screech" = 2 @@ -37,8 +37,20 @@ var/list/job_stats_list = list() // list of types /datum/entity/job_stats // nanoui data - var/round_data[0] - var/death_data[0] + var/list/round_data = list() + var/list/death_data = list() + +/datum/entity/statistic/round/Destroy(force) + . = ..() + QDEL_NULL(current_map) + QDEL_LIST(death_stats_list) + QDEL_LIST_ASSOC_VAL(abilities_used) + QDEL_LIST_ASSOC_VAL(final_participants) + QDEL_LIST_ASSOC_VAL(hijack_participants) + QDEL_LIST_ASSOC_VAL(total_deaths) + QDEL_LIST_ASSOC_VAL(caste_stats_list) + QDEL_LIST_ASSOC_VAL(weapon_stats_list) + QDEL_LIST_ASSOC_VAL(job_stats_list) /datum/entity_meta/statistic_round entity_type = /datum/entity/statistic/round diff --git a/code/datums/statistics/entities/weapon_stats.dm b/code/datums/statistics/entities/weapon_stats.dm index 0d8458c20de2..9fff5c514458 100644 --- a/code/datums/statistics/entities/weapon_stats.dm +++ b/code/datums/statistics/entities/weapon_stats.dm @@ -1,16 +1,23 @@ /datum/entity/weapon_stats - var/datum/entity/player = null // "deanthelis" - var/list/niche_stats = list() // list of type /datum/entity/statistic, "Total Reloads" = number - var/list/humans_killed = list() // list of type /datum/entity/statistic, "jobname2" = number - var/list/xenos_killed = list() // list of type /datum/entity/statistic, "caste" = number - var/name = null + var/datum/entity/player + var/list/niche_stats = list() //! Indexed list of /datum/entity/statistic, "Total Reloads" = number + var/list/humans_killed = list() //! Indexed list of /datum/entity/statistic, "jobname2" = number + var/list/xenos_killed = list() //! Indexed list of /datum/entity/statistic, "caste" = number + var/name var/total_kills = 0 - var/total_hits = null - var/total_shots = null - var/total_shots_hit = null - var/total_friendly_fire = null + var/total_hits + var/total_shots + var/total_shots_hit + var/total_friendly_fire var/display_stat = TRUE +/datum/entity/weapon_stats/Destroy(force) + player = null + QDEL_LIST_ASSOC_VAL(niche_stats) + QDEL_LIST_ASSOC_VAL(humans_killed) + QDEL_LIST_ASSOC_VAL(xenos_killed) + return ..() + /datum/entity/weapon_stats/proc/count_human_kill(job_name) if(!job_name) return diff --git a/code/datums/statistics/entities/xeno_stats.dm b/code/datums/statistics/entities/xeno_stats.dm index 9ed327258258..8fff4a2e5dd3 100644 --- a/code/datums/statistics/entities/xeno_stats.dm +++ b/code/datums/statistics/entities/xeno_stats.dm @@ -4,6 +4,12 @@ var/list/caste_stats_list = list() // list of types /datum/entity/player_stats/caste var/list/datum/entity/statistic/medal/medal_list = list() // list of all royal jelly earned +/datum/entity/player_stats/xeno/Destroy(force) + . = ..() + QDEL_NULL(top_caste) + QDEL_LIST_ASSOC_VAL(caste_stats_list) + QDEL_LIST(medal_list) + /datum/entity/player_stats/xeno/get_playtime(type) if(!type || type == FACTION_XENOMORPH) return ..() diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e1541f8368b8..44494bea83a0 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -33,8 +33,11 @@ var/list/filter_data //For handling persistent filters - // Base transform matrix - var/matrix/base_transform = null + /// Base transform matrix, edited by admin tooling and such + var/matrix/base_transform + /// Last transform used before being compound with base_transform + /// This allows us to re-create transform if only base_transform changes + var/matrix/raw_transform ///Chemistry. var/datum/reagents/reagents = null @@ -116,7 +119,14 @@ directive is properly returned. //=========================================================================== - +// TODO make all atoms use set_density, do not rely on it at present +///Setter for the `density` variable to append behavior related to its changing. +/atom/proc/set_density(new_value) + SHOULD_CALL_PARENT(TRUE) + if(density == new_value) + return + . = density + density = new_value //atmos procs @@ -141,15 +151,27 @@ directive is properly returned. if(loc) return loc.return_gas() -// Updates the atom's transform -/atom/proc/apply_transform(matrix/M) - if(!base_transform) - transform = M - return +/// Updates the atom's transform compounding it with [/atom/var/base_transform] +/atom/proc/apply_transform(matrix/new_transform, time = 0, easing = (EASE_IN|EASE_OUT)) + var/matrix/base_copy + if(base_transform) + base_copy = matrix(base_transform) + else + base_copy = matrix() + raw_transform = matrix(new_transform) // Keep a copy to replay if needed - var/matrix/base_copy = matrix(base_transform) // Compose the base and applied transform in that order - transform = base_copy.Multiply(M) + var/matrix/complete = base_copy.Multiply(raw_transform) + + if(!time) + transform = complete + return + animate(src, transform = complete, time = time, easing = easing) + +/// Upates the base_transform which will be compounded with other transforms +/atom/proc/update_base_transform(matrix/new_transform, time = 0) + base_transform = matrix(new_transform) + apply_transform(raw_transform, time) /atom/proc/on_reagent_change() return @@ -183,7 +205,9 @@ directive is properly returned. return /atom/proc/emp_act(severity) - return + SHOULD_CALL_PARENT(TRUE) + + SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity) /atom/proc/in_contents_of(container)//can take class or object instance as argument if(ispath(container)) @@ -223,8 +247,8 @@ directive is properly returned. if(!examine_strings) log_debug("Attempted to create an examine block with no strings! Atom : [src], user : [user]") return - to_chat(user, examine_block(examine_strings.Join("\n"))) SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, examine_strings) + to_chat(user, examine_block(examine_strings.Join("\n"))) /atom/proc/get_examine_text(mob/user) . = list() @@ -702,7 +726,6 @@ Parameters are passed from New. var/result = tgui_input_list(usr, "Choose the transformation to apply","Transform Mod", list("Scale","Translate","Rotate")) if(!result) return - var/matrix/M = transform if(!result) return switch(result) @@ -711,18 +734,21 @@ Parameters are passed from New. var/y = tgui_input_real_number(usr, "Choose y mod","Transform Mod") if(isnull(x) || isnull(y)) return - transform = M.Scale(x,y) + var/matrix/base_matrix = matrix(base_transform) + update_base_transform(base_matrix.Scale(x,y)) if("Translate") var/x = tgui_input_real_number(usr, "Choose x mod (negative = left, positive = right)","Transform Mod") var/y = tgui_input_real_number(usr, "Choose y mod (negative = down, positive = up)","Transform Mod") if(isnull(x) || isnull(y)) return - transform = M.Translate(x,y) + var/matrix/base_matrix = matrix(base_transform) + update_base_transform(base_matrix.Translate(x,y)) if("Rotate") var/angle = tgui_input_real_number(usr, "Choose angle to rotate","Transform Mod") if(isnull(angle)) return - transform = M.Turn(angle) + var/matrix/base_matrix = matrix(base_transform) + update_base_transform(base_matrix.Turn(angle)) SEND_SIGNAL(src, COMSIG_ATOM_VV_MODIFY_TRANSFORM) diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index d984aaa72c8a..d1c2640a81aa 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -210,6 +210,17 @@ roundstart = FALSE locked = TRUE +/datum/squad/marine/cbrn + name = SQUAD_CBRN + equipment_color = "#3B2A7B" //Chemical Corps Purple + chat_color = "#553EB2" + radio_freq = CBRN_FREQ + minimap_color = "#3B2A7B" + + active = FALSE + roundstart = FALSE + locked = TRUE + //############################### UPP Squads /datum/squad/upp name = "Root" diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 51039663a43f..dc9865f8d6e6 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -579,9 +579,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou new_human.sec_hud_set_ID() new_human.hud_set_squad() - for(var/obj/current_item in new_human.get_contents()) - SEND_SIGNAL(current_item, COMSIG_POST_SPAWN_UPDATE, new_human) - + SEND_SIGNAL(new_human, COMSIG_POST_SPAWN_UPDATE) SSround_recording.recorder.track_player(new_human) //Find which squad has the least population. If all 4 squads are equal it should just use a random one diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 0af38cacd75e..1c240fb05dfb 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -18,16 +18,14 @@ PF.flags_can_pass_all = PASS_OVER|PASS_AROUND|PASS_UNDER /obj/structure/machinery/portable_atmospherics/powered/scrubber/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return if(prob(50/severity)) on = !on update_icon() - ..(severity) - /obj/structure/machinery/portable_atmospherics/powered/scrubber/update_icon() src.overlays = 0 diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 116753093fe5..912a6070328a 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -114,6 +114,7 @@ /obj/structure/machinery/bot/emp_act(severity) + . = ..() var/was_on = on stat |= EMPED new /obj/effect/overlay/temp/emp_sparks (loc) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index d82591994e7b..b88f8249566b 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -916,11 +916,11 @@ post_signal_multiple(control_freq, kv) /obj/structure/machinery/bot/mulebot/emp_act(severity) + . = ..() if (cell) cell.emp_act(severity) if(load) load.emp_act(severity) - ..() /obj/structure/machinery/bot/mulebot/explode() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index d416c561fcd3..3b2a91eea314 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -35,6 +35,9 @@ var/colony_camera_mapload = TRUE + /// If this camera should have innate EMP-proofing + var/emp_proof = FALSE + /obj/structure/machinery/camera/Initialize(mapload, ...) . = ..() WireColorToFlag = randomCameraWires() @@ -72,6 +75,7 @@ if(WEST) pixel_x = 27 /obj/structure/machinery/camera/emp_act(severity) + . = ..() if(!isEmpProof()) if(prob(100/severity)) icon_state = "[initial(icon_state)]emp" @@ -89,7 +93,6 @@ if(can_use()) cameranet.addCamera(src) kick_viewers() - ..() /obj/structure/machinery/camera/ex_act(severity) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index a8735cbc06a8..e5ab520cbee8 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -30,6 +30,7 @@ network = list(CAMERA_NET_LASER_TARGETS) unslashable = TRUE unacidable = TRUE + emp_proof = TRUE /obj/structure/machinery/camera/laser_cam/Initialize(mapload, laser_name) . = ..() @@ -37,8 +38,6 @@ var/area/A = get_area(src) c_tag = "[laser_name] ([A.name])" -/obj/structure/machinery/camera/laser_cam/emp_act(severity) - return //immune to EMPs, just in case /obj/structure/machinery/camera/laser_cam/ex_act() return @@ -125,9 +124,7 @@ invisibility = 101 //fuck you init() colony_camera_mapload = FALSE - -/obj/structure/machinery/camera/autoname/lz_camera/emp_act(severity) - return //immune to EMPs, just in case + emp_proof = TRUE /obj/structure/machinery/camera/autoname/lz_camera/ex_act() return @@ -137,7 +134,7 @@ /obj/structure/machinery/camera/proc/isEmpProof() var/O = locate(/obj/item/stack/sheet/mineral/osmium) in assembly.upgrades - return O + return O || emp_proof /obj/structure/machinery/camera/proc/isXRay() var/obj/item/stock_parts/scanning_module/O = locate(/obj/item/stock_parts/scanning_module) in assembly.upgrades diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index fcd8c65e93ca..eb7a501fa078 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -80,11 +80,11 @@ return /obj/structure/machinery/cell_charger/emp_act(severity) + . = ..() if(inoperable()) return if(charging) charging.emp_act(severity) - ..(severity) /obj/structure/machinery/cell_charger/process() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 8d35dd1b6aff..1ac5a06738d5 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -165,8 +165,8 @@ return /obj/structure/machinery/computer/arcade/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return var/empprize = null var/num_of_prizes = 0 @@ -178,5 +178,3 @@ for(num_of_prizes; num_of_prizes > 0; num_of_prizes--) empprize = pickweight(prizes) new empprize(src.loc) - - ..(severity) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 281c548227b0..0fd487e2ef7c 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -354,8 +354,8 @@ exproof = TRUE colony_camera_mapload = FALSE -/obj/structure/machinery/computer/cameras/mortar/emp_act(severity) - return FALSE +/obj/structure/machinery/computer/cameras/mortar/set_broken() + return /obj/structure/machinery/computer/cameras/dropship name = "abstract dropship camera computer" diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 304b24a14f04..c33517796271 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -31,8 +31,9 @@ return 1 /obj/structure/machinery/computer/emp_act(severity) - if(prob(20/severity)) set_broken() - ..() + . = ..() + if(prob(20/severity)) + set_broken() /obj/structure/machinery/computer/ex_act(severity) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index fe85599018ae..53efad3da877 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -483,8 +483,8 @@ return /obj/structure/machinery/computer/med_data/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return for(var/datum/data/record/R as anything in GLOB.data_core.medical) @@ -509,8 +509,6 @@ qdel(R) continue - ..(severity) - /obj/structure/machinery/computer/med_data/laptop name = "Medical Laptop" diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 857118937910..2d9a4a1dbea4 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -524,8 +524,8 @@ What a mess.*/ return selection.fields["img"] /obj/structure/machinery/computer/secure_data/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return for(var/datum/data/record/R in GLOB.data_core.security) @@ -550,8 +550,6 @@ What a mess.*/ qdel(R) continue - ..(severity) - /obj/structure/machinery/computer/secure_data/detective_computer icon = 'icons/obj/structures/machinery/computer.dmi' icon_state = "messyfiles" diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index a20d344b53a9..60b5aa232940 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -347,8 +347,8 @@ What a mess.*/ return /obj/structure/machinery/computer/skills/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return for(var/datum/data/record/R in GLOB.data_core.security) @@ -373,4 +373,3 @@ What a mess.*/ qdel(R) continue - ..(severity) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 99996bea8978..687882d9d7ae 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -65,6 +65,7 @@ return /obj/structure/machinery/deployable/barrier/emp_act(severity) + . = ..() if(inoperable()) return if(prob(50/severity)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index b7257ff4e7d3..c6d9ddf3efbd 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -866,3 +866,8 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( var/damage = xeno.melee_damage_upper * TAILSTAB_AIRLOCK_DAMAGE_MULTIPLIER take_damage(damage, xeno) return TAILSTAB_COOLDOWN_NORMAL + +/obj/structure/machinery/door/airlock/autoclose() + if(locked) + return + ..() diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index f4d09796194c..feb699fd245e 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -138,7 +138,6 @@ opacity = 0 assembly_type = /obj/structure/airlock_assembly/airlock_assembly_research glass = 1 - heat_proof = 1 req_one_access = list(ACCESS_CIVILIAN_RESEARCH, ACCESS_CIVILIAN_COMMAND, ACCESS_WY_COLONIAL) /obj/structure/machinery/door/airlock/glass_mining/colony diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 578ef368f5d9..021cb60769f9 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -1,4 +1,3 @@ - /obj/structure/machinery/door name = "\improper Door" desc = "It opens and closes." @@ -7,50 +6,43 @@ anchored = TRUE opacity = TRUE density = TRUE - throwpass = 0 + throwpass = FALSE layer = DOOR_OPEN_LAYER minimap_color = MINIMAP_DOOR var/open_layer = DOOR_OPEN_LAYER var/closed_layer = DOOR_CLOSED_LAYER var/id = "" + var/width = 1 var/secondsElectrified = 0 - var/visible = 1 + var/visible = TRUE var/panel_open = FALSE - var/operating = 0 - var/autoclose = 0 - var/glass = 0 - var/normalspeed = 1 - var/openspeed = 10 //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations - var/heat_proof = 0 // For glass airlocks/opacity firedoors - var/air_properties_vary_with_direction = 0 - var/turf/filler //Fixes double door opacity issue + var/operating = FALSE + var/autoclose = FALSE + var/glass = FALSE + /// If FALSE it speeds up the autoclosing timing. + var/normalspeed = TRUE + /// Time to open/close airlock, default is 1 second. + var/openspeed = 1 SECONDS + /// Fixes multi_tile doors opacity issues. + var/list/filler_turfs = list() //Previously this was just var, because no one had forseen someone creating doors more than 2 tiles wide /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey var/masterkey_resist = FALSE var/masterkey_mod = 0.1 - - - //Multi-tile doors - dir = EAST - var/width = 1 + dir = EAST //So multitile doors are directioned properly /obj/structure/machinery/door/Initialize(mapload, ...) . = ..() - if(density) - layer = closed_layer - update_flags_heat_protection(get_turf(src)) - else - layer = open_layer - + layer = density ? closed_layer : open_layer handle_multidoor() /obj/structure/machinery/door/Destroy() . = ..() - if(filler && width > 1) - filler.set_opacity(0)// Ehh... let's hope there are no walls there. Must fix this - filler = null + if(length(filler_turfs) && width > 1) + change_filler_opacity(0) // It still doesn't check for walls, might want to add checking that in the future + filler_turfs = null density = FALSE /obj/structure/machinery/door/initialize_pass_flags(datum/pass_flags_container/PF) @@ -58,21 +50,41 @@ if (PF) PF.flags_can_pass_all = NONE +/// Also refreshes filler_turfs list. +/obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) + // I have no idea why do we null opacity first before... changing it + for(var/turf/filler_turf as anything in filler_turfs) + filler_turf.set_opacity(null) + + filler_turfs = list() + for(var/turf/filler as anything in locate_filler_turfs()) + filler.set_opacity(new_opacity) + filler_turfs += filler + +/// Updates collision box and opacity of multi_tile airlocks. /obj/structure/machinery/door/proc/handle_multidoor() if(width > 1) if(dir in list(EAST, WEST)) bound_width = width * world.icon_size bound_height = world.icon_size - filler = get_step(src,EAST) - filler.set_opacity(opacity) else bound_width = world.icon_size bound_height = width * world.icon_size - filler = get_step(src,NORTH) - filler.set_opacity(opacity) + change_filler_opacity(opacity) + +/// Finds turfs which should be filler ones. +/obj/structure/machinery/door/proc/locate_filler_turfs() + var/turf/filler_temp + var/list/located_turfs = list() -//process() - //return + for(var/i in 1 to width - 1) + if (dir in list(EAST, WEST)) + filler_temp = locate(x + i, y, z) + else + filler_temp = locate(x, y + i, z) + if (filler_temp) + located_turfs += filler_temp + return located_turfs /obj/structure/machinery/door/proc/borders_space() for(var/turf/target in range(1, src)) @@ -81,7 +93,8 @@ return FALSE /obj/structure/machinery/door/Collided(atom/movable/AM) - if(panel_open || operating) return + if(panel_open || operating) + return if(ismob(AM)) var/mob/M = AM if(world.time - M.last_bumped <= openspeed) return //Can bump-open one airlock per second. This is to prevent shock spam. @@ -89,12 +102,10 @@ if(!M.is_mob_restrained() && M.mob_size > MOB_SIZE_SMALL) bumpopen(M) return - if(istype(AM, /obj)) var/obj/O = AM if(O.buckled_mob) Collided(O.buckled_mob) - if(istype(AM, /obj/structure/machinery/bot)) var/obj/structure/machinery/bot/bot = AM if(src.check_access(bot.botcard)) @@ -102,16 +113,17 @@ open() return - /obj/structure/machinery/door/proc/bumpopen(mob/user as mob) - if(operating) return - src.add_fingerprint(user) - if(!src.requiresID()) + if(operating) + return + add_fingerprint(user) + if(!requiresID()) user = null - if(density) - if(allowed(user)) open() - else flick("door_deny", src) + if(allowed(user)) + open() + else + flick("door_deny", src) return /obj/structure/machinery/door/attack_remote(mob/user) @@ -124,9 +136,7 @@ add_fingerprint(user) if(operating) return - if(!Adjacent(user)) - user = null //so allowed(user) always succeeds - if(!requiresID()) + if(!Adjacent(user) || !requiresID()) user = null //so allowed(user) always succeeds if(allowed(user)) if(density) @@ -137,64 +147,56 @@ if(density) flick("door_deny", src) - /obj/structure/machinery/door/attackby(obj/item/I, mob/user) if(!(I.flags_item & NOBLUDGEON)) try_to_activate_door(user) - return 1 + return TRUE /obj/structure/machinery/door/emp_act(severity) - if(prob(20/severity) && (istype(src,/obj/structure/machinery/door/airlock) || istype(src,/obj/structure/machinery/door/window)) ) + . = ..() + if(prob(20/severity) && use_power) open() if(prob(40/severity)) if(secondsElectrified == 0) secondsElectrified = -1 spawn(30 SECONDS) secondsElectrified = 0 - ..() - /obj/structure/machinery/door/ex_act(severity) - if(unacidable) return + if(unacidable) + return if(density) switch(severity) if(0 to EXPLOSION_THRESHOLD_LOW) if(prob(80)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, src) - s.start() + var/datum/effect_system/spark_spread/spark = new /datum/effect_system/spark_spread + spark.set_up(2, 1, src) + spark.start() if(EXPLOSION_THRESHOLD_LOW to INFINITY) qdel(src) else switch(severity) if(0 to EXPLOSION_THRESHOLD_MEDIUM) if(prob(80)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, src) - s.start() + var/datum/effect_system/spark_spread/spark = new /datum/effect_system/spark_spread + spark.set_up(2, 1, src) + spark.start() else qdel(src) return - /obj/structure/machinery/door/get_explosion_resistance() if(density) if(unacidable) - return 1000000 + return 1000000 //Used for negation of explosions, should probably be made into define in the future else return EXPLOSION_THRESHOLD_LOW //this should exactly match the amount of damage needed to destroy the door else return 0 - /obj/structure/machinery/door/update_icon() - if(density) - icon_state = "door1" - else - icon_state = "door0" - return - + icon_state = density ? "door1" : "door0" /obj/structure/machinery/door/proc/do_animate(animation) switch(animation) @@ -212,7 +214,6 @@ flick("door_deny", src) return - /obj/structure/machinery/door/proc/open(forced=0) if(!density) return TRUE @@ -223,8 +224,8 @@ do_animate("opening") icon_state = "door0" set_opacity(FALSE) - if(filler) - filler.set_opacity(opacity) + if(length(filler_turfs)) + change_filler_opacity(opacity) addtimer(CALLBACK(src, PROC_REF(finish_open)), openspeed) return TRUE @@ -235,11 +236,9 @@ if(operating) operating = FALSE - if(autoclose) addtimer(CALLBACK(src, PROC_REF(autoclose)), normalspeed ? 150 + openspeed : 5) - /obj/structure/machinery/door/proc/close() if(density) return TRUE @@ -256,22 +255,19 @@ update_icon() if(visible && !glass) set_opacity(TRUE) - if(filler) - filler.set_opacity(opacity) + if(length(filler_turfs)) + change_filler_opacity(opacity) operating = FALSE /obj/structure/machinery/door/proc/requiresID() return TRUE - -/obj/structure/machinery/door/proc/update_flags_heat_protection(turf/source) - - +/// Used for overriding in airlocks /obj/structure/machinery/door/proc/autoclose() - var/obj/structure/machinery/door/airlock/A = src - if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose) + if(!autoclose) + return + if(!density && !operating) close() - return /obj/structure/machinery/door/Move(new_loc, new_dir) . = ..() @@ -279,16 +275,15 @@ if(dir in list(EAST, WEST)) bound_width = width * world.icon_size bound_height = world.icon_size - filler.set_opacity(0) - filler = (get_step(src,EAST)) //Find new turf - filler.set_opacity(opacity) else bound_width = world.icon_size bound_height = width * world.icon_size - filler.set_opacity(0) - filler = (get_step(src,NORTH)) //Find new turf - filler.set_opacity(opacity) + change_filler_opacity(opacity) +/obj/structure/machinery/door/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) + . = ..() + // Yes, for a split second after departure you can see through rear dropship airlocks, but it's the simplest solution I could've think of + handle_multidoor() /obj/structure/machinery/door/morgue icon = 'icons/obj/structures/doors/doormorgue.dmi' diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index 65ecd67a438e..ca218128160d 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -13,7 +13,6 @@ /obj/structure/machinery/door/airlock/multi_tile/Initialize() . = ..() - handle_multidoor() update_icon() /obj/structure/machinery/door/airlock/multi_tile/glass @@ -137,7 +136,6 @@ /obj/structure/window/framed/almayer, /obj/structure/machinery/door/airlock, ) - var/multi_filler = list() /obj/structure/machinery/door/airlock/multi_tile/almayer/Initialize() . = ..() @@ -233,42 +231,6 @@ req_access = null req_one_access = list(ACCESS_CIVILIAN_BRIG, ACCESS_CIVILIAN_COMMAND, ACCESS_WY_COLONIAL) -/obj/structure/machinery/door/airlock/multi_tile/almayer/handle_multidoor() - . = ..() - if(!(width > 1)) return //Bubblewrap - - update_filler_turfs() - -//We have to find these again since these doors are used on shuttles a lot so the turfs changes -/obj/structure/machinery/door/airlock/multi_tile/almayer/proc/update_filler_turfs() - for(var/turf/T in multi_filler) - T.set_opacity(null) - - multi_filler = list() - for(var/turf/T in get_filler_turfs()) - T.set_opacity(opacity) - multi_filler += list(T) - -/obj/structure/machinery/door/airlock/multi_tile/proc/get_filler_turfs() - . = list() - for(var/i = 1, i < width, i++) - if(dir in list(NORTH, SOUTH)) - var/turf/T = locate(x, y + i, z) - if(T) - . += list(T) - else if(dir in list(EAST, WEST)) - var/turf/T = locate(x + i, y, z) - if(T) - . += list(T) - -/obj/structure/machinery/door/airlock/multi_tile/almayer/open() - . = ..() - update_filler_turfs() - -/obj/structure/machinery/door/airlock/multi_tile/almayer/close() - . = ..() - update_filler_turfs() - //------Dropship Cargo Doors -----// /obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear diff --git a/code/game/machinery/doors/runed_sandstone.dm b/code/game/machinery/doors/runed_sandstone.dm index 4bf66dfdc8d8..a6de7348dd7f 100644 --- a/code/game/machinery/doors/runed_sandstone.dm +++ b/code/game/machinery/doors/runed_sandstone.dm @@ -110,8 +110,8 @@ density = FALSE update_icon() set_opacity(0) - if(filler) - filler.set_opacity(opacity) + if(length(filler_turfs)) + change_filler_opacity(opacity) if(operating) operating = FALSE diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2b57fbd0a44d..bd544c5c3f5a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -11,7 +11,6 @@ flags_atom = ON_BORDER opacity = FALSE var/obj/item/circuitboard/airlock/electronics = null - air_properties_vary_with_direction = 1 /obj/structure/machinery/door/window/Initialize() . = ..() diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index fe1f80646c4f..dd7e0ee70150 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -63,8 +63,9 @@ FIRE ALARM return src.alarm() /obj/structure/machinery/firealarm/emp_act(severity) - if(prob(50/severity)) alarm() - ..() + . = ..() + if(prob(50/severity)) + alarm() /obj/structure/machinery/firealarm/attackby(obj/item/held_object as obj, mob/user as mob) src.add_fingerprint(user) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 75d0de56dec0..cd59862a2e13 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -84,12 +84,11 @@ /obj/structure/machinery/flasher/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return if(prob(75/severity)) flash() - ..(severity) /obj/structure/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj) if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150)) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 33f75c50e341..d5a0505fca17 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -105,11 +105,10 @@ return 1 /obj/structure/machinery/sparker/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return ignite() - ..(severity) /obj/structure/machinery/ignition_switch/attack_remote(mob/user as mob) return attack_hand(user) diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 66eb0386713f..de61830c2501 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -62,8 +62,7 @@ updateicon() /obj/structure/machinery/light_switch/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return power_change() - ..(severity) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 4ce295aa9965..66bf08afba8e 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -175,10 +175,10 @@ Class Procs: . += SPAN_WARNING("[msg]") /obj/structure/machinery/emp_act(severity) + . = ..() if(use_power && stat == 0) use_power(7500/severity) new /obj/effect/overlay/temp/emp_sparks (loc) - ..() /obj/structure/machinery/ex_act(severity) diff --git a/code/game/machinery/medical_pod/sleeper.dm b/code/game/machinery/medical_pod/sleeper.dm index 35d9a44863d2..bf2abe246c35 100644 --- a/code/game/machinery/medical_pod/sleeper.dm +++ b/code/game/machinery/medical_pod/sleeper.dm @@ -332,14 +332,13 @@ /obj/structure/machinery/medical_pod/sleeper/emp_act(severity) + . = ..() if(filtering) toggle_filter() if(inoperable()) - ..(severity) return if(occupant) go_out() - ..() /obj/structure/machinery/medical_pod/sleeper/proc/toggle_filter() if(!occupant) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index c75360e07568..72e311c6d8ff 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -218,20 +218,14 @@ update_icon() /obj/structure/machinery/recharger/emp_act(severity) + . = ..() if(inoperable() || !anchored) - ..(severity) return -/* - if(istype(charging, /obj/item/weapon/gun/energy)) - var/obj/item/weapon/gun/energy/E = charging - if(E.power_supply) - E.power_supply.emp_act(severity) -*/ + if(istype(charging, /obj/item/weapon/baton)) var/obj/item/weapon/baton/B = charging if(B.bcell) B.bcell.charge = 0 - ..(severity) /obj/structure/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier. src.overlays = 0 diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 644402128852..56b782cd77a4 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -109,13 +109,12 @@ return /obj/structure/machinery/recharge_station/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return if(occupant) occupant.emp_act(severity) go_out() - ..(severity) /obj/structure/machinery/recharge_station/update_icon() ..() diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index aa51201ae18b..dd45ad597800 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -40,12 +40,11 @@ /obj/structure/machinery/space_heater/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return if(cell) cell.emp_act(severity) - ..(severity) /obj/structure/machinery/space_heater/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/cell)) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index c56f8da36150..79ead6321502 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -188,11 +188,10 @@ var/emotion = "Neutral" /obj/structure/machinery/ai_status_display/emp_act(severity) + . = ..() if(inoperable()) - ..(severity) return set_picture("ai_bsod") - ..(severity) /obj/structure/machinery/ai_status_display/proc/update() if(mode==0) //Blank diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index 5f26e9d5ed25..a9c7c61bc00d 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -449,8 +449,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) id = "CentComm Receiver" network = "tcommsat" autolinkers = list("receiverCent") - freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ) - + freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ, CBRN_FREQ) //Buses @@ -469,7 +468,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /obj/structure/machinery/telecomms/bus/preset_three id = "Bus 3" network = "tcommsat" - freq_listening = list(SEC_FREQ, COMM_FREQ, WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, JTAC_FREQ, INTEL_FREQ, WY_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ) + freq_listening = list(SEC_FREQ, COMM_FREQ, WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, JTAC_FREQ, INTEL_FREQ, WY_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ, CBRN_FREQ) autolinkers = list("processor3", "security", "command", "JTAC") /obj/structure/machinery/telecomms/bus/preset_four @@ -485,7 +484,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /obj/structure/machinery/telecomms/bus/preset_cent id = "CentComm Bus" network = "tcommsat" - freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ) + freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ, CBRN_FREQ) autolinkers = list("processorCent", "centcomm") //Processors @@ -550,7 +549,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /obj/structure/machinery/telecomms/server/presets/command id = "Command Server" - freq_listening = list(COMM_FREQ, WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, JTAC_FREQ, INTEL_FREQ, WY_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ) + freq_listening = list(COMM_FREQ, WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, JTAC_FREQ, INTEL_FREQ, WY_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ, CBRN_FREQ) autolinkers = list("command") /obj/structure/machinery/telecomms/server/presets/engineering @@ -565,10 +564,9 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /obj/structure/machinery/telecomms/server/presets/centcomm id = "CentComm Server" - freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ) + freq_listening = list(WY_WO_FREQ, PMC_FREQ, DUT_FREQ, YAUT_FREQ, HC_FREQ, PVST_FREQ, SOF_FREQ, CBRN_FREQ) autolinkers = list("centcomm") - //Broadcasters //--PRESET LEFT--// diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 255d70f45870..8b8b12dfd170 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -93,13 +93,13 @@ GLOBAL_LIST_EMPTY_TYPED(telecomms_list, /obj/structure/machinery/telecomms) update_state() /obj/structure/machinery/telecomms/emp_act(severity) + . = ..() if(prob(100/severity)) if(!(stat & EMPED)) stat |= EMPED var/duration = (300 * 10)/severity spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot. stat &= ~EMPED - ..() /* The receiver idles and receives messages from subspace-compatible radio equipment; diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index c530da73d8e5..70ef402ae4e0 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -140,9 +140,9 @@ GLOBAL_LIST_EMPTY(vending_products) if(vend_dir_whitelist) var/user_dir = get_dir(loc, user) if(!(user_dir in vend_dir_whitelist)) - return turf + return get_turf(user) var/turf/relative_turf = get_step(user, vend_dir) - if(relative_turf.Adjacent(src)) + if(relative_turf) return relative_turf return turf diff --git a/code/game/machinery/vending/vendor_types/crew/synthetic.dm b/code/game/machinery/vending/vendor_types/crew/synthetic.dm index 472db608c0f8..b489dbab16a4 100644 --- a/code/game/machinery/vending/vendor_types/crew/synthetic.dm +++ b/code/game/machinery/vending/vendor_types/crew/synthetic.dm @@ -104,7 +104,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_synth, list( list("Surgical Drop Pouch", 0, /obj/item/clothing/accessory/storage/surg_vest/drop_green, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), list("Surgical Drop Pouch (Blue)", 0, /obj/item/clothing/accessory/storage/surg_vest/drop_blue, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), list("Surgical Drop Pouch (Black)", 0, /obj/item/clothing/accessory/storage/surg_vest/drop_black, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), - list("Tool Webbing", 0, /obj/item/clothing/accessory/storage/black_vest/tool_webbing, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), + list("Tool Webbing", 0, /obj/item/clothing/accessory/storage/tool_webbing/equipped, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), list("Drop Pouch", 0, /obj/item/clothing/accessory/storage/droppouch, MARINE_CAN_BUY_ACCESSORY, VENDOR_ITEM_REGULAR), list("SHOES (CHOOSE 1)", 0, null, null, null), diff --git a/code/game/objects/effects/spawners/random.dm b/code/game/objects/effects/spawners/random.dm index a70fb5588f84..d302e7794f8b 100644 --- a/code/game/objects/effects/spawners/random.dm +++ b/code/game/objects/effects/spawners/random.dm @@ -351,8 +351,7 @@ /obj/effect/spawner/random/gun/proc/spawn_weapon_on_floor(gunpath, ammopath, ammo_amount = 1) - var/atom/spawnloc = src - spawnloc = get_turf(spawnloc) + var/turf/spawnloc = get_turf(src) var/obj/gun var/obj/ammo @@ -360,20 +359,20 @@ gun = new gunpath(spawnloc) if(scatter) var/direction = pick(alldirs) - var/turf/T = get_step(gun, direction) - if(!T || T.density) + var/turf/turf = get_step(gun, direction) + if(!turf || turf.density) return - gun.loc = T + gun.forceMove(turf) if(ammopath) for(var/i in 0 to ammo_amount-1) ammo = new ammopath(spawnloc) if(scatter) for(i=0, i 1 || get_dist(user, H) > 1 || H.lying) - return - if (!istype(H)) - return - - if(!do_after(user, cuff_delay, INTERRUPT_ALL, BUSY_ICON_HOSTILE, H, INTERRUPT_MOVED, BUSY_ICON_GENERIC)) - return - - // TODO: apply handcuffs - /obj/item/handcuffs/get_mob_overlay(mob/user_mob, slot) var/image/ret = ..() diff --git a/code/game/objects/items/implants/implant.dm b/code/game/objects/items/implants/implant.dm index d39b7e675452..e7ebe0391fae 100644 --- a/code/game/objects/items/implants/implant.dm +++ b/code/game/objects/items/implants/implant.dm @@ -82,6 +82,7 @@ Implant Specifics:
"} return dat /obj/item/implant/tracking/emp_act(severity) + . = ..() if (malfunction) //no, dawg, you can't malfunction while you are malfunctioning return malfunction = MALFUNCTION_TEMPORARY @@ -216,6 +217,7 @@ Implant Specifics:
"} return 1 /obj/item/implant/explosive/emp_act(severity) + . = ..() if (malfunction) return malfunction = MALFUNCTION_TEMPORARY @@ -307,6 +309,7 @@ the implant may become unstable and either pre-maturely inject the subject or si return /obj/item/implant/chem/emp_act(severity) + . = ..() if (malfunction) return malfunction = MALFUNCTION_TEMPORARY @@ -432,6 +435,7 @@ the implant may become unstable and either pre-maturely inject the subject or si STOP_PROCESSING(SSobj, src) /obj/item/implant/death_alarm/emp_act(severity) //for some reason alarms stop going off in case they are emp'd, even without this + . = ..() if (malfunction) //so I'm just going to add a meltdown chance here return malfunction = MALFUNCTION_TEMPORARY diff --git a/code/game/objects/items/implants/implantneurostim.dm b/code/game/objects/items/implants/implantneurostim.dm index a46cc31a2ca4..544cf70147e2 100644 --- a/code/game/objects/items/implants/implantneurostim.dm +++ b/code/game/objects/items/implants/implantneurostim.dm @@ -105,6 +105,7 @@ /obj/item/implant/neurostim/emp_act(severity) + . = ..() if (malfunction) return if (prob(80)) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 72c49a0ea15a..b20c5671503e 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -99,10 +99,8 @@ var/nvg_maxhealth = 125 var/nvg_health = 125 - var/nvg_maxcharge = 2500 - var/nvg_charge = 2500 - var/nvg_drain = 8 // has a 5 minute duration but byond may give it a couple of irl time due to lag - var/infinite_charge = FALSE + /// How much charge the cell should have at most. -1 is infinite + var/cell_max_charge = 2500 var/activated = FALSE var/nightvision = FALSE @@ -117,6 +115,13 @@ var/mob/living/attached_mob var/lighting_alpha = 100 +/obj/item/prop/helmetgarb/helmet_nvg/Initialize(mapload, ...) + . = ..() + if(shape != NVG_SHAPE_COSMETIC) + AddComponent(/datum/component/cell, cell_max_charge, TRUE, charge_drain = 8) + RegisterSignal(src, COMSIG_CELL_TRY_RECHARGING, PROC_REF(cell_try_recharge)) + RegisterSignal(src, COMSIG_CELL_OUT_OF_CHARGE, PROC_REF(on_power_out)) + /obj/item/prop/helmetgarb/helmet_nvg/on_enter_storage(obj/item/storage/internal/S) ..() @@ -139,42 +144,30 @@ /obj/item/prop/helmetgarb/helmet_nvg/attackby(obj/item/A as obj, mob/user as mob) - if(istype(A,/obj/item/cell)) - recharge(A, user) - if(HAS_TRAIT(A, TRAIT_TOOL_SCREWDRIVER)) repair(user) else ..() -/obj/item/prop/helmetgarb/helmet_nvg/proc/recharge(obj/item/cell/C, mob/user as mob) +/obj/item/prop/helmetgarb/helmet_nvg/proc/cell_try_recharge(datum/source, mob/living/user) + SIGNAL_HANDLER + if(user.action_busy) - return + return COMPONENT_CELL_NO_RECHARGE + if(src != user.get_inactive_hand()) - to_chat(user, SPAN_WARNING("You need to hold \the [src] in hand in order to recharge them.")) - return + to_chat(user, SPAN_WARNING("You need to hold [src] in hand in order to recharge them.")) + return COMPONENT_CELL_NO_RECHARGE + if(shape == NVG_SHAPE_COSMETIC) - to_chat(user, SPAN_WARNING("There is no connector for the power cell inside \the [src].")) - return + to_chat(user, SPAN_WARNING("There is no connector for the power cell inside [src].")) + return COMPONENT_CELL_NO_RECHARGE + if(shape == NVG_SHAPE_BROKEN) - to_chat(user, SPAN_WARNING("You need to repair \the [src] first.")) - return - if(nvg_charge == nvg_maxcharge) - to_chat(user, SPAN_WARNING("\The [src] are already fully charged.")) - return + to_chat(user, SPAN_WARNING("You need to repair [src] first.")) + return COMPONENT_CELL_NO_RECHARGE - while(nvg_charge < nvg_maxcharge) - if(C.charge <= 0) - to_chat(user, SPAN_WARNING("\The [C] is completely dry.")) - break - if(!do_after(user, 1 SECONDS, (INTERRUPT_ALL & (~INTERRUPT_MOVED)), BUSY_ICON_BUILD, C, INTERRUPT_DIFF_LOC)) - to_chat(user, SPAN_WARNING("You were interrupted.")) - break - var/to_transfer = min(400, C.charge, (nvg_maxcharge - nvg_charge)) - if(C.use(to_transfer)) - nvg_charge += to_transfer - to_chat(user, "You transfer some power between \the [C] and \the [src]. The gauge now reads: [round(100.0*nvg_charge/nvg_maxcharge) ]%.") /obj/item/prop/helmetgarb/helmet_nvg/proc/repair(mob/user as mob) if(user.action_busy) @@ -202,7 +195,6 @@ to_chat(user, "You successfully patch \the [src].") nvg_maxhealth = 65 nvg_health = 65 - nvg_drain = initial(nvg_drain) * 2 return else if(nvg_health == nvg_maxhealth) @@ -244,9 +236,6 @@ else if(nvg_health_procent >= 0) . += "They are falling apart." - if (get_dist(user, src) <= 1 && (shape == NVG_SHAPE_FINE || shape == NVG_SHAPE_PATCHED)) - . += "A small gauge in the corner reads: Power: [round(100.0*nvg_charge/nvg_maxcharge) ]%." - /obj/item/prop/helmetgarb/helmet_nvg/on_exit_storage(obj/item/storage/S) remove_attached_item() return ..() @@ -296,7 +285,7 @@ if(attached_mob != user && slot == WEAR_HEAD) set_attached_mob(user) - if(slot == WEAR_HEAD && !nightvision && activated && nvg_charge > 0 && shape > NVG_SHAPE_BROKEN) + if(slot == WEAR_HEAD && !nightvision && activated && !SEND_SIGNAL(src, COMSIG_CELL_CHECK_CHARGE) && shape > NVG_SHAPE_BROKEN) enable_nvg(user) else remove_nvg() @@ -319,7 +308,7 @@ attached_item.update_icon() activation.update_button_icon() - START_PROCESSING(SSobj, src) + SEND_SIGNAL(src, COMSIG_CELL_START_TICK_DRAIN) /obj/item/prop/helmetgarb/helmet_nvg/proc/update_sight(mob/M) @@ -353,20 +342,15 @@ attached_mob.update_sight() - STOP_PROCESSING(SSobj, src) + SEND_SIGNAL(src, COMSIG_CELL_STOP_TICK_DRAIN) /obj/item/prop/helmetgarb/helmet_nvg/process(delta_time) - if(nvg_charge > 0 && !infinite_charge) - nvg_charge = max(0, nvg_charge - nvg_drain * delta_time) - if(!attached_mob) return PROCESS_KILL - if(!activated || !attached_item || nvg_charge <= 0 || attached_mob.is_dead()) - if(activated && !attached_mob.is_dead()) - to_chat(attached_mob, SPAN_WARNING("\The [src] emit a low power warning and immediately shut down!")) - remove_nvg() + if(!activated || !attached_item || attached_mob.is_dead()) + on_power_out() return if(!attached_item.has_garb_overlay()) @@ -375,6 +359,13 @@ return +/obj/item/prop/helmetgarb/helmet_nvg/proc/on_power_out(datum/source) + SIGNAL_HANDLER + + if(activated && !attached_mob.is_dead()) + to_chat(attached_mob, SPAN_WARNING("[src] emit a low power warning and immediately shut down!")) + remove_nvg() + /obj/item/prop/helmetgarb/helmet_nvg/ui_action_click(mob/owner, obj/item/holder) toggle_nods(owner) @@ -410,7 +401,7 @@ if(activated) to_chat(user, SPAN_NOTICE("You flip the goggles down.")) icon_state = active_icon_state - if(nvg_charge > 0 && user.head == attached_item && shape > NVG_SHAPE_BROKEN) + if(!SEND_SIGNAL(src, COMSIG_CELL_CHECK_CHARGE) && user.head == attached_item && shape > NVG_SHAPE_BROKEN) enable_nvg(user) else icon_state = active_icon_state @@ -462,7 +453,7 @@ /obj/item/prop/helmetgarb/helmet_nvg/marsoc //for Marine Raiders name = "\improper Tactical M3 night vision goggles" desc = "With an integrated self-recharging battery, nothing can stop you. Put them on your helmet and press the button and it's go-time." - infinite_charge = TRUE + cell_max_charge = -1 #undef NVG_SHAPE_COSMETIC #undef NVG_SHAPE_BROKEN @@ -527,29 +518,38 @@ icon = 'icons/obj/items/items.dmi' icon_state = "photo" ///The human who spawns with the photo - var/mob/living/carbon/human/owner + var/datum/weakref/owner + ///The belonging human name + var/owner_name + ///The belonging human faction + var/owner_faction ///Text written on the back var/scribble -/obj/item/prop/helmetgarb/family_photo/Initialize(mapload, ...) +/obj/item/prop/helmetgarb/family_photo/pickup(mob/user, silent) . = ..() - if(!mapload) - RegisterSignal(src, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner)) + if(!owner) + RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner)) + ///Sets the owner of the family photo to the human it spawns with, needs var/source for signals -/obj/item/prop/helmetgarb/family_photo/proc/set_owner(source = src, mob/living/carbon/human/user) - UnregisterSignal(src, COMSIG_POST_SPAWN_UPDATE) - owner = user +/obj/item/prop/helmetgarb/family_photo/proc/set_owner(datum/source) + SIGNAL_HANDLER + UnregisterSignal(source, COMSIG_POST_SPAWN_UPDATE) + var/mob/living/carbon/human/user = source + owner = WEAKREF(user) + owner_name = user.name + owner_faction = user.faction /obj/item/prop/helmetgarb/family_photo/get_examine_text(mob/user) . = ..() if(scribble) . += "\"[scribble]\" is written on the back of the photo." - if(user == owner) + if(user.weak_reference == owner) . += "A photo of you and your family." return - if(user.faction == owner?.faction) - . += "A photo of [owner] and their family." + if(user.faction == owner_faction) + . += "A photo of [owner_name] and their family." return . += "A photo of a family you do not know." diff --git a/code/game/objects/items/reagent_containers/glass/bottle.dm b/code/game/objects/items/reagent_containers/glass/bottle.dm index dd857d391b52..01eb751774e1 100644 --- a/code/game/objects/items/reagent_containers/glass/bottle.dm +++ b/code/game/objects/items/reagent_containers/glass/bottle.dm @@ -30,7 +30,7 @@ /obj/item/reagent_container/glass/bottle/Initialize() . = ..() if(!icon_state) - icon_state = "bottle-[rand(1.4)]" + icon_state = "bottle-[rand(1,4)]" /obj/item/reagent_container/glass/bottle/update_icon() overlays.Cut() diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 3b65811b05b3..4b4252bac4b9 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -566,6 +566,18 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r /obj/item/storage/backpack/marine/satchel/rto/pickup(mob/user) . = ..() + autoset_phone_id(user) + +/obj/item/storage/backpack/marine/satchel/rto/equipped(mob/user, slot) + . = ..() + autoset_phone_id(user) + +/// Automatically sets the phone_id based on the current or updated user +/obj/item/storage/backpack/marine/satchel/rto/proc/autoset_phone_id(mob/user) + if(!user) + internal_transmitter.phone_id = "[src]" + internal_transmitter.enabled = FALSE + return if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.comm_title) @@ -579,13 +591,11 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r internal_transmitter.phone_id += " ([H.assigned_squad.name])" else internal_transmitter.phone_id = "[user]" - internal_transmitter.enabled = TRUE /obj/item/storage/backpack/marine/satchel/rto/dropped(mob/user) . = ..() - internal_transmitter.phone_id = "[src]" - internal_transmitter.enabled = FALSE + autoset_phone_id(null) // Disable phone when dropped /obj/item/storage/backpack/marine/satchel/rto/proc/use_phone(mob/user) internal_transmitter.attack_hand(user) @@ -745,6 +755,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r RegisterSignal(H, COMSIG_GRENADE_PRE_PRIME, PROC_REF(cloak_grenade_callback)) RegisterSignal(H, COMSIG_HUMAN_EXTINGUISH, PROC_REF(wrapper_fizzle_camouflage)) + RegisterSignal(H, COMSIG_MOB_EFFECT_CLOAK_CANCEL, PROC_REF(deactivate_camouflage)) camo_active = TRUE ADD_TRAIT(H, TRAIT_CLOAKED, TRAIT_SOURCE_EQUIPMENT(WEAR_BACK)) @@ -774,12 +785,14 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r deactivate_camouflage(wearer, TRUE, TRUE) /obj/item/storage/backpack/marine/satchel/scout_cloak/proc/deactivate_camouflage(mob/living/carbon/human/H, anim = TRUE, forced) + SIGNAL_HANDLER if(!istype(H)) return FALSE UnregisterSignal(H, list( COMSIG_GRENADE_PRE_PRIME, - COMSIG_HUMAN_EXTINGUISH + COMSIG_HUMAN_EXTINGUISH, + COMSIG_MOB_EFFECT_CLOAK_CANCEL, )) if(forced) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 160e4eb7ff0c..ebcf50326070 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -151,6 +151,7 @@ RegisterSignal(SSdcs, COMSIG_GLOB_MODE_PRESETUP, PROC_REF(handle_delete_clash_contents)) /obj/item/storage/box/flashbangs/proc/handle_delete_clash_contents() + SIGNAL_HANDLER if(MODE_HAS_FLAG(MODE_FACTION_CLASH)) var/grenade_count = 0 var/grenades_desired = 4 diff --git a/code/game/objects/items/storage/pouch.dm b/code/game/objects/items/storage/pouch.dm index 086b1b603d8a..525909cb621d 100644 --- a/code/game/objects/items/storage/pouch.dm +++ b/code/game/objects/items/storage/pouch.dm @@ -833,6 +833,15 @@ new /obj/item/stack/medical/advanced/ointment(src) new /obj/item/stack/medical/splint(src) +/obj/item/storage/pouch/medkit/full/toxin/fill_preset_inventory() + new /obj/item/device/healthanalyzer(src) + new /obj/item/storage/pill_bottle/antitox(src) + new /obj/item/storage/pill_bottle/antitox(src) + new /obj/item/roller(src) + new /obj/item/stack/medical/splint(src) + new /obj/item/stack/medical/advanced/bruise_pack(src) + new /obj/item/stack/medical/advanced/ointment(src) + /obj/item/storage/pouch/pressurized_reagent_canister name = "Pressurized Reagent Canister Pouch" max_w_class = SIZE_SMALL diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index e3fbe86c0e3b..6e7e891d6ba8 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -22,7 +22,7 @@ var/atom/movable/screen/storage/storage_start = null //storage UI var/atom/movable/screen/storage/storage_continue = null var/atom/movable/screen/storage/storage_end = null - var/datum/item_storage_box/stored_ISB = null // This contains what previously was known as stored_start, stored_continue, and stored_end + var/datum/item_storage_box/stored_ISB //! This contains what previously was known as stored_start, stored_continue, and stored_end var/atom/movable/screen/close/closer = null var/foldable = null var/use_sound = "rustle" //sound played when used. null for no sound. @@ -212,16 +212,17 @@ if (storage_flags & STORAGE_SHOW_FULLNESS) boxes.update_fullness(src) -var/list/global/item_storage_box_cache = list() +GLOBAL_LIST_EMPTY_TYPED(item_storage_box_cache, /datum/item_storage_box) /datum/item_storage_box - var/atom/movable/screen/storage/start = null - var/atom/movable/screen/storage/continued = null - var/atom/movable/screen/storage/end = null - /// The index that indentifies me inside item_storage_box_cache + var/atom/movable/screen/storage/start + var/atom/movable/screen/storage/continued + var/atom/movable/screen/storage/end + /// The index that indentifies me inside GLOB.item_storage_box_cache var/index /datum/item_storage_box/New() + . = ..() start = new() start.icon_state = "stored_start" continued = new() @@ -233,7 +234,7 @@ var/list/global/item_storage_box_cache = list() QDEL_NULL(start) QDEL_NULL(continued) QDEL_NULL(end) - item_storage_box_cache[index] = null // Or would it be better to -= src? + GLOB.item_storage_box_cache -= index return ..() /obj/item/storage/proc/space_orient_objs(list/obj/item/display_contents) @@ -271,7 +272,7 @@ var/list/global/item_storage_box_cache = list() click_border_start.Add(startpoint) click_border_end.Add(endpoint) - if(!item_storage_box_cache[isb_index]) + if(!GLOB.item_storage_box_cache[isb_index]) var/datum/item_storage_box/box = new() var/matrix/M_start = matrix() var/matrix/M_continue = matrix() @@ -284,9 +285,9 @@ var/list/global/item_storage_box_cache = list() box.continued.apply_transform(M_continue) box.end.apply_transform(M_end) box.index = isb_index - item_storage_box_cache[isb_index] = box + GLOB.item_storage_box_cache[isb_index] = box - var/datum/item_storage_box/ISB = item_storage_box_cache[isb_index] + var/datum/item_storage_box/ISB = GLOB.item_storage_box_cache[isb_index] stored_ISB = ISB storage_start.overlays += ISB.start @@ -851,6 +852,7 @@ W is always an item. stop_warning prevents messaging. user may be null.**/ return ..() /obj/item/storage/emp_act(severity) + . = ..() if(!istype(src.loc, /mob/living)) for(var/obj/O in contents) O.emp_act(severity) diff --git a/code/game/objects/items/tools/misc_tools.dm b/code/game/objects/items/tools/misc_tools.dm index 98dc89321d34..0b4a7cc98775 100644 --- a/code/game/objects/items/tools/misc_tools.dm +++ b/code/game/objects/items/tools/misc_tools.dm @@ -284,21 +284,24 @@ matter = list("metal" = 20, "gold" = 10) var/static/list/colour_list = list("red", "blue", "green", "yellow", "purple", "pink", "brown", "black", "orange") // Can add more colors as required var/current_colour_index = 1 - var/owner = "hard to read text" + var/owner_name -/obj/item/tool/pen/fountain/Initialize(mapload, ...) +/obj/item/tool/pen/fountain/pickup(mob/user, silent) . = ..() - if(!mapload) - RegisterSignal(src, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner)) + if(!owner_name) + RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(set_owner)) ///Sets the owner of the pen to who it spawns with, requires var/source for signals -/obj/item/tool/pen/fountain/proc/set_owner(source = src, mob/living/carbon/human/user) - UnregisterSignal(src, COMSIG_POST_SPAWN_UPDATE) - owner = user +/obj/item/tool/pen/fountain/proc/set_owner(datum/source) + SIGNAL_HANDLER + UnregisterSignal(source, COMSIG_POST_SPAWN_UPDATE) + var/mob/living/carbon/human/user = source + owner_name = user.name /obj/item/tool/pen/fountain/get_examine_text(mob/user) . = ..() - . += "There's a laser engraving of [owner] on it." + if(owner_name) + . += "There's a laser engraving of [owner_name] on it." /obj/item/tool/pen/fountain/attack_self(mob/living/carbon/human/user) if(on) diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 7a17904635f0..851f203c52c1 100644 --- a/code/game/objects/items/toys/toys.dm +++ b/code/game/objects/items/toys/toys.dm @@ -553,15 +553,15 @@ ///Hexadecimal 0-F (0-15) var/static/list/hexadecimal = list("0", "1", "2", "3" , "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F") -/obj/item/toy/plush/therapy/random_color/New(loc, ...) +/obj/item/toy/plush/therapy/random_color/Initialize(mapload, ...) . = ..() var/color_code = "#[pick(hexadecimal)][pick(hexadecimal)][pick(hexadecimal)][pick(hexadecimal)][pick(hexadecimal)][pick(hexadecimal)]" //This is dumb and I hope theres a better way I'm missing color = color_code - desc = "A custom therapy plush, in a unique color. This one is labeled with \"#[color_code]\"." + desc = "A custom therapy plush, in a unique color." /obj/item/toy/plush/random_plushie //Not using an effect so it can fit into storage from loadout name = "random plush" - desc = "You should not be seeing this" + desc = "This plush looks awfully standard and bland. Is it actually yours?" /// Standard plushies for the spawner to pick from var/list/plush_list = list( /obj/item/toy/plush/farwa, @@ -587,22 +587,32 @@ . = ..() if(mapload) //Placed in mapping, will be randomized instantly on spawn create_plushie() - return - RegisterSignal(src, COMSIG_POST_SPAWN_UPDATE, PROC_REF(create_plushie)) + return INITIALIZE_HINT_QDEL + +/obj/item/toy/plush/random_plushie/pickup(mob/user, silent) + . = ..() + RegisterSignal(user, COMSIG_POST_SPAWN_UPDATE, PROC_REF(create_plushie)) ///The randomizer picking and spawning a plushie on either the ground or in the humans backpack. Needs var/source due to signals -/obj/item/toy/plush/random_plushie/proc/create_plushie(source = src, mob/living/user) - UnregisterSignal(src, COMSIG_POST_SPAWN_UPDATE) +/obj/item/toy/plush/random_plushie/proc/create_plushie(datum/source) + SIGNAL_HANDLER + if(source) + UnregisterSignal(source, COMSIG_POST_SPAWN_UPDATE) + var/turf/spawn_location = get_turf(src) var/plush_list_variety = pick(60; plush_list, 40; therapy_plush_list) var/random_plushie = pick(plush_list_variety) - var/obj/item/toy/plush/plush = new random_plushie(get_turf(src)) //Starts on floor by default + var/obj/item/toy/plush/plush = new random_plushie(spawn_location) //Starts on floor by default + var/mob/living/carbon/human/user = source if(!user) //If it didn't spawn on a humanoid qdel(src) return + var/obj/item/storage/backpack/storage = locate() in user //If the user has a backpack, put it there if(storage?.can_be_inserted(plush, user, stop_messages = TRUE)) storage.attempt_item_insertion(plush, TRUE, user) + if(plush.loc == spawn_location) // Still on the ground + user.put_in_hands(plush, drop_on_fail = TRUE) qdel(src) //Admin plushies diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 6cb9f58aae37..82fdf30f0fc4 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -197,9 +197,9 @@ return TRUE /obj/item/weapon/baton/emp_act(severity) + . = ..() if(bcell) bcell.emp_act(severity) //let's not duplicate code everywhere if we don't have to please. - ..() //secborg stun baton module /obj/item/weapon/baton/robot/attack_self(mob/user) diff --git a/code/game/objects/prop.dm b/code/game/objects/prop.dm index e59c24b30d5f..c067a9730e70 100644 --- a/code/game/objects/prop.dm +++ b/code/game/objects/prop.dm @@ -11,6 +11,66 @@ w_class = SIZE_SMALL garbage = TRUE +/obj/item/prop/geiger_counter + name = "geiger counter" + desc = "A geiger counter measures the radiation it receives. This type automatically records and transfers any information it reads, provided it has a battery, with no user input required beyond being enabled." + icon = 'icons/obj/items/devices.dmi' + icon_state = "geiger" + item_state = "" + w_class = SIZE_SMALL + flags_equip_slot = SLOT_WAIST + ///Whether the geiger counter is on or off + var/toggled_on = FALSE + ///Iconstate of geiger counter when on + var/enabled_state = "geiger_on" + ///Iconstate of geiger counter when off + var/disabled_state = "geiger" + ///New battery it will spawn with + var/starting_battery = /obj/item/cell/crap + ///Battery inside geiger counter + var/obj/item/cell/battery //It doesn't drain the battery, but it has a battery for emergency use + +/obj/item/prop/geiger_counter/Initialize(mapload, ...) + . = ..() + if(!starting_battery) + return + battery = new starting_battery(src) + +/obj/item/prop/geiger_counter/Destroy() + . = ..() + if(battery) + qdel(battery) + +/obj/item/prop/geiger_counter/attack_self(mob/user) + . = ..() + toggled_on = !toggled_on + if(!battery) + to_chat(user, SPAN_NOTICE("[src] is missing a battery.")) + return + to_chat(user, SPAN_NOTICE("You [toggled_on ? "enable" : "disable"] [src].")) + update_icon() + +/obj/item/prop/geiger_counter/attackby(obj/item/attacking_item, mob/user) + . = ..() + if(!HAS_TRAIT(attacking_item, TRAIT_TOOL_SCREWDRIVER) && !HAS_TRAIT(attacking_item, TRAIT_TOOL_CROWBAR)) + return + + if(!battery) + to_chat(user, SPAN_NOTICE("There is no battery for you to remove.")) + return + to_chat(user, SPAN_NOTICE("You jam [battery] out of [src] with [attacking_item], prying it out irreversibly.")) + user.put_in_hands(battery) + battery = null + update_icon() + +/obj/item/prop/geiger_counter/update_icon() + . = ..() + + if(battery && toggled_on) + icon_state = enabled_state + return + icon_state = disabled_state + /obj/item/prop/tableflag name = "United Americas table flag" icon = 'icons/obj/items/items.dmi' diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index e290a23a61e9..331cb884bd59 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -30,6 +30,7 @@ return 0 /obj/structure/closet/secure_closet/emp_act(severity) + . = ..() for(var/obj/O in src) O.emp_act(severity) if(!broken) @@ -42,7 +43,6 @@ else src.req_access = list() src.req_access += pick(get_access(ACCESS_LIST_MARINE_MAIN)) - ..() /obj/structure/closet/secure_closet/proc/togglelock(mob/living/user) if(src.opened) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 9f0417ccb372..119615ab7aed 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -12,6 +12,19 @@ throwpass = 1 //prevents moving crates by hurling things at them store_mobs = FALSE var/rigged = 0 + /// Types this crate can be made into + var/list/crate_customizing_types = list( + "Plain" = /obj/structure/closet/crate, + "Weapons" = /obj/structure/closet/crate/weapon, + "Supply" = /obj/structure/closet/crate/supply, + "Ammo" = /obj/structure/closet/crate/ammo, + "Construction" = /obj/structure/closet/crate/construction, + "Explosives" = /obj/structure/closet/crate/explosives, + "Alpha" = /obj/structure/closet/crate/alpha, + "Bravo" = /obj/structure/closet/crate/bravo, + "Charlie" = /obj/structure/closet/crate/charlie, + "Delta" = /obj/structure/closet/crate/delta, + ) /obj/structure/closet/crate/initialize_pass_flags(datum/pass_flags_container/PF) ..() @@ -207,6 +220,7 @@ icon_state = "closed_freezer" icon_opened = "open_freezer" icon_closed = "closed_freezer" + crate_customizing_types = null var/target_temp = T0C - 40 var/cooling_power = 40 diff --git a/code/game/objects/structures/crates_lockers/secure_crates.dm b/code/game/objects/structures/crates_lockers/secure_crates.dm index a308c4c0a21c..28a77e0c81c0 100644 --- a/code/game/objects/structures/crates_lockers/secure_crates.dm +++ b/code/game/objects/structures/crates_lockers/secure_crates.dm @@ -4,6 +4,7 @@ icon_state = "secure_locked_basic" icon_opened = "secure_open_basic" icon_closed = "secure_locked_basic" + crate_customizing_types = null var/icon_locked = "secure_locked_basic" var/icon_unlocked = "secure_unlocked_basic" var/sparks = "securecratesparks" @@ -86,6 +87,7 @@ ..() /obj/structure/closet/crate/secure/emp_act(severity) + . = ..() for(var/obj/O in src) O.emp_act(severity) if(!broken && !opened && prob(50/severity)) @@ -105,7 +107,6 @@ else src.req_access = list() src.req_access += pick(get_access(ACCESS_LIST_MARINE_MAIN)) - ..() //------------------------------------ diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 52c715ed973d..b1e950dd18f0 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -72,6 +72,7 @@ PLANT_CUT_MACHETE = 3 = Needs at least a machete to be cut down addtimer(CALLBACK(src, PROC_REF(burn_up)), spread_time + 5 SECONDS) /obj/structure/flora/proc/spread_fire() + SIGNAL_HANDLER for(var/D in cardinal) //Spread fire var/turf/T = get_step(src.loc, D) if(T) @@ -82,6 +83,7 @@ PLANT_CUT_MACHETE = 3 = Needs at least a machete to be cut down new /obj/flamer_fire(T, create_cause_data("wildfire")) /obj/structure/flora/proc/burn_up() + SIGNAL_HANDLER new /obj/effect/decal/cleanable/dirt(loc) if(center) new /obj/effect/decal/cleanable/dirt(loc) //Produces more ash at the center diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index 7a4274c2c16e..6375fcd13823 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -53,7 +53,7 @@ current_mob.pixel_y = buckling_y["[dir]"] current_mob.pixel_x = buckling_x["[dir]"] current_mob.dir = turn(dir, 180) - current_mob.density = FALSE + ADD_TRAIT(current_mob, TRAIT_UNDENSE, XENO_NEST_TRAIT) pixel_y = buckling_y["[dir]"] pixel_x = buckling_x["[dir]"] if(dir == SOUTH) @@ -67,7 +67,7 @@ current_mob.pixel_y = initial(buckled_mob.pixel_y) current_mob.pixel_x = initial(buckled_mob.pixel_x) - current_mob.density = !(current_mob.lying || current_mob.stat == DEAD) + REMOVE_TRAIT(current_mob, TRAIT_UNDENSE, XENO_NEST_TRAIT) if(dir == SOUTH) current_mob.layer = initial(current_mob.layer) if(!ishuman(current_mob)) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 5042167023e6..38b63b94570c 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -261,7 +261,7 @@ if("Remove") if(!GLOB.trait_name_map) GLOB.trait_name_map = generate_trait_name_map() - for(var/trait in D.status_traits) + for(var/trait in D._status_traits) var/name = GLOB.trait_name_map[trait] || trait available_traits[name] = trait @@ -282,7 +282,7 @@ if("All") source = null if("Specific") - source = input("Source to be removed","Trait Remove/Add") as null|anything in sort_list(D.status_traits[chosen_trait]) + source = input("Source to be removed","Trait Remove/Add") as null|anything in sort_list(D._status_traits[chosen_trait]) if(!source) return REMOVE_TRAIT(D,chosen_trait,source) diff --git a/code/modules/admin/fax_templates.dm b/code/modules/admin/fax_templates.dm index 91b23abb2422..459ab675d3a3 100644 --- a/code/modules/admin/fax_templates.dm +++ b/code/modules/admin/fax_templates.dm @@ -1,11 +1,13 @@ /proc/generate_templated_fax(show_wy_logo, fax_header, fax_subject, addressed_to, message_body, sent_by, sent_title, sent_department) + var/datum/asset/asset = get_asset_datum(/datum/asset/simple/paper) + var/dat = "" dat += "