Files
Bubberstation/code/datums/saymode.dm
Seris02 fc36aea489 runtime fix for borgs cryoing with upgrade modules + no more mmi laying around after they cryo, and various other runtime fixes (#62091)
human huds will no longer runtime and die when prefs aren't initalised
SSEconomy will no longer have to deal with pathed jobs inside accounts
Some of the negative/neutral quirks that use the mind have been relegated to last_mind instead for runtime purposes
Mafia saymode will no longer runtime when someone uses it with no current mafia game
Autolathe secondary_attack will no longer runtime/work only because of runtimes
MULTIPLE CHECKS FOR QDELETED STACKS BEFORE ADDING FINGERPRINTS
More player_list client checks
A lazyinitlist for proximity monitors, as they used lazyremove which nulls the list when it hits zero things in it
A check for cigarettes in case temperature exposure causes a reaction that removes all reagents
Catwalks no longer runtime every time someone walks on them
/obj/machinery/atmospherics/components/binary/crystallizer will no longer runtime on secondary_attack if someone can't interact
cyborg models will no longer assume the thing they're inside is a cyborg and runtime when it isn't (cryopods)
When a simplemob falls into nullspace, it will no longer runtime (goliaths falling into chasms and etc)
runtime fix in techweb.dm when using a card without a sanity check
runtime fix with folders when they have nothing in them
runtime fix with glowing eyes when the LAZYADD doesn't get called in regenerate_light_effets() and so doesn't initalise the list
2021-10-22 10:31:07 +01:00

101 lines
2.9 KiB
Plaintext

/datum/saymode
var/key
var/mode
//Return FALSE if you have handled the message. Otherwise, return TRUE and saycode will continue doing saycode things.
//user = whoever said the message
//message = the message
//language = the language.
/datum/saymode/proc/handle_message(mob/living/user, message, datum/language/language)
return TRUE
/datum/saymode/xeno
key = "a"
mode = MODE_ALIEN
/datum/saymode/xeno/handle_message(mob/living/user, message, datum/language/language)
if(user.hivecheck())
user.alien_talk(message)
return FALSE
/datum/saymode/vocalcords
key = MODE_KEY_VOCALCORDS
mode = MODE_VOCALCORDS
/datum/saymode/vocalcords/handle_message(mob/living/user, message, datum/language/language)
if(iscarbon(user))
var/mob/living/carbon/C = user
var/obj/item/organ/vocal_cords/V = C.getorganslot(ORGAN_SLOT_VOICE)
if(V?.can_speak_with())
V.handle_speech(message) //message
V.speak_with(message) //action
return FALSE
/datum/saymode/binary //everything that uses .b (silicons, drones, swarmers)
key = MODE_KEY_BINARY
mode = MODE_BINARY
/datum/saymode/binary/handle_message(mob/living/user, message, datum/language/language)
if(isswarmer(user))
var/mob/living/simple_animal/hostile/swarmer/S = user
S.swarmer_chat(message)
return FALSE
if(isdrone(user))
var/mob/living/simple_animal/drone/D = user
D.drone_chat(message)
return FALSE
if(user.binarycheck())
user.robot_talk(message)
return FALSE
return FALSE
/datum/saymode/holopad
key = "h"
mode = MODE_HOLOPAD
/datum/saymode/holopad/handle_message(mob/living/user, message, datum/language/language)
if(isAI(user))
var/mob/living/silicon/ai/AI = user
AI.holopad_talk(message, language)
return FALSE
return TRUE
/datum/saymode/monkey
key = "k"
mode = MODE_MONKEY
/datum/saymode/monkey/handle_message(mob/living/user, message, datum/language/language)
var/datum/mind/mind = user.mind
if(!mind)
return TRUE
if(IS_MONKEY_LEADER(mind) || (ismonkey(user) && IS_INFECTED_MONKEY(mind)))
user.log_talk(message, LOG_SAY, tag=SPECIES_MONKEY)
if(prob(75) && ismonkey(user))
user.visible_message(span_notice("\The [user] chimpers."))
var/msg = "<span class='[IS_MONKEY_LEADER(mind) ? "monkeylead" : "monkeyhive"]'><b><font size=2>\[[IS_MONKEY_LEADER(mind) ? "Monkey Leader" : "Monkey"]\]</font> [user]</b>: [message]</span>"
for(var/_M in GLOB.mob_list)
var/mob/M = _M
if(M in GLOB.dead_mob_list)
var/link = FOLLOW_LINK(M, user)
to_chat(M, "[link] [msg]")
if((IS_MONKEY_LEADER(M.mind) || ismonkey(M)) && IS_INFECTED_MONKEY(M.mind))
to_chat(M, msg)
return FALSE
/datum/saymode/mafia
key = "j"
mode = MODE_MAFIA
/datum/saymode/mafia/handle_message(mob/living/user, message, datum/language/language)
var/datum/mafia_controller/MF = GLOB.mafia_game
if (!MF)
return TRUE
var/datum/mafia_role/R = MF.player_role_lookup[user]
if(!R || R.team != "mafia")
return TRUE
MF.send_message(span_changeling("<b>[R.body.real_name]:</b> [message]"),"mafia")
return FALSE