Skip to content

Commit

Permalink
adjsutments and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 5, 2023
1 parent 88db2f7 commit 606c37e
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 109 deletions.
4 changes: 1 addition & 3 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@

//disabilities
#define NEARSIGHTED (1<<0)
#define EPILEPSY (1<<1)
#define COUGHING (1<<2)
#define TOURETTES (1<<3)

#define NERVOUS (1<<4)
#define OPIATE_RECEPTOR_DEFICIENCY (1<<5)
//=================================================
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_VULTURE_USER" = TRAIT_VULTURE_USER,
"TRAIT_CLOAKED" = TRAIT_CLOAKED,
),
// /mob/living/carbon/human = list(
// ),
/mob/living/carbon/xenomorph = list(
"TRAIT_ABILITY_NO_PLASMA_TRANSFER" = TRAIT_ABILITY_NO_PLASMA_TRANSFER,
"TRAIT_ABILITY_OVIPOSITOR" = TRAIT_ABILITY_OVIPOSITOR,
Expand Down Expand Up @@ -394,6 +396,7 @@ GLOBAL_LIST(trait_name_map)
#define TRAIT_SOURCE_ATTACHMENT(slot) "t_s_attachment_[slot]"
///Status trait coming from ability
#define TRAIT_SOURCE_ABILITY(ability) "t_s_ability_[ability]"
#define TRAIT_SOURCE_LIMB(limb) "t_s_limb_[limb]"
///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
Expand Down
3 changes: 0 additions & 3 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,6 @@ DEFINE_BITFIELD(flags_area, list(

DEFINE_BITFIELD(disabilities, list(
"NEARSIGHTED" = NEARSIGHTED,
"EPILEPSY" = EPILEPSY,
"COUGHING" = COUGHING,
"TOURETTES" = TOURETTES,
"NERVOUS" = NERVOUS,
"OPIATE_RECEPTOR_DEFICIENCY" = OPIATE_RECEPTOR_DEFICIENCY,
))
Expand Down
5 changes: 2 additions & 3 deletions code/game/objects/items/devices/megaphone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
return
// we know user is a human now, so adjust user for this check
var/mob/living/carbon/human/humanoid = user
if(humanoid.speech_problem_flag)
var/list/new_message = humanoid.handle_speech_problems(message)
message = new_message[1]
var/list/new_message = humanoid.handle_speech_problems(message)
message = new_message[1]
message = capitalize(message)
log_admin("[key_name(user)] used a megaphone to say: >[message]<")

Expand Down
3 changes: 0 additions & 3 deletions code/modules/character_traits/biology_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@
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
13 changes: 0 additions & 13 deletions code/modules/clothing/masks/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@
siemens_coefficient = 0.9
flags_armor_protection = BODY_FLAG_HEAD|BODY_FLAG_FACE|BODY_FLAG_EYES

/obj/item/clothing/mask/horsehead
name = "horse head mask"
desc = "A mask made of soft vinyl and latex, representing the head of a horse."
icon_state = "horsehead"
item_state = "horsehead"
flags_inventory = COVERMOUTH|COVEREYES
flags_inv_hide = HIDEFACE|HIDEALLHAIR|HIDEEYES|HIDEEARS
flags_armor_protection = BODY_FLAG_HEAD|BODY_FLAG_FACE|BODY_FLAG_EYES
w_class = SIZE_SMALL
var/voicechange = 0
siemens_coefficient = 0.9


/obj/item/clothing/mask/balaclava
name = "balaclava"
desc = "A basic single eye-hole balaclava, available in almost every sporting goods, outdoor supply, or military surplus store in existance, protects your face from the cold almost as well as it conceals it. This one is in a standard black color."
Expand Down
3 changes: 1 addition & 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,6 @@ 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 = TRUE


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

parts -= picked
updatehealth()
speech_problem_flag = TRUE

if(update) UpdateDamageIcon()

// damage MANY limbs, in random order
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@

var/voice

var/speech_problem_flag = FALSE

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

var/last_dam = -1 //Used for determining if we need to process all limbs or just some or even none.
Expand Down
35 changes: 0 additions & 35 deletions code/modules/mob/living/carbon/human/life/handle_disabilities.dm
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
//Refer to life.dm for caller

/mob/living/carbon/human/proc/handle_disabilities()

if(disabilities & EPILEPSY)
if(prob(1) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT))
visible_message(SPAN_DANGER("\The [src] starts having a seizure!"), \
SPAN_DANGER("You start having a seizure!"), null, 5)
apply_effect(10, PARALYZE)
make_jittery(1000)
return

if(disabilities & COUGHING)
if(prob(5) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT))
drop_held_item()
INVOKE_ASYNC(src, PROC_REF(emote), "cough")
return

if(disabilities & TOURETTES)
speech_problem_flag = TRUE
if((prob(10) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)))
apply_effect(10, STUN)
spawn()
switch(rand(1, 3))
if(1)
emote("twitch")
if(2 to 3)
say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
var/old_x = pixel_x
var/old_y = pixel_y
pixel_x += rand(-2, 2)
pixel_y += rand(-1, 1)
sleep(2)
pixel_x = old_x
pixel_y = old_y
return

if(disabilities & NERVOUS)
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 @@ -60,10 +60,6 @@
else
clear_fullscreen("blind")

if(HAS_TRAIT(src, TRAIT_DAZED))
overlay_fullscreen("eye_blurry", /atom/movable/screen/fullscreen/impaired, 5)
else
clear_fullscreen("eye_blurry")
///Pain should override the SetEyeBlur(0) should the pain be painful enough to cause eyeblur in the first place. Also, peepers is essential to make sure eye damage isn't overriden.
var/datum/internal_organ/eyes/peepers = internal_organs_by_name["eyes"]
if((disabilities & NEARSIGHTED) && !HAS_TRAIT(src, TRAIT_NEARSIGHTED_EQUIPMENT) && pain.current_pain < 80 && peepers.organ_status == ORGAN_HEALTHY)
Expand Down Expand Up @@ -163,6 +159,12 @@
interactee.check_eye(src)
return TRUE

/mob/living/carbon/human/on_dazed_trait_gain(datum/source)
. = ..()
overlay_fullscreen("eye_blurry", /atom/movable/screen/fullscreen/impaired, 5)
/mob/living/carbon/human/on_dazed_trait_loss(datum/source)
. = ..()
clear_fullscreen("eye_blurry")

/mob/living/carbon/human/proc/check_status_effects()
var/status_effect_placement = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
if(regular_update && halloss > 0)
apply_damage(-3, HALLOSS)
else if(sleeping)
speech_problem_flag = TRUE
if(regular_update)
handle_dreams()
apply_damage(-3, HALLOSS)
Expand Down Expand Up @@ -121,7 +120,6 @@
handle_statuses()

if(paralyzed)
speech_problem_flag = TRUE
apply_effect(1, WEAKEN)
silent = 1
blinded = TRUE
Expand Down
15 changes: 0 additions & 15 deletions code/modules/mob/living/carbon/human/life/life_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,6 @@
if(G.lighting_alpha < lighting_alpha)
lighting_alpha = G.lighting_alpha

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

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

/mob/living/carbon/human/handle_stuttering()
if(..())
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

/mob/living/carbon/human/GetStunDuration(amount)
Expand Down
28 changes: 4 additions & 24 deletions code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,9 @@
message = capitalize(trim(message))
message = process_chat_markup(message, list("~", "_"))

if(speech_problem_flag)
var/list/handle_r = handle_speech_problems(message)
message = handle_r[1]
verb = handle_r[2]
speech_problem_flag = handle_r[3]

var/list/handle_r = handle_speech_problems(message)
message = handle_r[1]
verb = handle_r[2]
if(!message)
return

Expand Down Expand Up @@ -260,57 +257,40 @@ for it but just ignore it.
return verb

/mob/living/carbon/human/proc/handle_speech_problems(message)
var/list/returns[3]
var/list/returns[2]
var/verb = "says"
var/handled = FALSE
if(silent)
message = ""
handled = TRUE
if(sdisabilities & DISABILITY_MUTE)
message = ""
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 = TRUE

var/braindam = getBrainLoss()
if(slurring || stuttering || HAS_TRAIT(src, TRAIT_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 = TRUE
if(stuttering)
message = NewStutter(message)
verb = pick("stammers", "stutters")
handled = TRUE
if(HAS_TRAIT(src, TRAIT_DAZED))
message = DazedText(message)
verb = pick("mumbles", "babbles")
handled = TRUE
if(braindam >= 60)
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)
verb = "lisps"

returns[1] = message
returns[2] = verb
returns[3] = handled

return returns

/mob/living/carbon/human/hear_apollo()
Expand Down

0 comments on commit 606c37e

Please sign in to comment.