not-so-wip now.

This commit is contained in:
Ghommie
2020-01-31 19:20:59 +01:00
parent 188f726ffd
commit 7f14fa3c71
30 changed files with 74 additions and 76 deletions
+9 -17
View File
@@ -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]")
+2 -1
View File
@@ -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
+4 -2
View File
@@ -44,9 +44,11 @@
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the cover of [src]!</span>")
return
var/n_name = copytext(sanitize(input(user, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
var/inputvalue = stripped_input(user, "What would you like to label the folder?", "Folder Labelling", "", MAX_NAME_LEN)
if(!inputvalue)
return
if(user.canUseTopic(src, BE_CLOSE))
name = "folder[(n_name ? " - '[n_name]'" : null)]"
name = "folder - '[inputvalue]'"
/obj/item/folder/attack_self(mob/user)
+1 -1
View File
@@ -70,7 +70,7 @@
if(mode)
to_chat(user, "<span class='notice'>You turn on [src].</span>")
//Now let them chose the text.
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = reject_bad_text(stripped_input(user, "Label text?", "Set label","", MAX_NAME_LEN))
if(!str || !length(str))
to_chat(user, "<span class='warning'>Invalid text!</span>")
return
+4 -1
View File
@@ -152,7 +152,10 @@
if(istart == 0)
return //No field found with matching id
laststart = istart+1
if(links)
laststart = istart + length(info_links[istart])
else
laststart = istart + length(info[istart])
locid++
if(locid == id)
var/iend = 1
+3 -3
View File
@@ -111,9 +111,9 @@
if(data.len < 5)
return null
var/timestamp = data[2]
var/year = copytext(timestamp, 1, 5)
var/month = copytext(timestamp, 5, 7)
var/day = copytext(timestamp, 7, 9)
var/year = copytext_char(timestamp, 1, 5)
var/month = copytext_char(timestamp, 5, 7)
var/day = copytext_char(timestamp, 7, 9)
var/round = data[4]
. += "[year]/[month]/[day]/round-[round]"
if("O")
+4 -5
View File
@@ -55,9 +55,8 @@
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on [src]!</span>")
return
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text)
txt = copytext(txt, 1, 128)
if(user.canUseTopic(src, BE_CLOSE))
var/txt = stripped_input(user, "What would you like to write on the back?", "Photo Writing", "", 128)
if(txt && user.canUseTopic(src, BE_CLOSE))
scribble = txt
..()
@@ -85,8 +84,8 @@
set category = "Object"
set src in usr
var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text), 1, MAX_NAME_LEN)
var/n_name = stripped_input(usr, "What would you like to label the photo?", "Photo Labelling", "", MAX_NAME_LEN)
//loc.loc check is for making possible renaming photos in clipboards
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && usr.canmove && !usr.restrained())
if(n_name && (loc == usr || loc.loc && loc.loc == usr) && usr.stat == CONSCIOUS && usr.canmove && !usr.restrained())
name = "photo[(n_name ? text("- '[n_name]'") : null)]"
add_fingerprint(usr)
+2 -2
View File
@@ -85,8 +85,8 @@ By design, d1 is the smallest direction and d2 is the highest
if(isnull(_d1) || isnull(_d2))
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
var/dash = findtext(icon_state, "-")
d1 = text2num( copytext( icon_state, 1, dash ) )
d2 = text2num( copytext( icon_state, dash+1 ) )
d1 = text2num(copytext(icon_state, 1, dash))
d2 = text2num(copytext(icon_state, dash + length(icon_state[dash])))
else
d1 = _d1
d2 = _d2
@@ -30,7 +30,7 @@
/datum/mapGenerator/New()
..()
if(buildmode_name == "Undocumented")
buildmode_name = copytext("[type]", 20) // / d a t u m / m a p g e n e r a t o r / = 20 characters.
buildmode_name = copytext_char("[type]", 20) // / d a t u m / m a p g e n e r a t o r / = 20 characters.
initialiseModules()
//Defines the region the map represents, sets map
+1 -1
View File
@@ -196,7 +196,7 @@
return ""
var/outstring = "|<a href=\"#[R.name]\"><h5 id=\"[R.name]\">!\[[R.color]\](https://placehold.it/15/[copytext(R.color, 2, 8)]/000000?text=+)[R.name]</h5></a> pH: [R.pH] | "
var/outstring = "|<a href=\"#[R.name]\"><h5 id=\"[R.name]\">!\[[R.color]\](https://placehold.it/15/[copytext_char(R.color, 2, 8)]/000000?text=+)[R.name]</h5></a> pH: [R.pH] | "
var/datum/reagent/R3
if(CR)
outstring += "<ul>"
+2 -2
View File
@@ -36,7 +36,7 @@
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = stripped_input(user, "Label text?", "Set label", "", MAX_NAME_LEN)
if(!user.canUseTopic(src, BE_CLOSE))
return
if(!str || !length(str))
@@ -122,7 +122,7 @@
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = stripped_input(user, "Label text?", "Set label", "", MAX_NAME_LEN)
if(!user.canUseTopic(src, BE_CLOSE))
return
if(!str || !length(str))
@@ -142,7 +142,7 @@
var/new_sentence = stripped_input(user, "Choose the sentence that the host will be forced to say.", "Sentence", sentence, MAX_MESSAGE_LEN)
if(!new_sentence)
return
if(copytext(new_sentence, 1, 2) == "*") //emotes are abusable, like surrender
if(new_sentence[1] == "*") //emotes are abusable, like surrender
return
sentence = new_sentence
if(setting == "Comm Code")
+1 -1
View File
@@ -52,7 +52,7 @@ Nothing else in the console has ID requirements.
research_control = FALSE
/proc/CallMaterialName(ID)
if (copytext(ID, 1, 2) == "$" && GLOB.materials_list[ID])
if (ID[1] == "$" && GLOB.materials_list[ID])
var/datum/material/material = GLOB.materials_list[ID]
return material.name
@@ -134,7 +134,7 @@ Stabilized extracts:
saved_mind = null
START_PROCESSING(SSobj, src)
if(choice == "Familiar Name")
var/newname = copytext(sanitize(input(user, "Would you like to change the name of [mob_name]", "Name change", mob_name) as null|text),1,MAX_NAME_LEN)
var/newname = sanitize_name(stripped_input(user, "Would you like to change the name of [mob_name]", "Name change", mob_name, MAX_NAME_LEN))
if(newname)
mob_name = newname
to_chat(user, "<span class='notice'>You speak softly into [src], and it shakes slightly in response.</span>")
@@ -644,7 +644,7 @@
M.nutrition = 700
to_chat(M, "<span class='warning'>You absorb the potion and feel your intense desire to feed melt away.</span>")
to_chat(user, "<span class='notice'>You feed the slime the potion, removing its hunger and calming it.</span>")
var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
var/newname = sanitize_name(stripped_input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime", MAX_NAME_LEN))
if (!newname)
newname = "pet slime"
+1 -1
View File
@@ -171,7 +171,7 @@ GLOBAL_LIST_INIT(cargo_shuttle_leave_behind_typecache, typecacheof(list(
msg += "[value] credits: received [ex.reagents_volume[chem]]u of [chem].\n"
SSshuttle.points += value
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = copytext_char(msg, 1, MAX_MESSAGE_LEN)
SSshuttle.centcom_message = msg
investigate_log("Shuttle contents sold for [SSshuttle.points - presale_points] credits. Contents: [ex.exported_atoms || "none."] Message: [SSshuttle.centcom_message || "none."]", INVESTIGATE_CARGO)
@@ -61,7 +61,7 @@ Also, you never added distance checking after target is selected. I've went ahea
return
var/datum/mind/TM = target.mind
if((target.anti_magic_check(TRUE, FALSE) || TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev)) || cmptext(copytext(target.key,1,2),"@"))
if(target.anti_magic_check(TRUE, FALSE) || TM.has_antag_datum(/datum/antagonist/wizard) || TM.has_antag_datum(/datum/antagonist/cult) || TM.has_antag_datum(/datum/antagonist/clockcult) || TM.has_antag_datum(/datum/antagonist/changeling) || TM.has_antag_datum(/datum/antagonist/rev) || target.key[1] == "@")
if(!silent)
to_chat(user, "<span class='warning'>[target.p_their(TRUE)] mind is resisting your spell!</span>")
return
+1 -1
View File
@@ -202,7 +202,7 @@
/obj/item/organ/eyes/robotic/shield/emp_act(severity)
return
#define RGB2EYECOLORSTRING(definitionvar) ("[copytext(definitionvar,2,3)][copytext(definitionvar,4,5)][copytext(definitionvar,6,7)]")
#define RGB2EYECOLORSTRING(definitionvar) ("[copytext_char(definitionvar, 2, 3)][copytext_char(definitionvar, 4, 5)][copytext_char(definitionvar, 6, 7)]")
/obj/item/organ/eyes/robotic/glow
name = "High Luminosity Eyes"
+2 -2
View File
@@ -189,7 +189,7 @@
var/insertpos = rand(1, message_list.len - 1)
var/inserttext = message_list[insertpos]
if(!(copytext(inserttext, length(inserttext) - 2) == "..."))
if(!(copytext(inserttext, -3) == "..."))//3 == length("...")
message_list[insertpos] = inserttext + "..."
if(prob(20) && message_list.len > 3)
@@ -290,7 +290,7 @@
/obj/item/organ/tongue/fluffy/handle_speech(datum/source, list/speech_args)
var/message = speech_args[SPEECH_MESSAGE]
if(copytext(message, 1, 2) != "*")
if(message[1] != "*")
message = replacetext(message, "ne", "nye")
message = replacetext(message, "nu", "nyu")
message = replacetext(message, "na", "nya")
+3 -3
View File
@@ -189,7 +189,7 @@
listeners = list(L) //Devil names are unique.
power_multiplier *= 5 //if you're a devil and god himself addressed you, you fucked up
//Cut out the name so it doesn't trigger commands
message = copytext(message, 0, start)+copytext(message, start + length(devilinfo.truename), length(message) + 1)
message = copytext(message, 1, start) + copytext(message, start + length(devilinfo.truename))
break
else if(findtext(message, L.real_name, 1, length(L.real_name) + 1))
specific_listeners += L //focus on those with the specified name
@@ -209,7 +209,7 @@
if(specific_listeners.len)
listeners = specific_listeners
power_multiplier *= (1 + (1/specific_listeners.len)) //2x on a single guy, 1.5x on two and so on
message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1)
message = copytext(message, length(found_string) + 1)
var/static/regex/stun_words = regex("stop|wait|stand still|hold on|halt")
var/static/regex/knockdown_words = regex("drop|fall|trip|knockdown")
@@ -740,7 +740,7 @@
if(specific_listeners.len)
listeners = specific_listeners
//power_multiplier *= (1 + (1/specific_listeners.len)) //Put this is if it becomes OP, power is judged internally on a thrall, so shouldn't be nessicary.
message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1)//I have no idea what this does
message = copytext(message, length(found_string) + 1)//I have no idea what this does
var/obj/item/organ/tongue/T = user.getorganslot(ORGAN_SLOT_TONGUE)
if (T.name == "fluffy tongue") //If you sound hillarious, it's hard to take you seriously. This is a way for other players to combat/reduce their effectiveness.
+1 -1
View File
@@ -80,7 +80,7 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums)
//
/datum/vore_preferences/proc/load_path(ckey,slot,filename="character",ext="json")
if(!ckey || !slot) return
path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/vore/[filename][slot].[ext]"
path = "data/player_saves/[ckey[1]]/[ckey]/vore/[filename][slot].[ext]"
/datum/vore_preferences/proc/load_vore()
if(!client || !client_ckey)