Skip to content

Commit

Permalink
People with lisp now lisp on radio (#3760)
Browse files Browse the repository at this point in the history
# About the pull request

The lisp trait did not affect a flag for speech, making it so lisping
does not occur over radio, this should make it so what they say is
transmitted properly.

# Explain why it's good for the game

Fixes an oversight and allows for lisp speech to be handled by the
handle_speech_problems method. Also realism or something

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/91219575/7526b49e-ff74-4979-8024-71768501e43a)
Poor marine trying to alert command
</details>


# Changelog
:cl:
fix: lisps now occur over radio as well
refactor: Relevant variables relating to speech problems now use true
and false instead of 1 and 0
/:cl:
  • Loading branch information
Ben10083 authored Jun 30, 2023
1 parent 3795db8 commit db2384b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
2 changes: 2 additions & 0 deletions code/modules/character_traits/biology_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@
return

ADD_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK)
target.speech_problem_flag = TRUE

..()

/datum/character_trait/biology/lisp/unapply_trait(mob/living/carbon/human/target)
REMOVE_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK)
target.speech_problem_flag = FALSE
..()

/datum/character_trait/biology/bad_leg
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t
apply_damage(burn, BURN, picked, sharp, edge)
UpdateDamageIcon()
updatehealth()
speech_problem_flag = 1
speech_problem_flag = TRUE


//Heal MANY limbs, in random order
Expand All @@ -308,7 +308,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t

parts -= picked
updatehealth()
speech_problem_flag = 1
speech_problem_flag = TRUE
if(update) UpdateDamageIcon()

// damage MANY limbs, in random order
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

var/voice

var/speech_problem_flag = 0
var/speech_problem_flag = FALSE

var/special_voice = "" // For changing our voice. Used by a symptom.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
return

if(disabilities & TOURETTES)
speech_problem_flag = 1
speech_problem_flag = TRUE
if((prob(10) && knocked_out <= 1))
apply_effect(10, STUN)
spawn()
Expand All @@ -36,7 +36,7 @@
return

if(disabilities & NERVOUS)
speech_problem_flag = 1
speech_problem_flag = TRUE
if(prob(10))
stuttering = max(10, stuttering)
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
if(regular_update && halloss > 0)
apply_damage(-3, HALLOSS)
else if(sleeping)
speech_problem_flag = 1
speech_problem_flag = TRUE
if(regular_update)
handle_dreams()
apply_damage(-3, HALLOSS)
Expand Down Expand Up @@ -122,7 +122,7 @@
handle_statuses()

if(paralyzed)
speech_problem_flag = 1
speech_problem_flag = TRUE
apply_effect(1, WEAKEN)
silent = 1
blinded = TRUE
Expand Down
10 changes: 5 additions & 5 deletions code/modules/mob/living/carbon/human/life/life_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,18 @@

/mob/living/carbon/human/handle_silent()
if(..())
speech_problem_flag = 1
speech_problem_flag = TRUE
return silent

/mob/living/carbon/human/handle_slurring()
if(..())
speech_problem_flag = 1
speech_problem_flag = TRUE
return slurring

/mob/living/carbon/human/handle_stunned()
if(stunned)
adjust_effect(-species.stun_reduction, STUN, EFFECT_FLAG_LIFE)
speech_problem_flag = 1
speech_problem_flag = TRUE
return stunned

/mob/living/carbon/human/handle_dazed()
Expand All @@ -237,7 +237,7 @@
var/final_reduction = skill_resistance + 1
adjust_effect(-final_reduction, DAZE, EFFECT_FLAG_LIFE)
if(dazed)
speech_problem_flag = 1
speech_problem_flag = TRUE
return dazed

/mob/living/carbon/human/handle_knocked_down()
Expand All @@ -262,7 +262,7 @@

/mob/living/carbon/human/handle_stuttering()
if(..())
speech_problem_flag = 1
speech_problem_flag = TRUE
return stuttering

#define HUMAN_TIMER_TO_EFFECT_CONVERSION (0.05) //(1/20) //once per 2 seconds, with effect equal to endurance, which is used later
Expand Down
17 changes: 9 additions & 8 deletions code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,45 +262,46 @@ for it but just ignore it.
/mob/living/carbon/human/proc/handle_speech_problems(message)
var/list/returns[3]
var/verb = "says"
var/handled = 0
var/handled = FALSE
if(silent)
message = ""
handled = 1
handled = TRUE
if(sdisabilities & DISABILITY_MUTE)
message = ""
handled = 1
handled = TRUE
if(wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/horsehead))
var/obj/item/clothing/mask/horsehead/hoers = wear_mask
if(hoers.voicechange)
message = pick("NEEIIGGGHHHH!", "NEEEIIIIGHH!", "NEIIIGGHH!", "HAAWWWWW!", "HAAAWWW!")
verb = pick("whinnies","neighs", "says")
handled = 1
handled = TRUE

var/braindam = getBrainLoss()
if(slurring || stuttering || dazed || braindam >= 60)
msg_admin_niche("[key_name(src)] stuttered while saying: \"[message]\"") //Messages that get modified by the 4 reasons below have their original message logged too
if(slurring)
message = slur(message)
verb = pick("stammers","stutters")
handled = 1
handled = TRUE
if(stuttering)
message = NewStutter(message)
verb = pick("stammers", "stutters")
handled = 1
handled = TRUE
if(dazed)
message = DazedText(message)
verb = pick("mumbles", "babbles")
handled = 1
handled = TRUE
if(braindam >= 60)
handled = 1
handled = TRUE
if(prob(braindam/4))
message = stutter(message, stuttering)
verb = pick("stammers", "stutters")
if(prob(braindam))
message = uppertext(message)
verb = pick("yells like an idiot","says rather loudly")
if(HAS_TRAIT(src, TRAIT_LISPING))
handled = TRUE
var/old_message = message
message = lisp_replace(message)
if(old_message != message)
Expand Down

0 comments on commit db2384b

Please sign in to comment.