Merge remote-tracking branch 'upstream/master' into TGUIs_Nexties
This commit is contained in:
@@ -232,14 +232,16 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
var/b_val
|
||||
var/g_val
|
||||
var/color_format = length(input_color)
|
||||
if(color_format != length_char(input_color))
|
||||
return 0
|
||||
if(color_format == 3)
|
||||
r_val = hex2num(copytext(input_color, 1, 2))*16
|
||||
g_val = hex2num(copytext(input_color, 2, 3))*16
|
||||
b_val = hex2num(copytext(input_color, 3, 0))*16
|
||||
r_val = hex2num(copytext(input_color, 1, 2)) * 16
|
||||
g_val = hex2num(copytext(input_color, 2, 3)) * 16
|
||||
b_val = hex2num(copytext(input_color, 3, 0)) * 16
|
||||
else if(color_format == 6)
|
||||
r_val = hex2num(copytext(input_color, 1, 3))
|
||||
g_val = hex2num(copytext(input_color, 3, 5))
|
||||
b_val = hex2num(copytext(input_color, 5, 0))
|
||||
b_val = hex2num(copytext(input_color, 5, 7))
|
||||
else
|
||||
return 0 //If the color format is not 3 or 6, you're using an unexpected way to represent a color.
|
||||
|
||||
@@ -253,7 +255,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
if(b_val > 255)
|
||||
b_val = 255
|
||||
|
||||
return num2hex(r_val, 2) + num2hex(g_val, 2) + num2hex(b_val, 2)
|
||||
return copytext(rgb(r_val, g_val, b_val), 2)
|
||||
|
||||
/*
|
||||
Transfer_mind is there to check if mob is being deleted/not going to have a body.
|
||||
@@ -263,7 +265,7 @@ Works together with spawning an observer, noted above.
|
||||
/mob/proc/ghostize(can_reenter_corpse = TRUE, special = FALSE, penalize = FALSE, voluntary = FALSE)
|
||||
penalize = suiciding || penalize // suicide squad.
|
||||
voluntary_ghosted = voluntary
|
||||
if(!key || cmptext(copytext(key,1,2),"@") || (SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse, special, penalize) & COMPONENT_BLOCK_GHOSTING))
|
||||
if(!key || key[1] == "@" || (SEND_SIGNAL(src, COMSIG_MOB_GHOSTIZE, can_reenter_corpse, special, penalize) & COMPONENT_BLOCK_GHOSTING))
|
||||
return //mob has no key, is an aghost or some component hijacked.
|
||||
stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now
|
||||
var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc.
|
||||
@@ -365,7 +367,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(!can_reenter_corpse)
|
||||
to_chat(src, "<span class='warning'>You cannot re-enter your body.</span>")
|
||||
return
|
||||
if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients
|
||||
if(mind.current.key && mind.current.key[1] != "@") //makes sure we don't accidentally kick any clients
|
||||
to_chat(usr, "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>")
|
||||
return
|
||||
client.change_view(CONFIG_GET(string/default_view))
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
/mob/dead/observer/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if (!message)
|
||||
return
|
||||
|
||||
var/message_mode = get_message_mode(message)
|
||||
if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN))
|
||||
message = copytext(message, 3)
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 3)
|
||||
message = trim_left(message)
|
||||
|
||||
if(message_mode == MODE_ADMIN)
|
||||
client.cmd_admin_say(message)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var/param = message
|
||||
var/custom_param = findchar(act, " ")
|
||||
if(custom_param)
|
||||
param = copytext(act, custom_param + 1, length(act) + 1)
|
||||
param = copytext(act, custom_param + length(act[custom_param]))
|
||||
act = copytext(act, 1, custom_param)
|
||||
|
||||
var/datum/emote/E
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
var/datum/disease/D = thing
|
||||
blood_data["viruses"] += D.Copy()
|
||||
|
||||
blood_data["blood_DNA"] = copytext(dna.unique_enzymes,1,0)
|
||||
blood_data["blood_DNA"] = dna.unique_enzymes
|
||||
blood_data["bloodcolor"] = bloodtype_to_color(dna.blood_type)
|
||||
if(disease_resistances && disease_resistances.len)
|
||||
blood_data["resistances"] = disease_resistances.Copy()
|
||||
@@ -204,7 +204,7 @@
|
||||
|
||||
if(!suiciding)
|
||||
blood_data["cloneable"] = 1
|
||||
blood_data["blood_type"] = copytext(dna.blood_type,1,0)
|
||||
blood_data["blood_type"] = dna.blood_type
|
||||
blood_data["gender"] = gender
|
||||
blood_data["real_name"] = real_name
|
||||
blood_data["features"] = dna.features
|
||||
|
||||
@@ -120,7 +120,8 @@ Des: Removes all infected images from the alien.
|
||||
/mob/living/carbon/alien/proc/RemoveInfectionImages()
|
||||
if (client)
|
||||
for(var/image/I in client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected"))
|
||||
var/searchfor = "infected"
|
||||
if(findtext(I.icon_state, searchfor, 1, length(searchfor) + 1))
|
||||
qdel(I)
|
||||
return
|
||||
|
||||
|
||||
@@ -135,5 +135,6 @@ Des: Removes all images from the mob infected by this embryo
|
||||
for(var/mob/living/carbon/alien/alien in GLOB.player_list)
|
||||
if(alien.client)
|
||||
for(var/image/I in alien.client.images)
|
||||
if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == C)
|
||||
var/searchfor = "infected"
|
||||
if(I.loc == owner && findtext(I.icon_state, searchfor, 1, length(searchfor) + 1))
|
||||
qdel(I)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
. += SOFTCRIT_ADD_SLOWDOWN
|
||||
|
||||
/mob/living/carbon/slip(knockdown_amount, obj/O, lube)
|
||||
if(movement_type & FLYING)
|
||||
return 0
|
||||
if(movement_type & FLYING && !(lube & FLYING_DOESNT_HELP))
|
||||
return FALSE
|
||||
if(!(lube&SLIDE_ICE))
|
||||
log_combat(src, (O ? O : get_turf(src)), "slipped on the", null, ((lube & SLIDE) ? "(LUBE)" : null))
|
||||
return loc.handle_slip(src, knockdown_amount, O, lube)
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
create_internal_organs() //most of it is done in set_species now, this is only for parent call
|
||||
physiology = new()
|
||||
|
||||
handcrafting = new()
|
||||
|
||||
AddComponent(/datum/component/personal_crafting)
|
||||
. = ..()
|
||||
|
||||
if(CONFIG_GET(flag/disable_stambuffer))
|
||||
@@ -45,10 +44,6 @@
|
||||
QDEL_NULL_LIST(vore_organs) // CITADEL EDIT belly stuff
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/OpenCraftingMenu()
|
||||
handcrafting.ui_interact(src)
|
||||
|
||||
/mob/living/carbon/human/prepare_data_huds()
|
||||
//Update med hud images...
|
||||
..()
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
|
||||
var/custom_species = null
|
||||
|
||||
var/datum/personal_crafting/handcrafting
|
||||
var/datum/physiology/physiology
|
||||
|
||||
var/list/datum/bioware = list()
|
||||
|
||||
@@ -87,30 +87,22 @@
|
||||
/mob/living/carbon/human/proc/forcesay(list/append) //this proc is at the bottom of the file because quote fuckery makes notepad++ cri
|
||||
if(stat == CONSCIOUS)
|
||||
if(client)
|
||||
var/virgin = 1 //has the text been modified yet?
|
||||
var/temp = winget(client, "input", "text")
|
||||
if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //"case sensitive means
|
||||
var/say_starter = "Say \"" //"
|
||||
if(findtextEx(temp, say_starter, 1, length(say_starter) + 1) && length(temp) > length(say_starter)) //case sensitive means
|
||||
|
||||
temp = replacetext(temp, ";", "") //general radio
|
||||
temp = trim_left(copytext(temp, length(say_starter + 1)))
|
||||
temp = replacetext(temp, ";", "", 1, 2) //general radio
|
||||
while(trim_left(temp)[1] == ":") //dept radio again (necessary)
|
||||
temp = copytext_char(trim_left(temp), 3)
|
||||
|
||||
if(findtext(trim_left(temp), ":", 6, 7)) //dept radio
|
||||
temp = copytext(trim_left(temp), 8)
|
||||
virgin = 0
|
||||
|
||||
if(virgin)
|
||||
temp = copytext(trim_left(temp), 6) //normal speech
|
||||
virgin = 0
|
||||
|
||||
while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary)
|
||||
temp = copytext(trim_left(temp), 3)
|
||||
|
||||
if(findtext(temp, "*", 1, 2)) //emotes
|
||||
if(temp[1] == "*") //emotes
|
||||
return
|
||||
|
||||
var/trimmed = trim_left(temp)
|
||||
if(length(trimmed))
|
||||
if(append)
|
||||
temp += pick(append)
|
||||
trimmed += pick(append)
|
||||
|
||||
say(temp)
|
||||
say(trimmed)
|
||||
winset(client, "input", "text=[null]")
|
||||
|
||||
@@ -426,17 +426,10 @@
|
||||
message = null
|
||||
|
||||
/datum/emote/living/custom/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/custom/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -448,7 +441,7 @@
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/custom_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN) //CIT CHANGE - expands emote textbox
|
||||
var/custom_emote = stripped_multiline_input("Choose an emote to display.", "Custom Emote", null, MAX_MESSAGE_LEN)
|
||||
if(custom_emote && !check_invalid(user, custom_emote))
|
||||
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
|
||||
switch(type)
|
||||
|
||||
@@ -89,7 +89,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE)
|
||||
|
||||
if(sanitize)
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if(!message || message == "")
|
||||
return
|
||||
|
||||
@@ -99,11 +99,10 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
var/in_critical = InCritical()
|
||||
|
||||
if(one_character_prefix[message_mode])
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 2)
|
||||
else if(message_mode || saymode)
|
||||
message = copytext(message, 3)
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = copytext_char(message, 3)
|
||||
message = trim_left(message)
|
||||
|
||||
if(message_mode == MODE_ADMIN)
|
||||
if(client)
|
||||
@@ -135,11 +134,10 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
// No, you cannot speak in xenocommon just because you know the key
|
||||
if(can_speak_in_language(message_language))
|
||||
language = message_language
|
||||
message = copytext(message, 3)
|
||||
message = copytext_char(message, 3)
|
||||
|
||||
// Trim the space if they said ",0 I LOVE LANGUAGES"
|
||||
if(findtext(message, " ", 1, 2))
|
||||
message = copytext(message, 2)
|
||||
message = trim_left(message)
|
||||
|
||||
if(!language)
|
||||
language = get_default_language()
|
||||
@@ -167,8 +165,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
if(fullcrit)
|
||||
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
|
||||
// If we cut our message short, abruptly end it with a-..
|
||||
var/message_len = length(message)
|
||||
message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
|
||||
var/message_len = length_char(message)
|
||||
message = copytext_char(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
|
||||
message = Ellipsis(message, 10, 1)
|
||||
message_mode = MODE_WHISPER_CRIT
|
||||
succumbed = TRUE
|
||||
@@ -326,13 +324,13 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
return 1
|
||||
|
||||
/mob/living/proc/get_key(message)
|
||||
var/key = copytext(message, 1, 2)
|
||||
var/key = message[1]
|
||||
if(key in GLOB.department_radio_prefixes)
|
||||
return lowertext(copytext(message, 2, 3))
|
||||
return lowertext(message[1 + length(key)])
|
||||
|
||||
/mob/living/proc/get_message_language(message)
|
||||
if(copytext(message, 1, 2) == ",")
|
||||
var/key = copytext(message, 2, 3)
|
||||
if(message[1] == ",")
|
||||
var/key = message[1 + length(message[1])]
|
||||
for(var/ld in GLOB.all_languages)
|
||||
var/datum/language/LD = ld
|
||||
if(initial(LD.key) == key)
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
..()
|
||||
|
||||
/mob/living/silicon/ai/get_message_mode(message)
|
||||
if(copytext(message, 1, 3) in list(":h", ":H", ".h", ".H", "#h", "#H"))
|
||||
var/static/regex/holopad_finder = regex(@"[:.#][hH]")
|
||||
if(holopad_finder.Find(message, 1, 1))
|
||||
return MODE_HOLOPAD
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/datum/paiCandidate/proc/savefile_path(mob/user)
|
||||
return "data/player_saves/[copytext(user.ckey, 1, 2)]/[user.ckey]/pai.sav"
|
||||
return "data/player_saves/[user.ckey[1]]/[user.ckey]/pai.sav"
|
||||
|
||||
/datum/paiCandidate/proc/savefile_save(mob/user)
|
||||
if(IsGuestKey(user.key))
|
||||
|
||||
@@ -208,8 +208,8 @@
|
||||
ears.forceMove(drop_location())
|
||||
ears = null
|
||||
for(var/possible_phrase in speak)
|
||||
if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys)
|
||||
possible_phrase = copytext(possible_phrase,3)
|
||||
if(copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys)
|
||||
possible_phrase = copytext_char(possible_phrase, 3)
|
||||
|
||||
//Adding things to inventory
|
||||
else if(href_list["add_inv"])
|
||||
@@ -419,8 +419,8 @@
|
||||
if(prob(50))
|
||||
useradio = 1
|
||||
|
||||
if((copytext(possible_phrase,1,2) in GLOB.department_radio_prefixes) && (copytext(possible_phrase,2,3) in GLOB.department_radio_keys))
|
||||
possible_phrase = "[useradio?pick(available_channels):""][copytext(possible_phrase,3)]" //crop out the channel prefix
|
||||
if((possible_phrase[1] in GLOB.department_radio_prefixes) && (copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys))
|
||||
possible_phrase = "[useradio?pick(available_channels):""][copytext_char(possible_phrase, 3)]" //crop out the channel prefix
|
||||
else
|
||||
possible_phrase = "[useradio?pick(available_channels):""][possible_phrase]"
|
||||
|
||||
@@ -428,8 +428,8 @@
|
||||
|
||||
else //If we have no headset or channels to use, dont try to use any!
|
||||
for(var/possible_phrase in speak)
|
||||
if((copytext(possible_phrase,1,2) in GLOB.department_radio_prefixes) && (copytext(possible_phrase,2,3) in GLOB.department_radio_keys))
|
||||
possible_phrase = copytext(possible_phrase,3) //crop out the channel prefix
|
||||
if((possible_phrase[1] in GLOB.department_radio_prefixes) && (copytext_char(possible_phrase, 2, 3) in GLOB.department_radio_keys))
|
||||
possible_phrase = copytext_char(possible_phrase, 3) //crop out the channel prefix
|
||||
newspeak.Add(possible_phrase)
|
||||
speak = newspeak
|
||||
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
|
||||
var/dextrous = FALSE //If the creature has, and can use, hands
|
||||
var/dextrous_hud_type = /datum/hud/dextrous
|
||||
var/datum/personal_crafting/handcrafting
|
||||
|
||||
var/AIStatus = AI_ON //The Status of our AI, can be set to AI_ON (On, usual processing), AI_IDLE (Will not process, but will return to AI_ON if an enemy comes near), AI_OFF (Off, Not processing ever), AI_Z_OFF (Temporarily off due to nonpresence of players)
|
||||
var/can_have_ai = TRUE //once we have become sentient, we can never go back
|
||||
@@ -98,7 +97,6 @@
|
||||
/mob/living/simple_animal/Initialize()
|
||||
. = ..()
|
||||
GLOB.simple_animals[AIStatus] += src
|
||||
handcrafting = new()
|
||||
if(gender == PLURAL)
|
||||
gender = pick(MALE,FEMALE)
|
||||
if(!real_name)
|
||||
@@ -106,6 +104,8 @@
|
||||
if(!loc)
|
||||
stack_trace("Simple animal being instantiated in nullspace")
|
||||
update_simplemob_varspeed()
|
||||
if(dextrous)
|
||||
AddComponent(/datum/component/personal_crafting)
|
||||
|
||||
/mob/living/simple_animal/Destroy()
|
||||
GLOB.simple_animals[AIStatus] -= src
|
||||
@@ -471,10 +471,6 @@
|
||||
/mob/living/simple_animal/get_idcard(hand_first = TRUE)
|
||||
return ..() || access_card
|
||||
|
||||
/mob/living/simple_animal/OpenCraftingMenu()
|
||||
if(dextrous)
|
||||
handcrafting.ui_interact(src)
|
||||
|
||||
/mob/living/simple_animal/can_hold_items()
|
||||
return dextrous
|
||||
|
||||
|
||||
@@ -53,3 +53,5 @@
|
||||
CB.Invoke()
|
||||
|
||||
log_message("Client [key_name(src)] has taken ownership of mob [src]([src.type])", LOG_OWNERSHIP)
|
||||
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
if(!client)
|
||||
return
|
||||
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(msg, 1, MAX_MESSAGE_LEN)
|
||||
|
||||
if(type)
|
||||
if(type & MSG_VISUAL && eye_blind )//Vision related
|
||||
@@ -414,7 +414,7 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
|
||||
set name = "Add Note"
|
||||
set category = "IC"
|
||||
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = sanitize(msg)
|
||||
|
||||
if(mind)
|
||||
@@ -513,7 +513,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
|
||||
if(href_list["flavor2_more"])
|
||||
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, replacetext(flavor_text_2, "\n", "<BR>")), text("window=[];size=500x200", name))
|
||||
onclose(usr, "[name]")
|
||||
|
||||
|
||||
if(href_list["flavor_change"])
|
||||
update_flavor_text()
|
||||
|
||||
|
||||
+141
-148
@@ -42,128 +42,131 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/proc/stars(n, pr)
|
||||
n = html_encode(n)
|
||||
if (pr == null)
|
||||
pr = 25
|
||||
if (pr <= 0)
|
||||
return null
|
||||
else
|
||||
if (pr >= 100)
|
||||
return n
|
||||
var/te = n
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = null
|
||||
p = 1
|
||||
while(p <= n)
|
||||
if ((copytext(te, p, p + 1) == " " || prob(pr)))
|
||||
t = text("[][]", t, copytext(te, p, p + 1))
|
||||
/**
|
||||
* Convert random parts of a passed in message to stars
|
||||
*
|
||||
* * phrase - the string to convert
|
||||
* * probability - probability any character gets changed
|
||||
*
|
||||
* This proc is dangerously laggy, avoid it or die
|
||||
*/
|
||||
/proc/stars(phrase, probability = 25)
|
||||
if(probability <= 0)
|
||||
return phrase
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/char = ""
|
||||
for(var/i = 1, i <= leng, i += length(char))
|
||||
char = phrase[i]
|
||||
if(char == " " || !prob(probability))
|
||||
. += char
|
||||
else
|
||||
t = text("[]*", t)
|
||||
p++
|
||||
return sanitize(t)
|
||||
. += "*"
|
||||
return sanitize(.)
|
||||
|
||||
/proc/slur(n,var/strength=50)
|
||||
strength = min(strength,50)
|
||||
var/phrase = html_decode(n)
|
||||
/**
|
||||
* Makes you speak like you're drunk
|
||||
*/
|
||||
/proc/slur(phrase, strength = 50)
|
||||
strength = min(50, strength)
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
var/counter=length(phrase)
|
||||
var/newphrase=""
|
||||
var/newletter=""
|
||||
while(counter>=1)
|
||||
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
|
||||
if(rand(1,100)<=strength*0.5)
|
||||
if(lowertext(newletter)=="o")
|
||||
newletter="u"
|
||||
if(lowertext(newletter)=="s")
|
||||
newletter="ch"
|
||||
if(lowertext(newletter)=="a")
|
||||
newletter="ah"
|
||||
if(lowertext(newletter)=="u")
|
||||
newletter="oo"
|
||||
if(lowertext(newletter)=="c")
|
||||
newletter="k"
|
||||
if(rand(1,100) <= strength*0.25)
|
||||
if(newletter==" ")
|
||||
newletter="...huuuhhh..."
|
||||
if(newletter==".")
|
||||
newletter=" BURP!"
|
||||
if(rand(1,100) <= strength*0.5)
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="'"
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="[newletter]"
|
||||
if(rand(1,5) == 1)
|
||||
newletter+="[newletter][newletter]"
|
||||
newphrase+="[newletter]";counter-=1
|
||||
return newphrase
|
||||
|
||||
|
||||
/proc/cultslur(n) // Inflicted on victims of a stun talisman
|
||||
var/phrase = html_decode(n)
|
||||
var/leng = length(phrase)
|
||||
var/counter=length(phrase)
|
||||
var/newphrase=""
|
||||
var/newletter=""
|
||||
while(counter>=1)
|
||||
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
|
||||
if(rand(1,2)==2)
|
||||
if(lowertext(newletter)=="o")
|
||||
newletter="u"
|
||||
if(lowertext(newletter)=="t")
|
||||
newletter="ch"
|
||||
if(lowertext(newletter)=="a")
|
||||
newletter="ah"
|
||||
if(lowertext(newletter)=="u")
|
||||
newletter="oo"
|
||||
if(lowertext(newletter)=="c")
|
||||
newletter=" NAR "
|
||||
if(lowertext(newletter)=="s")
|
||||
newletter=" SIE "
|
||||
if(rand(1,4)==4)
|
||||
if(newletter==" ")
|
||||
newletter=" no hope... "
|
||||
if(newletter=="H")
|
||||
newletter=" IT COMES... "
|
||||
|
||||
switch(rand(1,15))
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar = ""
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(rand(1,100)<=strength * 0.5)
|
||||
var/lowerletter = lowertext(newletter)
|
||||
if(lowerletter == "o")
|
||||
newletter = "u"
|
||||
else if(lowerletter == "s")
|
||||
newletter = "ch"
|
||||
else if(lowerletter == "a")
|
||||
newletter = "ah"
|
||||
else if(lowerletter == "u")
|
||||
newletter = "oo"
|
||||
else if(lowerletter == "c")
|
||||
newletter = "k"
|
||||
if(rand(1,100) <= strength * 0.25)
|
||||
if(newletter == " ")
|
||||
newletter = "...huuuhhh..."
|
||||
else if(newletter == ".")
|
||||
newletter = " *BURP*."
|
||||
switch(rand(1,100) <= strength * 0.5)
|
||||
if(1)
|
||||
newletter="'"
|
||||
newletter += "'"
|
||||
if(10)
|
||||
newletter += "[newletter]"
|
||||
if(20)
|
||||
newletter += "[newletter][newletter]"
|
||||
. += "[newletter]"
|
||||
return sanitize(.)
|
||||
|
||||
/// Makes you talk like you got cult stunned, which is slurring but with some dark messages
|
||||
/proc/cultslur(phrase) // Inflicted on victims of a stun talisman
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar = ""
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(rand(1, 2) == 2)
|
||||
var/lowerletter = lowertext(newletter)
|
||||
if(lowerletter == "o")
|
||||
newletter = "u"
|
||||
else if(lowerletter == "t")
|
||||
newletter = "ch"
|
||||
else if(lowerletter == "a")
|
||||
newletter = "ah"
|
||||
else if(lowerletter == "u")
|
||||
newletter = "oo"
|
||||
else if(lowerletter == "c")
|
||||
newletter = " NAR "
|
||||
else if(lowerletter == "s")
|
||||
newletter = " SIE "
|
||||
if(rand(1, 4) == 4)
|
||||
if(newletter == " ")
|
||||
newletter = " no hope... "
|
||||
else if(newletter == "H")
|
||||
newletter = " IT COMES... "
|
||||
|
||||
switch(rand(1, 15))
|
||||
if(1)
|
||||
newletter = "'"
|
||||
if(2)
|
||||
newletter+="agn"
|
||||
newletter += "agn"
|
||||
if(3)
|
||||
newletter="fth"
|
||||
newletter = "fth"
|
||||
if(4)
|
||||
newletter="nglu"
|
||||
newletter = "nglu"
|
||||
if(5)
|
||||
newletter="glor"
|
||||
newphrase+="[newletter]";counter-=1
|
||||
return newphrase
|
||||
newletter = "glor"
|
||||
. += newletter
|
||||
return sanitize(.)
|
||||
|
||||
|
||||
/proc/stutter(n)
|
||||
var/te = html_decode(n)
|
||||
var/t = ""//placed before the message. Not really sure what it's for.
|
||||
n = length(n)//length of the entire word
|
||||
var/p = null
|
||||
p = 1//1 is the start of any word
|
||||
while(p <= n)//while P, which starts at 1 is less or equal to N which is the length.
|
||||
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
|
||||
if (prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
|
||||
if (prob(10))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]-[n_letter]")//replaces the current letter with this instead.
|
||||
///Adds stuttering to the message passed in
|
||||
/proc/stutter(phrase)
|
||||
phrase = html_decode(phrase)
|
||||
var/leng = length(phrase)
|
||||
. = ""
|
||||
var/newletter = ""
|
||||
var/rawchar
|
||||
for(var/i = 1, i <= leng, i += length(rawchar))
|
||||
rawchar = newletter = phrase[i]
|
||||
if(prob(80) && !(lowertext(newletter) in list("a", "e", "i", "o", "u", " ")))
|
||||
if(prob(10))
|
||||
newletter = "[newletter]-[newletter]-[newletter]-[newletter]"
|
||||
else if(prob(20))
|
||||
newletter = "[newletter]-[newletter]-[newletter]"
|
||||
else if (prob(5))
|
||||
newletter = ""
|
||||
else
|
||||
if (prob(20))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
else
|
||||
if (prob(5))
|
||||
n_letter = null
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
|
||||
p++//for each letter p is increased to find where the next letter will be.
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
newletter = "[newletter]-[newletter]"
|
||||
. += newletter
|
||||
return sanitize(.)
|
||||
|
||||
/proc/derpspeech(message, stuttering)
|
||||
message = replacetext(message, " am ", " ")
|
||||
@@ -183,52 +186,42 @@
|
||||
return message
|
||||
|
||||
|
||||
/proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added
|
||||
/* Turn text into complete gibberish! */
|
||||
var/returntext = ""
|
||||
for(var/i = 1, i <= length(t), i++)
|
||||
|
||||
var/letter = copytext(t, i, i+1)
|
||||
if(prob(50))
|
||||
if(p >= 70)
|
||||
/proc/Gibberish(text, replace_characters = FALSE, chance = 50)
|
||||
text = html_decode(text)
|
||||
. = ""
|
||||
var/rawchar = ""
|
||||
var/letter = ""
|
||||
var/lentext = length(text)
|
||||
for(var/i = 1, i <= lentext, i += length(rawchar))
|
||||
rawchar = letter = text[i]
|
||||
if(prob(chance))
|
||||
if(replace_characters)
|
||||
letter = ""
|
||||
for(var/j in 1 to rand(0, 2))
|
||||
letter += pick("#", "@", "*", "&", "%", "$", "/", "<", ">", ";", "*", "*", "*", "*", "*", "*", "*")
|
||||
. += letter
|
||||
return sanitize(.)
|
||||
|
||||
for(var/j = 1, j <= rand(0, 2), j++)
|
||||
letter += pick("#","@","*","&","%","$","/", "<", ">", ";","*","*","*","*","*","*","*")
|
||||
|
||||
returntext += letter
|
||||
|
||||
return returntext
|
||||
|
||||
|
||||
/proc/ninjaspeak(n) //NINJACODE
|
||||
/*
|
||||
The difference with stutter is that this proc can stutter more than 1 letter
|
||||
The issue here is that anything that does not have a space is treated as one word (in many instances). For instance, "LOOKING," is a word, including the comma.
|
||||
It's fairly easy to fix if dealing with single letters but not so much with compounds of letters./N
|
||||
*/
|
||||
var/te = html_decode(n)
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = 1
|
||||
while(p <= n)
|
||||
var/n_letter
|
||||
var/n_mod = rand(1,4)
|
||||
if(p+n_mod>n+1)
|
||||
n_letter = copytext(te, p, n+1)
|
||||
else
|
||||
n_letter = copytext(te, p, p+n_mod)
|
||||
/proc/ninjaspeak(phrase) //NINJACODE
|
||||
. = ""
|
||||
var/lentext = length_char(phrase)
|
||||
var/rawchars = ""
|
||||
var/letter = ""
|
||||
for(var/i = 1, i <= lentext, i += length_char(rawchars))
|
||||
var/end = i + rand(1,4)
|
||||
letter = rawchars = copytext_char(phrase, i, end > lentext ? 0 : end)
|
||||
if (prob(50))
|
||||
if (prob(30))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
letter = "[letter]-[letter]-[letter]"
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
else
|
||||
n_letter = text("[n_letter]")
|
||||
t = text("[t][n_letter]")
|
||||
p=p+n_mod
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
|
||||
letter = "[letter]-[letter]"
|
||||
. += letter
|
||||
return copytext_char(sanitize(.),1,MAX_MESSAGE_LEN)
|
||||
|
||||
/proc/shake_camera(mob/M, duration, strength=1)
|
||||
if(!M || !M.client || duration < 1)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/customsayverb = findtext(input, "*")
|
||||
if(customsayverb && message_mode != MODE_WHISPER_CRIT)
|
||||
message_mode = MODE_CUSTOM_SAY
|
||||
return lowertext(copytext(input, 1, customsayverb))
|
||||
return lowertext(copytext_char(input, 1, customsayverb))
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
usr.emote("me",1,message,TRUE)
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
deadchat_broadcast(rendered, follow_target = src, speaker_key = key)
|
||||
|
||||
/mob/proc/check_emote(message)
|
||||
if(copytext(message, 1, 2) == "*")
|
||||
emote(copytext(message, 2), intentional = TRUE)
|
||||
return 1
|
||||
if(message[1] == "*")
|
||||
emote(copytext(message, length(message[1]) + 1), intentional = TRUE)
|
||||
return TRUE
|
||||
|
||||
/mob/proc/hivecheck()
|
||||
return 0
|
||||
@@ -94,11 +94,11 @@
|
||||
return LINGHIVE_NONE
|
||||
|
||||
/mob/proc/get_message_mode(message)
|
||||
var/key = copytext(message, 1, 2)
|
||||
var/key = message[1]
|
||||
if(key == "#")
|
||||
return MODE_WHISPER
|
||||
else if(key == ";")
|
||||
return MODE_HEADSET
|
||||
else if(length(message) > 2 && (key in GLOB.department_radio_prefixes))
|
||||
var/key_symbol = lowertext(copytext(message, 2, 3))
|
||||
else if((length(message) > (length(key) + 1)) && (key in GLOB.department_radio_prefixes))
|
||||
var/key_symbol = lowertext(message[length(key) + 1])
|
||||
return GLOB.department_radio_keys[key_symbol]
|
||||
|
||||
+18
-38
@@ -9,25 +9,19 @@
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
to_chat(usr, "No.")
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(flavor_text), MAX_MESSAGE_LEN*2, TRUE)
|
||||
var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(flavor_text), MAX_MESSAGE_LEN, TRUE)
|
||||
|
||||
if(!isnull(msg))
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text = msg
|
||||
if(msg)
|
||||
flavor_text = html_encode(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)
|
||||
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, TRUE)
|
||||
|
||||
if(!isnull(msg))
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text_2 = msg
|
||||
if(msg)
|
||||
flavor_text_2 = html_encode(msg)
|
||||
|
||||
|
||||
/mob/proc/warn_flavor_changed()
|
||||
@@ -39,19 +33,19 @@
|
||||
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, "\n", " "))
|
||||
if(length(msg) <= 40)
|
||||
if(length_char(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>"
|
||||
return "<span class='notice'>[html_encode(copytext_char(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)
|
||||
if(length_char(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)];flavor2_more=1'>More...</span></a>"
|
||||
return "<span class='notice'>[html_encode(copytext_char(msg, 1, 37))]... <a href='?src=[REF(src)];flavor2_more=1'>More...</span></a>"
|
||||
|
||||
|
||||
/mob/proc/get_top_level_mob()
|
||||
@@ -80,17 +74,10 @@ proc/get_top_level_mob(var/mob/S)
|
||||
|
||||
|
||||
/datum/emote/living/subtle/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/subtle/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -100,7 +87,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/subtle_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN)
|
||||
var/subtle_emote = stripped_multiline_input("Choose an emote to display.", "Subtle", null, MAX_MESSAGE_LEN)
|
||||
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)
|
||||
@@ -151,17 +138,10 @@ proc/get_top_level_mob(var/mob/S)
|
||||
|
||||
|
||||
/datum/emote/living/subtler/proc/check_invalid(mob/user, input)
|
||||
. = TRUE
|
||||
if(copytext(input,1,5) == "says")
|
||||
if(stop_bad_mime.Find(input, 1, 1))
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,6) == "yells")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
to_chat(user, "<span class='danger'>Invalid emote.</span>")
|
||||
else
|
||||
. = FALSE
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/emote/living/subtler/run_emote(mob/user, params, type_override = null)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
@@ -171,7 +151,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
var/subtle_emote = copytext(sanitize(input("Choose an emote to display.") as message|null), 1, MAX_MESSAGE_LEN)
|
||||
var/subtle_emote = stripped_multiline_input(user, "Choose an emote to display.", "Subtler" , null, MAX_MESSAGE_LEN)
|
||||
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)
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
|
||||
// hash the original name?
|
||||
if(tr_flags & TR_HASHNAME)
|
||||
O.name = "monkey ([copytext(md5(real_name), 2, 6)])"
|
||||
O.real_name = "monkey ([copytext(md5(real_name), 2, 6)])"
|
||||
O.name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
|
||||
O.real_name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
|
||||
|
||||
//handle DNA and other attributes
|
||||
dna.transfer_identity(O)
|
||||
@@ -202,7 +202,7 @@
|
||||
dna.transfer_identity(O)
|
||||
O.updateappearance(mutcolor_update=1)
|
||||
|
||||
if(cmptext("monkey",copytext(O.dna.real_name,1,7)))
|
||||
if(findtext(O.dna.real_name, "monkey", 1, 7)) //7 == length("monkey") + 1
|
||||
O.real_name = random_unique_name(O.gender)
|
||||
O.dna.generate_unique_enzymes(O)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user