Electrocution will cause you to blurt out whatever you were typing (#74560)

## About The Pull Request

Basically, calls force say on humans that get electrocuted.
This also applies to baton hits, although they use a probability check.

## Why It's Good For The Game

I just think force_say() is a funny and underutilized feature of tgui
say.

## Changelog

🆑
add: Being electrocuted will most of the time make you blurt out
whatever you were typing. This includes batons. Be careful.
/🆑
This commit is contained in:
ChungusGamer666
2023-04-09 16:52:04 -06:00
committed by GitHub
parent 10bc12e8c5
commit c7ac4f6c0b
2 changed files with 18 additions and 4 deletions
+12
View File
@@ -27,6 +27,8 @@
var/clumsy_knockdown_time = 18 SECONDS
/// How much stamina damage we deal on a successful hit against a living, non-cyborg mob.
var/stamina_damage = 55
/// Chance of causing force_say() when stunning a human mob
var/force_say_chance = 33
/// Can we stun cyborgs?
var/affect_cyborg = FALSE
/// The path of the default sound to play when we stun something.
@@ -197,6 +199,10 @@
target.Paralyze((isnull(stun_override) ? stun_time_cyborg : stun_override) * (trait_check ? 0.1 : 1))
additional_effects_cyborg(target, user)
else
if(ishuman(target))
var/mob/living/carbon/human/human_target = target
if(prob(force_say_chance))
human_target.force_say()
target.apply_damage(stamina_damage, STAMINA)
if(!trait_check)
target.Knockdown((isnull(stun_override) ? knockdown_time : stun_override))
@@ -264,6 +270,10 @@
else
playsound(get_turf(src), 'sound/effects/bang.ogg', 10, TRUE)
else
//straight up always force say for clumsy humans
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
human_user.force_say()
user.Knockdown(clumsy_knockdown_time)
user.apply_damage(stamina_damage, STAMINA)
additional_effects_non_cyborg(user, user) // user is the target here
@@ -368,6 +378,7 @@
item_flags = NONE
force = 5
cooldown = 2.5 SECONDS
force_say_chance = 80 //very high force say chance because it's funny
stamina_damage = 85
clumsy_knockdown_time = 24 SECONDS
affect_cyborg = TRUE
@@ -398,6 +409,7 @@
attack_verb_simple = list("beat")
armor_type = /datum/armor/baton_security
throwforce = 7
force_say_chance = 50
stamina_damage = 60
knockdown_time = 5 SECONDS
clumsy_knockdown_time = 15 SECONDS
@@ -485,10 +485,12 @@
//Don't go further if the shock was blocked/too weak.
if(!.)
return
//Note we both check that the user is in cardiac arrest and can actually heartattack
//If they can't, they're missing their heart and this would runtime
if(undergoing_cardiac_arrest() && can_heartattack() && !(flags & SHOCK_ILLUSION))
if(shock_damage * siemens_coeff >= 1 && prob(25))
if(!(flags & SHOCK_ILLUSION))
if(shock_damage * siemens_coeff >= 5)
force_say()
//Note we both check that the user is in cardiac arrest and can actually heartattack
//If they can't, they're missing their heart and this would runtime
if(undergoing_cardiac_arrest() && can_heartattack() && (shock_damage * siemens_coeff >= 1) && prob(25))
var/obj/item/organ/internal/heart/heart = get_organ_slot(ORGAN_SLOT_HEART)
if(heart.Restart() && stat == CONSCIOUS)
to_chat(src, span_notice("You feel your heart beating again!"))