Files
Bubberstation/code/datums/saymode.dm
Mothblocks 7e4de07506 Remove all gamemodes except Dynamic (#58470)
Removes all /datum/game_mode except dynamic. Eventually, all of mode and game_mode will be removed, and Dynamic will become an ingrained system. Every single other gamemode was unmaintained at best and poisoned other code at worst. Currently all tg servers run 24/7 Dynamic, so the time to act is now.

* Remove gamemode references from age checks

* Monkey

* Remove heretics

* Remove BBs

* Refactor uplinks and remove clown ops

* Remove nuke ops

* Removes and refactors cult

* Remove extended

* Remove and move out meteors

* Removes wizard

* Remove sandbox

* Remove changelings

* Remove traitors

* Remove revs

* Remove gangs

* Remove changing mode and voting for new gamemodes

* get_candidates signature fix

* Summon ERT and NERD in their own panel

* Remove some old unneeded age_check stuff

* Fix old signatures of get_uplink_items

* Use Extended like config for dynamic.json

* Fix discounted gear
2021-04-25 01:55:10 -07:00

99 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="monkey")
if(prob(75) && ismonkey(user))
user.visible_message("<span class='notice'>\The [user] chimpers.</span>")
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
var/datum/mafia_role/R = MF.player_role_lookup[user]
if(!R || R.team != "mafia")
return TRUE
MF.send_message("<span class='changeling'><b>[R.body.real_name]:</b> [message]</span>","mafia")
return FALSE