mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 18:13:35 +00:00
say_understands() fixes and cleanup.
Whether or not someone can understand a language is now handled entirely by the language check in mob/say_understands(). The way the old code was written makes me think it came before languages were implemented.
This commit is contained in:
@@ -142,20 +142,24 @@
|
||||
|
||||
if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak.
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/monkey/diona) && !speaking)
|
||||
|
||||
//These only pertain to common. Languages are handled by mob/say_understands()
|
||||
if (!speaking)
|
||||
if (istype(other, /mob/living/carbon/monkey/diona))
|
||||
if(other.languages.len >= 2) //They've sucked down some blood and can speak common now.
|
||||
return 1
|
||||
|
||||
if (istype(other, /mob/living/silicon))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/brain))
|
||||
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
|
||||
|
||||
//This is already covered by mob/say_understands()
|
||||
//if (istype(other, /mob/living/simple_animal))
|
||||
// if((other.universal_speak && !speaking) || src.universal_speak || src.universal_understand)
|
||||
// return 1
|
||||
// return 0
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
..(message)
|
||||
|
||||
/mob/living/silicon/say_understands(var/other)
|
||||
//These only pertain to common. Languages are handled by mob/say_understands()
|
||||
if (!speaking)
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon))
|
||||
|
||||
@@ -68,31 +68,28 @@
|
||||
|
||||
/mob/proc/say_understands(var/mob/other,var/datum/language/speaking = null)
|
||||
|
||||
if (src.stat == 2) //Dead
|
||||
return 1
|
||||
|
||||
//Universal speak makes everything understandable, for obvious reasons.
|
||||
else if(src.universal_speak || src.universal_understand)
|
||||
return 1
|
||||
|
||||
//Languages are handled after.
|
||||
if (!speaking)
|
||||
if(!other)
|
||||
return 1
|
||||
//Universal speak makes everything understandable, for obvious reasons.
|
||||
else if(other.universal_speak || src.universal_speak || src.universal_understand)
|
||||
if(other.universal_speak)
|
||||
return 1
|
||||
else if (src.stat == 2)
|
||||
if(isAI(src) && ispAI(other))
|
||||
return 1
|
||||
else if (speaking) //Language check.
|
||||
|
||||
var/understood
|
||||
for(var/datum/language/L in src.languages)
|
||||
if(speaking.name == L.name)
|
||||
understood = 1
|
||||
break
|
||||
|
||||
if(understood || universal_speak)
|
||||
if (istype(other, src.type) || istype(src, other.type))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
else if(other.universal_speak || src.universal_speak || src.universal_understand)
|
||||
return 1
|
||||
else if(isAI(src) && ispAI(other))
|
||||
return 1
|
||||
else if (istype(other, src.type) || istype(src, other.type))
|
||||
//Language check.
|
||||
for(var/datum/language/L in src.languages)
|
||||
if(speaking.name == L.name)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_understands(var/other)
|
||||
//These only pertain to common. Languages are handled by mob/say_understands()
|
||||
if (!speaking)
|
||||
if (istype(other, /mob/living/carbon/human))
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/robot))
|
||||
@@ -71,8 +73,6 @@
|
||||
return 1
|
||||
if (istype(other, /mob/living/silicon/ai))
|
||||
return 1
|
||||
if (istype(other, /mob/living/carbon/human/tajaran))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/hive_mainframe/say_quote(var/text)
|
||||
|
||||
Reference in New Issue
Block a user