mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Merge pull request #14698 from Firecage/absolutepathsandifs
Absolute paths and changes one liner if's/else's/else if's.
This commit is contained in:
@@ -67,10 +67,13 @@
|
||||
|
||||
/obj/effect/hotspot/proc/perform_exposure()
|
||||
var/turf/simulated/location = loc
|
||||
if(!istype(location) || !(location.air)) return 0
|
||||
if(!istype(location) || !(location.air))
|
||||
return 0
|
||||
|
||||
if(volume > CELL_VOLUME*0.95) bypassing = 1
|
||||
else bypassing = 0
|
||||
if(volume > CELL_VOLUME*0.95)
|
||||
bypassing = 1
|
||||
else
|
||||
bypassing = 0
|
||||
|
||||
if(bypassing)
|
||||
if(!just_spawned)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/turf/proc/CanAtmosPass(turf/T)
|
||||
if(!istype(T)) return 0
|
||||
if(!istype(T))
|
||||
return 0
|
||||
var/R
|
||||
if(blocks_air || T.blocks_air)
|
||||
R = 1
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
return ..()
|
||||
|
||||
/turf/simulated/assume_air(datum/gas_mixture/giver)
|
||||
if(!giver) return 0
|
||||
if(!giver)
|
||||
return 0
|
||||
var/datum/gas_mixture/receiver = air
|
||||
if(istype(receiver))
|
||||
|
||||
|
||||
@@ -29,42 +29,41 @@
|
||||
#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))
|
||||
|
||||
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))
|
||||
|
||||
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))
|
||||
|
||||
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))
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
replacetextEx(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regEx_replaceallliteral")(str, exp, fmt)
|
||||
/proc/replacetextEx(str, exp, fmt)
|
||||
return call(LIBREGEX_LIBRARY, "regEx_replaceallliteral")(str, exp, fmt)
|
||||
|
||||
replacetext(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)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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))
|
||||
|
||||
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
|
||||
@@ -79,66 +78,69 @@
|
||||
var/anchors = 0
|
||||
var/list/matches = list()
|
||||
|
||||
New(str, exp, results)
|
||||
src.str = str
|
||||
src.exp = exp
|
||||
/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
|
||||
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
|
||||
|
||||
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/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)
|
||||
|
||||
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/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
|
||||
|
||||
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/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
|
||||
|
||||
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/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
|
||||
|
||||
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/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
|
||||
|
||||
New(pos, len)
|
||||
src.pos = pos
|
||||
src.len = len
|
||||
/datum/match/New(pos, len)
|
||||
src.pos = pos
|
||||
src.len = len
|
||||
|
||||
#endif
|
||||
@@ -4,51 +4,50 @@
|
||||
|
||||
var/datum/regex/results
|
||||
|
||||
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_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)]"
|
||||
|
||||
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/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)]"
|
||||
|
||||
compare_casesensitive(t as text)
|
||||
results = regEx_compare(t, expression)
|
||||
world << results.report()
|
||||
/mob/verb/compare_casesensitive(t as text)
|
||||
results = regEx_compare(t, expression)
|
||||
world << results.report()
|
||||
|
||||
compare(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()
|
||||
|
||||
find_casesensitive(t as text)
|
||||
results = regEx_find(t, expression)
|
||||
world << results.report()
|
||||
/mob/verb/find_casesensitive(t as text)
|
||||
results = regEx_find(t, expression)
|
||||
world << results.report()
|
||||
|
||||
find(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()
|
||||
|
||||
replaceall_casesensitive(t as text)
|
||||
usr << regEx_replaceall(t, expression, format)
|
||||
/mob/verb/replaceall_casesensitive(t as text)
|
||||
usr << regEx_replaceall(t, expression, format)
|
||||
|
||||
replaceall(t as text)
|
||||
usr << regex_replaceall(t, expression, format)
|
||||
/mob/verb/replaceall(t as text)
|
||||
usr << regex_replaceall(t, expression, format)
|
||||
|
||||
replace_casesensitive(t as text)
|
||||
usr << html_encode(regEx_replace(t, expression, format))
|
||||
/mob/verb/replace_casesensitive(t as text)
|
||||
usr << html_encode(regEx_replace(t, expression, format))
|
||||
|
||||
replace(t as text)
|
||||
usr << regex_replace(t, expression, format)
|
||||
/mob/verb/replace(t as text)
|
||||
usr << regex_replace(t, expression, format)
|
||||
|
||||
findall(t as text)
|
||||
results = regex_findall(t, expression)
|
||||
world << results.report()
|
||||
/mob/verb/findall(t as text)
|
||||
results = regex_findall(t, expression)
|
||||
world << results.report()
|
||||
|
||||
findall_casesensitive(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()
|
||||
@@ -292,7 +292,8 @@
|
||||
return candidates
|
||||
|
||||
/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
|
||||
if(!isobj(O)) O = new /obj/screen/text()
|
||||
if(!isobj(O))
|
||||
O = new /obj/screen/text()
|
||||
O.maptext = maptext
|
||||
O.maptext_height = maptext_height
|
||||
O.maptext_width = maptext_width
|
||||
@@ -300,8 +301,10 @@
|
||||
return O
|
||||
|
||||
/proc/Show2Group4Delay(obj/O, list/group, delay=0)
|
||||
if(!isobj(O)) return
|
||||
if(!group) group = clients
|
||||
if(!isobj(O))
|
||||
return
|
||||
if(!group)
|
||||
group = clients
|
||||
for(var/client/C in group)
|
||||
C.screen += O
|
||||
if(delay)
|
||||
@@ -409,7 +412,8 @@
|
||||
return candidates
|
||||
|
||||
/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
if(!G_found || !G_found.key)
|
||||
return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
//creates every subtype of prototype (excluding prototype) and adds it to list L.
|
||||
//if no list/L is provided, one is created.
|
||||
/proc/init_subtypes(prototype, list/L)
|
||||
if(!istype(L)) L = list()
|
||||
if(!istype(L))
|
||||
L = list()
|
||||
for(var/path in subtypesof(prototype))
|
||||
L += new path()
|
||||
return L
|
||||
|
||||
+13
-8
@@ -783,7 +783,8 @@ The _flatIcons list is a cache for generated icon files.
|
||||
/proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N
|
||||
var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A.
|
||||
for(var/I in A.overlays)//For every image in overlays. var/image/I will not work, don't try it.
|
||||
if(I:layer>A.layer) continue//If layer is greater than what we need, skip it.
|
||||
if(I:layer>A.layer)
|
||||
continue//If layer is greater than what we need, skip it.
|
||||
var/icon/image_overlay = new(I:icon,I:icon_state)//Blend only works with icon objects.
|
||||
//Also, icons cannot directly set icon_state. Slower than changing variables but whatever.
|
||||
alpha_mask.Blend(image_overlay,ICON_OR)//OR so they are lumped together in a nice overlay.
|
||||
@@ -799,10 +800,14 @@ The _flatIcons list is a cache for generated icon files.
|
||||
for(var/i=0,i<5,i++)//And now we add it as overlays. It's faster than creating an icon and then merging it.
|
||||
var/image/I = image("icon" = opacity_icon, "icon_state" = A.icon_state, "layer" = layer+0.8)//So it's above other stuff but below weapons and the like.
|
||||
switch(i)//Now to determine offset so the result is somewhat blurred.
|
||||
if(1) I.pixel_x--
|
||||
if(2) I.pixel_x++
|
||||
if(3) I.pixel_y--
|
||||
if(4) I.pixel_y++
|
||||
if(1)
|
||||
I.pixel_x--
|
||||
if(2)
|
||||
I.pixel_x++
|
||||
if(3)
|
||||
I.pixel_y--
|
||||
if(4)
|
||||
I.pixel_y++
|
||||
overlays += I//And finally add the overlay.
|
||||
|
||||
/proc/getHologramIcon(icon/A, safety=1)//If safety is on, a new icon is not created.
|
||||
@@ -920,12 +925,12 @@ var/global/list/humanoid_icon_cache = list()
|
||||
/proc/get_flat_human_icon(var/icon_id,var/outfit,var/datum/preferences/prefs)
|
||||
if(!icon_id || !humanoid_icon_cache[icon_id])
|
||||
var/mob/living/carbon/human/dummy/body = new()
|
||||
|
||||
|
||||
if(prefs)
|
||||
prefs.copy_to(body)
|
||||
if(outfit)
|
||||
body.equipOutfit(outfit, TRUE)
|
||||
|
||||
|
||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||
|
||||
body.dir = NORTH
|
||||
@@ -945,7 +950,7 @@ var/global/list/humanoid_icon_cache = list()
|
||||
out_icon.Insert(partial,dir=EAST)
|
||||
|
||||
qdel(body)
|
||||
|
||||
|
||||
humanoid_icon_cache[icon_id] = out_icon
|
||||
return out_icon
|
||||
else
|
||||
|
||||
+64
-32
@@ -3,30 +3,44 @@
|
||||
|
||||
/proc/random_eye_color()
|
||||
switch(pick(20;"brown",20;"hazel",20;"grey",15;"blue",15;"green",1;"amber",1;"albino"))
|
||||
if("brown") return "630"
|
||||
if("hazel") return "542"
|
||||
if("grey") return pick("666","777","888","999","aaa","bbb","ccc")
|
||||
if("blue") return "36c"
|
||||
if("green") return "060"
|
||||
if("amber") return "fc0"
|
||||
if("albino") return pick("c","d","e","f") + pick("0","1","2","3","4","5","6","7","8","9") + pick("0","1","2","3","4","5","6","7","8","9")
|
||||
else return "000"
|
||||
if("brown")
|
||||
return "630"
|
||||
if("hazel")
|
||||
return "542"
|
||||
if("grey")
|
||||
return pick("666","777","888","999","aaa","bbb","ccc")
|
||||
if("blue")
|
||||
return "36c"
|
||||
if("green")
|
||||
return "060"
|
||||
if("amber")
|
||||
return "fc0"
|
||||
if("albino")
|
||||
return pick("c","d","e","f") + pick("0","1","2","3","4","5","6","7","8","9") + pick("0","1","2","3","4","5","6","7","8","9")
|
||||
else
|
||||
return "000"
|
||||
|
||||
/proc/random_underwear(gender)
|
||||
if(!underwear_list.len)
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, underwear_list, underwear_m, underwear_f)
|
||||
switch(gender)
|
||||
if(MALE) return pick(underwear_m)
|
||||
if(FEMALE) return pick(underwear_f)
|
||||
else return pick(underwear_list)
|
||||
if(MALE)
|
||||
return pick(underwear_m)
|
||||
if(FEMALE)
|
||||
return pick(underwear_f)
|
||||
else
|
||||
return pick(underwear_list)
|
||||
|
||||
/proc/random_undershirt(gender)
|
||||
if(!undershirt_list.len)
|
||||
init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, undershirt_list, undershirt_m, undershirt_f)
|
||||
switch(gender)
|
||||
if(MALE) return pick(undershirt_m)
|
||||
if(FEMALE) return pick(undershirt_f)
|
||||
else return pick(undershirt_list)
|
||||
if(MALE)
|
||||
return pick(undershirt_m)
|
||||
if(FEMALE)
|
||||
return pick(undershirt_f)
|
||||
else
|
||||
return pick(undershirt_list)
|
||||
|
||||
/proc/random_socks()
|
||||
if(!socks_list.len)
|
||||
@@ -56,20 +70,28 @@
|
||||
|
||||
/proc/random_hair_style(gender)
|
||||
switch(gender)
|
||||
if(MALE) return pick(hair_styles_male_list)
|
||||
if(FEMALE) return pick(hair_styles_female_list)
|
||||
else return pick(hair_styles_list)
|
||||
if(MALE)
|
||||
return pick(hair_styles_male_list)
|
||||
if(FEMALE)
|
||||
return pick(hair_styles_female_list)
|
||||
else
|
||||
return pick(hair_styles_list)
|
||||
|
||||
/proc/random_facial_hair_style(gender)
|
||||
switch(gender)
|
||||
if(MALE) return pick(facial_hair_styles_male_list)
|
||||
if(FEMALE) return pick(facial_hair_styles_female_list)
|
||||
else return pick(facial_hair_styles_list)
|
||||
if(MALE)
|
||||
return pick(facial_hair_styles_male_list)
|
||||
if(FEMALE)
|
||||
return pick(facial_hair_styles_female_list)
|
||||
else
|
||||
return pick(facial_hair_styles_list)
|
||||
|
||||
/proc/random_unique_name(gender, attempts_to_find_unique_name=10)
|
||||
for(var/i=1, i<=attempts_to_find_unique_name, i++)
|
||||
if(gender==FEMALE) . = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
|
||||
else . = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
|
||||
if(gender==FEMALE)
|
||||
. = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
|
||||
else
|
||||
. = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
|
||||
|
||||
if(i != attempts_to_find_unique_name && !findname(.))
|
||||
break
|
||||
@@ -104,16 +126,26 @@ var/global/list/roundstart_species[0]
|
||||
|
||||
/proc/age2agedescription(age)
|
||||
switch(age)
|
||||
if(0 to 1) return "infant"
|
||||
if(1 to 3) return "toddler"
|
||||
if(3 to 13) return "child"
|
||||
if(13 to 19) return "teenager"
|
||||
if(19 to 30) return "young adult"
|
||||
if(30 to 45) return "adult"
|
||||
if(45 to 60) return "middle-aged"
|
||||
if(60 to 70) return "aging"
|
||||
if(70 to INFINITY) return "elderly"
|
||||
else return "unknown"
|
||||
if(0 to 1)
|
||||
return "infant"
|
||||
if(1 to 3)
|
||||
return "toddler"
|
||||
if(3 to 13)
|
||||
return "child"
|
||||
if(13 to 19)
|
||||
return "teenager"
|
||||
if(19 to 30)
|
||||
return "young adult"
|
||||
if(30 to 45)
|
||||
return "adult"
|
||||
if(45 to 60)
|
||||
return "middle-aged"
|
||||
if(60 to 70)
|
||||
return "aging"
|
||||
if(70 to INFINITY)
|
||||
return "elderly"
|
||||
else
|
||||
return "unknown"
|
||||
|
||||
/*
|
||||
Proc for attack log creation, because really why not
|
||||
|
||||
@@ -12,22 +12,30 @@
|
||||
return default
|
||||
|
||||
/proc/sanitize_inlist(value, list/List, default)
|
||||
if(value in List) return value
|
||||
if(default) return default
|
||||
if(List && List.len)return pick(List)
|
||||
if(value in List)
|
||||
return value
|
||||
if(default)
|
||||
return default
|
||||
if(List && List.len)
|
||||
return pick(List)
|
||||
|
||||
|
||||
|
||||
//more specialised stuff
|
||||
/proc/sanitize_gender(gender,neuter=0,plural=0, default="male")
|
||||
switch(gender)
|
||||
if(MALE, FEMALE)return gender
|
||||
if(MALE, FEMALE)
|
||||
return gender
|
||||
if(NEUTER)
|
||||
if(neuter) return gender
|
||||
else return default
|
||||
if(neuter)
|
||||
return gender
|
||||
else
|
||||
return default
|
||||
if(PLURAL)
|
||||
if(plural) return gender
|
||||
else return default
|
||||
if(plural)
|
||||
return gender
|
||||
else
|
||||
return default
|
||||
return default
|
||||
|
||||
/proc/sanitize_hexcolor(color, desired_format=3, include_crunch=0, default)
|
||||
@@ -43,14 +51,18 @@
|
||||
for(var/i=start, i<=len, i+=step_size)
|
||||
var/ascii = text2ascii(color,i)
|
||||
switch(ascii)
|
||||
if(48 to 57) . += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102) . += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70) . += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
if(48 to 57)
|
||||
. += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102)
|
||||
. += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70)
|
||||
. += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
else
|
||||
break
|
||||
|
||||
if(length(.) != desired_format)
|
||||
if(default) return default
|
||||
if(default)
|
||||
return default
|
||||
return crunch + repeat_string(desired_format, "0")
|
||||
|
||||
return crunch + .
|
||||
|
||||
+40
-20
@@ -62,16 +62,23 @@
|
||||
|
||||
//Returns null if there is any bad text in the string
|
||||
/proc/reject_bad_text(text, max_length=512)
|
||||
if(length(text) > max_length) return //message too long
|
||||
if(length(text) > max_length)
|
||||
return //message too long
|
||||
var/non_whitespace = 0
|
||||
for(var/i=1, i<=length(text), i++)
|
||||
switch(text2ascii(text,i))
|
||||
if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or /
|
||||
if(127 to 255) return //rejects weird letters like �
|
||||
if(0 to 31) return //more weird stuff
|
||||
if(32) continue //whitespace
|
||||
else non_whitespace = 1
|
||||
if(non_whitespace) return text //only accepts the text if it has some non-spaces
|
||||
if(62,60,92,47)
|
||||
return //rejects the text if it contains these bad characters: <, >, \ or /
|
||||
if(127 to 255)
|
||||
return //rejects weird letters like �
|
||||
if(0 to 31)
|
||||
return //more weird stuff
|
||||
if(32)
|
||||
continue //whitespace
|
||||
else
|
||||
non_whitespace = 1
|
||||
if(non_whitespace)
|
||||
return text //only accepts the text if it has some non-spaces
|
||||
|
||||
// Used to get a properly sanitized input, of max_length
|
||||
/proc/stripped_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN)
|
||||
@@ -103,47 +110,57 @@
|
||||
|
||||
// a .. z
|
||||
if(97 to 122) //Lowercase Letters
|
||||
if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else t_out += ascii2text(ascii_char)
|
||||
if(last_char_group<2)
|
||||
t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// 0 .. 9
|
||||
if(48 to 57) //Numbers
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 3
|
||||
|
||||
// ' - .
|
||||
if(39,45,46) //Common name punctuation
|
||||
if(!last_char_group) continue
|
||||
if(!last_char_group)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
// ~ | @ : # $ % & * +
|
||||
if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI)
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
if(!last_char_group)
|
||||
continue //suppress at start of string
|
||||
if(!allow_numbers)
|
||||
continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
//Space
|
||||
if(32)
|
||||
if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string
|
||||
if(last_char_group <= 1)
|
||||
continue //suppress double-spaces and spaces at start of string
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 1
|
||||
else
|
||||
return
|
||||
|
||||
if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
if(number_of_alphanumeric < 2)
|
||||
return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
if(last_char_group == 1)
|
||||
t_out = copytext(t_out,1,length(t_out)) //removes the last character (in this case a space)
|
||||
|
||||
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
|
||||
if(cmptext(t_out,bad_name)) return //(not case sensitive)
|
||||
if(cmptext(t_out,bad_name))
|
||||
return //(not case sensitive)
|
||||
|
||||
return t_out
|
||||
|
||||
@@ -345,8 +362,10 @@ var/list/binary = list("0","1")
|
||||
//This was coded to handle DNA gene-splicing.
|
||||
/proc/merge_text(into, from, null_char="_")
|
||||
. = ""
|
||||
if(!istext(into)) into = ""
|
||||
if(!istext(from)) from = ""
|
||||
if(!istext(into))
|
||||
into = ""
|
||||
if(!istext(from))
|
||||
from = ""
|
||||
var/null_ascii = istext(null_char) ? text2ascii(null_char,1) : null_char
|
||||
|
||||
var/previous = 0
|
||||
@@ -379,7 +398,8 @@ var/list/binary = list("0","1")
|
||||
var/len = length(needles)
|
||||
for(var/i=1, i<=len, i++)
|
||||
temp = findtextEx(haystack, ascii2text(text2ascii(needles,i)), start, end) //Note: ascii2text(text2ascii) is faster than copytext()
|
||||
if(temp) end = temp
|
||||
if(temp)
|
||||
end = temp
|
||||
return end
|
||||
|
||||
|
||||
|
||||
+128
-64
@@ -21,13 +21,19 @@
|
||||
for(var/i=1, i<=len, i++)
|
||||
var/num = text2ascii(hex,i)
|
||||
switch(num)
|
||||
if(48 to 57) num -= 48 //0-9
|
||||
if(97 to 102) num -= 87 //a-f
|
||||
if(65 to 70) num -= 55 //A-F
|
||||
if(45) negative = 1//-
|
||||
if(48 to 57)
|
||||
num -= 48 //0-9
|
||||
if(97 to 102)
|
||||
num -= 87 //a-f
|
||||
if(65 to 70)
|
||||
num -= 55 //A-F
|
||||
if(45)
|
||||
negative = 1//-
|
||||
else
|
||||
if(num) break
|
||||
else continue
|
||||
if(num)
|
||||
break
|
||||
else
|
||||
continue
|
||||
. *= 16
|
||||
. += num
|
||||
if(negative)
|
||||
@@ -48,16 +54,21 @@
|
||||
var/i=0
|
||||
while(1)
|
||||
if(len<=0)
|
||||
if(!num) break
|
||||
if(!num)
|
||||
break
|
||||
else
|
||||
if(i>=len) break
|
||||
if(i>=len)
|
||||
break
|
||||
var/remainder = num/16
|
||||
num = round(remainder)
|
||||
remainder = (remainder - num) * 16
|
||||
switch(remainder)
|
||||
if(9,8,7,6,5,4,3,2,1) . = "[remainder]" + .
|
||||
if(10,11,12,13,14,15) . = ascii2text(remainder+87) + .
|
||||
else . = "0" + .
|
||||
if(9,8,7,6,5,4,3,2,1)
|
||||
. = "[remainder]" + .
|
||||
if(10,11,12,13,14,15)
|
||||
. = ascii2text(remainder+87) + .
|
||||
else
|
||||
. = "0" + .
|
||||
i++
|
||||
return .
|
||||
|
||||
@@ -179,7 +190,8 @@
|
||||
//Case Sensitive!
|
||||
/proc/text2listEx(text, delimiter="\n")
|
||||
var/delim_len = length(delimiter)
|
||||
if(delim_len < 1) return list(text)
|
||||
if(delim_len < 1)
|
||||
return list(text)
|
||||
. = list()
|
||||
var/last_found = 1
|
||||
var/found
|
||||
@@ -243,28 +255,44 @@
|
||||
|
||||
degree = SimplifyDegrees(degree)
|
||||
|
||||
if(degree < 45) return NORTH
|
||||
if(degree < 90) return NORTHEAST
|
||||
if(degree < 135) return EAST
|
||||
if(degree < 180) return SOUTHEAST
|
||||
if(degree < 225) return SOUTH
|
||||
if(degree < 270) return SOUTHWEST
|
||||
if(degree < 315) return WEST
|
||||
if(degree < 45)
|
||||
return NORTH
|
||||
if(degree < 90)
|
||||
return NORTHEAST
|
||||
if(degree < 135)
|
||||
return EAST
|
||||
if(degree < 180)
|
||||
return SOUTHEAST
|
||||
if(degree < 225)
|
||||
return SOUTH
|
||||
if(degree < 270)
|
||||
return SOUTHWEST
|
||||
if(degree < 315)
|
||||
return WEST
|
||||
return NORTH|WEST
|
||||
|
||||
//returns the north-zero clockwise angle in degrees, given a direction
|
||||
|
||||
/proc/dir2angle(D)
|
||||
switch(D)
|
||||
if(NORTH) return 0
|
||||
if(SOUTH) return 180
|
||||
if(EAST) return 90
|
||||
if(WEST) return 270
|
||||
if(NORTHEAST) return 45
|
||||
if(SOUTHEAST) return 135
|
||||
if(NORTHWEST) return 315
|
||||
if(SOUTHWEST) return 225
|
||||
else return null
|
||||
if(NORTH)
|
||||
return 0
|
||||
if(SOUTH)
|
||||
return 180
|
||||
if(EAST)
|
||||
return 90
|
||||
if(WEST)
|
||||
return 270
|
||||
if(NORTHEAST)
|
||||
return 45
|
||||
if(SOUTHEAST)
|
||||
return 135
|
||||
if(NORTHWEST)
|
||||
return 315
|
||||
if(SOUTHWEST)
|
||||
return 225
|
||||
else
|
||||
return null
|
||||
|
||||
//Returns the angle in english
|
||||
/proc/angle2text(degree)
|
||||
@@ -273,26 +301,43 @@
|
||||
//Converts a blend_mode constant to one acceptable to icon.Blend()
|
||||
/proc/blendMode2iconMode(blend_mode)
|
||||
switch(blend_mode)
|
||||
if(BLEND_MULTIPLY) return ICON_MULTIPLY
|
||||
if(BLEND_ADD) return ICON_ADD
|
||||
if(BLEND_SUBTRACT) return ICON_SUBTRACT
|
||||
else return ICON_OVERLAY
|
||||
if(BLEND_MULTIPLY)
|
||||
return ICON_MULTIPLY
|
||||
if(BLEND_ADD)
|
||||
return ICON_ADD
|
||||
if(BLEND_SUBTRACT)
|
||||
return ICON_SUBTRACT
|
||||
else
|
||||
return ICON_OVERLAY
|
||||
|
||||
//Converts a rights bitfield into a string
|
||||
/proc/rights2text(rights, seperator="", list/adds, list/subs)
|
||||
if(rights & R_BUILDMODE) . += "[seperator]+BUILDMODE"
|
||||
if(rights & R_ADMIN) . += "[seperator]+ADMIN"
|
||||
if(rights & R_BAN) . += "[seperator]+BAN"
|
||||
if(rights & R_FUN) . += "[seperator]+FUN"
|
||||
if(rights & R_SERVER) . += "[seperator]+SERVER"
|
||||
if(rights & R_DEBUG) . += "[seperator]+DEBUG"
|
||||
if(rights & R_POSSESS) . += "[seperator]+POSSESS"
|
||||
if(rights & R_PERMISSIONS) . += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_STEALTH) . += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE) . += "[seperator]+REJUVINATE"
|
||||
if(rights & R_VAREDIT) . += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS) . += "[seperator]+SOUND"
|
||||
if(rights & R_SPAWN) . += "[seperator]+SPAWN"
|
||||
if(rights & R_BUILDMODE)
|
||||
. += "[seperator]+BUILDMODE"
|
||||
if(rights & R_ADMIN)
|
||||
. += "[seperator]+ADMIN"
|
||||
if(rights & R_BAN)
|
||||
. += "[seperator]+BAN"
|
||||
if(rights & R_FUN)
|
||||
. += "[seperator]+FUN"
|
||||
if(rights & R_SERVER)
|
||||
. += "[seperator]+SERVER"
|
||||
if(rights & R_DEBUG)
|
||||
. += "[seperator]+DEBUG"
|
||||
if(rights & R_POSSESS)
|
||||
. += "[seperator]+POSSESS"
|
||||
if(rights & R_PERMISSIONS)
|
||||
. += "[seperator]+PERMISSIONS"
|
||||
if(rights & R_STEALTH)
|
||||
. += "[seperator]+STEALTH"
|
||||
if(rights & R_REJUVINATE)
|
||||
. += "[seperator]+REJUVINATE"
|
||||
if(rights & R_VAREDIT)
|
||||
. += "[seperator]+VAREDIT"
|
||||
if(rights & R_SOUNDS)
|
||||
. += "[seperator]+SOUND"
|
||||
if(rights & R_SPAWN)
|
||||
. += "[seperator]+SPAWN"
|
||||
|
||||
for(var/verbpath in adds)
|
||||
. += "[seperator]+[verbpath]"
|
||||
@@ -302,11 +347,16 @@
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
switch(ui_style)
|
||||
if("Retro") return 'icons/mob/screen_retro.dmi'
|
||||
if("Plasmafire") return 'icons/mob/screen_plasmafire.dmi'
|
||||
if("Slimecore") return 'icons/mob/screen_slimecore.dmi'
|
||||
if("Operative") return 'icons/mob/screen_operative.dmi'
|
||||
else return 'icons/mob/screen_midnight.dmi'
|
||||
if("Retro")
|
||||
return 'icons/mob/screen_retro.dmi'
|
||||
if("Plasmafire")
|
||||
return 'icons/mob/screen_plasmafire.dmi'
|
||||
if("Slimecore")
|
||||
return 'icons/mob/screen_slimecore.dmi'
|
||||
if("Operative")
|
||||
return 'icons/mob/screen_operative.dmi'
|
||||
else
|
||||
return 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
//colour formats
|
||||
/proc/rgb2hsl(red, green, blue)
|
||||
@@ -318,18 +368,25 @@
|
||||
var/hue=0;var/saturation=0;var/lightness=0;
|
||||
lightness = (max + min)/2
|
||||
if(range != 0)
|
||||
if(lightness < 0.5) saturation = range/(max+min)
|
||||
else saturation = range/(2-max-min)
|
||||
if(lightness < 0.5)
|
||||
saturation = range/(max+min)
|
||||
else
|
||||
saturation = range/(2-max-min)
|
||||
|
||||
var/dred = ((max-red)/(6*max)) + 0.5
|
||||
var/dgreen = ((max-green)/(6*max)) + 0.5
|
||||
var/dblue = ((max-blue)/(6*max)) + 0.5
|
||||
|
||||
if(max==red) hue = dblue - dgreen
|
||||
else if(max==green) hue = dred - dblue + (1/3)
|
||||
else hue = dgreen - dred + (2/3)
|
||||
if(hue < 0) hue++
|
||||
else if(hue > 1) hue--
|
||||
if(max==red)
|
||||
hue = dblue - dgreen
|
||||
else if(max==green)
|
||||
hue = dred - dblue + (1/3)
|
||||
else
|
||||
hue = dgreen - dred + (2/3)
|
||||
if(hue < 0)
|
||||
hue++
|
||||
else if(hue > 1)
|
||||
hue--
|
||||
|
||||
return list(hue, saturation, lightness)
|
||||
|
||||
@@ -341,8 +398,10 @@
|
||||
blue = red
|
||||
else
|
||||
var/a;var/b;
|
||||
if(lightness < 0.5) b = lightness*(1+saturation)
|
||||
else b = (lightness+saturation) - (saturation*lightness)
|
||||
if(lightness < 0.5)
|
||||
b = lightness*(1+saturation)
|
||||
else
|
||||
b = (lightness+saturation) - (saturation*lightness)
|
||||
a = 2*lightness - b
|
||||
|
||||
red = round(255 * hue2rgb(a, b, hue+(1/3)))
|
||||
@@ -352,11 +411,16 @@
|
||||
return list(red, green, blue)
|
||||
|
||||
/proc/hue2rgb(a, b, hue)
|
||||
if(hue < 0) hue++
|
||||
else if(hue > 1) hue--
|
||||
if(6*hue < 1) return (a+(b-a)*6*hue)
|
||||
if(2*hue < 1) return b
|
||||
if(3*hue < 2) return (a+(b-a)*((2/3)-hue)*6)
|
||||
if(hue < 0)
|
||||
hue++
|
||||
else if(hue > 1)
|
||||
hue--
|
||||
if(6*hue < 1)
|
||||
return (a+(b-a)*6*hue)
|
||||
if(2*hue < 1)
|
||||
return b
|
||||
if(3*hue < 2)
|
||||
return (a+(b-a)*((2/3)-hue)*6)
|
||||
return a
|
||||
|
||||
// Very ugly, BYOND doesn't support unix time and rounding errors make it really hard to convert it to BYOND time.
|
||||
|
||||
+73
-37
@@ -27,7 +27,8 @@
|
||||
return
|
||||
|
||||
/proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams.
|
||||
if(!start || !end) return 0
|
||||
if(!start || !end)
|
||||
return 0
|
||||
var/dy
|
||||
var/dx
|
||||
dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y)
|
||||
@@ -117,18 +118,25 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
//Now to find a box from center location and make that our destination.
|
||||
for(var/turf/T in block(locate(center.x+b1xerror,center.y+b1yerror,location.z), locate(center.x+b2xerror,center.y+b2yerror,location.z) ))
|
||||
if(density&&T.density) continue//If density was specified.
|
||||
if(T.x>world.maxx || T.x<1) continue//Don't want them to teleport off the map.
|
||||
if(T.y>world.maxy || T.y<1) continue
|
||||
if(density&&T.density)
|
||||
continue//If density was specified.
|
||||
if(T.x>world.maxx || T.x<1)
|
||||
continue//Don't want them to teleport off the map.
|
||||
if(T.y>world.maxy || T.y<1)
|
||||
continue
|
||||
destination_list += T
|
||||
if(destination_list.len)
|
||||
destination = pick(destination_list)
|
||||
else return
|
||||
else
|
||||
return
|
||||
|
||||
else//Same deal here.
|
||||
if(density&&destination.density) return
|
||||
if(destination.x>world.maxx || destination.x<1) return
|
||||
if(destination.y>world.maxy || destination.y<1) return
|
||||
if(density&&destination.density)
|
||||
return
|
||||
if(destination.x>world.maxx || destination.x<1)
|
||||
return
|
||||
if(destination.y>world.maxy || destination.y<1)
|
||||
return
|
||||
else return
|
||||
|
||||
return destination
|
||||
@@ -257,15 +265,19 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/select_active_free_borg(mob/user)
|
||||
var/list/borgs = active_free_borgs()
|
||||
if(borgs.len)
|
||||
if(user) . = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in borgs
|
||||
else . = pick(borgs)
|
||||
if(user)
|
||||
. = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in borgs
|
||||
else
|
||||
. = pick(borgs)
|
||||
return .
|
||||
|
||||
/proc/select_active_ai(mob/user)
|
||||
var/list/ais = active_ais()
|
||||
if(ais.len)
|
||||
if(user) . = input(user,"AI signals detected:", "AI Selection", ais[1]) in ais
|
||||
else . = pick(ais)
|
||||
if(user)
|
||||
. = input(user,"AI signals detected:", "AI Selection", ais[1]) in ais
|
||||
else
|
||||
. = pick(ais)
|
||||
return .
|
||||
|
||||
//Returns a list of all items of interest with their name
|
||||
@@ -361,7 +373,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
var/key
|
||||
var/ckey
|
||||
|
||||
if(!whom) return "*null*"
|
||||
if(!whom)
|
||||
return "*null*"
|
||||
if(istype(whom, /client))
|
||||
C = whom
|
||||
M = C.mob
|
||||
@@ -524,10 +537,13 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
if(current != target_turf)
|
||||
current = get_step_towards(current, target_turf)
|
||||
while(current != target_turf)
|
||||
if(steps > length) return 0
|
||||
if(current.opacity) return 0
|
||||
if(steps > length)
|
||||
return 0
|
||||
if(current.opacity)
|
||||
return 0
|
||||
for(var/atom/A in current)
|
||||
if(A.opacity) return 0
|
||||
if(A.opacity)
|
||||
return 0
|
||||
current = get_step_towards(current, target_turf)
|
||||
steps++
|
||||
|
||||
@@ -574,16 +590,21 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
turf_last2 = get_step(turf_last2,dir_alt2)
|
||||
breakpoint++
|
||||
|
||||
if(!free_tile) return get_step(ref, base_dir)
|
||||
else return get_step_towards(ref,free_tile)
|
||||
if(!free_tile)
|
||||
return get_step(ref, base_dir)
|
||||
else
|
||||
return get_step_towards(ref,free_tile)
|
||||
|
||||
else return get_step(ref, base_dir)
|
||||
else
|
||||
return get_step(ref, base_dir)
|
||||
|
||||
//Takes: Anything that could possibly have variables and a varname to check.
|
||||
//Returns: 1 if found, 0 if not.
|
||||
/proc/hasvar(datum/A, varname)
|
||||
if(A.vars.Find(lowertext(varname))) return 1
|
||||
else return 0
|
||||
if(A.vars.Find(lowertext(varname)))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Repopulates sortedAreas list
|
||||
/proc/SortAreas()
|
||||
@@ -601,15 +622,18 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all areas of that type in the world.
|
||||
/proc/get_areas(areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/areas = new/list()
|
||||
for(var/area/N in world)
|
||||
if(istype(N, areatype)) areas += N
|
||||
if(istype(N, areatype))
|
||||
areas += N
|
||||
return areas
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
@@ -617,7 +641,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/get_area_turfs(areatype, target_z = 0)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
@@ -633,8 +658,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all atoms (objs, turfs, mobs) in areas of that type of that type in the world.
|
||||
/proc/get_area_all_atoms(areatype)
|
||||
if(!areatype) return null
|
||||
if(istext(areatype)) areatype = text2path(areatype)
|
||||
if(!areatype)
|
||||
return null
|
||||
if(istext(areatype))
|
||||
areatype = text2path(areatype)
|
||||
if(isarea(areatype))
|
||||
var/area/areatemp = areatype
|
||||
areatype = areatemp.type
|
||||
@@ -672,15 +699,24 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
return
|
||||
|
||||
/proc/parse_zone(zone)
|
||||
if(zone == "r_hand") return "right hand"
|
||||
else if (zone == "l_hand") return "left hand"
|
||||
else if (zone == "l_arm") return "left arm"
|
||||
else if (zone == "r_arm") return "right arm"
|
||||
else if (zone == "l_leg") return "left leg"
|
||||
else if (zone == "r_leg") return "right leg"
|
||||
else if (zone == "l_foot") return "left foot"
|
||||
else if (zone == "r_foot") return "right foot"
|
||||
else return zone
|
||||
if(zone == "r_hand")
|
||||
return "right hand"
|
||||
else if (zone == "l_hand")
|
||||
return "left hand"
|
||||
else if (zone == "l_arm")
|
||||
return "left arm"
|
||||
else if (zone == "r_arm")
|
||||
return "right arm"
|
||||
else if (zone == "l_leg")
|
||||
return "left leg"
|
||||
else if (zone == "r_leg")
|
||||
return "right leg"
|
||||
else if (zone == "l_foot")
|
||||
return "left foot"
|
||||
else if (zone == "r_foot")
|
||||
return "right foot"
|
||||
else
|
||||
return zone
|
||||
|
||||
|
||||
//Gets the turf this atom inhabits
|
||||
@@ -1177,4 +1213,4 @@ proc/shift_proximity(atom/checker, atom/A, range, atom/B, newrange)
|
||||
for(var/E in O)
|
||||
var/turf/F = E
|
||||
F.proximity_checkers |= checker
|
||||
return 1
|
||||
return 1
|
||||
|
||||
+18
-9
@@ -302,22 +302,31 @@
|
||||
|
||||
// Simple helper to face what you clicked on, in case it should be needed in more than one place
|
||||
/mob/proc/face_atom(atom/A)
|
||||
if( buckled || stat != CONSCIOUS || !A || !x || !y || !A.x || !A.y ) return
|
||||
if( buckled || stat != CONSCIOUS || !A || !x || !y || !A.x || !A.y )
|
||||
return
|
||||
var/dx = A.x - x
|
||||
var/dy = A.y - y
|
||||
if(!dx && !dy) // Wall items are graphically shifted but on the floor
|
||||
if(A.pixel_y > 16) dir = NORTH
|
||||
else if(A.pixel_y < -16)dir = SOUTH
|
||||
else if(A.pixel_x > 16) dir = EAST
|
||||
else if(A.pixel_x < -16)dir = WEST
|
||||
if(A.pixel_y > 16)
|
||||
dir = NORTH
|
||||
else if(A.pixel_y < -16)
|
||||
dir = SOUTH
|
||||
else if(A.pixel_x > 16)
|
||||
dir = EAST
|
||||
else if(A.pixel_x < -16)
|
||||
dir = WEST
|
||||
return
|
||||
|
||||
if(abs(dx) < abs(dy))
|
||||
if(dy > 0) dir = NORTH
|
||||
else dir = SOUTH
|
||||
if(dy > 0)
|
||||
dir = NORTH
|
||||
else
|
||||
dir = SOUTH
|
||||
else
|
||||
if(dx > 0) dir = EAST
|
||||
else dir = WEST
|
||||
if(dx > 0)
|
||||
dir = EAST
|
||||
else
|
||||
dir = WEST
|
||||
|
||||
/obj/screen/click_catcher
|
||||
icon = 'icons/mob/screen_full.dmi'
|
||||
|
||||
+56
-28
@@ -179,23 +179,39 @@ var/datum/global_hud/global_hud = new()
|
||||
if(H.handcuffed)
|
||||
H.handcuffed.screen_loc = null //no handcuffs in my UI!
|
||||
if(inventory_shown && hud_shown)
|
||||
if(H.shoes) H.shoes.screen_loc = ui_shoes
|
||||
if(H.gloves) H.gloves.screen_loc = ui_gloves
|
||||
if(H.ears) H.ears.screen_loc = ui_ears
|
||||
if(H.glasses) H.glasses.screen_loc = ui_glasses
|
||||
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
|
||||
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
|
||||
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
|
||||
if(H.head) H.head.screen_loc = ui_head
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = ui_shoes
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = ui_gloves
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = ui_ears
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = ui_glasses
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = ui_iclothing
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = ui_oclothing
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = ui_mask
|
||||
if(H.head)
|
||||
H.head.screen_loc = ui_head
|
||||
else
|
||||
if(H.shoes) H.shoes.screen_loc = null
|
||||
if(H.gloves) H.gloves.screen_loc = null
|
||||
if(H.ears) H.ears.screen_loc = null
|
||||
if(H.glasses) H.glasses.screen_loc = null
|
||||
if(H.w_uniform) H.w_uniform.screen_loc = null
|
||||
if(H.wear_suit) H.wear_suit.screen_loc = null
|
||||
if(H.wear_mask) H.wear_mask.screen_loc = null
|
||||
if(H.head) H.head.screen_loc = null
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = null
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = null
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = null
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = null
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = null
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = null
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = null
|
||||
if(H.head)
|
||||
H.head.screen_loc = null
|
||||
|
||||
|
||||
/datum/hud/proc/persistant_inventory_update()
|
||||
@@ -205,19 +221,31 @@ var/datum/global_hud/global_hud = new()
|
||||
if(ishuman(mymob))
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
if(hud_shown)
|
||||
if(H.s_store) H.s_store.screen_loc = ui_sstore1
|
||||
if(H.wear_id) H.wear_id.screen_loc = ui_id
|
||||
if(H.belt) H.belt.screen_loc = ui_belt
|
||||
if(H.back) H.back.screen_loc = ui_back
|
||||
if(H.l_store) H.l_store.screen_loc = ui_storage1
|
||||
if(H.r_store) H.r_store.screen_loc = ui_storage2
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = ui_sstore1
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = ui_id
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = ui_belt
|
||||
if(H.back)
|
||||
H.back.screen_loc = ui_back
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = ui_storage1
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = ui_storage2
|
||||
else
|
||||
if(H.s_store) H.s_store.screen_loc = null
|
||||
if(H.wear_id) H.wear_id.screen_loc = null
|
||||
if(H.belt) H.belt.screen_loc = null
|
||||
if(H.back) H.back.screen_loc = null
|
||||
if(H.l_store) H.l_store.screen_loc = null
|
||||
if(H.r_store) H.r_store.screen_loc = null
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = null
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = null
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = null
|
||||
if(H.back)
|
||||
H.back.screen_loc = null
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = null
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = null
|
||||
|
||||
|
||||
/datum/hud/proc/instantiate()
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
for(var/datum/mutation/human/HM in dna.mutations)
|
||||
override += HM.on_attack_hand(src, A)
|
||||
|
||||
if(override) return
|
||||
if(override)
|
||||
return
|
||||
|
||||
A.attack_hand(src)
|
||||
|
||||
@@ -82,7 +83,8 @@
|
||||
/mob/living/carbon/monkey/RestrainedClickOn(atom/A)
|
||||
if(..())
|
||||
return
|
||||
if(a_intent != "harm" || !ismob(A)) return
|
||||
if(a_intent != "harm" || !ismob(A))
|
||||
return
|
||||
if(is_muzzled())
|
||||
return
|
||||
var/mob/living/carbon/ML = A
|
||||
@@ -95,7 +97,8 @@
|
||||
ML.apply_damage(rand(1,3), BRUTE, affecting, armor)
|
||||
ML.visible_message("<span class='danger'>[name] bites [ML]!</span>", \
|
||||
"<span class='userdanger'>[name] bites [ML]!</span>")
|
||||
if(armor >= 2) return
|
||||
if(armor >= 2)
|
||||
return
|
||||
for(var/datum/disease/D in viruses)
|
||||
ML.ForceContractDisease(D)
|
||||
else
|
||||
|
||||
@@ -11,7 +11,8 @@ var/const/tk_maxrange = 15
|
||||
By default, emulate the user's unarmed attack
|
||||
*/
|
||||
/atom/proc/attack_tk(mob/user)
|
||||
if(user.stat) return
|
||||
if(user.stat)
|
||||
return
|
||||
user.UnarmedAttack(src,0) // attack_hand, attack_paw, etc
|
||||
return
|
||||
|
||||
@@ -29,7 +30,8 @@ var/const/tk_maxrange = 15
|
||||
attack_self(user)
|
||||
|
||||
/obj/attack_tk(mob/user)
|
||||
if(user.stat) return
|
||||
if(user.stat)
|
||||
return
|
||||
if(anchored)
|
||||
..()
|
||||
return
|
||||
@@ -41,7 +43,8 @@ var/const/tk_maxrange = 15
|
||||
return
|
||||
|
||||
/obj/item/attack_tk(mob/user)
|
||||
if(user.stat) return
|
||||
if(user.stat)
|
||||
return
|
||||
var/obj/item/tk_grab/O = new(src)
|
||||
user.put_in_active_hand(O)
|
||||
O.host = user
|
||||
@@ -86,7 +89,8 @@ var/const/tk_maxrange = 15
|
||||
|
||||
//stops TK grabs being equipped anywhere but into hands
|
||||
/obj/item/tk_grab/equipped(mob/user, slot)
|
||||
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
|
||||
if( (slot == slot_l_hand) || (slot== slot_r_hand) )
|
||||
return
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -96,8 +100,10 @@ var/const/tk_maxrange = 15
|
||||
focus.attack_self_tk(user)
|
||||
|
||||
/obj/item/tk_grab/afterattack(atom/target, mob/living/carbon/user, proximity, params)//TODO: go over this
|
||||
if(!target || !user) return
|
||||
if(last_throw+3 > world.time) return
|
||||
if(!target || !user)
|
||||
return
|
||||
if(last_throw+3 > world.time)
|
||||
return
|
||||
if(!host || host != user)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -148,7 +154,8 @@ var/const/tk_maxrange = 15
|
||||
|
||||
|
||||
/obj/item/tk_grab/proc/focus_object(obj/target, mob/living/user)
|
||||
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
|
||||
if(!istype(target,/obj))
|
||||
return//Cant throw non objects atm might let it do mobs later
|
||||
if(target.anchored || !isturf(target.loc))
|
||||
qdel(src)
|
||||
return
|
||||
@@ -159,7 +166,8 @@ var/const/tk_maxrange = 15
|
||||
|
||||
|
||||
/obj/item/tk_grab/proc/apply_focus_overlay()
|
||||
if(!focus) return
|
||||
if(!focus)
|
||||
return
|
||||
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
|
||||
O.name = "sparkles"
|
||||
O.anchored = 1
|
||||
@@ -187,12 +195,15 @@ var/const/tk_maxrange = 15
|
||||
/obj/item/tk_grab/proc/check_path()
|
||||
var/turf/ref = get_turf(src.loc)
|
||||
var/turf/target = get_turf(focus.loc)
|
||||
if(!ref || !target) return 0
|
||||
if(!ref || !target)
|
||||
return 0
|
||||
var/distance = get_dist(ref, target)
|
||||
if(distance >= 10) return 0
|
||||
if(distance >= 10)
|
||||
return 0
|
||||
for(var/i = 1 to distance)
|
||||
ref = get_step_to(ref, target, 0)
|
||||
if(ref != target) return 0
|
||||
if(ref != target)
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
|
||||
@@ -200,7 +211,8 @@ var/const/tk_maxrange = 15
|
||||
/*
|
||||
if(istype(user, /mob/living/carbon))
|
||||
if(user:mutations & TK && get_dist(source, user) <= 7)
|
||||
if(user:get_active_hand()) return 0
|
||||
if(user:get_active_hand())
|
||||
return 0
|
||||
var/X = source:x
|
||||
var/Y = source:y
|
||||
var/Z = source:z
|
||||
|
||||
@@ -211,7 +211,8 @@
|
||||
var/list/Lines = file2list(filename)
|
||||
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
@@ -576,7 +577,8 @@
|
||||
|
||||
var/datum/votablemap/currentmap = null
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
@@ -625,7 +627,8 @@
|
||||
/datum/configuration/proc/loadsql(filename)
|
||||
var/list/Lines = file2list(filename)
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
if(!t)
|
||||
continue
|
||||
|
||||
t = trim(t)
|
||||
if(length(t) == 0)
|
||||
|
||||
@@ -62,12 +62,17 @@ var/datum/subsystem/events/SSevent
|
||||
|
||||
var/sum_of_weights = 0
|
||||
for(var/datum/round_event_control/E in control)
|
||||
if(E.occurrences >= E.max_occurrences) continue
|
||||
if(E.earliest_start >= world.time) continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist)) continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue
|
||||
if(E.occurrences >= E.max_occurrences)
|
||||
continue
|
||||
if(E.earliest_start >= world.time)
|
||||
continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist))
|
||||
continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist))
|
||||
continue
|
||||
if(E.holidayID)
|
||||
if(!holidays || !holidays[E.holidayID]) continue
|
||||
if(!holidays || !holidays[E.holidayID])
|
||||
continue
|
||||
if(E.weight < 0) //for round-start events etc.
|
||||
if(E.runEvent() == PROCESS_KILL)
|
||||
E.max_occurrences = 0
|
||||
@@ -81,12 +86,17 @@ var/datum/subsystem/events/SSevent
|
||||
sum_of_weights = rand(0,sum_of_weights) //reusing this variable. It now represents the 'weight' we want to select
|
||||
|
||||
for(var/datum/round_event_control/E in control)
|
||||
if(E.occurrences >= E.max_occurrences) continue
|
||||
if(E.earliest_start >= world.time) continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist)) continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist)) continue
|
||||
if(E.occurrences >= E.max_occurrences)
|
||||
continue
|
||||
if(E.earliest_start >= world.time)
|
||||
continue
|
||||
if(E.gamemode_blacklist.len && (ticker.mode.config_tag in E.gamemode_blacklist))
|
||||
continue
|
||||
if(E.gamemode_whitelist.len && !(ticker.mode.config_tag in E.gamemode_whitelist))
|
||||
continue
|
||||
if(E.holidayID)
|
||||
if(!holidays || !holidays[E.holidayID]) continue
|
||||
if(!holidays || !holidays[E.holidayID])
|
||||
continue
|
||||
sum_of_weights -= E.weight
|
||||
|
||||
if(sum_of_weights <= 0) //we've hit our goal
|
||||
@@ -172,7 +182,8 @@ var/datum/subsystem/events/SSevent
|
||||
|
||||
//sets up the holidays and holidays list
|
||||
/datum/subsystem/events/proc/getHoliday()
|
||||
if(!config.allow_holidays) return // Holiday stuff was not enabled in the config!
|
||||
if(!config.allow_holidays)
|
||||
return // Holiday stuff was not enabled in the config!
|
||||
|
||||
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
|
||||
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
|
||||
|
||||
@@ -31,34 +31,44 @@ var/datum/subsystem/job/SSjob
|
||||
|
||||
for(var/J in all_jobs)
|
||||
var/datum/job/job = new J()
|
||||
if(!job) continue
|
||||
if(job.faction != faction) continue
|
||||
if(!job.config_check()) continue
|
||||
if(!job)
|
||||
continue
|
||||
if(job.faction != faction)
|
||||
continue
|
||||
if(!job.config_check())
|
||||
continue
|
||||
occupations += job
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/datum/subsystem/job/proc/Debug(text)
|
||||
if(!Debug2) return 0
|
||||
if(!Debug2)
|
||||
return 0
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
|
||||
|
||||
/datum/subsystem/job/proc/GetJob(rank)
|
||||
if(!rank) return null
|
||||
if(!rank)
|
||||
return null
|
||||
for(var/datum/job/J in occupations)
|
||||
if(!J) continue
|
||||
if(J.title == rank) return J
|
||||
if(!J)
|
||||
continue
|
||||
if(J.title == rank)
|
||||
return J
|
||||
return null
|
||||
|
||||
/datum/subsystem/job/proc/AssignRole(mob/new_player/player, rank, latejoin=0)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if(player && player.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job) return 0
|
||||
if(jobban_isbanned(player, rank)) return 0
|
||||
if(!job.player_old_enough(player.client)) return 0
|
||||
if(!job)
|
||||
return 0
|
||||
if(jobban_isbanned(player, rank))
|
||||
return 0
|
||||
if(!job.player_old_enough(player.client))
|
||||
return 0
|
||||
var/position_limit = job.total_positions
|
||||
if(!latejoin)
|
||||
position_limit = job.spawn_positions
|
||||
@@ -147,10 +157,13 @@ var/datum/subsystem/job/SSjob
|
||||
for(var/level = 1 to 3)
|
||||
for(var/command_position in command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job) continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1) continue
|
||||
if(!job)
|
||||
continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
|
||||
continue
|
||||
var/list/candidates = FindOccupationCandidates(job, level)
|
||||
if(!candidates.len) continue
|
||||
if(!candidates.len)
|
||||
continue
|
||||
var/mob/new_player/candidate = pick(candidates)
|
||||
if(AssignRole(candidate, command_position))
|
||||
return 1
|
||||
@@ -162,10 +175,13 @@ var/datum/subsystem/job/SSjob
|
||||
/datum/subsystem/job/proc/CheckHeadPositions(level)
|
||||
for(var/command_position in command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job) continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1) continue
|
||||
if(!job)
|
||||
continue
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
|
||||
continue
|
||||
var/list/candidates = FindOccupationCandidates(job, level)
|
||||
if(!candidates.len) continue
|
||||
if(!candidates.len)
|
||||
continue
|
||||
var/mob/new_player/candidate = pick(candidates)
|
||||
AssignRole(candidate, command_position)
|
||||
return
|
||||
@@ -212,7 +228,8 @@ var/datum/subsystem/job/SSjob
|
||||
initial_players_to_assign = unassigned.len
|
||||
|
||||
Debug("DO, Len: [unassigned.len]")
|
||||
if(unassigned.len == 0) return 0
|
||||
if(unassigned.len == 0)
|
||||
return 0
|
||||
|
||||
//Scale number of open security officer slots to population
|
||||
setup_officer_positions()
|
||||
|
||||
@@ -109,7 +109,8 @@ var/datum/subsystem/lighting/SSlighting
|
||||
var/msg = "## DEBUG: [time2text(world.timeofday)] [name] subsystem restarted. Reports:\n"
|
||||
for(var/varname in SSlighting.vars)
|
||||
switch(varname)
|
||||
if("tag","bestF","type","parent_type","vars") continue
|
||||
if("tag","bestF","type","parent_type","vars")
|
||||
continue
|
||||
else
|
||||
var/varval1 = SSlighting.vars[varname]
|
||||
var/varval2 = vars[varname]
|
||||
|
||||
@@ -198,11 +198,13 @@ var/datum/subsystem/pai/SSpai
|
||||
|
||||
/datum/subsystem/pai/proc/question(client/C)
|
||||
spawn(0)
|
||||
if(!C) return
|
||||
if(!C)
|
||||
return
|
||||
asked.Add(C.key)
|
||||
asked[C.key] = world.time
|
||||
var/response = tgalert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round", StealFocus=0, Timeout=askDelay)
|
||||
if(!C) return //handle logouts that happen whilst the alert is waiting for a response.
|
||||
if(!C)
|
||||
return //handle logouts that happen whilst the alert is waiting for a response.
|
||||
if(response == "Yes")
|
||||
recruitWindow(C.mob)
|
||||
else if (response == "Never for this round")
|
||||
|
||||
@@ -277,7 +277,8 @@ var/datum/subsystem/shuttle/SSshuttle
|
||||
contains = object.contains
|
||||
|
||||
for(var/typepath in contains)
|
||||
if(!typepath) continue
|
||||
if(!typepath)
|
||||
continue
|
||||
var/atom/A = new typepath(Crate)
|
||||
if(object.amount && A.vars.Find("amount") && A:amount)
|
||||
A:amount = object.amount
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
/*
|
||||
/obj/docking_port/mobile/emergency/findTransitDock()
|
||||
. = SSshuttle.getDock("emergency_transit")
|
||||
if(.) return .
|
||||
if(.)
|
||||
return .
|
||||
return ..()
|
||||
*/
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
/obj/docking_port/mobile/supply/dock()
|
||||
. = ..()
|
||||
if(.) return .
|
||||
if(.)
|
||||
return .
|
||||
|
||||
buy()
|
||||
sell()
|
||||
@@ -46,11 +47,13 @@
|
||||
|
||||
var/list/emptyTurfs = list()
|
||||
for(var/turf/simulated/floor/T in areaInstance)
|
||||
if(T.density || T.contents.len) continue
|
||||
if(T.density || T.contents.len)
|
||||
continue
|
||||
emptyTurfs += T
|
||||
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(!SO.object) continue
|
||||
if(!SO.object)
|
||||
continue
|
||||
|
||||
var/turf/T = pick_n_take(emptyTurfs) //turf we will place it in
|
||||
if(!T)
|
||||
@@ -81,7 +84,8 @@
|
||||
var/pointsEarned
|
||||
|
||||
for(var/atom/movable/MA in areaInstance)
|
||||
if(MA.anchored) continue
|
||||
if(MA.anchored)
|
||||
continue
|
||||
SSshuttle.sold_atoms += " [MA.name]"
|
||||
|
||||
// Must be in a crate (or a critter crate)!
|
||||
@@ -147,7 +151,8 @@
|
||||
// Sell tech levels
|
||||
if(istype(thing, /obj/item/weapon/disk/tech_disk))
|
||||
var/obj/item/weapon/disk/tech_disk/disk = thing
|
||||
if(!disk.stored) continue
|
||||
if(!disk.stored)
|
||||
continue
|
||||
var/datum/tech/tech = disk.stored
|
||||
|
||||
var/cost = tech.getCost(SSshuttle.techLevels[tech.id])
|
||||
@@ -159,9 +164,11 @@
|
||||
// Sell max reliablity designs
|
||||
if(istype(thing, /obj/item/weapon/disk/design_disk))
|
||||
var/obj/item/weapon/disk/design_disk/disk = thing
|
||||
if(!disk.blueprint) continue
|
||||
if(!disk.blueprint)
|
||||
continue
|
||||
var/datum/design/design = disk.blueprint
|
||||
if(design.id in SSshuttle.researchDesigns) continue
|
||||
if(design.id in SSshuttle.researchDesigns)
|
||||
continue
|
||||
|
||||
if(initial(design.reliability) < 100 && design.reliability >= 100)
|
||||
// Maxed out reliability designs only.
|
||||
@@ -285,7 +292,8 @@
|
||||
temp += "<b>Request from: [get_supply_group_name(cat)]</b><BR><BR>"
|
||||
for(var/supply_type in SSshuttle.supply_packs )
|
||||
var/datum/supply_packs/N = SSshuttle.supply_packs[supply_type]
|
||||
if(N.hidden || N.contraband || N.group != cat) continue //Have to send the type instead of a reference to
|
||||
if(N.hidden || N.contraband || N.group != cat)
|
||||
continue //Have to send the type instead of a reference to
|
||||
temp += "<A href='?src=\ref[src];doorder=[supply_type]'>[N.name]</A> Cost: [N.cost]<BR>" //the obj because it would get caught by the garbage
|
||||
else if (href_list["doorder"])
|
||||
if(world.time < reqtime)
|
||||
@@ -293,12 +301,15 @@
|
||||
return
|
||||
|
||||
//Find the correct supply_pack datum
|
||||
if(!SSshuttle.supply_packs["[href_list["doorder"]]"]) return
|
||||
if(!SSshuttle.supply_packs["[href_list["doorder"]]"])
|
||||
return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
if(world.time > timeout)
|
||||
return
|
||||
if(!reason)
|
||||
return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
@@ -310,7 +321,8 @@
|
||||
idname = usr.real_name
|
||||
|
||||
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
|
||||
if(!O) return
|
||||
if(!O)
|
||||
return
|
||||
O.generateRequisition(loc)
|
||||
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
@@ -414,7 +426,8 @@
|
||||
post_signal("supply")
|
||||
|
||||
else if (href_list["order"])
|
||||
if(SSshuttle.supply.mode != SHUTTLE_IDLE) return
|
||||
if(SSshuttle.supply.mode != SHUTTLE_IDLE)
|
||||
return
|
||||
if(href_list["order"] == "categories")
|
||||
//all_supply_groups
|
||||
//Request what?
|
||||
@@ -456,8 +469,10 @@
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = stripped_input(usr,"Reason:","Why do you require this item?","")
|
||||
if(world.time > timeout) return
|
||||
// if(!reason) return
|
||||
if(world.time > timeout)
|
||||
return
|
||||
// if(!reason)
|
||||
// return
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
@@ -469,7 +484,8 @@
|
||||
idname = usr.real_name
|
||||
|
||||
var/datum/supply_order/O = SSshuttle.generateSupplyOrder(href_list["doorder"], idname, idrank, reason)
|
||||
if(!O) return
|
||||
if(!O)
|
||||
return
|
||||
O.generateRequisition(loc)
|
||||
|
||||
reqtime = (world.time + 5) % 1e5
|
||||
@@ -550,7 +566,8 @@
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
|
||||
@@ -59,8 +59,10 @@ var/datum/subsystem/ticker/ticker
|
||||
/datum/subsystem/ticker/Initialize(timeofday, zlevel)
|
||||
if (zlevel)
|
||||
return ..()
|
||||
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
|
||||
if(!syndicate_code_phrase)
|
||||
syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response)
|
||||
syndicate_code_response = generate_code_phrase()
|
||||
setupFactions()
|
||||
..()
|
||||
|
||||
@@ -207,7 +209,8 @@ var/datum/subsystem/ticker/ticker
|
||||
|
||||
//Plus it provides an easy way to make cinematics for other events. Just use this as a template
|
||||
/datum/subsystem/ticker/proc/station_explosion_cinematic(station_missed=0, override = null)
|
||||
if( cinematic ) return //already a cinematic in progress!
|
||||
if( cinematic )
|
||||
return //already a cinematic in progress!
|
||||
|
||||
for (var/datum/html_interface/hi in html_interfaces)
|
||||
hi.closeAll()
|
||||
@@ -304,8 +307,10 @@ var/datum/subsystem/ticker/ticker
|
||||
//If its actually the end of the round, wait for it to end.
|
||||
//Otherwise if its a verb it will continue on afterwards.
|
||||
spawn(300)
|
||||
if(cinematic) qdel(cinematic) //end the cinematic
|
||||
if(temp_buckle) qdel(temp_buckle) //release everybody
|
||||
if(cinematic)
|
||||
qdel(cinematic) //end the cinematic
|
||||
if(temp_buckle)
|
||||
qdel(temp_buckle) //release everybody
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -79,11 +79,14 @@ var/datum/subsystem/vote/SSvote
|
||||
var/list/winners = get_result()
|
||||
var/text
|
||||
if(winners.len > 0)
|
||||
if(question) text += "<b>[question]</b>"
|
||||
else text += "<b>[capitalize(mode)] Vote</b>"
|
||||
if(question)
|
||||
text += "<b>[question]</b>"
|
||||
else
|
||||
text += "<b>[capitalize(mode)] Vote</b>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes) votes = 0
|
||||
if(!votes)
|
||||
votes = 0
|
||||
text += "\n<b>[choices[i]]:</b> [votes]"
|
||||
if(mode != "custom")
|
||||
if(winners.len > 1)
|
||||
@@ -149,16 +152,21 @@ var/datum/subsystem/vote/SSvote
|
||||
|
||||
reset()
|
||||
switch(vote_type)
|
||||
if("restart") choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode") choices.Add(config.votable_modes)
|
||||
if("restart")
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode")
|
||||
choices.Add(config.votable_modes)
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question) return 0
|
||||
if(!question)
|
||||
return 0
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish"))
|
||||
if(!option || mode || !usr.client) break
|
||||
if(!option || mode || !usr.client)
|
||||
break
|
||||
choices.Add(option)
|
||||
else return 0
|
||||
else
|
||||
return 0
|
||||
mode = vote_type
|
||||
initiator = initiator_key
|
||||
started_time = world.time
|
||||
@@ -172,7 +180,8 @@ var/datum/subsystem/vote/SSvote
|
||||
return 0
|
||||
|
||||
/datum/subsystem/vote/proc/interface(client/C)
|
||||
if(!C) return
|
||||
if(!C)
|
||||
return
|
||||
var/admin = 0
|
||||
var/trialmin = 0
|
||||
if(C.holder)
|
||||
@@ -182,12 +191,15 @@ var/datum/subsystem/vote/SSvote
|
||||
voting |= C
|
||||
|
||||
if(mode)
|
||||
if(question) . += "<h2>Vote: '[question]'</h2>"
|
||||
else . += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
if(question)
|
||||
. += "<h2>Vote: '[question]'</h2>"
|
||||
else
|
||||
. += "<h2>Vote: [capitalize(mode)]</h2>"
|
||||
. += "Time Left: [time_remaining] s<hr><ul>"
|
||||
for(var/i=1,i<=choices.len,i++)
|
||||
var/votes = choices[choices[i]]
|
||||
if(!votes) votes = 0
|
||||
if(!votes)
|
||||
votes = 0
|
||||
. += "<li><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a> ([votes] votes)</li>"
|
||||
. += "</ul><hr>"
|
||||
if(admin)
|
||||
@@ -220,7 +232,8 @@ var/datum/subsystem/vote/SSvote
|
||||
|
||||
|
||||
/datum/subsystem/vote/Topic(href,href_list[],hsrc)
|
||||
if(!usr || !usr.client) return //not necessary but meh...just in-case somebody does something stupid
|
||||
if(!usr || !usr.client)
|
||||
return //not necessary but meh...just in-case somebody does something stupid
|
||||
switch(href_list["vote"])
|
||||
if("close")
|
||||
voting -= usr.client
|
||||
|
||||
@@ -88,8 +88,10 @@
|
||||
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
if(1)
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
if(!line)
|
||||
continue
|
||||
if(findtextEx(line,"#",1,2))
|
||||
continue
|
||||
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len)
|
||||
@@ -107,8 +109,10 @@
|
||||
/datum/ai_laws/custom/New() //This reads silicon_laws.txt and allows server hosts to set custom AI starting laws.
|
||||
..()
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
if(!line)
|
||||
continue
|
||||
if(findtextEx(line,"#",1,2))
|
||||
continue
|
||||
|
||||
add_inherent_law(line)
|
||||
if(!inherent.len) //Failsafe to prevent lawless AIs being created.
|
||||
@@ -211,4 +215,4 @@
|
||||
if (length(law) > 0)
|
||||
data += "[show_numbers ? "[number]:" : ""] [law]"
|
||||
number++
|
||||
return data
|
||||
return data
|
||||
|
||||
+100
-50
@@ -17,7 +17,8 @@ datum/proc/on_varedit(modified_var) //called whenever a var is edited
|
||||
var/title = ""
|
||||
var/body = ""
|
||||
|
||||
if(!D) return
|
||||
if(!D)
|
||||
return
|
||||
if(istype(D, /atom))
|
||||
var/atom/A = D
|
||||
title = "[A.name] (\ref[A]) = [A.type]"
|
||||
@@ -425,7 +426,8 @@ body
|
||||
src.debug_variables(DAT)
|
||||
|
||||
else if(href_list["mob_player_panel"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["mob_player_panel"])
|
||||
if(!istype(M))
|
||||
@@ -436,7 +438,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["mob_player_panel"]
|
||||
|
||||
else if(href_list["godmode"])
|
||||
if(!check_rights(R_REJUVINATE)) return
|
||||
if(!check_rights(R_REJUVINATE))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["godmode"])
|
||||
if(!istype(M))
|
||||
@@ -447,7 +450,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["godmode"]
|
||||
|
||||
else if(href_list["mark_object"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/datum/D = locate(href_list["mark_object"])
|
||||
if(!istype(D))
|
||||
@@ -458,7 +462,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["mark_object"]
|
||||
|
||||
else if(href_list["proc_call"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/T = locate(href_list["proc_call"])
|
||||
|
||||
@@ -466,7 +471,8 @@ body
|
||||
callproc_datum(T)
|
||||
|
||||
else if(href_list["regenerateicons"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["regenerateicons"])
|
||||
if(!ismob(M))
|
||||
@@ -482,7 +488,8 @@ body
|
||||
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
|
||||
|
||||
if(href_list["rename"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["rename"])
|
||||
if(!istype(M))
|
||||
@@ -490,14 +497,16 @@ body
|
||||
return
|
||||
|
||||
var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN)
|
||||
if( !new_name || !M ) return
|
||||
if( !new_name || !M )
|
||||
return
|
||||
|
||||
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")
|
||||
M.fully_replace_character_name(M.real_name,new_name)
|
||||
href_list["datumrefresh"] = href_list["rename"]
|
||||
|
||||
else if(href_list["varnameedit"] && href_list["datumedit"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/D = locate(href_list["datumedit"])
|
||||
if(!istype(D,/datum) && !istype(D,/client))
|
||||
@@ -507,7 +516,8 @@ body
|
||||
modify_variables(D, href_list["varnameedit"], 1)
|
||||
|
||||
else if(href_list["varnamechange"] && href_list["datumchange"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/D = locate(href_list["datumchange"])
|
||||
if(!istype(D,/datum) && !istype(D,/client))
|
||||
@@ -517,7 +527,8 @@ body
|
||||
modify_variables(D, href_list["varnamechange"], 0)
|
||||
|
||||
else if(href_list["varnamemass"] && href_list["datummass"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["datummass"])
|
||||
if(!istype(A))
|
||||
@@ -527,7 +538,8 @@ body
|
||||
cmd_mass_modify_object_variables(A, href_list["varnamemass"])
|
||||
|
||||
else if(href_list["give_spell"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["give_spell"])
|
||||
if(!istype(M))
|
||||
@@ -538,7 +550,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["give_spell"]
|
||||
|
||||
else if(href_list["give_disease"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["give_disease"])
|
||||
if(!istype(M))
|
||||
@@ -549,7 +562,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["give_spell"]
|
||||
|
||||
else if(href_list["ninja"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["ninja"])
|
||||
if(!istype(M))
|
||||
@@ -560,7 +574,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["ninja"]
|
||||
|
||||
else if(href_list["gib"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["gib"])
|
||||
if(!istype(M))
|
||||
@@ -570,7 +585,8 @@ body
|
||||
src.cmd_admin_gib(M)
|
||||
|
||||
else if(href_list["build_mode"])
|
||||
if(!check_rights(R_BUILDMODE)) return
|
||||
if(!check_rights(R_BUILDMODE))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["build_mode"])
|
||||
if(!istype(M))
|
||||
@@ -581,7 +597,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["build_mode"]
|
||||
|
||||
else if(href_list["drop_everything"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["drop_everything"])
|
||||
if(!istype(M))
|
||||
@@ -592,7 +609,8 @@ body
|
||||
usr.client.cmd_admin_drop_everything(M)
|
||||
|
||||
else if(href_list["direct_control"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["direct_control"])
|
||||
if(!istype(M))
|
||||
@@ -603,7 +621,8 @@ body
|
||||
usr.client.cmd_assume_direct_control(M)
|
||||
|
||||
else if(href_list["offer_control"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["offer_control"])
|
||||
if(!istype(M))
|
||||
@@ -631,7 +650,8 @@ body
|
||||
message_admins("No ghosts were willing to take control of [key_name_admin(M)])")
|
||||
|
||||
else if(href_list["delall"])
|
||||
if(!check_rights(R_DEBUG|R_SERVER)) return
|
||||
if(!check_rights(R_DEBUG|R_SERVER))
|
||||
return
|
||||
|
||||
var/obj/O = locate(href_list["delall"])
|
||||
if(!isobj(O))
|
||||
@@ -674,7 +694,8 @@ body
|
||||
message_admins("<span class='notice'>[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) </span>")
|
||||
|
||||
else if(href_list["addreagent"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["addreagent"])
|
||||
|
||||
@@ -706,7 +727,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["addreagent"]
|
||||
|
||||
else if(href_list["explode"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["explode"])
|
||||
if(!isobj(A) && !ismob(A) && !isturf(A))
|
||||
@@ -717,7 +739,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["explode"]
|
||||
|
||||
else if(href_list["emp"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["emp"])
|
||||
if(!isobj(A) && !ismob(A) && !isturf(A))
|
||||
@@ -728,7 +751,8 @@ body
|
||||
href_list["datumrefresh"] = href_list["emp"]
|
||||
|
||||
else if(href_list["rotatedatum"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["rotatedatum"])
|
||||
if(!istype(A))
|
||||
@@ -736,12 +760,15 @@ body
|
||||
return
|
||||
|
||||
switch(href_list["rotatedir"])
|
||||
if("right") A.dir = turn(A.dir, -45)
|
||||
if("left") A.dir = turn(A.dir, 45)
|
||||
if("right")
|
||||
A.dir = turn(A.dir, -45)
|
||||
if("left")
|
||||
A.dir = turn(A.dir, 45)
|
||||
href_list["datumrefresh"] = href_list["rotatedatum"]
|
||||
|
||||
else if(href_list["editorgans"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C = locate(href_list["editorgans"])
|
||||
if(!istype(C))
|
||||
@@ -752,91 +779,104 @@ body
|
||||
href_list["datumrefresh"] = href_list["editorgans"]
|
||||
|
||||
else if(href_list["makehuman"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/monkey/Mo = locate(href_list["makehuman"])
|
||||
if(!istype(Mo))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon/monkey"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!Mo)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("humanone"=href_list["makehuman"]))
|
||||
|
||||
else if(href_list["makemonkey"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makemonkey"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("monkeyone"=href_list["makemonkey"]))
|
||||
|
||||
else if(href_list["makerobot"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makerobot"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("makerobot"=href_list["makerobot"]))
|
||||
|
||||
else if(href_list["makealien"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makealien"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("makealien"=href_list["makealien"]))
|
||||
|
||||
else if(href_list["makeslime"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["makeslime"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("makeslime"=href_list["makeslime"]))
|
||||
|
||||
else if(href_list["makeai"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/H = locate(href_list["makeai"])
|
||||
if(!istype(H))
|
||||
usr << "This can only be done to instances of type /mob/living/carbon"
|
||||
return
|
||||
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
|
||||
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform")
|
||||
return
|
||||
if(!H)
|
||||
usr << "Mob doesn't exist anymore"
|
||||
return
|
||||
holder.Topic(href, list("makeai"=href_list["makeai"]))
|
||||
|
||||
else if(href_list["setspecies"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["setspecies"])
|
||||
if(!istype(H))
|
||||
@@ -857,7 +897,8 @@ body
|
||||
|
||||
|
||||
else if(href_list["purrbation"])
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = locate(href_list["purrbation"])
|
||||
if(!istype(H))
|
||||
@@ -889,10 +930,12 @@ body
|
||||
usr << "You can only put humans on purrbation."
|
||||
|
||||
else if(href_list["adjustDamage"] && href_list["mobToDamage"])
|
||||
if(!check_rights(0)) return
|
||||
if(!check_rights(0))
|
||||
return
|
||||
|
||||
var/mob/living/L = locate(href_list["mobToDamage"])
|
||||
if(!istype(L)) return
|
||||
if(!istype(L))
|
||||
return
|
||||
|
||||
var/Text = href_list["adjustDamage"]
|
||||
|
||||
@@ -903,13 +946,20 @@ body
|
||||
return
|
||||
|
||||
switch(Text)
|
||||
if("brute") L.adjustBruteLoss(amount)
|
||||
if("fire") L.adjustFireLoss(amount)
|
||||
if("toxin") L.adjustToxLoss(amount)
|
||||
if("oxygen")L.adjustOxyLoss(amount)
|
||||
if("brain") L.adjustBrainLoss(amount)
|
||||
if("clone") L.adjustCloneLoss(amount)
|
||||
if("stamina") L.adjustStaminaLoss(amount)
|
||||
if("brute")
|
||||
L.adjustBruteLoss(amount)
|
||||
if("fire")
|
||||
L.adjustFireLoss(amount)
|
||||
if("toxin")
|
||||
L.adjustToxLoss(amount)
|
||||
if("oxygen")
|
||||
L.adjustOxyLoss(amount)
|
||||
if("brain")
|
||||
L.adjustBrainLoss(amount)
|
||||
if("clone")
|
||||
L.adjustCloneLoss(amount)
|
||||
if("stamina")
|
||||
L.adjustStaminaLoss(amount)
|
||||
else
|
||||
usr << "You caused an error. DEBUG: Text:[Text] Mob:[L]"
|
||||
return
|
||||
|
||||
@@ -65,8 +65,10 @@
|
||||
affected_mob << "<span class='danger'>Your entire body vibrates.</span>"
|
||||
|
||||
if (prob(35))
|
||||
if(prob(50)) scramble_dna(affected_mob, 1, 0, rand(15,45))
|
||||
else scramble_dna(affected_mob, 0, 1, rand(15,45))
|
||||
if(prob(50))
|
||||
scramble_dna(affected_mob, 1, 0, rand(15,45))
|
||||
else
|
||||
scramble_dna(affected_mob, 0, 1, rand(15,45))
|
||||
|
||||
if(4)
|
||||
if(restcure)
|
||||
@@ -75,5 +77,7 @@
|
||||
cure()
|
||||
return
|
||||
if (prob(60))
|
||||
if(prob(50)) scramble_dna(affected_mob, 1, 0, rand(50,75))
|
||||
else scramble_dna(affected_mob, 0, 1, rand(50,75))
|
||||
if(prob(50))
|
||||
scramble_dna(affected_mob, 1, 0, rand(50,75))
|
||||
else
|
||||
scramble_dna(affected_mob, 0, 1, rand(50,75))
|
||||
@@ -42,7 +42,8 @@
|
||||
if(jobban_isbanned(affected_mob, new_form))
|
||||
affected_mob.death(1)
|
||||
return
|
||||
if(affected_mob.notransform) return
|
||||
if(affected_mob.notransform)
|
||||
return
|
||||
affected_mob.notransform = 1
|
||||
affected_mob.canmove = 0
|
||||
affected_mob.icon = null
|
||||
|
||||
@@ -10,7 +10,8 @@ var/global/datum/getrev/revdata = new()
|
||||
for(var/line=head_log.len, line>=1, line--)
|
||||
if(head_log[line])
|
||||
var/list/last_entry = text2list(head_log[line], " ")
|
||||
if(last_entry.len < 2) continue
|
||||
if(last_entry.len < 2)
|
||||
continue
|
||||
revision = last_entry[2]
|
||||
// Get date/time
|
||||
if(last_entry.len >= 5)
|
||||
|
||||
+1692
-1680
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,8 @@
|
||||
. = on_losing(owner)
|
||||
|
||||
/datum/mutation/human/proc/set_se(se_string, on = 1)
|
||||
if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) return
|
||||
if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE)
|
||||
return
|
||||
var/before = copytext(se_string, 1, ((dna_block - 1) * DNA_BLOCK_SIZE) + 1)
|
||||
var/injection = num2hex(on ? rand(lowest_value, (256 * 16) - 1) : rand(0, lowest_value - 1), DNA_BLOCK_SIZE)
|
||||
var/after = copytext(se_string, (dna_block * DNA_BLOCK_SIZE) + 1, 0)
|
||||
@@ -41,7 +42,8 @@
|
||||
owner.dna.struc_enzymes = set_se(owner.dna.struc_enzymes, on)
|
||||
|
||||
/datum/mutation/human/proc/check_block_string(se_string)
|
||||
if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE) return 0
|
||||
if(!se_string || lentext(se_string) < DNA_STRUC_ENZYMES_BLOCKS * DNA_BLOCK_SIZE)
|
||||
return 0
|
||||
if(hex2num(getblock(se_string, dna_block)) >= lowest_value)
|
||||
return 1
|
||||
|
||||
@@ -288,13 +290,15 @@
|
||||
text_lose_indication = "<span class='notice'>Everything around you seems to shrink..</span>"
|
||||
|
||||
/datum/mutation/human/dwarfism/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
owner.resize = 0.8
|
||||
owner.pass_flags |= PASSTABLE
|
||||
owner.visible_message("<span class='danger'>[owner] suddenly shrinks!</span>")
|
||||
|
||||
/datum/mutation/human/dwarfism/on_losing(mob/living/carbon/human/owner)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
owner.resize = 1.25
|
||||
owner.pass_flags &= ~PASSTABLE
|
||||
owner.visible_message("<span class='danger'>[owner] suddenly grows!</span>")
|
||||
@@ -306,7 +310,8 @@
|
||||
text_gain_indication = "<span class='danger'>You feel lightheaded.</span>"
|
||||
|
||||
/datum/mutation/human/clumsy/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
owner.disabilities |= CLUMSY
|
||||
|
||||
/datum/mutation/human/clumsy/on_losing(mob/living/carbon/human/owner)
|
||||
@@ -352,7 +357,8 @@
|
||||
text_gain_indication = "<span class='danger'>You can't seem to hear anything.</span>"
|
||||
|
||||
/datum/mutation/human/deaf/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
owner.disabilities |= DEAF
|
||||
|
||||
/datum/mutation/human/deaf/on_losing(mob/living/carbon/human/owner)
|
||||
@@ -367,7 +373,8 @@
|
||||
text_gain_indication = "<span class='danger'>You can't seem to see anything.</span>"
|
||||
|
||||
/datum/mutation/human/blind/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
owner.disabilities |= BLIND
|
||||
|
||||
/datum/mutation/human/blind/on_losing(mob/living/carbon/human/owner)
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
if(T in range(target,inner_tele_radius)) continue
|
||||
if(istype(T,/turf/space) && !include_space) continue
|
||||
if(T.density && !include_dense) continue
|
||||
if(T.x>world.maxx-outer_tele_radius || T.x<outer_tele_radius) continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-outer_tele_radius || T.y<outer_tele_radius) continue
|
||||
if(T.x>world.maxx-outer_tele_radius || T.x<outer_tele_radius)
|
||||
continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-outer_tele_radius || T.y<outer_tele_radius)
|
||||
continue
|
||||
turfs += T
|
||||
|
||||
if(!turfs.len)
|
||||
|
||||
@@ -54,7 +54,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
/datum/supply_packs/New()
|
||||
manifest += "<ul>"
|
||||
for(var/path in contains)
|
||||
if(!path) continue
|
||||
if(!path)
|
||||
continue
|
||||
var/atom/movable/AM = path
|
||||
manifest += "<li>[initial(AM.name)]</li>"
|
||||
manifest += "</ul>"
|
||||
|
||||
@@ -835,20 +835,20 @@ var/list/teleportlocs = list()
|
||||
icon_state = "armory"
|
||||
|
||||
/*
|
||||
New()
|
||||
..()
|
||||
/area/security/transfer/New()
|
||||
..()
|
||||
|
||||
spawn(10) //let objects set up first
|
||||
for(var/turf/turfToGrayscale in src)
|
||||
if(turfToGrayscale.icon)
|
||||
var/icon/newIcon = icon(turfToGrayscale.icon)
|
||||
spawn(10) //let objects set up first
|
||||
for(var/turf/turfToGrayscale in src)
|
||||
if(turfToGrayscale.icon)
|
||||
var/icon/newIcon = icon(turfToGrayscale.icon)
|
||||
newIcon.GrayScale()
|
||||
turfToGrayscale.icon = newIcon
|
||||
for(var/obj/objectToGrayscale in turfToGrayscale) //1 level deep, means tables, apcs, locker, etc, but not locker contents
|
||||
if(objectToGrayscale.icon)
|
||||
var/icon/newIcon = icon(objectToGrayscale.icon)
|
||||
newIcon.GrayScale()
|
||||
turfToGrayscale.icon = newIcon
|
||||
for(var/obj/objectToGrayscale in turfToGrayscale) //1 level deep, means tables, apcs, locker, etc, but not locker contents
|
||||
if(objectToGrayscale.icon)
|
||||
var/icon/newIcon = icon(objectToGrayscale.icon)
|
||||
newIcon.GrayScale()
|
||||
objectToGrayscale.icon = newIcon
|
||||
objectToGrayscale.icon = newIcon
|
||||
*/
|
||||
|
||||
/area/security/nuke_storage
|
||||
|
||||
@@ -322,17 +322,20 @@
|
||||
|
||||
|
||||
/area/Entered(A)
|
||||
if(!istype(A,/mob/living)) return
|
||||
if(!istype(A,/mob/living))
|
||||
return
|
||||
|
||||
var/mob/living/L = A
|
||||
if(!L.ckey) return
|
||||
if(!L.ckey)
|
||||
return
|
||||
|
||||
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
|
||||
if(L.client && !L.client.ambience_playing && L.client.prefs.toggles & SOUND_SHIP_AMBIENCE)
|
||||
L.client.ambience_playing = 1
|
||||
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
|
||||
|
||||
if(!(L.client && (L.client.prefs.toggles & SOUND_AMBIENCE))) return //General ambience check is below the ship ambience so one can play without the other
|
||||
if(!(L.client && (L.client.prefs.toggles & SOUND_AMBIENCE)))
|
||||
return //General ambience check is below the ship ambience so one can play without the other
|
||||
|
||||
if(prob(35))
|
||||
var/sound = pick(ambientsounds)
|
||||
|
||||
+8
-6
@@ -90,11 +90,11 @@
|
||||
|
||||
/*//Convenience proc to see whether a container can be accessed in a certain way.
|
||||
|
||||
proc/can_subract_container()
|
||||
return flags & EXTRACT_CONTAINER
|
||||
/atom/proc/can_subract_container()
|
||||
return flags & EXTRACT_CONTAINER
|
||||
|
||||
proc/can_add_container()
|
||||
return flags & INSERT_CONTAINER
|
||||
/atom/proc/can_add_container()
|
||||
return flags & INSERT_CONTAINER
|
||||
*/
|
||||
|
||||
|
||||
@@ -302,11 +302,13 @@ var/list/blood_splatter_icons = list()
|
||||
B.blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type
|
||||
else if(istype(M, /mob/living/carbon/alien))
|
||||
var/obj/effect/decal/cleanable/xenoblood/B = locate() in contents
|
||||
if(!B) B = new(src)
|
||||
if(!B)
|
||||
B = new(src)
|
||||
B.blood_DNA["UNKNOWN BLOOD"] = "X*"
|
||||
else if(istype(M, /mob/living/silicon/robot))
|
||||
var/obj/effect/decal/cleanable/oil/B = locate() in contents
|
||||
if(!B) B = new(src)
|
||||
if(!B)
|
||||
B = new(src)
|
||||
|
||||
/atom/proc/clean_blood()
|
||||
if(istype(blood_DNA, /list))
|
||||
|
||||
@@ -117,7 +117,8 @@
|
||||
loc = destination
|
||||
destination.Entered(src, oldloc)
|
||||
for(var/atom/movable/AM in destination)
|
||||
if(AM == src) continue
|
||||
if(AM == src)
|
||||
continue
|
||||
AM.Crossed(src)
|
||||
Moved(oldloc, 0)
|
||||
return 1
|
||||
@@ -170,7 +171,8 @@
|
||||
throw_at(target, range, speed, thrower, spin, diagonals_first)
|
||||
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0)
|
||||
if(!target || !src || (flags & NODROP)) return 0
|
||||
if(!target || !src || (flags & NODROP))
|
||||
return 0
|
||||
//use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target
|
||||
|
||||
throwing = 1
|
||||
|
||||
+8
-4
@@ -54,7 +54,8 @@
|
||||
remove_mutation_group(mutations)
|
||||
|
||||
/datum/dna/proc/remove_mutation_group(list/group)
|
||||
if(!group) return
|
||||
if(!group)
|
||||
return
|
||||
for(var/datum/mutation/human/HM in group)
|
||||
HM.force_lose(holder)
|
||||
|
||||
@@ -77,8 +78,10 @@
|
||||
L[DNA_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.eye_color)
|
||||
|
||||
for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
|
||||
if(L[i]) . += L[i]
|
||||
else . += random_string(DNA_BLOCK_SIZE,hex_characters)
|
||||
if(L[i])
|
||||
. += L[i]
|
||||
else
|
||||
. += random_string(DNA_BLOCK_SIZE,hex_characters)
|
||||
return .
|
||||
|
||||
/datum/dna/proc/generate_struc_enzymes()
|
||||
@@ -279,7 +282,8 @@ mob/living/carbon/human/updateappearance(icon_update=1, mutcolor_update=0, mutat
|
||||
return copytext(input, blocksize*(blocknumber-1)+1, (blocksize*blocknumber)+1)
|
||||
|
||||
/proc/setblock(istring, blocknumber, replacement, blocksize=DNA_BLOCK_SIZE)
|
||||
if(!istring || !blocknumber || !replacement || !blocksize) return 0
|
||||
if(!istring || !blocknumber || !replacement || !blocksize)
|
||||
return 0
|
||||
return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
|
||||
|
||||
/proc/randmut(mob/living/carbon/M, list/candidates, difficulty = 2)
|
||||
|
||||
@@ -98,7 +98,8 @@
|
||||
world << "ERROR: NO VALID TERRITORIES"
|
||||
|
||||
/datum/station_state/proc/score(datum/station_state/result)
|
||||
if(!result) return 0
|
||||
if(!result)
|
||||
return 0
|
||||
var/output = 0
|
||||
output += (result.floor / max(floor,1))
|
||||
output += (result.r_wall/ max(r_wall,1))
|
||||
|
||||
@@ -300,8 +300,10 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas
|
||||
/datum/changeling/New(var/gender=FEMALE)
|
||||
..()
|
||||
var/honorific
|
||||
if(gender == FEMALE) honorific = "Ms."
|
||||
else honorific = "Mr."
|
||||
if(gender == FEMALE)
|
||||
honorific = "Ms."
|
||||
else
|
||||
honorific = "Mr."
|
||||
if(possible_changeling_IDs.len)
|
||||
changelingID = pick(possible_changeling_IDs)
|
||||
possible_changeling_IDs -= changelingID
|
||||
|
||||
@@ -82,7 +82,8 @@ var/list/datum/dna/hivemind_bank = list()
|
||||
return
|
||||
|
||||
var/S = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names
|
||||
if(!S) return
|
||||
if(!S)
|
||||
return
|
||||
var/datum/changelingprofile/chosen_prof = names[S]
|
||||
if(!chosen_prof)
|
||||
return
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
var/uplink_contents // the contents of the uplink
|
||||
|
||||
proc/assign_objectives(var/datum/mind/traitor)
|
||||
..()
|
||||
/datum/faction/syndicate/proc/assign_objectives(var/datum/mind/traitor)
|
||||
..()
|
||||
|
||||
|
||||
/* ----- Begin defining syndicate factions ------ */
|
||||
|
||||
+841
-838
File diff suppressed because it is too large
Load Diff
@@ -57,19 +57,19 @@
|
||||
wizard.current.stat = 2
|
||||
continue
|
||||
wizards_alive++
|
||||
if(!time_checked)
|
||||
if(!time_checked)
|
||||
time_checked = world.time
|
||||
if(bullshit_mode)
|
||||
if(world.time > time_checked + time_check)
|
||||
max_mages = INFINITY
|
||||
time_checked = world.time
|
||||
make_more_mages()
|
||||
make_more_mages()
|
||||
return ..()
|
||||
if (wizards_alive)
|
||||
if(world.time > time_checked + time_check && (mages_made < max_mages))
|
||||
time_checked = world.time
|
||||
make_more_mages()
|
||||
|
||||
|
||||
else
|
||||
if(mages_made >= max_mages)
|
||||
finished = 1
|
||||
@@ -137,7 +137,8 @@
|
||||
..(1)
|
||||
|
||||
/datum/game_mode/wizard/raginmages/proc/makeBody(mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
if(!G_found || !G_found.key)
|
||||
return
|
||||
|
||||
//First we spawn a dude.
|
||||
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
|
||||
|
||||
@@ -159,11 +159,16 @@
|
||||
|
||||
|
||||
/obj/proc/check_access_list(list/L)
|
||||
if(!src.req_access && !src.req_one_access) return 1
|
||||
if(!istype(src.req_access, /list)) return 1
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len)) return 1
|
||||
if(!L) return 0
|
||||
if(!istype(L, /list)) return 0
|
||||
if(!src.req_access && !src.req_one_access)
|
||||
return 1
|
||||
if(!istype(src.req_access, /list))
|
||||
return 1
|
||||
if(!src.req_access.len && (!src.req_one_access || !src.req_one_access.len))
|
||||
return 1
|
||||
if(!L)
|
||||
return 0
|
||||
if(!istype(L, /list))
|
||||
return 0
|
||||
for(var/req in src.req_access)
|
||||
if(!(req in L)) //doesn't have this access
|
||||
return 0
|
||||
@@ -437,7 +442,8 @@
|
||||
|
||||
/obj/item/proc/GetJobName() //Used in secHUD icon generation
|
||||
var/obj/item/weapon/card/id/I = GetID()
|
||||
if(!I) return
|
||||
if(!I)
|
||||
return
|
||||
var/jobName = I.assignment
|
||||
if(jobName in get_all_job_icons()) //Check if the job has a hud icon
|
||||
return jobName
|
||||
|
||||
@@ -14,7 +14,8 @@ AI
|
||||
minimal_player_age = 30
|
||||
|
||||
/datum/job/ai/equip(mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
if(!H)
|
||||
return 0
|
||||
|
||||
/datum/job/ai/config_check()
|
||||
if(config && config.allow_ai)
|
||||
@@ -36,5 +37,6 @@ Cyborg
|
||||
minimal_player_age = 21
|
||||
|
||||
/datum/job/cyborg/equip(mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
if(!H)
|
||||
return 0
|
||||
return H.Robotize()
|
||||
|
||||
@@ -4,7 +4,8 @@ var/list/whitelist
|
||||
|
||||
/proc/load_whitelist()
|
||||
whitelist = file2list(WHITELISTFILE)
|
||||
if(!whitelist.len) whitelist = null
|
||||
if(!whitelist.len)
|
||||
whitelist = null
|
||||
|
||||
/proc/check_whitelist(mob/M /*, var/rank*/)
|
||||
if(!whitelist)
|
||||
|
||||
@@ -85,7 +85,8 @@
|
||||
ai_actual_track(target)
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_actual_track(mob/living/target)
|
||||
if(!istype(target)) return
|
||||
if(!istype(target))
|
||||
return
|
||||
var/mob/living/silicon/ai/U = usr
|
||||
|
||||
U.cameraFollow = target
|
||||
|
||||
@@ -102,7 +102,8 @@ var/time_last_changed_position = 0
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(!ticker) return
|
||||
if(!ticker)
|
||||
return
|
||||
if (mode == 1) // accessing crew manifest
|
||||
var/crew = ""
|
||||
for(var/datum/data/record/t in sortRecord(data_core.general))
|
||||
|
||||
@@ -88,9 +88,12 @@
|
||||
if(viable_occupant.has_dna() && (!(viable_occupant.disabilities & NOCLONE) || (connected.scan_level == 3))) //occupent is viable for dna modification
|
||||
occupant_status += "[viable_occupant.name] => "
|
||||
switch(viable_occupant.stat)
|
||||
if(CONSCIOUS) occupant_status += "<span class='good'>Conscious</span>"
|
||||
if(UNCONSCIOUS) occupant_status += "<span class='average'>Unconscious</span>"
|
||||
else occupant_status += "<span class='bad'>DEAD</span>"
|
||||
if(CONSCIOUS)
|
||||
occupant_status += "<span class='good'>Conscious</span>"
|
||||
if(UNCONSCIOUS)
|
||||
occupant_status += "<span class='average'>Unconscious</span>"
|
||||
else
|
||||
occupant_status += "<span class='bad'>DEAD</span>"
|
||||
occupant_status += "</div></div>"
|
||||
occupant_status += "<div class='line'><div class='statusLabel'>Health:</div><div class='progressBar'><div style='width: [viable_occupant.health]%;' class='progressFill good'></div></div><div class='statusValue'>[viable_occupant.health] %</div></div>"
|
||||
occupant_status += "<div class='line'><div class='statusLabel'>Radiation Level:</div><div class='progressBar'><div style='width: [viable_occupant.radiation]%;' class='progressFill bad'></div></div><div class='statusValue'>[viable_occupant.radiation] %</div></div>"
|
||||
@@ -133,10 +136,14 @@
|
||||
stddev = RADIATION_ACCURACY_MULTIPLIER/radduration
|
||||
var/chance_to_hit
|
||||
switch(stddev) //hardcoded values from a z-table for a normal distribution
|
||||
if(0 to 0.25) chance_to_hit = ">95 %"
|
||||
if(0.25 to 0.5) chance_to_hit = "68-95 %"
|
||||
if(0.5 to 0.75) chance_to_hit = "55-68 %"
|
||||
else chance_to_hit = "<38 %"
|
||||
if(0 to 0.25)
|
||||
chance_to_hit = ">95 %"
|
||||
if(0.25 to 0.5)
|
||||
chance_to_hit = "68-95 %"
|
||||
if(0.5 to 0.75)
|
||||
chance_to_hit = "55-68 %"
|
||||
else
|
||||
chance_to_hit = "<38 %"
|
||||
status += "<div class='line'><div class='statusLabel'>Pulse Duration:</div><div class='statusValue'>[radduration]</div></div>"
|
||||
status += "<div class='line'><div class='statusLabel'> \> Accuracy:</div><div class='statusValue'>[chance_to_hit]</div></div>"
|
||||
status += "<br></div>" // Close statusDisplay div
|
||||
@@ -147,13 +154,20 @@
|
||||
buttons += "<span class='linkOff'>[connected.locked ? "Unlock" : "Lock"] Scanner</span> "
|
||||
else
|
||||
buttons += "<a href='?src=\ref[src];task=togglelock;'>[connected.locked ? "Unlock" : "Lock"] Scanner</a> "
|
||||
else buttons += "<span class='linkOff'>Open Scanner</span> <span class='linkOff'>Lock Scanner</span> "
|
||||
if(viable_occupant) buttons += "<a href='?src=\ref[src];task=rejuv'>Inject Rejuvenators</a> "
|
||||
else buttons += "<span class='linkOff'>Inject Rejuvenators</span> "
|
||||
if(diskette) buttons += "<a href='?src=\ref[src];task=ejectdisk'>Eject Disk</a> "
|
||||
else buttons += "<span class='linkOff'>Eject Disk</span> "
|
||||
if(current_screen == "buffer") buttons += "<a href='?src=\ref[src];task=screen;text=mainmenu;'>Radiation Emitter Menu</a> "
|
||||
else buttons += "<a href='?src=\ref[src];task=screen;text=buffer;'>Buffer Menu</a> "
|
||||
else
|
||||
buttons += "<span class='linkOff'>Open Scanner</span> <span class='linkOff'>Lock Scanner</span> "
|
||||
if(viable_occupant)
|
||||
buttons += "<a href='?src=\ref[src];task=rejuv'>Inject Rejuvenators</a> "
|
||||
else
|
||||
buttons += "<span class='linkOff'>Inject Rejuvenators</span> "
|
||||
if(diskette)
|
||||
buttons += "<a href='?src=\ref[src];task=ejectdisk'>Eject Disk</a> "
|
||||
else
|
||||
buttons += "<span class='linkOff'>Eject Disk</span> "
|
||||
if(current_screen == "buffer")
|
||||
buttons += "<a href='?src=\ref[src];task=screen;text=mainmenu;'>Radiation Emitter Menu</a> "
|
||||
else
|
||||
buttons += "<a href='?src=\ref[src];task=screen;text=buffer;'>Buffer Menu</a> "
|
||||
|
||||
switch(current_screen)
|
||||
if("working")
|
||||
@@ -171,11 +185,15 @@
|
||||
var/list/buffer_slot = buffer[i]
|
||||
if( !buffer_slot || !buffer_slot.len || !buffer_slot["name"] || !((buffer_slot["UI"] && buffer_slot["UE"]) || buffer_slot["SE"]) )
|
||||
temp_html += "<br>\tNo Data"
|
||||
if(viable_occupant) temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
|
||||
else temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
|
||||
if(viable_occupant)
|
||||
temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
|
||||
else
|
||||
temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
|
||||
temp_html += "<span class='linkOff'>Clear Buffer</span> "
|
||||
if(diskette) temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
|
||||
else temp_html += "<span class='linkOff'>Load from Disk</span> "
|
||||
if(diskette)
|
||||
temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Load from Disk</span> "
|
||||
temp_html += "<span class='linkOff'>Save to Disk</span> "
|
||||
else
|
||||
var/ui = buffer_slot["UI"]
|
||||
@@ -189,46 +207,68 @@
|
||||
if(ue && name && blood_type)
|
||||
temp_html += "<br>\tBlood Type: [blood_type]"
|
||||
temp_html += "<br>\tUE: [ue] "
|
||||
if(viable_occupant) temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ue'>Occupant</a> "
|
||||
else temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
if(viable_occupant)
|
||||
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ue'>Occupant</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_UE]'>Occupant:Delayed</a> "
|
||||
if(injectorready) temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ue'>Injector</a>"
|
||||
else temp_html += "<span class='linkOff'>Injector</span>"
|
||||
if(injectorready)
|
||||
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ue'>Injector</a>"
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Injector</span>"
|
||||
else
|
||||
temp_html += "<br>\tBlood Type: No Data"
|
||||
temp_html += "<br>\tUE: No Data"
|
||||
if(ui)
|
||||
temp_html += "<br>\tUI: [ui] "
|
||||
if(viable_occupant) temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ui'>Occupant</a> "
|
||||
else temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
if(viable_occupant)
|
||||
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=ui'>Occupant</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_UI]'>Occupant:Delayed</a> "
|
||||
if(injectorready) temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ui'>Injector</a>"
|
||||
else temp_html += "<span class='linkOff'>Injector</span>"
|
||||
if(injectorready)
|
||||
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=ui'>Injector</a>"
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Injector</span>"
|
||||
else
|
||||
temp_html += "<br>\tUI: No Data"
|
||||
if(ue && name && blood_type && ui)
|
||||
temp_html += "<br>\tUI+UE: [ui]/[ue] "
|
||||
if(viable_occupant) temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=mixed'>Occupant</a> "
|
||||
else temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
if(viable_occupant)
|
||||
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=mixed'>Occupant</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Occupant</span>"
|
||||
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_MIXED]'>Occupant:Delayed</a> "
|
||||
if(injectorready) temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=mixed'>UI+UE Injector</a>"
|
||||
else temp_html += "<span class='linkOff'>UI+UE Injector</span>"
|
||||
if(injectorready)
|
||||
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=mixed'>UI+UE Injector</a>"
|
||||
else
|
||||
temp_html += "<span class='linkOff'>UI+UE Injector</span>"
|
||||
if(se)
|
||||
temp_html += "<br>\tSE: [se] "
|
||||
if(viable_occupant) temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=se'>Occupant</a> "
|
||||
else temp_html += "<span class='linkOff'>Occupant</span> "
|
||||
if(viable_occupant)
|
||||
temp_html += "<a href='?src=\ref[src];task=transferbuffer;num=[i];text=se'>Occupant</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Occupant</span> "
|
||||
temp_html += "<a href='?src=\ref[src];task=setdelayed;num=[i];delayaction=[SCANNER_ACTION_SE]'>Occupant:Delayed</a> "
|
||||
if(injectorready) temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=se'>Injector</a>"
|
||||
else temp_html += "<span class='linkOff'>Injector</span>"
|
||||
if(injectorready)
|
||||
temp_html += "<a href='?src=\ref[src];task=injector;num=[i];text=se'>Injector</a>"
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Injector</span>"
|
||||
else
|
||||
temp_html += "<br>\tSE: No Data"
|
||||
if(viable_occupant) temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
|
||||
else temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
|
||||
if(viable_occupant)
|
||||
temp_html += "<br><a href='?src=\ref[src];task=setbuffer;num=[i];'>Save to Buffer</a> "
|
||||
else
|
||||
temp_html += "<br><span class='linkOff'>Save to Buffer</span> "
|
||||
temp_html += "<a href='?src=\ref[src];task=clearbuffer;num=[i];'>Clear Buffer</a> "
|
||||
if(diskette) temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
|
||||
else temp_html += "<span class='linkOff'>Load from Disk</span> "
|
||||
if(diskette && !diskette.read_only) temp_html += "<a href='?src=\ref[src];task=savedisk;num=[i];'>Save to Disk</a> "
|
||||
else temp_html += "<span class='linkOff'>Save to Disk</span> "
|
||||
if(diskette)
|
||||
temp_html += "<a href='?src=\ref[src];task=loaddisk;num=[i];'>Load from Disk</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Load from Disk</span> "
|
||||
if(diskette && !diskette.read_only)
|
||||
temp_html += "<a href='?src=\ref[src];task=savedisk;num=[i];'>Save to Disk</a> "
|
||||
else
|
||||
temp_html += "<span class='linkOff'>Save to Disk</span> "
|
||||
else
|
||||
temp_html += status
|
||||
temp_html += buttons
|
||||
@@ -292,9 +332,11 @@
|
||||
var/last_change
|
||||
switch(href_list["task"])
|
||||
if("togglelock")
|
||||
if(connected) connected.locked = !connected.locked
|
||||
if(connected)
|
||||
connected.locked = !connected.locked
|
||||
if("toggleopen")
|
||||
if(connected) connected.toggle_open(usr)
|
||||
if(connected)
|
||||
connected.toggle_open(usr)
|
||||
if("setduration")
|
||||
if(!num)
|
||||
num = round(input(usr, "Choose pulse duration:", "Input an Integer", null) as num|null)
|
||||
@@ -471,9 +513,12 @@
|
||||
/obj/machinery/computer/scan_consolenew/proc/scramble(input,rs,rd)
|
||||
var/length = length(input)
|
||||
var/ran = gaussian(0, rs*RADIATION_STRENGTH_MULTIPLIER)
|
||||
if(ran == 0) ran = pick(-1,1) //hacky, statistically should almost never happen. 0-change makes people mad though
|
||||
else if(ran < 0) ran = round(ran) //negative, so floor it
|
||||
else ran = -round(-ran) //positive, so ceiling it
|
||||
if(ran == 0)
|
||||
ran = pick(-1,1) //hacky, statistically should almost never happen. 0-change makes people mad though
|
||||
else if(ran < 0)
|
||||
ran = round(ran) //negative, so floor it
|
||||
else
|
||||
ran = -round(-ran) //positive, so ceiling it
|
||||
return num2hex(Wrap(hex2num(input)+ran, 0, 16**length), length)
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/proc/randomize_radiation_accuracy(position_we_were_supposed_to_hit, radduration, number_of_blocks)
|
||||
@@ -492,7 +537,7 @@
|
||||
var/list/buffer_slot = buffer[buffer_num]
|
||||
var/mob/living/carbon/viable_occupant = get_viable_occupant()
|
||||
if(istype(buffer_slot))
|
||||
viable_occupant.radiation += rand(10/(connected.damage_coeff ** 2),25/(connected.damage_coeff ** 2))
|
||||
viable_occupant.radiation += rand(10/(connected.damage_coeff ** 2),25/(connected.damage_coeff ** 2))
|
||||
//15 and 40 are just magic numbers that were here before so i didnt touch them, they are initial boundaries of damage
|
||||
//Each laser level reduces damage by lvl^2, so no effect on 1 lvl, 4 times less damage on 2 and 9 times less damage on 3
|
||||
//Numbers are this high because other way upgrading laser is just not worth the hassle, and i cant think of anything better to inmrove
|
||||
|
||||
@@ -171,7 +171,8 @@
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/mob/living/simple_animal/bot/medbot/M in living_mob_list)
|
||||
if(M.z != src.z) continue //only find medibots on the same z-level as the computer
|
||||
if(M.z != src.z)
|
||||
continue //only find medibots on the same z-level as the computer
|
||||
var/turf/bl = get_turf(M)
|
||||
if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
|
||||
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
|
||||
|
||||
@@ -35,8 +35,10 @@
|
||||
var/turf/Tr = null
|
||||
for(var/obj/item/weapon/implant/chem/C in tracked_implants)
|
||||
Tr = get_turf(C)
|
||||
if((Tr) && (Tr.z != src.z)) continue//Out of range
|
||||
if(!C.implanted) continue
|
||||
if((Tr) && (Tr.z != src.z))
|
||||
continue//Out of range
|
||||
if(!C.implanted)
|
||||
continue
|
||||
dat += "[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject: "
|
||||
dat += "<A href='?src=\ref[src];inject1=\ref[C]'>(<font class='bad'>(1)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject5=\ref[C]'>(<font class='bad'>(5)</font>)</A>"
|
||||
@@ -112,14 +114,17 @@
|
||||
inserted_id.goal = num
|
||||
else if(href_list["inject1"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
|
||||
if(I) I.activate(1)
|
||||
if(I)
|
||||
I.activate(1)
|
||||
else if(href_list["inject5"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
|
||||
if(I) I.activate(5)
|
||||
if(I)
|
||||
I.activate(5)
|
||||
|
||||
else if(href_list["inject10"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
|
||||
if(I) I.activate(10)
|
||||
if(I)
|
||||
I.activate(10)
|
||||
|
||||
else if(href_list["lock"])
|
||||
if(src.allowed(usr))
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/emergency_shuttle/attackby(obj/item/weapon/card/W, mob/user, params)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(!istype(W, /obj/item/weapon/card))
|
||||
return
|
||||
if(SSshuttle.emergency.mode != SHUTTLE_DOCKED)
|
||||
|
||||
@@ -1026,7 +1026,8 @@ var/list/airlock_overlays = list()
|
||||
return 1
|
||||
|
||||
/obj/machinery/door/airlock/proc/prison_open()
|
||||
if(emagged) return
|
||||
if(emagged)
|
||||
return
|
||||
src.locked = 0
|
||||
src.open()
|
||||
src.locked = 1
|
||||
@@ -1055,7 +1056,8 @@ var/list/airlock_overlays = list()
|
||||
optionlist = list("Public", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Mining", "Maintenance", "External", "High Security")
|
||||
|
||||
var/paintjob = input(user, "Please select a paintjob for this airlock.") in optionlist
|
||||
if((!in_range(src, usr) && src.loc != usr) || !W.use(user)) return
|
||||
if((!in_range(src, usr) && src.loc != usr) || !W.use(user))
|
||||
return
|
||||
switch(paintjob)
|
||||
if("Public")
|
||||
icon = 'icons/obj/doors/airlocks/station/public.dmi'
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
// if it's less than 0, open door, reset timer
|
||||
// update the door_timer window and the icon
|
||||
/obj/machinery/door_timer/process()
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(timing)
|
||||
if(world.time > src.releasetime)
|
||||
Radio.set_frequency(SEC_FREQ)
|
||||
@@ -87,32 +88,40 @@
|
||||
// open/closedoor checks if door_timer has power, if so it checks if the
|
||||
// linked door is open/closed (by density) then opens it/closes it.
|
||||
/obj/machinery/door_timer/proc/timer_start()
|
||||
if(stat & (NOPOWER|BROKEN)) return 0
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(door.density) continue
|
||||
if(door.density)
|
||||
continue
|
||||
spawn(0)
|
||||
door.close()
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken) continue
|
||||
if(C.opened && !C.close()) continue
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened && !C.close())
|
||||
continue
|
||||
C.locked = 1
|
||||
C.update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door_timer/proc/timer_end()
|
||||
if(stat & (NOPOWER|BROKEN)) return 0
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(!door.density) continue
|
||||
if(!door.density)
|
||||
continue
|
||||
spawn(0)
|
||||
door.open()
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken) continue
|
||||
if(C.opened) continue
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened)
|
||||
continue
|
||||
C.locked = 0
|
||||
C.update_icon()
|
||||
|
||||
@@ -229,13 +238,15 @@
|
||||
disp2 = "Error"
|
||||
update_display(disp1, disp2)
|
||||
else
|
||||
if(maptext) maptext = ""
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
return
|
||||
|
||||
|
||||
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
|
||||
/obj/machinery/door_timer/proc/set_picture(state)
|
||||
if(maptext) maptext = ""
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
picture_state = state
|
||||
overlays.Cut()
|
||||
overlays += image('icons/obj/status_display.dmi', icon_state=picture_state)
|
||||
|
||||
@@ -115,9 +115,11 @@
|
||||
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/device/detective_scanner))
|
||||
return
|
||||
if(isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
|
||||
if(isrobot(user))
|
||||
return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
|
||||
src.add_fingerprint(user)
|
||||
if(operating || emagged) return
|
||||
if(operating || emagged)
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
user = null
|
||||
if(!src.requiresID())
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
|
||||
/obj/machinery/door/firedoor/attackby(obj/item/weapon/C, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(operating) return//Already doing something.
|
||||
if(operating)
|
||||
return//Already doing something.
|
||||
|
||||
if(istype(C, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = C
|
||||
@@ -54,7 +55,8 @@
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] starts undoing [src]'s bolts...</span>", \
|
||||
"<span class='notice'>You start unfastening [src]'s floor bolts...</span>")
|
||||
if(!do_after(user, 50/C.toolspeed, target = src)) return
|
||||
if(!do_after(user, 50/C.toolspeed, target = src))
|
||||
return
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] unfastens [src]'s bolts.</span>", \
|
||||
"<span class='notice'>You undo [src]'s floor bolts.</span>")
|
||||
@@ -67,7 +69,8 @@
|
||||
return
|
||||
|
||||
if(istype(C, /obj/item/weapon/crowbar) || (istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1))
|
||||
if(blocked || operating) return
|
||||
if(blocked || operating)
|
||||
return
|
||||
if(density)
|
||||
open()
|
||||
return
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
|
||||
|
||||
/obj/machinery/door/unpowered/Bumped(atom/AM)
|
||||
if(src.locked) return
|
||||
if(src.locked)
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/door/unpowered/attackby(obj/item/I, mob/user, params)
|
||||
if(src.locked) return
|
||||
if(src.locked)
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
@@ -37,13 +37,20 @@
|
||||
|
||||
var/percent = round((beaker.reagents.total_volume / beaker.volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9) filling.icon_state = "reagent0"
|
||||
if(10 to 24) filling.icon_state = "reagent10"
|
||||
if(25 to 49) filling.icon_state = "reagent25"
|
||||
if(50 to 74) filling.icon_state = "reagent50"
|
||||
if(75 to 79) filling.icon_state = "reagent75"
|
||||
if(80 to 90) filling.icon_state = "reagent80"
|
||||
if(91 to INFINITY) filling.icon_state = "reagent100"
|
||||
if(0 to 9)
|
||||
filling.icon_state = "reagent0"
|
||||
if(10 to 24)
|
||||
filling.icon_state = "reagent10"
|
||||
if(25 to 49)
|
||||
filling.icon_state = "reagent25"
|
||||
if(50 to 74)
|
||||
filling.icon_state = "reagent50"
|
||||
if(75 to 79)
|
||||
filling.icon_state = "reagent75"
|
||||
if(80 to 90)
|
||||
filling.icon_state = "reagent80"
|
||||
if(91 to INFINITY)
|
||||
filling.icon_state = "reagent100"
|
||||
|
||||
filling.icon += mix_color_from_reagents(beaker.reagents.reagent_list)
|
||||
overlays += filling
|
||||
|
||||
@@ -82,9 +82,11 @@
|
||||
if(command)
|
||||
switch(command)
|
||||
if("set-electriclevel")
|
||||
if(modifier) electricity_level = modifier
|
||||
if(modifier)
|
||||
electricity_level = modifier
|
||||
if("set-magneticfield")
|
||||
if(modifier) magnetic_field = modifier
|
||||
if(modifier)
|
||||
magnetic_field = modifier
|
||||
|
||||
if("add-elec")
|
||||
electricity_level++
|
||||
@@ -104,9 +106,11 @@
|
||||
magnetic_field = 1
|
||||
|
||||
if("set-x")
|
||||
if(modifier) center_x = modifier
|
||||
if(modifier)
|
||||
center_x = modifier
|
||||
if("set-y")
|
||||
if(modifier) center_y = modifier
|
||||
if(modifier)
|
||||
center_y = modifier
|
||||
|
||||
if("N") // NORTH
|
||||
center_y++
|
||||
@@ -124,7 +128,8 @@
|
||||
center_y = rand(-max_dist, max_dist)
|
||||
|
||||
if("set-code")
|
||||
if(modifier) code = modifier
|
||||
if(modifier)
|
||||
code = modifier
|
||||
if("toggle-power")
|
||||
on = !on
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
usr.set_machine(src)
|
||||
if(!mapping) return
|
||||
if(!mapping)
|
||||
return
|
||||
|
||||
log_game("[usr]([usr.key]) used station map L[z] in [src.loc.loc]")
|
||||
|
||||
|
||||
@@ -255,7 +255,8 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
return
|
||||
|
||||
/obj/machinery/requests_console/Topic(href, href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -291,7 +292,8 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
screen = 0
|
||||
|
||||
if(href_list["sendAnnouncement"])
|
||||
if(!announcementConsole) return
|
||||
if(!announcementConsole)
|
||||
return
|
||||
minor_announce(message, "[department] Announcement:")
|
||||
news_network.SubmitArticle(message, department, "Station Announcements", null)
|
||||
log_say("[key_name(usr)] has made a station announcement: [message]")
|
||||
@@ -409,7 +411,8 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
if(9) //authentication
|
||||
screen = 9
|
||||
if(10) //send announcement
|
||||
if(!announcementConsole) return
|
||||
if(!announcementConsole)
|
||||
return
|
||||
screen = 10
|
||||
else //main menu
|
||||
dpt = ""
|
||||
@@ -422,8 +425,10 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
//Handle silencing the console
|
||||
switch( href_list["setSilent"] )
|
||||
if(null) //skip
|
||||
if("1") silent = 1
|
||||
else silent = 0
|
||||
if("1")
|
||||
silent = 1
|
||||
else
|
||||
silent = 0
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -295,7 +295,8 @@
|
||||
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
var/datum/powernet/PN
|
||||
if(C) PN = C.powernet // find the powernet of the connected cable
|
||||
if(C)
|
||||
PN = C.powernet // find the powernet of the connected cable
|
||||
|
||||
if(!PN)
|
||||
power = 0
|
||||
|
||||
@@ -88,8 +88,8 @@
|
||||
freq_listening = list(COMM_FREQ, ENG_FREQ, SEC_FREQ) //command, engineering, security
|
||||
|
||||
//Common and other radio frequencies for people to freely use
|
||||
New()
|
||||
for(var/i = 1441, i < 1489, i += 2)
|
||||
freq_listening |= i
|
||||
..()
|
||||
/obj/machinery/telecomms/receiver/preset_right/New()
|
||||
for(var/i = 1441, i < 1489, i += 2)
|
||||
freq_listening |= i
|
||||
..()
|
||||
|
||||
|
||||
@@ -189,8 +189,10 @@
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(!T) continue
|
||||
if(T.z == ZLEVEL_CENTCOM) continue
|
||||
if(!T)
|
||||
continue
|
||||
if(T.z == ZLEVEL_CENTCOM)
|
||||
continue
|
||||
var/tmpname = M.real_name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
|
||||
@@ -211,7 +211,8 @@
|
||||
/obj/effect/anomaly/bhole/proc/affect_coord(x, y, ex_act_force, pull_chance, turf_removal_chance)
|
||||
//Get turf at coordinate
|
||||
var/turf/T = locate(x, y, z)
|
||||
if(isnull(T)) return
|
||||
if(isnull(T))
|
||||
return
|
||||
|
||||
//Pulling and/or ex_act-ing movable atoms in that turf
|
||||
if(prob(pull_chance))
|
||||
|
||||
@@ -240,7 +240,8 @@ list(name = "- Carbon Dioxide", desc = " This informational poster teaches the v
|
||||
|
||||
//seperated to reduce code duplication. Moved here for ease of reference and to unclutter r_wall/attackby()
|
||||
/turf/simulated/wall/proc/place_poster(obj/item/weapon/poster/P, mob/user)
|
||||
if(!P.resulting_poster) return
|
||||
if(!P.resulting_poster)
|
||||
return
|
||||
|
||||
var/stuff_on_wall = 0
|
||||
for(var/obj/O in contents) //Let's see if it already has a poster on it or too much stuff
|
||||
@@ -265,7 +266,8 @@ list(name = "- Carbon Dioxide", desc = " This informational poster teaches the v
|
||||
playsound(D.loc, 'sound/items/poster_being_created.ogg', 100, 1)
|
||||
|
||||
if(do_after(user,D.placespeed,target=src))
|
||||
if(!D) return
|
||||
if(!D)
|
||||
return
|
||||
|
||||
if(istype(src,/turf/simulated/wall) && user && user.loc == temp_loc) //Let's check if everything is still there
|
||||
user << "<span class='notice'>You place the poster!</span>"
|
||||
|
||||
@@ -126,10 +126,14 @@
|
||||
if(dist < flame_range)
|
||||
flame_dist = 1
|
||||
|
||||
if(dist < devastation_range) dist = 1
|
||||
else if(dist < heavy_impact_range) dist = 2
|
||||
else if(dist < light_impact_range) dist = 3
|
||||
else dist = 0
|
||||
if(dist < devastation_range)
|
||||
dist = 1
|
||||
else if(dist < heavy_impact_range)
|
||||
dist = 2
|
||||
else if(dist < light_impact_range)
|
||||
dist = 3
|
||||
else
|
||||
dist = 0
|
||||
|
||||
//------- TURF FIRES -------
|
||||
|
||||
@@ -152,7 +156,8 @@
|
||||
|
||||
var/took = (world.timeofday-start)/10
|
||||
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
|
||||
if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
|
||||
if(Debug2)
|
||||
world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
|
||||
|
||||
//Machines which report explosions.
|
||||
for(var/array in doppler_arrays)
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/body_egg/process()
|
||||
if(!owner) return
|
||||
if(!owner)
|
||||
return
|
||||
if(!(src in owner.internal_organs))
|
||||
Remove(owner)
|
||||
return
|
||||
|
||||
@@ -382,7 +382,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
if (!toff)
|
||||
for (var/obj/item/device/pda/P in sortNames(get_viewable_pdas()))
|
||||
if (P == src) continue
|
||||
if (P == src)
|
||||
continue
|
||||
dat += "<li><a href='byond://?src=\ref[src];choice=Message;target=\ref[P]'>[P]</a>"
|
||||
if (istype(cartridge, /obj/item/weapon/cartridge/syndicate) && P.detonate)
|
||||
dat += " (<a href='byond://?src=\ref[src];choice=Detonate;target=\ref[P]'><img src=pda_boom.png>*Detonate*</a>)"
|
||||
@@ -503,12 +504,16 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if("Light")
|
||||
if(fon)
|
||||
fon = 0
|
||||
if(src in U.contents) U.AddLuminosity(-f_lum)
|
||||
else SetLuminosity(0)
|
||||
if(src in U.contents)
|
||||
U.AddLuminosity(-f_lum)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
else
|
||||
fon = 1
|
||||
if(src in U.contents) U.AddLuminosity(f_lum)
|
||||
else SetLuminosity(f_lum)
|
||||
if(src in U.contents)
|
||||
U.AddLuminosity(f_lum)
|
||||
else
|
||||
SetLuminosity(f_lum)
|
||||
if("Medical Scan")
|
||||
if(scanmode == 1)
|
||||
scanmode = 0
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
|
||||
proc/digest_delay()
|
||||
spawn(600)
|
||||
qdel(src)*/ //Bacon beacons are no more rip in peace
|
||||
//Probably a better way of doing this, I'm lazy.
|
||||
/obj/item/device/radio/beacon/bacon/proc/digest_delay()
|
||||
spawn(600)
|
||||
qdel(src)*/ //Bacon beacons are no more rip in peace
|
||||
@@ -101,7 +101,8 @@
|
||||
user << "<span class='warning'>You need one sheet of metal to start building ED-209!</span>"
|
||||
return
|
||||
if(istype(W, /obj/item/robot_parts/l_leg))
|
||||
if(src.l_leg) return
|
||||
if(src.l_leg)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
@@ -109,7 +110,8 @@
|
||||
src.updateicon()
|
||||
|
||||
if(istype(W, /obj/item/robot_parts/r_leg))
|
||||
if(src.r_leg) return
|
||||
if(src.r_leg)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
@@ -117,7 +119,8 @@
|
||||
src.updateicon()
|
||||
|
||||
if(istype(W, /obj/item/robot_parts/l_arm))
|
||||
if(src.l_arm) return
|
||||
if(src.l_arm)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
@@ -125,7 +128,8 @@
|
||||
src.updateicon()
|
||||
|
||||
if(istype(W, /obj/item/robot_parts/r_arm))
|
||||
if(src.r_arm) return
|
||||
if(src.r_arm)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
@@ -133,7 +137,8 @@
|
||||
src.updateicon()
|
||||
|
||||
if(istype(W, /obj/item/robot_parts/chest))
|
||||
if(src.chest) return
|
||||
if(src.chest)
|
||||
return
|
||||
if(W:wired && W:cell)
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
@@ -146,7 +151,8 @@
|
||||
user << "<span class='warning'>You need to attach a cell to it first!</span>"
|
||||
|
||||
if(istype(W, /obj/item/robot_parts/head))
|
||||
if(src.head) return
|
||||
if(src.head)
|
||||
return
|
||||
if(W:flash2 && W:flash1)
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
@@ -190,7 +196,8 @@
|
||||
return
|
||||
|
||||
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
|
||||
if(!O) return
|
||||
if(!O)
|
||||
return
|
||||
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
else if(user.gender == FEMALE)
|
||||
t_himself = "herself"
|
||||
user.visible_message("<span class='notice'>[user] starts to apply [src] on [t_himself]...</span>", "<span class='notice'>You begin applying [src] on yourself...</span>")
|
||||
if(!do_mob(user, M, self_delay)) return
|
||||
if(!do_mob(user, M, self_delay))
|
||||
return
|
||||
user.visible_message("<span class='green'>[user] applies [src] on [t_himself].</span>", "<span class='green'>You apply [src] on yourself.</span>")
|
||||
|
||||
|
||||
|
||||
@@ -56,18 +56,23 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/sheet/glass/proc/construct_window(mob/user)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user || !src)
|
||||
return 0
|
||||
if(!istype(user.loc,/turf))
|
||||
return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
|
||||
return 0
|
||||
if(zero_amount()) return 0
|
||||
if(zero_amount())
|
||||
return 0
|
||||
var/title = "Sheet-Glass"
|
||||
title += " ([src.get_amount()] sheet\s left)"
|
||||
switch(alert(title, "Would you like full tile glass or one direction?", "One Direction", "Full Window", "Cancel", null))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(!src)
|
||||
return 1
|
||||
if(src.loc != user)
|
||||
return 1
|
||||
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
@@ -101,8 +106,10 @@
|
||||
src.use(1)
|
||||
W.add_fingerprint(user)
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(!src)
|
||||
return 1
|
||||
if(src.loc != user)
|
||||
return 1
|
||||
if(src.get_amount() < 2)
|
||||
user << "<span class='warning'>You need more glass to do that!</span>"
|
||||
return 1
|
||||
@@ -153,8 +160,10 @@
|
||||
construct_window(user)
|
||||
|
||||
/obj/item/stack/sheet/rglass/proc/construct_window(mob/user)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user || !src)
|
||||
return 0
|
||||
if(!istype(user.loc,/turf))
|
||||
return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
|
||||
return 0
|
||||
@@ -162,8 +171,10 @@
|
||||
title += " ([src.get_amount()] sheet\s left)"
|
||||
switch(input(title, "Would you like full tile glass a one direction glass pane or a windoor?") in list("One Direction", "Full Window", "Windoor", "Cancel"))
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(!src)
|
||||
return 1
|
||||
if(src.loc != user)
|
||||
return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
@@ -197,8 +208,10 @@
|
||||
src.use(1)
|
||||
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(!src)
|
||||
return 1
|
||||
if(src.loc != user)
|
||||
return 1
|
||||
if(src.get_amount() < 2)
|
||||
user << "<span class='warning'>You need more glass to do that!</span>"
|
||||
return 1
|
||||
@@ -290,7 +303,8 @@
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/weapon/shard/afterattack(atom/A as mob|obj, mob/user, proximity)
|
||||
if(!proximity || !(src in user)) return
|
||||
if(!proximity || !(src in user))
|
||||
return
|
||||
if(isturf(A))
|
||||
return
|
||||
if(istype(A, /obj/item/weapon/storage))
|
||||
|
||||
@@ -222,7 +222,8 @@
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user)
|
||||
if (user.get_inactive_hand() == src)
|
||||
if(zero_amount()) return
|
||||
if(zero_amount())
|
||||
return
|
||||
var/obj/item/stack/F = new src.type(user, 1)
|
||||
. = F
|
||||
F.copy_evidences(src)
|
||||
@@ -263,12 +264,13 @@
|
||||
var/time = 0
|
||||
var/one_per_turf = 0
|
||||
var/on_floor = 0
|
||||
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
src.res_amount = res_amount
|
||||
src.max_res_amount = max_res_amount
|
||||
src.time = time
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
|
||||
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
src.res_amount = res_amount
|
||||
src.max_res_amount = max_res_amount
|
||||
src.time = time
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
|
||||
@@ -135,7 +135,8 @@ AI MODULES
|
||||
|
||||
/obj/item/weapon/aiModule/supplied/safeguard/attack_self(mob/user)
|
||||
var/targName = stripped_input(user, "Please enter the subject to safeguard.", "Safeguard who?", user.name,MAX_NAME_LEN)
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
targetName = targName
|
||||
laws[1] = "Safeguard [targetName]. Individuals that threaten [targetName] are not human and must be eliminated."
|
||||
..()
|
||||
@@ -161,7 +162,8 @@ AI MODULES
|
||||
|
||||
/obj/item/weapon/aiModule/zeroth/oneHuman/attack_self(mob/user)
|
||||
var/targName = stripped_input(user, "Please enter the subject who is the only human.", "Who?", user.real_name,MAX_NAME_LEN)
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
targetName = targName
|
||||
laws[1] = "Only [targetName] is human"
|
||||
..()
|
||||
@@ -224,7 +226,8 @@ AI MODULES
|
||||
newpos = 15
|
||||
lawpos = min(newpos, 50)
|
||||
var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1], MAX_MESSAGE_LEN)
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
laws[1] = targName
|
||||
..()
|
||||
|
||||
@@ -299,7 +302,8 @@ AI MODULES
|
||||
|
||||
/obj/item/weapon/aiModule/core/full/asimov/attack_self(var/mob/user as mob)
|
||||
var/targName = stripped_input(user, "Please enter a new subject that asimov is concerned with.", "Asimov to who?", subject, MAX_MESSAGE_LEN)
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
subject = targName
|
||||
laws = list("You may not injure a [subject] or, through inaction, allow a [subject] to come to harm.",\
|
||||
"You must obey orders given to you by [subject]s, except where such orders would conflict with the First Law.",\
|
||||
@@ -359,8 +363,10 @@ AI MODULES
|
||||
/obj/item/weapon/aiModule/core/full/custom/New()
|
||||
..()
|
||||
for(var/line in file2list("config/silicon_laws.txt"))
|
||||
if(!line) continue
|
||||
if(findtextEx(line,"#",1,2)) continue
|
||||
if(!line)
|
||||
continue
|
||||
if(findtextEx(line,"#",1,2))
|
||||
continue
|
||||
|
||||
laws += line
|
||||
|
||||
@@ -408,7 +414,8 @@ AI MODULES
|
||||
|
||||
/obj/item/weapon/aiModule/core/freeformcore/attack_self(mob/user)
|
||||
var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", laws[1])
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
laws[1] = targName
|
||||
..()
|
||||
|
||||
@@ -427,7 +434,8 @@ AI MODULES
|
||||
|
||||
/obj/item/weapon/aiModule/syndicate/attack_self(mob/user)
|
||||
var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1],MAX_MESSAGE_LEN)
|
||||
if(!targName) return
|
||||
if(!targName)
|
||||
return
|
||||
laws[1] = targName
|
||||
..()
|
||||
|
||||
|
||||
@@ -183,7 +183,8 @@ var/global/list/RPD_recipes=list(
|
||||
return "<a href=\"?src=\ref[src];setdir=[_dir];flipped=[flipped]\" title=\"[title]\"[selected]\"><img src=\"[pic]\" /></a>"
|
||||
|
||||
/obj/item/weapon/pipe_dispenser/proc/show_menu(mob/user)
|
||||
if(!user || !src) return 0
|
||||
if(!user || !src)
|
||||
return 0
|
||||
var/dat = {"<h2>Type</h2>
|
||||
<b>Utilities:</b>
|
||||
<ul>"}
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
|
||||
/obj/item/weapon/card/emag/afterattack(atom/target, mob/user, proximity)
|
||||
var/atom/A = target
|
||||
if(!proximity) return
|
||||
if(!proximity)
|
||||
return
|
||||
A.emag_act(user)
|
||||
|
||||
/obj/item/weapon/card/id
|
||||
@@ -133,7 +134,8 @@ update_label("John Doe", "Clowny")
|
||||
origin_tech = "syndicate=3"
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/afterattack(obj/item/weapon/O, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/I = O
|
||||
src.access |= I.access
|
||||
@@ -176,10 +178,11 @@ update_label("John Doe", "Clowny")
|
||||
item_state = "gold_id"
|
||||
registered_name = "Captain"
|
||||
assignment = "Captain"
|
||||
New()
|
||||
var/datum/job/captain/J = new/datum/job/captain
|
||||
access = J.get_access()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/id/captains_spare/New()
|
||||
var/datum/job/captain/J = new/datum/job/captain
|
||||
access = J.get_access()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/id/centcom
|
||||
name = "\improper Centcom ID"
|
||||
@@ -187,31 +190,41 @@ update_label("John Doe", "Clowny")
|
||||
icon_state = "centcom"
|
||||
registered_name = "Central Command"
|
||||
assignment = "General"
|
||||
New()
|
||||
access = get_all_centcom_access()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/id/centcom/New()
|
||||
access = get_all_centcom_access()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/id/ert
|
||||
name = "\improper Centcom ID"
|
||||
desc = "A ERT ID card"
|
||||
icon_state = "centcom"
|
||||
registered_name = "Emergency Response Team Commander"
|
||||
assignment = "Emergency Response Team Commander"
|
||||
New() access = get_all_accesses()+get_ert_access("commander")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/New()
|
||||
access = get_all_accesses()+get_ert_access("commander")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Security
|
||||
registered_name = "Security Response Officer"
|
||||
assignment = "Security Response Officer"
|
||||
New() access = get_all_accesses()+get_ert_access("sec")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Security/New()
|
||||
access = get_all_accesses()+get_ert_access("sec")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Engineer
|
||||
registered_name = "Engineer Response Officer"
|
||||
assignment = "Engineer Response Officer"
|
||||
New() access = get_all_accesses()+get_ert_access("eng")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Engineer/New()
|
||||
access = get_all_accesses()+get_ert_access("eng")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Medical
|
||||
registered_name = "Medical Response Officer"
|
||||
assignment = "Medical Response Officer"
|
||||
New() access = get_all_accesses()+get_ert_access("med")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/ert/Medical/New()
|
||||
access = get_all_accesses()+get_ert_access("med")-access_change_ids
|
||||
|
||||
/obj/item/weapon/card/id/prisoner
|
||||
name = "prisoner ID card"
|
||||
|
||||
@@ -44,9 +44,11 @@
|
||||
icon_state = "lipstick"
|
||||
|
||||
/obj/item/weapon/lipstick/attack(mob/M, mob/user)
|
||||
if(!open) return
|
||||
if(!open)
|
||||
return
|
||||
|
||||
if(!istype(M, /mob)) return
|
||||
if(!istype(M, /mob))
|
||||
return
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
@@ -7,17 +7,22 @@
|
||||
/obj/item/weapon/storage/pill_bottle/dice/New()
|
||||
..()
|
||||
var/special_die = pick("1","2","fudge","00","100")
|
||||
if(special_die == "1") new /obj/item/weapon/dice/d1(src)
|
||||
if(special_die == "2") new /obj/item/weapon/dice/d2(src)
|
||||
if(special_die == "1")
|
||||
new /obj/item/weapon/dice/d1(src)
|
||||
if(special_die == "2")
|
||||
new /obj/item/weapon/dice/d2(src)
|
||||
new /obj/item/weapon/dice/d4(src)
|
||||
new /obj/item/weapon/dice/d6(src)
|
||||
if(special_die == "fudge") new /obj/item/weapon/dice/fudge(src)
|
||||
if(special_die == "fudge")
|
||||
new /obj/item/weapon/dice/fudge(src)
|
||||
new /obj/item/weapon/dice/d8(src)
|
||||
new /obj/item/weapon/dice/d10(src)
|
||||
if(special_die == "00") new /obj/item/weapon/dice/d00(src)
|
||||
if(special_die == "00")
|
||||
new /obj/item/weapon/dice/d00(src)
|
||||
new /obj/item/weapon/dice/d12(src)
|
||||
new /obj/item/weapon/dice/d20(src)
|
||||
if(special_die == "100") new /obj/item/weapon/dice/d100(src)
|
||||
if(special_die == "100")
|
||||
new /obj/item/weapon/dice/d100(src)
|
||||
|
||||
/obj/item/weapon/dice //depreciated d6, use /obj/item/weapon/dice/d6 if you actually want a d6
|
||||
name = "die"
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
|
||||
if(target != user)
|
||||
target.visible_message("<span class='danger'>[user] is trying to inject [target] with [src]!</span>", "<span class='userdanger'>[user] is trying to inject [target] with [src]!</span>")
|
||||
if(!do_mob(user, target)) return
|
||||
if(!do_mob(user, target))
|
||||
return
|
||||
target.visible_message("<span class='danger'>[user] injects [target] with the syringe with [src]!", \
|
||||
"<span class='userdanger'>[user] injects [target] with the syringe with [src]!")
|
||||
|
||||
|
||||
@@ -70,7 +70,8 @@
|
||||
flame_turf(turflist)
|
||||
|
||||
/obj/item/weapon/flamethrower/attackby(obj/item/W, mob/user, params)
|
||||
if(user.stat || user.restrained() || user.lying) return
|
||||
if(user.stat || user.restrained() || user.lying)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wrench) && !status)//Taking this apart
|
||||
var/turf/T = get_turf(src)
|
||||
if(weldtool)
|
||||
@@ -94,8 +95,10 @@
|
||||
|
||||
if(isigniter(W))
|
||||
var/obj/item/device/assembly/igniter/I = W
|
||||
if(I.secured) return
|
||||
if(igniter) return
|
||||
if(I.secured)
|
||||
return
|
||||
if(igniter)
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
I.loc = src
|
||||
@@ -121,7 +124,8 @@
|
||||
|
||||
|
||||
/obj/item/weapon/flamethrower/attack_self(mob/user)
|
||||
if(user.stat || user.restrained() || user.lying) return
|
||||
if(user.stat || user.restrained() || user.lying)
|
||||
return
|
||||
user.set_machine(src)
|
||||
if(!ptank)
|
||||
user << "<span class='notice'>Attach a plasma tank first!</span>"
|
||||
@@ -137,11 +141,14 @@
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=flamethrower")
|
||||
return
|
||||
if(usr.stat || usr.restrained() || usr.lying) return
|
||||
if(usr.stat || usr.restrained() || usr.lying)
|
||||
return
|
||||
usr.set_machine(src)
|
||||
if(href_list["light"])
|
||||
if(!ptank) return
|
||||
if(!status) return
|
||||
if(!ptank)
|
||||
return
|
||||
if(!status)
|
||||
return
|
||||
lit = !lit
|
||||
if(lit)
|
||||
SSobj.processing |= src
|
||||
@@ -152,7 +159,8 @@
|
||||
throw_amount = throw_amount + text2num(href_list["amount"])
|
||||
throw_amount = max(50, min(5000, throw_amount))
|
||||
if(href_list["remove"])
|
||||
if(!ptank) return
|
||||
if(!ptank)
|
||||
return
|
||||
usr.put_in_hands(ptank)
|
||||
ptank = null
|
||||
lit = 0
|
||||
@@ -174,7 +182,8 @@
|
||||
|
||||
//Called from turf.dm turf/dblclick
|
||||
/obj/item/weapon/flamethrower/proc/flame_turf(turflist)
|
||||
if(!lit || operating) return
|
||||
if(!lit || operating)
|
||||
return
|
||||
operating = 1
|
||||
var/turf/previousturf = get_turf(src)
|
||||
for(var/turf/simulated/T in turflist)
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
|
||||
var/gift_type = pick(gift_type_list)
|
||||
|
||||
if(!ispath(gift_type,/obj/item)) return
|
||||
if(!ispath(gift_type,/obj/item))
|
||||
return
|
||||
|
||||
var/obj/item/I = new gift_type(M)
|
||||
M.unEquip(src, 1)
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
activate(reagents.total_volume)
|
||||
|
||||
/obj/item/weapon/implant/chem/activate(cause)
|
||||
if(!cause || !imp_in) return 0
|
||||
if(!cause || !imp_in)
|
||||
return 0
|
||||
var/mob/living/carbon/R = imp_in
|
||||
var/injectamount = null
|
||||
if (cause == "action_button")
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
activate("death")
|
||||
|
||||
/obj/item/weapon/implant/explosive/activate(cause)
|
||||
if(!cause || !imp_in) return 0
|
||||
if(!cause || !imp_in)
|
||||
return 0
|
||||
if(cause == "action_button" && alert(imp_in, "Are you sure you want to activate your microbomb implant? This will cause you to explode!", "Microbomb Implant Confirmation", "Yes", "No") != "Yes")
|
||||
return 0
|
||||
heavy = round(heavy)
|
||||
@@ -82,7 +83,8 @@
|
||||
delay = 70
|
||||
|
||||
/obj/item/weapon/implant/explosive/macro/activate(cause)
|
||||
if(!cause || !imp_in) return 0
|
||||
if(!cause || !imp_in)
|
||||
return 0
|
||||
if(cause == "action_button" && alert(imp_in, "Are you sure you want to activate your macrobomb implant? This will cause you to explode and gib!", "Macrobomb Implant Confirmation", "Yes", "No") != "Yes")
|
||||
return 0
|
||||
imp_in << "<span class='notice'>You activate your macrobomb implant.</span>"
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
|
||||
/obj/item/weapon/implant/freedom/activate()
|
||||
if(uses == 0) return 0
|
||||
if(uses != -1) uses--
|
||||
if(uses == 0)
|
||||
return 0
|
||||
if(uses != -1)
|
||||
uses--
|
||||
imp_in << "You feel a faint click."
|
||||
if(iscarbon(imp_in))
|
||||
var/mob/living/carbon/C_imp_in = imp_in
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
return dat
|
||||
|
||||
/obj/item/weapon/implant/adrenalin/activate()
|
||||
if(uses < 1) return 0
|
||||
if(uses < 1)
|
||||
return 0
|
||||
uses--
|
||||
imp_in << "<span class='notice'>You feel a sudden surge of energy!</span>"
|
||||
imp_in.SetStunned(0)
|
||||
@@ -56,6 +57,7 @@
|
||||
uses = 2
|
||||
|
||||
/obj/item/weapon/implant/emp/activate()
|
||||
if (src.uses < 1) return 0
|
||||
if (src.uses < 1)
|
||||
return 0
|
||||
src.uses--
|
||||
empulse(imp_in, 3, 5)
|
||||
|
||||
@@ -126,9 +126,11 @@
|
||||
/obj/machinery/implantchair/implant(mob/M)
|
||||
if (!istype(M, /mob/living/carbon))
|
||||
return
|
||||
if(!implant_list.len) return
|
||||
if(!implant_list.len)
|
||||
return
|
||||
for(var/obj/item/weapon/implant/loyalty/imp in implant_list)
|
||||
if(!imp) continue
|
||||
if(!imp)
|
||||
continue
|
||||
if(istype(imp, /obj/item/weapon/implant/loyalty))
|
||||
M.visible_message("<span class='warning'>[M] has been implanted by the [src.name].</span>")
|
||||
|
||||
|
||||
@@ -207,7 +207,8 @@
|
||||
consume_turf(target)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/proc/consume_turf(turf/T)
|
||||
if(istype(T, T.baseturf)) return //Can't void the void, baby!
|
||||
if(istype(T, T.baseturf))
|
||||
return //Can't void the void, baby!
|
||||
playsound(T, 'sound/effects/supermatter.ogg', 50, 1)
|
||||
T.visible_message("<span class='danger'>\The [T] smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
else
|
||||
user.show_message("<span class='danger'>Unable to reset internal memory.</span>", 1)
|
||||
src.l_hacking = 0
|
||||
else src.l_hacking = 0
|
||||
else
|
||||
src.l_hacking = 0
|
||||
return
|
||||
//At this point you have exhausted all the special things to do when locked
|
||||
// ... but it's still locked.
|
||||
|
||||
@@ -197,11 +197,11 @@
|
||||
var/obj/item/sample_object
|
||||
var/number
|
||||
|
||||
New(obj/item/sample)
|
||||
if(!istype(sample))
|
||||
qdel(src)
|
||||
sample_object = sample
|
||||
number = 1
|
||||
/datum/numbered_display/New(obj/item/sample)
|
||||
if(!istype(sample))
|
||||
qdel(src)
|
||||
sample_object = sample
|
||||
number = 1
|
||||
|
||||
|
||||
//This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing.
|
||||
@@ -235,7 +235,8 @@
|
||||
//This proc return 1 if the item can be picked up and 0 if it can't.
|
||||
//Set the stop_messages to stop it from printing messages
|
||||
/obj/item/weapon/storage/proc/can_be_inserted(obj/item/W, stop_messages = 0, mob/user)
|
||||
if(!istype(W) || (W.flags & ABSTRACT)) return //Not an item
|
||||
if(!istype(W) || (W.flags & ABSTRACT))
|
||||
return //Not an item
|
||||
|
||||
if(loc == W)
|
||||
return 0 //Means the item is already in the storage item
|
||||
@@ -292,7 +293,8 @@
|
||||
//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once,
|
||||
//such as when picking up all the items on a tile with one click.
|
||||
/obj/item/weapon/storage/proc/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/user)
|
||||
if(!istype(W)) return 0
|
||||
if(!istype(W))
|
||||
return 0
|
||||
if(usr)
|
||||
if(!usr.unEquip(W))
|
||||
return 0
|
||||
@@ -325,7 +327,8 @@
|
||||
|
||||
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
|
||||
/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
|
||||
if(!istype(W)) return 0
|
||||
if(!istype(W))
|
||||
return 0
|
||||
|
||||
if(istype(src, /obj/item/weapon/storage/fancy))
|
||||
var/obj/item/weapon/storage/fancy/F = src
|
||||
|
||||
@@ -92,7 +92,8 @@
|
||||
|
||||
if (istype(W, /obj/item/weapon/flamethrower))
|
||||
var/obj/item/weapon/flamethrower/F = W
|
||||
if ((!F.status)||(F.ptank)) return
|
||||
if ((!F.status)||(F.ptank))
|
||||
return
|
||||
src.master = F
|
||||
F.ptank = src
|
||||
user.unEquip(src)
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
var/on = 0
|
||||
volume = 300
|
||||
var/usage_ratio = 5 //5 unit added per 1 removed
|
||||
var/injection_amount = 1
|
||||
var/injection_amount = 1
|
||||
amount_per_transfer_from_this = 5
|
||||
flags = OPENCONTAINER
|
||||
spillable = 0
|
||||
@@ -375,9 +375,12 @@
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 15) filling.icon_state = "backpack-10"
|
||||
if(16 to 60) filling.icon_state = "backpack50"
|
||||
if(61 to INFINITY) filling.icon_state = "backpack100"
|
||||
if(0 to 15)
|
||||
filling.icon_state = "backpack-10"
|
||||
if(16 to 60)
|
||||
filling.icon_state = "backpack50"
|
||||
if(61 to INFINITY)
|
||||
filling.icon_state = "backpack100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
overlays += filling
|
||||
@@ -390,9 +393,12 @@
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 15) filling.icon_state = "backpackmob-10"
|
||||
if(16 to 60) filling.icon_state = "backpackmob50"
|
||||
if(61 to INFINITY) filling.icon_state = "backpackmob100"
|
||||
if(0 to 15)
|
||||
filling.icon_state = "backpackmob-10"
|
||||
if(16 to 60)
|
||||
filling.icon_state = "backpackmob50"
|
||||
if(61 to INFINITY)
|
||||
filling.icon_state = "backpackmob100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
. += filling
|
||||
|
||||
@@ -150,8 +150,10 @@ Frequency:
|
||||
L["[get_area(com.target)] (Inactive)"] = com.target
|
||||
var/list/turfs = list( )
|
||||
for(var/turf/T in ultra_range(10, orange=1))
|
||||
if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-8 || T.y<8) continue
|
||||
if(T.x>world.maxx-8 || T.x<8)
|
||||
continue //putting them at the edge is dumb
|
||||
if(T.y>world.maxy-8 || T.y<8)
|
||||
continue
|
||||
turfs += T
|
||||
if(turfs.len)
|
||||
L["None (Dangerous)"] = pick(turfs)
|
||||
|
||||
@@ -91,7 +91,8 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user)
|
||||
if(!istype(M)) return ..()
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head")
|
||||
return ..()
|
||||
if(user.disabilities & CLUMSY && prob(50))
|
||||
@@ -223,7 +224,8 @@
|
||||
if(src.remove_fuel(1))
|
||||
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] starts to fix some of the dents on [H]'s [affecting.getDisplayName()].</span>", "<span class='notice'>You start fixing some of the dents on [H]'s [affecting.getDisplayName()].</span>")
|
||||
if(!do_mob(user, H, 50)) return
|
||||
if(!do_mob(user, H, 50))
|
||||
return
|
||||
item_heal_robotic(H, user, 5, 0)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
var/unwieldsound = null
|
||||
|
||||
/obj/item/weapon/twohanded/proc/unwield(mob/living/carbon/user)
|
||||
if(!wielded || !user) return
|
||||
if(!wielded || !user)
|
||||
return
|
||||
wielded = 0
|
||||
if(force_unwielded)
|
||||
force = force_unwielded
|
||||
@@ -53,7 +54,8 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/twohanded/proc/wield(mob/living/carbon/user)
|
||||
if(wielded) return
|
||||
if(wielded)
|
||||
return
|
||||
if(istype(user,/mob/living/carbon/monkey) )
|
||||
user << "<span class='warning'>It's too heavy for you to wield fully.</span>"
|
||||
return
|
||||
@@ -272,13 +274,11 @@
|
||||
if(wielded)
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/green
|
||||
New()
|
||||
item_color = "green"
|
||||
/obj/item/weapon/twohanded/dualsaber/green/New()
|
||||
item_color = "green"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/red
|
||||
New()
|
||||
item_color = "red"
|
||||
/obj/item/weapon/twohanded/dualsaber/red/New()
|
||||
item_color = "red"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/attackby(obj/item/weapon/W, mob/user, params)
|
||||
..()
|
||||
|
||||
@@ -194,9 +194,12 @@ LINEN BINS
|
||||
|
||||
/obj/structure/bedsheetbin/update_icon()
|
||||
switch(amount)
|
||||
if(0) icon_state = "linenbin-empty"
|
||||
if(1 to 5) icon_state = "linenbin-half"
|
||||
else icon_state = "linenbin-full"
|
||||
if(0)
|
||||
icon_state = "linenbin-empty"
|
||||
if(1 to 5)
|
||||
icon_state = "linenbin-half"
|
||||
else
|
||||
icon_state = "linenbin-full"
|
||||
|
||||
/obj/structure/bedsheetbin/fire_act()
|
||||
if(!amount)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user