Merge pull request #10480 from Putnam3145/more_flavor

Added second flavor text, not copied anywhere.
This commit is contained in:
kevinz000
2020-01-12 00:41:47 -08:00
committed by GitHub
3 changed files with 42 additions and 0 deletions

View File

@@ -392,6 +392,13 @@
. += "...?"
else
. += "[print_flavor_text()]"
if(print_flavor_text_2())
if(get_visible_name() == "Unknown") //Are we sure we know who this is? Don't show flavor text unless we can recognize them. Prevents certain metagaming with impersonation.
. += "...?"
else if(skipface) //Sometimes we're not unknown, but impersonating someone in a hardsuit, let's not reveal our flavor text then either.
. += "...?"
else
. += "[print_flavor_text_2()]"
. += "*---------*</span>"
/mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects!

View File

@@ -3,6 +3,7 @@
//////////////////////////////////////////////////////
/mob
var/flavor_text = "" //tired of fucking double checking this
var/flavor_text_2 = ""
/mob/proc/update_flavor_text()
set src in usr
@@ -16,6 +17,19 @@
flavor_text = msg
/mob/proc/update_flavor_text_2()
set src in usr
if(usr != src)
to_chat(usr, "No.")
var/msg = stripped_multiline_input(usr, "Set the temporary flavor text in your 'examine' verb. This should be used only for things pertaining to the current round!", "Short-Term Flavor Text", html_decode(flavor_text_2), MAX_MESSAGE_LEN*2, TRUE)
if(!isnull(msg))
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
flavor_text_2 = msg
/mob/proc/warn_flavor_changed()
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
to_chat(src, "<h2 class='alert'>OOC Warning:</h2>")
@@ -30,6 +44,16 @@
else
return "<span class='notice'>[html_encode(copytext(msg, 1, 37))]... <a href='?src=[REF(src)];flavor_more=1'>More...</span></a>"
/mob/proc/print_flavor_text_2()
if(flavor_text && flavor_text != "")
// We are decoding and then encoding to not only get correct amount of characters, but also to prevent partial escaping characters being shown.
var/msg = html_decode(replacetext(flavor_text_2, "\n", " "))
if(length(msg) <= 40)
return "<span class='notice'>[html_encode(msg)]</span>"
else
return "<span class='notice'>[html_encode(copytext(msg, 1, 37))]... <a href='?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