mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Say code fixes.
Lobby players won't hear stuffs Universal hearing with animals won't be a thing. Players won't hear stuff if they are sleeping, though somethings might slip through...
This commit is contained in:
@@ -4,10 +4,19 @@
|
||||
if(!client)
|
||||
return
|
||||
|
||||
if(sleeping)
|
||||
hear_sleep(message)
|
||||
return
|
||||
|
||||
var/style = "body"
|
||||
if(language)
|
||||
if(!say_understands(speaker,language))
|
||||
if(!say_understands(speaker,language))
|
||||
if(istype(speaker,/mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/S = speaker
|
||||
message = pick(S.speak)
|
||||
else
|
||||
message = stars(message)
|
||||
|
||||
if(language)
|
||||
verb = language.speech_verb
|
||||
style = language.colour
|
||||
|
||||
@@ -36,15 +45,29 @@
|
||||
src << "<span class='game say'><span class='name'>[speaker_name]</span>[alt_name] [track]<span class='[style]'>[verb], <span class='message'>\"[message]\"</span></span></span>"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0)
|
||||
if(!client)
|
||||
return
|
||||
|
||||
if(sleeping)
|
||||
hear_sleep(message)
|
||||
return
|
||||
|
||||
var/track = null
|
||||
|
||||
var/style = "body"
|
||||
if(language)
|
||||
if(!say_understands(speaker,language))
|
||||
|
||||
if(!say_understands(speaker,language))
|
||||
if(istype(speaker,/mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/S = speaker
|
||||
message = pick(S.speak)
|
||||
else
|
||||
message = stars(message)
|
||||
|
||||
if(language)
|
||||
verb = language.speech_verb
|
||||
style = language.colour
|
||||
|
||||
@@ -90,3 +113,25 @@
|
||||
src << "[part_a][track][part_b]<span class=\"[style]\"> [verb], \"[message]\"</span></span></span>"
|
||||
else
|
||||
src << "[part_a][speaker_name][part_b]<span class=\"[style]\"> [verb], \"[message]\"</span></span></span>"
|
||||
|
||||
/mob/proc/hear_sleep(var/message)
|
||||
if(prob(15))
|
||||
var/list/punctuation = list(",", "!", ".", ";", "?")
|
||||
var/list/messages = text2list(message, " ")
|
||||
var/R = rand(1, messages.len)
|
||||
var/heardword = messages[R]
|
||||
if(copytext(heardword,1, 1) in punctuation)
|
||||
heardword = copytext(heardword,2)
|
||||
if(copytext(heardword,-1) in punctuation)
|
||||
heardword = copytext(heardword,1,lentext(heardword))
|
||||
var/heard = "<span class = 'game_say'>...You hear something about...[heardword]</span>"
|
||||
|
||||
src << heard
|
||||
else
|
||||
var/heard = "<span class = 'game_say'>...<i>You almost hear someone talking</i>...</span>"
|
||||
|
||||
src << heard
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
..(message, speaking, verb, alt_name, italics, message_range, used_radios)
|
||||
|
||||
/mob/living/carbon/human/say_understands(var/other,var/datum/language/speaking = null)
|
||||
/mob/living/carbon/human/say_understands(var/mob/other,var/datum/language/speaking = null)
|
||||
|
||||
if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak.
|
||||
return 1
|
||||
@@ -138,6 +138,11 @@
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/slime))
|
||||
return 1
|
||||
if (istype(other, /mob/living/simple_animal))
|
||||
if(other.universal_speak || src.universal_speak || src.universal_understand)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/GetVoice()
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
a_intent = "harm"
|
||||
stop_automated_movement = 1
|
||||
status_flags = CANPUSH
|
||||
universal_speak = 1
|
||||
attack_sound = 'sound/weapons/punch1.ogg'
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
speak_emote = list("clicks")
|
||||
emote_hear = list("clicks")
|
||||
emote_see = list("clacks")
|
||||
universal_speak = 1
|
||||
speak_chance = 1
|
||||
turns_per_move = 5
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
response_disarm = "gently moves aside the"
|
||||
response_harm = "swats the"
|
||||
stop_automated_movement = 1
|
||||
universal_speak = 1
|
||||
|
||||
var/parrot_state = PARROT_WANDER //Hunt for a perch when created
|
||||
var/parrot_sleep_max = 25 //The time the parrot sits while perched before looking around. Mosly a way to avoid the parrot's AI in life() being run every single tick.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
icon_dead = "shade_dead"
|
||||
maxHealth = 50
|
||||
health = 50
|
||||
universal_speak = 1
|
||||
speak_emote = list("hisses")
|
||||
emote_hear = list("wails","screeches")
|
||||
response_help = "puts their hand through"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
var/turns_per_move = 1
|
||||
var/turns_since_move = 0
|
||||
universal_speak = 1
|
||||
universal_speak = 0 //No, just no.
|
||||
var/meat_amount = 0
|
||||
var/meat_type
|
||||
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
|
||||
@@ -454,3 +454,15 @@
|
||||
overlays = null
|
||||
if (targeted_by && target_locked)
|
||||
overlays += target_locked
|
||||
|
||||
|
||||
/mob/living/simple_animal/say(var/message, var/datum/language/speaking= null, var/verb = "says")
|
||||
|
||||
if(stat)
|
||||
return
|
||||
if(speak_emote.len)
|
||||
verb = pick(speak_emote)
|
||||
|
||||
..(message, null, verb)
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
maxHealth = 30
|
||||
health = 30
|
||||
|
||||
universal_speak =1
|
||||
|
||||
stop_automated_movement = 1
|
||||
animate_movement = SYNC_STEPS
|
||||
|
||||
|
||||
@@ -413,3 +413,10 @@
|
||||
proc/close_spawn_windows()
|
||||
src << browse(null, "window=latechoices") //closes late choices window
|
||||
src << browse(null, "window=playersetup") //closes the player setup window
|
||||
|
||||
|
||||
/mob/new_player/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "",var/italics = 0, var/mob/speaker = null)
|
||||
return
|
||||
|
||||
/mob/new_player/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user