diff --git a/code/__DEFINES/~doppler_defines/traits/declarations.dm b/code/__DEFINES/~doppler_defines/traits/declarations.dm new file mode 100644 index 0000000000000..391336f06072b --- /dev/null +++ b/code/__DEFINES/~doppler_defines/traits/declarations.dm @@ -0,0 +1,3 @@ +/// The trait that determines if someone has the system shock quirk. +#define TRAIT_SYSTEM_SHOCK "trait_system_shock" + diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 6c0d4441e6463..399f12d91f551 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -578,6 +578,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_IGNORE_FIRE_PROTECTION" = TRAIT_IGNORE_FIRE_PROTECTION, "TRAIT_LEFT_EYE_SCAR" = TRAIT_LEFT_EYE_SCAR, "TRAIT_RIGHT_EYE_SCAR" = TRAIT_RIGHT_EYE_SCAR, + "TRAIT_SYSTEM_SHOCK" = TRAIT_SYSTEM_SHOCK, // DOPPLER EDIT ADDITION ), /obj/item = list( "TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index 0a7eef38b742f..92818a74a4a09 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -333,6 +333,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_IGNORE_FIRE_PROTECTION" = TRAIT_IGNORE_FIRE_PROTECTION, "TRAIT_LEFT_EYE_SCAR" = TRAIT_LEFT_EYE_SCAR, "TRAIT_RIGHT_EYE_SCAR" = TRAIT_RIGHT_EYE_SCAR, + "TRAIT_SYSTEM_SHOCK" = TRAIT_SYSTEM_SHOCK, // DOPPLER EDIT ADDITION ), /obj/item = list( "TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING, diff --git a/code/game/objects/items/robot/items/generic.dm b/code/game/objects/items/robot/items/generic.dm index 385baa0381ae9..894135c7ef468 100644 --- a/code/game/objects/items/robot/items/generic.dm +++ b/code/game/objects/items/robot/items/generic.dm @@ -54,6 +54,7 @@ span_userdanger("[user] prods you with [src]!"), ) + SEND_SIGNAL(attacked_mob, COMSIG_LIVING_MINOR_SHOCK) // DOPPLER EDIT ADDITION playsound(loc, 'sound/items/weapons/egloves.ogg', 50, TRUE, -1) cooldown_check = world.time + cooldown log_combat(user, attacked_mob, "stunned", src, "(Combat mode: [user.combat_mode ? "On" : "Off"])") diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 592d187ebbf0b..35ede57d31d43 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -290,6 +290,7 @@ if(3) brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30) brainmob.emote("alarm") + SEND_SIGNAL(brainmob, COMSIG_LIVING_MINOR_SHOCK) // DOPPLER EDIT ADDITION /obj/item/mmi/atom_deconstruct(disassembled = TRUE) if(brain) diff --git a/modular_doppler/modular_quirks/system_shock/system_shock.dm b/modular_doppler/modular_quirks/system_shock/system_shock.dm new file mode 100644 index 0000000000000..abfc8556bc7ab --- /dev/null +++ b/modular_doppler/modular_quirks/system_shock/system_shock.dm @@ -0,0 +1,31 @@ +/datum/quirk/system_shock + name = "System Shock" + desc = "You and electricity have a volatile relationship. One spark's liable to forcefully reboot your systems. Note: This quirk only works on synths." + gain_text = span_danger("You start feeling nervous around plug sockets.") + lose_text = span_notice("You feel normal about sparks.") + medical_record_text = "Patient's processors are unusually uninsulated." + value = -8 + mob_trait = TRAIT_SYSTEM_SHOCK + icon = FA_ICON_PLUG_CIRCLE_XMARK + quirk_flags = QUIRK_HUMAN_ONLY + +/datum/quirk/system_shock/add(client/client_source) + if(isandroid(quirk_holder)) + RegisterSignals(quirk_holder, list(COMSIG_LIVING_ELECTROCUTE_ACT, COMSIG_LIVING_MINOR_SHOCK), PROC_REF(on_electrocute)) + +/datum/quirk/system_shock/remove() + UnregisterSignal(quirk_holder, list(COMSIG_LIVING_ELECTROCUTE_ACT, COMSIG_LIVING_MINOR_SHOCK)) + + +/datum/quirk/system_shock/proc/on_electrocute() + SIGNAL_HANDLER + var/knockout_length = 20 SECONDS + rand(0 SECONDS, 5 SECONDS) + quirk_holder.set_static_vision(knockout_length) + quirk_holder.balloon_alert(quirk_holder, "system rebooting") + to_chat(quirk_holder, span_danger("CRIT&!AL ERR%R: S#STEM REBO#TING.")) + //The intent with the 0.4 seconds is so that the visual static effect lasts longer than the actual knockout/sleeping effect. + addtimer(CALLBACK(src, PROC_REF(knock_out), knockout_length - 0.4 SECONDS), 2 SECONDS) + +///The length at which unconsciousness lasts during system shock. +/datum/quirk/system_shock/proc/knock_out(length) + quirk_holder.Sleeping(length) diff --git a/tgstation.dme b/tgstation.dme index 4d047136317d3..23f7189562ba6 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -444,6 +444,7 @@ #include "code\__DEFINES\~doppler_defines\traits.dm" #include "code\__DEFINES\~doppler_defines\vv.dm" #include "code\__DEFINES\~doppler_defines\wounds.dm" +#include "code\__DEFINES\~doppler_defines\traits\declarations.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_dreamluau.dm" #include "code\__HELPERS\_lists.dm" @@ -7054,6 +7055,7 @@ #include "modular_doppler\modular_quirks\paycheck_rations\code\tickets.dm" #include "modular_doppler\modular_quirks\permitted_cybernetic\permitted_cybernetic.dm" #include "modular_doppler\modular_quirks\permitted_cybernetic\code\preferences.dm" +#include "modular_doppler\modular_quirks\system_shock\system_shock.dm" #include "modular_doppler\modular_sounds\code\sounds.dm" #include "modular_doppler\modular_species\_species.dm" #include "modular_doppler\modular_species\code\bloodsplatter.dm"