This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
say_vr.dm
111 lines (93 loc) · 3.52 KB
/
say_vr.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//////////////////////////////////////////////////////
////////////////////SUBTLE COMMAND//////////////////// (ported from citadel, needed for LOOC and flavour text)
//////////////////////////////////////////////////////
/mob
var/flavor_text = "" //tired of fucking double checking this
/mob/proc/update_flavor_text()
set name = "Update Flavor Text"
set category = "IC"
set src in usr
if(usr != src)
usr << "No."
var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null)
if(msg) //WS edit - "Cancel" does not clear flavor text
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
flavor_text = msg
/mob/proc/warn_flavor_changed()
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
src << "<h2 class='alert'>OOC Warning:</h2>"
src << "<span class='alert'>Your flavor text is likely out of date! <a href='byond://?src=\ref[src];flavor_change=1'>Change</a></span>"
/mob/proc/print_flavor_text()
if(flavor_text && flavor_text != "")
var/msg = replacetext(flavor_text, "\n", " ")
if(length(msg) <= 100)
return "<span class='notice'>[msg]</span>"
else
return "<span class='notice'>[copytext(msg, 1, 97)]... <a href=\"byond://?src=\ref[src];flavor_more=1\">More...</span></a>"
/mob/proc/get_top_level_mob()
if(istype(src.loc,/mob)&&src.loc!=src)
var/mob/M=src.loc
return M.get_top_level_mob()
return src
proc/get_top_level_mob(var/mob/S)
if(istype(S.loc,/mob)&&S.loc!=S)
var/mob/M=S.loc
return M.get_top_level_mob()
return S
/*
SUBTLER //WS - Subtle emotes
*/
/datum/emote/living/subtler
key = "subtler"
key_third_person = "subtler"
message = null
mob_type_blacklist_typecache = list(/mob/living/brain)
/datum/emote/living/subtler/proc/check_invalid(mob/user, input)
if(stop_bad_mime.Find(input, 1, 1))
to_chat(user, "<span class='danger'>Invalid emote.</span>")
return TRUE
return FALSE
/datum/emote/living/subtler/run_emote(mob/user, params, type_override = null)
if(is_banned_from(user, "emote"))
to_chat(user, "You cannot send subtle emotes (banned).")
return FALSE
else if(user.client && user.client.prefs.muted & MUTE_IC)
to_chat(user, "You cannot send IC messages (muted).")
return FALSE
else if(!params)
var/subtle_emote = sanitize(input(user, "Choose an emote to display.", "Subtler"))
if(subtle_emote && !check_invalid(user, subtle_emote))
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
switch(type)
if("Visible")
emote_type = EMOTE_VISIBLE
if("Hearable")
emote_type = EMOTE_AUDIBLE
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = subtle_emote
else
return FALSE
else
message = params
if(type_override)
emote_type = type_override
. = TRUE
if(!can_run_emote(user))
return FALSE
user.log_message(message, LOG_SUBTLER)
message = "<b>[user]</b> " + "<i>[message]</i>"
if(emote_type == EMOTE_AUDIBLE)
user.audible_message(message=message,hearing_distance=1, ignored_mobs = GLOB.dead_mob_list)
else
user.visible_message(message=message,self_message=message,vision_distance=1, ignored_mobs = GLOB.dead_mob_list)
///////////////// VERB CODE
/mob/living/verb/subtler()
set name = "Subtler"
set category = "IC"
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
usr.emote("subtler")