Merge remote-tracking branch 'upstream/master' into TGUIs_Nexties
This commit is contained in:
@@ -135,10 +135,10 @@ GLOBAL_PROTECT(protected_ranks)
|
||||
var/previous_rights = 0
|
||||
//load text from file and process each line separately
|
||||
for(var/line in world.file2list("[global.config.directory]/admin_ranks.txt"))
|
||||
if(!line || findtextEx(line,"#",1,2))
|
||||
if(!line || findtextEx_char(line,"#",1,2))
|
||||
continue
|
||||
var/next = findtext(line, "=")
|
||||
var/datum/admin_rank/R = new(ckeyEx(copytext(line, 1, next)))
|
||||
var/datum/admin_rank/R = new(ckeyEx(copytext(line, 1, line[next])))
|
||||
if(!R)
|
||||
continue
|
||||
GLOB.admin_ranks += R
|
||||
@@ -146,7 +146,7 @@ GLOBAL_PROTECT(protected_ranks)
|
||||
var/prev = findchar(line, "+-*", next, 0)
|
||||
while(prev)
|
||||
next = findchar(line, "+-*", prev + 1, 0)
|
||||
R.process_keyword(copytext(line, prev, next), previous_rights)
|
||||
R.process_keyword(copytext_char(line, prev, next), previous_rights)
|
||||
prev = next
|
||||
previous_rights = R.rights
|
||||
if(!CONFIG_GET(flag/admin_legacy_system) || dbfail)
|
||||
|
||||
@@ -448,11 +448,9 @@ GLOBAL_PROTECT(admin_verbs_hideable)
|
||||
mob.name = initial(mob.name)
|
||||
mob.mouse_opacity = initial(mob.mouse_opacity)
|
||||
else
|
||||
var/new_key = ckeyEx(input("Enter your desired display name.", "Fake Key", key) as text|null)
|
||||
var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26))
|
||||
if(!new_key)
|
||||
return
|
||||
if(length(new_key) >= 26)
|
||||
new_key = copytext(new_key, 1, 26)
|
||||
holder.fakekey = new_key
|
||||
createStealthKey()
|
||||
if(isobserver(mob))
|
||||
@@ -559,9 +557,9 @@ GLOBAL_PROTECT(admin_verbs_hideable)
|
||||
set desc = "Gives a spell to a mob."
|
||||
|
||||
var/list/spell_list = list()
|
||||
var/type_length = length("/obj/effect/proc_holder/spell") + 2
|
||||
var/type_length = length_char("/obj/effect/proc_holder/spell") + 2
|
||||
for(var/A in GLOB.spells)
|
||||
spell_list[copytext("[A]", type_length)] = A
|
||||
spell_list[copytext_char("[A]", type_length)] = A
|
||||
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
|
||||
if(!S)
|
||||
return
|
||||
|
||||
@@ -149,10 +149,10 @@
|
||||
else
|
||||
var/timeleft = SSshuttle.emergency.timeLeft()
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL)
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_leading(num2text(timeleft % 60), 2, "0")]</a><BR>"
|
||||
dat += "<a href='?_src_=holder;[HrefToken()];call_shuttle=2'>Send Back</a><br>"
|
||||
else
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]</a><BR>"
|
||||
dat += "ETA: <a href='?_src_=holder;[HrefToken()];edit_shuttle_time=1'>[(timeleft / 60) % 60]:[add_leading(num2text(timeleft % 60), 2, "0")]</a><BR>"
|
||||
dat += "<B>Continuous Round Status</B><BR>"
|
||||
dat += "<a href='?_src_=holder;[HrefToken()];toggle_continuous=1'>[CONFIG_GET(keyed_list/continuous)[SSticker.mode.config_tag] ? "Continue if antagonists die" : "End on antagonist death"]</a>"
|
||||
if(CONFIG_GET(keyed_list/continuous)[SSticker.mode.config_tag])
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
if(!SSticker.HasRoundStarted())
|
||||
alert("The game hasn't started yet!")
|
||||
return
|
||||
var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
|
||||
var/objective = stripped_input(usr, "Enter an objective")
|
||||
if(!objective)
|
||||
return
|
||||
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Traitor All", "[objective]"))
|
||||
|
||||
@@ -2469,8 +2469,6 @@
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_feed_channel.channel_name = stripped_input(usr, "Provide a Feed Channel Name.", "Network Channel Handler", "")
|
||||
while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
|
||||
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,length(src.admincaster_feed_channel.channel_name)+1)
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_channel_lock"])
|
||||
@@ -2510,9 +2508,7 @@
|
||||
else if(href_list["ac_set_new_message"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story.", "Network Channel Handler", ""))
|
||||
while (findtext(src.admincaster_feed_message.returnBody(-1)," ") == 1)
|
||||
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.returnBody(-1),2,length(src.admincaster_feed_message.returnBody(-1))+1)
|
||||
src.admincaster_feed_message.body = adminscrub(stripped_input(usr, "Write your Feed story.", "Network Channel Handler", ""))
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_submit_new_message"])
|
||||
@@ -2571,17 +2567,13 @@
|
||||
else if(href_list["ac_set_wanted_name"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_wanted_message.criminal = adminscrub(input(usr, "Provide the name of the Wanted person.", "Network Security Handler", ""))
|
||||
while(findtext(src.admincaster_wanted_message.criminal," ") == 1)
|
||||
src.admincaster_wanted_message.criminal = copytext(admincaster_wanted_message.criminal,2,length(admincaster_wanted_message.criminal)+1)
|
||||
src.admincaster_wanted_message.criminal = adminscrub(stripped_input(usr, "Provide the name of the Wanted person.", "Network Security Handler", ""))
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_wanted_desc"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
src.admincaster_wanted_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important.", "Network Security Handler", ""))
|
||||
while (findtext(src.admincaster_wanted_message.body," ") == 1)
|
||||
src.admincaster_wanted_message.body = copytext(src.admincaster_wanted_message.body,2,length(src.admincaster_wanted_message.body)+1)
|
||||
src.admincaster_wanted_message.body = adminscrub(stripped_input(usr, "Provide the a description of the Wanted person and any other details you deem important.", "Network Security Handler", ""))
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_submit_wanted"])
|
||||
|
||||
@@ -869,8 +869,8 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
else if(ispath(expression[i]))
|
||||
val = expression[i]
|
||||
|
||||
else if(copytext(expression[i], 1, 2) in list("'", "\""))
|
||||
val = copytext(expression[i], 2, length(expression[i]))
|
||||
else if(expression[i][1] in list("'", "\""))
|
||||
val = copytext_char(expression[i], 2, -1)
|
||||
|
||||
else if(expression[i] == "\[")
|
||||
var/list/expressions_list = expression[++i]
|
||||
@@ -961,11 +961,11 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
if(is_proper_datum(object))
|
||||
D = object
|
||||
|
||||
if (object == world && (!long || expression[start + 1] == ".") && !(expression[start] in exclude))
|
||||
if (object == world && (!long || expression[start + 1] == ".") && !(expression[start] in exclude)) //3 == length("SS") + 1
|
||||
to_chat(usr, "<span class='danger'>World variables are not allowed to be accessed. Use global.</span>")
|
||||
return null
|
||||
|
||||
else if(expression [start] == "{" && long)
|
||||
else if(expression [start] == "{" && long) //3 == length("0x") + 1
|
||||
if(lowertext(copytext(expression[start + 1], 1, 3)) != "0x")
|
||||
to_chat(usr, "<span class='danger'>Invalid pointer syntax: [expression[start + 1]]</span>")
|
||||
return null
|
||||
@@ -1070,9 +1070,10 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
var/word = ""
|
||||
var/list/query_list = list()
|
||||
var/len = length(query_text)
|
||||
var/char = ""
|
||||
|
||||
for(var/i = 1, i <= len, i++)
|
||||
var/char = copytext(query_text, i, i + 1)
|
||||
for(var/i = 1, i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
|
||||
if(char in whitespace)
|
||||
if(word != "")
|
||||
@@ -1091,7 +1092,7 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
query_list += word
|
||||
word = ""
|
||||
|
||||
var/char2 = copytext(query_text, i + 1, i + 2)
|
||||
var/char2 = query_text[i + length(char)]
|
||||
|
||||
if(char2 in multi[char])
|
||||
query_list += "[char][char2]"
|
||||
@@ -1107,13 +1108,13 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
|
||||
word = "'"
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
for(i += length(char), i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
|
||||
if(char == "'")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
if(query_text[i + length(char)] == "'")
|
||||
word += "'"
|
||||
i++
|
||||
i += length(query_text[i + length(char)])
|
||||
|
||||
else
|
||||
break
|
||||
@@ -1135,13 +1136,13 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
|
||||
word = "\""
|
||||
|
||||
for(i++, i <= len, i++)
|
||||
char = copytext(query_text, i, i + 1)
|
||||
for(i += length(char), i <= len, i += length(char))
|
||||
char = query_text[i]
|
||||
|
||||
if(char == "\"")
|
||||
if(copytext(query_text, i + 1, i + 2) == "'")
|
||||
if(query_text[i + length(char)] == "'")
|
||||
word += "\""
|
||||
i++
|
||||
i += length(query_text[i + length(char)])
|
||||
|
||||
else
|
||||
break
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
node += "*"
|
||||
i++
|
||||
|
||||
else if (copytext(token(i), 1, 2) == "/")
|
||||
else if(token(i)[1] == "/")
|
||||
i = object_type(i, node)
|
||||
|
||||
else
|
||||
@@ -377,7 +377,7 @@
|
||||
//object_type: <type path>
|
||||
/datum/SDQL_parser/proc/object_type(i, list/node)
|
||||
|
||||
if (copytext(token(i), 1, 2) != "/")
|
||||
if(token(i)[1] != "/")
|
||||
return parse_error("Expected type, but it didn't begin with /")
|
||||
|
||||
var/path = text2path(token(i))
|
||||
@@ -416,7 +416,7 @@
|
||||
//string: ''' <some text> ''' | '"' <some text > '"'
|
||||
/datum/SDQL_parser/proc/string(i, list/node)
|
||||
|
||||
if(copytext(token(i), 1, 2) in list("'", "\""))
|
||||
if(token(i)[1] in list("'", "\""))
|
||||
node += token(i)
|
||||
|
||||
else
|
||||
@@ -427,7 +427,7 @@
|
||||
//array: '[' expression, expression, ... ']'
|
||||
/datum/SDQL_parser/proc/array(var/i, var/list/node)
|
||||
// Arrays get turned into this: list("[", list(exp_1a = exp_1b, ...), ...), "[" is to mark the next node as an array.
|
||||
if(copytext(token(i), 1, 2) != "\[")
|
||||
if(token(i)[1] != "\[")
|
||||
parse_error("Expected an array but found '[token(i)]'")
|
||||
return i + 1
|
||||
|
||||
@@ -613,7 +613,7 @@
|
||||
node += "null"
|
||||
i++
|
||||
|
||||
else if(lowertext(copytext(token(i), 1, 3)) == "0x" && isnum(hex2num(copytext(token(i), 3))))
|
||||
else if(lowertext(copytext(token(i), 1, 3)) == "0x" && isnum(hex2num(copytext(token(i), 3))))//3 == length("0x") + 1
|
||||
node += hex2num(copytext(token(i), 3))
|
||||
i++
|
||||
|
||||
@@ -621,12 +621,12 @@
|
||||
node += text2num(token(i))
|
||||
i++
|
||||
|
||||
else if(copytext(token(i), 1, 2) in list("'", "\""))
|
||||
else if(token(i)[1] in list("'", "\""))
|
||||
i = string(i, node)
|
||||
|
||||
else if(copytext(token(i), 1, 2) == "\[") // Start a list.
|
||||
else if(token(i)[1] == "\[") // Start a list.
|
||||
i = array(i, node)
|
||||
else if(copytext(token(i), 1, 2) == "/")
|
||||
else if(token(i)[1] == "/")
|
||||
i = object_type(i, node)
|
||||
else
|
||||
i = variable(i, node)
|
||||
|
||||
@@ -165,7 +165,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
//is_bwoink is TRUE if this ticket was started by an admin PM
|
||||
/datum/admin_help/New(msg, client/C, is_bwoink)
|
||||
//clean the input msg
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
msg = sanitize(copytext_char(msg,1,MAX_MESSAGE_LEN))
|
||||
if(!msg || !C || !C.mob)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return
|
||||
var/client/C
|
||||
if(istext(whom))
|
||||
if(cmptext(copytext(whom,1,2),"@"))
|
||||
if(whom[1] == "@")
|
||||
whom = findStealthKey(whom)
|
||||
C = GLOB.directory[whom]
|
||||
else if(istype(whom, /client))
|
||||
@@ -76,7 +76,7 @@
|
||||
var/client/recipient
|
||||
var/irc = 0
|
||||
if(istext(whom))
|
||||
if(cmptext(copytext(whom,1,2),"@"))
|
||||
if(whom[1] == "@")
|
||||
whom = findStealthKey(whom)
|
||||
if(whom == "IRCKEY")
|
||||
irc = 1
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
//clean the message if it's not sent by a high-rank admin
|
||||
if(!check_rights(R_SERVER|R_DEBUG,0)||irc)//no sending html to the poor bots
|
||||
msg = trim(sanitize(copytext(msg,1,MAX_MESSAGE_LEN)))
|
||||
msg = trim(sanitize(msg), MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
if(!stealthkey)
|
||||
stealthkey = GenIrcStealthKey()
|
||||
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
|
||||
if(!msg)
|
||||
return "Error: No message"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
mob.log_talk(msg, LOG_DSAY)
|
||||
|
||||
if (!msg)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/map = input(src, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
|
||||
if(!map)
|
||||
return
|
||||
if(copytext("[map]",-4) != ".dmm")
|
||||
if(copytext("[map]", -4) != ".dmm")//4 == length(".dmm")
|
||||
to_chat(src, "<span class='warning'>Filename must end in '.dmm': [map]</span>")
|
||||
return
|
||||
var/datum/map_template/M
|
||||
|
||||
@@ -307,9 +307,9 @@ GLOBAL_PROTECT(VVpixelmovement)
|
||||
// the type with the base type removed from the begaining
|
||||
var/fancytype = types[D.type]
|
||||
if (findtext(fancytype, types[type]))
|
||||
fancytype = copytext(fancytype, length(types[type])+1)
|
||||
var/shorttype = copytext("[D.type]", length("[type]")+1)
|
||||
if (length(shorttype) > length(fancytype))
|
||||
fancytype = copytext(fancytype, length(types[type]) + 1)
|
||||
var/shorttype = copytext("[D.type]", length("[type]") + 1)
|
||||
if (length_char(shorttype) > length_char(fancytype))
|
||||
shorttype = fancytype
|
||||
if (!length(shorttype))
|
||||
shorttype = "/"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
log_prayer("[src.key]/([src.name]): [msg]")
|
||||
@@ -54,21 +54,21 @@
|
||||
//log_admin("HELP: [key_name(src)]: [msg]")
|
||||
|
||||
/proc/CentCom_announce(text , mob/Sender)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=orange>CENTCOM:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_CENTCOM_REPLY(Sender)]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
/proc/Syndicate_announce(text , mob/Sender)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=crimson>SYNDICATE:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_SYNDICATE_REPLY(Sender)]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
C.overrideCooldown()
|
||||
|
||||
/proc/Nuke_request(text , mob/Sender)
|
||||
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN)
|
||||
msg = "<span class='adminnotice'><b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(Sender)] [ADMIN_CENTCOM_REPLY(Sender)] [ADMIN_SET_SD_CODE]:</b> [msg]</span>"
|
||||
to_chat(GLOB.admins, msg)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
|
||||
@@ -210,7 +210,7 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/edit_memory(mob/user)
|
||||
var/new_memo = copytext(trim(input(user,"Write new memory", "Memory", antag_memory) as null|message),1,MAX_MESSAGE_LEN)
|
||||
var/new_memo = stripped_multiline_input(user, "Write new memory", "Memory", antag_memory, MAX_MESSAGE_LEN)
|
||||
if (isnull(new_memo))
|
||||
return
|
||||
antag_memory = new_memo
|
||||
|
||||
@@ -203,7 +203,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
|
||||
|
||||
/mob/camera/blob/proc/blob_talk(message)
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
if (!message)
|
||||
return
|
||||
|
||||
@@ -283,8 +283,8 @@
|
||||
streak = ""
|
||||
restraining = 0
|
||||
streak = streak+element
|
||||
if(length(streak) > max_streak_length)
|
||||
streak = copytext(streak,2)
|
||||
if(length_char(streak) > max_streak_length)
|
||||
streak = streak[1]
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
return
|
||||
if(client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
message = trim(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
if(!message)
|
||||
return
|
||||
src.log_talk(message, LOG_SAY, tag="clockwork eminence")
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
var/wizard_name_second = pick(GLOB.wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
var/mob/living/wiz_mob = owner.current
|
||||
var/newname = copytext(sanitize(input(wiz_mob, "You are the [name]. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
var/newname = reject_bad_name(stripped_input(wiz_mob, "You are the [name]. Would you like to change your name to something else?", "Name change", randomname, MAX_NAME_LEN))
|
||||
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
|
||||
@@ -25,12 +25,13 @@
|
||||
listening = FALSE
|
||||
languages = message_language
|
||||
say("The recorded message is '[recorded]'.", language = message_language)
|
||||
activate_cooldown = max(round(length(recorded) * 0.5), 3 SECONDS)
|
||||
|
||||
/obj/item/assembly/playback/activate()
|
||||
if(recorded == "") // Why say anything when there isn't anything to say
|
||||
. = ..()
|
||||
if(!. || !recorded) // Why say anything when there isn't anything to say
|
||||
return FALSE
|
||||
say("[recorded]", language = languages) // Repeat the message in the language it was said in
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/playback/proc/record()
|
||||
if(!secured || holder)
|
||||
|
||||
@@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "[global.con
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
continue
|
||||
else if (copytext(t, 1, 2) == "#")
|
||||
else if (t[1] == "#")
|
||||
continue
|
||||
|
||||
var/pos = findtext(t, " ")
|
||||
|
||||
@@ -149,6 +149,14 @@
|
||||
crate_type = /obj/structure/closet/crate/secure/engineering
|
||||
dangerous = TRUE
|
||||
|
||||
/datum/supply_pack/engine/supermatter_spray
|
||||
name = "Supermatter Spray Crate"
|
||||
desc = "The single thing that can truly heal the supermatter."
|
||||
cost = 2000
|
||||
contains = list(/obj/item/supermatterspray)
|
||||
crate_name = "supermatter shard crate"
|
||||
crate_type = /obj/structure/closet/crate/engineering/electrical
|
||||
|
||||
/datum/supply_pack/engine/tesla_coils
|
||||
name = "Tesla Coil Crate"
|
||||
desc = "Whether it's high-voltage executions, creating research points, or just plain old power generation: This pack of four Tesla coils can do it all!"
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
desc = "Get your mind out of the gutter operative, you have work to do. Three items per order. Possible Results: .357 Speedloaders, Kitchen Gun Mags, Stetchkin Mags."
|
||||
hidden = TRUE
|
||||
cost = 12000
|
||||
var/num_contained = 3
|
||||
var/num_contained = 3
|
||||
contains = list(/obj/item/ammo_box/a357,
|
||||
/obj/item/ammo_box/a357,
|
||||
/obj/item/ammo_box/a357,
|
||||
@@ -268,6 +268,13 @@
|
||||
/obj/item/storage/box/matches)
|
||||
crate_name = "candle crate"
|
||||
|
||||
/datum/supply_pack/misc/diamondring
|
||||
name = "Diamond Ring"
|
||||
desc = "Show them your love is like a diamond: unbreakable and forever lasting. Shipped straight from child slave cartels in the space african mines."
|
||||
cost = 10000
|
||||
contains = list(/obj/item/storage/fancy/ringbox/diamond)
|
||||
crate_name = "diamond ring crate"
|
||||
|
||||
/datum/supply_pack/misc/exoticfootwear
|
||||
name = "Exotic Footwear Crate"
|
||||
desc = "Popularised by lizards and exotic dancers, the footwear included in this shipment is sure to give your feet the breathing room they deserve. Sweet Kicks Inc. is not responsible for any damage, distress, or @r0u$a1 caused by this shipment."
|
||||
@@ -303,6 +310,16 @@
|
||||
crate_name = "coffin"
|
||||
crate_type = /obj/structure/closet/crate/coffin
|
||||
|
||||
/datum/supply_pack/misc/jewelry
|
||||
name = "Jewelry Crate"
|
||||
desc = "Bling out with this crate of jewelry. Includes gold necklace and a set of two rings."
|
||||
cost = 5000
|
||||
contains = list(/obj/item/clothing/neck/necklace/dope,
|
||||
/obj/item/storage/fancy/ringbox,
|
||||
/obj/item/storage/fancy/ringbox/silver
|
||||
)
|
||||
crate_name = "jewelry crate"
|
||||
|
||||
/datum/supply_pack/misc/jukebox
|
||||
name = "Jukebox"
|
||||
cost = 10000
|
||||
|
||||
@@ -423,7 +423,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
winset(src, "[child]", "[entries[child]]")
|
||||
if (!ispath(child, /datum/verbs/menu))
|
||||
var/procpath/verbpath = child
|
||||
if (copytext(verbpath.name,1,2) != "@")
|
||||
if (verbpath.name[1] != "@")
|
||||
new child(src)
|
||||
|
||||
for (var/thing in prefs.menuoptions)
|
||||
|
||||
@@ -199,7 +199,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/auto_fit_viewport = TRUE
|
||||
|
||||
var/uplink_spawn_loc = UPLINK_PDA
|
||||
|
||||
|
||||
var/sprint_spacebar = FALSE
|
||||
var/sprint_toggle = FALSE
|
||||
|
||||
@@ -1476,9 +1476,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN)
|
||||
|
||||
if("flavor_text")
|
||||
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(features["flavor_text"]), MAX_MESSAGE_LEN*2, TRUE)
|
||||
if(!isnull(msg))
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN*2)
|
||||
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(features["flavor_text"]), MAX_MESSAGE_LEN, TRUE)
|
||||
if(msg)
|
||||
msg = msg
|
||||
features["flavor_text"] = msg
|
||||
|
||||
if("hair")
|
||||
@@ -2230,7 +2230,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
if("never_hypno")
|
||||
cit_toggles ^= NEVER_HYPNO
|
||||
|
||||
|
||||
if("aphro")
|
||||
cit_toggles ^= NO_APHRO
|
||||
|
||||
@@ -2239,7 +2239,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
if("bimbo")
|
||||
cit_toggles ^= BIMBOFICATION
|
||||
|
||||
|
||||
//END CITADEL EDIT
|
||||
|
||||
if("ambientocclusion")
|
||||
|
||||
@@ -118,7 +118,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
|
||||
if(!ckey)
|
||||
return
|
||||
path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/[filename]"
|
||||
path = "data/player_saves/[ckey[1]]/[ckey]/[filename]"
|
||||
|
||||
/datum/preferences/proc/load_preferences()
|
||||
if(!path)
|
||||
|
||||
@@ -31,7 +31,7 @@ GLOBAL_VAR_INIT(normal_aooc_colour, "#ce254f")
|
||||
if(QDELETED(src))
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
var/raw_msg = msg
|
||||
|
||||
if(!msg)
|
||||
|
||||
@@ -13,7 +13,7 @@ GLOBAL_VAR_INIT(normal_looc_colour, "#6699CC")
|
||||
if(!mob)
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
|
||||
if(QDELETED(src))
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
var/raw_msg = msg
|
||||
|
||||
if(!msg)
|
||||
@@ -36,7 +36,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
|
||||
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
if((copytext(msg, 1, 2) in list(".",";",":","#")) || (findtext(lowertext(copytext(msg, 1, 5)), "say")))
|
||||
if((msg[1] in list(".",";",":","#")) || findtext_char(msg, "say", 1, 5))
|
||||
if(alert("Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes")
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/obj/item/clothing/gloves/ring
|
||||
name = "gold ring"
|
||||
desc = "A tiny gold ring, sized to wrap around a finger."
|
||||
gender = NEUTER
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
icon = 'icons/obj/ring.dmi'
|
||||
icon_state = "ringgold"
|
||||
body_parts_covered = 0
|
||||
attack_verb = list("proposed")
|
||||
transfer_prints = TRUE
|
||||
strip_delay = 40
|
||||
|
||||
/obj/item/clothing/gloves/ring/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>\[user] is putting the [src] in [user.p_their()] mouth! It looks like [user] is trying to choke on the [src]!</span>")
|
||||
return OXYLOSS
|
||||
|
||||
|
||||
/obj/item/clothing/gloves/ring/diamond
|
||||
name = "diamond ring"
|
||||
desc = "A tiny gold ring, studded with a diamond. Cultures have used these rings in courtship for a millenia."
|
||||
icon_state = "ringdiamond"
|
||||
|
||||
/obj/item/clothing/gloves/ring/silver
|
||||
name = "silver ring"
|
||||
desc = "A tiny silver ring, sized to wrap around a finger."
|
||||
icon_state = "ringsilver"
|
||||
@@ -189,7 +189,7 @@
|
||||
var/tagname = null
|
||||
|
||||
/obj/item/clothing/neck/petcollar/attack_self(mob/user)
|
||||
tagname = copytext(sanitize(input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot") as null|text),1,MAX_NAME_LEN)
|
||||
tagname = stripped_input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot", MAX_NAME_LEN)
|
||||
name = "[initial(name)] - [tagname]"
|
||||
|
||||
/obj/item/clothing/neck/petcollar/worn_overlays(isinhands, icon_file, style_flags = NONE)
|
||||
|
||||
@@ -922,3 +922,78 @@
|
||||
|
||||
/obj/item/clothing/head/hooded/winterhood/christmashoodrg
|
||||
icon_state = "christmashoodrg"
|
||||
|
||||
/obj/item/clothing/suit/hooded/wintercoat/polychromic
|
||||
name = "polychromic winter coat"
|
||||
icon_state = "coatpoly"
|
||||
item_state = "coatpoly"
|
||||
item_color = "coatpoly"
|
||||
hoodtype = /obj/item/clothing/head/hooded/winterhood/polychromic
|
||||
hasprimary = TRUE
|
||||
hassecondary = TRUE
|
||||
hastertiary = TRUE
|
||||
primary_color = "#6A6964"
|
||||
secondary_color = "#C4B8A6"
|
||||
tertiary_color = "#0000FF"
|
||||
|
||||
/obj/item/clothing/head/hooded/winterhood/polychromic
|
||||
icon_state = "winterhood_poly"
|
||||
item_color = "winterhood_poly"
|
||||
item_state = "winterhood_poly"
|
||||
|
||||
/obj/item/clothing/head/hooded/winterhood/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens.
|
||||
. = ..()
|
||||
if(suit.hasprimary | suit.hassecondary)
|
||||
if(!isinhands) //prevents the worn sprites from showing up if you're just holding them
|
||||
if(suit.hasprimary) //checks if overlays are enabled
|
||||
var/mutable_appearance/primary_worn = mutable_appearance(icon_file, "[item_color]-primary") //automagical sprite selection
|
||||
primary_worn.color = suit.primary_color //colors the overlay
|
||||
. += primary_worn //adds the overlay onto the buffer list to draw on the mob sprite.
|
||||
if(suit.hassecondary)
|
||||
var/mutable_appearance/secondary_worn = mutable_appearance(icon_file, "[item_color]-secondary")
|
||||
secondary_worn.color = suit.secondary_color
|
||||
. += secondary_worn
|
||||
|
||||
/obj/item/clothing/suit/hooded/wintercoat/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens.
|
||||
. = ..()
|
||||
if(hasprimary | hassecondary | hastertiary)
|
||||
if(!isinhands) //prevents the worn sprites from showing up if you're just holding them
|
||||
if(hasprimary) //checks if overlays are enabled
|
||||
var/mutable_appearance/primary_worn = mutable_appearance(icon_file, "[item_color]-primary[suittoggled ? "_t" : ""]") //automagical sprite selection
|
||||
primary_worn.color = primary_color //colors the overlay
|
||||
. += primary_worn //adds the overlay onto the buffer list to draw on the mob sprite.
|
||||
if(hassecondary)
|
||||
var/mutable_appearance/secondary_worn = mutable_appearance(icon_file, "[item_color]-secondary[suittoggled ? "_t" : ""]")
|
||||
secondary_worn.color = secondary_color
|
||||
. += secondary_worn
|
||||
if(hastertiary)
|
||||
var/mutable_appearance/tertiary_worn = mutable_appearance(icon_file, "[item_color]-tertiary[suittoggled ? "_t" : ""]")
|
||||
tertiary_worn.color = tertiary_color
|
||||
. += tertiary_worn
|
||||
|
||||
/obj/item/clothing/suit/hooded/wintercoat/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
return
|
||||
if(hasprimary | hassecondary | hastertiary)
|
||||
var/choice = input(user,"polychromic thread options", "Clothing Recolor") as null|anything in list("[hasprimary ? "Primary Color" : ""]", "[hassecondary ? "Secondary Color" : ""]", "[hastertiary ? "Tertiary Color" : ""]") //generates a list depending on the enabled overlays
|
||||
switch(choice) //Lets the list's options actually lead to something
|
||||
if("Primary Color")
|
||||
var/primary_color_input = input(usr,"","Choose Primary Color",primary_color) as color|null //color input menu, the "|null" adds a cancel button to it.
|
||||
if(primary_color_input) //Checks if the color selected is NULL, rejects it if it is NULL.
|
||||
primary_color = sanitize_hexcolor(primary_color_input, desired_format=6, include_crunch=1) //formats the selected color properly
|
||||
update_icon() //updates the item icon
|
||||
user.regenerate_icons() //updates the worn icon. Probably a bad idea, but it works.
|
||||
if("Secondary Color")
|
||||
var/secondary_color_input = input(usr,"","Choose Secondary Color",secondary_color) as color|null
|
||||
if(secondary_color_input)
|
||||
secondary_color = sanitize_hexcolor(secondary_color_input, desired_format=6, include_crunch=1)
|
||||
update_icon()
|
||||
user.regenerate_icons()
|
||||
if("Tertiary Color")
|
||||
var/tertiary_color_input = input(usr,"","Choose Tertiary Color",tertiary_color) as color|null
|
||||
if(tertiary_color_input)
|
||||
tertiary_color = sanitize_hexcolor(tertiary_color_input, desired_format=6, include_crunch=1)
|
||||
update_icon()
|
||||
user.regenerate_icons()
|
||||
return TRUE
|
||||
@@ -1,443 +0,0 @@
|
||||
/datum/personal_crafting
|
||||
var/busy
|
||||
var/viewing_category = 1 //typical powergamer starting on the Weapons tab
|
||||
var/viewing_subcategory = 1
|
||||
var/list/categories = list(
|
||||
CAT_WEAPONRY,
|
||||
CAT_ROBOT,
|
||||
CAT_MISC,
|
||||
CAT_PRIMAL,
|
||||
CAT_FOOD,
|
||||
CAT_CLOTHING)
|
||||
var/list/subcategories = list(
|
||||
list( //Weapon subcategories
|
||||
CAT_WEAPON,
|
||||
CAT_AMMO),
|
||||
CAT_NONE, //Robot subcategories
|
||||
CAT_NONE, //Misc subcategories
|
||||
CAT_NONE, //Tribal subcategories
|
||||
list( //Food subcategories
|
||||
CAT_BREAD,
|
||||
CAT_BURGER,
|
||||
CAT_CAKE,
|
||||
CAT_EGG,
|
||||
CAT_FISH,
|
||||
CAT_ICE, //Called Frozen
|
||||
CAT_MEAT,
|
||||
CAT_MISCFOOD,
|
||||
CAT_PASTRY,
|
||||
CAT_PIE,
|
||||
CAT_PIZZA,
|
||||
CAT_SALAD,
|
||||
CAT_SANDWICH,
|
||||
CAT_SOUP,
|
||||
CAT_SPAGHETTI),
|
||||
CAT_NONE) //Clothing subcategories
|
||||
|
||||
var/datum/action/innate/crafting/button
|
||||
var/display_craftable_only = FALSE
|
||||
var/display_compact = TRUE
|
||||
|
||||
|
||||
|
||||
|
||||
/* This is what procs do:
|
||||
get_environment - gets a list of things accessable for crafting by user
|
||||
get_surroundings - takes a list of things and makes a list of key-types to values-amounts of said type in the list
|
||||
check_contents - takes a recipe and a key-type list and checks if said recipe can be done with available stuff
|
||||
check_tools - takes recipe, a key-type list, and a user and checks if there are enough tools to do the stuff, checks bugs one level deep
|
||||
construct_item - takes a recipe and a user, call all the checking procs, calls do_after, checks all the things again, calls del_reqs, creates result, calls CheckParts of said result with argument being list returned by deel_reqs
|
||||
del_reqs - takes recipe and a user, loops over the recipes reqs var and tries to find everything in the list make by get_environment and delete it/add to parts list, then returns the said list
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/personal_crafting/proc/check_contents(datum/crafting_recipe/R, list/contents)
|
||||
contents = contents["other"]
|
||||
main_loop:
|
||||
for(var/A in R.reqs)
|
||||
var/needed_amount = R.reqs[A]
|
||||
for(var/B in contents)
|
||||
if(ispath(B, A))
|
||||
if(contents[B] >= R.reqs[A])
|
||||
continue main_loop
|
||||
else
|
||||
needed_amount -= contents[B]
|
||||
if(needed_amount <= 0)
|
||||
continue main_loop
|
||||
else
|
||||
continue
|
||||
return 0
|
||||
for(var/A in R.chem_catalysts)
|
||||
if(contents[A] < R.chem_catalysts[A])
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/personal_crafting/proc/get_environment(mob/user)
|
||||
. = list()
|
||||
for(var/obj/item/I in user.held_items)
|
||||
. += I
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
var/list/L = block(get_step(user, SOUTHWEST), get_step(user, NORTHEAST))
|
||||
for(var/A in L)
|
||||
var/turf/T = A
|
||||
if(T.Adjacent(user))
|
||||
for(var/B in T)
|
||||
var/atom/movable/AM = B
|
||||
if(AM.flags_1 & HOLOGRAM_1)
|
||||
continue
|
||||
. += AM
|
||||
|
||||
/datum/personal_crafting/proc/get_surroundings(mob/user)
|
||||
. = list()
|
||||
.["tool_behaviour"] = list()
|
||||
.["other"] = list()
|
||||
for(var/obj/item/I in get_environment(user))
|
||||
if(I.flags_1 & HOLOGRAM_1)
|
||||
continue
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
.["other"][I.type] += S.amount
|
||||
else if(I.tool_behaviour)
|
||||
.["tool_behaviour"] += I.tool_behaviour
|
||||
.["other"][I.type] += 1
|
||||
else
|
||||
if(istype(I, /obj/item/reagent_containers))
|
||||
var/obj/item/reagent_containers/RC = I
|
||||
if(RC.is_drainable())
|
||||
for(var/datum/reagent/A in RC.reagents.reagent_list)
|
||||
.["other"][A.type] += A.volume
|
||||
.["other"][I.type] += 1
|
||||
|
||||
/datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
|
||||
if(!R.tools.len)
|
||||
return TRUE
|
||||
var/list/possible_tools = list()
|
||||
var/list/present_qualities = list()
|
||||
present_qualities |= contents["tool_behaviour"]
|
||||
for(var/obj/item/I in user.contents)
|
||||
if(istype(I, /obj/item/storage))
|
||||
for(var/obj/item/SI in I.contents)
|
||||
possible_tools += SI.type
|
||||
if(SI.tool_behaviour)
|
||||
present_qualities.Add(SI.tool_behaviour)
|
||||
|
||||
possible_tools += I.type
|
||||
|
||||
if(I.tool_behaviour)
|
||||
present_qualities.Add(I.tool_behaviour)
|
||||
|
||||
possible_tools |= contents["other"]
|
||||
|
||||
main_loop:
|
||||
for(var/A in R.tools)
|
||||
if(A in present_qualities)
|
||||
continue
|
||||
else
|
||||
for(var/I in possible_tools)
|
||||
if(ispath(I, A))
|
||||
continue main_loop
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
|
||||
var/list/contents = get_surroundings(user)
|
||||
var/send_feedback = 1
|
||||
if(check_contents(R, contents))
|
||||
if(check_tools(user, R, contents))
|
||||
if(do_after(user, R.time, target = user))
|
||||
contents = get_surroundings(user)
|
||||
if(!check_contents(R, contents))
|
||||
return ", missing component."
|
||||
if(!check_tools(user, R, contents))
|
||||
return ", missing tool."
|
||||
var/list/parts = del_reqs(R, user)
|
||||
var/atom/movable/I = new R.result (get_turf(user.loc))
|
||||
I.CheckParts(parts, R)
|
||||
if(send_feedback)
|
||||
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
|
||||
log_craft("[I] crafted by [user] at [loc_name(I.loc)]")
|
||||
return 0
|
||||
return "."
|
||||
return ", missing tool."
|
||||
return ", missing component."
|
||||
|
||||
|
||||
/*Del reqs works like this:
|
||||
|
||||
Loop over reqs var of the recipe
|
||||
Set var amt to the value current cycle req is pointing to, its amount of type we need to delete
|
||||
Get var/surroundings list of things accessable to crafting by get_environment()
|
||||
Check the type of the current cycle req
|
||||
If its reagent then do a while loop, inside it try to locate() reagent containers, inside such containers try to locate needed reagent, if there isnt remove thing from surroundings
|
||||
If there is enough reagent in the search result then delete the needed amount, create the same type of reagent with the same data var and put it into deletion list
|
||||
If there isnt enough take all of that reagent from the container, put into deletion list, substract the amt var by the volume of reagent, remove the container from surroundings list and keep searching
|
||||
While doing above stuff check deletion list if it already has such reagnet, if yes merge instead of adding second one
|
||||
If its stack check if it has enough amount
|
||||
If yes create new stack with the needed amount and put in into deletion list, substract taken amount from the stack
|
||||
If no put all of the stack in the deletion list, substract its amount from amt and keep searching
|
||||
While doing above stuff check deletion list if it already has such stack type, if yes try to merge them instead of adding new one
|
||||
If its anything else just locate() in in the list in a while loop, each find --s the amt var and puts the found stuff in deletion loop
|
||||
|
||||
Then do a loop over parts var of the recipe
|
||||
Do similar stuff to what we have done above, but now in deletion list, until the parts conditions are satisfied keep taking from the deletion list and putting it into parts list for return
|
||||
|
||||
After its done loop over deletion list and delete all the shit that wasnt taken by parts loop
|
||||
|
||||
del_reqs return the list of parts resulting object will receive as argument of CheckParts proc, on the atom level it will add them all to the contents, on all other levels it calls ..() and does whatever is needed afterwards but from contents list already
|
||||
*/
|
||||
|
||||
/datum/personal_crafting/proc/del_reqs(datum/crafting_recipe/R, mob/user)
|
||||
var/list/surroundings
|
||||
var/list/Deletion = list()
|
||||
. = list()
|
||||
var/data
|
||||
var/amt
|
||||
main_loop:
|
||||
for(var/A in R.reqs)
|
||||
amt = R.reqs[A]
|
||||
surroundings = get_environment(user)
|
||||
surroundings -= Deletion
|
||||
if(ispath(A, /datum/reagent))
|
||||
var/datum/reagent/RG = new A
|
||||
var/datum/reagent/RGNT
|
||||
while(amt > 0)
|
||||
var/obj/item/reagent_containers/RC = locate() in surroundings
|
||||
RG = RC.reagents.get_reagent(A)
|
||||
if(RG)
|
||||
if(!locate(RG.type) in Deletion)
|
||||
Deletion += new RG.type()
|
||||
if(RG.volume > amt)
|
||||
RG.volume -= amt
|
||||
data = RG.data
|
||||
RC.reagents.conditional_update(RC)
|
||||
RG = locate(RG.type) in Deletion
|
||||
RG.volume = amt
|
||||
RG.data += data
|
||||
continue main_loop
|
||||
else
|
||||
surroundings -= RC
|
||||
amt -= RG.volume
|
||||
RC.reagents.reagent_list -= RG
|
||||
RC.reagents.conditional_update(RC)
|
||||
RGNT = locate(RG.type) in Deletion
|
||||
RGNT.volume += RG.volume
|
||||
RGNT.data += RG.data
|
||||
qdel(RG)
|
||||
RC.on_reagent_change()
|
||||
else
|
||||
surroundings -= RC
|
||||
else if(ispath(A, /obj/item/stack))
|
||||
var/obj/item/stack/S
|
||||
var/obj/item/stack/SD
|
||||
while(amt > 0)
|
||||
S = locate(A) in surroundings
|
||||
if(S.amount >= amt)
|
||||
if(!locate(S.type) in Deletion)
|
||||
SD = new S.type()
|
||||
Deletion += SD
|
||||
S.use(amt)
|
||||
SD = locate(S.type) in Deletion
|
||||
SD.amount += amt
|
||||
continue main_loop
|
||||
else
|
||||
amt -= S.amount
|
||||
if(!locate(S.type) in Deletion)
|
||||
Deletion += S
|
||||
else
|
||||
data = S.amount
|
||||
S = locate(S.type) in Deletion
|
||||
S.add(data)
|
||||
surroundings -= S
|
||||
else
|
||||
var/atom/movable/I
|
||||
while(amt > 0)
|
||||
I = locate(A) in surroundings
|
||||
Deletion += I
|
||||
surroundings -= I
|
||||
amt--
|
||||
var/list/partlist = list(R.parts.len)
|
||||
for(var/M in R.parts)
|
||||
partlist[M] = R.parts[M]
|
||||
for(var/A in R.parts)
|
||||
if(istype(A, /datum/reagent))
|
||||
var/datum/reagent/RG = locate(A) in Deletion
|
||||
if(RG.volume > partlist[A])
|
||||
RG.volume = partlist[A]
|
||||
. += RG
|
||||
Deletion -= RG
|
||||
continue
|
||||
else if(istype(A, /obj/item/stack))
|
||||
var/obj/item/stack/ST = locate(A) in Deletion
|
||||
if(ST.amount > partlist[A])
|
||||
ST.amount = partlist[A]
|
||||
. += ST
|
||||
Deletion -= ST
|
||||
continue
|
||||
else
|
||||
while(partlist[A] > 0)
|
||||
var/atom/movable/AM = locate(A) in Deletion
|
||||
. += AM
|
||||
Deletion -= AM
|
||||
partlist[A] -= 1
|
||||
while(Deletion.len)
|
||||
var/DL = Deletion[Deletion.len]
|
||||
Deletion.Cut(Deletion.len)
|
||||
qdel(DL)
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "personal_crafting", "Crafting Menu", 700, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/subs = list()
|
||||
var/cur_subcategory = CAT_NONE
|
||||
var/cur_category = categories[viewing_category]
|
||||
if (islist(subcategories[viewing_category]))
|
||||
subs = subcategories[viewing_category]
|
||||
cur_subcategory = subs[viewing_subcategory]
|
||||
data["busy"] = busy
|
||||
data["prev_cat"] = categories[prev_cat()]
|
||||
data["prev_subcat"] = subs[prev_subcat()]
|
||||
data["category"] = cur_category
|
||||
data["subcategory"] = cur_subcategory
|
||||
data["next_cat"] = categories[next_cat()]
|
||||
data["next_subcat"] = subs[next_subcat()]
|
||||
data["display_craftable_only"] = display_craftable_only
|
||||
data["display_compact"] = display_compact
|
||||
|
||||
var/list/surroundings = get_surroundings(user)
|
||||
var/list/can_craft = list()
|
||||
var/list/cant_craft = list()
|
||||
for(var/rec in GLOB.crafting_recipes)
|
||||
var/datum/crafting_recipe/R = rec
|
||||
if(!R.always_availible && !(R.type in user?.mind?.learned_recipes)) //User doesn't actually know how to make this.
|
||||
continue
|
||||
if((R.category != cur_category) || (R.subcategory != cur_subcategory))
|
||||
continue
|
||||
if(check_contents(R, surroundings))
|
||||
can_craft += list(build_recipe_data(R))
|
||||
else
|
||||
cant_craft += list(build_recipe_data(R))
|
||||
data["can_craft"] = can_craft
|
||||
data["cant_craft"] = cant_craft
|
||||
return data
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("make")
|
||||
var/datum/crafting_recipe/TR = locate(params["recipe"])
|
||||
busy = TRUE
|
||||
ui_interact(usr) //explicit call to show the busy display
|
||||
var/fail_msg = construct_item(usr, TR)
|
||||
if(!fail_msg)
|
||||
to_chat(usr, "<span class='notice'>[TR.name] constructed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Construction failed[fail_msg]</span>")
|
||||
busy = FALSE
|
||||
ui_interact(usr)
|
||||
if("forwardCat") //Meow
|
||||
viewing_category = next_cat(FALSE)
|
||||
. = TRUE
|
||||
if("backwardCat")
|
||||
viewing_category = prev_cat(FALSE)
|
||||
. = TRUE
|
||||
if("forwardSubCat")
|
||||
viewing_subcategory = next_subcat()
|
||||
. = TRUE
|
||||
if("backwardSubCat")
|
||||
viewing_subcategory = prev_subcat()
|
||||
. = TRUE
|
||||
if("toggle_recipes")
|
||||
display_craftable_only = !display_craftable_only
|
||||
. = TRUE
|
||||
if("toggle_compact")
|
||||
display_compact = !display_compact
|
||||
. = TRUE
|
||||
|
||||
|
||||
//Next works nicely with modular arithmetic
|
||||
/datum/personal_crafting/proc/next_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
. = viewing_category % categories.len + 1
|
||||
|
||||
/datum/personal_crafting/proc/next_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
. = viewing_subcategory % subs.len + 1
|
||||
|
||||
|
||||
//Previous can go fuck itself
|
||||
/datum/personal_crafting/proc/prev_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
if(viewing_category == categories.len)
|
||||
. = viewing_category-1
|
||||
else
|
||||
. = viewing_category % categories.len - 1
|
||||
if(. <= 0)
|
||||
. = categories.len
|
||||
|
||||
/datum/personal_crafting/proc/prev_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
if(viewing_subcategory == subs.len)
|
||||
. = viewing_subcategory-1
|
||||
else
|
||||
. = viewing_subcategory % subs.len - 1
|
||||
if(. <= 0)
|
||||
. = subs.len
|
||||
else
|
||||
. = null
|
||||
|
||||
|
||||
/datum/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||
var/list/data = list()
|
||||
data["name"] = R.name
|
||||
data["ref"] = "[REF(R)]"
|
||||
var/req_text = ""
|
||||
var/tool_text = ""
|
||||
var/catalyst_text = ""
|
||||
|
||||
for(var/a in R.reqs)
|
||||
//We just need the name, so cheat-typecast to /atom for speed (even tho Reagents are /datum they DO have a "name" var)
|
||||
//Also these are typepaths so sadly we can't just do "[a]"
|
||||
var/atom/A = a
|
||||
req_text += " [R.reqs[A]] [initial(A.name)],"
|
||||
req_text = replacetext(req_text,",","",-1)
|
||||
data["req_text"] = req_text
|
||||
|
||||
for(var/a in R.chem_catalysts)
|
||||
var/atom/A = a //cheat-typecast
|
||||
catalyst_text += " [R.chem_catalysts[A]] [initial(A.name)],"
|
||||
catalyst_text = replacetext(catalyst_text,",","",-1)
|
||||
data["catalyst_text"] = catalyst_text
|
||||
|
||||
for(var/a in R.tools)
|
||||
if(ispath(a, /obj/item))
|
||||
var/obj/item/b = a
|
||||
tool_text += " [initial(b.name)],"
|
||||
else
|
||||
tool_text += " [a],"
|
||||
tool_text = replacetext(tool_text,",","",-1)
|
||||
data["tool_text"] = tool_text
|
||||
|
||||
return data
|
||||
|
||||
//Mind helpers
|
||||
|
||||
/datum/mind/proc/teach_crafting_recipe(R)
|
||||
if(!learned_recipes)
|
||||
learned_recipes = list()
|
||||
learned_recipes |= R
|
||||
@@ -1,299 +0,0 @@
|
||||
//This file is for glass working types of things!
|
||||
|
||||
/obj/item/glasswork
|
||||
name = "This is a bug report it!"
|
||||
desc = "Failer to code. Contact your local bug remover..."
|
||||
icon = 'icons/obj/glassworks.dmi'
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
force = 1
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
tool_behaviour = null
|
||||
|
||||
/obj/item/glasswork/glasskit
|
||||
name = "Glass working tools"
|
||||
desc = "A lovely belt of most the tools you will need to shape, mold, and refine glass into more advanced shapes."
|
||||
icon_state = "glass_tools"
|
||||
tool_behaviour = TOOL_GLASS_CUT
|
||||
|
||||
/obj/item/glasswork/blowing_rod
|
||||
name = "Glass working blow rod"
|
||||
desc = "A hollow metal stick made for glass blowing."
|
||||
icon_state = "blowing_rods_unused"
|
||||
tool_behaviour = TOOL_BLOW
|
||||
|
||||
/obj/item/glasswork/glass_base
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A sheet of glass set aside for glass working"
|
||||
icon_state = "glass_base"
|
||||
var/next_step = null
|
||||
var/rod = /obj/item/glasswork/blowing_rod
|
||||
|
||||
/obj/item/lens
|
||||
name = "Optical lens"
|
||||
desc = "Good for selling or crafting, by itself its useless"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "glass_optics"
|
||||
|
||||
//////////////////////Chem Disk/////////////////////
|
||||
//Two Steps //
|
||||
//Sells for 300 cr, takes 10 glass shets //
|
||||
//Usefull for chem spliting //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/glasswork/glass_base/dish
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A set of glass sheets set aside for glass working, this one is ideal for a small glass dish. Needs to be cut with some tools."
|
||||
next_step = /obj/item/glasswork/glass_base/dish_part1
|
||||
|
||||
/obj/item/glasswork/glass_base/dish/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/dish_part1
|
||||
name = "Half chem dish sheet"
|
||||
desc = "A sheet of glass cut in half, looks like it still needs some more cutting down"
|
||||
icon_state = "glass_base_half"
|
||||
next_step = /obj/item/reagent_containers/glass/beaker/glass_dish
|
||||
|
||||
/obj/item/glasswork/glass_base/dish_part1/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
//////////////////////Lens//////////////////////////
|
||||
//Six Steps //
|
||||
//Sells for 1800 cr, takes 15 glass shets //
|
||||
//Usefull for selling and later crafting //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A set of glass sheets set aside for glass working, this one is ideal for a small glass lens. Needs to be cut with some tools."
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part1
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part1
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass ready to be heated. Needs to be heated with some tools."
|
||||
icon_state = "glass_base_half"
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part2
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part1/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part2
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated. Needs to be heated more with some tools."
|
||||
icon_state = "glass_base_heat"
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part3
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part2/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part3
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated into a blob of hot glass. Needs to be placed onto a blow tube."
|
||||
icon_state = "glass_base_molding"
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part4
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part3/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_BLOW)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
qdel(I)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part4
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated into a blob of hot glass. Needs to be cut off onto a blow tube."
|
||||
icon_state = "blowing_rods_inuse"
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part5
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part4/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
new rod(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part5
|
||||
name = "Unpolished glass lens"
|
||||
desc = "A small unpolished glass lens. Could be polished with some cloth."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "glass_optics"
|
||||
next_step = /obj/item/glasswork/glass_base/glass_lens_part6
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part5/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(istype(I, /obj/item/stack/sheet/cloth))
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part6
|
||||
name = "Unrefined glass lens"
|
||||
desc = "A small polished glass lens. Just needs to be refined with some sandstone."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "glass_optics"
|
||||
next_step = /obj/item/lens
|
||||
|
||||
/obj/item/glasswork/glass_base/glass_lens_part6/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(istype(I, /obj/item/stack/sheet/mineral/sandstone))
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
//////////////////////Spouty Flask//////////////////
|
||||
//Four Steps //
|
||||
//Sells for 1200 cr, takes 20 glass shets //
|
||||
//Usefull for selling and chemical things //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A set of glass sheets set aside for glass working, this one is ideal for a spout beaker. Needs to be cut with some tools."
|
||||
next_step = /obj/item/glasswork/glass_base/spouty_part2
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part2
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated. Needs to be heated with some tools."
|
||||
icon_state = "glass_base_half"
|
||||
next_step = /obj/item/glasswork/glass_base/spouty_part3
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part2/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part3
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated into a blob of hot glass. Needs to be placed onto a blow tube."
|
||||
icon_state = "glass_base_molding"
|
||||
next_step = /obj/item/glasswork/glass_base/spouty_part4
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part3/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_BLOW)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
qdel(I)
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part4
|
||||
name = "Glass fodder sheet"
|
||||
desc = "Cut glass that has been heated into a blob of hot glass. Needs to be cut off onto a blow tube."
|
||||
icon_state = "blowing_rods_inuse"
|
||||
next_step = /obj/item/reagent_containers/glass/beaker/flask/spouty
|
||||
|
||||
/obj/item/glasswork/glass_base/spouty_part4/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
new rod(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
//////////////////////Small Bulb Flask//////////////
|
||||
//Two Steps //
|
||||
//Sells for 600 cr, takes 5 glass shets //
|
||||
//Usefull for selling and chemical things //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A set of glass sheets set aside for glass working, this one is ideal for a small flask. Needs to be heated with some tools."
|
||||
next_step = /obj/item/glasswork/glass_base/flask_small_part1
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small_part1
|
||||
name = "Metled glass"
|
||||
desc = "A blob of metled glass, this one is ideal for a small flask. Needs to be blown with some tools."
|
||||
icon_state = "glass_base_molding"
|
||||
next_step = /obj/item/glasswork/glass_base/flask_small_part2
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small_part1/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_BLOW)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
qdel(I)
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small_part2
|
||||
name = "Metled glass"
|
||||
desc = "A blob of metled glass on the end of a blowing rod. Needs to be cut off with some tools."
|
||||
icon_state = "blowing_rods_inuse"
|
||||
next_step = /obj/item/reagent_containers/glass/beaker/flask
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_small_part2/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
new rod(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
//////////////////////Large Bulb Flask//////////////
|
||||
//Two Steps //
|
||||
//Sells for 1000 cr, takes 15 glass shets //
|
||||
//Usefull for selling and chemical things //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large
|
||||
name = "Glass fodder sheet"
|
||||
desc = "A set of glass sheets set aside for glass working, this one is ideal for a large flask. Needs to be heated with some tools."
|
||||
next_step = /obj/item/glasswork/glass_base/flask_large_part1
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_WELDER)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large_part1
|
||||
name = "Metled glass"
|
||||
desc = "A blob of metled glass, this one is ideal for a large flask. Needs to be blown with some tools."
|
||||
icon_state = "glass_base_molding"
|
||||
next_step = /obj/item/glasswork/glass_base/flask_large_part2
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large_part1/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_BLOW)
|
||||
new next_step(user.loc, 1)
|
||||
qdel(src)
|
||||
qdel(I)
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large_part2
|
||||
name = "Metled glass"
|
||||
desc = "A blob of metled glass on the end of a blowing rod. Needs to be cut off with some tools."
|
||||
icon_state = "blowing_rods_inuse"
|
||||
next_step = /obj/item/reagent_containers/glass/beaker/flask/large
|
||||
|
||||
/obj/item/glasswork/glass_base/flask_large_part2/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
if(I.tool_behaviour == TOOL_GLASS_CUT)
|
||||
new next_step(user.loc, 1)
|
||||
new rod(user.loc, 1)
|
||||
qdel(src)
|
||||
@@ -1,15 +0,0 @@
|
||||
//Gun crafting parts til they can be moved elsewhere
|
||||
|
||||
// PARTS //
|
||||
|
||||
/obj/item/weaponcrafting/receiver
|
||||
name = "modular receiver"
|
||||
desc = "A prototype modular receiver and trigger assembly for a firearm."
|
||||
icon = 'icons/obj/improvised.dmi'
|
||||
icon_state = "receiver"
|
||||
|
||||
/obj/item/weaponcrafting/stock
|
||||
name = "rifle stock"
|
||||
desc = "A classic rifle stock that doubles as a grip, roughly carved out of wood."
|
||||
icon = 'icons/obj/improvised.dmi'
|
||||
icon_state = "riflestock"
|
||||
@@ -1,11 +0,0 @@
|
||||
/datum/crafting_recipe
|
||||
var/name = "" //in-game display name
|
||||
var/reqs[] = list() //type paths of items consumed associated with how many are needed
|
||||
var/result //type path of item resulting from this craft
|
||||
var/tools[] = list() //type paths of items needed but not consumed
|
||||
var/time = 30 //time in deciseconds
|
||||
var/parts[] = list() //type paths of items that will be placed in the result
|
||||
var/chem_catalysts[] = list() //like tools but for reagents
|
||||
var/category = CAT_NONE //where it shows up in the crafting UI
|
||||
var/subcategory = CAT_NONE
|
||||
var/always_availible = TRUE //Set to FALSE if it needs to be learned first.
|
||||
@@ -1,187 +0,0 @@
|
||||
/datum/crafting_recipe/mummy
|
||||
name = "Mummification Bandages (Mask)"
|
||||
result = /obj/item/clothing/mask/mummy
|
||||
time = 10
|
||||
tools = list(/obj/item/nullrod/egyptian)
|
||||
reqs = list(/obj/item/stack/sheet/cloth = 2)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/mummy/body
|
||||
name = "Mummification Bandages (Body)"
|
||||
result = /obj/item/clothing/under/mummy
|
||||
reqs = list(/obj/item/stack/sheet/cloth = 5)
|
||||
|
||||
/datum/crafting_recipe/lizardhat
|
||||
name = "Lizard Cloche Hat"
|
||||
result = /obj/item/clothing/head/lizard
|
||||
time = 10
|
||||
reqs = list(/obj/item/organ/tail/lizard = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/lizardhat_alternate
|
||||
name = "Lizard Cloche Hat"
|
||||
result = /obj/item/clothing/head/lizard
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/sheet/animalhide/lizard = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/kittyears
|
||||
name = "Kitty Ears"
|
||||
result = /obj/item/clothing/head/kitty/genuine
|
||||
time = 10
|
||||
reqs = list(/obj/item/organ/tail/cat = 1,
|
||||
/obj/item/organ/ears/cat = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/hudsunsec
|
||||
name = "Security HUDsunglasses"
|
||||
result = /obj/item/clothing/glasses/hud/security/sunglasses
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/hud/security = 1,
|
||||
/obj/item/clothing/glasses/sunglasses = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/hudsunsecremoval
|
||||
name = "Security HUD removal"
|
||||
result = /obj/item/clothing/glasses/sunglasses
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/hud/security/sunglasses = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/hudsunmed
|
||||
name = "Medical HUDsunglasses"
|
||||
result = /obj/item/clothing/glasses/hud/health/sunglasses
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/hud/health = 1,
|
||||
/obj/item/clothing/glasses/sunglasses = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/hudsunmedremoval
|
||||
name = "Medical HUD removal"
|
||||
result = /obj/item/clothing/glasses/sunglasses
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/hud/health/sunglasses = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/beergoggles
|
||||
name = "Beer Goggles"
|
||||
result = /obj/item/clothing/glasses/sunglasses/reagent
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/science = 1,
|
||||
/obj/item/clothing/glasses/sunglasses = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/beergogglesremoval
|
||||
name = "Beer Goggles removal"
|
||||
result = /obj/item/clothing/glasses/sunglasses
|
||||
time = 20
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/clothing/glasses/sunglasses/reagent = 1)
|
||||
category = CAT_CLOTHING
|
||||
/* //Kevinz doesn't want it as a recipe for now, leaving it in if anything ever changes to let it in
|
||||
/datum/crafting_recipe/stunglasses
|
||||
name = "Stunglasses"
|
||||
result = /obj/item/clothing/glasses/sunglasses/stunglasses
|
||||
time = 60
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/assembly/flash = 1,
|
||||
/obj/item/clothing/glasses/sunglasses = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_CLOTHING
|
||||
*/
|
||||
/datum/crafting_recipe/ghostsheet
|
||||
name = "Ghost Sheet"
|
||||
result = /obj/item/clothing/suit/ghost_sheet
|
||||
time = 5
|
||||
tools = list(TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/bedsheet = 1)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/briefcase
|
||||
name = "Hand made Briefcase"
|
||||
result = /obj/item/storage/briefcase/crafted
|
||||
time = 35
|
||||
tools = list(TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/stack/sheet/cardboard = 1,
|
||||
/obj/item/stack/sheet/cloth = 2,
|
||||
/obj/item/stack/sheet/leather = 5)
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/medolier
|
||||
name = "Medolier"
|
||||
result = /obj/item/storage/belt/medolier
|
||||
reqs = list(/obj/item/stack/sheet/metal = 2,
|
||||
/obj/item/stack/sheet/cloth = 3,
|
||||
/obj/item/stack/sheet/plastic = 4)
|
||||
time = 30
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_duffelbag
|
||||
name = "Durathread Dufflebag"
|
||||
result = /obj/item/storage/backpack/duffelbag/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 7,
|
||||
/obj/item/stack/sheet/leather = 3)
|
||||
time = 70
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_toolbelt
|
||||
name = "Durathread Toolbelt"
|
||||
result = /obj/item/storage/belt/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 5,
|
||||
/obj/item/stack/sheet/leather = 2)
|
||||
time = 30
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_bandolier
|
||||
name = "Durathread Bandolier"
|
||||
result = /obj/item/storage/belt/bandolier/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 6,
|
||||
/obj/item/stack/sheet/leather = 2)
|
||||
time = 50
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_helmet
|
||||
name = "Makeshift Durathread Helmet"
|
||||
result = /obj/item/clothing/head/helmet/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 4,
|
||||
/obj/item/stack/sheet/leather = 2)
|
||||
time = 30
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_vest
|
||||
name = "Makeshift Durathread Armour"
|
||||
result = /obj/item/clothing/suit/armor/vest/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 6,
|
||||
/obj/item/stack/sheet/leather = 3)
|
||||
time = 50
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/durathread_wintercoat
|
||||
name = "Durathread Winter Coat"
|
||||
result = /obj/item/clothing/suit/hooded/wintercoat/durathread
|
||||
reqs = list(/obj/item/stack/sheet/durathread = 12,
|
||||
/obj/item/stack/sheet/leather = 10)
|
||||
time = 70
|
||||
category = CAT_CLOTHING
|
||||
|
||||
/datum/crafting_recipe/wintercoat_cosmic
|
||||
name = "Cosmic Winter Coat"
|
||||
result = /obj/item/clothing/suit/hooded/wintercoat/cosmic
|
||||
reqs = list(/obj/item/clothing/suit/hooded/wintercoat = 1,
|
||||
/obj/item/bedsheet/cosmos = 1)
|
||||
time = 60
|
||||
always_availible = TRUE
|
||||
category = CAT_CLOTHING
|
||||
@@ -1,368 +0,0 @@
|
||||
/////////////////
|
||||
//Large Objects//
|
||||
/////////////////
|
||||
|
||||
/datum/crafting_recipe/showercurtain
|
||||
name = "Shower Curtains"
|
||||
reqs = list(/obj/item/stack/sheet/cloth = 2,
|
||||
/obj/item/stack/sheet/plastic = 2,
|
||||
/obj/item/stack/rods = 1)
|
||||
result = /obj/structure/curtain
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/guillotine
|
||||
name = "Guillotine"
|
||||
result = /obj/structure/guillotine
|
||||
time = 150 // Building a functioning guillotine takes time
|
||||
reqs = list(/obj/item/stack/sheet/plasteel = 3,
|
||||
/obj/item/stack/sheet/mineral/wood = 20,
|
||||
/obj/item/stack/cable_coil = 10)
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/femur_breaker
|
||||
name = "Femur Breaker"
|
||||
result = /obj/structure/femur_breaker
|
||||
time = 150
|
||||
reqs = list(/obj/item/stack/sheet/metal = 20,
|
||||
/obj/item/stack/cable_coil = 30)
|
||||
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
|
||||
category = CAT_MISC
|
||||
|
||||
///////////////////
|
||||
//Tools & Storage//
|
||||
///////////////////
|
||||
|
||||
/datum/crafting_recipe/ghettojetpack
|
||||
name = "Improvised Jetpack"
|
||||
result = /obj/item/tank/jetpack/improvised
|
||||
time = 30
|
||||
reqs = list(/obj/item/tank/internals/oxygen = 2,
|
||||
/obj/item/extinguisher = 1,
|
||||
/obj/item/pipe = 3,
|
||||
/obj/item/stack/cable_coil = 30)
|
||||
category = CAT_MISC
|
||||
tools = list(TOOL_WRENCH, TOOL_WELDER, TOOL_WIRECUTTER)
|
||||
|
||||
/datum/crafting_recipe/goldenbox
|
||||
name = "Gold Plated Toolbox"
|
||||
result = /obj/item/storage/toolbox/gold_fake
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
reqs = list(/obj/item/stack/sheet/cardboard = 1, //so we dont null items in crafting
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/sheet/mineral/gold = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bronze_driver
|
||||
name = "Bronze Plated Screwdriver"
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
result = /obj/item/screwdriver/bronze
|
||||
reqs = list(/obj/item/screwdriver = 1,
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/tile/bronze = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bronze_welder
|
||||
name = "Bronze Plated Welding Tool"
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
result = /obj/item/weldingtool/bronze
|
||||
reqs = list(/obj/item/weldingtool = 1,
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/tile/bronze = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bronze_wirecutters
|
||||
name = "Bronze Plated Wirecutters"
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
result = /obj/item/wirecutters/bronze
|
||||
reqs = list(/obj/item/wirecutters = 1,
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/tile/bronze = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bronze_crowbar
|
||||
name = "Bronze Plated Crowbar"
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
result = /obj/item/crowbar/bronze
|
||||
reqs = list(/obj/item/crowbar = 1,
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/tile/bronze = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bronze_wrench
|
||||
name = "Bronze Plated Wrench"
|
||||
tools = list(/obj/item/stock_parts/cell/upgraded/plus)
|
||||
result = /obj/item/wrench/bronze
|
||||
reqs = list(/obj/item/wrench = 1,
|
||||
/obj/item/stack/cable_coil = 10,
|
||||
/obj/item/stack/tile/bronze = 1,
|
||||
/datum/reagent/water = 15)
|
||||
time = 40
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/rcl
|
||||
name = "Makeshift Rapid Cable Layer"
|
||||
result = /obj/item/twohanded/rcl/ghetto
|
||||
time = 40
|
||||
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WRENCH)
|
||||
reqs = list(/obj/item/stack/sheet/metal = 15)
|
||||
category = CAT_MISC
|
||||
|
||||
////////////
|
||||
//Vehicles//
|
||||
////////////
|
||||
|
||||
/datum/crafting_recipe/wheelchair
|
||||
name = "Wheelchair"
|
||||
result = /obj/vehicle/ridden/wheelchair
|
||||
reqs = list(/obj/item/stack/sheet/plasteel = 2,
|
||||
/obj/item/stack/rods = 8)
|
||||
time = 100
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/skateboard
|
||||
name = "Skateboard"
|
||||
result = /obj/vehicle/ridden/scooter/skateboard
|
||||
time = 60
|
||||
reqs = list(/obj/item/stack/sheet/metal = 5,
|
||||
/obj/item/stack/rods = 10)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/scooter
|
||||
name = "Scooter"
|
||||
result = /obj/vehicle/ridden/scooter
|
||||
time = 65
|
||||
reqs = list(/obj/item/stack/sheet/metal = 5,
|
||||
/obj/item/stack/rods = 12)
|
||||
category = CAT_MISC
|
||||
|
||||
/////////
|
||||
//Toys///
|
||||
/////////
|
||||
|
||||
/datum/crafting_recipe/toysword
|
||||
name = "Toy Sword"
|
||||
reqs = list(/obj/item/light/bulb = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
|
||||
result = /obj/item/toy/sword
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/extendohand
|
||||
name = "Extendo-Hand"
|
||||
reqs = list(/obj/item/bodypart/r_arm/robot = 1, /obj/item/clothing/gloves/boxing = 1)
|
||||
result = /obj/item/extendohand
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/toyneb
|
||||
name = "Non-Euplastic Blade"
|
||||
reqs = list(/obj/item/light/tube = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
|
||||
result = /obj/item/toy/sword/cx
|
||||
category = CAT_MISC
|
||||
|
||||
////////////
|
||||
//Unsorted//
|
||||
////////////
|
||||
|
||||
/datum/crafting_recipe/blackcarpet
|
||||
name = "Black Carpet"
|
||||
reqs = list(/obj/item/stack/tile/carpet = 50, /obj/item/toy/crayon/black = 1)
|
||||
result = /obj/item/stack/tile/carpet/black/fifty
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/paperframes
|
||||
name = "Paper Frames"
|
||||
result = /obj/item/stack/sheet/paperframes/five
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/sheet/mineral/wood = 5, /obj/item/paper = 20)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/naturalpaper
|
||||
name = "Hand-Pressed Paper"
|
||||
time = 30
|
||||
reqs = list(/datum/reagent/water = 50, /obj/item/stack/sheet/mineral/wood = 1)
|
||||
tools = list(/obj/item/hatchet)
|
||||
result = /obj/item/paper_bin/bundlenatural
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bluespacehonker
|
||||
name = "Bluespace Bike horn"
|
||||
result = /obj/item/bikehorn/bluespacehonker
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/ore/bluespace_crystal = 1,
|
||||
/obj/item/toy/crayon/blue = 1,
|
||||
/obj/item/bikehorn = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/mousetrap
|
||||
name = "Mouse Trap"
|
||||
result = /obj/item/assembly/mousetrap
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/sheet/cardboard = 1,
|
||||
/obj/item/stack/rods = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/papersack
|
||||
name = "Paper Sack"
|
||||
result = /obj/item/storage/box/papersack
|
||||
time = 10
|
||||
reqs = list(/obj/item/paper = 5)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/flashlight_eyes
|
||||
name = "Flashlight Eyes"
|
||||
result = /obj/item/organ/eyes/robotic/flashlight
|
||||
time = 10
|
||||
reqs = list(
|
||||
/obj/item/flashlight = 2,
|
||||
/obj/item/restraints/handcuffs/cable = 1
|
||||
)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/smallcarton
|
||||
name = "Small Carton"
|
||||
result = /obj/item/reagent_containers/food/drinks/sillycup/smallcarton
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/sheet/cardboard = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/pressureplate
|
||||
name = "Pressure Plate"
|
||||
result = /obj/item/pressure_plate
|
||||
time = 5
|
||||
reqs = list(/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/tile/plasteel = 1,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/assembly/igniter = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/gold_horn
|
||||
name = "Golden Bike Horn"
|
||||
result = /obj/item/bikehorn/golden
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/mineral/bananium = 5,
|
||||
/obj/item/bikehorn = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/spooky_camera
|
||||
name = "Camera Obscura"
|
||||
result = /obj/item/camera/spooky
|
||||
time = 15
|
||||
reqs = list(/obj/item/camera = 1,
|
||||
/datum/reagent/water/holywater = 10)
|
||||
parts = list(/obj/item/camera = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/paperwork
|
||||
name = "Filed Paper Work"
|
||||
result = /obj/item/folder/paperwork_correct
|
||||
time = 10 //Takes time for people to file and complete paper work!
|
||||
tools = list(/obj/item/pen)
|
||||
reqs = list(/obj/item/folder/paperwork = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
//////////////
|
||||
//Banners/////
|
||||
//////////////
|
||||
|
||||
/datum/crafting_recipe/command_banner
|
||||
name = "Command Banner"
|
||||
result = /obj/item/banner/command/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/captainparade = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/engineering_banner
|
||||
name = "Engitopia Banner"
|
||||
result = /obj/item/banner/engineering/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/rank/engineer = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/cargo_banner
|
||||
name = "Cargonia Banner"
|
||||
result = /obj/item/banner/cargo/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/rank/cargotech = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/science_banner
|
||||
name = "Sciencia Banner"
|
||||
result = /obj/item/banner/science/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/rank/scientist = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/medical_banner
|
||||
name = "Meditopia Banner"
|
||||
result = /obj/item/banner/medical/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/rank/medical = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/security_banner
|
||||
name = "Securistan Banner"
|
||||
result = /obj/item/banner/security/mundane
|
||||
time = 40
|
||||
reqs = list(/obj/item/stack/rods = 2,
|
||||
/obj/item/clothing/under/rank/security = 1)
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/bloodsucker/vassalrack
|
||||
name = "Persuasion Rack"
|
||||
//desc = "For converting crewmembers into loyal Vassals."
|
||||
result = /obj/structure/bloodsucker/vassalrack
|
||||
tools = list(/obj/item/weldingtool,
|
||||
///obj/item/screwdriver,
|
||||
/obj/item/wrench
|
||||
)
|
||||
reqs = list(/obj/item/stack/sheet/mineral/wood = 3,
|
||||
/obj/item/stack/sheet/metal = 2,
|
||||
/obj/item/restraints/handcuffs/cable = 2,
|
||||
///obj/item/storage/belt = 1
|
||||
///obj/item/stack/sheet/animalhide = 1, // /obj/item/stack/sheet/leather = 1,
|
||||
///obj/item/stack/sheet/plasteel = 5
|
||||
)
|
||||
//parts = list(/obj/item/storage/belt = 1
|
||||
// )
|
||||
|
||||
time = 150
|
||||
category = CAT_MISC
|
||||
always_availible = FALSE // Disabled til learned
|
||||
|
||||
|
||||
/datum/crafting_recipe/bloodsucker/candelabrum
|
||||
name = "Candelabrum"
|
||||
//desc = "For converting crewmembers into loyal Vassals."
|
||||
result = /obj/structure/bloodsucker/candelabrum
|
||||
tools = list(/obj/item/weldingtool,
|
||||
/obj/item/wrench
|
||||
)
|
||||
reqs = list(/obj/item/stack/sheet/metal = 3,
|
||||
/obj/item/stack/rods = 1,
|
||||
/obj/item/candle = 1
|
||||
)
|
||||
time = 100
|
||||
category = CAT_MISC
|
||||
always_availible = FALSE // Disabled til learned
|
||||
|
||||
/datum/crafting_recipe/coconut_bong
|
||||
name = "Coconut Bong"
|
||||
result = /obj/item/bong/coconut
|
||||
reqs = list(/obj/item/stack/sheet/mineral/bamboo = 2,
|
||||
/obj/item/reagent_containers/food/snacks/grown/coconut = 1)
|
||||
time = 70
|
||||
category = CAT_MISC
|
||||
@@ -1,113 +0,0 @@
|
||||
/datum/crafting_recipe/bonearmor
|
||||
name = "Bone Armor"
|
||||
result = /obj/item/clothing/suit/armor/bone
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 6)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonetalisman
|
||||
name = "Bone Talisman"
|
||||
result = /obj/item/clothing/accessory/talisman
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/bone = 2,
|
||||
/obj/item/stack/sheet/sinew = 1)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonecodpiece
|
||||
name = "Skull Codpiece"
|
||||
result = /obj/item/clothing/accessory/skullcodpiece
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/bone = 2,
|
||||
/obj/item/stack/sheet/animalhide/goliath_hide = 1)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bracers
|
||||
name = "Bone Bracers"
|
||||
result = /obj/item/clothing/gloves/bracer
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/bone = 2,
|
||||
/obj/item/stack/sheet/sinew = 1)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/skullhelm
|
||||
name = "Skull Helmet"
|
||||
result = /obj/item/clothing/head/helmet/skull
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 4)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/goliathcloak
|
||||
name = "Goliath Cloak"
|
||||
result = /obj/item/clothing/suit/hooded/cloak/goliath
|
||||
time = 50
|
||||
reqs = list(/obj/item/stack/sheet/leather = 2,
|
||||
/obj/item/stack/sheet/sinew = 2,
|
||||
/obj/item/stack/sheet/animalhide/goliath_hide = 2) //it takes 4 goliaths to make 1 cloak if the plates are skinned
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/drakecloak
|
||||
name = "Ash Drake Armour"
|
||||
result = /obj/item/clothing/suit/hooded/cloak/drake
|
||||
time = 60
|
||||
reqs = list(/obj/item/stack/sheet/bone = 10,
|
||||
/obj/item/stack/sheet/sinew = 2,
|
||||
/obj/item/stack/sheet/animalhide/ashdrake = 5)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonebag
|
||||
name = "Bone Satchel"
|
||||
result = /obj/item/storage/backpack/satchel/bone
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 3,
|
||||
/obj/item/stack/sheet/sinew = 2)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonedagger
|
||||
name = "Bone Dagger"
|
||||
result = /obj/item/kitchen/knife/combat/bone
|
||||
time = 20
|
||||
reqs = list(/obj/item/stack/sheet/bone = 2)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonespear
|
||||
name = "Bone Spear"
|
||||
result = /obj/item/twohanded/bonespear
|
||||
time = 30
|
||||
reqs = list(/obj/item/stack/sheet/bone = 4,
|
||||
/obj/item/stack/sheet/sinew = 1)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/boneaxe
|
||||
name = "Bone Axe"
|
||||
result = /obj/item/twohanded/fireaxe/boneaxe
|
||||
time = 50
|
||||
reqs = list(/obj/item/stack/sheet/bone = 6,
|
||||
/obj/item/stack/sheet/sinew = 3)
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/bonfire
|
||||
name = "Bonfire"
|
||||
time = 60
|
||||
reqs = list(/obj/item/grown/log = 5)
|
||||
result = /obj/structure/bonfire
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/headpike
|
||||
name = "Spike Head (Glass Spear)"
|
||||
time = 65
|
||||
reqs = list(/obj/item/twohanded/spear = 1,
|
||||
/obj/item/bodypart/head = 1)
|
||||
parts = list(/obj/item/bodypart/head = 1,
|
||||
/obj/item/twohanded/spear = 1)
|
||||
result = /obj/structure/headpike
|
||||
category = CAT_PRIMAL
|
||||
|
||||
/datum/crafting_recipe/headpikebone
|
||||
name = "Spike Head (Bone Spear)"
|
||||
time = 65
|
||||
reqs = list(/obj/item/twohanded/bonespear = 1,
|
||||
/obj/item/bodypart/head = 1)
|
||||
parts = list(/obj/item/bodypart/head = 1,
|
||||
/obj/item/twohanded/bonespear = 1)
|
||||
result = /obj/structure/headpike/bone
|
||||
category = CAT_PRIMAL
|
||||
@@ -1,98 +0,0 @@
|
||||
|
||||
/datum/crafting_recipe/ed209
|
||||
name = "ED209"
|
||||
result = /mob/living/simple_animal/bot/ed209
|
||||
reqs = list(/obj/item/robot_suit = 1,
|
||||
/obj/item/clothing/head/helmet = 1,
|
||||
/obj/item/clothing/suit/armor/vest = 1,
|
||||
/obj/item/bodypart/l_leg/robot = 1,
|
||||
/obj/item/bodypart/r_leg/robot = 1,
|
||||
/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/gun/energy/e_gun/advtaser = 1,
|
||||
/obj/item/stock_parts/cell = 1,
|
||||
/obj/item/assembly/prox_sensor = 1)
|
||||
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER)
|
||||
time = 60
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/secbot
|
||||
name = "Secbot"
|
||||
result = /mob/living/simple_animal/bot/secbot
|
||||
reqs = list(/obj/item/assembly/signaler = 1,
|
||||
/obj/item/clothing/head/helmet/sec = 1,
|
||||
/obj/item/melee/baton = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1)
|
||||
tools = list(TOOL_WELDER)
|
||||
time = 60
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/cleanbot
|
||||
name = "Cleanbot"
|
||||
result = /mob/living/simple_animal/bot/cleanbot
|
||||
reqs = list(/obj/item/reagent_containers/glass/bucket = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1)
|
||||
time = 40
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/floorbot
|
||||
name = "Floorbot"
|
||||
result = /mob/living/simple_animal/bot/floorbot
|
||||
reqs = list(/obj/item/storage/toolbox/mechanical = 1,
|
||||
/obj/item/stack/tile/plasteel = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1)
|
||||
time = 40
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/medbot
|
||||
name = "Medbot"
|
||||
result = /mob/living/simple_animal/bot/medbot
|
||||
reqs = list(/obj/item/healthanalyzer = 1,
|
||||
/obj/item/storage/firstaid = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1)
|
||||
time = 40
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/honkbot
|
||||
name = "Honkbot"
|
||||
result = /mob/living/simple_animal/bot/honkbot
|
||||
reqs = list(/obj/item/storage/box/clown = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/bikehorn/ = 1)
|
||||
time = 40
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/Firebot
|
||||
name = "Firebot"
|
||||
result = /mob/living/simple_animal/bot/firebot
|
||||
reqs = list(/obj/item/extinguisher = 1,
|
||||
/obj/item/bodypart/r_arm/robot = 1,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/clothing/head/hardhat/red = 1)
|
||||
time = 40
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/aitater
|
||||
name = "intelliTater"
|
||||
result = /obj/item/aicard/aitater
|
||||
time = 30
|
||||
tools = list(TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/aicard = 1,
|
||||
/obj/item/reagent_containers/food/snacks/grown/potato = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_ROBOT
|
||||
|
||||
/datum/crafting_recipe/aispook
|
||||
name = "intelliLantern"
|
||||
result = /obj/item/aicard/aispook
|
||||
time = 30
|
||||
tools = list(TOOL_WIRECUTTER)
|
||||
reqs = list(/obj/item/aicard = 1,
|
||||
/obj/item/reagent_containers/food/snacks/grown/pumpkin = 1,
|
||||
/obj/item/stack/cable_coil = 5)
|
||||
category = CAT_ROBOT
|
||||
@@ -1,357 +0,0 @@
|
||||
/datum/crafting_recipe/pin_removal
|
||||
name = "Pin Removal"
|
||||
result = /obj/item/gun
|
||||
reqs = list(/obj/item/gun = 1)
|
||||
parts = list(/obj/item/gun = 1)
|
||||
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
time = 50
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/strobeshield
|
||||
name = "Strobe Shield"
|
||||
result = /obj/item/assembly/flash/shield
|
||||
reqs = list(/obj/item/wallframe/flasher = 1,
|
||||
/obj/item/assembly/flash/handheld = 1,
|
||||
/obj/item/shield/riot = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/makeshiftshield
|
||||
name = "Makeshift Metal Shield"
|
||||
result = /obj/item/shield/makeshift
|
||||
reqs = list(/obj/item/stack/cable_coil = 30,
|
||||
/obj/item/stack/sheet/metal = 10,
|
||||
/obj/item/stack/sheet/cloth = 2,
|
||||
/obj/item/stack/sheet/leather = 3)
|
||||
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
|
||||
time = 100
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/spear
|
||||
name = "Spear"
|
||||
result = /obj/item/twohanded/spear
|
||||
reqs = list(/obj/item/restraints/handcuffs/cable = 1,
|
||||
/obj/item/shard = 1,
|
||||
/obj/item/stack/rods = 1)
|
||||
parts = list(/obj/item/shard = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/stunprod
|
||||
name = "Stunprod"
|
||||
result = /obj/item/melee/baton/cattleprod
|
||||
reqs = list(/obj/item/restraints/handcuffs/cable = 1,
|
||||
/obj/item/stack/rods = 1,
|
||||
/obj/item/assembly/igniter = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/teleprod
|
||||
name = "Teleprod"
|
||||
result = /obj/item/melee/baton/cattleprod/teleprod
|
||||
reqs = list(/obj/item/restraints/handcuffs/cable = 1,
|
||||
/obj/item/stack/rods = 1,
|
||||
/obj/item/assembly/igniter = 1,
|
||||
/obj/item/stack/ore/bluespace_crystal = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/bola
|
||||
name = "Bola"
|
||||
result = /obj/item/restraints/legcuffs/bola
|
||||
reqs = list(/obj/item/restraints/handcuffs/cable = 1,
|
||||
/obj/item/stack/sheet/metal = 6)
|
||||
time = 20//15 faster than crafting them by hand!
|
||||
category= CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/tailclub
|
||||
name = "Tail Club"
|
||||
result = /obj/item/tailclub
|
||||
reqs = list(/obj/item/organ/tail/lizard = 1,
|
||||
/obj/item/stack/sheet/metal = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/tailwhip
|
||||
name = "Liz O' Nine Tails"
|
||||
result = /obj/item/melee/chainofcommand/tailwhip
|
||||
reqs = list(/obj/item/organ/tail/lizard = 1,
|
||||
/obj/item/stack/cable_coil = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/catwhip
|
||||
name = "Cat O' Nine Tails"
|
||||
result = /obj/item/melee/chainofcommand/tailwhip/kitty
|
||||
reqs = list(/obj/item/organ/tail/cat = 1,
|
||||
/obj/item/stack/cable_coil = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/chainsaw
|
||||
name = "Chainsaw"
|
||||
result = /obj/item/twohanded/required/chainsaw
|
||||
reqs = list(/obj/item/circular_saw = 1,
|
||||
/obj/item/stack/cable_coil = 3,
|
||||
/obj/item/stack/sheet/plasteel = 5)
|
||||
tools = list(TOOL_WELDER)
|
||||
time = 50
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/switchblade_ms
|
||||
name = "Switchblade"
|
||||
result = /obj/item/switchblade/crafted
|
||||
reqs = list(/obj/item/weaponcrafting/stock = 1,
|
||||
/obj/item/weaponcrafting/receiver = 1,
|
||||
/obj/item/kitchen/knife = 1,
|
||||
/obj/item/stack/cable_coil = 2)
|
||||
tools = list(TOOL_WELDER)
|
||||
time = 45
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
//////////////////
|
||||
///BOMB CRAFTING//
|
||||
//////////////////
|
||||
|
||||
/datum/crafting_recipe/chemical_payload
|
||||
name = "Chemical Payload (C4)"
|
||||
result = /obj/item/bombcore/chemical
|
||||
reqs = list(
|
||||
/obj/item/stock_parts/matter_bin = 1,
|
||||
/obj/item/grenade/plastic/c4 = 1,
|
||||
/obj/item/grenade/chem_grenade = 2
|
||||
)
|
||||
parts = list(/obj/item/stock_parts/matter_bin = 1, /obj/item/grenade/chem_grenade = 2)
|
||||
time = 30
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/chemical_payload2
|
||||
name = "Chemical Payload (Gibtonite)"
|
||||
result = /obj/item/bombcore/chemical
|
||||
reqs = list(
|
||||
/obj/item/stock_parts/matter_bin = 1,
|
||||
/obj/item/twohanded/required/gibtonite = 1,
|
||||
/obj/item/grenade/chem_grenade = 2
|
||||
)
|
||||
parts = list(/obj/item/stock_parts/matter_bin = 1, /obj/item/grenade/chem_grenade = 2)
|
||||
time = 50
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/molotov
|
||||
name = "Molotov"
|
||||
result = /obj/item/reagent_containers/food/drinks/bottle/molotov
|
||||
reqs = list(/obj/item/reagent_containers/rag = 1,
|
||||
/obj/item/reagent_containers/food/drinks/bottle = 1)
|
||||
parts = list(/obj/item/reagent_containers/food/drinks/bottle = 1)
|
||||
time = 40
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/IED
|
||||
name = "IED"
|
||||
result = /obj/item/grenade/iedcasing
|
||||
reqs = list(/datum/reagent/fuel = 50,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/assembly/igniter = 1,
|
||||
/obj/item/reagent_containers/food/drinks/soda_cans = 1)
|
||||
parts = list(/obj/item/reagent_containers/food/drinks/soda_cans = 1)
|
||||
time = 15
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/lance
|
||||
name = "Explosive Lance (Grenade)"
|
||||
result = /obj/item/twohanded/spear
|
||||
reqs = list(/obj/item/twohanded/spear = 1,
|
||||
/obj/item/grenade = 1)
|
||||
parts = list(/obj/item/twohanded/spear = 1,
|
||||
/obj/item/grenade = 1)
|
||||
time = 15
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
//////////////////
|
||||
///GUNS CRAFTING//
|
||||
//////////////////
|
||||
|
||||
|
||||
/datum/crafting_recipe/smartdartgun
|
||||
name = "Smart dartgun"
|
||||
result = /obj/item/gun/syringe/dart
|
||||
reqs = list(/obj/item/stack/sheet/metal = 10,
|
||||
/obj/item/stack/sheet/glass = 5,
|
||||
/obj/item/tank/internals = 1,
|
||||
/obj/item/reagent_containers/glass/beaker = 1,
|
||||
/obj/item/stack/sheet/plastic = 5,
|
||||
/obj/item/stack/cable_coil = 1)
|
||||
time = 150 //It's a gun
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/rapiddartgun
|
||||
name = "Rapid Smart dartgun"
|
||||
result = /obj/item/gun/syringe/dart/rapiddart
|
||||
reqs = list(
|
||||
/obj/item/gun/syringe/dart = 1,
|
||||
/obj/item/stack/sheet/plastic = 5,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/reagent_containers/glass/beaker = 1
|
||||
)
|
||||
parts = list(/obj/item/reagent_containers/glass/beaker = 1)
|
||||
time = 120 //Modifying your gun
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/improvised_pneumatic_cannon
|
||||
name = "Pneumatic Cannon"
|
||||
result = /obj/item/pneumatic_cannon/ghetto
|
||||
tools = list(TOOL_WELDER, TOOL_WRENCH)
|
||||
reqs = list(/obj/item/stack/sheet/metal = 4,
|
||||
/obj/item/stack/packageWrap = 8,
|
||||
/obj/item/pipe = 2)
|
||||
time = 300
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/flamethrower //Gun*
|
||||
name = "Flamethrower"
|
||||
result = /obj/item/flamethrower
|
||||
reqs = list(/obj/item/weldingtool = 1,
|
||||
/obj/item/assembly/igniter = 1,
|
||||
/obj/item/stack/rods = 1)
|
||||
parts = list(/obj/item/assembly/igniter = 1,
|
||||
/obj/item/weldingtool = 1)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 10
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/ishotgun
|
||||
name = "Improvised Shotgun"
|
||||
result = /obj/item/gun/ballistic/revolver/doublebarrel/improvised
|
||||
reqs = list(/obj/item/weaponcrafting/receiver = 1,
|
||||
/obj/item/pipe = 1,
|
||||
/obj/item/weaponcrafting/stock = 1,
|
||||
/obj/item/stack/packageWrap = 5)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 100
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
/datum/crafting_recipe/irifle
|
||||
name = "Improvised Rifle(7.62mm)"
|
||||
result = /obj/item/gun/ballistic/shotgun/boltaction/improvised
|
||||
reqs = list(/obj/item/weaponcrafting/receiver = 1,
|
||||
/obj/item/pipe = 2,
|
||||
/obj/item/weaponcrafting/stock = 1,
|
||||
/obj/item/stack/packageWrap = 5)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 100
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_WEAPON
|
||||
|
||||
//////////////////
|
||||
///AMMO CRAFTING//
|
||||
//////////////////
|
||||
|
||||
/datum/crafting_recipe/smartdart
|
||||
name = "Medical smartdart"
|
||||
result = /obj/item/reagent_containers/syringe/dart
|
||||
reqs = list(/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/sheet/glass = 1,
|
||||
/obj/item/stack/sheet/plastic = 1)
|
||||
time = 10
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/meteorslug
|
||||
name = "Meteorslug Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/meteorslug
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/obj/item/rcd_ammo = 1,
|
||||
/obj/item/stock_parts/manipulator = 2)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/pulseslug
|
||||
name = "Pulse Slug Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/pulseslug
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/obj/item/stock_parts/capacitor/adv = 2,
|
||||
/obj/item/stock_parts/micro_laser/ultra = 1)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/dragonsbreath
|
||||
name = "Dragonsbreath Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/dragonsbreath
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/datum/reagent/phosphorus = 5)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/frag12
|
||||
name = "FRAG-12 Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/frag12
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/datum/reagent/glycerol = 5,
|
||||
/datum/reagent/toxin/acid = 5,
|
||||
/datum/reagent/toxin/acid/fluacid = 5)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/ionslug
|
||||
name = "Ion Scatter Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/ion
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/obj/item/stock_parts/micro_laser/ultra = 1,
|
||||
/obj/item/stock_parts/subspace/crystal = 1)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/improvisedslug
|
||||
name = "Improvised Shotgun Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/improvised
|
||||
reqs = list(/obj/item/grenade/chem_grenade = 1,
|
||||
/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/datum/reagent/fuel = 10)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
|
||||
/datum/crafting_recipe/laserslug
|
||||
name = "Scatter Laser Shell"
|
||||
result = /obj/item/ammo_casing/shotgun/laserslug
|
||||
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
|
||||
/obj/item/stock_parts/capacitor/adv = 1,
|
||||
/obj/item/stock_parts/micro_laser/high = 1)
|
||||
tools = list(TOOL_SCREWDRIVER)
|
||||
time = 5
|
||||
category = CAT_WEAPONRY
|
||||
subcategory = CAT_AMMO
|
||||
@@ -12,14 +12,14 @@
|
||||
parsed += copytext(text, pos, search)
|
||||
if(search)
|
||||
pos = search
|
||||
search = findtext(text, ":", pos+1)
|
||||
search = findtext(text, ":", pos + length(text[pos]))
|
||||
if(search)
|
||||
emoji = lowertext(copytext(text, pos+1, search))
|
||||
emoji = lowertext(copytext(text, pos + length(text[pos]), search))
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/goonchat)
|
||||
var/tag = sheet.icon_tag("emoji-[emoji]")
|
||||
if(tag)
|
||||
parsed += tag
|
||||
pos = search + 1
|
||||
pos = search + length(text[pos])
|
||||
else
|
||||
parsed += copytext(text, pos, search)
|
||||
pos = search
|
||||
@@ -42,12 +42,12 @@
|
||||
search = findtext(text, ":", pos)
|
||||
if(search)
|
||||
pos = search
|
||||
search = findtext(text, ":", pos+1)
|
||||
search = findtext(text, ":", pos + length(text[pos]))
|
||||
if(search)
|
||||
var/word = lowertext(copytext(text, pos+1, search))
|
||||
var/word = lowertext(copytext(text, pos + length(text[pos]), search))
|
||||
if(word in emojis)
|
||||
final += lowertext(copytext(text, pos, search+1))
|
||||
pos = search + 1
|
||||
final += lowertext(copytext(text, pos, search + length(text[search])))
|
||||
pos = search + length(text[search])
|
||||
continue
|
||||
break
|
||||
return final
|
||||
|
||||
@@ -12,7 +12,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
|
||||
return ..()
|
||||
|
||||
//this is snowflake because of a byond bug (ID:2306577), do not attempt to call non-builtin procs in this if
|
||||
if(copytext(E.name,1,32) == "Maximum recursion level reached")
|
||||
if(copytext(E.name, 1, 32) == "Maximum recursion level reached")//32 == length() of that string + 1
|
||||
//log to world while intentionally triggering the byond bug.
|
||||
log_world("runtime error: [E.name]\n[E.desc]")
|
||||
//if we got to here without silently ending, the byond bug has been fixed.
|
||||
@@ -102,7 +102,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
|
||||
usrinfo = null
|
||||
continue // Our usr info is better, replace it
|
||||
|
||||
if(copytext(line, 1, 3) != " ")
|
||||
if(copytext(line, 1, 3) != " ")//3 == length(" ") + 1
|
||||
desclines += (" " + line) // Pad any unpadded lines, so they look pretty
|
||||
else
|
||||
desclines += line
|
||||
|
||||
@@ -61,8 +61,8 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("tmp/iconCache.sav")) //Cache of ico
|
||||
// Arguments are in the form "param[paramname]=thing"
|
||||
var/list/params = list()
|
||||
for(var/key in href_list)
|
||||
if(length(key) > 7 && findtext(key, "param")) // 7 is the amount of characters in the basic param key template.
|
||||
var/param_name = copytext(key, 7, -1)
|
||||
if(length_char(key) > 7 && findtext(key, "param")) // 7 is the amount of characters in the basic param key template.
|
||||
var/param_name = copytext_char(key, 7, -1)
|
||||
var/item = href_list[key]
|
||||
|
||||
params[param_name] = item
|
||||
|
||||
@@ -228,7 +228,7 @@ function highlightTerms(el) {
|
||||
console.log(newWord)
|
||||
}
|
||||
newText += newWord || words[w].replace("<", "<");
|
||||
newText += w >= words.length ? '' : ' ';
|
||||
newText += w >= words.length - 1 ? '' : ' ';
|
||||
}
|
||||
} else { //Every other type of element
|
||||
newText += outerHTML(el.childNodes[c]);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// Returns special prefixes for the station name on certain days. You wind up with names like "Christmas Object Epsilon". See new_station_name()
|
||||
/datum/holiday/proc/getStationPrefix()
|
||||
//get the first word of the Holiday and use that
|
||||
var/i = findtext(name," ",1,0)
|
||||
return copytext(name,1,i)
|
||||
var/i = findtext(name," ")
|
||||
return copytext(name, 1, i)
|
||||
|
||||
// Return 1 if this holidy should be celebrated today
|
||||
/datum/holiday/proc/shouldCelebrate(dd, mm, yy, ww, ddd)
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
/obj/machinery/plantgenes/proc/repaint_seed()
|
||||
if(!seed)
|
||||
return
|
||||
if(copytext(seed.name, 1, 13) == "experimental")
|
||||
if(copytext(seed.name, 1, 13) == "experimental")//13 == length("experimental") + 1
|
||||
return // Already modded name and icon
|
||||
seed.name = "experimental " + seed.name
|
||||
seed.icon_state = "seed-x"
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
new_data = uppertext(new_data)
|
||||
if(length(new_data) != 7) // We can hex if we want to, we can leave your strings behind
|
||||
return // Cause your strings don't hex and if they don't hex
|
||||
var/friends = copytext(new_data, 2, 8) // Well they're are no strings of mine
|
||||
var/friends = copytext_char(new_data, 2, 8) // Well they're are no strings of mine
|
||||
// I say, we can go where we want to, a place where they will never find
|
||||
var/safety_dance = 1
|
||||
while(safety_dance >= 7) // And we can act like we come from out of this world.log
|
||||
var/hex = copytext(friends, safety_dance, safety_dance+1)
|
||||
var/hex = copytext_char(friends, safety_dance, safety_dance+1)
|
||||
if(!(hex in list("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")))
|
||||
return // Leave the fake one far behind,
|
||||
safety_dance++
|
||||
|
||||
@@ -224,8 +224,8 @@
|
||||
|
||||
var/split = min(index+1, length(text))
|
||||
|
||||
var/before_text = copytext(text, 1, split)
|
||||
var/after_text = copytext(text, split, 0)
|
||||
var/before_text = copytext_char(text, 1, split)
|
||||
var/after_text = copytext_char(text, split)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, before_text)
|
||||
set_pin_data(IC_OUTPUT, 2, after_text)
|
||||
@@ -331,7 +331,7 @@
|
||||
var/strin = get_pin_data(IC_INPUT, 1)
|
||||
var/delimiter = get_pin_data(IC_INPUT, 2)
|
||||
if(delimiter == null)
|
||||
set_pin_data(IC_OUTPUT, 1, string2charlist(strin))
|
||||
set_pin_data(IC_OUTPUT, 1, text2charlist(strin))
|
||||
else
|
||||
set_pin_data(IC_OUTPUT, 1, splittext(strin, delimiter))
|
||||
push_data()
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
|
||||
. = ""
|
||||
var/list/words = list()
|
||||
while(length(.) < length(input))
|
||||
while(length_char(.) < length_char(input))
|
||||
words += generate_code_phrase(return_list=TRUE)
|
||||
. = jointext(words, ", ")
|
||||
|
||||
. = capitalize(.)
|
||||
|
||||
var/input_ending = copytext(input, length(input))
|
||||
var/input_ending = copytext_char(input, -1)
|
||||
|
||||
var/static/list/endings
|
||||
if(!endings)
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
if(lookup)
|
||||
return lookup
|
||||
|
||||
var/input_size = length(input)
|
||||
var/input_size = length_char(input)
|
||||
var/scrambled_text = ""
|
||||
var/capitalize = TRUE
|
||||
|
||||
while(length(scrambled_text) < input_size)
|
||||
while(length_char(scrambled_text) < input_size)
|
||||
var/next = pick(syllables)
|
||||
if(capitalize)
|
||||
next = capitalize(next)
|
||||
@@ -98,10 +98,10 @@
|
||||
scrambled_text += " "
|
||||
|
||||
scrambled_text = trim(scrambled_text)
|
||||
var/ending = copytext(scrambled_text, length(scrambled_text))
|
||||
var/ending = copytext_char(scrambled_text, -1)
|
||||
if(ending == ".")
|
||||
scrambled_text = copytext(scrambled_text,1,length(scrambled_text)-1)
|
||||
var/input_ending = copytext(input, input_size)
|
||||
scrambled_text = copytext_char(scrambled_text, 1, -2)
|
||||
var/input_ending = copytext_char(input, -1)
|
||||
if(input_ending in list("!","?","."))
|
||||
scrambled_text += input_ending
|
||||
|
||||
|
||||
@@ -387,9 +387,9 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
if(checkoutperiod < 1)
|
||||
checkoutperiod = 1
|
||||
if(href_list["editbook"])
|
||||
buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
|
||||
buffer_book = stripped_input(usr, "Enter the book's title:")
|
||||
if(href_list["editmob"])
|
||||
buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
|
||||
buffer_mob = stripped_input(usr, "Enter the recipient's name:", max_length = MAX_NAME_LEN)
|
||||
if(href_list["checkout"])
|
||||
var/datum/borrowbook/b = new /datum/borrowbook
|
||||
b.bookname = sanitize(buffer_book)
|
||||
@@ -406,7 +406,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
||||
if(b && istype(b))
|
||||
inventory.Remove(b)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
|
||||
var/newauthor = stripped_input(usr, "Enter the author's name: ")
|
||||
if(newauthor)
|
||||
scanner.cache.author = newauthor
|
||||
if(href_list["setcategory"])
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
/obj/structure/chisel_message/update_icon()
|
||||
..()
|
||||
var/hash = md5(hidden_message)
|
||||
var/newcolor = copytext(hash, 1, 7)
|
||||
var/newcolor = copytext_char(hash, 1, 7)
|
||||
add_atom_colour("#[newcolor]", FIXED_COLOUR_PRIORITY)
|
||||
light_color = "#[newcolor]"
|
||||
set_light(1)
|
||||
|
||||
@@ -241,7 +241,8 @@
|
||||
var/variables_start = findtext(full_def, "{")
|
||||
var/path_text = trim_text(copytext(full_def, 1, variables_start))
|
||||
var/atom_def = text2path(path_text) //path definition, e.g /obj/foo/bar
|
||||
old_position = dpos + 1
|
||||
if(dpos)
|
||||
old_position = dpos + length(model[dpos])
|
||||
|
||||
if(!ispath(atom_def, /atom)) // Skip the item if the path does not exist. Fix your crap, mappers!
|
||||
if(bad_paths)
|
||||
@@ -253,7 +254,7 @@
|
||||
var/list/fields = list()
|
||||
|
||||
if(variables_start)//if there's any variable
|
||||
full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
|
||||
full_def = copytext(full_def, variables_start + length(full_def[variables_start]), -length(copytext_char(full_def, -1))) //removing the last '}'
|
||||
fields = readlist(full_def, ";")
|
||||
if(fields.len)
|
||||
if(!trim(fields[fields.len]))
|
||||
@@ -423,12 +424,13 @@
|
||||
|
||||
var/trim_left = trim_text(copytext(text,old_position,(equal_position ? equal_position : position)))
|
||||
var/left_constant = delimiter == ";" ? trim_left : parse_constant(trim_left)
|
||||
old_position = position + 1
|
||||
if(position)
|
||||
old_position = position + length(text[position])
|
||||
|
||||
if(equal_position && !isnum(left_constant))
|
||||
// Associative var, so do the association.
|
||||
// Note that numbers cannot be keys - the RHS is dropped if so.
|
||||
var/trim_right = trim_text(copytext(text,equal_position+1,position))
|
||||
var/trim_right = trim_text(copytext(text, equal_position + length(text[equal_position]), position))
|
||||
var/right_constant = parse_constant(trim_right)
|
||||
.[left_constant] = right_constant
|
||||
|
||||
@@ -442,12 +444,12 @@
|
||||
return num
|
||||
|
||||
// string
|
||||
if(findtext(text,"\"",1,2))
|
||||
return copytext(text,2,findtext(text,"\"",3,0))
|
||||
if(text[1] == "\"")
|
||||
return copytext(text, length(text[1]) + 1, findtext(text, "\"", length(text[1]) + 1))
|
||||
|
||||
// list
|
||||
if(copytext(text,1,6) == "list(")
|
||||
return readlist(copytext(text,6,length(text)))
|
||||
if(copytext(text, 1, 6) == "list(")//6 == length("list(") + 1
|
||||
return readlist(copytext(text, 6, -1))
|
||||
|
||||
// typepath
|
||||
var/path = text2path(text)
|
||||
@@ -455,8 +457,8 @@
|
||||
return path
|
||||
|
||||
// file
|
||||
if(copytext(text,1,2) == "'")
|
||||
return file(copytext(text,2,length(text)))
|
||||
if(text[1] == "'")
|
||||
return file(copytext_char(text, 2, -1))
|
||||
|
||||
// null
|
||||
if(text == "null")
|
||||
|
||||
@@ -60,8 +60,9 @@
|
||||
// build_cache will check bad paths for us
|
||||
var/list/modelCache = build_cache(TRUE, report.bad_paths)
|
||||
|
||||
var/static/regex/area_or_turf = regex(@"/(turf|area)/")
|
||||
for(var/path in report.bad_paths)
|
||||
if(copytext(path, 1, 7) == "/turf/" || copytext(path, 1, 7) == "/area/")
|
||||
if(area_or_turf.Find("[path]", 1, 1))
|
||||
report.loadable = FALSE
|
||||
|
||||
// check for tiles with the wrong number of turfs or areas
|
||||
|
||||
@@ -157,20 +157,23 @@
|
||||
var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text
|
||||
if(user.canUseTopic(src, BE_CLOSE))
|
||||
var/list/sanitised = list()
|
||||
var/sanitycheck = 1
|
||||
for(var/i=1,i<=length(input),i++) //put the guess into a list
|
||||
sanitised += text2num(copytext(input,i,i+1))
|
||||
for(var/i=1,i<=(length(input)-1),i++) //compare each digit in the guess to all those following it
|
||||
for(var/j=(i+1),j<=length(input),j++)
|
||||
var/sanitycheck = TRUE
|
||||
var/char = ""
|
||||
var/length_input = length(input)
|
||||
for(var/i = 1, i <= length_input, i += length(char)) //put the guess into a list
|
||||
char = input[i]
|
||||
sanitised += text2num(char)
|
||||
for(var/i = 1, i <= length(sanitised) - 1, i++) //compare each digit in the guess to all those following it
|
||||
for(var/j = i + 1, j <= length(sanitised), j++)
|
||||
if(sanitised[i] == sanitised[j])
|
||||
sanitycheck = null //if a digit is repeated, reject the input
|
||||
if (input == code)
|
||||
sanitycheck = FALSE //if a digit is repeated, reject the input
|
||||
if(input == code)
|
||||
to_chat(user, "<span class='notice'>The crate unlocks!</span>")
|
||||
locked = FALSE
|
||||
cut_overlays()
|
||||
add_overlay("securecrateg")
|
||||
tamperproof = 0 // set explosion chance to zero, so we dont accidently hit it with a multitool and instantly die
|
||||
else if (input == null || sanitycheck == null || length(input) != codelen)
|
||||
else if(!input || !sanitycheck || length(sanitised) != codelen)
|
||||
to_chat(user, "<span class='notice'>You leave the crate alone.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>A red light flashes.</span>")
|
||||
@@ -196,20 +199,27 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>* Anti-Tamper Bomb will activate after [attempts] failed access attempts.</span>")
|
||||
if(lastattempt != null)
|
||||
var/list/guess = list()
|
||||
var/list/answer = list()
|
||||
var/bulls = 0
|
||||
var/cows = 0
|
||||
for(var/i=1,i<=length(lastattempt),i++)
|
||||
guess += text2num(copytext(lastattempt,i,i+1))
|
||||
for(var/i=1,i<=length(lastattempt),i++)
|
||||
answer += text2num(copytext(code,i,i+1))
|
||||
for(var/i = 1, i < codelen + 1, i++) // Go through list and count matches
|
||||
if( answer.Find(guess[i],1,codelen+1))
|
||||
++cows
|
||||
if( answer[i] == guess[i])
|
||||
var/bulls = 0 //right position, right number
|
||||
var/cows = 0 //wrong position but in the puzzle
|
||||
|
||||
var/lastattempt_char = ""
|
||||
var/length_lastattempt = length(lastattempt)
|
||||
var/lastattempt_it = 1
|
||||
|
||||
var/code_char = ""
|
||||
var/length_code = length(code)
|
||||
var/code_it = 1
|
||||
|
||||
while(lastattempt_it <= length_lastattempt && code_it <= length_code) // Go through list and count matches
|
||||
lastattempt_char = lastattempt[lastattempt_it]
|
||||
code_char = code[code_it]
|
||||
if(lastattempt_char == code_char)
|
||||
++bulls
|
||||
--cows
|
||||
else if(findtext(code, lastattempt_char))
|
||||
++cows
|
||||
|
||||
lastattempt_it += length(lastattempt_char)
|
||||
code_it += length(code_char)
|
||||
|
||||
to_chat(user, "<span class='notice'>Last code attempt, [lastattempt], had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>")
|
||||
return
|
||||
|
||||
@@ -230,5 +230,5 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
|
||||
var/val = round(materials[key]) / MINERAL_MATERIAL_AMOUNT
|
||||
msg += sep
|
||||
sep = ", "
|
||||
msg += "[amount < 0 ? "-" : "+"][val] [copytext(key, 2)]"
|
||||
msg += "[amount < 0 ? "-" : "+"][val] [copytext(key, length(key[1]) + 1)]"
|
||||
formatted = msg.Join()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
|
||||
/obj/machinery/power/apc/Initialize(mapload, ndir, building = FALSE)
|
||||
. = ..()
|
||||
tdir = ndir || dir
|
||||
var/area/A = get_base_area(src)
|
||||
if(!building)
|
||||
has_electronics = APC_ELECTRONICS_SECURED
|
||||
@@ -189,9 +190,6 @@
|
||||
wires = new /datum/wires/apc(src)
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
setDir(ndir)
|
||||
src.tdir = dir // to fix Vars bug
|
||||
setDir(SOUTH)
|
||||
|
||||
switch(tdir)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,7 +79,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
||||
return main_part.attackby(I, user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/get_status()
|
||||
return main_part.get_status()
|
||||
return main_part?.get_status()
|
||||
|
||||
/obj/machinery/gravity_generator/part/attack_hand(mob/user)
|
||||
return main_part.attack_hand(user)
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
|
||||
#define SUPERMATTER_COUNTDOWN_TIME 30 SECONDS
|
||||
|
||||
#define SUPERMATTER_INTEGRITY_MULT 1.3 //(loss of integrity / 10) ^ 1.3
|
||||
|
||||
GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal
|
||||
@@ -158,6 +160,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
var/datum/looping_sound/supermatter/soundloop
|
||||
|
||||
var/moveable = FALSE
|
||||
var/min_damage = 0
|
||||
var/power_calc = 0
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/Initialize()
|
||||
. = ..()
|
||||
@@ -359,6 +363,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
//capping damage
|
||||
damage = min(damage_archived + (DAMAGE_HARDCAP * explosion_point),damage)
|
||||
damage = max(min_damage, damage) //max integrity
|
||||
if(damage > damage_archived && prob(10))
|
||||
playsound(get_turf(src), 'sound/effects/empulse.ogg', 50, 1)
|
||||
|
||||
@@ -398,7 +403,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
if(matter_power)
|
||||
var/removed_matter = max(matter_power/MATTER_POWER_CONVERSION, 40)
|
||||
power = max(power + removed_matter, 0)
|
||||
power_calc = max(power_calc + removed_matter, 0)
|
||||
matter_power = max(matter_power - removed_matter, 0)
|
||||
|
||||
var/temp_factor = 50
|
||||
@@ -411,7 +416,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
temp_factor = 30
|
||||
icon_state = base_icon_state
|
||||
|
||||
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0) //Total laser power plus an overload
|
||||
power_calc = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power_calc, 0) //Total laser power plus an overload
|
||||
|
||||
if(prob(50))
|
||||
radiation_pulse(src, power * (1 + (tritiumcomp * TRITIUM_RADIOACTIVITY_MODIFIER) + ((pluoxiumcomp * PLUOXIUM_RADIOACTIVITY_MODIFIER) * pluoxiumbonus) * (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER))))) // Rad Modifiers BZ(500%), Tritium(300%), and Pluoxium(-200%)
|
||||
@@ -443,15 +448,19 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them.
|
||||
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
var/D = sqrt(1 / max(1, get_dist(l, src)))
|
||||
l.hallucination += power * config_hallucination_power * D
|
||||
l.hallucination += power_calc * config_hallucination_power * D
|
||||
l.hallucination = CLAMP(0, 200, l.hallucination)
|
||||
|
||||
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
|
||||
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
|
||||
l.rad_act(rads)
|
||||
|
||||
power -= ((power/500)**3) * powerloss_inhibitor
|
||||
|
||||
power_calc -= ((power_calc/500)**3) * powerloss_inhibitor
|
||||
if ((100-get_integrity()) < 75)
|
||||
power = (power_calc * ((100 - (0.15*(100-get_integrity()) - 5)**2) / 100)) + power_calc*0.1
|
||||
else
|
||||
power = power_calc * (((100-get_integrity())^((3*(100-get_integrity()))/1000) + 2*(100-get_integrity()))/100) //new and improved, more linear
|
||||
//power = power_calc * ((((100-get_integrity())**1.3)-(2*(100-get_integrity())))/100)
|
||||
if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
@@ -474,8 +483,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
supermatter_anomaly_gen(src, GRAVITATIONAL_ANOMALY, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD)
|
||||
supermatter_anomaly_gen(src, PYRO_ANOMALY, rand(5, 10))
|
||||
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if (damage - damage_archived > 0)
|
||||
min_damage += ((damage - damage_archived) / 9) * SUPERMATTER_INTEGRITY_MULT
|
||||
if(damage > (min_damage < 200 ? min_damage : 0) + warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((REALTIMEOFDAY - lastwarning) / 10 >= WARNING_DELAY)
|
||||
alarm()
|
||||
|
||||
@@ -514,7 +524,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(!istype(Proj.firer, /obj/machinery/power/emitter))
|
||||
investigate_log("has been hit by [Proj] fired by [key_name(Proj.firer)]", INVESTIGATE_SUPERMATTER)
|
||||
if(Proj.flag != "bullet")
|
||||
power += Proj.damage * config_bullet_energy
|
||||
power_calc += Proj.damage * config_bullet_energy
|
||||
if(!has_been_powered)
|
||||
investigate_log("has been powered for the first time.", INVESTIGATE_SUPERMATTER)
|
||||
message_admins("[src] has been powered for the first time [ADMIN_JMP(src)].")
|
||||
@@ -615,6 +625,17 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
to_chat(user, "<span class='notice'>You extract a sliver from \the [src]. \The [src] begins to react violently!</span>")
|
||||
new /obj/item/nuke_core/supermatter_sliver(drop_location())
|
||||
matter_power += 200
|
||||
if (istype(W, /obj/item/supermatterspray))
|
||||
var/obj/item/supermatterspray/S = W
|
||||
if (S.usesleft > 0 && do_after(user, 60, target=src))
|
||||
min_damage = max(0,min_damage - 10)
|
||||
to_chat(user, "<span class='notice'>You spray \the [src] with [S].</span>")
|
||||
playsound(user.loc,'sound/effects/spray2.ogg',50,1,-6)
|
||||
S.usesleft--
|
||||
if (prob(10))
|
||||
to_chat(user, "<span class='warning'>Your hands slip and you drop [S] into \the [src]!</span>")
|
||||
Consume(S)
|
||||
return
|
||||
else if(user.dropItemToGround(W))
|
||||
user.visible_message("<span class='danger'>As [user] touches \the [src] with \a [W], silence fills the room...</span>",\
|
||||
"<span class='userdanger'>You touch \the [src] with \the [W], and everything suddenly goes silent.</span>\n<span class='notice'>\The [W] flashes into dust as you flinch away from \the [src].</span>",\
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
setDir(pick(GLOB.alldirs))
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_casing/Destroy()
|
||||
if(BB)
|
||||
QDEL_NULL(BB)
|
||||
return ..()
|
||||
|
||||
/obj/item/ammo_casing/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
|
||||
|
||||
@@ -76,6 +76,13 @@
|
||||
if(zoomable)
|
||||
azoom = new (src)
|
||||
|
||||
/obj/item/gun/Destroy()
|
||||
QDEL_NULL(pin)
|
||||
QDEL_NULL(gun_light)
|
||||
QDEL_NULL(bayonet)
|
||||
QDEL_NULL(chambered)
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/CheckParts(list/parts_list)
|
||||
..()
|
||||
var/obj/item/gun/G = locate(/obj/item/gun) in contents
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
/obj/item/gun/energy/Destroy()
|
||||
QDEL_NULL(cell)
|
||||
QDEL_LIST(ammo_type)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
if(DUEL_HUGBOX_NONE)
|
||||
var/obj/item/bodypart/B = L.get_bodypart(BODY_ZONE_HEAD)
|
||||
B.dismember()
|
||||
qdel(B)
|
||||
QDEL_IN(B, 1)
|
||||
if(DUEL_HUGBOX_LETHAL)
|
||||
L.adjustBruteLoss(180)
|
||||
L.death() //Die, powergamers.
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
/obj/item/borg/upgrade/modkit/proc/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
|
||||
. = TRUE
|
||||
if(src in KA.modkits) // Sanity check to prevent installing the same modkit twice thanks to occasional click/lag delays.
|
||||
return
|
||||
return FALSE
|
||||
if(minebot_upgrade)
|
||||
if(minebot_exclusive && !istype(KA.loc, /mob/living/simple_animal/hostile/mining_drone))
|
||||
to_chat(user, "<span class='notice'>The modkit you're trying to install is only rated for minebot use.</span>")
|
||||
@@ -317,7 +317,7 @@
|
||||
if(KA.get_remaining_mod_capacity() >= cost)
|
||||
if(.)
|
||||
if(!user.transferItemToLoc(src, KA))
|
||||
return
|
||||
return FALSE
|
||||
to_chat(user, "<span class='notice'>You install the modkit.</span>")
|
||||
playsound(loc, 'sound/items/screwdriver.ogg', 100, 1)
|
||||
KA.modkits += src
|
||||
@@ -382,7 +382,7 @@
|
||||
var/old = KA.overheat_time
|
||||
KA.overheat_time = max(0, KA.overheat_time - modifier)
|
||||
decreased = old - KA.overheat_time
|
||||
|
||||
|
||||
|
||||
/obj/item/borg/upgrade/modkit/cooldown/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
|
||||
KA.overheat_time += decreased
|
||||
|
||||
@@ -105,13 +105,15 @@
|
||||
|
||||
/obj/item/gun/energy/kinetic_accelerator/crossbow/large
|
||||
name = "energy crossbow"
|
||||
desc = "A reverse engineered weapon using syndicate technology."
|
||||
desc = "A reverse engineered weapon using syndicate technology. This thing seems incredibly unwieldly, and seems to be using similar internals to the Proto-Kinetic Accelerator. It might not play nice when brought near weapons similar to it."
|
||||
icon_state = "crossbowlarge"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
materials = list(MAT_METAL=4000)
|
||||
suppressed = null
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
pin = null
|
||||
unique_frequency = FALSE
|
||||
|
||||
/obj/item/gun/energy/plasmacutter
|
||||
name = "plasma cutter"
|
||||
|
||||
@@ -643,11 +643,11 @@
|
||||
Bump(original)
|
||||
|
||||
/obj/item/projectile/Destroy()
|
||||
STOP_PROCESSING(SSprojectiles, src)
|
||||
if(hitscan)
|
||||
finalize_hitscan_and_generate_tracers()
|
||||
STOP_PROCESSING(SSprojectiles, src)
|
||||
cleanup_beam_segments()
|
||||
qdel(trajectory)
|
||||
QDEL_NULL(trajectory)
|
||||
return ..()
|
||||
|
||||
/obj/item/projectile/proc/cleanup_beam_segments()
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/obj/item/projectile/energy/bolt //ebow bolts
|
||||
name = "bolt"
|
||||
icon_state = "cbbolt"
|
||||
damage = 8
|
||||
damage = 15
|
||||
damage_type = TOX
|
||||
nodamage = 0
|
||||
knockdown = 100
|
||||
stutter = 5
|
||||
drowsy = 50
|
||||
eyeblur = 10
|
||||
slur = 5
|
||||
knockdown = 160
|
||||
stamina = 60
|
||||
knockdown_stamoverride = 0
|
||||
|
||||
/obj/item/projectile/energy/bolt/halloween
|
||||
name = "candy corn"
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
var/working_state = "dispenser_working"
|
||||
var/nopower_state = "dispenser_nopower"
|
||||
var/has_panel_overlay = TRUE
|
||||
var/macrotier = 1
|
||||
var/obj/item/reagent_containers/beaker = null
|
||||
//dispensable_reagents is copypasted in plumbing synthesizers. Please update accordingly. (I didn't make it global because that would limit custom chem dispensers)
|
||||
var/list/dispensable_reagents = list(
|
||||
/datum/reagent/hydrogen,
|
||||
/datum/reagent/lithium,
|
||||
@@ -61,7 +61,7 @@
|
||||
/datum/reagent/bromine,
|
||||
/datum/reagent/stable_plasma
|
||||
)
|
||||
//these become available once upgraded.
|
||||
//These become available once upgraded.
|
||||
var/list/upgrade_reagents = list(
|
||||
/datum/reagent/oil,
|
||||
/datum/reagent/ammonia,
|
||||
@@ -87,11 +87,13 @@
|
||||
/datum/reagent/toxin/histamine,
|
||||
/datum/reagent/medicine/morphine
|
||||
)
|
||||
var/list/recording_recipe
|
||||
|
||||
var/list/saved_recipes = list()
|
||||
|
||||
/obj/machinery/chem_dispenser/Initialize()
|
||||
. = ..()
|
||||
dispensable_reagents = sortList(dispensable_reagents, /proc/cmp_reagents_asc)
|
||||
if(emagged_reagents)
|
||||
emagged_reagents = sortList(emagged_reagents, /proc/cmp_reagents_asc)
|
||||
if(upgrade_reagents)
|
||||
@@ -116,15 +118,6 @@
|
||||
. += "<span class='notice'>The status display reads:\n\
|
||||
Recharging <b>[recharge_amount]</b> power units per interval.\n\
|
||||
Power efficiency increased by <b>[round((powerefficiency*1000)-100, 1)]%</b>.</span>"
|
||||
switch(macrotier)
|
||||
if(1)
|
||||
. += "<span class='notice'>Macro granularity at <b>5u</b>.<span>"
|
||||
if(2)
|
||||
. += "<span class='notice'>Macro granularity at <b>3u</b>.<span>"
|
||||
if(3)
|
||||
. += "<span class='notice'>Macro granularity at <b>2u</b>.<span>"
|
||||
if(4)
|
||||
. += "<span class='notice'>Macro granularity at <b>1u</b>.<span>"
|
||||
|
||||
/obj/machinery/chem_dispenser/process()
|
||||
if (recharge_counter >= 4)
|
||||
@@ -160,7 +153,6 @@
|
||||
beaker_overlay = display_beaker()
|
||||
add_overlay(beaker_overlay)
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
@@ -225,8 +217,7 @@
|
||||
data["beakerTransferAmounts"] = null
|
||||
data["beakerCurrentpH"] = null
|
||||
|
||||
var/chemicals[0]
|
||||
var/recipes[0]
|
||||
var/list/chemicals = list()
|
||||
var/is_hallucinating = FALSE
|
||||
if(user.hallucinating())
|
||||
is_hallucinating = TRUE
|
||||
@@ -237,10 +228,10 @@
|
||||
if(is_hallucinating && prob(5))
|
||||
chemname = "[pick_list_replacements("hallucination.json", "chemicals")]"
|
||||
chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name))))
|
||||
for(var/recipe in saved_recipes)
|
||||
recipes.Add(list(recipe))
|
||||
data["chemicals"] = chemicals
|
||||
data["recipes"] = recipes
|
||||
data["recipes"] = saved_recipes
|
||||
|
||||
data["recordingRecipe"] = recording_recipe
|
||||
return data
|
||||
|
||||
/obj/machinery/chem_dispenser/ui_act(action, params)
|
||||
@@ -258,24 +249,28 @@
|
||||
if("dispense")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
var/reagent = GLOB.name2reagent[params["reagent"]]
|
||||
if(beaker && dispensable_reagents.Find(reagent))
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(amount, (cell.charge * powerefficiency)*10, free)
|
||||
var/reagent_name = params["reagent"]
|
||||
if(!recording_recipe)
|
||||
var/reagent = GLOB.name2reagent[reagent_name]
|
||||
if(beaker && dispensable_reagents.Find(reagent))
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(amount, (cell.charge * powerefficiency)*10, free)
|
||||
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(reagent, actual)
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(reagent, actual)
|
||||
|
||||
work_animation()
|
||||
. = TRUE
|
||||
work_animation()
|
||||
else
|
||||
recording_recipe[reagent_name] += amount
|
||||
. = TRUE
|
||||
if("remove")
|
||||
if(!is_operational())
|
||||
if(!is_operational() || recording_recipe)
|
||||
return
|
||||
var/amount = text2num(params["amount"])
|
||||
if(beaker && (amount in beaker.possible_transfer_amounts))
|
||||
if(beaker && amount in beaker.possible_transfer_amounts)
|
||||
beaker.reagents.remove_all(amount)
|
||||
work_animation()
|
||||
. = TRUE
|
||||
@@ -285,57 +280,65 @@
|
||||
if("dispense_recipe")
|
||||
if(!is_operational() || QDELETED(cell))
|
||||
return
|
||||
var/recipe_to_use = params["recipe"]
|
||||
var/list/chemicals_to_dispense = process_recipe_list(recipe_to_use)
|
||||
var/res = get_macro_resolution()
|
||||
for(var/key in chemicals_to_dispense) // i suppose you could edit the list locally before passing it
|
||||
var/list/keysplit = splittext(key," ")
|
||||
var/r_id = GLOB.name2reagent[translate_legacy_chem_id(keysplit[1])]
|
||||
if(beaker && dispensable_reagents.Find(r_id)) // but since we verify we have the reagent, it'll be fine
|
||||
var/list/chemicals_to_dispense = saved_recipes[params["recipe"]]
|
||||
if(!LAZYLEN(chemicals_to_dispense))
|
||||
return
|
||||
for(var/key in chemicals_to_dispense)
|
||||
var/reagent = GLOB.name2reagent[translate_legacy_chem_id(key)]
|
||||
var/dispense_amount = chemicals_to_dispense[key]
|
||||
if(!dispensable_reagents.Find(reagent))
|
||||
return
|
||||
if(!recording_recipe)
|
||||
if(!beaker)
|
||||
return
|
||||
var/datum/reagents/R = beaker.reagents
|
||||
var/free = R.maximum_volume - R.total_volume
|
||||
var/actual = min(max(chemicals_to_dispense[key], res), (cell.charge * powerefficiency)*10, free)
|
||||
var/actual = min(dispense_amount, (cell.charge * powerefficiency)*10, free)
|
||||
if(actual)
|
||||
if(!cell.use(actual / powerefficiency))
|
||||
say("Not enough energy to complete operation!")
|
||||
return
|
||||
R.add_reagent(r_id, actual)
|
||||
R.add_reagent(reagent, actual)
|
||||
work_animation()
|
||||
else
|
||||
recording_recipe[key] += dispense_amount
|
||||
. = TRUE
|
||||
if("clear_recipes")
|
||||
if(!is_operational())
|
||||
return
|
||||
var/yesno = alert("Clear all recipes?",, "Yes","No")
|
||||
if(yesno == "Yes")
|
||||
saved_recipes = list()
|
||||
if("add_recipe")
|
||||
. = TRUE
|
||||
if("record_recipe")
|
||||
if(!is_operational())
|
||||
return
|
||||
recording_recipe = list()
|
||||
. = TRUE
|
||||
if("save_recording")
|
||||
if(!is_operational())
|
||||
return
|
||||
var/name = stripped_input(usr,"Name","What do you want to name this recipe?", "Recipe", MAX_NAME_LEN)
|
||||
var/recipe = stripped_input(usr,"Recipe","Insert recipe with chem IDs")
|
||||
if(!usr.canUseTopic(src, !issilicon(usr)))
|
||||
return
|
||||
if(name && recipe)
|
||||
var/list/first_process = splittext(recipe, ";")
|
||||
if(!LAZYLEN(first_process))
|
||||
return
|
||||
var/res = get_macro_resolution()
|
||||
var/resmismatch = FALSE
|
||||
for(var/reagents in first_process)
|
||||
var/list/reagent = splittext(reagents, "=")
|
||||
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent[1])]
|
||||
if(dispensable_reagents.Find(reagent_id))
|
||||
if (!resmismatch && !check_macro_part(reagents, res))
|
||||
resmismatch = TRUE
|
||||
continue
|
||||
else
|
||||
var/chemid = reagent[1]
|
||||
if(saved_recipes[name] && alert("\"[name]\" already exists, do you want to overwrite it?",, "Yes", "No") == "No")
|
||||
return
|
||||
if(name && recording_recipe)
|
||||
for(var/reagent in recording_recipe)
|
||||
var/reagent_id = GLOB.name2reagent[translate_legacy_chem_id(reagent)]
|
||||
if(!dispensable_reagents.Find(reagent_id))
|
||||
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
|
||||
to_chat(usr, "<span class ='danger'>[src] cannot find Chemical ID: <b>[chemid]</b>!</span>")
|
||||
to_chat(usr, "<span class ='danger'>[src] cannot find <b>[reagent]</b>!</span>")
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, 1)
|
||||
return
|
||||
if (resmismatch && alert("[src] is not yet capable of replicating this recipe with the precision it needs, do you want to save it anyway?",, "Yes","No") == "No")
|
||||
return
|
||||
saved_recipes += list(list("recipe_name" = name, "contents" = recipe))
|
||||
saved_recipes[name] = recording_recipe
|
||||
recording_recipe = null
|
||||
. = TRUE
|
||||
if("cancel_recording")
|
||||
if(!is_operational())
|
||||
return
|
||||
recording_recipe = null
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
if(default_unfasten_wrench(user, I))
|
||||
@@ -343,7 +346,6 @@
|
||||
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
@@ -384,7 +386,6 @@
|
||||
work_animation()
|
||||
visible_message("<span class='danger'>[src] malfunctions, spraying chemicals everywhere!</span>")
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/RefreshParts()
|
||||
recharge_amount = initial(recharge_amount)
|
||||
var/newpowereff = 0.0666666
|
||||
@@ -395,13 +396,11 @@
|
||||
for(var/obj/item/stock_parts/capacitor/C in component_parts)
|
||||
recharge_amount *= C.rating
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
if (M.rating > macrotier)
|
||||
macrotier = M.rating
|
||||
if (M.rating > 1)
|
||||
if(M.rating > 1)
|
||||
dispensable_reagents |= upgrade_reagents
|
||||
if (M.rating > 2)
|
||||
if(M.rating > 2)
|
||||
dispensable_reagents |= upgrade_reagents2
|
||||
if (M.rating > 3)
|
||||
if(M.rating > 3)
|
||||
dispensable_reagents |= upgrade_reagents3
|
||||
powerefficiency = round(newpowereff, 0.01)
|
||||
|
||||
@@ -422,41 +421,14 @@
|
||||
cell = null
|
||||
if(beaker)
|
||||
beaker.forceMove(drop_location())
|
||||
beaker = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/get_macro_resolution()
|
||||
. = 5
|
||||
if (macrotier > 1)
|
||||
. -= macrotier // 5 for tier1, 3 for 2, 2 for 3, 1 for 4.
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/check_macro(macro)
|
||||
var/res = get_macro_resolution()
|
||||
for (var/reagent in splittext(trim(macro), ";"))
|
||||
if (!check_macro_part(reagent, res))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/check_macro_part(var/part, var/res = get_macro_resolution())
|
||||
var/detail = splittext(part, "=")
|
||||
if (round(text2num(detail[2]), res) != text2num(detail[2]))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/process_recipe_list(var/fucking_hell)
|
||||
var/list/key_list = list()
|
||||
var/list/final_list = list()
|
||||
var/list/first_process = splittext(fucking_hell, ";")
|
||||
for(var/reagents in first_process)
|
||||
var/list/fuck = splittext(reagents, "=")
|
||||
final_list += list(avoid_assoc_duplicate_keys(fuck[1],key_list) = text2num(fuck[2]))
|
||||
return final_list
|
||||
|
||||
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
if(istype(user) && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
replace_beaker(user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/Initialize()
|
||||
. = ..()
|
||||
@@ -540,7 +512,6 @@
|
||||
/datum/reagent/toxin/staminatoxin
|
||||
)
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/drinks/fullupgrade //fully ugpraded stock parts, emagged
|
||||
desc = "Contains a large reservoir of soft drinks. This model has had its safeties shorted out."
|
||||
obj_flags = CAN_BE_HIT | EMAGGED
|
||||
@@ -646,7 +617,7 @@
|
||||
/datum/reagent/ammonia,
|
||||
/datum/reagent/ash,
|
||||
/datum/reagent/diethylamine)
|
||||
//same as above.
|
||||
//same as above.
|
||||
upgrade_reagents = null
|
||||
upgrade_reagents2 = null
|
||||
upgrade_reagents3 = null
|
||||
|
||||
@@ -540,9 +540,13 @@
|
||||
|
||||
if(MUTCOLORS in N.dna.species.species_traits) //take current alien color and darken it slightly
|
||||
var/newcolor = ""
|
||||
var/len = length(N.dna.features["mcolor"])
|
||||
for(var/i=1, i<=len, i+=1)
|
||||
var/ascii = text2ascii(N.dna.features["mcolor"],i)
|
||||
var/string = N.dna.features["mcolor"]
|
||||
var/len = length(string)
|
||||
var/char = ""
|
||||
var/ascii = 0
|
||||
for(var/i=1, i<=len, i += length(char))
|
||||
char = string[i]
|
||||
ascii = text2ascii(char)
|
||||
switch(ascii)
|
||||
if(48)
|
||||
newcolor += "0"
|
||||
@@ -553,7 +557,7 @@
|
||||
if(98 to 102)
|
||||
newcolor += ascii2text(ascii-1) //letters b to f lowercase
|
||||
if(65)
|
||||
newcolor +="9"
|
||||
newcolor += "9"
|
||||
if(66 to 70)
|
||||
newcolor += ascii2text(ascii+31) //letters B to F - translates to lowercase
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user