forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from K3Licia/system-shock
"Have You Tried Turning It off and on Again?" | NEW NEGATIVE QUIRK
- Loading branch information
Showing
7 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// The trait that determines if someone has the system shock quirk. | ||
#define TRAIT_SYSTEM_SHOCK "trait_system_shock" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
modular_doppler/modular_quirks/system_shock/system_shock.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters