Absolute paths for 3 nanoUI files

...

...
This commit is contained in:
Firecage
2014-08-06 18:52:31 +02:00
parent 8ee10c4940
commit 9732b3a254
5 changed files with 3349 additions and 3362 deletions
+61 -61
View File
@@ -72,75 +72,75 @@
origin_tech = "materials=1;engineering=1"
attack_verb = list("hit", "pierced", "sliced", "attacked")
/obj/item/weapon/pickaxe/hammer
name = "sledgehammer"
//icon_state = "sledgehammer" Waiting on sprite
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
hammer
name = "sledgehammer"
//icon_state = "sledgehammer" Waiting on sprite
desc = "A mining hammer made of reinforced metal. You feel like smashing your boss in the face with this."
/obj/item/weapon/pickaxe/silver
name = "silver pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
digspeed = 30
origin_tech = "materials=3"
desc = "This makes no metallurgic sense."
silver
name = "silver pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
digspeed = 30
origin_tech = "materials=3"
desc = "This makes no metallurgic sense."
/obj/item/weapon/pickaxe/drill
name = "mining drill" // Can dig sand as well!
icon_state = "handdrill"
item_state = "jackhammer"
digspeed = 30
origin_tech = "materials=2;powerstorage=3;engineering=2"
desc = "Yours is the drill that will pierce through the rock walls."
drill
name = "mining drill" // Can dig sand as well!
icon_state = "handdrill"
item_state = "jackhammer"
digspeed = 30
origin_tech = "materials=2;powerstorage=3;engineering=2"
desc = "Yours is the drill that will pierce through the rock walls."
/obj/item/weapon/pickaxe/jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 15 //faster than drill, but cannot dig
origin_tech = "materials=3;powerstorage=2;engineering=2"
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 15 //faster than drill, but cannot dig
origin_tech = "materials=3;powerstorage=2;engineering=2"
desc = "Cracks rocks with sonic blasts, perfect for killing cave lizards."
/obj/item/weapon/pickaxe/gold
name = "golden pickaxe"
icon_state = "gpickaxe"
item_state = "gpickaxe"
digspeed = 20
origin_tech = "materials=4"
desc = "This makes no metallurgic sense."
gold
name = "golden pickaxe"
icon_state = "gpickaxe"
item_state = "gpickaxe"
digspeed = 20
origin_tech = "materials=4"
desc = "This makes no metallurgic sense."
/obj/item/weapon/pickaxe/plasmacutter
name = "plasma cutter"
icon_state = "plasmacutter"
item_state = "gun"
w_class = 3.0 //it is smaller than the pickaxe
damtype = "fire"
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
origin_tech = "materials=4;plasmatech=3;engineering=3"
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
plasmacutter
name = "plasma cutter"
icon_state = "plasmacutter"
item_state = "gun"
w_class = 3.0 //it is smaller than the pickaxe
damtype = "fire"
digspeed = 20 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/ light thermite on fire
origin_tech = "materials=4;plasmatech=3;engineering=3"
desc = "A rock cutter that uses bursts of hot plasma. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
/obj/item/weapon/pickaxe/diamond
name = "diamond pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
digspeed = 10
origin_tech = "materials=6;engineering=4"
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
diamond
name = "diamond pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
digspeed = 10
origin_tech = "materials=6;engineering=4"
desc = "A pickaxe with a diamond pick head, this is just like minecraft."
/obj/item/weapon/pickaxe/diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
name = "diamond mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 5 //Digs through walls, girders, and can dig up sand
origin_tech = "materials=6;powerstorage=4;engineering=5"
desc = "Yours is the drill that will pierce the heavens!"
diamonddrill //When people ask about the badass leader of the mining tools, they are talking about ME!
name = "diamond mining drill"
icon_state = "diamonddrill"
item_state = "jackhammer"
digspeed = 5 //Digs through walls, girders, and can dig up sand
origin_tech = "materials=6;powerstorage=4;engineering=5"
desc = "Yours is the drill that will pierce the heavens!"
/obj/item/weapon/pickaxe/borgdrill
name = "cyborg mining drill"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 15
desc = ""
borgdrill
name = "cyborg mining drill"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 15
desc = ""
/*****************************Shovel********************************/
+167 -168
View File
@@ -20,186 +20,185 @@ json_reader
i = 1
proc
// scanner
ScanJson(json)
src.json = json
. = new/list()
src.i = 1
while(src.i <= lentext(json))
var/char = get_char()
if(is_whitespace(char))
i++
continue
if(string.Find(char))
. += read_string(char)
else if(symbols.Find(char))
. += new/json_token/symbol(char)
else if(is_digit(char))
. += read_number()
json_reader/proc/ScanJson(json)
// scanner
src.json = json
. = new/list()
src.i = 1
while(src.i <= lentext(json))
var/char = get_char()
if(is_whitespace(char))
i++
continue
if(string.Find(char))
. += read_string(char)
else if(symbols.Find(char))
. += new/json_token/symbol(char)
else if(is_digit(char))
. += read_number()
else
. += read_word()
i++
. += new/json_token/eof()
json_reader/proc/read_word()
var/val = ""
while(i <= lentext(json))
var/char = get_char()
if(is_whitespace(char) || symbols.Find(char))
i-- // let scanner handle this character
return new/json_token/word(val)
val += char
i++
json_reader/proc/read_string(delim)
var
escape = FALSE
val = ""
while(++i <= lentext(json))
var/char = get_char()
if(escape)
switch(char)
if("\\", "'", "\"", "/", "u")
val += char
else
. += read_word()
i++
. += new/json_token/eof()
read_word()
var/val = ""
while(i <= lentext(json))
var/char = get_char()
if(is_whitespace(char) || symbols.Find(char))
i-- // let scanner handle this character
return new/json_token/word(val)
// TODO: support octal, hex, unicode sequences
ASSERT(sequences.Find(char))
val += ascii2text(sequences[char])
else
if(char == delim)
return new/json_token/text(val)
else if(char == "\\")
escape = TRUE
else
val += char
i++
CRASH("Unterminated string.")
read_string(delim)
var
escape = FALSE
val = ""
while(++i <= lentext(json))
var/char = get_char()
if(escape)
switch(char)
if("\\", "'", "\"", "/", "u")
val += char
else
// TODO: support octal, hex, unicode sequences
ASSERT(sequences.Find(char))
val += ascii2text(sequences[char])
else
if(char == delim)
return new/json_token/text(val)
else if(char == "\\")
escape = TRUE
else
val += char
CRASH("Unterminated string.")
json_reader/proc/read_number()
var/val = ""
var/char = get_char()
while(is_digit(char) || char == "." || lowertext(char) == "e")
val += char
i++
char = get_char()
i-- // allow scanner to read the first non-number character
return new/json_token/number(text2num(val))
read_number()
var/val = ""
var/char = get_char()
while(is_digit(char) || char == "." || lowertext(char) == "e")
val += char
i++
char = get_char()
i-- // allow scanner to read the first non-number character
return new/json_token/number(text2num(val))
json_reader/proc/check_char()
ASSERT(args.Find(get_char()))
check_char()
ASSERT(args.Find(get_char()))
json_reader/proc/get_char()
return copytext(json, i, i+1)
get_char()
return copytext(json, i, i+1)
json_reader/proc/is_whitespace(char)
return char == " " || char == "\t" || char == "\n" || text2ascii(char) == 13
is_whitespace(char)
return char == " " || char == "\t" || char == "\n" || text2ascii(char) == 13
is_digit(char)
var/c = text2ascii(char)
return 48 <= c && c <= 57 || char == "+" || char == "-"
json_reader/proc/is_digit(char)
var/c = text2ascii(char)
return 48 <= c && c <= 57 || char == "+" || char == "-"
// parser
ReadObject(list/tokens)
src.tokens = tokens
. = new/list()
i = 1
read_token("{", /json_token/symbol)
while(i <= tokens.len)
var/json_token/K = get_token()
check_type(/json_token/word, /json_token/text)
next_token()
read_token(":", /json_token/symbol)
.[K.value] = read_value()
var/json_token/S = get_token()
check_type(/json_token/symbol)
switch(S.value)
if(",")
next_token()
continue
if("}")
next_token()
return
else
die()
get_token()
return tokens[i]
// parser
json_reader/proc/ReadObject(list/tokens)
src.tokens = tokens
. = new/list()
i = 1
read_token("{", /json_token/symbol)
while(i <= tokens.len)
var/json_token/K = get_token()
check_type(/json_token/word, /json_token/text)
next_token()
return tokens[++i]
read_token(":", /json_token/symbol)
read_token(val, type)
var/json_token/T = get_token()
if(!(T.value == val && istype(T, type)))
CRASH("Expected '[val]', found '[T.value]'.")
.[K.value] = read_value()
var/json_token/S = get_token()
check_type(/json_token/symbol)
switch(S.value)
if(",")
next_token()
continue
if("}")
next_token()
return
else
die()
json_reader/proc/get_token()
return tokens[i]
json_reader/proc/next_token()
return tokens[++i]
json_reader/proc/read_token(val, type)
var/json_token/T = get_token()
if(!(T.value == val && istype(T, type)))
CRASH("Expected '[val]', found '[T.value]'.")
next_token()
return T
json_reader/proc/check_type(...)
var/json_token/T = get_token()
for(var/type in args)
if(istype(T, type))
return
CRASH("Bad token type: [T.type].")
json_reader/proc/check_value(...)
var/json_token/T = get_token()
ASSERT(args.Find(T.value))
json_reader/proc/read_key()
var/char = get_char()
if(char == "\"" || char == "'")
return read_string(char)
json_reader/proc/read_value()
var/json_token/T = get_token()
switch(T.type)
if(/json_token/text, /json_token/number)
next_token()
return T
return T.value
if(/json_token/word)
next_token()
switch(T.value)
if("true")
return TRUE
if("false")
return FALSE
if("null")
return null
if(/json_token/symbol)
switch(T.value)
if("\[")
return read_array()
if("{")
return ReadObject(tokens.Copy(i))
die()
check_type(...)
var/json_token/T = get_token()
for(var/type in args)
if(istype(T, type))
return
CRASH("Bad token type: [T.type].")
check_value(...)
var/json_token/T = get_token()
ASSERT(args.Find(T.value))
read_key()
var/char = get_char()
if(char == "\"" || char == "'")
return read_string(char)
read_value()
var/json_token/T = get_token()
switch(T.type)
if(/json_token/text, /json_token/number)
next_token()
return T.value
if(/json_token/word)
next_token()
switch(T.value)
if("true")
return TRUE
if("false")
return FALSE
if("null")
return null
if(/json_token/symbol)
switch(T.value)
if("\[")
return read_array()
if("{")
return ReadObject(tokens.Copy(i))
die()
read_array()
read_token("\[", /json_token/symbol)
. = new/list()
var/list/L = .
while(i <= tokens.len)
// Avoid using Add() or += in case a list is returned.
L.len++
L[L.len] = read_value()
var/json_token/T = get_token()
check_type(/json_token/symbol)
switch(T.value)
if(",")
next_token()
continue
if("]")
next_token()
return
else
die()
next_token()
CRASH("Unterminated array.")
json_reader/proc/read_array()
read_token("\[", /json_token/symbol)
. = new/list()
var/list/L = .
while(i <= tokens.len)
// Avoid using Add() or += in case a list is returned.
L.len++
L[L.len] = read_value()
var/json_token/T = get_token()
check_type(/json_token/symbol)
switch(T.value)
if(",")
next_token()
continue
if("]")
next_token()
return
else
die()
next_token()
CRASH("Unterminated array.")
die(json_token/T)
if(!T) T = get_token()
CRASH("Unexpected token: [T.value].")
json_reader/proc/die(json_token/T)
if(!T) T = get_token()
CRASH("Unexpected token: [T.value].")
+52 -54
View File
@@ -1,59 +1,57 @@
json_writer
proc
WriteObject(list/L)
. = "{"
var/i = 1
for(var/k in L)
var/val = L[k]
. += {"\"[k]\":[write(val)]"}
if(i++ < L.len)
. += ","
.+= "}"
json_writer/proc/WriteObject(list/L)
. = "{"
var/i = 1
for(var/k in L)
var/val = L[k]
. += {"\"[k]\":[write(val)]"}
if(i++ < L.len)
. += ","
.+= "}"
write(val)
if(isnum(val))
return num2text(val, 100)
else if(isnull(val))
return "null"
else if(istype(val, /list))
if(is_associative(val))
return WriteObject(val)
else
return write_array(val)
json_writer/proc/write(val)
if(isnum(val))
return num2text(val, 100)
else if(isnull(val))
return "null"
else if(istype(val, /list))
if(is_associative(val))
return WriteObject(val)
else
return write_array(val)
else
. += write_string("[val]")
json_writer/proc/write_array(list/L)
. = "\["
for(var/i = 1 to L.len)
. += write(L[i])
if(i < L.len)
. += ","
. += "]"
json_writer/proc/write_string(txt)
var/static/list/json_escape = list("\\", "\"", "'", "\n")
for(var/targ in json_escape)
var/start = 1
while(start <= lentext(txt))
var/i = findtext(txt, targ, start)
if(!i)
break
if(targ == "\n")
txt = copytext(txt, 1, i) + "\\n" + copytext(txt, i+2)
start = i + 1 // 1 character added
if(targ == "'")
txt = copytext(txt, 1, i) + "`" + copytext(txt, i+1) // apostrophies fuck shit up...
start = i + 1 // 1 character added
else
. += write_string("[val]")
txt = copytext(txt, 1, i) + "\\" + copytext(txt, i)
start = i + 2 // 2 characters added
write_array(list/L)
. = "\["
for(var/i = 1 to L.len)
. += write(L[i])
if(i < L.len)
. += ","
. += "]"
return {""[txt]""}
write_string(txt)
var/static/list/json_escape = list("\\", "\"", "'", "\n")
for(var/targ in json_escape)
var/start = 1
while(start <= lentext(txt))
var/i = findtext(txt, targ, start)
if(!i)
break
if(targ == "\n")
txt = copytext(txt, 1, i) + "\\n" + copytext(txt, i+2)
start = i + 1 // 1 character added
if(targ == "'")
txt = copytext(txt, 1, i) + "`" + copytext(txt, i+1) // apostrophies fuck shit up...
start = i + 1 // 1 character added
else
txt = copytext(txt, 1, i) + "\\" + copytext(txt, i)
start = i + 2 // 2 characters added
return {""[txt]""}
is_associative(list/L)
for(var/key in L)
// if the key is a list that means it's actually an array of lists (stupid Byond...)
if(!isnum(key) && !istype(key, /list))
return TRUE
json_writer/proc/is_associative(list/L)
for(var/key in L)
// if the key is a list that means it's actually an array of lists (stupid Byond...)
if(!isnum(key) && !istype(key, /list))
return TRUE
+2 -3
View File
@@ -2,11 +2,10 @@
n_Json v11.3.21
*/
proc
json2list(json)
proc/json2list(json)
var/static/json_reader/_jsonr = new()
return _jsonr.ReadObject(_jsonr.ScanJson(json))
list2json(list/L)
proc/list2json(list/L)
var/static/json_writer/_jsonw = new()
return _jsonw.WriteObject(L)
File diff suppressed because it is too large Load Diff