mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
+2
-2
@@ -3,8 +3,8 @@ sudo: false
|
||||
|
||||
env:
|
||||
global:
|
||||
- BYOND_MAJOR="509"
|
||||
- BYOND_MINOR="1319"
|
||||
- BYOND_MAJOR="510"
|
||||
- BYOND_MINOR="1322"
|
||||
- NODE_VERSION="4"
|
||||
matrix:
|
||||
- DM_MAPFILE="tgstation2"
|
||||
|
||||
@@ -73,11 +73,6 @@ specified in the config.txt, and set the Security box to 'Safe'. Then press GO
|
||||
and the server should start up and be ready to join. It is also recommended that
|
||||
you set up the SQL backend (see below).
|
||||
|
||||
###HOSTING ON LINUX
|
||||
We use BYGEX for some of our text replacement related code. Unfortunately, we
|
||||
only have a windows dll included right now. You can find a version known to compile on linux, along with some basic install instructions here
|
||||
https://github.com/optimumtact/byond-regex
|
||||
|
||||
##UPDATING
|
||||
|
||||
To update an existing installation, first back up your /config and /data folders
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
// Helpers for running 510 code on older versions of BYOND.
|
||||
#if DM_VERSION < 510
|
||||
#define BYGEX "code/__HELPERS/bygex"
|
||||
/proc/replacetext(text, replace, replacement)
|
||||
if(istype(replace, /regex))
|
||||
var/regex/R = replace
|
||||
return R.Replace(text, replacement)
|
||||
else
|
||||
return call(BYGEX, "regex_replaceallliteral")(text, replace, replacement)
|
||||
|
||||
/proc/replacetextEx(text, replace, replacement)
|
||||
return call(BYGEX, "regEx_replaceallliteral")(text, replace, replacement)
|
||||
|
||||
/proc/regex(pattern, flags)
|
||||
return new /regex(pattern, flags)
|
||||
|
||||
/regex
|
||||
var/pattern
|
||||
var/list/flags
|
||||
var/list/group
|
||||
|
||||
/regex/New(pattern, flags)
|
||||
src.pattern = pattern
|
||||
src.flags = splittext(flags, "")
|
||||
group = list()
|
||||
|
||||
/regex/proc/Find(text) // Does not support Start/End.
|
||||
var/method
|
||||
if("i" in flags)
|
||||
method = "regex_find"
|
||||
else
|
||||
method = "regEx_find"
|
||||
|
||||
var/results = call(BYGEX, method)(text, pattern)
|
||||
var/list/L = params2list(results)
|
||||
var/list/M
|
||||
var/i
|
||||
var/j
|
||||
|
||||
for(i in L)
|
||||
M = L[i]
|
||||
for(j = 2, j <= M.len, j += 2)
|
||||
var/pos = text2num(M[j-1])
|
||||
var/len = text2num(M[j])
|
||||
group += copytext(text, pos, pos + len)
|
||||
|
||||
/regex/proc/Replace(text, replacement)
|
||||
var/method
|
||||
if("g" in flags)
|
||||
if("i" in flags)
|
||||
method = "regex_replaceall"
|
||||
else
|
||||
method = "regEx_replaceall"
|
||||
else
|
||||
if("i" in flags)
|
||||
method = "regex_replace"
|
||||
else
|
||||
method = "regEx_replace"
|
||||
return call(BYGEX, method)(text, pattern, replacement)
|
||||
#undef BYGEX
|
||||
|
||||
// Formerly list2text
|
||||
/proc/jointext(list/ls, sep)
|
||||
if(ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if(sep != null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += "[S1]" // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
// Formerly text2list
|
||||
/proc/splittext(text, delim = "\n")
|
||||
var/delim_len = length(delim)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found = 1
|
||||
if(delim_len < 1)
|
||||
var/text_len = length(text)
|
||||
while(found++ <= text_len)
|
||||
. += copytext(text,found-1, found)
|
||||
else
|
||||
do
|
||||
found = findtext(text, delim, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
// Formerly JSON.stringify
|
||||
/proc/json_encode(value)
|
||||
return jointext(json_encode_value(list(), value))
|
||||
|
||||
/proc/json_encode_value(list/json, value)
|
||||
. = json
|
||||
if(isnum(value))
|
||||
json += value // Consider num2text(value, 20) for maximum accuracy.
|
||||
else if(isnull(value))
|
||||
json += "null"
|
||||
else if(istext(value))
|
||||
json_encode_string(json, value)
|
||||
else if(istype(value, /list))
|
||||
json_encode_list(json, value)
|
||||
else
|
||||
json_encode_string(json, "[value]")
|
||||
// 510 just encodes the name of a datum.
|
||||
//throw EXCEPTION("Datums cannot be converted to JSON.")
|
||||
|
||||
/proc/json_encode_string(list/json, str)
|
||||
. = json
|
||||
var/quotePos = findtextEx(str, "\"")
|
||||
var/bsPos = findtextEx(str, "\\")
|
||||
if (quotePos == 0 && bsPos == 0)
|
||||
json.Add("\"", str, "\"")
|
||||
else
|
||||
json += "\""
|
||||
var/lastStop = 1
|
||||
while(quotePos != 0 || bsPos != 0)
|
||||
var/escPos
|
||||
if(quotePos < bsPos && quotePos != 0 || bsPos == 0)
|
||||
escPos = quotePos
|
||||
else
|
||||
escPos = bsPos
|
||||
json.Add(copytext(str, lastStop, escPos), "\\")
|
||||
lastStop = escPos
|
||||
if(escPos == quotePos)
|
||||
quotePos = findtextEx(str, "\"", escPos + 1)
|
||||
else if(escPos == bsPos)
|
||||
bsPos = findtextEx(str, "\\", escPos + 1)
|
||||
json.Add(copytext(str, lastStop), "\"")
|
||||
|
||||
/proc/json_encode_list(list/json, list/listVal)
|
||||
. = json
|
||||
#define Either 0
|
||||
#define CannotBeArray 1
|
||||
#define CannotBeObject 2
|
||||
#define BadList (CannotBeArray | CannotBeObject)
|
||||
var/listType = Either
|
||||
for(var/key in listVal)
|
||||
if(istext(key))
|
||||
if(!isnull(listVal[key]))
|
||||
listType |= CannotBeArray
|
||||
else
|
||||
if(!isnum(key) && !isnull(listVal[key]))
|
||||
listType = BadList
|
||||
else
|
||||
listType |= CannotBeObject
|
||||
|
||||
if(listType == BadList)
|
||||
throw EXCEPTION("The given list cannot be converted to JSON.")
|
||||
|
||||
if(listType == CannotBeArray)
|
||||
json += "{"
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
json_encode_string(json, key)
|
||||
json += ":"
|
||||
json_encode_value(json, listVal[key])
|
||||
json += "}"
|
||||
else
|
||||
json += "\["
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
json_encode_value(json, key)
|
||||
json += "]"
|
||||
#undef Either
|
||||
#undef CannotBeFlat
|
||||
#undef CannotBeAssoc
|
||||
#undef BadList
|
||||
#endif
|
||||
@@ -12,11 +12,11 @@ var/global/list/string_cache
|
||||
var/list/stringsList = list()
|
||||
fileList = file2list("strings/[filename]")
|
||||
for(var/s in fileList)
|
||||
stringsList = text2list(s, "@=")
|
||||
stringsList = splittext(s, "@=")
|
||||
if(stringsList.len != 2)
|
||||
CRASH("Invalid string list in strings/[filename]")
|
||||
if(findtext(stringsList[2], "@,"))
|
||||
string_cache[filename][stringsList[1]] = text2list(stringsList[2], "@,")
|
||||
string_cache[filename][stringsList[1]] = splittext(stringsList[2], "@,")
|
||||
else
|
||||
string_cache[filename][stringsList[1]] = stringsList[2] // Its a single string!
|
||||
else
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
This file is part of bygex.
|
||||
|
||||
bygex is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
bygex is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with bygex. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
Based on code by Zac Stringham - Copyright 2009 (LGPL)
|
||||
Written 6-Oct-2013 - carnie (elly1989@rocketmail.com), accreditation appreciated but not required.
|
||||
Please do not remove this comment.
|
||||
|
||||
Full source code is available at https://code.google.com/p/byond-regex/
|
||||
Please report any relevant issues on the tracker at the above address.
|
||||
~Carn
|
||||
*/
|
||||
|
||||
#ifdef USE_BYGEX
|
||||
|
||||
#ifndef LIBREGEX_LIBRARY
|
||||
#define LIBREGEX_LIBRARY "bin/bygex"
|
||||
#endif
|
||||
|
||||
/proc/regEx_compare(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_compare")(str, exp))
|
||||
|
||||
/proc/regex_compare(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_compare")(str, exp))
|
||||
|
||||
/proc/regEx_find(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp))
|
||||
|
||||
/proc/regex_find(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_find")(str, exp))
|
||||
|
||||
/proc/regEx_replaceall(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regEx_replaceall")(str, exp, fmt)
|
||||
|
||||
/proc/regex_replaceall(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regex_replaceall")(str, exp, fmt)
|
||||
|
||||
/proc/replacetextEx(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regEx_replaceallliteral")(str, exp, fmt)
|
||||
|
||||
/proc/replacetext(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regex_replaceallliteral")(str, exp, fmt)
|
||||
|
||||
/proc/regEx_replace(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regEx_replace")(str, exp, fmt)
|
||||
|
||||
/proc/regex_replace(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regex_replace")(str, exp, fmt)
|
||||
|
||||
/proc/regEx_findall(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_findall")(str, exp))
|
||||
|
||||
/proc/regex_findall(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regex_findall")(str, exp))
|
||||
|
||||
|
||||
//upon calling a regex match or search, a /datum/regex object is created with str(haystack) and exp(needle) variables set
|
||||
//it also contains a list(matches) of /datum/match objects, each of which holds the position and length of the match
|
||||
//matched strings are not returned from the dll, in order to save on memory allocation for large numbers of strings
|
||||
//instead, you can use regex.str(matchnum) to fetch this string as needed.
|
||||
//likewise you can also use regex.pos(matchnum) and regex.len(matchnum) as shorthands
|
||||
/datum/regex
|
||||
var/str
|
||||
var/exp
|
||||
var/error
|
||||
var/anchors = 0
|
||||
var/list/matches = list()
|
||||
|
||||
/datum/regex/New(str, exp, results)
|
||||
src.str = str
|
||||
src.exp = exp
|
||||
|
||||
if(findtext(results, "$Err$", 1, 6)) //error message
|
||||
src.error = results
|
||||
else
|
||||
var/list/L = params2list(results)
|
||||
var/list/M
|
||||
var{i;j}
|
||||
for(i in L)
|
||||
M = L[i]
|
||||
for(j=2, j<=M.len, j+=2)
|
||||
matches += new /datum/match(text2num(M[j-1]),text2num(M[j]))
|
||||
anchors = (j-2)/2
|
||||
return matches
|
||||
|
||||
/datum/regex/proc/str(i)
|
||||
if(!i)
|
||||
return str
|
||||
var/datum/match/M = matches[i]
|
||||
if(i < 1 || i > matches.len)
|
||||
throw EXCEPTION("str(): out of bounds")
|
||||
return copytext(str, M.pos, M.pos+M.len)
|
||||
|
||||
/datum/regex/proc/pos(i)
|
||||
if(!i)
|
||||
return 1
|
||||
if(i < 1 || i > matches.len)
|
||||
throw EXCEPTION("pos(): out of bounds")
|
||||
var/datum/match/M = matches[i]
|
||||
return M.pos
|
||||
|
||||
/datum/regex/proc/len(i)
|
||||
if(!i)
|
||||
return length(str)
|
||||
if(i < 1 || i > matches.len)
|
||||
throw EXCEPTION("len(): out of bounds")
|
||||
var/datum/match/M = matches[i]
|
||||
return M.len
|
||||
|
||||
/datum/regex/proc/end(i)
|
||||
if(!i)
|
||||
return length(str)
|
||||
if(i < 1 || i > matches.len)
|
||||
throw EXCEPTION("end() out of bounds")
|
||||
var/datum/match/M = matches[i]
|
||||
return M.pos + M.len
|
||||
|
||||
/datum/regex/proc/report() //debug tool
|
||||
. = ":: RESULTS ::\n:: str :: [html_encode(str)]\n:: exp :: [html_encode(exp)]\n:: anchors :: [anchors]"
|
||||
if(error)
|
||||
. += "\n<font color='red'>[error]</font>"
|
||||
return
|
||||
for(var/i=1, i<=matches.len, ++i)
|
||||
. += "\nMatch[i]\n\t[html_encode(str(i))]\n\tpos=[pos(i)] len=[len(i)]"
|
||||
|
||||
/datum/match
|
||||
var/pos
|
||||
var/len
|
||||
|
||||
/datum/match/New(pos, len)
|
||||
src.pos = pos
|
||||
src.len = len
|
||||
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/mob
|
||||
var/expression = "\\S+"
|
||||
var/format = "*"
|
||||
|
||||
var/datum/regex/results
|
||||
|
||||
/mob/verb/set_expression()
|
||||
var/t = input(usr,"Input Expression","title",expression) as text|null
|
||||
if(t != null)
|
||||
expression = t
|
||||
usr << "Expression set to:\t[html_encode(t)]"
|
||||
|
||||
/mob/verb/set_format()
|
||||
var/t = input(usr,"Input Formatter","title",format) as text|null
|
||||
if(t != null)
|
||||
format = t
|
||||
usr << "Format set to:\t[html_encode(t)]"
|
||||
|
||||
/mob/verb/compare_casesensitive(t as text)
|
||||
results = regEx_compare(t, expression)
|
||||
world << results.report()
|
||||
|
||||
/mob/verb/compare(t as text)
|
||||
results = regex_compare(t, expression)
|
||||
world << results.report()
|
||||
|
||||
/mob/verb/find_casesensitive(t as text)
|
||||
results = regEx_find(t, expression)
|
||||
world << results.report()
|
||||
|
||||
/mob/verb/find(t as text)
|
||||
results = regex_find(t, expression)
|
||||
world << results.report()
|
||||
|
||||
/mob/verb/replaceall_casesensitive(t as text)
|
||||
usr << regEx_replaceall(t, expression, format)
|
||||
|
||||
/mob/verb/replaceall(t as text)
|
||||
usr << regex_replaceall(t, expression, format)
|
||||
|
||||
/mob/verb/replace_casesensitive(t as text)
|
||||
usr << html_encode(regEx_replace(t, expression, format))
|
||||
|
||||
/mob/verb/replace(t as text)
|
||||
usr << regex_replace(t, expression, format)
|
||||
|
||||
/mob/verb/findall(t as text)
|
||||
results = regex_findall(t, expression)
|
||||
world << results.report()
|
||||
|
||||
/mob/verb/findall_casesensitive(t as text)
|
||||
results = regEx_findall(t, expression)
|
||||
world << results.report()
|
||||
@@ -206,18 +206,6 @@
|
||||
if(start)
|
||||
return findtextEx(text, suffix, start, null)
|
||||
|
||||
/*
|
||||
* Text modification
|
||||
*/
|
||||
// See bygex.dm
|
||||
#ifndef USE_BYGEX
|
||||
/proc/replacetext(text, find, replacement)
|
||||
return list2text(text2list(text, find), replacement)
|
||||
|
||||
/proc/replacetextEx(text, find, replacement)
|
||||
return list2text(text2listEx(text, find), replacement)
|
||||
#endif
|
||||
|
||||
//Adds 'u' number of zeros ahead of the text 't'
|
||||
/proc/add_zero(t, u)
|
||||
while (length(t) < u)
|
||||
|
||||
+8
-138
@@ -2,7 +2,6 @@
|
||||
* Holds procs designed to change one type of value, into another.
|
||||
* Contains:
|
||||
* hex2num & num2hex
|
||||
* text2list & list2text
|
||||
* file2list
|
||||
* angle2dir
|
||||
* angle2text
|
||||
@@ -72,138 +71,9 @@
|
||||
i++
|
||||
return .
|
||||
|
||||
|
||||
// Concatenates a list of strings into a single string. A seperator may optionally be provided.
|
||||
/proc/list2text(list/ls, sep)
|
||||
if(ls.len <= 1) // Early-out code for empty or singleton lists.
|
||||
return ls.len ? ls[1] : ""
|
||||
|
||||
var/l = ls.len // Made local for sanic speed.
|
||||
var/i = 0 // Incremented every time a list index is accessed.
|
||||
|
||||
if(sep != null)
|
||||
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
|
||||
#define S1 sep, ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
// Having the small concatenations come before the large ones boosted speed by an average of at least 5%.
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. = text("[][][]", ., S1) // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][][][][][]", ., S4) // And so on....
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
else
|
||||
// Macros expand to long argument lists like so: ls[++i], ls[++i], ls[++i], etc...
|
||||
#define S1 ls[++i]
|
||||
#define S4 S1, S1, S1, S1
|
||||
#define S16 S4, S4, S4, S4
|
||||
#define S64 S16, S16, S16, S16
|
||||
|
||||
. = "[ls[++i]]" // Make sure the initial element is converted to text.
|
||||
|
||||
if(l-1 & 0x01) // 'i' will always be 1 here.
|
||||
. += "[S1]" // Append 1 element if the remaining elements are not a multiple of 2.
|
||||
if(l-i & 0x02)
|
||||
. = text("[][][]", ., S1, S1) // Append 2 elements if the remaining elements are not a multiple of 4.
|
||||
if(l-i & 0x04)
|
||||
. = text("[][][][][]", ., S4) // And so on...
|
||||
if(l-i & 0x08)
|
||||
. = text("[][][][][][][][][]", ., S4, S4)
|
||||
if(l-i & 0x10)
|
||||
. = text("[][][][][][][][][][][][][][][][][]", ., S16)
|
||||
if(l-i & 0x20)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S16, S16)
|
||||
if(l-i & 0x40)
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64)
|
||||
while(l > i) // Chomp through the rest of the list, 128 elements at a time.
|
||||
. = text("[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]\
|
||||
[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]", ., S64, S64)
|
||||
|
||||
#undef S64
|
||||
#undef S16
|
||||
#undef S4
|
||||
#undef S1
|
||||
|
||||
|
||||
//slower then list2text, but correctly processes associative lists.
|
||||
/proc/tg_list2text(list/list, glue=",")
|
||||
if(!istype(list) || !list.len)
|
||||
return
|
||||
var/output
|
||||
for(var/i=1 to list.len)
|
||||
output += (i!=1? glue : null)+(!isnull(list["[list[i]]"])?"[list["[list[i]]"]]":"[list[i]]")
|
||||
return output
|
||||
|
||||
|
||||
//Converts a string into a list by splitting the string at each delimiter found. (discarding the seperator)
|
||||
/proc/text2list(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found = 1
|
||||
if(delim_len < 1)
|
||||
var/text_len = length(text)
|
||||
while(found++ <= text_len)
|
||||
. += copytext(text,found-1, found)
|
||||
else
|
||||
do
|
||||
found = findtext(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
//Case Sensitive!
|
||||
/proc/text2listEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1)
|
||||
return list(text)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
do
|
||||
found = findtextEx(text, delimiter, last_found, 0)
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
//Splits the text of a file at seperator and returns them in a list.
|
||||
/proc/file2list(filename, seperator="\n")
|
||||
return text2list(return_file_text(filename),seperator)
|
||||
return splittext(return_file_text(filename),seperator)
|
||||
|
||||
|
||||
//Turns a direction into text
|
||||
@@ -679,18 +549,18 @@ for(var/t in test_times)
|
||||
//Find var names
|
||||
|
||||
// "A dog said hi [name]!"
|
||||
// text2list() --> list("A dog said hi ","name]!"
|
||||
// list2text() --> "A dog said hi name]!"
|
||||
// text2list() --> list("A","dog","said","hi","name]!")
|
||||
// splittext() --> list("A dog said hi ","name]!"
|
||||
// jointext() --> "A dog said hi name]!"
|
||||
// splittext() --> list("A","dog","said","hi","name]!")
|
||||
|
||||
t_string = replacetext(t_string,"\[","\[ ")//Necessary to resolve "word[var_name]" scenarios
|
||||
var/list/list_value = text2list(t_string,"\[")
|
||||
var/intermediate_stage = list2text(list_value)
|
||||
var/list/list_value = splittext(t_string,"\[")
|
||||
var/intermediate_stage = jointext(list_value, null)
|
||||
|
||||
list_value = text2list(intermediate_stage," ")
|
||||
list_value = splittext(intermediate_stage," ")
|
||||
for(var/value in list_value)
|
||||
if(findtext(value,"]"))
|
||||
value = text2list(value,"]") //"name]!" --> list("name","!")
|
||||
value = splittext(value,"]") //"name]!" --> list("name","!")
|
||||
for(var/A in value)
|
||||
if(var_source.vars.Find(A))
|
||||
. += A
|
||||
|
||||
@@ -951,11 +951,11 @@ var/list/WALLITEMS_INVERSE = list(
|
||||
|
||||
|
||||
/proc/screen_loc2turf(scr_loc, turf/origin)
|
||||
var/tX = text2list(scr_loc, ",")
|
||||
var/tY = text2list(tX[2], ":")
|
||||
var/tX = splittext(scr_loc, ",")
|
||||
var/tY = splittext(tX[2], ":")
|
||||
var/tZ = origin.z
|
||||
tY = tY[1]
|
||||
tX = text2list(tX[1], ":")
|
||||
tX = splittext(tX[1], ":")
|
||||
tX = tX[1]
|
||||
tX = max(1, min(world.maxx, origin.x + (text2num(tX) - (world.view + 1))))
|
||||
tY = max(1, min(world.maxy, origin.y + (text2num(tY) - (world.view + 1))))
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
#error Your version of BYOND is too out-of-date to compile this project. Go to byond.com/download and update.
|
||||
#endif
|
||||
|
||||
#define USE_BYGEX
|
||||
|
||||
|
||||
#ifndef SERVERTOOLS
|
||||
#define SERVERTOOLS 0
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#define CLICKCATCHER_PLANE -99
|
||||
@@ -331,7 +331,7 @@
|
||||
/obj/screen/click_catcher
|
||||
icon = 'icons/mob/screen_full.dmi'
|
||||
icon_state = "passage0"
|
||||
layer = 0
|
||||
plane = CLICKCATCHER_PLANE
|
||||
mouse_opacity = 2
|
||||
screen_loc = "CENTER-7,CENTER-7"
|
||||
|
||||
|
||||
@@ -122,27 +122,12 @@
|
||||
alien_plasma_display.name = "plasma stored"
|
||||
alien_plasma_display.screen_loc = ui_alienplasmadisplay
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen()
|
||||
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel/alien()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi'
|
||||
mymob.zone_sel.update_icon()
|
||||
|
||||
mymob.client.screen = list()
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, alien_plasma_display, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, alien_plasma_display, mymob.pullin) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += adding + other
|
||||
mymob.client.screen += mymob.client.void
|
||||
@@ -25,27 +25,12 @@
|
||||
mymob.pullin.update_icon(mymob)
|
||||
mymob.pullin.screen_loc = ui_pull_resist
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen()
|
||||
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel/alien()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi'
|
||||
mymob.zone_sel.update_icon()
|
||||
|
||||
mymob.client.screen = list()
|
||||
|
||||
mymob.client.screen += list( mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list( mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += adding + other
|
||||
mymob.client.screen += mymob.client.void
|
||||
@@ -0,0 +1,108 @@
|
||||
#define FULLSCREEN_LAYER 18
|
||||
#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1
|
||||
#define BLIND_LAYER DAMAGE_LAYER + 0.1
|
||||
#define CRIT_LAYER BLIND_LAYER + 0.1
|
||||
|
||||
/mob
|
||||
var/list/screens = list()
|
||||
|
||||
/mob/proc/overlay_fullscreen(category, type, severity)
|
||||
var/obj/screen/fullscreen/screen
|
||||
if(screens[category])
|
||||
screen = screens[category]
|
||||
if(screen.type != type)
|
||||
clear_fullscreen(category, FALSE)
|
||||
return .()
|
||||
else if(!severity || severity == screen.severity)
|
||||
return null
|
||||
else
|
||||
screen = PoolOrNew(type)
|
||||
|
||||
screen.icon_state = "[initial(screen.icon_state)][severity]"
|
||||
screen.severity = severity
|
||||
|
||||
screens[category] = screen
|
||||
if(client)
|
||||
client.screen += screen
|
||||
return screen
|
||||
|
||||
/mob/proc/clear_fullscreen(category, animate = 10)
|
||||
set waitfor = 0
|
||||
var/obj/screen/fullscreen/screen = screens[category]
|
||||
if(!screen)
|
||||
return
|
||||
|
||||
if(animate)
|
||||
animate(screen, alpha = 0, time = animate)
|
||||
sleep(animate)
|
||||
|
||||
screens -= category
|
||||
if(client)
|
||||
client.screen -= screen
|
||||
qdel(screen)
|
||||
|
||||
/mob/proc/clear_fullscreens()
|
||||
for(var/category in screens)
|
||||
clear_fullscreen(category)
|
||||
|
||||
/datum/hud/proc/reload_fullscreen()
|
||||
var/list/screens = mymob.screens
|
||||
for(var/category in screens)
|
||||
mymob.client.screen |= screens[category]
|
||||
|
||||
/obj/screen/fullscreen
|
||||
icon = 'icons/mob/screen_full.dmi'
|
||||
icon_state = "default"
|
||||
screen_loc = "CENTER-7,CENTER-7"
|
||||
layer = FULLSCREEN_LAYER
|
||||
mouse_opacity = 0
|
||||
var/severity = 0
|
||||
|
||||
/obj/screen/fullscreen/Destroy()
|
||||
..()
|
||||
severity = 0
|
||||
return QDEL_HINT_PUTINPOOL
|
||||
|
||||
/obj/screen/fullscreen/brute
|
||||
icon_state = "brutedamageoverlay"
|
||||
layer = DAMAGE_LAYER
|
||||
|
||||
/obj/screen/fullscreen/oxy
|
||||
icon_state = "oxydamageoverlay"
|
||||
layer = DAMAGE_LAYER
|
||||
|
||||
/obj/screen/fullscreen/crit
|
||||
icon_state = "passage"
|
||||
layer = CRIT_LAYER
|
||||
|
||||
/obj/screen/fullscreen/blind
|
||||
icon_state = "blackimageoverlay"
|
||||
layer = BLIND_LAYER
|
||||
|
||||
/obj/screen/fullscreen/impaired
|
||||
icon_state = "impairedoverlay"
|
||||
|
||||
/obj/screen/fullscreen/blurry
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
icon_state = "blurry"
|
||||
|
||||
/obj/screen/fullscreen/flash
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
icon_state = "flash"
|
||||
|
||||
/obj/screen/fullscreen/flash/noise
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
icon_state = "noise"
|
||||
|
||||
/obj/screen/fullscreen/high
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
icon_state = "druggy"
|
||||
|
||||
#undef FULLSCREEN_LAYER
|
||||
#undef BLIND_LAYER
|
||||
#undef DAMAGE_LAYER
|
||||
#undef CRIT_LAYER
|
||||
@@ -1,85 +1,3 @@
|
||||
/*
|
||||
The global hud:
|
||||
Uses the same visual objects for all players.
|
||||
*/
|
||||
|
||||
var/datum/global_hud/global_hud = new()
|
||||
|
||||
/datum/global_hud
|
||||
var/obj/screen/druggy
|
||||
var/obj/screen/blurry
|
||||
var/list/vimpaired
|
||||
var/list/darkMask
|
||||
|
||||
/datum/global_hud/New()
|
||||
//420erryday psychedellic colours screen overlay for when you are high
|
||||
druggy = new /obj/screen()
|
||||
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
druggy.icon_state = "druggy"
|
||||
druggy.blend_mode = BLEND_MULTIPLY
|
||||
druggy.layer = 17
|
||||
druggy.mouse_opacity = 0
|
||||
|
||||
//that white blurry effect you get when you eyes are damaged
|
||||
blurry = new /obj/screen()
|
||||
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
blurry.icon_state = "blurry"
|
||||
blurry.layer = 17
|
||||
blurry.mouse_opacity = 0
|
||||
|
||||
var/obj/screen/O
|
||||
var/i
|
||||
//that nasty looking dither you get when you're short-sighted
|
||||
vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen)
|
||||
O = vimpaired[1]
|
||||
O.screen_loc = "WEST,SOUTH to CENTER-3,NORTH" //West dither
|
||||
O = vimpaired[2]
|
||||
O.screen_loc = "WEST,SOUTH to EAST,CENTER-3" //South dither
|
||||
O = vimpaired[3]
|
||||
O.screen_loc = "CENTER+3,SOUTH to EAST,NORTH" //East dither
|
||||
O = vimpaired[4]
|
||||
O.screen_loc = "WEST,CENTER+3 to EAST,NORTH" //North dither
|
||||
|
||||
//welding mask overlay black/dither
|
||||
darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen)
|
||||
O = darkMask[1]
|
||||
O.screen_loc = "CENTER-5,CENTER-5 to CENTER-3,CENTER+5" //West dither
|
||||
O = darkMask[2]
|
||||
O.screen_loc = "CENTER-5,CENTER-5 to CENTER+5,CENTER-3" //South dither
|
||||
O = darkMask[3]
|
||||
O.screen_loc = "CENTER+3,CENTER-5 to CENTER+5,CENTER+5" //East dither
|
||||
O = darkMask[4]
|
||||
O.screen_loc = "CENTER-5,CENTER+3 to CENTER+5,CENTER+5" //North dither
|
||||
O = darkMask[5]
|
||||
O.screen_loc = "WEST,SOUTH to CENTER-5,NORTH" //West black
|
||||
O = darkMask[6]
|
||||
O.screen_loc = "WEST,SOUTH to EAST,CENTER-5" //South black
|
||||
O = darkMask[7]
|
||||
O.screen_loc = "CENTER+5,SOUTH to EAST,NORTH" //East black
|
||||
O = darkMask[8]
|
||||
O.screen_loc = "WEST,CENTER+5 to EAST,NORTH" //North black
|
||||
|
||||
|
||||
for(i = 1, i <= 4, i++)
|
||||
O = vimpaired[i]
|
||||
O.icon_state = "dither50"
|
||||
O.blend_mode = BLEND_MULTIPLY
|
||||
O.layer = 17
|
||||
O.mouse_opacity = 0
|
||||
|
||||
O = darkMask[i]
|
||||
O.icon_state = "dither50"
|
||||
O.blend_mode = BLEND_MULTIPLY
|
||||
O.layer = 17
|
||||
O.mouse_opacity = 0
|
||||
|
||||
for(i = 5, i <= 8, i++)
|
||||
O = darkMask[i]
|
||||
O.icon_state = "black"
|
||||
O.blend_mode = BLEND_MULTIPLY
|
||||
O.layer = 17
|
||||
O.mouse_opacity = 0
|
||||
|
||||
/*
|
||||
The hud datum
|
||||
Used to show and hide huds for all the different mob types,
|
||||
@@ -287,6 +205,8 @@ var/datum/global_hud/global_hud = new()
|
||||
else if(isovermind(mymob))
|
||||
blob_hud()
|
||||
|
||||
reload_fullscreen() // Reload any fullscreen overlays this mob has.
|
||||
|
||||
//Version denotes which style should be displayed. blank or 0 means "next version"
|
||||
/datum/hud/proc/show_hud(version = 0)
|
||||
if(!ismob(mymob))
|
||||
@@ -316,11 +236,6 @@ var/datum/global_hud/global_hud = new()
|
||||
mymob.client.screen += mymob.internals
|
||||
mymob.client.screen += lingstingdisplay
|
||||
mymob.client.screen += lingchemdisplay
|
||||
|
||||
hidden_inventory_update()
|
||||
persistant_inventory_update()
|
||||
mymob.update_action_buttons()
|
||||
reorganize_alerts()
|
||||
if(HUD_STYLE_REDUCED) //Reduced HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(adding)
|
||||
@@ -340,11 +255,6 @@ var/datum/global_hud/global_hud = new()
|
||||
mymob.client.screen += r_hand_hud_object //we want the hands to be visible
|
||||
mymob.client.screen += action_intent //we want the intent swticher visible
|
||||
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
|
||||
hidden_inventory_update()
|
||||
persistant_inventory_update()
|
||||
mymob.update_action_buttons()
|
||||
reorganize_alerts()
|
||||
if(HUD_STYLE_NOHUD) //No HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(adding)
|
||||
@@ -361,11 +271,11 @@ var/datum/global_hud/global_hud = new()
|
||||
mymob.client.screen -= mymob.internals
|
||||
mymob.client.screen -= lingstingdisplay
|
||||
mymob.client.screen -= lingchemdisplay
|
||||
hidden_inventory_update()
|
||||
persistant_inventory_update()
|
||||
mymob.update_action_buttons()
|
||||
reorganize_alerts()
|
||||
|
||||
hidden_inventory_update()
|
||||
persistant_inventory_update()
|
||||
mymob.update_action_buttons()
|
||||
reorganize_alerts()
|
||||
hud_version = display_hud_version
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
|
||||
@@ -252,7 +252,6 @@
|
||||
mymob.throw_icon.screen_loc = ui_drop_throw
|
||||
hotkeybuttons += mymob.throw_icon
|
||||
|
||||
|
||||
mymob.internals = new /obj/screen/internals()
|
||||
mymob.internals.screen_loc = ui_internal
|
||||
|
||||
@@ -277,40 +276,16 @@
|
||||
lingstingdisplay = new /obj/screen/ling/sting()
|
||||
lingstingdisplay.screen_loc = ui_lingstingdisplay
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.mouse_opacity = 0
|
||||
mymob.blind.layer = 0
|
||||
|
||||
mymob.damageoverlay = new /obj/screen()
|
||||
mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
|
||||
mymob.damageoverlay.name = "dmg"
|
||||
mymob.damageoverlay.blend_mode = BLEND_MULTIPLY
|
||||
mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.damageoverlay.mouse_opacity = 0
|
||||
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
|
||||
|
||||
mymob.flash = new /obj/screen()
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.blend_mode = BLEND_ADD
|
||||
mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.update_icon()
|
||||
|
||||
mymob.client.screen = list()
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
|
||||
mymob.client.screen += adding + hotkeybuttons
|
||||
mymob.client.screen += mymob.client.void
|
||||
inventory_shown = 0;
|
||||
inventory_shown = 0
|
||||
|
||||
|
||||
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
|
||||
|
||||
@@ -114,30 +114,6 @@
|
||||
lingstingdisplay = new /obj/screen/ling/sting()
|
||||
lingstingdisplay.screen_loc = ui_lingstingdisplay
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.damageoverlay = new /obj/screen()
|
||||
mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
|
||||
mymob.damageoverlay.name = "dmg"
|
||||
mymob.damageoverlay.blend_mode = BLEND_MULTIPLY
|
||||
mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.damageoverlay.mouse_opacity = 0
|
||||
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
|
||||
|
||||
mymob.flash = new /obj/screen()
|
||||
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = ui_style
|
||||
mymob.zone_sel.update_icon()
|
||||
@@ -149,6 +125,6 @@
|
||||
using.screen_loc = ui_pull_resist
|
||||
adding += using
|
||||
|
||||
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.pullin, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += adding + other
|
||||
mymob.client.screen += mymob.client.void
|
||||
@@ -27,13 +27,13 @@
|
||||
return
|
||||
|
||||
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
|
||||
var/list/screen_loc_params = text2list(PM["screen-loc"], ",")
|
||||
var/list/screen_loc_params = splittext(PM["screen-loc"], ",")
|
||||
|
||||
//Split X+Pixel_X up into list(X, Pixel_X)
|
||||
var/list/screen_loc_X = text2list(screen_loc_params[1],":")
|
||||
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
|
||||
|
||||
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
|
||||
var/list/screen_loc_Y = text2list(screen_loc_params[2],":")
|
||||
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
|
||||
|
||||
if(snap2grid) //Discard Pixel Values
|
||||
screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]"
|
||||
|
||||
@@ -2,16 +2,7 @@
|
||||
return
|
||||
|
||||
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.client.screen = list()
|
||||
mymob.client.screen += list(mymob.blind)
|
||||
mymob.client.screen += mymob.client.void
|
||||
|
||||
/datum/hud/proc/hoggod_hud(ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
@@ -33,6 +24,5 @@
|
||||
deity_follower_display.screen_loc = ui_deityfollowers
|
||||
deity_follower_display.layer = 20
|
||||
|
||||
mymob.client.screen = null
|
||||
|
||||
mymob.client.screen = list()
|
||||
mymob.client.screen += list(deity_health_display, deity_power_display, deity_follower_display)
|
||||
|
||||
@@ -144,28 +144,13 @@
|
||||
mymob.pullin.update_icon(mymob)
|
||||
mymob.pullin.screen_loc = ui_borg_pull
|
||||
|
||||
mymob.blind = new /obj/screen()
|
||||
mymob.blind.icon = 'icons/mob/screen_full.dmi'
|
||||
mymob.blind.icon_state = "blackimageoverlay"
|
||||
mymob.blind.name = " "
|
||||
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
|
||||
mymob.blind.layer = 0
|
||||
mymob.blind.mouse_opacity = 0
|
||||
|
||||
mymob.flash = new /obj/screen()
|
||||
mymob.flash.icon = 'icons/mob/screen_gen.dmi'
|
||||
mymob.flash.icon_state = "blank"
|
||||
mymob.flash.name = "flash"
|
||||
mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.zone_sel = new /obj/screen/zone_sel()
|
||||
mymob.zone_sel.icon = 'icons/mob/screen_cyborg.dmi'
|
||||
mymob.zone_sel.update_icon()
|
||||
|
||||
mymob.client.screen = list()
|
||||
|
||||
mymob.client.screen += list(mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += list(mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin) //, mymob.rest, mymob.sleep, mymob.mach )
|
||||
mymob.client.screen += adding + other
|
||||
mymob.client.screen += mymob.client.void
|
||||
|
||||
|
||||
@@ -428,10 +428,10 @@ var/datum/subsystem/job/SSjob
|
||||
/datum/subsystem/job/proc/LoadJobs()
|
||||
var/jobstext = return_file_text("config/jobs.txt")
|
||||
for(var/datum/job/J in occupations)
|
||||
var/regex = "[J.title]=(-1|\\d+),(-1|\\d+)"
|
||||
var/datum/regex/results = regex_find(jobstext, regex)
|
||||
J.total_positions = text2num(results.str(2))
|
||||
J.spawn_positions = text2num(results.str(3))
|
||||
var/regex/jobs = new("[J.title]=(-1|\\d+),(-1|\\d+)")
|
||||
jobs.Find(jobstext)
|
||||
J.total_positions = text2num(jobs.group[2])
|
||||
J.spawn_positions = text2num(jobs.group[3])
|
||||
|
||||
/datum/subsystem/job/proc/HandleFeedbackGathering()
|
||||
for(var/datum/job/job in occupations)
|
||||
|
||||
@@ -63,7 +63,7 @@ var/datum/subsystem/timer/SStimer
|
||||
event.thingToCall = thingToCall
|
||||
event.procToCall = procToCall
|
||||
event.timeToRun = world.time + wait
|
||||
event.hash = list2text(args)
|
||||
event.hash = jointext(args, null)
|
||||
if(args.len > 4)
|
||||
event.argList = args.Copy(5)
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ var/list/advance_cures = list(
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
L += S.id
|
||||
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
|
||||
var/result = list2text(L, ":")
|
||||
var/result = jointext(L, ":")
|
||||
id = result
|
||||
return id
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ var/global/datum/getrev/revdata = new()
|
||||
var/list/head_log = file2list(".git/logs/HEAD", "\n")
|
||||
for(var/line=head_log.len, line>=1, line--)
|
||||
if(head_log[line])
|
||||
var/list/last_entry = text2list(head_log[line], " ")
|
||||
var/list/last_entry = splittext(head_log[line], " ")
|
||||
if(last_entry.len < 2)
|
||||
continue
|
||||
revision = last_entry[2]
|
||||
|
||||
@@ -520,7 +520,7 @@
|
||||
else
|
||||
prefix=""
|
||||
|
||||
var/list/words = text2list(message," ")
|
||||
var/list/words = splittext(message," ")
|
||||
var/list/rearranged = list()
|
||||
for(var/i=1;i<=words.len;i++)
|
||||
var/cword = pick(words)
|
||||
@@ -531,7 +531,7 @@
|
||||
suffix = copytext(cword,length(cword)-1,length(cword) )
|
||||
if(length(cword))
|
||||
rearranged += cword
|
||||
message = "[prefix][uppertext(list2text(rearranged," "))]!!"
|
||||
message = "[prefix][uppertext(jointext(rearranged," "))]!!"
|
||||
return message
|
||||
|
||||
/datum/mutation/human/swedish
|
||||
|
||||
@@ -683,7 +683,7 @@ var/list/teleport_other_runes = list()
|
||||
log_game("Talisman Imbue rune failed - no nearby runes")
|
||||
return
|
||||
var/obj/effect/rune/picked_rune = pick(nearby_runes)
|
||||
var/list/split_rune_type = text2list("[picked_rune.type]", "/")
|
||||
var/list/split_rune_type = splittext("[picked_rune.type]", "/")
|
||||
var/imbue_type = split_rune_type[split_rune_type.len]
|
||||
var/talisman_type = text2path("/obj/item/weapon/paper/talisman/[imbue_type]")
|
||||
if(ispath(talisman_type))
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
usr << "<span class='warning'>No input found, please hang up and try your call again!</span>"
|
||||
return
|
||||
|
||||
var/list/tempnetwork = text2list(input, ",")
|
||||
var/list/tempnetwork = splittext(input, ",")
|
||||
if(tempnetwork.len < 1)
|
||||
usr << "<span class='warning'>No network found, please hang up and try your call again!</span>"
|
||||
return
|
||||
|
||||
@@ -157,10 +157,10 @@
|
||||
var/datum/radio_frequency/freq = SSradio.return_frequency(1441)
|
||||
var/list/devices = freq.devices["_default"]
|
||||
for(var/obj/machinery/atmospherics/components/unary/vent_pump/U in devices)
|
||||
var/list/text = text2list(U.id_tag, "_")
|
||||
var/list/text = splittext(U.id_tag, "_")
|
||||
IO |= text[1]
|
||||
for(var/obj/machinery/atmospherics/components/unary/outlet_injector/U in devices)
|
||||
var/list/text = text2list(U.id, "_")
|
||||
var/list/text = splittext(U.id, "_")
|
||||
IO |= text[1]
|
||||
if(!IO.len)
|
||||
user << "<span class='alert'>No machinery detected.</span>"
|
||||
@@ -171,7 +171,7 @@
|
||||
name = "[uppertext(S)] Supply Control"
|
||||
var/list/new_devices = freq.devices["4"]
|
||||
for(var/obj/machinery/air_sensor/U in new_devices)
|
||||
var/list/text = text2list(U.id_tag, "_")
|
||||
var/list/text = splittext(U.id_tag, "_")
|
||||
if(text[1] == S)
|
||||
sensors = list("[S]_sensor" = "Tank")
|
||||
break
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
codes = new()
|
||||
|
||||
var/list/entries = text2list(codes_txt, ";") // entries are separated by semicolons
|
||||
var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons
|
||||
|
||||
for(var/e in entries)
|
||||
var/index = findtext(e, "=") // format is "key=value"
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
build_inventory(contraband, 1)
|
||||
build_inventory(premium, 0, 1)
|
||||
|
||||
slogan_list = text2list(product_slogans, ";")
|
||||
slogan_list = splittext(product_slogans, ";")
|
||||
// So not all machines speak at the exact same time.
|
||||
// The first time this machine says something will be at slogantime + this random value,
|
||||
// so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated.
|
||||
|
||||
@@ -61,8 +61,7 @@
|
||||
return
|
||||
|
||||
if(M == user) //they're using it on themselves
|
||||
if(!M.eye_blind)
|
||||
flick("flash", M.flash)
|
||||
if(M.flash_eyes(visual = 1))
|
||||
M.visible_message("[M] directs [src] to \his eyes.", \
|
||||
"<span class='notice'>You wave the light in front of your eyes! Trippy!</span>")
|
||||
else
|
||||
@@ -80,8 +79,7 @@
|
||||
else if(M.dna.check_mutation(XRAY)) //mob has X-RAY vision
|
||||
user << "<span class='danger'>[M] pupils give an eerie glow!</span>"
|
||||
else //they're okay!
|
||||
if(!M.eye_blind)
|
||||
flick("flash", M.flash) //flash the affected mob
|
||||
if(M.flash_eyes(visual = 1))
|
||||
user << "<span class='notice'>[M]'s pupils narrow.</span>"
|
||||
else
|
||||
return ..()
|
||||
@@ -313,7 +311,7 @@ obj/item/device/flashlight/lamp/bananalamp
|
||||
|
||||
/obj/item/device/flashlight/emp/afterattack(atom/A as mob|obj, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
if(istype(A, /obj/item/weapon/storage/) && A.loc == user)
|
||||
if(istype(A, /obj/item/weapon/storage/) && A.loc == user)
|
||||
return
|
||||
if (emp_cur_charges > 0)
|
||||
emp_cur_charges -= 1
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
var/mob/living/silicon/S = target
|
||||
//20% chance to actually hit the sensors
|
||||
if(prob(effectchance * diode.rating))
|
||||
flick("e_flash", S.flash)
|
||||
S.flash_eyes(affect_silicon = 1)
|
||||
S.Weaken(rand(5,10))
|
||||
S << "<span class='danger'>Your sensors were overloaded by a laser!</span>"
|
||||
outmsg = "<span class='notice'>You overload [S] by shining [src] at their sensors.</span>"
|
||||
|
||||
@@ -384,12 +384,12 @@
|
||||
dat = ""
|
||||
|
||||
/obj/item/toy/crayon/proc/crayon_text_strip(text)
|
||||
var/list/base = text2list(lowertext(text),"")
|
||||
var/list/base = splittext(lowertext(text),"")
|
||||
var/list/out = list()
|
||||
for(var/a in base)
|
||||
if(a in (letters|numerals))
|
||||
out += a
|
||||
return list2text(out)
|
||||
return jointext(out, null)
|
||||
|
||||
/obj/item/toy/crayon/Topic(href, href_list, hsrc)
|
||||
var/temp = "a"
|
||||
|
||||
@@ -84,10 +84,10 @@
|
||||
|
||||
for(var/line in lines)
|
||||
//world << line
|
||||
for(var/beat in text2list(lowertext(line), ","))
|
||||
for(var/beat in splittext(lowertext(line), ","))
|
||||
//world << "beat: [beat]"
|
||||
var/list/notes = text2list(beat, "/")
|
||||
for(var/note in text2list(notes[1], "-"))
|
||||
var/list/notes = splittext(beat, "/")
|
||||
for(var/note in splittext(notes[1], "-"))
|
||||
//world << "note: [note]"
|
||||
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
|
||||
playing = 0
|
||||
@@ -204,7 +204,7 @@
|
||||
|
||||
//split into lines
|
||||
spawn()
|
||||
lines = text2list(t, "\n")
|
||||
lines = splittext(t, "\n")
|
||||
if(copytext(lines[1],1,6) == "BPM: ")
|
||||
tempo = sanitize_tempo(600 / text2num(copytext(lines[1],6)))
|
||||
lines.Cut(1,2)
|
||||
|
||||
@@ -262,7 +262,7 @@ obj/structure/transit_tube/ex_act(severity, target)
|
||||
if(text in direction_table)
|
||||
return direction_table[text]
|
||||
|
||||
var/list/split_text = text2list(text, "-")
|
||||
var/list/split_text = splittext(text, "-")
|
||||
|
||||
// If the first token is D, the icon_state represents
|
||||
// a purely decorative tube, and doesn't actually
|
||||
|
||||
@@ -16,19 +16,19 @@
|
||||
//wrapper for turn that changes the transit tube formatted icon_state instead of the dir
|
||||
/obj/structure/c_transit_tube/proc/tube_turn(angle)
|
||||
var/list/badtubes = list("W-E", "W-E-Pass", "S-N", "S-N-Pass", "SW-NE", "SE-NW")
|
||||
var/list/split_text = text2list(icon_state, "-")
|
||||
var/list/split_text = splittext(icon_state, "-")
|
||||
for(var/i=1; i<=split_text.len; i++)
|
||||
var/curdir = text2dir_extended(split_text[i]) //0 if not a valid direction (e.g. Pass, Block)
|
||||
if(curdir)
|
||||
split_text[i] = dir2text_short(turn(curdir, angle))
|
||||
var/newdir = list2text(split_text, "-")
|
||||
var/newdir = jointext(split_text, "-")
|
||||
if(badtubes.Find(newdir))
|
||||
split_text.Swap(1,2)
|
||||
newdir = list2text(split_text, "-")
|
||||
newdir = jointext(split_text, "-")
|
||||
icon_state = newdir
|
||||
|
||||
/obj/structure/c_transit_tube/proc/tube_flip()
|
||||
var/list/split_text = text2list(icon_state, "-")
|
||||
var/list/split_text = splittext(icon_state, "-")
|
||||
//skip straight pipes
|
||||
if(length(split_text[2]) < 2)
|
||||
return
|
||||
@@ -44,7 +44,7 @@
|
||||
split_text[2] = copytext(split_text[2],1,2) + ((copytext(split_text[2],2,3) == "E") ? "W" : "E")
|
||||
else
|
||||
split_text[2] = ((copytext(split_text[2],1,2) == "N") ? "S" : "N") + copytext(split_text[2],2,3)
|
||||
icon_state = list2text(split_text, "-")
|
||||
icon_state = jointext(split_text, "-")
|
||||
|
||||
// disposals-style flip and rotate verbs
|
||||
/obj/structure/c_transit_tube/verb/rotate()
|
||||
|
||||
@@ -177,7 +177,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums
|
||||
continue
|
||||
|
||||
//Split the line at every "="
|
||||
var/list/List = text2list(line, "=")
|
||||
var/list/List = splittext(line, "=")
|
||||
if(!List.len)
|
||||
continue
|
||||
|
||||
|
||||
@@ -596,7 +596,7 @@ var/list/admin_verbs_hideable = list(
|
||||
//load text from file
|
||||
var/list/Lines = file2list("config/admins.txt")
|
||||
for(var/line in Lines)
|
||||
var/list/splitline = text2list(line, " = ")
|
||||
var/list/splitline = splittext(line, " = ")
|
||||
if(ckey(splitline[1]) == ckey)
|
||||
if(splitline.len >= 2)
|
||||
rank = ckeyEx(splitline[2])
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/admins/proc/create_mob(mob/user)
|
||||
if (!create_mob_html)
|
||||
var/mobjs = null
|
||||
mobjs = list2text(typesof(/mob), ";")
|
||||
mobjs = jointext(typesof(/mob), ";")
|
||||
create_mob_html = file2text('html/create_object.html')
|
||||
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ var/list/create_object_forms = list(
|
||||
/datum/admins/proc/create_object(mob/user)
|
||||
if (!create_object_html)
|
||||
var/objectjs = null
|
||||
objectjs = list2text(typesof(/obj), ";")
|
||||
objectjs = jointext(typesof(/obj), ";")
|
||||
create_object_html = file2text('html/create_object.html')
|
||||
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
|
||||
|
||||
@@ -19,7 +19,7 @@ var/list/create_object_forms = list(
|
||||
var/html_form = create_object_forms[path]
|
||||
|
||||
if (!html_form)
|
||||
var/objectjs = list2text(typesof(path), ";")
|
||||
var/objectjs = jointext(typesof(path), ";")
|
||||
html_form = file2text('html/create_object.html')
|
||||
html_form = replacetext(html_form, "null /* object types */", "\"[objectjs]\"")
|
||||
create_object_forms[path] = html_form
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/datum/admins/proc/create_turf(mob/user)
|
||||
if (!create_turf_html)
|
||||
var/turfjs = null
|
||||
turfjs = list2text(typesof(/turf), ";")
|
||||
turfjs = jointext(typesof(/turf), ";")
|
||||
create_turf_html = file2text('html/create_object.html')
|
||||
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
|
||||
|
||||
|
||||
@@ -169,9 +169,6 @@
|
||||
output += ruler
|
||||
usr << browse(output, "window=show_notes;size=900x500")
|
||||
|
||||
/proc/regex_note_sql_extract(str, exp)
|
||||
return new /datum/regex(str, exp, call(LIBREGEX_LIBRARY, "regEx_find")(str, exp))
|
||||
|
||||
#define NOTESFILE "data/player_notes.sav"
|
||||
//if the AUTOCONVERT_NOTES is turned on, anytime a player connects this will be run to try and add all their notes to the databas
|
||||
/proc/convert_notes_sql(ckey)
|
||||
@@ -184,13 +181,13 @@
|
||||
var/notetext
|
||||
notesfile >> notetext
|
||||
var/server
|
||||
if (config && config.server_name)
|
||||
if(config && config.server_name)
|
||||
server = config.server_name
|
||||
var/regex = "^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$"
|
||||
var/datum/regex/results = regex_note_sql_extract(notetext, regex)
|
||||
var/timestamp = results.str(2)
|
||||
notetext = results.str(3)
|
||||
var/adminckey = results.str(4)
|
||||
var/regex/note = new("^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$", "i")
|
||||
note.Find(notetext)
|
||||
var/timestamp = note.group[2]
|
||||
notetext = note.group[3]
|
||||
var/adminckey = note.group[4]
|
||||
var/DBQuery/query_convert_time = dbcon.NewQuery("SELECT ADDTIME(STR_TO_DATE('[timestamp]','%d-%b-%Y'), '0')")
|
||||
if(!query_convert_time.Execute())
|
||||
var/err = query_convert_time.ErrorMsg()
|
||||
@@ -217,4 +214,4 @@ this proc can take several minutes to execute fully if converting and cause DD t
|
||||
world << "Deleting NOTESFILE"
|
||||
fdel(NOTESFILE)
|
||||
world << "Finished mass note conversion, remember to turn off AUTOCONVERT_NOTES"*/
|
||||
#undef NOTESFILE
|
||||
#undef NOTESFILE
|
||||
@@ -175,10 +175,10 @@
|
||||
if (!ban)
|
||||
return null
|
||||
. = params2list(ban)
|
||||
.["keys"] = text2list(.["keys"], ",")
|
||||
.["type"] = text2list(.["type"], ",")
|
||||
.["IP"] = text2list(.["IP"], ",")
|
||||
.["computer_id"] = text2list(.["computer_id"], ",")
|
||||
.["keys"] = splittext(.["keys"], ",")
|
||||
.["type"] = splittext(.["type"], ",")
|
||||
.["IP"] = splittext(.["IP"], ",")
|
||||
.["computer_id"] = splittext(.["computer_id"], ",")
|
||||
|
||||
|
||||
/proc/list2stickyban(var/list/ban)
|
||||
@@ -186,13 +186,13 @@
|
||||
return null
|
||||
. = ban.Copy()
|
||||
if (.["keys"])
|
||||
.["keys"] = list2text(.["keys"], ",")
|
||||
.["keys"] = jointext(.["keys"], ",")
|
||||
if (.["type"])
|
||||
.["type"] = list2text(.["type"], ",")
|
||||
.["type"] = jointext(.["type"], ",")
|
||||
if (.["IP"])
|
||||
.["IP"] = list2text(.["IP"], ",")
|
||||
.["IP"] = jointext(.["IP"], ",")
|
||||
if (.["computer_id"])
|
||||
.["computer_id"] = list2text(.["computer_id"], ",")
|
||||
.["computer_id"] = jointext(.["computer_id"], ",")
|
||||
. = list2params(.)
|
||||
|
||||
|
||||
|
||||
@@ -1882,7 +1882,7 @@
|
||||
alert("Select fewer object types, (max 5)")
|
||||
return
|
||||
|
||||
var/list/offset = text2list(href_list["offset"],",")
|
||||
var/list/offset = splittext(href_list["offset"],",")
|
||||
var/number = Clamp(text2num(href_list["object_count"]), 1, 100)
|
||||
var/X = offset.len > 0 ? text2num(offset[1]) : 0
|
||||
var/Y = offset.len > 1 ? text2num(offset[2]) : 0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
|
||||
|
||||
//explode the input msg into a list
|
||||
var/list/msglist = text2list(msg, " ")
|
||||
var/list/msglist = splittext(msg, " ")
|
||||
|
||||
//generate keywords lookup
|
||||
var/list/surnames = list()
|
||||
@@ -16,7 +16,7 @@
|
||||
indexing += M.mind.name
|
||||
|
||||
for(var/string in indexing)
|
||||
var/list/L = text2list(string, " ")
|
||||
var/list/L = splittext(string, " ")
|
||||
var/surname_found = 0
|
||||
//surnames
|
||||
for(var/i=L.len, i>=1, i--)
|
||||
|
||||
@@ -688,19 +688,19 @@ var/global/list/g_fancy_list_of_types = null
|
||||
|
||||
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
|
||||
if("Players")
|
||||
usr << list2text(player_list,",")
|
||||
usr << jointext(player_list,",")
|
||||
if("Admins")
|
||||
usr << list2text(admins,",")
|
||||
usr << jointext(admins,",")
|
||||
if("Mobs")
|
||||
usr << list2text(mob_list,",")
|
||||
usr << jointext(mob_list,",")
|
||||
if("Living Mobs")
|
||||
usr << list2text(living_mob_list,",")
|
||||
usr << jointext(living_mob_list,",")
|
||||
if("Dead Mobs")
|
||||
usr << list2text(dead_mob_list,",")
|
||||
usr << jointext(dead_mob_list,",")
|
||||
if("Clients")
|
||||
usr << list2text(clients,",")
|
||||
usr << jointext(clients,",")
|
||||
if("Joined Clients")
|
||||
usr << list2text(joined_player_list,",")
|
||||
usr << jointext(joined_player_list,",")
|
||||
|
||||
/client/proc/cmd_display_del_log()
|
||||
set category = "Debug"
|
||||
|
||||
@@ -151,7 +151,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
var/variables_start = findtext(full_def,"{")
|
||||
if(variables_start)//if there's any variable
|
||||
full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
|
||||
fields = text2list(full_def,";")
|
||||
fields = readlist(full_def, ";")
|
||||
|
||||
//then fill the members_attributes list with the corresponding variables
|
||||
members_attributes.len++
|
||||
@@ -258,7 +258,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
|
||||
//build a list from variables in text form (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
|
||||
//return the filled list
|
||||
/dmm_suite/proc/text2list(text as text,delimiter=",")
|
||||
/dmm_suite/proc/readlist(text as text, delimiter=",")
|
||||
|
||||
var/list/to_return = list()
|
||||
|
||||
@@ -292,7 +292,7 @@ var/global/dmm_suite/preloader/_preloader = null
|
||||
|
||||
//Check for list
|
||||
else if(copytext(trim_right,1,5) == "list")
|
||||
trim_right = text2list(copytext(trim_right,6,length(trim_right)))
|
||||
trim_right = readlist(copytext(trim_right,6,length(trim_right)))
|
||||
|
||||
//Check for file
|
||||
else if(copytext(trim_right,1,2) == "'")
|
||||
|
||||
@@ -201,12 +201,12 @@ var/next_external_rsc = 0
|
||||
else
|
||||
winset(src, "infowindow.changelog", "font-style=bold")
|
||||
|
||||
if (ckey in clientmessages)
|
||||
for (var/message in clientmessages[ckey])
|
||||
if(ckey in clientmessages)
|
||||
for(var/message in clientmessages[ckey])
|
||||
src << message
|
||||
clientmessages.Remove(ckey)
|
||||
|
||||
if (config && config.autoconvert_notes)
|
||||
if(config && config.autoconvert_notes)
|
||||
convert_notes_sql(ckey)
|
||||
|
||||
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/obj/item/weapon/paper/P = new(get_turf(src))
|
||||
P.name = "paper- 'Scanner Report'"
|
||||
P.info = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>"
|
||||
P.info += list2text(log, "<BR>")
|
||||
P.info += jointext(log, "<BR>")
|
||||
P.info += "<HR><B>Notes:</B><BR>"
|
||||
P.info_links = P.info
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/proc/NewStutter(phrase,stunned)
|
||||
phrase = html_decode(phrase)
|
||||
|
||||
var/list/split_phrase = text2list(phrase," ") //Split it up into words.
|
||||
var/list/split_phrase = splittext(phrase," ") //Split it up into words.
|
||||
|
||||
var/list/unstuttered_words = split_phrase.Copy()
|
||||
var/i = rand(1,3)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
split_phrase[index] = word
|
||||
|
||||
return sanitize(list2text(split_phrase," "))
|
||||
return sanitize(jointext(split_phrase," "))
|
||||
|
||||
/proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness.
|
||||
step(M, pick(d,turn(d,90),turn(d,-90)))
|
||||
@@ -45,7 +45,7 @@
|
||||
if(chance >= 100) return original_msg
|
||||
|
||||
var/list
|
||||
words = text2list(original_msg," ")
|
||||
words = splittext(original_msg," ")
|
||||
new_words = list()
|
||||
|
||||
var/new_msg = ""
|
||||
@@ -57,6 +57,6 @@
|
||||
continue
|
||||
new_words += w
|
||||
|
||||
new_msg = list2text(new_words," ")
|
||||
new_msg = jointext(new_words," ")
|
||||
|
||||
return new_msg
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
if(!src.req_access)
|
||||
src.req_access = list()
|
||||
if(src.req_access_txt)
|
||||
var/list/req_access_str = text2list(req_access_txt,";")
|
||||
var/list/req_access_str = splittext(req_access_txt,";")
|
||||
for(var/x in req_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
@@ -133,7 +133,7 @@
|
||||
if(!src.req_one_access)
|
||||
src.req_one_access = list()
|
||||
if(src.req_one_access_txt)
|
||||
var/list/req_one_access_str = text2list(req_one_access_txt,";")
|
||||
var/list/req_one_access_str = splittext(req_one_access_txt,";")
|
||||
for(var/x in req_one_access_str)
|
||||
var/n = text2num(x)
|
||||
if(n)
|
||||
|
||||
@@ -1,284 +0,0 @@
|
||||
/* Usage:
|
||||
JSON.stringify(obj) - Converts lists and values into a JSON string.
|
||||
JSON.parse(json) - Converts a JSON string into lists and values.
|
||||
*/
|
||||
|
||||
/var/datum/jsonHelper/JSON = new // A namespace for procs.
|
||||
|
||||
// ************************************ WRITER ************************************
|
||||
/datum/jsonHelper/proc/stringify(value)
|
||||
return list2text(WriteValue(list(), value))
|
||||
|
||||
/datum/jsonHelper/proc/WriteValue(list/json, value)
|
||||
. = json
|
||||
if(isnum(value))
|
||||
json += value // Consider num2text(value, 20) for maximum accuracy.
|
||||
else if(isnull(value))
|
||||
json += "null"
|
||||
else if(istext(value))
|
||||
WriteString(json, value)
|
||||
else if(istype(value, /list))
|
||||
WriteList(json, value)
|
||||
else
|
||||
throw EXCEPTION("Datums cannot be converted to JSON.")
|
||||
|
||||
/datum/jsonHelper/proc/WriteString(list/json, str)
|
||||
. = json
|
||||
var/quotePos = findtextEx(str, "\"")
|
||||
var/bsPos = findtextEx(str, "\\")
|
||||
if (quotePos == 0 && bsPos == 0)
|
||||
json.Add("\"", str, "\"")
|
||||
else
|
||||
json += "\""
|
||||
var/lastStop = 1
|
||||
while(quotePos != 0 || bsPos != 0)
|
||||
var/escPos
|
||||
if(quotePos < bsPos && quotePos != 0 || bsPos == 0)
|
||||
escPos = quotePos
|
||||
else
|
||||
escPos = bsPos
|
||||
json.Add(copytext(str, lastStop, escPos), "\\")
|
||||
lastStop = escPos
|
||||
if(escPos == quotePos)
|
||||
quotePos = findtextEx(str, "\"", escPos + 1)
|
||||
else if(escPos == bsPos)
|
||||
bsPos = findtextEx(str, "\\", escPos + 1)
|
||||
json.Add(copytext(str, lastStop), "\"")
|
||||
|
||||
/datum/jsonHelper/proc/WriteList(list/json, list/listVal)
|
||||
. = json
|
||||
#define Either 0
|
||||
#define CannotBeArray 1
|
||||
#define CannotBeObject 2
|
||||
#define BadList (CannotBeArray | CannotBeObject)
|
||||
var/listType = Either
|
||||
for(var/key in listVal)
|
||||
if(istext(key))
|
||||
if(!isnull(listVal[key]))
|
||||
listType |= CannotBeArray
|
||||
else
|
||||
if(!isnum(key) && !isnull(listVal[key]))
|
||||
listType = BadList
|
||||
else
|
||||
listType |= CannotBeObject
|
||||
|
||||
if(listType == BadList)
|
||||
throw EXCEPTION("The given list cannot be converted to JSON.")
|
||||
|
||||
if(listType == CannotBeArray)
|
||||
json += "{"
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
WriteString(json, key)
|
||||
json += ":"
|
||||
WriteValue(json, listVal[key])
|
||||
json += "}"
|
||||
else
|
||||
json += "\["
|
||||
var/addComma
|
||||
for(var/key in listVal)
|
||||
if(addComma)
|
||||
json += ","
|
||||
else
|
||||
addComma = TRUE
|
||||
WriteValue(json, key)
|
||||
json += "]"
|
||||
#undef Either
|
||||
#undef CannotBeFlat
|
||||
#undef CannotBeAssoc
|
||||
#undef BadList
|
||||
|
||||
// ************************************ READER ************************************
|
||||
#define aBackspace 0x08
|
||||
#define aTab 0x09
|
||||
#define aLineBreak 0x0A
|
||||
#define aVertTab 0x0B
|
||||
#define aFormFeed 0x0C
|
||||
#define aCarriageReturn 0x0D
|
||||
#define aSpace 0x20
|
||||
#define aZero 0x30
|
||||
#define aNonBreakSpace 0xA0
|
||||
|
||||
#define Advance if(++readPos > jsonLen) { curAscii = 0; curChar = "" } else { curAscii = text2ascii(json, readPos); curChar = ascii2text(curAscii) } // Deal with it.
|
||||
#define SkipWhitespace while(curAscii in whitespace) Advance
|
||||
#define AdvanceWS Advance; SkipWhitespace
|
||||
|
||||
/datum/jsonHelper/var
|
||||
readPos
|
||||
jsonLen
|
||||
json
|
||||
curAscii
|
||||
curChar
|
||||
static/list/whitespace = list(aTab, aLineBreak, aVertTab, aFormFeed, aCarriageReturn, aSpace, aNonBreakSpace)
|
||||
|
||||
/datum/jsonHelper/proc/parse(json)
|
||||
readPos = 0
|
||||
jsonLen = length(json)
|
||||
src.json = json
|
||||
curAscii = 0
|
||||
curChar = ""
|
||||
AdvanceWS
|
||||
var/value = ParseValue()
|
||||
if(readPos < jsonLen)
|
||||
throw EXCEPTION("Expected: End of JSON")
|
||||
return value
|
||||
|
||||
/datum/jsonHelper/proc/ParseValue()
|
||||
if(curChar == "\"")
|
||||
return ParseString()
|
||||
else if(curChar == "-" || (curAscii >= aZero && curAscii <= aZero + 9))
|
||||
return ParseNumber()
|
||||
else if(curChar == "{")
|
||||
return ParseObject()
|
||||
else if(curChar == "\[")
|
||||
return ParseArray()
|
||||
else if(curChar == "t")
|
||||
if(copytext(json, readPos, readPos+4) == "true")
|
||||
readPos += 3
|
||||
AdvanceWS
|
||||
return TRUE
|
||||
else
|
||||
throw EXCEPTION("Expected: 'true'")
|
||||
else if(curChar == "f")
|
||||
if(copytext(json, readPos, readPos+5) == "false")
|
||||
readPos += 4
|
||||
AdvanceWS
|
||||
return FALSE
|
||||
else
|
||||
throw EXCEPTION("Expected: 'false'")
|
||||
else if(curChar == "n")
|
||||
if(copytext(json, readPos, readPos+4) == "null")
|
||||
readPos += 3
|
||||
AdvanceWS
|
||||
return null
|
||||
else
|
||||
throw EXCEPTION("Expected: 'null'")
|
||||
else if(curChar == "")
|
||||
throw EXCEPTION("Unexpected: End of JSON")
|
||||
else
|
||||
throw EXCEPTION("Unexpected: '[curChar]'")
|
||||
|
||||
|
||||
|
||||
/datum/jsonHelper/proc/ParseString()
|
||||
ASSERT(curChar == "\"")
|
||||
Advance
|
||||
var/list/chars = list()
|
||||
while(readPos <= jsonLen)
|
||||
if(curChar == "\"")
|
||||
AdvanceWS
|
||||
return list2text(chars)
|
||||
else if(curChar == "\\")
|
||||
Advance
|
||||
switch(curChar)
|
||||
if("\"", "\\", "/")
|
||||
chars += ascii2text(curAscii)
|
||||
if("b")
|
||||
chars += ascii2text(aBackspace)
|
||||
if("f")
|
||||
chars += ascii2text(aFormFeed)
|
||||
if("n")
|
||||
chars += "\n"
|
||||
if("r")
|
||||
chars += ascii2text(aCarriageReturn) // Should we ignore these?
|
||||
if("t")
|
||||
chars += "\t"
|
||||
if("u")
|
||||
throw EXCEPTION("JSON \\uXXXX escape sequence not supported")
|
||||
else
|
||||
throw EXCEPTION("Invalid escape sequence")
|
||||
Advance
|
||||
else
|
||||
chars += ascii2text(curAscii)
|
||||
Advance
|
||||
throw EXCEPTION("Unterminated string")
|
||||
|
||||
/datum/jsonHelper/proc/ParseNumber()
|
||||
var/firstPos = readPos
|
||||
if(curChar == "-")
|
||||
Advance
|
||||
if(curAscii >= aZero + 1 && curAscii <= aZero + 9)
|
||||
do
|
||||
Advance
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
else if(curAscii == aZero)
|
||||
Advance
|
||||
else
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
if(curChar == ".")
|
||||
Advance
|
||||
var/found = FALSE
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
found = TRUE
|
||||
Advance
|
||||
if(!found)
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
if(curChar == "E" || curChar == "e")
|
||||
Advance
|
||||
var/found = FALSE
|
||||
if(curChar == "-")
|
||||
Advance
|
||||
else if(curChar == "+")
|
||||
Advance
|
||||
while(curAscii >= aZero && curAscii <= aZero + 9)
|
||||
found = TRUE
|
||||
Advance
|
||||
if(!found)
|
||||
throw EXCEPTION("Expected: digit")
|
||||
|
||||
SkipWhitespace
|
||||
return text2num(copytext(json, firstPos, readPos))
|
||||
|
||||
/datum/jsonHelper/proc/ParseObject()
|
||||
ASSERT(curChar == "{")
|
||||
var/list/object = list()
|
||||
AdvanceWS
|
||||
while(curChar == "\"")
|
||||
var/key = ParseString()
|
||||
if(curChar != ":")
|
||||
throw EXCEPTION("Expected: ':'")
|
||||
AdvanceWS
|
||||
object[key] = ParseValue()
|
||||
if(curChar == ",")
|
||||
AdvanceWS
|
||||
else
|
||||
break
|
||||
if(curChar != "}")
|
||||
throw EXCEPTION("Expected: string or '}'")
|
||||
AdvanceWS
|
||||
return object
|
||||
|
||||
/datum/jsonHelper/proc/ParseArray()
|
||||
ASSERT(curChar == "\[")
|
||||
var/list/array = list()
|
||||
AdvanceWS
|
||||
while(curChar != "]")
|
||||
array += list(ParseValue()) // Wrapped in a list in case ParseValue() returns a list.
|
||||
if(curChar == ",")
|
||||
AdvanceWS
|
||||
else
|
||||
break
|
||||
if(curChar != "]")
|
||||
throw EXCEPTION("Expected: ']'")
|
||||
AdvanceWS
|
||||
return array
|
||||
|
||||
#undef aBackspace
|
||||
#undef aTab
|
||||
#undef aLineBreak
|
||||
#undef aVertTab
|
||||
#undef aFormFeed
|
||||
#undef aCarriageReturn
|
||||
#undef aSpace
|
||||
#undef aZero
|
||||
#undef aNonBreakSpace
|
||||
|
||||
#undef Advance
|
||||
#undef SkipWhitespace
|
||||
#undef AdvanceWS
|
||||
@@ -9,8 +9,6 @@
|
||||
playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
|
||||
visible_message("<span class='name'>[src]</span> lets out a waning guttural screech, green blood bubbling from its maw...")
|
||||
update_canmove()
|
||||
if(client)
|
||||
blind.layer = 0
|
||||
update_icons()
|
||||
status_flags |=CANPUSH
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
if(!gibbed)
|
||||
visible_message("<span class='name'>[src]</span> lets out a waning high-pitched cry.")
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
if(mind)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
container.icon_state = "mmi_dead"
|
||||
stat = DEAD
|
||||
|
||||
if(blind) blind.layer = 0
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -169,9 +169,11 @@
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
|
||||
var/damage = intensity - check_eye_prot()
|
||||
if(..()) // we've been flashed
|
||||
if(visual)
|
||||
return
|
||||
if(weakeyes)
|
||||
Stun(2)
|
||||
switch(damage)
|
||||
@@ -202,7 +204,6 @@
|
||||
else
|
||||
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
return 1
|
||||
|
||||
else if(damage == 0) // just enough protection
|
||||
if(prob(20))
|
||||
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
emote("deathgasp") //let the world KNOW WE ARE DEAD
|
||||
|
||||
update_canmove()
|
||||
if(client) blind.layer = 0
|
||||
|
||||
dna.species.spec_death(gibbed,src)
|
||||
dna.species.spec_death(gibbed, src)
|
||||
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
if(mind)
|
||||
|
||||
@@ -263,7 +263,6 @@
|
||||
dna.species.handle_chemicals_in_body(src)
|
||||
|
||||
/mob/living/carbon/human/handle_vision()
|
||||
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
|
||||
if(machine)
|
||||
if(!machine.check_eye(src))
|
||||
reset_view(null)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
message = dna.species.handle_speech(message,src)
|
||||
if(viruses.len)
|
||||
for(var/datum/disease/pierrot_throat/D in viruses)
|
||||
var/list/temp_message = text2list(message, " ") //List each word in the message
|
||||
var/list/temp_message = splittext(message, " ") //List each word in the message
|
||||
var/list/pick_list = list()
|
||||
for(var/i = 1, i <= temp_message.len, i++) //Create a second list for excluding words down the line
|
||||
pick_list += i
|
||||
@@ -22,7 +22,7 @@
|
||||
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
|
||||
temp_message[H] = "HONK"
|
||||
pick_list -= H //Make sure that you dont HONK the same word twice
|
||||
message = list2text(temp_message, " ")
|
||||
message = jointext(temp_message, " ")
|
||||
message = ..(message)
|
||||
message = dna.mutations_say_mods(message)
|
||||
return message
|
||||
|
||||
@@ -668,78 +668,86 @@
|
||||
return
|
||||
|
||||
/datum/species/proc/handle_vision(mob/living/carbon/human/H)
|
||||
if( H.stat == DEAD )
|
||||
if(H.stat == DEAD)
|
||||
H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
||||
H.see_in_dark = 8
|
||||
if(!H.druggy)
|
||||
H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
return
|
||||
|
||||
if(!(SEE_TURFS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_TURFS
|
||||
if(!(SEE_MOBS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_MOBS
|
||||
if(!(SEE_OBJS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_OBJS
|
||||
|
||||
if(H.remote_view)
|
||||
H.sight |= SEE_TURFS
|
||||
H.sight |= SEE_MOBS
|
||||
H.sight |= SEE_OBJS
|
||||
|
||||
H.see_in_dark = (H.sight == SEE_TURFS|SEE_MOBS|SEE_OBJS) ? 8 : darksight
|
||||
var/see_temp = H.see_invisible
|
||||
H.see_invisible = invis_sight
|
||||
|
||||
if(H.glasses)
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses))
|
||||
var/obj/item/clothing/glasses/G = H.glasses
|
||||
H.sight |= G.vision_flags
|
||||
H.see_in_dark = G.darkness_view
|
||||
if(G.invis_override)
|
||||
H.see_invisible = G.invis_override
|
||||
else
|
||||
H.see_invisible = min(G.invis_view, H.see_invisible)
|
||||
if(H.druggy) //Override for druggy
|
||||
H.see_invisible = see_temp
|
||||
|
||||
if(H.see_override) //Override all
|
||||
H.see_invisible = H.see_override
|
||||
|
||||
// This checks how much the mob's eyewear impairs their vision
|
||||
if(H.tinttotal >= TINT_IMPAIR)
|
||||
if(tinted_weldhelh)
|
||||
H.overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2)
|
||||
if(H.tinttotal >= TINT_BLIND)
|
||||
H.eye_blind = max(H.eye_blind, 1)
|
||||
else
|
||||
if(!(SEE_TURFS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_TURFS
|
||||
if(!(SEE_MOBS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_MOBS
|
||||
if(!(SEE_OBJS & H.permanent_sight_flags))
|
||||
H.sight &= ~SEE_OBJS
|
||||
H.clear_fullscreen("tint")
|
||||
|
||||
if(H.remote_view)
|
||||
H.sight |= SEE_TURFS
|
||||
H.sight |= SEE_MOBS
|
||||
H.sight |= SEE_OBJS
|
||||
if(H.eye_stat > 30)
|
||||
H.overlay_fullscreen("impaired", /obj/screen/fullscreen/impaired, 2)
|
||||
else if(H.eye_stat > 20)
|
||||
H.overlay_fullscreen("impaired", /obj/screen/fullscreen/impaired, 1)
|
||||
else
|
||||
H.clear_fullscreen("impaired")
|
||||
|
||||
H.see_in_dark = (H.sight == SEE_TURFS|SEE_MOBS|SEE_OBJS) ? 8 : darksight
|
||||
var/see_temp = H.see_invisible
|
||||
H.see_invisible = invis_sight
|
||||
if(!H.client)//no client, no screen to update
|
||||
return 1
|
||||
|
||||
if(H.glasses)
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses))
|
||||
var/obj/item/clothing/glasses/G = H.glasses
|
||||
H.sight |= G.vision_flags
|
||||
H.see_in_dark = G.darkness_view
|
||||
if(G.invis_override)
|
||||
H.see_invisible = G.invis_override
|
||||
else
|
||||
H.see_invisible = min(G.invis_view, H.see_invisible)
|
||||
if(H.druggy) //Override for druggy
|
||||
H.see_invisible = see_temp
|
||||
if(H.eye_blind)
|
||||
H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
||||
H.throw_alert("blind", /obj/screen/alert/blind)
|
||||
else
|
||||
H.clear_fullscreen("blind")
|
||||
H.clear_alert("blind")
|
||||
|
||||
if(H.see_override) //Override all
|
||||
H.see_invisible = H.see_override
|
||||
if(H.disabilities & NEARSIGHT && !istype(H.glasses, /obj/item/clothing/glasses/regular))
|
||||
H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
|
||||
else
|
||||
H.clear_fullscreen("nearsighted")
|
||||
|
||||
// This checks how much the mob's eyewear impairs their vision
|
||||
if(H.tinttotal >= TINT_IMPAIR)
|
||||
if(tinted_weldhelh)
|
||||
if(H.tinttotal >= TINT_BLIND)
|
||||
H.eye_blind = max(H.eye_blind, 1)
|
||||
if(H.client)
|
||||
H.client.screen += global_hud.darkMask
|
||||
if(H.eye_blurry)
|
||||
H.overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
|
||||
else
|
||||
H.clear_fullscreen("blurry")
|
||||
|
||||
if(H.blind)
|
||||
if(H.eye_blind)
|
||||
H.throw_alert("blind", /obj/screen/alert/blind)
|
||||
H.blind.layer = 18
|
||||
else
|
||||
H.clear_alert("blind")
|
||||
H.blind.layer = 0
|
||||
|
||||
if(!H.client)//no client, no screen to update
|
||||
return 1
|
||||
|
||||
if( H.disabilities & NEARSIGHT && !istype(H.glasses, /obj/item/clothing/glasses/regular) )
|
||||
H.client.screen += global_hud.vimpaired
|
||||
if(H.eye_blurry)
|
||||
H.client.screen += global_hud.blurry
|
||||
if(H.druggy)
|
||||
H.client.screen += global_hud.druggy
|
||||
H.throw_alert("high", /obj/screen/alert/high)
|
||||
else
|
||||
H.clear_alert("high")
|
||||
|
||||
|
||||
if(H.eye_stat > 20)
|
||||
if(H.eye_stat > 30)
|
||||
H.client.screen += global_hud.darkMask
|
||||
else
|
||||
H.client.screen += global_hud.vimpaired
|
||||
if(H.druggy)
|
||||
H.overlay_fullscreen("high", /obj/screen/fullscreen/high)
|
||||
H.throw_alert("high", /obj/screen/alert/high)
|
||||
else
|
||||
H.clear_fullscreen("high")
|
||||
H.clear_alert("high")
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -74,14 +74,12 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
|
||||
return randname
|
||||
|
||||
var/regex/lizard_hiss = new("s+", "g")
|
||||
var/regex/lizard_hiSS = new("S+", "g")
|
||||
/datum/species/lizard/handle_speech(message)
|
||||
|
||||
if(copytext(message, 1, 2) != "*")
|
||||
message = regEx_replaceall(message, "(?<!s)s(?!s)", "sss") //(?<!s) Not s before. (?!s) not s after. That way it only triples a single s instead of double ss.
|
||||
message = regEx_replaceall(message, "(?<!s)ss(?!s)", "ssss")
|
||||
message = regEx_replaceall(message, "(?<!S)S(?!S)", "SSS")
|
||||
message = regEx_replaceall(message, "(?<!S)SS(?!S)", "SSSS")
|
||||
|
||||
message = lizard_hiss.Replace(message, "sss")
|
||||
message = lizard_hiSS.Replace(message, "SSS")
|
||||
return message
|
||||
|
||||
//I wag in death
|
||||
@@ -415,7 +413,7 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
specflags = list(NOBREATH,HEATRES,COLDRES,NOBLOOD,RADIMMUNE)
|
||||
|
||||
/datum/species/zombie/handle_speech(message)
|
||||
var/list/message_list = text2list(message, " ")
|
||||
var/list/message_list = splittext(message, " ")
|
||||
var/maxchanges = max(round(message_list.len / 1.5), 2)
|
||||
|
||||
for(var/i = rand(maxchanges / 2, maxchanges), i > 0, i--)
|
||||
@@ -428,7 +426,7 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
if(prob(20) && message_list.len > 3)
|
||||
message_list.Insert(insertpos, "[pick("BRAINS", "Brains", "Braaaiinnnsss", "BRAAAIIINNSSS")]...")
|
||||
|
||||
return list2text(message_list, " ")
|
||||
return jointext(message_list, " ")
|
||||
|
||||
/datum/species/cosmetic_zombie
|
||||
name = "Human"
|
||||
|
||||
@@ -403,84 +403,53 @@
|
||||
if(!client)
|
||||
return 0
|
||||
|
||||
if(damageoverlay)
|
||||
if(damageoverlay.overlays)
|
||||
damageoverlay.overlays = list()
|
||||
|
||||
if(stat == UNCONSCIOUS)
|
||||
//Critical damage passage overlay
|
||||
if(health <= config.health_threshold_crit)
|
||||
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "passage0")
|
||||
I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY
|
||||
switch(health)
|
||||
if(-20 to -10)
|
||||
I.icon_state = "passage1"
|
||||
if(-30 to -20)
|
||||
I.icon_state = "passage2"
|
||||
if(-40 to -30)
|
||||
I.icon_state = "passage3"
|
||||
if(-50 to -40)
|
||||
I.icon_state = "passage4"
|
||||
if(-60 to -50)
|
||||
I.icon_state = "passage5"
|
||||
if(-70 to -60)
|
||||
I.icon_state = "passage6"
|
||||
if(-80 to -70)
|
||||
I.icon_state = "passage7"
|
||||
if(-90 to -80)
|
||||
I.icon_state = "passage8"
|
||||
if(-95 to -90)
|
||||
I.icon_state = "passage9"
|
||||
if(-INFINITY to -95)
|
||||
I.icon_state = "passage10"
|
||||
damageoverlay.overlays += I
|
||||
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
|
||||
var/severity = 0
|
||||
switch(health)
|
||||
if(-20 to -10) severity = 1
|
||||
if(-30 to -20) severity = 2
|
||||
if(-40 to -30) severity = 3
|
||||
if(-50 to -40) severity = 4
|
||||
if(-60 to -50) severity = 5
|
||||
if(-70 to -60) severity = 6
|
||||
if(-80 to -70) severity = 7
|
||||
if(-90 to -80) severity = 8
|
||||
if(-95 to -90) severity = 9
|
||||
if(-INFINITY to -95) severity = 10
|
||||
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
|
||||
else
|
||||
clear_fullscreen("crit")
|
||||
if(oxyloss)
|
||||
var/severity = 0
|
||||
switch(oxyloss)
|
||||
if(10 to 20) severity = 1
|
||||
if(20 to 25) severity = 2
|
||||
if(25 to 30) severity = 3
|
||||
if(30 to 35) severity = 4
|
||||
if(35 to 40) severity = 5
|
||||
if(40 to 45) severity = 6
|
||||
if(45 to INFINITY) severity = 7
|
||||
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
|
||||
else
|
||||
//Oxygen damage overlay
|
||||
if(oxyloss)
|
||||
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "oxydamageoverlay0")
|
||||
switch(oxyloss)
|
||||
if(10 to 20)
|
||||
I.icon_state = "oxydamageoverlay1"
|
||||
if(20 to 25)
|
||||
I.icon_state = "oxydamageoverlay2"
|
||||
if(25 to 30)
|
||||
I.icon_state = "oxydamageoverlay3"
|
||||
if(30 to 35)
|
||||
I.icon_state = "oxydamageoverlay4"
|
||||
if(35 to 40)
|
||||
I.icon_state = "oxydamageoverlay5"
|
||||
if(40 to 45)
|
||||
I.icon_state = "oxydamageoverlay6"
|
||||
if(45 to INFINITY)
|
||||
I.icon_state = "oxydamageoverlay7"
|
||||
damageoverlay.overlays += I
|
||||
clear_fullscreen("oxy")
|
||||
|
||||
//Fire and Brute damage overlay (BSSR)
|
||||
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
|
||||
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
|
||||
if(hurtdamage)
|
||||
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "brutedamageoverlay0")
|
||||
I.blend_mode = BLEND_ADD
|
||||
switch(hurtdamage)
|
||||
if(5 to 15)
|
||||
I.icon_state = "brutedamageoverlay1"
|
||||
if(15 to 30)
|
||||
I.icon_state = "brutedamageoverlay2"
|
||||
if(30 to 45)
|
||||
I.icon_state = "brutedamageoverlay3"
|
||||
if(45 to 70)
|
||||
I.icon_state = "brutedamageoverlay4"
|
||||
if(70 to 85)
|
||||
I.icon_state = "brutedamageoverlay5"
|
||||
if(85 to INFINITY)
|
||||
I.icon_state = "brutedamageoverlay6"
|
||||
var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen
|
||||
black.color = "#170000"
|
||||
damageoverlay.overlays += I
|
||||
damageoverlay.overlays += black
|
||||
//Fire and Brute damage overlay (BSSR)
|
||||
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
|
||||
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
|
||||
if(hurtdamage)
|
||||
var/severity = 0
|
||||
switch(hurtdamage)
|
||||
if(5 to 15) severity = 1
|
||||
if(15 to 30) severity = 2
|
||||
if(30 to 45) severity = 3
|
||||
if(45 to 70) severity = 4
|
||||
if(70 to 85) severity = 5
|
||||
if(85 to INFINITY) severity = 6
|
||||
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
|
||||
else
|
||||
clear_fullscreen("brute")
|
||||
|
||||
..()
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/update_sight()
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
visible_message("<b>[src]</b> lets out a faint chimper as it collapses and stops moving...") //ded -- Urist
|
||||
|
||||
update_canmove()
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
ticker.mode.check_win()
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/mob/living/death(gibbed)
|
||||
eye_blind = max(eye_blind, 1)
|
||||
timeofdeath = world.time
|
||||
|
||||
living_mob_list -= src
|
||||
if(!gibbed)
|
||||
dead_mob_list += src
|
||||
else if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
|
||||
clear_fullscreens()
|
||||
..()
|
||||
|
||||
/mob/living/gib(animation = 1)
|
||||
var/prev_lying = lying
|
||||
death(1)
|
||||
@@ -34,17 +47,6 @@
|
||||
/mob/living/proc/dust_animation(animate, flick_name = "")
|
||||
flick(flick_name, animate)
|
||||
|
||||
/mob/living/death(gibbed)
|
||||
eye_blind = max(eye_blind, 1)
|
||||
timeofdeath = world.time
|
||||
|
||||
living_mob_list -= src
|
||||
if(!gibbed)
|
||||
dead_mob_list += src
|
||||
else if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
|
||||
|
||||
/mob/living/proc/setup_animation(animation, prev_lying)
|
||||
var/atom/movable/overlay/animate = null
|
||||
notransform = 1
|
||||
|
||||
@@ -182,44 +182,47 @@
|
||||
return 1
|
||||
|
||||
/mob/living/proc/handle_vision()
|
||||
|
||||
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
|
||||
|
||||
update_sight()
|
||||
|
||||
if(stat != DEAD)
|
||||
if(blind)
|
||||
if(eye_blind)
|
||||
blind.layer = 18
|
||||
throw_alert("blind", /obj/screen/alert/blind)
|
||||
else
|
||||
blind.layer = 0
|
||||
clear_alert("blind")
|
||||
if(stat == DEAD)
|
||||
return
|
||||
if(eye_blind)
|
||||
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
||||
throw_alert("blind", /obj/screen/alert/blind)
|
||||
else
|
||||
clear_fullscreen("blind")
|
||||
clear_alert("blind")
|
||||
|
||||
if (disabilities & NEARSIGHT)
|
||||
client.screen += global_hud.vimpaired
|
||||
|
||||
if (eye_blurry)
|
||||
client.screen += global_hud.blurry
|
||||
|
||||
if (druggy)
|
||||
client.screen += global_hud.druggy
|
||||
throw_alert("high", /obj/screen/alert/high)
|
||||
else
|
||||
clear_alert("high")
|
||||
|
||||
if(eye_stat > 20)
|
||||
if(eye_stat > 30)
|
||||
client.screen += global_hud.darkMask
|
||||
else
|
||||
client.screen += global_hud.vimpaired
|
||||
|
||||
if(machine)
|
||||
if (!( machine.check_eye(src) ))
|
||||
reset_view(null)
|
||||
if(disabilities & NEARSIGHT)
|
||||
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
|
||||
else
|
||||
if(!remote_view && !client.adminobs)
|
||||
reset_view(null)
|
||||
clear_fullscreen("nearsighted")
|
||||
|
||||
if(eye_blurry)
|
||||
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
|
||||
else
|
||||
clear_fullscreen("blurry")
|
||||
|
||||
if(druggy)
|
||||
overlay_fullscreen("high", /obj/screen/fullscreen/high)
|
||||
throw_alert("high", /obj/screen/alert/high)
|
||||
else
|
||||
clear_fullscreen("high")
|
||||
clear_alert("high")
|
||||
|
||||
if(eye_stat > 30)
|
||||
overlay_fullscreen("impaired", /obj/screen/fullscreen/impaired, 2)
|
||||
else if(eye_stat > 20)
|
||||
overlay_fullscreen("impaired", /obj/screen/fullscreen/impaired, 1)
|
||||
else
|
||||
clear_fullscreen("impaired")
|
||||
|
||||
if(machine)
|
||||
if (!( machine.check_eye(src) ))
|
||||
reset_view(null)
|
||||
else
|
||||
if(!remote_view && !client.adminobs)
|
||||
reset_view(null)
|
||||
|
||||
/mob/living/proc/update_sight()
|
||||
return
|
||||
|
||||
@@ -193,8 +193,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
|
||||
/mob/living/ex_act(severity, target)
|
||||
..()
|
||||
if(client && !eye_blind)
|
||||
flick("flash", src.flash)
|
||||
flash_eyes()
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if(status_flags & GODMODE)
|
||||
@@ -704,9 +703,10 @@ Sorry Giacom. Please don't be mad :(
|
||||
floating = 0
|
||||
|
||||
//called when the mob receives a bright flash
|
||||
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
|
||||
if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
|
||||
flick("e_flash", flash)
|
||||
overlay_fullscreen("flash", type)
|
||||
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
|
||||
return 1
|
||||
|
||||
//this returns the mob's protection against eye damage (number between -1 and 2)
|
||||
|
||||
@@ -13,10 +13,8 @@
|
||||
|
||||
anchored = 0 //unbolt floorbolts
|
||||
update_canmove()
|
||||
if(src.eyeobj)
|
||||
src.eyeobj.setLoc(get_turf(src))
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
if(eyeobj)
|
||||
eyeobj.setLoc(get_turf(src))
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
@@ -45,7 +43,7 @@
|
||||
for(var/obj/machinery/ai_status_display/O in world) //change status
|
||||
if(src.key)
|
||||
O.mode = 2
|
||||
if (istype(loc, /obj/item/device/aicard))
|
||||
if(istype(loc, /obj/item/device/aicard))
|
||||
loc.icon_state = "aicard-404"
|
||||
|
||||
tod = worldtime2text() //weasellos time of death patch
|
||||
|
||||
@@ -53,15 +53,13 @@
|
||||
//stage = 5
|
||||
blindness = 1
|
||||
|
||||
if (!blindness)
|
||||
if(!blindness)
|
||||
//stage = 4.5
|
||||
if (src.blind.layer != 0)
|
||||
src.blind.layer = 0
|
||||
src.sight |= SEE_TURFS
|
||||
src.sight |= SEE_MOBS
|
||||
src.sight |= SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
sight |= SEE_TURFS
|
||||
sight |= SEE_MOBS
|
||||
sight |= SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
if(see_override)
|
||||
see_invisible = see_override
|
||||
|
||||
@@ -74,26 +72,23 @@
|
||||
if (aiRestorePowerRoutine==2)
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else if (aiRestorePowerRoutine==3)
|
||||
src << "Alert cancelled. Power has been restored."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
return
|
||||
else
|
||||
|
||||
//stage = 6
|
||||
src.blind.screen_loc = "1,1 to 15,15"
|
||||
if (src.blind.layer!=18)
|
||||
src.blind.layer = 18
|
||||
src.sight = src.sight&~SEE_TURFS
|
||||
src.sight = src.sight&~SEE_MOBS
|
||||
src.sight = src.sight&~SEE_OBJS
|
||||
src.see_in_dark = 0
|
||||
src.see_invisible = SEE_INVISIBLE_LIVING
|
||||
sight = src.sight&~SEE_TURFS
|
||||
sight = src.sight&~SEE_MOBS
|
||||
sight = src.sight&~SEE_OBJS
|
||||
see_in_dark = 0
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
|
||||
if (lacks_power())
|
||||
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
|
||||
|
||||
if(lacks_power())
|
||||
if (aiRestorePowerRoutine==0)
|
||||
aiRestorePowerRoutine = 1
|
||||
|
||||
@@ -111,7 +106,7 @@
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0
|
||||
clear_fullscreen("blind")
|
||||
return
|
||||
src << "Fault confirmed: missing external power. Shutting down main control system to save power."
|
||||
sleep(20)
|
||||
@@ -149,7 +144,7 @@
|
||||
if (!istype(T, /turf/space))
|
||||
src << "Alert cancelled. Power has been restored without our assistance."
|
||||
aiRestorePowerRoutine = 0
|
||||
src.blind.layer = 0 //This, too, is a fix to issue 603
|
||||
clear_fullscreen("blind")
|
||||
return
|
||||
switch(PRP)
|
||||
if (1) src << "APC located. Optimizing route to APC to avoid needless power waste."
|
||||
|
||||
@@ -5,21 +5,9 @@
|
||||
blood.override = 1
|
||||
client.images += blood
|
||||
regenerate_icons()
|
||||
flash = new /obj/screen()
|
||||
flash.icon_state = "blank"
|
||||
flash.name = "flash"
|
||||
flash.screen_loc = "1,1 to 15,15"
|
||||
flash.layer = 17
|
||||
blind = new /obj/screen()
|
||||
blind.icon_state = "black"
|
||||
blind.name = " "
|
||||
blind.screen_loc = "1,1 to 15,15"
|
||||
blind.layer = 0
|
||||
client.screen.Add( blind, flash )
|
||||
|
||||
if(stat != DEAD)
|
||||
for(var/obj/machinery/ai_status_display/O in machines) //change status
|
||||
O.mode = 1
|
||||
O.emotion = "Neutral"
|
||||
src.view_core()
|
||||
return
|
||||
view_core()
|
||||
@@ -109,7 +109,7 @@ var/const/VOX_DELAY = 600
|
||||
src << "<span class='notice'>Wireless interface disabled, unable to interact with announcement PA.</span>"
|
||||
return
|
||||
|
||||
var/list/words = text2list(trim(message), " ")
|
||||
var/list/words = splittext(trim(message), " ")
|
||||
var/list/incorrect_words = list()
|
||||
|
||||
if(words.len > 30)
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
return
|
||||
stat = DEAD
|
||||
canmove = 0
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
uneq_all() // particularly to ensure sight modes are cleared
|
||||
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
|
||||
@@ -676,7 +676,7 @@
|
||||
|
||||
/mob/living/silicon/robot/attack_slime(mob/living/simple_animal/slime/M)
|
||||
if(..()) //successful slime shock
|
||||
flick("noise", flash)
|
||||
flash_eyes()
|
||||
var/stunprob = M.powerlevel * 7 + 10
|
||||
if(prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustBruteLoss(M.powerlevel * rand(6,10))
|
||||
@@ -1187,4 +1187,4 @@
|
||||
Stun(8)
|
||||
if(2)
|
||||
Stun(3)
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -135,9 +135,9 @@
|
||||
src.take_organ_damage(20)
|
||||
if(2)
|
||||
src.take_organ_damage(10)
|
||||
flick("noise", src:flash)
|
||||
src << "<span class='userdanger'>*BZZZT*</span>"
|
||||
src << "<span class='danger'>Warning: Electromagnetic pulse detected.</span>"
|
||||
flash_eyes(affect_silicon = 1)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
|
||||
@@ -393,7 +393,7 @@
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>", \
|
||||
"<span class='userdanger'>[M] has slashed at [src]!</span>")
|
||||
if(prob(8))
|
||||
flick("noise", flash)
|
||||
flash_eyes(affect_silicon = 1)
|
||||
add_logs(M, src, "attacked")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
@@ -466,7 +466,7 @@
|
||||
/mob/living/silicon/grabbedby(mob/living/user)
|
||||
return
|
||||
|
||||
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
|
||||
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
|
||||
if(affect_silicon)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@
|
||||
return
|
||||
|
||||
if(buckled)
|
||||
Feedstop(silent=1) //releases ourselves from the mob we fed on.
|
||||
Feedstop(silent = 1) //releases ourselves from the mob we fed on.
|
||||
|
||||
stat = DEAD
|
||||
overlays.len = 0
|
||||
|
||||
update_canmove()
|
||||
if(blind)
|
||||
blind.layer = 0
|
||||
|
||||
if(ticker && ticker.mode)
|
||||
ticker.mode.check_win()
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
|
||||
|
||||
var/obj/screen/flash = null
|
||||
var/obj/screen/blind = null
|
||||
var/obj/screen/hands = null
|
||||
var/obj/screen/pullin = null
|
||||
var/obj/screen/internals = null
|
||||
@@ -19,7 +17,6 @@
|
||||
var/obj/screen/m_select = null
|
||||
var/obj/screen/healths = null
|
||||
var/obj/screen/throw_icon = null
|
||||
var/obj/screen/damageoverlay = null
|
||||
/*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
|
||||
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
|
||||
The current method unnecessarily clusters up the variable list, especially for humans (although rearranging won't really clean it up a lot but the difference will be noticable for other mobs).
|
||||
|
||||
@@ -21,7 +21,7 @@ Contents:
|
||||
/obj/item/clothing/mask/gas/voice/space_ninja/speechModification(message)
|
||||
if(voice == "Unknown")
|
||||
if(copytext(message, 1, 2) != "*")
|
||||
var/list/temp_message = text2list(message, " ")
|
||||
var/list/temp_message = splittext(message, " ")
|
||||
var/list/pick_list = list()
|
||||
for(var/i = 1, i <= temp_message.len, i++)
|
||||
pick_list += i
|
||||
@@ -30,7 +30,7 @@ Contents:
|
||||
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
|
||||
temp_message[H] = ninjaspeak(temp_message[H])
|
||||
pick_list -= H
|
||||
message = list2text(temp_message, " ")
|
||||
message = jointext(temp_message, " ")
|
||||
|
||||
//The Alternate speech mod is now the main one.
|
||||
message = replacetext(message, "l", "r")
|
||||
|
||||
@@ -155,8 +155,8 @@
|
||||
src << "Missing Input"
|
||||
return
|
||||
|
||||
var/list/startCoords = text2list(startInput, ";")
|
||||
var/list/endCoords = text2list(endInput, ";")
|
||||
var/list/startCoords = splittext(startInput, ";")
|
||||
var/list/endCoords = splittext(endInput, ";")
|
||||
if(!startCoords || !endCoords)
|
||||
src << "Invalid Coords"
|
||||
src << "Start Input: [startInput]"
|
||||
|
||||
@@ -39,12 +39,12 @@
|
||||
var/list/temp_list
|
||||
if(!id_with_upload.len)
|
||||
temp_list = list()
|
||||
temp_list = text2list(id_with_upload_string, ";")
|
||||
temp_list = splittext(id_with_upload_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_upload += text2num(N)
|
||||
if(!id_with_download.len)
|
||||
temp_list = list()
|
||||
temp_list = text2list(id_with_download_string, ";")
|
||||
temp_list = splittext(id_with_download_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_download += text2num(N)
|
||||
|
||||
|
||||
@@ -47,4 +47,4 @@
|
||||
target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
|
||||
playsound(get_turf(target), mSounds[randM], 50, 1)
|
||||
|
||||
flick("e_flash", target.flash)
|
||||
target.flash_eyes()
|
||||
|
||||
@@ -245,10 +245,10 @@
|
||||
json_data["data"] = data
|
||||
|
||||
// Generate the JSON.
|
||||
var/json = JSON.stringify(json_data)
|
||||
var/json = json_encode(json_data)
|
||||
// Strip #255/improper.
|
||||
json = regex_replaceall(json, "\improper", "")
|
||||
json = regex_replaceall(json, "\proper", "")
|
||||
json = replacetext(json, "\improper", "")
|
||||
json = replacetext(json, "\proper", "")
|
||||
return json
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
|
||||
features += "hosted by <b>[config.hostedby]</b>"
|
||||
|
||||
if (features)
|
||||
s += ": [list2text(features, ", ")]"
|
||||
s += ": [jointext(features, ", ")]"
|
||||
|
||||
/* does this help? I do not know */
|
||||
if (src.status != s)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#List the potential random Z-levels here.
|
||||
#Maps must be the full path to them
|
||||
#Maps should be 255x255 or smaller and be bounded. Falling off the edge of the map will result in undefined behavior.
|
||||
#Maps should be 255x255 or smaller and be bounded. Falling off the edge of the map will result in undefined behavior.
|
||||
#SPECIFYING AN INVALID MAP WILL RESULT IN RUNTIMES ON GAME START
|
||||
|
||||
#!!IMPORTANT NOTES FOR HOSTING AWAY MISSIONS!!:
|
||||
#!!IMPORTANT NOTES FOR HOSTING AWAY MISSIONS!!:
|
||||
#Do NOT tick the maps during compile -- the game uses this list to decide which map to load. Ticking the maps will result in them ALL being loaded at once.
|
||||
#DO tick the associated code file for the away mission you are enabling. Otherwise, the map will be trying to reference objects which do not exist, which will cause runtime errors!
|
||||
|
||||
|
||||
+16
-16
@@ -26,7 +26,7 @@ BAN_LEGACY_SYSTEM
|
||||
## log OOC channel
|
||||
LOG_OOC
|
||||
|
||||
## log client Say
|
||||
## log client Say
|
||||
LOG_SAY
|
||||
|
||||
## log admin actions
|
||||
@@ -146,7 +146,7 @@ GUEST_BAN
|
||||
##Remove the # mark infront of this to forbid admins from possessing the singularity.
|
||||
#FORBID_SINGULO_POSSESSION
|
||||
|
||||
## Remove the # to show a popup 'reply to' window to every non-admin that recieves an adminPM.
|
||||
## Remove the # to show a popup 'reply to' window to every non-admin that recieves an adminPM.
|
||||
## The intention is to make adminPMs more visible. (although I fnd popups annoying so this defaults to off)
|
||||
#POPUP_ADMIN_PM
|
||||
|
||||
@@ -190,7 +190,7 @@ EXTREME_POPCAP_MESSAGE The server is currently serving a high number of users, f
|
||||
|
||||
## Notify admins when a new player connects for the first x days a player's been around. (0 for first connection only, -1 for never)
|
||||
## Requres database
|
||||
NOTIFY_NEW_PLAYER_AGE 0
|
||||
NOTIFY_NEW_PLAYER_AGE 0
|
||||
|
||||
## Notify the irc channel when a new player makes their first connection
|
||||
## Requres database
|
||||
@@ -206,26 +206,26 @@ NOTIFY_NEW_PLAYER_AGE 0
|
||||
## Uncomment to have the game log runtimes to the log folder. (Note: this disables normal output in dd/ds, so it should be left off for testing.
|
||||
#LOG_RUNTIMES
|
||||
|
||||
##Comment this out if you've used the mass conversion sql proc for notes or want to stop converting notes
|
||||
## Comment this out if you've used the mass conversion sql proc for notes or want to stop converting notes
|
||||
AUTOCONVERT_NOTES
|
||||
|
||||
##Comment this out to stop admin messages sent anytime an admin disconnects from a round in play, you can edit the messages in admin.dm
|
||||
## Comment this out to stop admin messages sent anytime an admin disconnects from a round in play, you can edit the messages in admin.dm
|
||||
ANNOUNCE_ADMIN_LOGOUT
|
||||
|
||||
##Uncomment to have an admin message sent anytime an admin connects to a round in play, you can edit the messages in admin.dm
|
||||
## Uncomment to have an admin message sent anytime an admin connects to a round in play, you can edit the messages in admin.dm
|
||||
#ANNOUNCE_ADMIN_LOGIN
|
||||
|
||||
##Map rotation
|
||||
##This feature requires you are running a Windows OS (or can other wise run .bat files) and that you are using the tgstation-server toolset in tools/
|
||||
##You should edit maps.txt to match your configuration when you enable this.
|
||||
## Map rotation
|
||||
## This feature requires you are running a Windows OS (or can other wise run .bat files) and that you are using the tgstation-server toolset in tools/
|
||||
## You should edit maps.txt to match your configuration when you enable this.
|
||||
#MAPROTATION
|
||||
|
||||
##Map rotate chance delta
|
||||
##This is the chance of map rotation factored to the round length.
|
||||
##A value of 1 would mean the map rotation chance is the round length in minutes (hour long round == 60% rotation chance)
|
||||
##A value of 0.5 would mean the map rotation chance is half of the round length in minutes (hour long round == 30% rotation chance)
|
||||
## Map rotate chance delta
|
||||
## This is the chance of map rotation factored to the round length.
|
||||
## A value of 1 would mean the map rotation chance is the round length in minutes (hour long round == 60% rotation chance)
|
||||
## A value of 0.5 would mean the map rotation chance is half of the round length in minutes (hour long round == 30% rotation chance)
|
||||
#MAPROTATIONCHANCEDELTA 0.75
|
||||
|
||||
##AUTOADMIN
|
||||
##Uncomment to automatically give that admin rank to all players
|
||||
#AUTOADMIN Game Admin
|
||||
## AUTOADMIN
|
||||
## Uncomment to automatically give that admin rank to all players
|
||||
#AUTOADMIN Game Admin
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 114 KiB |
+3
-2
@@ -46,6 +46,7 @@
|
||||
#include "code\__DEFINES\tablecrafting.dm"
|
||||
#include "code\__DEFINES\tgui.dm"
|
||||
#include "code\__DEFINES\wires.dm"
|
||||
#include "code\__HELPERS\510.dm"
|
||||
#include "code\__HELPERS\_logging.dm"
|
||||
#include "code\__HELPERS\_string_lists.dm"
|
||||
#include "code\__HELPERS\cmp.dm"
|
||||
@@ -65,7 +66,6 @@
|
||||
#include "code\__HELPERS\time.dm"
|
||||
#include "code\__HELPERS\type2type.dm"
|
||||
#include "code\__HELPERS\unsorted.dm"
|
||||
#include "code\__HELPERS\bygex\bygex.dm"
|
||||
#include "code\__HELPERS\sorts\__main.dm"
|
||||
#include "code\__HELPERS\sorts\InsertSort.dm"
|
||||
#include "code\__HELPERS\sorts\MergeSort.dm"
|
||||
@@ -83,6 +83,7 @@
|
||||
#include "code\_globalvars\lists\mobs.dm"
|
||||
#include "code\_globalvars\lists\names.dm"
|
||||
#include "code\_globalvars\lists\objects.dm"
|
||||
#include "code\_onclick\_defines.dm"
|
||||
#include "code\_onclick\adjacent.dm"
|
||||
#include "code\_onclick\ai.dm"
|
||||
#include "code\_onclick\click.dm"
|
||||
@@ -101,6 +102,7 @@
|
||||
#include "code\_onclick\hud\alien.dm"
|
||||
#include "code\_onclick\hud\alien_larva.dm"
|
||||
#include "code\_onclick\hud\drones.dm"
|
||||
#include "code\_onclick\hud\fullscreen.dm"
|
||||
#include "code\_onclick\hud\ghost.dm"
|
||||
#include "code\_onclick\hud\hud.dm"
|
||||
#include "code\_onclick\hud\human.dm"
|
||||
@@ -1096,7 +1098,6 @@
|
||||
#include "code\modules\jobs\job_types\science.dm"
|
||||
#include "code\modules\jobs\job_types\security.dm"
|
||||
#include "code\modules\jobs\job_types\silicon.dm"
|
||||
#include "code\modules\json\json.dm"
|
||||
#include "code\modules\library\lib_items.dm"
|
||||
#include "code\modules\library\lib_machines.dm"
|
||||
#include "code\modules\library\lib_readme.dm"
|
||||
|
||||
Reference in New Issue
Block a user