Circuits Update One (#6852)

Ports a buuuuunch of circuits from Polaris.
Allows metabolic siphons and internal energy siphons to consume power to feed their host.
Ports /tg/ circuits too while I'm at it.
Increases base size and complexity for circuits. You're all adults. Hopefully. Don't abuse it.
Ports the integrated circuit detailer.
This commit is contained in:
MarinaGryphon
2019-08-25 13:44:42 -05:00
committed by Erki
parent 4481646713
commit bd5884c89a
56 changed files with 2067 additions and 134 deletions

View File

@@ -396,6 +396,11 @@ proc/TextPreview(var/string,var/len=40)
. += ascii2text(letter)
. = jointext(.,null)
/proc/random_string(length, list/characters)
. = ""
for(var/i=1, i<=length, i++)
. += pick(characters)
#define starts_with(string, substring) (copytext(string,1,1+length(substring)) == substring)
#define gender2text(gender) capitalize(gender)
@@ -478,7 +483,7 @@ proc/TextPreview(var/string,var/len=40)
var/next_backslash = findtext(string, "\\")
if(!next_backslash)
return string
var/leng = length(string)
var/next_space = findtext(string, " ", next_backslash + 1)

View File

@@ -262,3 +262,27 @@ proc/tg_list2text(list/list, glue=",")
/proc/isLeap(y)
return ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
/proc/strtohex(str)
if(!istext(str)||!str)
return
var/r
var/c
for(var/i = 1 to length(str))
c= text2ascii(str,i)
r+= num2hex(c)
return r
// Decodes hex to raw byte string.
// If safe=TRUE, returns null on incorrect input strings instead of CRASHing
/proc/hextostr(str, safe=FALSE)
if(!istext(str)||!str)
return
var/r
var/c
for(var/i = 1 to length(str)/2)
c = hex2num(copytext(str,i*2-1,i*2+1), safe)
if(isnull(c))
return null
r += ascii2text(c)
return r