diff --git a/code/LINDA/LINDA_fire.dm b/code/LINDA/LINDA_fire.dm index 52ea8059ee0..a462e0887e0 100644 --- a/code/LINDA/LINDA_fire.dm +++ b/code/LINDA/LINDA_fire.dm @@ -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) diff --git a/code/LINDA/LINDA_system.dm b/code/LINDA/LINDA_system.dm index a3a972aba68..9b490803820 100644 --- a/code/LINDA/LINDA_system.dm +++ b/code/LINDA/LINDA_system.dm @@ -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 diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm index 2f720d946e1..ae0e1f12a9f 100644 --- a/code/LINDA/LINDA_turf_tile.dm +++ b/code/LINDA/LINDA_turf_tile.dm @@ -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)) diff --git a/code/__HELPERS/bygex/bygex.dm b/code/__HELPERS/bygex/bygex.dm index c5c4999ccca..69ebbd8dbb4 100644 --- a/code/__HELPERS/bygex/bygex.dm +++ b/code/__HELPERS/bygex/bygex.dm @@ -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[error]" - 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[error]" + 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 \ No newline at end of file diff --git a/code/__HELPERS/bygex/demo.dm b/code/__HELPERS/bygex/demo.dm index f89be30ded2..fe481f93020 100644 --- a/code/__HELPERS/bygex/demo.dm +++ b/code/__HELPERS/bygex/demo.dm @@ -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() \ No newline at end of file +/mob/verb/findall_casesensitive(t as text) + results = regEx_findall(t, expression) + world << results.report() \ No newline at end of file diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index b098af53541..4f0e9158101 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -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. diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 31a40ca978f..436b4c76c78 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -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 diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 74a1e3bb811..4e76b773352 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -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 diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 7959272566d..f54ebddcc8d 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -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 diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm index cf840584c6f..4dec0e05de9 100644 --- a/code/__HELPERS/sanitize_values.dm +++ b/code/__HELPERS/sanitize_values.dm @@ -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 + . diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 27f8526c2e1..bdf517b9be9 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -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 diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index a9c35aee9b4..fad0c646c3d 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -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. diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index f8385d0582e..20d35846a87 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -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 \ No newline at end of file + return 1 diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index f1cdda90967..446a31d00b0 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -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' diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index c1bb029840f..b00df6d17bb 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -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() diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index fc019b9d390..a053de3efa2 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -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("[name] bites [ML]!", \ "[name] bites [ML]!") - if(armor >= 2) return + if(armor >= 2) + return for(var/datum/disease/D in viruses) ML.ForceContractDisease(D) else diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 4a32ac96510..1fb7b369327 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -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 diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b68ec62bd32..40bb99bf993 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -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) diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 0791d5c563f..54ef9632f00 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -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 diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index 456ae87304d..0e17eea252a 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -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() diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 9203115b4bf..ad117cb80ea 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -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] diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm index 7c6678e5c36..accb885078b 100644 --- a/code/controllers/subsystem/pai.dm +++ b/code/controllers/subsystem/pai.dm @@ -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") diff --git a/code/controllers/subsystem/shuttles.dm b/code/controllers/subsystem/shuttles.dm index 7f7a0dceb74..d720fc02ece 100644 --- a/code/controllers/subsystem/shuttles.dm +++ b/code/controllers/subsystem/shuttles.dm @@ -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 diff --git a/code/controllers/subsystem/shuttles/emergency.dm b/code/controllers/subsystem/shuttles/emergency.dm index 7cf45c0e8ac..959262460a5 100644 --- a/code/controllers/subsystem/shuttles/emergency.dm +++ b/code/controllers/subsystem/shuttles/emergency.dm @@ -72,7 +72,8 @@ /* /obj/docking_port/mobile/emergency/findTransitDock() . = SSshuttle.getDock("emergency_transit") - if(.) return . + if(.) + return . return ..() */ diff --git a/code/controllers/subsystem/shuttles/supply.dm b/code/controllers/subsystem/shuttles/supply.dm index d3c96f216d2..4bb2baf855e 100644 --- a/code/controllers/subsystem/shuttles/supply.dm +++ b/code/controllers/subsystem/shuttles/supply.dm @@ -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 += "Request from: [get_supply_group_name(cat)]

" 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 += "[N.name] Cost: [N.cost]
" //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 diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 56cdf29535f..13fe30f0070 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -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 diff --git a/code/controllers/subsystem/voting.dm b/code/controllers/subsystem/voting.dm index 1fce5abd014..0549457940e 100644 --- a/code/controllers/subsystem/voting.dm +++ b/code/controllers/subsystem/voting.dm @@ -79,11 +79,14 @@ var/datum/subsystem/vote/SSvote var/list/winners = get_result() var/text if(winners.len > 0) - if(question) text += "[question]" - else text += "[capitalize(mode)] Vote" + if(question) + text += "[question]" + else + text += "[capitalize(mode)] Vote" for(var/i=1,i<=choices.len,i++) var/votes = choices[choices[i]] - if(!votes) votes = 0 + if(!votes) + votes = 0 text += "\n[choices[i]]: [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) . += "

Vote: '[question]'

" - else . += "

Vote: [capitalize(mode)]

" + if(question) + . += "

Vote: '[question]'

" + else + . += "

Vote: [capitalize(mode)]

" . += "Time Left: [time_remaining] s

" 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 diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 1db2d388c94..ff89e51f6ef 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -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 \ No newline at end of file + return data diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 3f582156347..45af5ab843a 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -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("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") 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 diff --git a/code/datums/diseases/retrovirus.dm b/code/datums/diseases/retrovirus.dm index 53dcdfa45c5..ed94a8c0fb6 100644 --- a/code/datums/diseases/retrovirus.dm +++ b/code/datums/diseases/retrovirus.dm @@ -65,8 +65,10 @@ affected_mob << "Your entire body vibrates." 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)) \ No newline at end of file + if(prob(50)) + scramble_dna(affected_mob, 1, 0, rand(50,75)) + else + scramble_dna(affected_mob, 0, 1, rand(50,75)) \ No newline at end of file diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 3be1783df4b..0fee76411e9 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -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 diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 8f7735304a0..87cf949ae3f 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -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) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index b1f66c493c0..ab14f6575c9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1,1680 +1,1692 @@ -/* Note from Carnie: - The way datum/mind stuff works has been changed a lot. - Minds now represent IC characters rather than following a client around constantly. - - Guidelines for using minds properly: - - - Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living! - ghost.mind is however used as a reference to the ghost's corpse - - - When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human) - the existing mind of the old mob should be transfered to the new mob like so: - - mind.transfer_to(new_mob) - - - You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you. - By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing - the player. - - - IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you. - - - When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting - a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done. - - new_mob.key = key - - The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple! - However if you want that mind to have any special properties like being a traitor etc you will have to do that - yourself. - -*/ - -/datum/mind - var/key - var/name //replaces mob/var/original_name - var/mob/living/current - var/active = 0 - - var/memory - var/attack_log - - var/assigned_role - var/special_role - var/list/restricted_roles = list() - - var/datum/job/assigned_job - - var/list/datum/objective/objectives = list() - var/list/datum/objective/special_verbs = list() - - var/list/spell_list = list() // Wizard mode & "Give Spell" badmin button. - - var/datum/faction/faction //associated faction - var/datum/changeling/changeling //changeling holder - - var/miming = 0 // Mime's vow of silence - var/antag_hud_icon_state = null //this mind's ANTAG_HUD should have this icon_state - var/datum/atom_hud/antag/antag_hud = null //this mind's antag HUD - var/datum/gang/gang_datum //Which gang this mind belongs to, if any - -/datum/mind/New(var/key) - src.key = key - - -/datum/mind/proc/transfer_to(mob/new_character) - if(current) // remove ourself from our old body's mind variable - current.mind = null - SStgui.on_transfer(current, new_character) - - if(key) - if(new_character.key != key) //if we're transfering into a body with a key associated which is not ours - new_character.ghostize(1) //we'll need to ghostize so that key isn't mobless. - else - key = new_character.key - - if(new_character.mind) //disassociate any mind currently in our new body's mind variable - new_character.mind.current = null - - var/datum/atom_hud/antag/hud_to_transfer = antag_hud//we need this because leave_hud() will clear this list - leave_all_huds() //leave all the huds in the old body, so it won't get huds if somebody else enters it - current = new_character //associate ourself with our new body - new_character.mind = src //and associate our new body with ourself - transfer_antag_huds(hud_to_transfer) //inherit the antag HUD - transfer_actions(new_character) - - if(active) - new_character.key = key //now transfer the key to link the client to our new body - -/datum/mind/proc/store_memory(new_text) - memory += "[new_text]
" - -/datum/mind/proc/wipe_memory() - memory = null - - -/* - Removes antag type's references from a mind. - objectives, uplinks, powers etc are all handled. -*/ - -/datum/mind/proc/remove_objectives() - if(objectives.len) - for(var/datum/objective/O in objectives) - objectives -= O - qdel(O) - -/datum/mind/proc/remove_changeling() - if(src in ticker.mode.changelings) - ticker.mode.changelings -= src - current.remove_changeling_powers() - if(changeling) - qdel(changeling) - changeling = null - special_role = null - remove_antag_equip() - -/datum/mind/proc/remove_traitor() - if(src in ticker.mode.traitors) - ticker.mode.traitors -= src - if(isAI(current)) - var/mob/living/silicon/ai/A = current - A.set_zeroth_law("") - A.show_laws() - A.verbs -= /mob/living/silicon/ai/proc/choose_modules - A.malf_picker.remove_verbs(A) - qdel(A.malf_picker) - special_role = null - remove_antag_equip() - -/datum/mind/proc/remove_nukeop() - if(src in ticker.mode.syndicates) - ticker.mode.syndicates -= src - ticker.mode.update_synd_icons_removed(src) - special_role = null - remove_objectives() - remove_antag_equip() - -/datum/mind/proc/remove_wizard() - if(src in ticker.mode.wizards) - ticker.mode.wizards -= src - current.spellremove(current) - special_role = null - remove_antag_equip() - -/datum/mind/proc/remove_cultist() - if(src in ticker.mode.cult) - ticker.mode.cult -= src - ticker.mode.update_cult_icons_removed(src) - special_role = null - -/datum/mind/proc/remove_rev() - if(src in ticker.mode.revolutionaries) - ticker.mode.revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - if(src in ticker.mode.head_revolutionaries) - ticker.mode.head_revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - special_role = null - remove_objectives() - remove_antag_equip() - - -/datum/mind/proc/remove_gang() - ticker.mode.remove_gangster(src,0,1,1) - remove_objectives() - -/datum/mind/proc/remove_hog_follower_prophet() - ticker.mode.red_deity_followers -= src - ticker.mode.red_deity_prophets -= src - ticker.mode.blue_deity_prophets -= src - ticker.mode.blue_deity_followers -= src - ticker.mode.update_hog_icons_removed(src, "red") - ticker.mode.update_hog_icons_removed(src, "blue") - - - -/datum/mind/proc/remove_antag_equip() - var/list/Mob_Contents = current.get_contents() - for(var/obj/item/I in Mob_Contents) - if(istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/P = I - P.lock_code = "" - - else if(istype(I, /obj/item/device/radio)) - var/obj/item/device/radio/R = I - R.traitor_frequency = 0 - -/datum/mind/proc/remove_all_antag() //For the Lazy amongst us. - remove_changeling() - remove_traitor() - remove_nukeop() - remove_wizard() - remove_cultist() - remove_rev() - remove_gang() - -/datum/mind/proc/show_memory(mob/recipient, window=1) - if(!recipient) - recipient = current - var/output = "[current.real_name]'s Memories:
" - output += memory - - if(objectives.len) - output += "Objectives:" - var/obj_count = 1 - for(var/datum/objective/objective in objectives) - output += "
Objective #[obj_count++]: [objective.explanation_text]" - - if(window) recipient << browse(output,"window=memory") - else recipient << "[output]" - -/datum/mind/proc/edit_memory() - if(!ticker || !ticker.mode) - alert("Not before round-start!", "Alert") - return - - var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" - out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" - out += "Assigned role: [assigned_role]. Edit
" - out += "Faction and special role: [special_role]
" - - var/list/sections = list( - "revolution", - "gang", - "cult", - "wizard", - "changeling", - "nuclear", - "traitor", // "traitorchan", - "monkey", - ) - var/text = "" - - if (istype(current, /mob/living/carbon/human) || istype(current, /mob/living/carbon/monkey)) - /** REVOLUTION ***/ - text = "revolution" - if (ticker.mode.config_tag=="revolution") - text = uppertext(text) - text = "[text]: " - if (assigned_role in command_positions) - text += "HEAD|loyal|employee|headrev|rev" - else if (src in ticker.mode.head_revolutionaries) - text += "head|loyal|employee|HEADREV|rev" - text += "
Flash: give" - - var/list/L = current.get_contents() - var/obj/item/device/assembly/flash/flash = locate() in L - if (flash) - if(!flash.crit_fail) - text += "|take." - else - text += "|take|repair." - else - text += "." - - text += " Reequip (gives traitor uplink)." - if (objectives.len==0) - text += "
Objectives are empty! Set to kill all heads." - else if(isloyal(current)) - text += "head|LOYAL|employee|headrev|rev" - else if (src in ticker.mode.revolutionaries) - text += "head|loyal|employee|headrev|REV" - else - text += "head|loyal|EMPLOYEE|headrev|rev" - - if(current && current.client && (ROLE_REV in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["revolution"] = text - - /** GANG ***/ - text = "gang" - if (ticker.mode.config_tag=="gang") - text = uppertext(text) - text = "[text]: " - text += "[isloyal(current) ? "LOYAL" : "loyal"]|" - if(src in ticker.mode.get_all_gangsters()) - text += "none" - else - text += "NONE" - - if(current && current.client && (ROLE_GANG in current.client.prefs.be_special)) - text += "|Enabled in Prefs
" - else - text += "|Disabled in Prefs
" - - for(var/datum/gang/G in ticker.mode.gangs) - text += "[G.name]: " - if(src in (G.gangsters)) - text += "GANGSTER" - else - text += "gangster" - text += "|" - if(src in (G.bosses)) - text += "GANG LEADER" - text += "|Equipment: give" - var/list/L = current.get_contents() - var/obj/item/device/gangtool/gangtool = locate() in L - if (gangtool) - text += "|take" - - else - text += "gang leader" - text += "
" - - if(gang_colors_pool.len) - text += "Create New Gang" - - sections["gang"] = text - - - /** CULT ***/ - text = "cult" - if (ticker.mode.config_tag=="cult") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.cult) - text += "loyal|employee|CULTIST" - text += "
Equip" - - else if(isloyal(current)) - text += "LOYAL|employee|cultist" - else - text += "loyal|EMPLOYEE|cultist" - - if(current && current.client && (ROLE_CULTIST in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["cult"] = text - - /** WIZARD ***/ - text = "wizard" - if (ticker.mode.config_tag=="wizard") - text = uppertext(text) - text = "[text]: " - if ((src in ticker.mode.wizards) || (src in ticker.mode.apprentices)) - text += "YES|no" - text += "
To lair, undress, dress up, let choose name." - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - else - text += "yes|NO" - - if(current && current.client && (ROLE_WIZARD in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["wizard"] = text - - /** CHANGELING ***/ - text = "changeling" - if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan") - text = uppertext(text) - text = "[text]: " - if ((src in ticker.mode.changelings) && special_role) - text += "YES|no" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - if(changeling && changeling.stored_profiles.len && (current.real_name != changeling.first_prof.name) ) - text += "
Transform to initial appearance." - else if(src in ticker.mode.changelings) //Station Aligned Changeling - text += "YES (but not an antag)|no" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - if(changeling && changeling.stored_profiles.len && (current.real_name != changeling.first_prof.name) ) - text += "
Transform to initial appearance." - else - text += "yes|NO" -// var/datum/game_mode/changeling/changeling = ticker.mode -// if (istype(changeling) && changeling.changelingdeath) -// text += "
All the changelings are dead! Restart in [round((changeling.TIME_TO_GET_REVIVED-(world.time-changeling.changelingdeathtime))/10)] seconds." - - if(current && current.client && (ROLE_CHANGELING in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["changeling"] = text - - /** NUCLEAR ***/ - text = "nuclear" - if (ticker.mode.config_tag=="nuclear") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.syndicates) - text += "OPERATIVE|nanotrasen" - text += "
To shuttle, undress, dress up." - var/code - for (var/obj/machinery/nuclearbomb/bombue in machines) - if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") - code = bombue.r_code - break - if (code) - text += " Code is [code]. tell the code." - else - text += "operative|NANOTRASEN" - - if(current && current.client && (ROLE_OPERATIVE in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["nuclear"] = text - - /** TRAITOR ***/ - text = "traitor" - if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.traitors) - text += "TRAITOR|loyal" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - else - text += "traitor|LOYAL" - - if(current && current.client && (ROLE_TRAITOR in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["traitor"] = text - - /** SHADOWLING **/ - text = "shadowling" - if(ticker.mode.config_tag == "shadowling") - text = uppertext(text) - text = "[text]: " - if(src in ticker.mode.shadows) - text += "SHADOWLING|thrall|human" - else if(src in ticker.mode.thralls) - text += "shadowling|THRALL|human" - else - text += "shadowling|thrall|HUMAN" - - if(current && current.client && (ROLE_SHADOWLING in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["shadowling"] = text - - /** Abductors **/ - - text = "Abductor" - if(ticker.mode.config_tag == "abductor") - text = uppertext(text) - text = "[text]: " - if(src in ticker.mode.abductors) - text += "Abductor|human" - text += "|undress|equip" - else - text += "Abductor|human" - - if(current && current.client && (ROLE_ABDUCTOR in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["abductor"] = text - - /** HAND OF GOD **/ - text = "hand of god" - if(ticker.mode.config_tag == "handofgod") - text = uppertext(text) - text = "[text]: " - if(src in ticker.mode.red_deity_prophets) - text += "RED PROPHET|red follower|employee|blue follower|blue prophet|red god|blue god" - else if (src in ticker.mode.red_deity_followers) - text += "red prophet|RED FOLLOWER|employee|blue follower|blue prophet|red god|blue god" - else if (src in ticker.mode.blue_deity_followers) - text += "red prophet|red follower|employee|BLUE FOLLOWER|blue prophet|red god|blue god" - else if (src in ticker.mode.blue_deity_prophets) - text += "red prophet|red follower|employee|blue follower|BLUE PROPHET|red god|blue god" - else if (src in ticker.mode.red_deities) - text += "red prophet|red follower|employee|blue follower|blue prophet|RED GOD|blue god" - else if (src in ticker.mode.blue_deities) - text += "red prophet|red follower|employee|blue follower|blue prophet|red god|BLUE GOD" - else - text += "red prophet|red follower|EMPLOYEE|blue follower|blue prophet|red god|blue god" - - if(current && current.client && (ROLE_HOG_GOD in current.client.prefs.be_special)) - text += "|HOG God Enabled in Prefs" - else - text += "|HOG God Disabled in Prefs" - - if(current && current.client && (ROLE_HOG_CULTIST in current.client.prefs.be_special)) - text += "|HOG Cultist Enabled in Prefs" - else - text += "|HOG Disabled in Prefs" - - sections["follower"] = text - - /** MONKEY ***/ - if (istype(current, /mob/living/carbon)) - text = "monkey" - if (ticker.mode.config_tag=="monkey") - text = uppertext(text) - text = "[text]: " - if (istype(current, /mob/living/carbon/human)) - text += "healthy|infected|HUMAN|other" - else if (istype(current, /mob/living/carbon/monkey)) - var/found = 0 - for(var/datum/disease/D in current.viruses) - if(istype(D, /datum/disease/transformation/jungle_fever)) found = 1 - - if(found) - text += "healthy|INFECTED|human|other" - else - text += "HEALTHY|infected|human|other" - - else - text += "healthy|infected|human|OTHER" - - if(current && current.client && (ROLE_MONKEY in current.client.prefs.be_special)) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["monkey"] = text - - - /** SILICON ***/ - - if (istype(current, /mob/living/silicon)) - text = "silicon" - var/mob/living/silicon/robot/robot = current - if (istype(robot) && robot.emagged) - text += "
Cyborg: Is emagged! Unemag!
0th law: [robot.laws.zeroth]" - var/mob/living/silicon/ai/ai = current - if (istype(ai) && ai.connected_robots.len) - var/n_e_robots = 0 - for (var/mob/living/silicon/robot/R in ai.connected_robots) - if (R.emagged) - n_e_robots++ - text += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" - if (ticker.mode.config_tag == "traitorchan") - if (sections["traitor"]) - out += sections["traitor"]+"
" - if (sections["changeling"]) - out += sections["changeling"]+"

" - sections -= "traitor" - sections -= "changeling" - else - if (sections[ticker.mode.config_tag]) - out += sections[ticker.mode.config_tag]+"

" - sections -= ticker.mode.config_tag - for (var/i in sections) - if (sections[i]) - out += sections[i]+"
" - - - if (((src in ticker.mode.head_revolutionaries) || \ - (src in ticker.mode.traitors) || \ - (src in ticker.mode.syndicates)) && \ - istype(current,/mob/living/carbon/human) ) - - text = "Uplink: give" - var/obj/item/device/uplink/U = find_syndicate_uplink() - if(U) - text += "|take" - if (check_rights(R_FUN, 0)) - text += ", [U.telecrystals] TC" - else - text += ", [U.telecrystals] TC" - text += "." //hiel grammar - out += text - - out += "

" - - out += "Memory:
" - out += memory - out += "
Edit memory
" - out += "Objectives:
" - if (objectives.len == 0) - out += "EMPTY
" - else - var/obj_count = 1 - for(var/datum/objective/objective in objectives) - out += "[obj_count]: [objective.explanation_text] Edit Delete Toggle Completion
" - obj_count++ - out += "Add objective

" - - out += "Announce objectives

" - - usr << browse(out, "window=edit_memory[src];size=500x600") - - -/datum/mind/Topic(href, href_list) - if(!check_rights(R_ADMIN)) return - - if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() - if (!new_role) return - assigned_role = new_role - - else if (href_list["memory_edit"]) - var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN) - if (isnull(new_memo)) return - memory = new_memo - - else if (href_list["obj_edit"] || href_list["obj_add"]) - var/datum/objective/objective - var/objective_pos - var/def_value - - if (href_list["obj_edit"]) - objective = locate(href_list["obj_edit"]) - if (!objective) return - objective_pos = objectives.Find(objective) - - //Text strings are easy to manipulate. Revised for simplicity. - var/temp_obj_type = "[objective.type]"//Convert path into a text string. - def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. - if(!def_value)//If it's a custom objective, it will be an empty string. - def_value = "custom" - - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "maroon", "debrain", "protect", "destroy", "prevent", "hijack", "escape", "survive", "martyr", "steal", "download", "nuclear", "capture", "absorb", "custom","follower block (HOG)","build (HOG)","deicide (HOG)", "follower escape (HOG)", "sacrifice prophet (HOG)") - if (!new_obj_type) return - - var/datum/objective/new_objective = null - - switch (new_obj_type) - if ("assassinate","protect","debrain","maroon") - var/list/possible_targets = list("Free objective") - for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) - possible_targets += possible_target.current - - var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current - - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets - if (!new_target) return - - var/objective_path = text2path("/datum/objective/[new_obj_type]") - if (new_target == "Free objective") - new_objective = new objective_path - new_objective.owner = src - new_objective:target = null - new_objective.explanation_text = "Free objective" - else - new_objective = new objective_path - new_objective.owner = src - new_objective:target = new_target:mind - //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. - new_objective.update_explanation_text() - - if ("destroy") - var/list/possible_targets = active_ais(1) - if(possible_targets.len) - var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets - new_objective = new /datum/objective/destroy - new_objective.target = new_target.mind - new_objective.owner = src - new_objective.update_explanation_text() - else - usr << "No active AIs with minds" - - if ("prevent") - new_objective = new /datum/objective/block - new_objective.owner = src - - if ("hijack") - new_objective = new /datum/objective/hijack - new_objective.owner = src - - if ("escape") - new_objective = new /datum/objective/escape - new_objective.owner = src - - if ("survive") - new_objective = new /datum/objective/survive - new_objective.owner = src - - if("martyr") - new_objective = new /datum/objective/martyr - new_objective.owner = src - - if ("nuclear") - new_objective = new /datum/objective/nuclear - new_objective.owner = src - - if ("steal") - if (!istype(objective, /datum/objective/steal)) - new_objective = new /datum/objective/steal - new_objective.owner = src - else - new_objective = objective - var/datum/objective/steal/steal = new_objective - if (!steal.select_target()) - return - - if("download","capture","absorb") - var/def_num - if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) - def_num = objective.target_amount - - var/target_number = input("Input target number:", "Objective", def_num) as num|null - if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. - return - - switch(new_obj_type) - if("download") - new_objective = new /datum/objective/download - new_objective.explanation_text = "Download [target_number] research levels." - if("capture") - new_objective = new /datum/objective/capture - new_objective.explanation_text = "Capture [target_number] lifeforms with an energy net. Live, rare specimens are worth more." - if("absorb") - new_objective = new /datum/objective/absorb - new_objective.explanation_text = "Absorb [target_number] compatible genomes." - new_objective.owner = src - new_objective.target_amount = target_number - - if("follower block (HOG)") - new_objective = new /datum/objective/follower_block - new_objective.owner = src - if("build (HOG)") - new_objective = new /datum/objective/build - new_objective.owner = src - if("deicide (HOG)") - new_objective = new /datum/objective/deicide - new_objective.owner = src - if("follower escape (HOG)") - new_objective = new /datum/objective/escape_followers - new_objective.owner = src - if("sacrifice prophet (HOG)") - new_objective = new /datum/objective/sacrifice_prophet - new_objective.owner = src - - if ("custom") - var/expl = stripped_input(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "") - if (!expl) return - new_objective = new /datum/objective - new_objective.owner = src - new_objective.explanation_text = expl - - if (!new_objective) return - - if (objective) - objectives -= objective - objectives.Insert(objective_pos, new_objective) - message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]") - log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]") - else - objectives += new_objective - message_admins("[key_name_admin(usr)] added a new objective for [current]: [new_objective.explanation_text]") - log_admin("[key_name(usr)] added a new objective for [current]: [new_objective.explanation_text]") - - else if (href_list["obj_delete"]) - var/datum/objective/objective = locate(href_list["obj_delete"]) - if(!istype(objective)) return - objectives -= objective - message_admins("[key_name_admin(usr)] removed an objective for [current]: [objective.explanation_text]") - log_admin("[key_name(usr)] removed an objective for [current]: [objective.explanation_text]") - - else if(href_list["obj_completed"]) - var/datum/objective/objective = locate(href_list["obj_completed"]) - if(!istype(objective)) return - objective.completed = !objective.completed - log_admin("[key_name(usr)] toggled the win state for [current]'s objective: [objective.explanation_text]") - - else if (href_list["handofgod"]) - switch(href_list["handofgod"]) - if("clear") //wipe handofgod status - if((src in ticker.mode.red_deity_followers) || (src in ticker.mode.blue_deity_followers) || (src in ticker.mode.red_deity_prophets) || (src in ticker.mode.blue_deity_prophets)) - remove_hog_follower_prophet() - current << "You have been brainwashed... again! Your faith is no more!" - message_admins("[key_name_admin(usr)] has de-hand of god'ed [current].") - log_admin("[key_name(usr)] has de-hand of god'ed [current].") - - if("red follower") - make_Handofgod_follower("red") - message_admins("[key_name_admin(usr)] has red follower'ed [current].") - log_admin("[key_name(usr)] has red follower'ed [current].") - - if("red prophet") - make_Handofgod_prophet("red") - message_admins("[key_name_admin(usr)] has red prophet'ed [current].") - log_admin("[key_name(usr)] has red prophet'ed [current].") - - if("blue follower") - make_Handofgod_follower("blue") - message_admins("[key_name_admin(usr)] has blue follower'ed [current].") - log_admin("[key_name(usr)] has blue follower'ed [current].") - - if("blue prophet") - make_Handofgod_prophet("blue") - message_admins("[key_name_admin(usr)] has blue prophet'ed [current].") - log_admin("[key_name(usr)] has blue prophet'ed [current].") - - if("red god") - make_Handofgod_god("red") - message_admins("[key_name_admin(usr)] has red god'ed [current].") - log_admin("[key_name(usr)] has red god'ed [current].") - - if("blue god") - make_Handofgod_god("blue") - message_admins("[key_name_admin(usr)] has blue god'ed [current].") - log_admin("[key_name(usr)] has blue god'ed [current].") - - - else if (href_list["revolution"]) - switch(href_list["revolution"]) - if("clear") - remove_rev() - current << "You have been brainwashed! You are no longer a revolutionary!" - message_admins("[key_name_admin(usr)] has de-rev'ed [current].") - log_admin("[key_name(usr)] has de-rev'ed [current].") - if("rev") - if(src in ticker.mode.head_revolutionaries) - ticker.mode.head_revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - current << "Revolution has been disappointed of your leader traits! You are a regular revolutionary now!" - else if(!(src in ticker.mode.revolutionaries)) - current << " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" - else - return - ticker.mode.revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Revolutionary" - message_admins("[key_name_admin(usr)] has rev'ed [current].") - log_admin("[key_name(usr)] has rev'ed [current].") - - if("headrev") - if(src in ticker.mode.revolutionaries) - ticker.mode.revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - current << "You have proved your devotion to revoltion! Yea are a head revolutionary now!" - else if(!(src in ticker.mode.head_revolutionaries)) - current << "You are a member of the revolutionaries' leadership now!" - else - return - if (ticker.mode.head_revolutionaries.len>0) - // copy targets - var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries - if (valid_head) - for (var/datum/objective/mutiny/O in valid_head.objectives) - var/datum/objective/mutiny/rev_obj = new - rev_obj.owner = src - rev_obj.target = O.target - rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]." - objectives += rev_obj - ticker.mode.greet_revolutionary(src,0) - ticker.mode.head_revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Head Revolutionary" - message_admins("[key_name_admin(usr)] has head-rev'ed [current].") - log_admin("[key_name(usr)] has head-rev'ed [current].") - - if("autoobjectives") - ticker.mode.forge_revolutionary_objectives(src) - ticker.mode.greet_revolutionary(src,0) - usr << "The objectives for revolution have been generated and shown to [key]" - - if("flash") - if (!ticker.mode.equip_revolutionary(current)) - usr << "Spawning flash failed!" - - if("takeflash") - var/list/L = current.get_contents() - var/obj/item/device/assembly/flash/flash = locate() in L - if (!flash) - usr << "Deleting flash failed!" - qdel(flash) - - if("repairflash") - var/list/L = current.get_contents() - var/obj/item/device/assembly/flash/flash = locate() in L - if (!flash) - usr << "Repairing flash failed!" - else - flash.crit_fail = 0 - flash.update_icon() - - - -//////////////////// GANG MODE - - else if (href_list["gang"]) - switch(href_list["gang"]) - if("clear") - remove_gang() - message_admins("[key_name_admin(usr)] has de-gang'ed [current].") - log_admin("[key_name(usr)] has de-gang'ed [current].") - - if("equip") - switch(ticker.mode.equip_gang(current,gang_datum)) - if(1) - usr << "Unable to equip territory spraycan!" - if(2) - usr << "Unable to equip recruitment pen and spraycan!" - if(3) - usr << "Unable to equip gangtool, pen, and spraycan!" - - if("takeequip") - var/list/L = current.get_contents() - for(var/obj/item/weapon/pen/gang/pen in L) - qdel(pen) - for(var/obj/item/device/gangtool/gangtool in L) - qdel(gangtool) - for(var/obj/item/toy/crayon/spraycan/gang/SC in L) - qdel(SC) - - if("new") - if(gang_colors_pool.len) - var/list/names = list("Random") + gang_name_pool - var/gangname = input("Pick a gang name.","Select Name") as null|anything in names - if(gangname && gang_colors_pool.len) //Check again just in case another admin made max gangs at the same time - if(!(gangname in gang_name_pool)) - gangname = null - var/datum/gang/newgang = new(null,gangname) - ticker.mode.gangs += newgang - message_admins("[key_name_admin(usr)] has created the [newgang.name] Gang.") - log_admin("[key_name(usr)] has created the [newgang.name] Gang.") - - else if (href_list["gangboss"]) - var/datum/gang/G = locate(href_list["gangboss"]) in ticker.mode.gangs - if(!G || (src in G.bosses)) - return - ticker.mode.remove_gangster(src,0,2,1) - G.bosses += src - gang_datum = G - special_role = "[G.name] Gang Boss" - G.add_gang_hud(src) - current << "You are a [G.name] Gang Boss!" - message_admins("[key_name_admin(usr)] has added [current] to the [G.name] Gang leadership.") - log_admin("[key_name(usr)] has added [current] to the [G.name] Gang leadership.") - ticker.mode.forge_gang_objectives(src) - ticker.mode.greet_gang(src,0) - - else if (href_list["gangster"]) - var/datum/gang/G = locate(href_list["gangster"]) in ticker.mode.gangs - if(!G || (src in G.gangsters)) - return - ticker.mode.remove_gangster(src,0,2,1) - ticker.mode.add_gangster(src,G,0) - message_admins("[key_name_admin(usr)] has added [current] to the [G.name] Gang (A).") - log_admin("[key_name(usr)] has added [current] to the [G.name] Gang (A).") - -///////////////////////////////// - - - - else if (href_list["cult"]) - switch(href_list["cult"]) - if("clear") - remove_cultist() - current << "You have been brainwashed! You are no longer a cultist!" - message_admins("[key_name_admin(usr)] has de-cult'ed [current].") - log_admin("[key_name(usr)] has de-cult'ed [current].") - if("cultist") - if(!(src in ticker.mode.cult)) - ticker.mode.add_cultist(src) - message_admins("[key_name_admin(usr)] has cult'ed [current].") - log_admin("[key_name(usr)] has cult'ed [current].") - if("equip") - if (!ticker.mode.equip_cultist(current)) - usr << "equip_cultist() failed! [current]'s starting equipment will be incomplete." - - else if (href_list["wizard"]) - switch(href_list["wizard"]) - if("clear") - remove_wizard() - current << "You have been brainwashed! You are no longer a wizard!" - log_admin("[key_name(usr)] has de-wizard'ed [current].") - if("wizard") - if(!(src in ticker.mode.wizards)) - ticker.mode.wizards += src - special_role = "Wizard" - //ticker.mode.learn_basic_spells(current) - current << "You are the Space Wizard!" - message_admins("[key_name_admin(usr)] has wizard'ed [current].") - log_admin("[key_name(usr)] has wizard'ed [current].") - if("lair") - current.loc = pick(wizardstart) - if("dressup") - ticker.mode.equip_wizard(current) - if("name") - ticker.mode.name_wizard(current) - if("autoobjectives") - ticker.mode.forge_wizard_objectives(src) - usr << "The objectives for wizard [key] have been generated. You can edit them and anounce manually." - - else if (href_list["changeling"]) - switch(href_list["changeling"]) - if("clear") - remove_changeling() - current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" - message_admins("[key_name_admin(usr)] has de-changeling'ed [current].") - log_admin("[key_name(usr)] has de-changeling'ed [current].") - if("changeling") - if(!(src in ticker.mode.changelings)) - ticker.mode.changelings += src - current.make_changeling() - special_role = "Changeling" - current << "Your powers are awoken. A flash of memory returns to us...we are [changeling.changelingID], a changeling!" - message_admins("[key_name_admin(usr)] has changeling'ed [current].") - log_admin("[key_name(usr)] has changeling'ed [current].") - if("autoobjectives") - ticker.mode.forge_changeling_objectives(src) - usr << "The objectives for changeling [key] have been generated. You can edit them and anounce manually." - - if("initialdna") - if( !changeling || !changeling.stored_profiles.len || !istype(current, /mob/living/carbon)) - usr << "Resetting DNA failed!" - else - var/mob/living/carbon/C = current - changeling.first_prof.dna.transfer_identity(C, transfer_SE=1) - C.real_name = changeling.first_prof.name - C.updateappearance(mutcolor_update=1) - C.domutcheck() - - else if (href_list["nuclear"]) - switch(href_list["nuclear"]) - if("clear") - remove_nukeop() - current << "You have been brainwashed! You are no longer a syndicate operative!" - message_admins("[key_name_admin(usr)] has de-nuke op'ed [current].") - log_admin("[key_name(usr)] has de-nuke op'ed [current].") - if("nuclear") - if(!(src in ticker.mode.syndicates)) - ticker.mode.syndicates += src - ticker.mode.update_synd_icons_added(src) - if (ticker.mode.syndicates.len==1) - ticker.mode.prepare_syndicate_leader(src) - else - current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" - special_role = "Syndicate" - assigned_role = "Syndicate" - current << "You are a [syndicate_name()] agent!" - ticker.mode.forge_syndicate_objectives(src) - ticker.mode.greet_syndicate(src) - message_admins("[key_name_admin(usr)] has nuke op'ed [current].") - log_admin("[key_name(usr)] has nuke op'ed [current].") - if("lair") - current.loc = get_turf(locate("landmark*Syndicate-Spawn")) - if("dressup") - var/mob/living/carbon/human/H = current - qdel(H.belt) - qdel(H.back) - qdel(H.ears) - qdel(H.gloves) - qdel(H.head) - qdel(H.shoes) - qdel(H.wear_id) - qdel(H.wear_suit) - qdel(H.w_uniform) - - if (!ticker.mode.equip_syndicate(current)) - usr << "Equipping a syndicate failed!" - if("tellcode") - var/code - for (var/obj/machinery/nuclearbomb/bombue in machines) - if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") - code = bombue.r_code - break - if (code) - store_memory("Syndicate Nuclear Bomb Code: [code]", 0, 0) - current << "The nuclear authorization code is: [code]" - else - usr << "No valid nuke found!" - - else if (href_list["traitor"]) - switch(href_list["traitor"]) - if("clear") - remove_traitor() - current << "You have been brainwashed! You are no longer a traitor!" - message_admins("[key_name_admin(usr)] has de-traitor'ed [current].") - log_admin("[key_name(usr)] has de-traitor'ed [current].") - - if("traitor") - if(!(src in ticker.mode.traitors)) - ticker.mode.traitors += src - special_role = "traitor" - current << "You are a traitor!" - message_admins("[key_name_admin(usr)] has traitor'ed [current].") - log_admin("[key_name(usr)] has traitor'ed [current].") - if(isAI(current)) - var/mob/living/silicon/ai/A = current - ticker.mode.add_law_zero(A) - - if("autoobjectives") - ticker.mode.forge_traitor_objectives(src) - usr << "The objectives for traitor [key] have been generated. You can edit them and anounce manually." - - else if(href_list["shadowling"]) - switch(href_list["shadowling"]) - if("clear") - ticker.mode.update_shadow_icons_removed(src) - if(src in ticker.mode.shadows) - ticker.mode.shadows -= src - special_role = null - current << "Your powers have been quenched! You are no longer a shadowling!" - remove_spell(/obj/effect/proc_holder/spell/self/shadowling_hatch) - remove_spell(/obj/effect/proc_holder/spell/self/shadowling_ascend) - remove_spell(/obj/effect/proc_holder/spell/targeted/enthrall) - remove_spell(/obj/effect/proc_holder/spell/self/shadowling_hivemind) - message_admins("[key_name_admin(usr)] has de-shadowling'ed [current].") - log_admin("[key_name(usr)] has de-shadowling'ed [current].") - else if(src in ticker.mode.thralls) - ticker.mode.remove_thrall(src,0) - message_admins("[key_name_admin(usr)] has de-thrall'ed [current].") - log_admin("[key_name(usr)] has de-thrall'ed [current].") - if("shadowling") - if(!ishuman(current)) - usr << "This only works on humans!" - return - ticker.mode.shadows += src - special_role = "shadowling" - current << "Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \ - time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\ - " - ticker.mode.finalize_shadowling(src) - ticker.mode.update_shadow_icons_added(src) - if("thrall") - if(!ishuman(current)) - usr << "This only works on humans!" - return - ticker.mode.add_thrall(src) - message_admins("[key_name_admin(usr)] has thrall'ed [current].") - log_admin("[key_name(usr)] has thrall'ed [current].") - - else if(href_list["abductor"]) - switch(href_list["abductor"]) - if("clear") - usr << "Not implemented yet. Sorry!" - if("abductor") - if(!ishuman(current)) - usr << "This only works on humans!" - return - make_Abductor() - log_admin("[key_name(usr)] turned [current] into abductor.") - if("equip") - var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist") - if(gear) - var/datum/game_mode/abduction/temp = new - temp.equip_common(current) - if(gear=="Agent") - temp.equip_agent(current) - else - temp.equip_scientist(current) - - else if (href_list["monkey"]) - var/mob/living/L = current - if (L.notransform) - return - switch(href_list["monkey"]) - if("healthy") - if (check_rights(R_ADMIN)) - var/mob/living/carbon/human/H = current - var/mob/living/carbon/monkey/M = current - if (istype(H)) - log_admin("[key_name(usr)] attempting to monkeyize [key_name(current)]") - message_admins("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(current)]") - src = null - M = H.monkeyize() - src = M.mind - //world << "DEBUG: \"healthy\": M=[M], M.mind=[M.mind], src=[src]!" - else if (istype(M) && length(M.viruses)) - for(var/datum/disease/D in M.viruses) - D.cure(0) - sleep(0) //because deleting of virus is done through spawn(0) - if("infected") - if (check_rights(R_ADMIN, 0)) - var/mob/living/carbon/human/H = current - var/mob/living/carbon/monkey/M = current - if (istype(H)) - log_admin("[key_name(usr)] attempting to monkeyize and infect [key_name(current)]") - message_admins("[key_name_admin(usr)] attempting to monkeyize and infect [key_name_admin(current)]") - src = null - M = H.monkeyize() - src = M.mind - current.ForceContractDisease(new /datum/disease/transformation/jungle_fever) - else if (istype(M)) - current.ForceContractDisease(new /datum/disease/transformation/jungle_fever) - if("human") - if (check_rights(R_ADMIN, 0)) - var/mob/living/carbon/human/H = current - var/mob/living/carbon/monkey/M = current - if (istype(M)) - for(var/datum/disease/D in M.viruses) - if (istype(D,/datum/disease/transformation/jungle_fever)) - D.cure(0) - sleep(0) //because deleting of virus is doing throught spawn(0) - log_admin("[key_name(usr)] attempting to humanize [key_name(current)]") - message_admins("[key_name_admin(usr)] attempting to humanize [key_name_admin(current)]") - H = M.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_DEFAULTMSG) - if(H) - src = H.mind - - else if (href_list["silicon"]) - switch(href_list["silicon"]) - if("unemag") - var/mob/living/silicon/robot/R = current - if (istype(R)) - R.SetEmagged(0) - message_admins("[key_name_admin(usr)] has unemag'ed [R].") - log_admin("[key_name(usr)] has unemag'ed [R].") - - if("unemagcyborgs") - if (istype(current, /mob/living/silicon/ai)) - var/mob/living/silicon/ai/ai = current - for (var/mob/living/silicon/robot/R in ai.connected_robots) - R.SetEmagged(0) - message_admins("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.") - log_admin("[key_name(usr)] has unemag'ed [ai]'s Cyborgs.") - - else if (href_list["common"]) - switch(href_list["common"]) - if("undress") - for(var/obj/item/W in current) - current.unEquip(W, 1) //The 1 forces all items to drop, since this is an admin undress. - if("takeuplink") - take_uplink() - memory = null//Remove any memory they may have had. - log_admin("[key_name(usr)] removed [current]'s uplink.") - if("crystals") - if(check_rights(R_FUN, 0)) - var/obj/item/device/uplink/U = find_syndicate_uplink() - if(U) - var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) as null|num - if(!isnull(crystals)) - U.telecrystals = crystals - message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].") - log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].") - if("uplink") - if(!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) - usr << "Equipping a syndicate failed!" - log_admin("[key_name(usr)] attempted to give [current] an uplink.") - - else if (href_list["obj_announce"]) - var/obj_count = 1 - current << "Your current objectives:" - for(var/datum/objective/objective in objectives) - current << "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ - - edit_memory() - -/datum/mind/proc/find_syndicate_uplink() - var/list/L = current.get_contents() - for (var/obj/item/I in L) - if (I.hidden_uplink) - return I.hidden_uplink - return null - -/datum/mind/proc/take_uplink() - var/obj/item/device/uplink/H = find_syndicate_uplink() - if(H) - qdel(H) - -/datum/mind/proc/make_Traitor() - if(!(src in ticker.mode.traitors)) - ticker.mode.traitors += src - special_role = "traitor" - ticker.mode.forge_traitor_objectives(src) - ticker.mode.finalize_traitor(src) - ticker.mode.greet_traitor(src) - -/datum/mind/proc/make_Nuke(turf/spawnloc,nuke_code,leader=0, telecrystals = TRUE) - if(!(src in ticker.mode.syndicates)) - ticker.mode.syndicates += src - ticker.mode.update_synd_icons_added(src) - special_role = "Syndicate" - ticker.mode.forge_syndicate_objectives(src) - ticker.mode.greet_syndicate(src) - - current.loc = spawnloc - - var/mob/living/carbon/human/H = current - qdel(H.belt) - qdel(H.back) - qdel(H.ears) - qdel(H.gloves) - qdel(H.head) - qdel(H.shoes) - qdel(H.wear_id) - qdel(H.wear_suit) - qdel(H.w_uniform) - - ticker.mode.equip_syndicate(current, telecrystals) - - if (nuke_code) - store_memory("Syndicate Nuclear Bomb Code: [nuke_code]", 0, 0) - current << "The nuclear authorization code is: [nuke_code]" - - if (leader) - ticker.mode.prepare_syndicate_leader(src,nuke_code) - else - current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" - -/datum/mind/proc/make_Changling() - if(!(src in ticker.mode.changelings)) - ticker.mode.changelings += src - current.make_changeling() - special_role = "Changeling" - ticker.mode.forge_changeling_objectives(src) - ticker.mode.greet_changeling(src) - -/datum/mind/proc/make_Wizard() - if(!(src in ticker.mode.wizards)) - ticker.mode.wizards += src - special_role = "Wizard" - assigned_role = "Wizard" - //ticker.mode.learn_basic_spells(current) - if(!wizardstart.len) - current.loc = pick(latejoin) - current << "HOT INSERTION, GO GO GO" - else - current.loc = pick(wizardstart) - - ticker.mode.equip_wizard(current) - for(var/obj/item/weapon/spellbook/S in current.contents) - S.op = 0 - ticker.mode.name_wizard(current) - ticker.mode.forge_wizard_objectives(src) - ticker.mode.greet_wizard(src) - - -/datum/mind/proc/make_Cultist() - if(!(src in ticker.mode.cult)) - ticker.mode.cult += src - ticker.mode.update_cult_icons_added(src) - special_role = "Cultist" - current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." - current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." - current << "Your objective is to summon Nar-Sie by building and defending a suitable shell for the Geometer. Adequate supplies can be procured through human sacrifices." - ticker.mode.equip_cultist(current) - -/datum/mind/proc/make_Rev() - if (ticker.mode.head_revolutionaries.len>0) - // copy targets - var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries - if (valid_head) - for (var/datum/objective/mutiny/O in valid_head.objectives) - var/datum/objective/mutiny/rev_obj = new - rev_obj.owner = src - rev_obj.target = O.target - rev_obj.explanation_text = "Assassinate [O.target.current.real_name], the [O.target.assigned_role]." - objectives += rev_obj - ticker.mode.greet_revolutionary(src,0) - ticker.mode.head_revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Head Revolutionary" - - ticker.mode.forge_revolutionary_objectives(src) - ticker.mode.greet_revolutionary(src,0) - - var/list/L = current.get_contents() - var/obj/item/device/assembly/flash/flash = locate() in L - qdel(flash) - take_uplink() - var/fail = 0 -// fail |= !ticker.mode.equip_traitor(current, 1) - fail |= !ticker.mode.equip_revolutionary(current) - - -/datum/mind/proc/make_Gang(datum/gang/G) - special_role = "[G.name] Gang Boss" - G.bosses += src - gang_datum = G - G.add_gang_hud(src) - ticker.mode.forge_gang_objectives(src) - ticker.mode.greet_gang(src) - ticker.mode.equip_gang(current,G) - -/datum/mind/proc/make_Abductor() - var/role = alert("Abductor Role ?","Role","Agent","Scientist") - var/team = input("Abductor Team ?","Team ?") in list(1,2,3,4) - var/teleport = alert("Teleport to ship ?","Teleport","Yes","No") - - if(!role || !team || !teleport) - return - - if(!ishuman(current)) - return - - ticker.mode.abductors |= src - - var/datum/objective/experiment/O = new - O.owner = src - objectives += O - - var/mob/living/carbon/human/H = current - - H.set_species(/datum/species/abductor) - var/datum/species/abductor/S = H.dna.species - - switch(role) - if("Agent") - S.agent = 1 - if("Scientist") - S.scientist = 1 - S.team = team - - var/list/obj/effect/landmark/abductor/agent_landmarks = new - var/list/obj/effect/landmark/abductor/scientist_landmarks = new - agent_landmarks.len = 4 - scientist_landmarks.len = 4 - for(var/obj/effect/landmark/abductor/A in landmarks_list) - if(istype(A,/obj/effect/landmark/abductor/agent)) - agent_landmarks[text2num(A.team)] = A - else if(istype(A,/obj/effect/landmark/abductor/scientist)) - scientist_landmarks[text2num(A.team)] = A - - var/obj/effect/landmark/L - if(teleport=="Yes") - switch(role) - if("Agent") - S.agent = 1 - L = agent_landmarks[team] - H.loc = L.loc - if("Scientist") - S.scientist = 1 - L = agent_landmarks[team] - H.loc = L.loc - - -/datum/mind/proc/make_Handofgod_follower(colour) - . = 0 - switch(colour) - if("red") - //Remove old allegiances - if(src in ticker.mode.blue_deity_followers || src in ticker.mode.blue_deity_prophets) - current << "You are no longer a member of the Blue cult!" - - ticker.mode.blue_deity_followers -= src - ticker.mode.blue_deity_prophets -= src - current.faction |= "red god" - current.faction -= "blue god" - - if(src in ticker.mode.red_deity_prophets) - current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" - ticker.mode.red_deity_prophets -= src - - ticker.mode.red_deity_followers |= src - current << "You are now a follower of the red cult's god!" - - special_role = "Hand of God: Red Follower" - . = 1 - if("blue") - //Remove old allegiances - if(src in ticker.mode.red_deity_followers || src in ticker.mode.red_deity_prophets) - current << "You are no longer a member of the Red cult!" - - ticker.mode.red_deity_followers -= src - ticker.mode.red_deity_prophets -= src - current.faction -= "red god" - current.faction |= "blue god" - - if(src in ticker.mode.blue_deity_prophets) - current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" - ticker.mode.blue_deity_prophets -= src - - ticker.mode.blue_deity_followers |= src - current << "You are now a follower of the blue cult's god!" - - special_role = "Hand of God: Blue Follower" - . = 1 - else - return 0 - - ticker.mode.update_hog_icons_removed(src,"red") - ticker.mode.update_hog_icons_removed(src,"blue") - //ticker.mode.greet_hog_follower(src,colour) - ticker.mode.update_hog_icons_added(src, colour) - -/datum/mind/proc/make_Handofgod_prophet(colour) - . = 0 - switch(colour) - if("red") - //Remove old allegiances - - if(src in ticker.mode.blue_deity_followers || src in ticker.mode.blue_deity_prophets) - current << "You are no longer a member of the Blue cult!" - current.faction -= "blue god" - current.faction |= "red god" - - ticker.mode.blue_deity_followers -= src - ticker.mode.blue_deity_prophets -= src - ticker.mode.red_deity_followers -= src - - ticker.mode.red_deity_prophets |= src - current << "You are now a prophet of the red cult's god!" - - special_role = "Hand of God: Red Prophet" - . = 1 - if("blue") - //Remove old allegiances - - if(src in ticker.mode.red_deity_followers || src in ticker.mode.red_deity_prophets) - current << "You are no longer a member of the Red cult!" - current.faction -= "red god" - current.faction |= "blue god" - - ticker.mode.red_deity_followers -= src - ticker.mode.red_deity_prophets -= src - ticker.mode.blue_deity_followers -= src - - ticker.mode.blue_deity_prophets |= src - current << "You are now a prophet of the blue cult's god!" - - special_role = "Hand of God: Blue Prophet" - . = 1 - - else - return 0 - - ticker.mode.update_hog_icons_removed(src,"red") - ticker.mode.update_hog_icons_removed(src,"blue") - ticker.mode.greet_hog_follower(src,colour) - ticker.mode.update_hog_icons_added(src, colour) - - -/datum/mind/proc/make_Handofgod_god(colour) - switch(colour) - if("red") - current.become_god("red") - ticker.mode.add_god(src,"red") - if("blue") - current.become_god("blue") - ticker.mode.add_god(src,"blue") - else - return 0 - ticker.mode.forge_deity_objectives(src) - ticker.mode.remove_hog_follower(src,0) - ticker.mode.update_hog_icons_added(src, colour) -// ticker.mode.greet_hog_follower(src,colour) - return 1 - - -/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/spell) - spell_list += spell - if(!spell.action) - spell.action = new/datum/action/spell_action - spell.action.target = spell - spell.action.name = spell.name - spell.action.button_icon = spell.action_icon - spell.action.button_icon_state = spell.action_icon_state - spell.action.background_icon_state = spell.action_background_icon_state - spell.action.Grant(current) - return -/datum/mind/proc/transfer_actions(mob/living/new_character) - if(current && current.actions) - for(var/datum/action/A in current.actions) - A.Grant(new_character) - transfer_mindbound_actions(new_character) - -/datum/mind/proc/transfer_mindbound_actions(var/mob/living/new_character) - for(var/obj/effect/proc_holder/spell/spell in spell_list) - if(!spell.action) // Unlikely but whatever - spell.action = new/datum/action/spell_action - spell.action.target = spell - spell.action.name = spell.name - spell.action.button_icon = spell.action_icon - spell.action.button_icon_state = spell.action_icon_state - spell.action.background_icon_state = spell.action_background_icon_state - spell.action.Grant(new_character) - return - -/mob/proc/sync_mind() - mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) - mind.active = 1 //indicates that the mind is currently synced with a client - -/mob/new_player/sync_mind() - return - -/mob/dead/observer/sync_mind() - return - -//Initialisation procs -/mob/proc/mind_initialize() - if(mind) - mind.key = key - - else - mind = new /datum/mind(key) - if(ticker) - ticker.minds += mind - else - spawn(0) - throw EXCEPTION("mind_initialize(): No ticker ready") - if(!mind.name) mind.name = real_name - mind.current = src - -//HUMAN -/mob/living/carbon/human/mind_initialize() - ..() - if(!mind.assigned_role) mind.assigned_role = "Assistant" //defualt - -//MONKEY -/mob/living/carbon/monkey/mind_initialize() - ..() - -//slime -/mob/living/simple_animal/slime/mind_initialize() - ..() - mind.special_role = "slime" - mind.assigned_role = "slime" - -//XENO -/mob/living/carbon/alien/mind_initialize() - ..() - mind.special_role = "Alien" - mind.assigned_role = "Alien" - //XENO HUMANOID -/mob/living/carbon/alien/humanoid/royal/queen/mind_initialize() - ..() - mind.special_role = "Queen" - -/mob/living/carbon/alien/humanoid/royal/praetorian/mind_initialize() - ..() - mind.special_role = "Praetorian" - -/mob/living/carbon/alien/humanoid/hunter/mind_initialize() - ..() - mind.special_role = "Hunter" - -/mob/living/carbon/alien/humanoid/drone/mind_initialize() - ..() - mind.special_role = "Drone" - -/mob/living/carbon/alien/humanoid/sentinel/mind_initialize() - ..() - mind.special_role = "Sentinel" - //XENO LARVA -/mob/living/carbon/alien/larva/mind_initialize() - ..() - mind.special_role = "Larva" - -//AI -/mob/living/silicon/ai/mind_initialize() - ..() - mind.assigned_role = "AI" - -//BORG -/mob/living/silicon/robot/mind_initialize() - ..() - mind.assigned_role = "Cyborg" - -//PAI -/mob/living/silicon/pai/mind_initialize() - ..() - mind.assigned_role = "pAI" - mind.special_role = "" - -//BLOB -/mob/camera/blob/mind_initialize() - ..() - mind.special_role = "Blob" - -//Animals -/mob/living/simple_animal/mind_initialize() - ..() - mind.assigned_role = "Animal" - mind.special_role = "Animal" - -/mob/living/simple_animal/pet/dog/corgi/mind_initialize() - ..() - mind.assigned_role = "Corgi" - mind.special_role = "Corgi" - -/mob/living/simple_animal/shade/mind_initialize() - ..() - mind.assigned_role = "Shade" - mind.special_role = "Shade" - -/mob/living/simple_animal/hostile/construct/mind_initialize() - ..() - mind.assigned_role = "[initial(name)]" - mind.special_role = "Cultist" - +/* Note from Carnie: + The way datum/mind stuff works has been changed a lot. + Minds now represent IC characters rather than following a client around constantly. + + Guidelines for using minds properly: + + - Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living! + ghost.mind is however used as a reference to the ghost's corpse + + - When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human) + the existing mind of the old mob should be transfered to the new mob like so: + + mind.transfer_to(new_mob) + + - You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you. + By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing + the player. + + - IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you. + + - When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting + a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done. + + new_mob.key = key + + The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple! + However if you want that mind to have any special properties like being a traitor etc you will have to do that + yourself. + +*/ + +/datum/mind + var/key + var/name //replaces mob/var/original_name + var/mob/living/current + var/active = 0 + + var/memory + var/attack_log + + var/assigned_role + var/special_role + var/list/restricted_roles = list() + + var/datum/job/assigned_job + + var/list/datum/objective/objectives = list() + var/list/datum/objective/special_verbs = list() + + var/list/spell_list = list() // Wizard mode & "Give Spell" badmin button. + + var/datum/faction/faction //associated faction + var/datum/changeling/changeling //changeling holder + + var/miming = 0 // Mime's vow of silence + var/antag_hud_icon_state = null //this mind's ANTAG_HUD should have this icon_state + var/datum/atom_hud/antag/antag_hud = null //this mind's antag HUD + var/datum/gang/gang_datum //Which gang this mind belongs to, if any + +/datum/mind/New(var/key) + src.key = key + + +/datum/mind/proc/transfer_to(mob/new_character) + if(current) // remove ourself from our old body's mind variable + current.mind = null + SStgui.on_transfer(current, new_character) + + if(key) + if(new_character.key != key) //if we're transfering into a body with a key associated which is not ours + new_character.ghostize(1) //we'll need to ghostize so that key isn't mobless. + else + key = new_character.key + + if(new_character.mind) //disassociate any mind currently in our new body's mind variable + new_character.mind.current = null + + var/datum/atom_hud/antag/hud_to_transfer = antag_hud//we need this because leave_hud() will clear this list + leave_all_huds() //leave all the huds in the old body, so it won't get huds if somebody else enters it + current = new_character //associate ourself with our new body + new_character.mind = src //and associate our new body with ourself + transfer_antag_huds(hud_to_transfer) //inherit the antag HUD + transfer_actions(new_character) + + if(active) + new_character.key = key //now transfer the key to link the client to our new body + +/datum/mind/proc/store_memory(new_text) + memory += "[new_text]
" + +/datum/mind/proc/wipe_memory() + memory = null + + +/* + Removes antag type's references from a mind. + objectives, uplinks, powers etc are all handled. +*/ + +/datum/mind/proc/remove_objectives() + if(objectives.len) + for(var/datum/objective/O in objectives) + objectives -= O + qdel(O) + +/datum/mind/proc/remove_changeling() + if(src in ticker.mode.changelings) + ticker.mode.changelings -= src + current.remove_changeling_powers() + if(changeling) + qdel(changeling) + changeling = null + special_role = null + remove_antag_equip() + +/datum/mind/proc/remove_traitor() + if(src in ticker.mode.traitors) + ticker.mode.traitors -= src + if(isAI(current)) + var/mob/living/silicon/ai/A = current + A.set_zeroth_law("") + A.show_laws() + A.verbs -= /mob/living/silicon/ai/proc/choose_modules + A.malf_picker.remove_verbs(A) + qdel(A.malf_picker) + special_role = null + remove_antag_equip() + +/datum/mind/proc/remove_nukeop() + if(src in ticker.mode.syndicates) + ticker.mode.syndicates -= src + ticker.mode.update_synd_icons_removed(src) + special_role = null + remove_objectives() + remove_antag_equip() + +/datum/mind/proc/remove_wizard() + if(src in ticker.mode.wizards) + ticker.mode.wizards -= src + current.spellremove(current) + special_role = null + remove_antag_equip() + +/datum/mind/proc/remove_cultist() + if(src in ticker.mode.cult) + ticker.mode.cult -= src + ticker.mode.update_cult_icons_removed(src) + special_role = null + +/datum/mind/proc/remove_rev() + if(src in ticker.mode.revolutionaries) + ticker.mode.revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + if(src in ticker.mode.head_revolutionaries) + ticker.mode.head_revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + special_role = null + remove_objectives() + remove_antag_equip() + + +/datum/mind/proc/remove_gang() + ticker.mode.remove_gangster(src,0,1,1) + remove_objectives() + +/datum/mind/proc/remove_hog_follower_prophet() + ticker.mode.red_deity_followers -= src + ticker.mode.red_deity_prophets -= src + ticker.mode.blue_deity_prophets -= src + ticker.mode.blue_deity_followers -= src + ticker.mode.update_hog_icons_removed(src, "red") + ticker.mode.update_hog_icons_removed(src, "blue") + + + +/datum/mind/proc/remove_antag_equip() + var/list/Mob_Contents = current.get_contents() + for(var/obj/item/I in Mob_Contents) + if(istype(I, /obj/item/device/pda)) + var/obj/item/device/pda/P = I + P.lock_code = "" + + else if(istype(I, /obj/item/device/radio)) + var/obj/item/device/radio/R = I + R.traitor_frequency = 0 + +/datum/mind/proc/remove_all_antag() //For the Lazy amongst us. + remove_changeling() + remove_traitor() + remove_nukeop() + remove_wizard() + remove_cultist() + remove_rev() + remove_gang() + +/datum/mind/proc/show_memory(mob/recipient, window=1) + if(!recipient) + recipient = current + var/output = "[current.real_name]'s Memories:
" + output += memory + + if(objectives.len) + output += "Objectives:" + var/obj_count = 1 + for(var/datum/objective/objective in objectives) + output += "
Objective #[obj_count++]: [objective.explanation_text]" + + if(window) + recipient << browse(output,"window=memory") + else + recipient << "[output]" + +/datum/mind/proc/edit_memory() + if(!ticker || !ticker.mode) + alert("Not before round-start!", "Alert") + return + + var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" + out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" + out += "Assigned role: [assigned_role]. Edit
" + out += "Faction and special role: [special_role]
" + + var/list/sections = list( + "revolution", + "gang", + "cult", + "wizard", + "changeling", + "nuclear", + "traitor", // "traitorchan", + "monkey", + ) + var/text = "" + + if (istype(current, /mob/living/carbon/human) || istype(current, /mob/living/carbon/monkey)) + /** REVOLUTION ***/ + text = "revolution" + if (ticker.mode.config_tag=="revolution") + text = uppertext(text) + text = "[text]: " + if (assigned_role in command_positions) + text += "HEAD|loyal|employee|headrev|rev" + else if (src in ticker.mode.head_revolutionaries) + text += "head|loyal|employee|HEADREV|rev" + text += "
Flash: give" + + var/list/L = current.get_contents() + var/obj/item/device/assembly/flash/flash = locate() in L + if (flash) + if(!flash.crit_fail) + text += "|take." + else + text += "|take|repair." + else + text += "." + + text += " Reequip (gives traitor uplink)." + if (objectives.len==0) + text += "
Objectives are empty! Set to kill all heads." + else if(isloyal(current)) + text += "head|LOYAL|employee|headrev|rev" + else if (src in ticker.mode.revolutionaries) + text += "head|loyal|employee|headrev|REV" + else + text += "head|loyal|EMPLOYEE|headrev|rev" + + if(current && current.client && (ROLE_REV in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["revolution"] = text + + /** GANG ***/ + text = "gang" + if (ticker.mode.config_tag=="gang") + text = uppertext(text) + text = "[text]: " + text += "[isloyal(current) ? "LOYAL" : "loyal"]|" + if(src in ticker.mode.get_all_gangsters()) + text += "none" + else + text += "NONE" + + if(current && current.client && (ROLE_GANG in current.client.prefs.be_special)) + text += "|Enabled in Prefs
" + else + text += "|Disabled in Prefs
" + + for(var/datum/gang/G in ticker.mode.gangs) + text += "[G.name]: " + if(src in (G.gangsters)) + text += "GANGSTER" + else + text += "gangster" + text += "|" + if(src in (G.bosses)) + text += "GANG LEADER" + text += "|Equipment: give" + var/list/L = current.get_contents() + var/obj/item/device/gangtool/gangtool = locate() in L + if (gangtool) + text += "|take" + + else + text += "gang leader" + text += "
" + + if(gang_colors_pool.len) + text += "Create New Gang" + + sections["gang"] = text + + + /** CULT ***/ + text = "cult" + if (ticker.mode.config_tag=="cult") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.cult) + text += "loyal|employee|CULTIST" + text += "
Equip" + + else if(isloyal(current)) + text += "LOYAL|employee|cultist" + else + text += "loyal|EMPLOYEE|cultist" + + if(current && current.client && (ROLE_CULTIST in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["cult"] = text + + /** WIZARD ***/ + text = "wizard" + if (ticker.mode.config_tag=="wizard") + text = uppertext(text) + text = "[text]: " + if ((src in ticker.mode.wizards) || (src in ticker.mode.apprentices)) + text += "YES|no" + text += "
To lair, undress, dress up, let choose name." + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + else + text += "yes|NO" + + if(current && current.client && (ROLE_WIZARD in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["wizard"] = text + + /** CHANGELING ***/ + text = "changeling" + if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan") + text = uppertext(text) + text = "[text]: " + if ((src in ticker.mode.changelings) && special_role) + text += "YES|no" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + if(changeling && changeling.stored_profiles.len && (current.real_name != changeling.first_prof.name) ) + text += "
Transform to initial appearance." + else if(src in ticker.mode.changelings) //Station Aligned Changeling + text += "YES (but not an antag)|no" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + if(changeling && changeling.stored_profiles.len && (current.real_name != changeling.first_prof.name) ) + text += "
Transform to initial appearance." + else + text += "yes|NO" +// var/datum/game_mode/changeling/changeling = ticker.mode +// if (istype(changeling) && changeling.changelingdeath) +// text += "
All the changelings are dead! Restart in [round((changeling.TIME_TO_GET_REVIVED-(world.time-changeling.changelingdeathtime))/10)] seconds." + + if(current && current.client && (ROLE_CHANGELING in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["changeling"] = text + + /** NUCLEAR ***/ + text = "nuclear" + if (ticker.mode.config_tag=="nuclear") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.syndicates) + text += "OPERATIVE|nanotrasen" + text += "
To shuttle, undress, dress up." + var/code + for (var/obj/machinery/nuclearbomb/bombue in machines) + if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") + code = bombue.r_code + break + if (code) + text += " Code is [code]. tell the code." + else + text += "operative|NANOTRASEN" + + if(current && current.client && (ROLE_OPERATIVE in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["nuclear"] = text + + /** TRAITOR ***/ + text = "traitor" + if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.traitors) + text += "TRAITOR|loyal" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + else + text += "traitor|LOYAL" + + if(current && current.client && (ROLE_TRAITOR in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["traitor"] = text + + /** SHADOWLING **/ + text = "shadowling" + if(ticker.mode.config_tag == "shadowling") + text = uppertext(text) + text = "[text]: " + if(src in ticker.mode.shadows) + text += "SHADOWLING|thrall|human" + else if(src in ticker.mode.thralls) + text += "shadowling|THRALL|human" + else + text += "shadowling|thrall|HUMAN" + + if(current && current.client && (ROLE_SHADOWLING in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["shadowling"] = text + + /** Abductors **/ + + text = "Abductor" + if(ticker.mode.config_tag == "abductor") + text = uppertext(text) + text = "[text]: " + if(src in ticker.mode.abductors) + text += "Abductor|human" + text += "|undress|equip" + else + text += "Abductor|human" + + if(current && current.client && (ROLE_ABDUCTOR in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["abductor"] = text + + /** HAND OF GOD **/ + text = "hand of god" + if(ticker.mode.config_tag == "handofgod") + text = uppertext(text) + text = "[text]: " + if(src in ticker.mode.red_deity_prophets) + text += "RED PROPHET|red follower|employee|blue follower|blue prophet|red god|blue god" + else if (src in ticker.mode.red_deity_followers) + text += "red prophet|RED FOLLOWER|employee|blue follower|blue prophet|red god|blue god" + else if (src in ticker.mode.blue_deity_followers) + text += "red prophet|red follower|employee|BLUE FOLLOWER|blue prophet|red god|blue god" + else if (src in ticker.mode.blue_deity_prophets) + text += "red prophet|red follower|employee|blue follower|BLUE PROPHET|red god|blue god" + else if (src in ticker.mode.red_deities) + text += "red prophet|red follower|employee|blue follower|blue prophet|RED GOD|blue god" + else if (src in ticker.mode.blue_deities) + text += "red prophet|red follower|employee|blue follower|blue prophet|red god|BLUE GOD" + else + text += "red prophet|red follower|EMPLOYEE|blue follower|blue prophet|red god|blue god" + + if(current && current.client && (ROLE_HOG_GOD in current.client.prefs.be_special)) + text += "|HOG God Enabled in Prefs" + else + text += "|HOG God Disabled in Prefs" + + if(current && current.client && (ROLE_HOG_CULTIST in current.client.prefs.be_special)) + text += "|HOG Cultist Enabled in Prefs" + else + text += "|HOG Disabled in Prefs" + + sections["follower"] = text + + /** MONKEY ***/ + if (istype(current, /mob/living/carbon)) + text = "monkey" + if (ticker.mode.config_tag=="monkey") + text = uppertext(text) + text = "[text]: " + if (istype(current, /mob/living/carbon/human)) + text += "healthy|infected|HUMAN|other" + else if (istype(current, /mob/living/carbon/monkey)) + var/found = 0 + for(var/datum/disease/D in current.viruses) + if(istype(D, /datum/disease/transformation/jungle_fever)) found = 1 + + if(found) + text += "healthy|INFECTED|human|other" + else + text += "HEALTHY|infected|human|other" + + else + text += "healthy|infected|human|OTHER" + + if(current && current.client && (ROLE_MONKEY in current.client.prefs.be_special)) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["monkey"] = text + + + /** SILICON ***/ + + if (istype(current, /mob/living/silicon)) + text = "silicon" + var/mob/living/silicon/robot/robot = current + if (istype(robot) && robot.emagged) + text += "
Cyborg: Is emagged! Unemag!
0th law: [robot.laws.zeroth]" + var/mob/living/silicon/ai/ai = current + if (istype(ai) && ai.connected_robots.len) + var/n_e_robots = 0 + for (var/mob/living/silicon/robot/R in ai.connected_robots) + if (R.emagged) + n_e_robots++ + text += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" + if (ticker.mode.config_tag == "traitorchan") + if (sections["traitor"]) + out += sections["traitor"]+"
" + if (sections["changeling"]) + out += sections["changeling"]+"

" + sections -= "traitor" + sections -= "changeling" + else + if (sections[ticker.mode.config_tag]) + out += sections[ticker.mode.config_tag]+"

" + sections -= ticker.mode.config_tag + for (var/i in sections) + if (sections[i]) + out += sections[i]+"
" + + + if (((src in ticker.mode.head_revolutionaries) || \ + (src in ticker.mode.traitors) || \ + (src in ticker.mode.syndicates)) && \ + istype(current,/mob/living/carbon/human) ) + + text = "Uplink: give" + var/obj/item/device/uplink/U = find_syndicate_uplink() + if(U) + text += "|take" + if (check_rights(R_FUN, 0)) + text += ", [U.telecrystals] TC" + else + text += ", [U.telecrystals] TC" + text += "." //hiel grammar + out += text + + out += "

" + + out += "Memory:
" + out += memory + out += "
Edit memory
" + out += "Objectives:
" + if (objectives.len == 0) + out += "EMPTY
" + else + var/obj_count = 1 + for(var/datum/objective/objective in objectives) + out += "[obj_count]: [objective.explanation_text] Edit Delete Toggle Completion
" + obj_count++ + out += "Add objective

" + + out += "Announce objectives

" + + usr << browse(out, "window=edit_memory[src];size=500x600") + + +/datum/mind/Topic(href, href_list) + if(!check_rights(R_ADMIN)) + return + + if (href_list["role_edit"]) + var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() + if (!new_role) + return + assigned_role = new_role + + else if (href_list["memory_edit"]) + var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN) + if (isnull(new_memo)) + return + memory = new_memo + + else if (href_list["obj_edit"] || href_list["obj_add"]) + var/datum/objective/objective + var/objective_pos + var/def_value + + if (href_list["obj_edit"]) + objective = locate(href_list["obj_edit"]) + if (!objective) + return + objective_pos = objectives.Find(objective) + + //Text strings are easy to manipulate. Revised for simplicity. + var/temp_obj_type = "[objective.type]"//Convert path into a text string. + def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. + if(!def_value)//If it's a custom objective, it will be an empty string. + def_value = "custom" + + var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "maroon", "debrain", "protect", "destroy", "prevent", "hijack", "escape", "survive", "martyr", "steal", "download", "nuclear", "capture", "absorb", "custom","follower block (HOG)","build (HOG)","deicide (HOG)", "follower escape (HOG)", "sacrifice prophet (HOG)") + if (!new_obj_type) + return + + var/datum/objective/new_objective = null + + switch (new_obj_type) + if ("assassinate","protect","debrain","maroon") + var/list/possible_targets = list("Free objective") + for(var/datum/mind/possible_target in ticker.minds) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target.current + + var/mob/def_target = null + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon) + if (objective&&(objective.type in objective_list) && objective:target) + def_target = objective:target.current + + var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + if (!new_target) + return + + var/objective_path = text2path("/datum/objective/[new_obj_type]") + if (new_target == "Free objective") + new_objective = new objective_path + new_objective.owner = src + new_objective:target = null + new_objective.explanation_text = "Free objective" + else + new_objective = new objective_path + new_objective.owner = src + new_objective:target = new_target:mind + //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. + new_objective.update_explanation_text() + + if ("destroy") + var/list/possible_targets = active_ais(1) + if(possible_targets.len) + var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets + new_objective = new /datum/objective/destroy + new_objective.target = new_target.mind + new_objective.owner = src + new_objective.update_explanation_text() + else + usr << "No active AIs with minds" + + if ("prevent") + new_objective = new /datum/objective/block + new_objective.owner = src + + if ("hijack") + new_objective = new /datum/objective/hijack + new_objective.owner = src + + if ("escape") + new_objective = new /datum/objective/escape + new_objective.owner = src + + if ("survive") + new_objective = new /datum/objective/survive + new_objective.owner = src + + if("martyr") + new_objective = new /datum/objective/martyr + new_objective.owner = src + + if ("nuclear") + new_objective = new /datum/objective/nuclear + new_objective.owner = src + + if ("steal") + if (!istype(objective, /datum/objective/steal)) + new_objective = new /datum/objective/steal + new_objective.owner = src + else + new_objective = objective + var/datum/objective/steal/steal = new_objective + if (!steal.select_target()) + return + + if("download","capture","absorb") + var/def_num + if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) + def_num = objective.target_amount + + var/target_number = input("Input target number:", "Objective", def_num) as num|null + if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. + return + + switch(new_obj_type) + if("download") + new_objective = new /datum/objective/download + new_objective.explanation_text = "Download [target_number] research levels." + if("capture") + new_objective = new /datum/objective/capture + new_objective.explanation_text = "Capture [target_number] lifeforms with an energy net. Live, rare specimens are worth more." + if("absorb") + new_objective = new /datum/objective/absorb + new_objective.explanation_text = "Absorb [target_number] compatible genomes." + new_objective.owner = src + new_objective.target_amount = target_number + + if("follower block (HOG)") + new_objective = new /datum/objective/follower_block + new_objective.owner = src + if("build (HOG)") + new_objective = new /datum/objective/build + new_objective.owner = src + if("deicide (HOG)") + new_objective = new /datum/objective/deicide + new_objective.owner = src + if("follower escape (HOG)") + new_objective = new /datum/objective/escape_followers + new_objective.owner = src + if("sacrifice prophet (HOG)") + new_objective = new /datum/objective/sacrifice_prophet + new_objective.owner = src + + if ("custom") + var/expl = stripped_input(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "") + if (!expl) + return + new_objective = new /datum/objective + new_objective.owner = src + new_objective.explanation_text = expl + + if (!new_objective) + return + + if (objective) + objectives -= objective + objectives.Insert(objective_pos, new_objective) + message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]") + log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]") + else + objectives += new_objective + message_admins("[key_name_admin(usr)] added a new objective for [current]: [new_objective.explanation_text]") + log_admin("[key_name(usr)] added a new objective for [current]: [new_objective.explanation_text]") + + else if (href_list["obj_delete"]) + var/datum/objective/objective = locate(href_list["obj_delete"]) + if(!istype(objective)) + return + objectives -= objective + message_admins("[key_name_admin(usr)] removed an objective for [current]: [objective.explanation_text]") + log_admin("[key_name(usr)] removed an objective for [current]: [objective.explanation_text]") + + else if(href_list["obj_completed"]) + var/datum/objective/objective = locate(href_list["obj_completed"]) + if(!istype(objective)) + return + objective.completed = !objective.completed + log_admin("[key_name(usr)] toggled the win state for [current]'s objective: [objective.explanation_text]") + + else if (href_list["handofgod"]) + switch(href_list["handofgod"]) + if("clear") //wipe handofgod status + if((src in ticker.mode.red_deity_followers) || (src in ticker.mode.blue_deity_followers) || (src in ticker.mode.red_deity_prophets) || (src in ticker.mode.blue_deity_prophets)) + remove_hog_follower_prophet() + current << "You have been brainwashed... again! Your faith is no more!" + message_admins("[key_name_admin(usr)] has de-hand of god'ed [current].") + log_admin("[key_name(usr)] has de-hand of god'ed [current].") + + if("red follower") + make_Handofgod_follower("red") + message_admins("[key_name_admin(usr)] has red follower'ed [current].") + log_admin("[key_name(usr)] has red follower'ed [current].") + + if("red prophet") + make_Handofgod_prophet("red") + message_admins("[key_name_admin(usr)] has red prophet'ed [current].") + log_admin("[key_name(usr)] has red prophet'ed [current].") + + if("blue follower") + make_Handofgod_follower("blue") + message_admins("[key_name_admin(usr)] has blue follower'ed [current].") + log_admin("[key_name(usr)] has blue follower'ed [current].") + + if("blue prophet") + make_Handofgod_prophet("blue") + message_admins("[key_name_admin(usr)] has blue prophet'ed [current].") + log_admin("[key_name(usr)] has blue prophet'ed [current].") + + if("red god") + make_Handofgod_god("red") + message_admins("[key_name_admin(usr)] has red god'ed [current].") + log_admin("[key_name(usr)] has red god'ed [current].") + + if("blue god") + make_Handofgod_god("blue") + message_admins("[key_name_admin(usr)] has blue god'ed [current].") + log_admin("[key_name(usr)] has blue god'ed [current].") + + + else if (href_list["revolution"]) + switch(href_list["revolution"]) + if("clear") + remove_rev() + current << "You have been brainwashed! You are no longer a revolutionary!" + message_admins("[key_name_admin(usr)] has de-rev'ed [current].") + log_admin("[key_name(usr)] has de-rev'ed [current].") + if("rev") + if(src in ticker.mode.head_revolutionaries) + ticker.mode.head_revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + current << "Revolution has been disappointed of your leader traits! You are a regular revolutionary now!" + else if(!(src in ticker.mode.revolutionaries)) + current << " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" + else + return + ticker.mode.revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Revolutionary" + message_admins("[key_name_admin(usr)] has rev'ed [current].") + log_admin("[key_name(usr)] has rev'ed [current].") + + if("headrev") + if(src in ticker.mode.revolutionaries) + ticker.mode.revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + current << "You have proved your devotion to revoltion! Yea are a head revolutionary now!" + else if(!(src in ticker.mode.head_revolutionaries)) + current << "You are a member of the revolutionaries' leadership now!" + else + return + if (ticker.mode.head_revolutionaries.len>0) + // copy targets + var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries + if (valid_head) + for (var/datum/objective/mutiny/O in valid_head.objectives) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = src + rev_obj.target = O.target + rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]." + objectives += rev_obj + ticker.mode.greet_revolutionary(src,0) + ticker.mode.head_revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Head Revolutionary" + message_admins("[key_name_admin(usr)] has head-rev'ed [current].") + log_admin("[key_name(usr)] has head-rev'ed [current].") + + if("autoobjectives") + ticker.mode.forge_revolutionary_objectives(src) + ticker.mode.greet_revolutionary(src,0) + usr << "The objectives for revolution have been generated and shown to [key]" + + if("flash") + if (!ticker.mode.equip_revolutionary(current)) + usr << "Spawning flash failed!" + + if("takeflash") + var/list/L = current.get_contents() + var/obj/item/device/assembly/flash/flash = locate() in L + if (!flash) + usr << "Deleting flash failed!" + qdel(flash) + + if("repairflash") + var/list/L = current.get_contents() + var/obj/item/device/assembly/flash/flash = locate() in L + if (!flash) + usr << "Repairing flash failed!" + else + flash.crit_fail = 0 + flash.update_icon() + + + +//////////////////// GANG MODE + + else if (href_list["gang"]) + switch(href_list["gang"]) + if("clear") + remove_gang() + message_admins("[key_name_admin(usr)] has de-gang'ed [current].") + log_admin("[key_name(usr)] has de-gang'ed [current].") + + if("equip") + switch(ticker.mode.equip_gang(current,gang_datum)) + if(1) + usr << "Unable to equip territory spraycan!" + if(2) + usr << "Unable to equip recruitment pen and spraycan!" + if(3) + usr << "Unable to equip gangtool, pen, and spraycan!" + + if("takeequip") + var/list/L = current.get_contents() + for(var/obj/item/weapon/pen/gang/pen in L) + qdel(pen) + for(var/obj/item/device/gangtool/gangtool in L) + qdel(gangtool) + for(var/obj/item/toy/crayon/spraycan/gang/SC in L) + qdel(SC) + + if("new") + if(gang_colors_pool.len) + var/list/names = list("Random") + gang_name_pool + var/gangname = input("Pick a gang name.","Select Name") as null|anything in names + if(gangname && gang_colors_pool.len) //Check again just in case another admin made max gangs at the same time + if(!(gangname in gang_name_pool)) + gangname = null + var/datum/gang/newgang = new(null,gangname) + ticker.mode.gangs += newgang + message_admins("[key_name_admin(usr)] has created the [newgang.name] Gang.") + log_admin("[key_name(usr)] has created the [newgang.name] Gang.") + + else if (href_list["gangboss"]) + var/datum/gang/G = locate(href_list["gangboss"]) in ticker.mode.gangs + if(!G || (src in G.bosses)) + return + ticker.mode.remove_gangster(src,0,2,1) + G.bosses += src + gang_datum = G + special_role = "[G.name] Gang Boss" + G.add_gang_hud(src) + current << "You are a [G.name] Gang Boss!" + message_admins("[key_name_admin(usr)] has added [current] to the [G.name] Gang leadership.") + log_admin("[key_name(usr)] has added [current] to the [G.name] Gang leadership.") + ticker.mode.forge_gang_objectives(src) + ticker.mode.greet_gang(src,0) + + else if (href_list["gangster"]) + var/datum/gang/G = locate(href_list["gangster"]) in ticker.mode.gangs + if(!G || (src in G.gangsters)) + return + ticker.mode.remove_gangster(src,0,2,1) + ticker.mode.add_gangster(src,G,0) + message_admins("[key_name_admin(usr)] has added [current] to the [G.name] Gang (A).") + log_admin("[key_name(usr)] has added [current] to the [G.name] Gang (A).") + +///////////////////////////////// + + + + else if (href_list["cult"]) + switch(href_list["cult"]) + if("clear") + remove_cultist() + current << "You have been brainwashed! You are no longer a cultist!" + message_admins("[key_name_admin(usr)] has de-cult'ed [current].") + log_admin("[key_name(usr)] has de-cult'ed [current].") + if("cultist") + if(!(src in ticker.mode.cult)) + ticker.mode.add_cultist(src) + message_admins("[key_name_admin(usr)] has cult'ed [current].") + log_admin("[key_name(usr)] has cult'ed [current].") + if("equip") + if (!ticker.mode.equip_cultist(current)) + usr << "equip_cultist() failed! [current]'s starting equipment will be incomplete." + + else if (href_list["wizard"]) + switch(href_list["wizard"]) + if("clear") + remove_wizard() + current << "You have been brainwashed! You are no longer a wizard!" + log_admin("[key_name(usr)] has de-wizard'ed [current].") + if("wizard") + if(!(src in ticker.mode.wizards)) + ticker.mode.wizards += src + special_role = "Wizard" + //ticker.mode.learn_basic_spells(current) + current << "You are the Space Wizard!" + message_admins("[key_name_admin(usr)] has wizard'ed [current].") + log_admin("[key_name(usr)] has wizard'ed [current].") + if("lair") + current.loc = pick(wizardstart) + if("dressup") + ticker.mode.equip_wizard(current) + if("name") + ticker.mode.name_wizard(current) + if("autoobjectives") + ticker.mode.forge_wizard_objectives(src) + usr << "The objectives for wizard [key] have been generated. You can edit them and anounce manually." + + else if (href_list["changeling"]) + switch(href_list["changeling"]) + if("clear") + remove_changeling() + current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" + message_admins("[key_name_admin(usr)] has de-changeling'ed [current].") + log_admin("[key_name(usr)] has de-changeling'ed [current].") + if("changeling") + if(!(src in ticker.mode.changelings)) + ticker.mode.changelings += src + current.make_changeling() + special_role = "Changeling" + current << "Your powers are awoken. A flash of memory returns to us...we are [changeling.changelingID], a changeling!" + message_admins("[key_name_admin(usr)] has changeling'ed [current].") + log_admin("[key_name(usr)] has changeling'ed [current].") + if("autoobjectives") + ticker.mode.forge_changeling_objectives(src) + usr << "The objectives for changeling [key] have been generated. You can edit them and anounce manually." + + if("initialdna") + if( !changeling || !changeling.stored_profiles.len || !istype(current, /mob/living/carbon)) + usr << "Resetting DNA failed!" + else + var/mob/living/carbon/C = current + changeling.first_prof.dna.transfer_identity(C, transfer_SE=1) + C.real_name = changeling.first_prof.name + C.updateappearance(mutcolor_update=1) + C.domutcheck() + + else if (href_list["nuclear"]) + switch(href_list["nuclear"]) + if("clear") + remove_nukeop() + current << "You have been brainwashed! You are no longer a syndicate operative!" + message_admins("[key_name_admin(usr)] has de-nuke op'ed [current].") + log_admin("[key_name(usr)] has de-nuke op'ed [current].") + if("nuclear") + if(!(src in ticker.mode.syndicates)) + ticker.mode.syndicates += src + ticker.mode.update_synd_icons_added(src) + if (ticker.mode.syndicates.len==1) + ticker.mode.prepare_syndicate_leader(src) + else + current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" + special_role = "Syndicate" + assigned_role = "Syndicate" + current << "You are a [syndicate_name()] agent!" + ticker.mode.forge_syndicate_objectives(src) + ticker.mode.greet_syndicate(src) + message_admins("[key_name_admin(usr)] has nuke op'ed [current].") + log_admin("[key_name(usr)] has nuke op'ed [current].") + if("lair") + current.loc = get_turf(locate("landmark*Syndicate-Spawn")) + if("dressup") + var/mob/living/carbon/human/H = current + qdel(H.belt) + qdel(H.back) + qdel(H.ears) + qdel(H.gloves) + qdel(H.head) + qdel(H.shoes) + qdel(H.wear_id) + qdel(H.wear_suit) + qdel(H.w_uniform) + + if (!ticker.mode.equip_syndicate(current)) + usr << "Equipping a syndicate failed!" + if("tellcode") + var/code + for (var/obj/machinery/nuclearbomb/bombue in machines) + if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") + code = bombue.r_code + break + if (code) + store_memory("Syndicate Nuclear Bomb Code: [code]", 0, 0) + current << "The nuclear authorization code is: [code]" + else + usr << "No valid nuke found!" + + else if (href_list["traitor"]) + switch(href_list["traitor"]) + if("clear") + remove_traitor() + current << "You have been brainwashed! You are no longer a traitor!" + message_admins("[key_name_admin(usr)] has de-traitor'ed [current].") + log_admin("[key_name(usr)] has de-traitor'ed [current].") + + if("traitor") + if(!(src in ticker.mode.traitors)) + ticker.mode.traitors += src + special_role = "traitor" + current << "You are a traitor!" + message_admins("[key_name_admin(usr)] has traitor'ed [current].") + log_admin("[key_name(usr)] has traitor'ed [current].") + if(isAI(current)) + var/mob/living/silicon/ai/A = current + ticker.mode.add_law_zero(A) + + if("autoobjectives") + ticker.mode.forge_traitor_objectives(src) + usr << "The objectives for traitor [key] have been generated. You can edit them and anounce manually." + + else if(href_list["shadowling"]) + switch(href_list["shadowling"]) + if("clear") + ticker.mode.update_shadow_icons_removed(src) + if(src in ticker.mode.shadows) + ticker.mode.shadows -= src + special_role = null + current << "Your powers have been quenched! You are no longer a shadowling!" + remove_spell(/obj/effect/proc_holder/spell/self/shadowling_hatch) + remove_spell(/obj/effect/proc_holder/spell/self/shadowling_ascend) + remove_spell(/obj/effect/proc_holder/spell/targeted/enthrall) + remove_spell(/obj/effect/proc_holder/spell/self/shadowling_hivemind) + message_admins("[key_name_admin(usr)] has de-shadowling'ed [current].") + log_admin("[key_name(usr)] has de-shadowling'ed [current].") + else if(src in ticker.mode.thralls) + ticker.mode.remove_thrall(src,0) + message_admins("[key_name_admin(usr)] has de-thrall'ed [current].") + log_admin("[key_name(usr)] has de-thrall'ed [current].") + if("shadowling") + if(!ishuman(current)) + usr << "This only works on humans!" + return + ticker.mode.shadows += src + special_role = "shadowling" + current << "Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \ + time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\ + " + ticker.mode.finalize_shadowling(src) + ticker.mode.update_shadow_icons_added(src) + if("thrall") + if(!ishuman(current)) + usr << "This only works on humans!" + return + ticker.mode.add_thrall(src) + message_admins("[key_name_admin(usr)] has thrall'ed [current].") + log_admin("[key_name(usr)] has thrall'ed [current].") + + else if(href_list["abductor"]) + switch(href_list["abductor"]) + if("clear") + usr << "Not implemented yet. Sorry!" + if("abductor") + if(!ishuman(current)) + usr << "This only works on humans!" + return + make_Abductor() + log_admin("[key_name(usr)] turned [current] into abductor.") + if("equip") + var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist") + if(gear) + var/datum/game_mode/abduction/temp = new + temp.equip_common(current) + if(gear=="Agent") + temp.equip_agent(current) + else + temp.equip_scientist(current) + + else if (href_list["monkey"]) + var/mob/living/L = current + if (L.notransform) + return + switch(href_list["monkey"]) + if("healthy") + if (check_rights(R_ADMIN)) + var/mob/living/carbon/human/H = current + var/mob/living/carbon/monkey/M = current + if (istype(H)) + log_admin("[key_name(usr)] attempting to monkeyize [key_name(current)]") + message_admins("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(current)]") + src = null + M = H.monkeyize() + src = M.mind + //world << "DEBUG: \"healthy\": M=[M], M.mind=[M.mind], src=[src]!" + else if (istype(M) && length(M.viruses)) + for(var/datum/disease/D in M.viruses) + D.cure(0) + sleep(0) //because deleting of virus is done through spawn(0) + if("infected") + if (check_rights(R_ADMIN, 0)) + var/mob/living/carbon/human/H = current + var/mob/living/carbon/monkey/M = current + if (istype(H)) + log_admin("[key_name(usr)] attempting to monkeyize and infect [key_name(current)]") + message_admins("[key_name_admin(usr)] attempting to monkeyize and infect [key_name_admin(current)]") + src = null + M = H.monkeyize() + src = M.mind + current.ForceContractDisease(new /datum/disease/transformation/jungle_fever) + else if (istype(M)) + current.ForceContractDisease(new /datum/disease/transformation/jungle_fever) + if("human") + if (check_rights(R_ADMIN, 0)) + var/mob/living/carbon/human/H = current + var/mob/living/carbon/monkey/M = current + if (istype(M)) + for(var/datum/disease/D in M.viruses) + if (istype(D,/datum/disease/transformation/jungle_fever)) + D.cure(0) + sleep(0) //because deleting of virus is doing throught spawn(0) + log_admin("[key_name(usr)] attempting to humanize [key_name(current)]") + message_admins("[key_name_admin(usr)] attempting to humanize [key_name_admin(current)]") + H = M.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_DEFAULTMSG) + if(H) + src = H.mind + + else if (href_list["silicon"]) + switch(href_list["silicon"]) + if("unemag") + var/mob/living/silicon/robot/R = current + if (istype(R)) + R.SetEmagged(0) + message_admins("[key_name_admin(usr)] has unemag'ed [R].") + log_admin("[key_name(usr)] has unemag'ed [R].") + + if("unemagcyborgs") + if (istype(current, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/ai = current + for (var/mob/living/silicon/robot/R in ai.connected_robots) + R.SetEmagged(0) + message_admins("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.") + log_admin("[key_name(usr)] has unemag'ed [ai]'s Cyborgs.") + + else if (href_list["common"]) + switch(href_list["common"]) + if("undress") + for(var/obj/item/W in current) + current.unEquip(W, 1) //The 1 forces all items to drop, since this is an admin undress. + if("takeuplink") + take_uplink() + memory = null//Remove any memory they may have had. + log_admin("[key_name(usr)] removed [current]'s uplink.") + if("crystals") + if(check_rights(R_FUN, 0)) + var/obj/item/device/uplink/U = find_syndicate_uplink() + if(U) + var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.telecrystals) as null|num + if(!isnull(crystals)) + U.telecrystals = crystals + message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].") + log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].") + if("uplink") + if(!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) + usr << "Equipping a syndicate failed!" + log_admin("[key_name(usr)] attempted to give [current] an uplink.") + + else if (href_list["obj_announce"]) + var/obj_count = 1 + current << "Your current objectives:" + for(var/datum/objective/objective in objectives) + current << "Objective #[obj_count]: [objective.explanation_text]" + obj_count++ + + edit_memory() + +/datum/mind/proc/find_syndicate_uplink() + var/list/L = current.get_contents() + for (var/obj/item/I in L) + if (I.hidden_uplink) + return I.hidden_uplink + return null + +/datum/mind/proc/take_uplink() + var/obj/item/device/uplink/H = find_syndicate_uplink() + if(H) + qdel(H) + +/datum/mind/proc/make_Traitor() + if(!(src in ticker.mode.traitors)) + ticker.mode.traitors += src + special_role = "traitor" + ticker.mode.forge_traitor_objectives(src) + ticker.mode.finalize_traitor(src) + ticker.mode.greet_traitor(src) + +/datum/mind/proc/make_Nuke(turf/spawnloc,nuke_code,leader=0, telecrystals = TRUE) + if(!(src in ticker.mode.syndicates)) + ticker.mode.syndicates += src + ticker.mode.update_synd_icons_added(src) + special_role = "Syndicate" + ticker.mode.forge_syndicate_objectives(src) + ticker.mode.greet_syndicate(src) + + current.loc = spawnloc + + var/mob/living/carbon/human/H = current + qdel(H.belt) + qdel(H.back) + qdel(H.ears) + qdel(H.gloves) + qdel(H.head) + qdel(H.shoes) + qdel(H.wear_id) + qdel(H.wear_suit) + qdel(H.w_uniform) + + ticker.mode.equip_syndicate(current, telecrystals) + + if (nuke_code) + store_memory("Syndicate Nuclear Bomb Code: [nuke_code]", 0, 0) + current << "The nuclear authorization code is: [nuke_code]" + + if (leader) + ticker.mode.prepare_syndicate_leader(src,nuke_code) + else + current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" + +/datum/mind/proc/make_Changling() + if(!(src in ticker.mode.changelings)) + ticker.mode.changelings += src + current.make_changeling() + special_role = "Changeling" + ticker.mode.forge_changeling_objectives(src) + ticker.mode.greet_changeling(src) + +/datum/mind/proc/make_Wizard() + if(!(src in ticker.mode.wizards)) + ticker.mode.wizards += src + special_role = "Wizard" + assigned_role = "Wizard" + //ticker.mode.learn_basic_spells(current) + if(!wizardstart.len) + current.loc = pick(latejoin) + current << "HOT INSERTION, GO GO GO" + else + current.loc = pick(wizardstart) + + ticker.mode.equip_wizard(current) + for(var/obj/item/weapon/spellbook/S in current.contents) + S.op = 0 + ticker.mode.name_wizard(current) + ticker.mode.forge_wizard_objectives(src) + ticker.mode.greet_wizard(src) + + +/datum/mind/proc/make_Cultist() + if(!(src in ticker.mode.cult)) + ticker.mode.cult += src + ticker.mode.update_cult_icons_added(src) + special_role = "Cultist" + current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." + current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + current << "Your objective is to summon Nar-Sie by building and defending a suitable shell for the Geometer. Adequate supplies can be procured through human sacrifices." + ticker.mode.equip_cultist(current) + +/datum/mind/proc/make_Rev() + if (ticker.mode.head_revolutionaries.len>0) + // copy targets + var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries + if (valid_head) + for (var/datum/objective/mutiny/O in valid_head.objectives) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = src + rev_obj.target = O.target + rev_obj.explanation_text = "Assassinate [O.target.current.real_name], the [O.target.assigned_role]." + objectives += rev_obj + ticker.mode.greet_revolutionary(src,0) + ticker.mode.head_revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Head Revolutionary" + + ticker.mode.forge_revolutionary_objectives(src) + ticker.mode.greet_revolutionary(src,0) + + var/list/L = current.get_contents() + var/obj/item/device/assembly/flash/flash = locate() in L + qdel(flash) + take_uplink() + var/fail = 0 +// fail |= !ticker.mode.equip_traitor(current, 1) + fail |= !ticker.mode.equip_revolutionary(current) + + +/datum/mind/proc/make_Gang(datum/gang/G) + special_role = "[G.name] Gang Boss" + G.bosses += src + gang_datum = G + G.add_gang_hud(src) + ticker.mode.forge_gang_objectives(src) + ticker.mode.greet_gang(src) + ticker.mode.equip_gang(current,G) + +/datum/mind/proc/make_Abductor() + var/role = alert("Abductor Role ?","Role","Agent","Scientist") + var/team = input("Abductor Team ?","Team ?") in list(1,2,3,4) + var/teleport = alert("Teleport to ship ?","Teleport","Yes","No") + + if(!role || !team || !teleport) + return + + if(!ishuman(current)) + return + + ticker.mode.abductors |= src + + var/datum/objective/experiment/O = new + O.owner = src + objectives += O + + var/mob/living/carbon/human/H = current + + H.set_species(/datum/species/abductor) + var/datum/species/abductor/S = H.dna.species + + switch(role) + if("Agent") + S.agent = 1 + if("Scientist") + S.scientist = 1 + S.team = team + + var/list/obj/effect/landmark/abductor/agent_landmarks = new + var/list/obj/effect/landmark/abductor/scientist_landmarks = new + agent_landmarks.len = 4 + scientist_landmarks.len = 4 + for(var/obj/effect/landmark/abductor/A in landmarks_list) + if(istype(A,/obj/effect/landmark/abductor/agent)) + agent_landmarks[text2num(A.team)] = A + else if(istype(A,/obj/effect/landmark/abductor/scientist)) + scientist_landmarks[text2num(A.team)] = A + + var/obj/effect/landmark/L + if(teleport=="Yes") + switch(role) + if("Agent") + S.agent = 1 + L = agent_landmarks[team] + H.loc = L.loc + if("Scientist") + S.scientist = 1 + L = agent_landmarks[team] + H.loc = L.loc + + +/datum/mind/proc/make_Handofgod_follower(colour) + . = 0 + switch(colour) + if("red") + //Remove old allegiances + if(src in ticker.mode.blue_deity_followers || src in ticker.mode.blue_deity_prophets) + current << "You are no longer a member of the Blue cult!" + + ticker.mode.blue_deity_followers -= src + ticker.mode.blue_deity_prophets -= src + current.faction |= "red god" + current.faction -= "blue god" + + if(src in ticker.mode.red_deity_prophets) + current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" + ticker.mode.red_deity_prophets -= src + + ticker.mode.red_deity_followers |= src + current << "You are now a follower of the red cult's god!" + + special_role = "Hand of God: Red Follower" + . = 1 + if("blue") + //Remove old allegiances + if(src in ticker.mode.red_deity_followers || src in ticker.mode.red_deity_prophets) + current << "You are no longer a member of the Red cult!" + + ticker.mode.red_deity_followers -= src + ticker.mode.red_deity_prophets -= src + current.faction -= "red god" + current.faction |= "blue god" + + if(src in ticker.mode.blue_deity_prophets) + current << "You have lost the connection with your deity, but you still believe in their grand design, You are no longer a prophet!" + ticker.mode.blue_deity_prophets -= src + + ticker.mode.blue_deity_followers |= src + current << "You are now a follower of the blue cult's god!" + + special_role = "Hand of God: Blue Follower" + . = 1 + else + return 0 + + ticker.mode.update_hog_icons_removed(src,"red") + ticker.mode.update_hog_icons_removed(src,"blue") + //ticker.mode.greet_hog_follower(src,colour) + ticker.mode.update_hog_icons_added(src, colour) + +/datum/mind/proc/make_Handofgod_prophet(colour) + . = 0 + switch(colour) + if("red") + //Remove old allegiances + + if(src in ticker.mode.blue_deity_followers || src in ticker.mode.blue_deity_prophets) + current << "You are no longer a member of the Blue cult!" + current.faction -= "blue god" + current.faction |= "red god" + + ticker.mode.blue_deity_followers -= src + ticker.mode.blue_deity_prophets -= src + ticker.mode.red_deity_followers -= src + + ticker.mode.red_deity_prophets |= src + current << "You are now a prophet of the red cult's god!" + + special_role = "Hand of God: Red Prophet" + . = 1 + if("blue") + //Remove old allegiances + + if(src in ticker.mode.red_deity_followers || src in ticker.mode.red_deity_prophets) + current << "You are no longer a member of the Red cult!" + current.faction -= "red god" + current.faction |= "blue god" + + ticker.mode.red_deity_followers -= src + ticker.mode.red_deity_prophets -= src + ticker.mode.blue_deity_followers -= src + + ticker.mode.blue_deity_prophets |= src + current << "You are now a prophet of the blue cult's god!" + + special_role = "Hand of God: Blue Prophet" + . = 1 + + else + return 0 + + ticker.mode.update_hog_icons_removed(src,"red") + ticker.mode.update_hog_icons_removed(src,"blue") + ticker.mode.greet_hog_follower(src,colour) + ticker.mode.update_hog_icons_added(src, colour) + + +/datum/mind/proc/make_Handofgod_god(colour) + switch(colour) + if("red") + current.become_god("red") + ticker.mode.add_god(src,"red") + if("blue") + current.become_god("blue") + ticker.mode.add_god(src,"blue") + else + return 0 + ticker.mode.forge_deity_objectives(src) + ticker.mode.remove_hog_follower(src,0) + ticker.mode.update_hog_icons_added(src, colour) +// ticker.mode.greet_hog_follower(src,colour) + return 1 + + +/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/spell) + spell_list += spell + if(!spell.action) + spell.action = new/datum/action/spell_action + spell.action.target = spell + spell.action.name = spell.name + spell.action.button_icon = spell.action_icon + spell.action.button_icon_state = spell.action_icon_state + spell.action.background_icon_state = spell.action_background_icon_state + spell.action.Grant(current) + return +/datum/mind/proc/transfer_actions(mob/living/new_character) + if(current && current.actions) + for(var/datum/action/A in current.actions) + A.Grant(new_character) + transfer_mindbound_actions(new_character) + +/datum/mind/proc/transfer_mindbound_actions(var/mob/living/new_character) + for(var/obj/effect/proc_holder/spell/spell in spell_list) + if(!spell.action) // Unlikely but whatever + spell.action = new/datum/action/spell_action + spell.action.target = spell + spell.action.name = spell.name + spell.action.button_icon = spell.action_icon + spell.action.button_icon_state = spell.action_icon_state + spell.action.background_icon_state = spell.action_background_icon_state + spell.action.Grant(new_character) + return + +/mob/proc/sync_mind() + mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) + mind.active = 1 //indicates that the mind is currently synced with a client + +/mob/new_player/sync_mind() + return + +/mob/dead/observer/sync_mind() + return + +//Initialisation procs +/mob/proc/mind_initialize() + if(mind) + mind.key = key + + else + mind = new /datum/mind(key) + if(ticker) + ticker.minds += mind + else + spawn(0) + throw EXCEPTION("mind_initialize(): No ticker ready") + if(!mind.name) mind.name = real_name + mind.current = src + +//HUMAN +/mob/living/carbon/human/mind_initialize() + ..() + if(!mind.assigned_role) mind.assigned_role = "Assistant" //defualt + +//MONKEY +/mob/living/carbon/monkey/mind_initialize() + ..() + +//slime +/mob/living/simple_animal/slime/mind_initialize() + ..() + mind.special_role = "slime" + mind.assigned_role = "slime" + +//XENO +/mob/living/carbon/alien/mind_initialize() + ..() + mind.special_role = "Alien" + mind.assigned_role = "Alien" + //XENO HUMANOID +/mob/living/carbon/alien/humanoid/royal/queen/mind_initialize() + ..() + mind.special_role = "Queen" + +/mob/living/carbon/alien/humanoid/royal/praetorian/mind_initialize() + ..() + mind.special_role = "Praetorian" + +/mob/living/carbon/alien/humanoid/hunter/mind_initialize() + ..() + mind.special_role = "Hunter" + +/mob/living/carbon/alien/humanoid/drone/mind_initialize() + ..() + mind.special_role = "Drone" + +/mob/living/carbon/alien/humanoid/sentinel/mind_initialize() + ..() + mind.special_role = "Sentinel" + //XENO LARVA +/mob/living/carbon/alien/larva/mind_initialize() + ..() + mind.special_role = "Larva" + +//AI +/mob/living/silicon/ai/mind_initialize() + ..() + mind.assigned_role = "AI" + +//BORG +/mob/living/silicon/robot/mind_initialize() + ..() + mind.assigned_role = "Cyborg" + +//PAI +/mob/living/silicon/pai/mind_initialize() + ..() + mind.assigned_role = "pAI" + mind.special_role = "" + +//BLOB +/mob/camera/blob/mind_initialize() + ..() + mind.special_role = "Blob" + +//Animals +/mob/living/simple_animal/mind_initialize() + ..() + mind.assigned_role = "Animal" + mind.special_role = "Animal" + +/mob/living/simple_animal/pet/dog/corgi/mind_initialize() + ..() + mind.assigned_role = "Corgi" + mind.special_role = "Corgi" + +/mob/living/simple_animal/shade/mind_initialize() + ..() + mind.assigned_role = "Shade" + mind.special_role = "Shade" + +/mob/living/simple_animal/hostile/construct/mind_initialize() + ..() + mind.assigned_role = "[initial(name)]" + mind.special_role = "Cultist" + diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index fe0df5ec3a3..5459f47e461 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -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 = "Everything around you seems to shrink.." /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("[owner] suddenly shrinks!") /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("[owner] suddenly grows!") @@ -306,7 +310,8 @@ text_gain_indication = "You feel lightheaded." /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 = "You can't seem to hear anything." /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 = "You can't seem to see anything." /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) diff --git a/code/datums/spells/turf_teleport.dm b/code/datums/spells/turf_teleport.dm index 7010b9bf705..c8ada3a8997 100644 --- a/code/datums/spells/turf_teleport.dm +++ b/code/datums/spells/turf_teleport.dm @@ -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.xworld.maxy-outer_tele_radius || T.yworld.maxx-outer_tele_radius || T.xworld.maxy-outer_tele_radius || T.y 0) - target = pick(possible_targets) - update_explanation_text() - return target - -/datum/objective/proc/find_target_by_role(role, role_type=0, invert=0)//Option sets either to check assigned role or special role. Default to assigned., invert inverts the check, eg: "Don't choose a Ling" - for(var/datum/mind/possible_target in ticker.minds) - if((possible_target != owner) && ishuman(possible_target.current)) - var/is_role = 0 - if(role_type) - if(possible_target.special_role == role) - is_role++ - else - if(possible_target.assigned_role == role) - is_role++ - - if(invert) - if(is_role) - continue - target = possible_target - break - else if(is_role) - target = possible_target - break - - update_explanation_text() - -/datum/objective/proc/update_explanation_text() - //Default does nothing, override where needed - -/datum/objective/proc/give_special_equipment() - -/datum/objective/assassinate - var/target_role_type=0 - dangerrating = 10 - martyr_compatible = 1 - -/datum/objective/assassinate/find_target_by_role(role, role_type=0, invert=0) - if(!invert) - target_role_type = role_type - ..() - return target - -/datum/objective/assassinate/check_completion() - if(target && target.current) - if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite - return 1 - return 0 - return 1 - -/datum/objective/assassinate/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Assassinate [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - - -/datum/objective/mutiny - var/target_role_type=0 - martyr_compatible = 1 - -/datum/objective/mutiny/find_target_by_role(role, role_type=0,invert=0) - if(!invert) - target_role_type = role_type - ..() - return target - -/datum/objective/mutiny/check_completion() - if(target && target.current) - if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client) - return 1 - var/turf/T = get_turf(target.current) - if(T && (T.z > ZLEVEL_STATION) || target.current.client.is_afk()) //If they leave the station or go afk they count as dead for this - return 2 - return 0 - return 1 - -/datum/objective/mutiny/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Assassinate or exile [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - - - -/datum/objective/maroon - var/target_role_type=0 - dangerrating = 5 - martyr_compatible = 1 - -/datum/objective/maroon/find_target_by_role(role, role_type=0, invert=0) - if(!invert) - target_role_type = role_type - ..() - return target - -/datum/objective/maroon/check_completion() - if(target && target.current) - if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite - return 1 - if(target.current.onCentcom() || target.current.onSyndieBase()) - return 0 - return 1 - -/datum/objective/maroon/update_explanation_text() - if(target && target.current) - explanation_text = "Prevent [target.name], the [!target_role_type ? target.assigned_role : target.special_role], from escaping alive." - else - explanation_text = "Free Objective" - - - -/datum/objective/debrain//I want braaaainssss - var/target_role_type=0 - dangerrating = 20 - -/datum/objective/debrain/find_target_by_role(role, role_type=0, invert=0) - if(!invert) - target_role_type = role_type - ..() - return target - -/datum/objective/debrain/check_completion() - if(!target)//If it's a free objective. - return 1 - if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead. - return 0 - if( !target.current || !isbrain(target.current) ) - return 0 - var/atom/A = target.current - while(A.loc) //check to see if the brainmob is on our person - A = A.loc - if(A == owner.current) - return 1 - return 0 - -/datum/objective/debrain/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Steal the brain of [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - - - -/datum/objective/protect//The opposite of killing a dude. - var/target_role_type=0 - dangerrating = 10 - martyr_compatible = 1 - -/datum/objective/protect/find_target_by_role(role, role_type=0, invert=0) - if(!invert) - target_role_type = role_type - ..() - return target - -/datum/objective/protect/check_completion() - if(!target) //If it's a free objective. - return 1 - if(target.current) - if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) - return 0 - return 1 - return 0 - -/datum/objective/protect/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Protect [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - - - -/datum/objective/hijack - explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody." - dangerrating = 25 - martyr_compatible = 0 //Technically you won't get both anyway. - -/datum/objective/hijack/check_completion() - if(!owner.current || owner.current.stat) - return 0 - if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) - return 0 - if(issilicon(owner.current)) - return 0 - - var/area/A = get_area(owner.current) - if(SSshuttle.emergency.areaInstance != A) - return 0 - - for(var/mob/living/player in player_list) - if(player.mind && player.mind != owner) - if(player.stat != DEAD) - if(istype(player, /mob/living/silicon)) //Borgs are technically dead anyways - continue - if(get_area(player) == A) - if(!player.mind.special_role && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) - return 0 - return 1 - -/datum/objective/hijackclone - explanation_text = "Hijack the emergency shuttle by ensuring only you (or your copies) escape." - dangerrating = 25 - martyr_compatible = 0 - -/datum/objective/hijackclone/check_completion() - if(!owner.current) - return 0 - if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) - return 0 - - var/area/A = SSshuttle.emergency.areaInstance - - for(var/mob/living/player in player_list) //Make sure nobody else is onboard - if(player.mind && player.mind != owner) - if(player.stat != DEAD) - if(istype(player, /mob/living/silicon)) - continue - if(get_area(player) == A) - if(player.real_name != owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) - return 0 - - for(var/mob/living/player in player_list) //Make sure at least one of you is onboard - if(player.mind && player.mind != owner) - if(player.stat != DEAD) - if(istype(player, /mob/living/silicon)) - continue - if(get_area(player) == A) - if(player.real_name == owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) - return 1 - return 0 - -/datum/objective/block - explanation_text = "Do not allow any organic lifeforms to escape on the shuttle alive." - dangerrating = 25 - martyr_compatible = 1 - -/datum/objective/block/check_completion() - if(!istype(owner.current, /mob/living/silicon)) - return 0 - if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) - return 1 - - var/area/A = SSshuttle.emergency.areaInstance - - for(var/mob/living/player in player_list) - if(istype(player, /mob/living/silicon)) - continue - if(player.mind) - if(player.stat != DEAD) - if(get_area(player) == A) - return 0 - - return 1 - - -/datum/objective/escape - explanation_text = "Escape on the shuttle or an escape pod alive and without being in custody." - dangerrating = 5 - -/datum/objective/escape/check_completion() - if(issilicon(owner.current)) - return 0 - if(isbrain(owner.current)) - return 0 - if(!owner.current || owner.current.stat == DEAD) - return 0 - if(ticker.force_ending) //This one isn't their fault, so lets just assume good faith - return 1 - if(ticker.mode.station_was_nuked) //If they escaped the blast somehow, let them win - return 1 - if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) - return 0 - var/turf/location = get_turf(owner.current) - if(!location) - return 0 - - if(istype(location, /turf/simulated/floor/plasteel/shuttle/red)) // Fails traitors if they are in the shuttle brig -- Polymorph - return 0 - - if(location.onCentcom() || location.onSyndieBase()) - return 1 - - return 0 - -/datum/objective/escape/escape_with_identity - dangerrating = 10 - var/target_real_name // Has to be stored because the target's real_name can change over the course of the round - var/target_missing_id - -/datum/objective/escape/escape_with_identity/find_target() - target = ..() - update_explanation_text() - -/datum/objective/escape/escape_with_identity/update_explanation_text() - if(target && target.current) - target_real_name = target.current.real_name - explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [target.assigned_role]" - var/mob/living/carbon/human/H - if(ishuman(target.current)) - H = target.current - if(H && H.get_id_name() != target_real_name) - target_missing_id = 1 - else - explanation_text += " while wearing their identification card" - explanation_text += "." //Proper punctuation is important! - - else - explanation_text = "Free Objective." - -/datum/objective/escape/escape_with_identity/check_completion() - if(!target_real_name) - return 1 - if(!ishuman(owner.current)) - return 0 - var/mob/living/carbon/human/H = owner.current - if(..()) - if(H.dna.real_name == target_real_name) - if(H.get_id_name()== target_real_name || target_missing_id) - return 1 - return 0 - - -/datum/objective/survive - explanation_text = "Stay alive until the end." - dangerrating = 3 - -/datum/objective/survive/check_completion() - if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current)) - return 0 //Brains no longer win survive objectives. --NEO - if(!is_special_character(owner.current)) //This fails borg'd traitors - return 0 - return 1 - - -/datum/objective/martyr - explanation_text = "Die a glorious death." - dangerrating = 1 - -/datum/objective/martyr/check_completion() - if(!owner.current) //Gibbed, etc. - return 1 - if(owner.current && owner.current.stat == DEAD) //You're dead! Yay! - return 1 - return 0 - - -/datum/objective/nuclear - explanation_text = "Destroy the station with a nuclear device." - martyr_compatible = 1 - -/datum/objective/nuclear/check_completion() - if(ticker && ticker.mode && ticker.mode.station_was_nuked) - return 1 - return 0 - - -var/global/list/possible_items = list() -/datum/objective/steal - var/datum/objective_item/targetinfo = null //Save the chosen item datum so we can access it later. - var/obj/item/steal_target = null //Needed for custom objectives (they're just items, not datums). - dangerrating = 5 //Overridden by the individual item's difficulty, but defaults to 5 for custom objectives. - martyr_compatible = 0 - -/datum/objective/steal/get_target() - return steal_target - -/datum/objective/steal/New() - ..() - if(!possible_items.len)//Only need to fill the list when it's needed. - init_subtypes(/datum/objective_item/steal,possible_items) - -/datum/objective/steal/find_target() - var/approved_targets = list() - for(var/datum/objective_item/possible_item in possible_items) - if(is_unique_objective(possible_item.targetitem) && !(owner.current.mind.assigned_role in possible_item.excludefromjob)) - approved_targets += possible_item - return set_target(safepick(approved_targets)) - -/datum/objective/steal/proc/set_target(datum/objective_item/item) - if(item) - targetinfo = item - - steal_target = targetinfo.targetitem - explanation_text = "Steal [targetinfo.name]." - dangerrating = targetinfo.difficulty - give_special_equipment() - return steal_target - else - explanation_text = "Free objective" - return - -/datum/objective/steal/proc/select_target() //For admins setting objectives manually. - var/list/possible_items_all = possible_items+"custom" - var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all - if (!new_target) return - - if (new_target == "custom") //Can set custom items. - var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) - if (!custom_target) return - var/tmp_obj = new custom_target - var/custom_name = tmp_obj:name - qdel(tmp_obj) - custom_name = stripped_input("Enter target name:", "Objective target", custom_name) - if (!custom_name) return - steal_target = custom_target - explanation_text = "Steal [custom_name]." - - else - set_target(new_target) - return steal_target - -/datum/objective/steal/check_completion() - if(!steal_target) return 1 - if(!isliving(owner.current)) return 0 - var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. - - for(var/obj/I in all_items) //Check for items - if(istype(I, steal_target)) - if(!targetinfo) //If there's no targetinfo, then that means it was a custom objective. At this point, we know you have the item, so return 1. - return 1 - else if(targetinfo.check_special_completion(I))//Returns 1 by default. Items with special checks will return 1 if the conditions are fulfilled. - return 1 - - if(targetinfo && I.type in targetinfo.altitems) //Ok, so you don't have the item. Do you have an alternative, at least? - if(targetinfo.check_special_completion(I))//Yeah, we do! Don't return 0 if we don't though - then you could fail if you had 1 item that didn't pass and got checked first! - return 1 - return 0 - -/datum/objective/steal/give_special_equipment() - if(owner && owner.current && targetinfo) - if(istype(owner.current, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = owner.current - var/list/slots = list ("backpack" = slot_in_backpack) - for(var/eq_path in targetinfo.special_equipment) - var/obj/O = new eq_path - H.equip_in_one_of_slots(O, slots) - H.update_icons() - -var/global/list/possible_items_special = list() -/datum/objective/steal/special //ninjas are so special they get their own subtype good for them - -/datum/objective/steal/special/New() - ..() - if(!possible_items_special.len) - init_subtypes(/datum/objective_item/special,possible_items) - init_subtypes(/datum/objective_item/stack,possible_items) - -/datum/objective/steal/special/find_target() - return set_target(pick(possible_items_special)) - - - -/datum/objective/steal/exchange - dangerrating = 10 - martyr_compatible = 0 - -/datum/objective/steal/exchange/proc/set_faction(faction,otheragent) - target = otheragent - if(faction == "red") - targetinfo = new/datum/objective_item/unique/docs_blue - else if(faction == "blue") - targetinfo = new/datum/objective_item/unique/docs_red - explanation_text = "Acquire [targetinfo.name] held by [target.current.real_name], the [target.assigned_role] and syndicate agent" - steal_target = targetinfo.targetitem - - -/datum/objective/steal/exchange/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Acquire [targetinfo.name] held by [target.name], the [target.assigned_role] and syndicate agent" - else - explanation_text = "Free Objective" - - -/datum/objective/steal/exchange/backstab - dangerrating = 3 - -/datum/objective/steal/exchange/backstab/set_faction(faction) - if(faction == "red") - targetinfo = new/datum/objective_item/unique/docs_red - else if(faction == "blue") - targetinfo = new/datum/objective_item/unique/docs_blue - explanation_text = "Do not give up or lose [targetinfo.name]." - steal_target = targetinfo.targetitem - - -/datum/objective/download - dangerrating = 10 - -/datum/objective/download/proc/gen_amount_goal() - target_amount = rand(10,20) - explanation_text = "Download [target_amount] research level\s." - return target_amount - -/datum/objective/download/check_completion()//NINJACODE - if(!ishuman(owner.current)) - return 0 - - var/mob/living/carbon/human/H = owner.current - if(!H || H.stat == DEAD) - return 0 - - if(!istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja)) - return 0 - - var/obj/item/clothing/suit/space/space_ninja/SN = H.wear_suit - if(!SN.s_initialized) - return 0 - - var/current_amount - if(!SN.stored_research.len) - return 0 - else - for(var/datum/tech/current_data in SN.stored_research) - if(current_data.level) - current_amount += (current_data.level-1) - if(current_amount= target_amount)) - return 1 - else - return 0 - - - -/datum/objective/destroy - dangerrating = 10 - martyr_compatible = 1 - -/datum/objective/destroy/find_target() - var/list/possible_targets = active_ais(1) - var/mob/living/silicon/ai/target_ai = pick(possible_targets) - target = target_ai.mind - update_explanation_text() - return target - -/datum/objective/destroy/check_completion() - if(target && target.current) - if(target.current.stat == DEAD || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite - return 1 - return 0 - return 1 - -/datum/objective/destroy/update_explanation_text() - ..() - if(target && target.current) - explanation_text = "Destroy [target.name], the experimental AI." - else - explanation_text = "Free Objective" - -/datum/objective/summon_guns - explanation_text = "Steal at least five guns!" - -/datum/objective/summon_guns/check_completion() - if(!isliving(owner.current)) return 0 - var/guncount = 0 - var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. - for(var/obj/I in all_items) //Check for guns - if(istype(I, /obj/item/weapon/gun)) - guncount++ - if(guncount >= 5) - return 1 - else - return 0 - return 0 - - - -//////////////////////////////// -// Changeling team objectives // -//////////////////////////////// - -/datum/objective/changeling_team_objective //Abstract type - martyr_compatible = 0 //Suicide is not teamwork! - explanation_text = "Changeling Friendship!" - var/min_lings = 3 //Minimum amount of lings for this team objective to be possible - var/escape_objective_compatible = FALSE - - -//Impersonate department -//Picks as many people as it can from a department (Security,Engineer,Medical,Science) -//and tasks the lings with killing and replacing them -/datum/objective/changeling_team_objective/impersonate_department - explanation_text = "Ensure X derpartment are killed, impersonated, and replaced by Changelings" - var/command_staff_only = FALSE //if this is true, it picks command staff instead - var/list/department_minds = list() - var/list/department_real_names = list() - var/department_string = "" - - -/datum/objective/changeling_team_objective/impersonate_department/proc/get_department_staff() - department_minds = list() - department_real_names = list() - - var/list/departments = list("Head of Security","Research Director","Chief Engineer","Chief Medical Officer") - var/department_head = pick(departments) - switch(department_head) - if("Head of Security") - department_string = "security" - if("Research Director") - department_string = "science" - if("Chief Engineer") - department_string = "engineering" - if("Chief Medical Officer") - department_string = "medical" - - var/ling_count = ticker.mode.changelings - - for(var/datum/mind/M in ticker.minds) - if(M in ticker.mode.changelings) - continue - if(department_head in get_department_heads(M.assigned_role)) - if(ling_count) - ling_count-- - department_minds += M - department_real_names += M.current.real_name - else - break - - if(!department_minds.len) - log_game("[type] has failed to find department staff, and has removed itself. the round will continue normally") - owner.objectives -= src - qdel(src) - return - - -/datum/objective/changeling_team_objective/impersonate_department/proc/get_heads() - department_minds = list() - department_real_names = list() - - //Needed heads is between min_lings and the maximum possible amount of command roles - //So at the time of writing, rand(3,6), it's also capped by the amount of lings there are - //Because you can't fill 6 head roles with 3 lings - - var/needed_heads = rand(min_lings,command_positions.len) - needed_heads = min(ticker.mode.changelings.len,needed_heads) - - var/list/heads = ticker.mode.get_living_heads() - for(var/datum/mind/head in heads) - if(head in ticker.mode.changelings) //Looking at you HoP. - continue - if(needed_heads) - department_minds += head - department_real_names += head.current.real_name - needed_heads-- - else - break - - if(!department_minds.len) - log_game("[type] has failed to find department heads, and has removed itself. the round will continue normally") - owner.objectives -= src - qdel(src) - return - - -/datum/objective/changeling_team_objective/impersonate_department/New(var/text) - ..() - if(command_staff_only) - get_heads() - else - get_department_staff() - - update_explanation_text() - - -/datum/objective/changeling_team_objective/impersonate_department/update_explanation_text() - ..() - if(!department_real_names.len || !department_minds.len) - explanation_text = "Free Objective" - return //Something fucked up, give them a win - - if(command_staff_only) - explanation_text = "Ensure changelings impersonate and escape as the following heads of staff: " - else - explanation_text = "Ensure changelings impersonate and escape as the following members of \the [department_string] department: " - - var/first = 1 - for(var/datum/mind/M in department_minds) - var/string = "[M.name] the [M.assigned_role]" - if(!first) - string = ", [M.name] the [M.assigned_role]" - else - first-- - explanation_text += string - - if(command_staff_only) - explanation_text += ", while the real heads are dead. This is a team objective." - else - explanation_text += ", while the real members are dead. This is a team objective." - - -/datum/objective/changeling_team_objective/impersonate_department/check_completion() - if(!department_real_names.len || !department_minds.len) - return 1 //Something fucked up, give them a win - - var/list/check_names = department_real_names.Copy() - - //Check each department member's mind to see if any of them made it to centcomm alive, if they did it's an automatic fail - for(var/datum/mind/M in department_minds) - if(M in ticker.mode.changelings) //Lings aren't picked for this, but let's be safe - continue - - if(M.current) - var/turf/mloc = get_turf(M.current) - if(mloc.onCentcom() && (M.current.stat != DEAD)) - return 0 //A Non-ling living target got to centcomm, fail - - //Check each staff member has been replaced, by cross referencing changeling minds, changeling current dna, the staff minds and their original DNA names - var/success = 0 - changelings: - for(var/datum/mind/changeling in ticker.mode.changelings) - if(success >= department_minds.len) //We did it, stop here! - return 1 - if(ishuman(changeling.current)) - var/mob/living/carbon/human/H = changeling.current - var/turf/cloc = get_turf(changeling.current) - if(cloc && cloc.onCentcom() && (changeling.current.stat != DEAD)) //Living changeling on centcomm.... - for(var/name in check_names) //Is he (disguised as) one of the staff? - if(H.dna.real_name == name) - check_names -= name //This staff member is accounted for, remove them, so the team don't succeed by escape as 7 of the same engineer - success++ //A living changeling staff member made it to centcomm - continue changelings - - if(success >= department_minds.len) - return 1 - return 0 - - - - -//A subtype of impersonate_derpartment -//This subtype always picks as many command staff as it can (HoS,HoP,Cap,CE,CMO,RD) -//and tasks the lings with killing and replacing them -/datum/objective/changeling_team_objective/impersonate_department/impersonate_heads - explanation_text = "Have X or more heads of staff escape on the shuttle disguised as heads, while the real heads are dead" - command_staff_only = TRUE - - - +/datum/objective + var/datum/mind/owner = null //Who owns the objective. + var/explanation_text = "Nothing" //What that person is supposed to do. + var/datum/mind/target = null //If they are focused on a particular person. + var/target_amount = 0 //If they are focused on a particular number. Steal objectives have their own counter. + var/completed = 0 //currently only used for custom objectives. + var/dangerrating = 0 //How hard the objective is, essentially. Used for dishing out objectives and checking overall victory. + var/martyr_compatible = 0 //If the objective is compatible with martyr objective, i.e. if you can still do it while dead. + +/datum/objective/New(var/text) + if(text) + explanation_text = text + +/datum/objective/proc/check_completion() + return completed + +/datum/objective/proc/is_unique_objective(possible_target) + for(var/datum/objective/O in owner.objectives) + if(istype(O, type) && O.get_target() == possible_target) + return 0 + return 1 + +/datum/objective/proc/get_target() + return target + +/datum/objective/proc/find_target() + var/list/possible_targets = list() + for(var/datum/mind/possible_target in ticker.minds) + if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2) && is_unique_objective(possible_target)) + possible_targets += possible_target + if(possible_targets.len > 0) + target = pick(possible_targets) + update_explanation_text() + return target + +/datum/objective/proc/find_target_by_role(role, role_type=0, invert=0)//Option sets either to check assigned role or special role. Default to assigned., invert inverts the check, eg: "Don't choose a Ling" + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && ishuman(possible_target.current)) + var/is_role = 0 + if(role_type) + if(possible_target.special_role == role) + is_role++ + else + if(possible_target.assigned_role == role) + is_role++ + + if(invert) + if(is_role) + continue + target = possible_target + break + else if(is_role) + target = possible_target + break + + update_explanation_text() + +/datum/objective/proc/update_explanation_text() + //Default does nothing, override where needed + +/datum/objective/proc/give_special_equipment() + +/datum/objective/assassinate + var/target_role_type=0 + dangerrating = 10 + martyr_compatible = 1 + +/datum/objective/assassinate/find_target_by_role(role, role_type=0, invert=0) + if(!invert) + target_role_type = role_type + ..() + return target + +/datum/objective/assassinate/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite + return 1 + return 0 + return 1 + +/datum/objective/assassinate/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Assassinate [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + + +/datum/objective/mutiny + var/target_role_type=0 + martyr_compatible = 1 + +/datum/objective/mutiny/find_target_by_role(role, role_type=0,invert=0) + if(!invert) + target_role_type = role_type + ..() + return target + +/datum/objective/mutiny/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client) + return 1 + var/turf/T = get_turf(target.current) + if(T && (T.z > ZLEVEL_STATION) || target.current.client.is_afk()) //If they leave the station or go afk they count as dead for this + return 2 + return 0 + return 1 + +/datum/objective/mutiny/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Assassinate or exile [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + + + +/datum/objective/maroon + var/target_role_type=0 + dangerrating = 5 + martyr_compatible = 1 + +/datum/objective/maroon/find_target_by_role(role, role_type=0, invert=0) + if(!invert) + target_role_type = role_type + ..() + return target + +/datum/objective/maroon/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite + return 1 + if(target.current.onCentcom() || target.current.onSyndieBase()) + return 0 + return 1 + +/datum/objective/maroon/update_explanation_text() + if(target && target.current) + explanation_text = "Prevent [target.name], the [!target_role_type ? target.assigned_role : target.special_role], from escaping alive." + else + explanation_text = "Free Objective" + + + +/datum/objective/debrain//I want braaaainssss + var/target_role_type=0 + dangerrating = 20 + +/datum/objective/debrain/find_target_by_role(role, role_type=0, invert=0) + if(!invert) + target_role_type = role_type + ..() + return target + +/datum/objective/debrain/check_completion() + if(!target)//If it's a free objective. + return 1 + if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead. + return 0 + if( !target.current || !isbrain(target.current) ) + return 0 + var/atom/A = target.current + while(A.loc) //check to see if the brainmob is on our person + A = A.loc + if(A == owner.current) + return 1 + return 0 + +/datum/objective/debrain/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Steal the brain of [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + + + +/datum/objective/protect//The opposite of killing a dude. + var/target_role_type=0 + dangerrating = 10 + martyr_compatible = 1 + +/datum/objective/protect/find_target_by_role(role, role_type=0, invert=0) + if(!invert) + target_role_type = role_type + ..() + return target + +/datum/objective/protect/check_completion() + if(!target) //If it's a free objective. + return 1 + if(target.current) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) + return 0 + return 1 + return 0 + +/datum/objective/protect/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Protect [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + + + +/datum/objective/hijack + explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody." + dangerrating = 25 + martyr_compatible = 0 //Technically you won't get both anyway. + +/datum/objective/hijack/check_completion() + if(!owner.current || owner.current.stat) + return 0 + if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) + return 0 + if(issilicon(owner.current)) + return 0 + + var/area/A = get_area(owner.current) + if(SSshuttle.emergency.areaInstance != A) + return 0 + + for(var/mob/living/player in player_list) + if(player.mind && player.mind != owner) + if(player.stat != DEAD) + if(istype(player, /mob/living/silicon)) //Borgs are technically dead anyways + continue + if(get_area(player) == A) + if(!player.mind.special_role && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) + return 0 + return 1 + +/datum/objective/hijackclone + explanation_text = "Hijack the emergency shuttle by ensuring only you (or your copies) escape." + dangerrating = 25 + martyr_compatible = 0 + +/datum/objective/hijackclone/check_completion() + if(!owner.current) + return 0 + if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) + return 0 + + var/area/A = SSshuttle.emergency.areaInstance + + for(var/mob/living/player in player_list) //Make sure nobody else is onboard + if(player.mind && player.mind != owner) + if(player.stat != DEAD) + if(istype(player, /mob/living/silicon)) + continue + if(get_area(player) == A) + if(player.real_name != owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) + return 0 + + for(var/mob/living/player in player_list) //Make sure at least one of you is onboard + if(player.mind && player.mind != owner) + if(player.stat != DEAD) + if(istype(player, /mob/living/silicon)) + continue + if(get_area(player) == A) + if(player.real_name == owner.current.real_name && !istype(get_turf(player.mind.current), /turf/simulated/floor/plasteel/shuttle/red)) + return 1 + return 0 + +/datum/objective/block + explanation_text = "Do not allow any organic lifeforms to escape on the shuttle alive." + dangerrating = 25 + martyr_compatible = 1 + +/datum/objective/block/check_completion() + if(!istype(owner.current, /mob/living/silicon)) + return 0 + if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) + return 1 + + var/area/A = SSshuttle.emergency.areaInstance + + for(var/mob/living/player in player_list) + if(istype(player, /mob/living/silicon)) + continue + if(player.mind) + if(player.stat != DEAD) + if(get_area(player) == A) + return 0 + + return 1 + + +/datum/objective/escape + explanation_text = "Escape on the shuttle or an escape pod alive and without being in custody." + dangerrating = 5 + +/datum/objective/escape/check_completion() + if(issilicon(owner.current)) + return 0 + if(isbrain(owner.current)) + return 0 + if(!owner.current || owner.current.stat == DEAD) + return 0 + if(ticker.force_ending) //This one isn't their fault, so lets just assume good faith + return 1 + if(ticker.mode.station_was_nuked) //If they escaped the blast somehow, let them win + return 1 + if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) + return 0 + var/turf/location = get_turf(owner.current) + if(!location) + return 0 + + if(istype(location, /turf/simulated/floor/plasteel/shuttle/red)) // Fails traitors if they are in the shuttle brig -- Polymorph + return 0 + + if(location.onCentcom() || location.onSyndieBase()) + return 1 + + return 0 + +/datum/objective/escape/escape_with_identity + dangerrating = 10 + var/target_real_name // Has to be stored because the target's real_name can change over the course of the round + var/target_missing_id + +/datum/objective/escape/escape_with_identity/find_target() + target = ..() + update_explanation_text() + +/datum/objective/escape/escape_with_identity/update_explanation_text() + if(target && target.current) + target_real_name = target.current.real_name + explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [target.assigned_role]" + var/mob/living/carbon/human/H + if(ishuman(target.current)) + H = target.current + if(H && H.get_id_name() != target_real_name) + target_missing_id = 1 + else + explanation_text += " while wearing their identification card" + explanation_text += "." //Proper punctuation is important! + + else + explanation_text = "Free Objective." + +/datum/objective/escape/escape_with_identity/check_completion() + if(!target_real_name) + return 1 + if(!ishuman(owner.current)) + return 0 + var/mob/living/carbon/human/H = owner.current + if(..()) + if(H.dna.real_name == target_real_name) + if(H.get_id_name()== target_real_name || target_missing_id) + return 1 + return 0 + + +/datum/objective/survive + explanation_text = "Stay alive until the end." + dangerrating = 3 + +/datum/objective/survive/check_completion() + if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current)) + return 0 //Brains no longer win survive objectives. --NEO + if(!is_special_character(owner.current)) //This fails borg'd traitors + return 0 + return 1 + + +/datum/objective/martyr + explanation_text = "Die a glorious death." + dangerrating = 1 + +/datum/objective/martyr/check_completion() + if(!owner.current) //Gibbed, etc. + return 1 + if(owner.current && owner.current.stat == DEAD) //You're dead! Yay! + return 1 + return 0 + + +/datum/objective/nuclear + explanation_text = "Destroy the station with a nuclear device." + martyr_compatible = 1 + +/datum/objective/nuclear/check_completion() + if(ticker && ticker.mode && ticker.mode.station_was_nuked) + return 1 + return 0 + + +var/global/list/possible_items = list() +/datum/objective/steal + var/datum/objective_item/targetinfo = null //Save the chosen item datum so we can access it later. + var/obj/item/steal_target = null //Needed for custom objectives (they're just items, not datums). + dangerrating = 5 //Overridden by the individual item's difficulty, but defaults to 5 for custom objectives. + martyr_compatible = 0 + +/datum/objective/steal/get_target() + return steal_target + +/datum/objective/steal/New() + ..() + if(!possible_items.len)//Only need to fill the list when it's needed. + init_subtypes(/datum/objective_item/steal,possible_items) + +/datum/objective/steal/find_target() + var/approved_targets = list() + for(var/datum/objective_item/possible_item in possible_items) + if(is_unique_objective(possible_item.targetitem) && !(owner.current.mind.assigned_role in possible_item.excludefromjob)) + approved_targets += possible_item + return set_target(safepick(approved_targets)) + +/datum/objective/steal/proc/set_target(datum/objective_item/item) + if(item) + targetinfo = item + + steal_target = targetinfo.targetitem + explanation_text = "Steal [targetinfo.name]." + dangerrating = targetinfo.difficulty + give_special_equipment() + return steal_target + else + explanation_text = "Free objective" + return + +/datum/objective/steal/proc/select_target() //For admins setting objectives manually. + var/list/possible_items_all = possible_items+"custom" + var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all + if (!new_target) return + + if (new_target == "custom") //Can set custom items. + var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) + if (!custom_target) return + var/tmp_obj = new custom_target + var/custom_name = tmp_obj:name + qdel(tmp_obj) + custom_name = stripped_input("Enter target name:", "Objective target", custom_name) + if (!custom_name) return + steal_target = custom_target + explanation_text = "Steal [custom_name]." + + else + set_target(new_target) + return steal_target + +/datum/objective/steal/check_completion() + if(!steal_target) + return 1 + if(!isliving(owner.current)) + return 0 + var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. + + for(var/obj/I in all_items) //Check for items + if(istype(I, steal_target)) + if(!targetinfo) //If there's no targetinfo, then that means it was a custom objective. At this point, we know you have the item, so return 1. + return 1 + else if(targetinfo.check_special_completion(I))//Returns 1 by default. Items with special checks will return 1 if the conditions are fulfilled. + return 1 + + if(targetinfo && I.type in targetinfo.altitems) //Ok, so you don't have the item. Do you have an alternative, at least? + if(targetinfo.check_special_completion(I))//Yeah, we do! Don't return 0 if we don't though - then you could fail if you had 1 item that didn't pass and got checked first! + return 1 + return 0 + +/datum/objective/steal/give_special_equipment() + if(owner && owner.current && targetinfo) + if(istype(owner.current, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = owner.current + var/list/slots = list ("backpack" = slot_in_backpack) + for(var/eq_path in targetinfo.special_equipment) + var/obj/O = new eq_path + H.equip_in_one_of_slots(O, slots) + H.update_icons() + +var/global/list/possible_items_special = list() +/datum/objective/steal/special //ninjas are so special they get their own subtype good for them + +/datum/objective/steal/special/New() + ..() + if(!possible_items_special.len) + init_subtypes(/datum/objective_item/special,possible_items) + init_subtypes(/datum/objective_item/stack,possible_items) + +/datum/objective/steal/special/find_target() + return set_target(pick(possible_items_special)) + + + +/datum/objective/steal/exchange + dangerrating = 10 + martyr_compatible = 0 + +/datum/objective/steal/exchange/proc/set_faction(faction,otheragent) + target = otheragent + if(faction == "red") + targetinfo = new/datum/objective_item/unique/docs_blue + else if(faction == "blue") + targetinfo = new/datum/objective_item/unique/docs_red + explanation_text = "Acquire [targetinfo.name] held by [target.current.real_name], the [target.assigned_role] and syndicate agent" + steal_target = targetinfo.targetitem + + +/datum/objective/steal/exchange/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Acquire [targetinfo.name] held by [target.name], the [target.assigned_role] and syndicate agent" + else + explanation_text = "Free Objective" + + +/datum/objective/steal/exchange/backstab + dangerrating = 3 + +/datum/objective/steal/exchange/backstab/set_faction(faction) + if(faction == "red") + targetinfo = new/datum/objective_item/unique/docs_red + else if(faction == "blue") + targetinfo = new/datum/objective_item/unique/docs_blue + explanation_text = "Do not give up or lose [targetinfo.name]." + steal_target = targetinfo.targetitem + + +/datum/objective/download + dangerrating = 10 + +/datum/objective/download/proc/gen_amount_goal() + target_amount = rand(10,20) + explanation_text = "Download [target_amount] research level\s." + return target_amount + +/datum/objective/download/check_completion()//NINJACODE + if(!ishuman(owner.current)) + return 0 + + var/mob/living/carbon/human/H = owner.current + if(!H || H.stat == DEAD) + return 0 + + if(!istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja)) + return 0 + + var/obj/item/clothing/suit/space/space_ninja/SN = H.wear_suit + if(!SN.s_initialized) + return 0 + + var/current_amount + if(!SN.stored_research.len) + return 0 + else + for(var/datum/tech/current_data in SN.stored_research) + if(current_data.level) + current_amount += (current_data.level-1) + if(current_amount= target_amount)) + return 1 + else + return 0 + + + +/datum/objective/destroy + dangerrating = 10 + martyr_compatible = 1 + +/datum/objective/destroy/find_target() + var/list/possible_targets = active_ais(1) + var/mob/living/silicon/ai/target_ai = pick(possible_targets) + target = target_ai.mind + update_explanation_text() + return target + +/datum/objective/destroy/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite + return 1 + return 0 + return 1 + +/datum/objective/destroy/update_explanation_text() + ..() + if(target && target.current) + explanation_text = "Destroy [target.name], the experimental AI." + else + explanation_text = "Free Objective" + +/datum/objective/summon_guns + explanation_text = "Steal at least five guns!" + +/datum/objective/summon_guns/check_completion() + if(!isliving(owner.current)) + return 0 + var/guncount = 0 + var/list/all_items = owner.current.GetAllContents() //this should get things in cheesewheels, books, etc. + for(var/obj/I in all_items) //Check for guns + if(istype(I, /obj/item/weapon/gun)) + guncount++ + if(guncount >= 5) + return 1 + else + return 0 + return 0 + + + +//////////////////////////////// +// Changeling team objectives // +//////////////////////////////// + +/datum/objective/changeling_team_objective //Abstract type + martyr_compatible = 0 //Suicide is not teamwork! + explanation_text = "Changeling Friendship!" + var/min_lings = 3 //Minimum amount of lings for this team objective to be possible + var/escape_objective_compatible = FALSE + + +//Impersonate department +//Picks as many people as it can from a department (Security,Engineer,Medical,Science) +//and tasks the lings with killing and replacing them +/datum/objective/changeling_team_objective/impersonate_department + explanation_text = "Ensure X derpartment are killed, impersonated, and replaced by Changelings" + var/command_staff_only = FALSE //if this is true, it picks command staff instead + var/list/department_minds = list() + var/list/department_real_names = list() + var/department_string = "" + + +/datum/objective/changeling_team_objective/impersonate_department/proc/get_department_staff() + department_minds = list() + department_real_names = list() + + var/list/departments = list("Head of Security","Research Director","Chief Engineer","Chief Medical Officer") + var/department_head = pick(departments) + switch(department_head) + if("Head of Security") + department_string = "security" + if("Research Director") + department_string = "science" + if("Chief Engineer") + department_string = "engineering" + if("Chief Medical Officer") + department_string = "medical" + + var/ling_count = ticker.mode.changelings + + for(var/datum/mind/M in ticker.minds) + if(M in ticker.mode.changelings) + continue + if(department_head in get_department_heads(M.assigned_role)) + if(ling_count) + ling_count-- + department_minds += M + department_real_names += M.current.real_name + else + break + + if(!department_minds.len) + log_game("[type] has failed to find department staff, and has removed itself. the round will continue normally") + owner.objectives -= src + qdel(src) + return + + +/datum/objective/changeling_team_objective/impersonate_department/proc/get_heads() + department_minds = list() + department_real_names = list() + + //Needed heads is between min_lings and the maximum possible amount of command roles + //So at the time of writing, rand(3,6), it's also capped by the amount of lings there are + //Because you can't fill 6 head roles with 3 lings + + var/needed_heads = rand(min_lings,command_positions.len) + needed_heads = min(ticker.mode.changelings.len,needed_heads) + + var/list/heads = ticker.mode.get_living_heads() + for(var/datum/mind/head in heads) + if(head in ticker.mode.changelings) //Looking at you HoP. + continue + if(needed_heads) + department_minds += head + department_real_names += head.current.real_name + needed_heads-- + else + break + + if(!department_minds.len) + log_game("[type] has failed to find department heads, and has removed itself. the round will continue normally") + owner.objectives -= src + qdel(src) + return + + +/datum/objective/changeling_team_objective/impersonate_department/New(var/text) + ..() + if(command_staff_only) + get_heads() + else + get_department_staff() + + update_explanation_text() + + +/datum/objective/changeling_team_objective/impersonate_department/update_explanation_text() + ..() + if(!department_real_names.len || !department_minds.len) + explanation_text = "Free Objective" + return //Something fucked up, give them a win + + if(command_staff_only) + explanation_text = "Ensure changelings impersonate and escape as the following heads of staff: " + else + explanation_text = "Ensure changelings impersonate and escape as the following members of \the [department_string] department: " + + var/first = 1 + for(var/datum/mind/M in department_minds) + var/string = "[M.name] the [M.assigned_role]" + if(!first) + string = ", [M.name] the [M.assigned_role]" + else + first-- + explanation_text += string + + if(command_staff_only) + explanation_text += ", while the real heads are dead. This is a team objective." + else + explanation_text += ", while the real members are dead. This is a team objective." + + +/datum/objective/changeling_team_objective/impersonate_department/check_completion() + if(!department_real_names.len || !department_minds.len) + return 1 //Something fucked up, give them a win + + var/list/check_names = department_real_names.Copy() + + //Check each department member's mind to see if any of them made it to centcomm alive, if they did it's an automatic fail + for(var/datum/mind/M in department_minds) + if(M in ticker.mode.changelings) //Lings aren't picked for this, but let's be safe + continue + + if(M.current) + var/turf/mloc = get_turf(M.current) + if(mloc.onCentcom() && (M.current.stat != DEAD)) + return 0 //A Non-ling living target got to centcomm, fail + + //Check each staff member has been replaced, by cross referencing changeling minds, changeling current dna, the staff minds and their original DNA names + var/success = 0 + changelings: + for(var/datum/mind/changeling in ticker.mode.changelings) + if(success >= department_minds.len) //We did it, stop here! + return 1 + if(ishuman(changeling.current)) + var/mob/living/carbon/human/H = changeling.current + var/turf/cloc = get_turf(changeling.current) + if(cloc && cloc.onCentcom() && (changeling.current.stat != DEAD)) //Living changeling on centcomm.... + for(var/name in check_names) //Is he (disguised as) one of the staff? + if(H.dna.real_name == name) + check_names -= name //This staff member is accounted for, remove them, so the team don't succeed by escape as 7 of the same engineer + success++ //A living changeling staff member made it to centcomm + continue changelings + + if(success >= department_minds.len) + return 1 + return 0 + + + + +//A subtype of impersonate_derpartment +//This subtype always picks as many command staff as it can (HoS,HoP,Cap,CE,CMO,RD) +//and tasks the lings with killing and replacing them +/datum/objective/changeling_team_objective/impersonate_department/impersonate_heads + explanation_text = "Have X or more heads of staff escape on the shuttle disguised as heads, while the real heads are dead" + command_staff_only = TRUE + + + diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index 46addfb7f6d..1015f72b1c5 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -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. diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 5258dc5f166..92a623c69f7 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -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 diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm index 15d9cd2cb2e..c234b05fbd3 100644 --- a/code/game/jobs/job/silicon.dm +++ b/code/game/jobs/job/silicon.dm @@ -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() diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 244e26739a3..c0d5db24fec 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -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) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index a7657017611..04d16507522 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -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 diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 4160d45eb8a..d976f97f7fd 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -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)) diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index e3ead355f11..c887b428be7 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -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 += "Conscious" - if(UNCONSCIOUS) occupant_status += "Unconscious" - else occupant_status += "DEAD" + if(CONSCIOUS) + occupant_status += "Conscious" + if(UNCONSCIOUS) + occupant_status += "Unconscious" + else + occupant_status += "DEAD" occupant_status += "" occupant_status += "
Health:
[viable_occupant.health] %
" occupant_status += "
Radiation Level:
[viable_occupant.radiation] %
" @@ -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 += "
Pulse Duration:
[radduration]
" status += "
  \> Accuracy:
[chance_to_hit]
" status += "
" // Close statusDisplay div @@ -147,13 +154,20 @@ buttons += "[connected.locked ? "Unlock" : "Lock"] Scanner " else buttons += "[connected.locked ? "Unlock" : "Lock"] Scanner " - else buttons += "Open Scanner Lock Scanner " - if(viable_occupant) buttons += "Inject Rejuvenators " - else buttons += "Inject Rejuvenators " - if(diskette) buttons += "Eject Disk " - else buttons += "Eject Disk " - if(current_screen == "buffer") buttons += "Radiation Emitter Menu " - else buttons += "Buffer Menu " + else + buttons += "Open Scanner Lock Scanner " + if(viable_occupant) + buttons += "Inject Rejuvenators " + else + buttons += "Inject Rejuvenators " + if(diskette) + buttons += "Eject Disk " + else + buttons += "Eject Disk " + if(current_screen == "buffer") + buttons += "Radiation Emitter Menu " + else + buttons += "Buffer Menu " 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 += "
\tNo Data" - if(viable_occupant) temp_html += "
Save to Buffer " - else temp_html += "
Save to Buffer " + if(viable_occupant) + temp_html += "
Save to Buffer " + else + temp_html += "
Save to Buffer " temp_html += "Clear Buffer " - if(diskette) temp_html += "Load from Disk " - else temp_html += "Load from Disk " + if(diskette) + temp_html += "Load from Disk " + else + temp_html += "Load from Disk " temp_html += "Save to Disk " else var/ui = buffer_slot["UI"] @@ -189,46 +207,68 @@ if(ue && name && blood_type) temp_html += "
\tBlood Type: [blood_type]" temp_html += "
\tUE: [ue] " - if(viable_occupant) temp_html += "Occupant " - else temp_html += "Occupant" + if(viable_occupant) + temp_html += "Occupant " + else + temp_html += "Occupant" temp_html += "Occupant:Delayed " - if(injectorready) temp_html += "Injector" - else temp_html += "Injector" + if(injectorready) + temp_html += "Injector" + else + temp_html += "Injector" else temp_html += "
\tBlood Type: No Data" temp_html += "
\tUE: No Data" if(ui) temp_html += "
\tUI: [ui] " - if(viable_occupant) temp_html += "Occupant " - else temp_html += "Occupant" + if(viable_occupant) + temp_html += "Occupant " + else + temp_html += "Occupant" temp_html += "Occupant:Delayed " - if(injectorready) temp_html += "Injector" - else temp_html += "Injector" + if(injectorready) + temp_html += "Injector" + else + temp_html += "Injector" else temp_html += "
\tUI: No Data" if(ue && name && blood_type && ui) temp_html += "
\tUI+UE: [ui]/[ue] " - if(viable_occupant) temp_html += "Occupant " - else temp_html += "Occupant" + if(viable_occupant) + temp_html += "Occupant " + else + temp_html += "Occupant" temp_html += "Occupant:Delayed " - if(injectorready) temp_html += "UI+UE Injector" - else temp_html += "UI+UE Injector" + if(injectorready) + temp_html += "UI+UE Injector" + else + temp_html += "UI+UE Injector" if(se) temp_html += "
\tSE: [se] " - if(viable_occupant) temp_html += "Occupant " - else temp_html += "Occupant " + if(viable_occupant) + temp_html += "Occupant " + else + temp_html += "Occupant " temp_html += "Occupant:Delayed " - if(injectorready) temp_html += "Injector" - else temp_html += "Injector" + if(injectorready) + temp_html += "Injector" + else + temp_html += "Injector" else temp_html += "
\tSE: No Data" - if(viable_occupant) temp_html += "
Save to Buffer " - else temp_html += "
Save to Buffer " + if(viable_occupant) + temp_html += "
Save to Buffer " + else + temp_html += "
Save to Buffer " temp_html += "Clear Buffer " - if(diskette) temp_html += "Load from Disk " - else temp_html += "Load from Disk " - if(diskette && !diskette.read_only) temp_html += "Save to Disk " - else temp_html += "Save to Disk " + if(diskette) + temp_html += "Load from Disk " + else + temp_html += "Load from Disk " + if(diskette && !diskette.read_only) + temp_html += "Save to Disk " + else + temp_html += "Save to Disk " 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 diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 553c7925e50..2f9bfbbe42d 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -171,7 +171,8 @@ dat += "
Medical Robots:" 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] - \[[bl.x],[bl.y]\] - [M.on ? "Online" : "Offline"]
" diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 0b9d41b2d9f..342c689ce8a 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -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 += "((1))" dat += "((5))" @@ -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)) diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index e4ed47bcd46..10c1af8d7a6 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -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) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c0d7060f6bd..7b57aae3915 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -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' diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 426063cfbea..77c1f3419c8 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -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) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 8a8989a0bc5..5f1322f6a32 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -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()) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 9e23c4b60c3..20bb77598d3 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -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("[user] starts undoing [src]'s bolts...", \ "You start unfastening [src]'s floor bolts...") - 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("[user] unfastens [src]'s bolts.", \ "You undo [src]'s floor bolts.") @@ -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 diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm index e57408e06f5..f93ffc94453 100644 --- a/code/game/machinery/doors/unpowered.dm +++ b/code/game/machinery/doors/unpowered.dm @@ -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 diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 1d5630e2fc9..51cdae2c6e1 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -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 diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index d848eab6e40..54bd13d35dc 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -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 diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index 5d8f4bdef13..0efe14fee0d 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -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]") diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 340282cdeb6..f367cb641b5 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -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 diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 533caff5692..7320d68cb7c 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -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 diff --git a/code/game/machinery/telecomms/machines/receiver.dm b/code/game/machinery/telecomms/machines/receiver.dm index 071828fced2..b1dc2b53c92 100644 --- a/code/game/machinery/telecomms/machines/receiver.dm +++ b/code/game/machinery/telecomms/machines/receiver.dm @@ -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 + ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 35ba2c53edf..86d8993b928 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -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]])" diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index 5166299aedb..b582c9b95cd 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -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)) diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm index 673d7b6f9a8..30a5e77f01b 100644 --- a/code/game/objects/effects/contraband.dm +++ b/code/game/objects/effects/contraband.dm @@ -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 << "You place the poster!" diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index e1a4efa2a72..524e04393a4 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -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) diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index 8fad18c31cc..1e84a7556d8 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -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 diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index aea78b91bd8..3f284a0481a 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -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 += "
  • [P]" if (istype(cartridge, /obj/item/weapon/cartridge/syndicate) && P.detonate) dat += " (*Detonate*)" @@ -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 diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index b075905dd01..3c372f71657 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -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 \ No newline at end of file +//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 \ No newline at end of file diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 01c200df8ca..1b659cb1b0f 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -101,7 +101,8 @@ user << "You need one sheet of metal to start building ED-209!" 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 << "You need to attach a cell to it first!" 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 diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 8f3d63b0e57..84ca2c03081 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -64,7 +64,8 @@ else if(user.gender == FEMALE) t_himself = "herself" user.visible_message("[user] starts to apply [src] on [t_himself]...", "You begin applying [src] on yourself...") - if(!do_mob(user, M, self_delay)) return + if(!do_mob(user, M, self_delay)) + return user.visible_message("[user] applies [src] on [t_himself].", "You apply [src] on yourself.") diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index b2db790d174..4587104e2d1 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -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 << "You don't have the dexterity to do this!" 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 << "You need more glass to do that!" 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 << "You don't have the dexterity to do this!" 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 << "You need more glass to do that!" 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)) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index c1c8fef41a7..2bdeba77802 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -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 diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index bf20298a6ae..d76a517b5ee 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -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 ..() diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm index 18a49025893..b6bedcfa6a6 100644 --- a/code/game/objects/items/weapons/RPD.dm +++ b/code/game/objects/items/weapons/RPD.dm @@ -183,7 +183,8 @@ var/global/list/RPD_recipes=list( return "" /obj/item/weapon/pipe_dispenser/proc/show_menu(mob/user) - if(!user || !src) return 0 + if(!user || !src) + return 0 var/dat = {"

    Type

    Utilities:
      "} diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 7ff548f6db8..8b43d98082e 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -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" diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 2fe704d5760..d23426e15dc 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -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 diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index 430d2a17a9d..30c54497b12 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -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" diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 047aa449f2c..81e013d1dc9 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -69,7 +69,8 @@ if(target != user) target.visible_message("[user] is trying to inject [target] with [src]!", "[user] is trying to inject [target] with [src]!") - if(!do_mob(user, target)) return + if(!do_mob(user, target)) + return target.visible_message("[user] injects [target] with the syringe with [src]!", \ "[user] injects [target] with the syringe with [src]!") diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 44f29a96e7a..fffd768233c 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -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 << "Attach a plasma tank first!" @@ -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) diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 1d6ede4dc3e..41809963e96 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -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) diff --git a/code/game/objects/items/weapons/implants/implant_chem.dm b/code/game/objects/items/weapons/implants/implant_chem.dm index e5f89008ade..56c184f052d 100644 --- a/code/game/objects/items/weapons/implants/implant_chem.dm +++ b/code/game/objects/items/weapons/implants/implant_chem.dm @@ -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") diff --git a/code/game/objects/items/weapons/implants/implant_explosive.dm b/code/game/objects/items/weapons/implants/implant_explosive.dm index 1422eae75aa..60884ea93f0 100644 --- a/code/game/objects/items/weapons/implants/implant_explosive.dm +++ b/code/game/objects/items/weapons/implants/implant_explosive.dm @@ -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 << "You activate your macrobomb implant." diff --git a/code/game/objects/items/weapons/implants/implant_freedom.dm b/code/game/objects/items/weapons/implants/implant_freedom.dm index e3e70e982a2..106615e78e2 100644 --- a/code/game/objects/items/weapons/implants/implant_freedom.dm +++ b/code/game/objects/items/weapons/implants/implant_freedom.dm @@ -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 diff --git a/code/game/objects/items/weapons/implants/implant_misc.dm b/code/game/objects/items/weapons/implants/implant_misc.dm index 7f7276d380c..e32c94b128f 100644 --- a/code/game/objects/items/weapons/implants/implant_misc.dm +++ b/code/game/objects/items/weapons/implants/implant_misc.dm @@ -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 << "You feel a sudden surge of energy!" 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) diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 891ab95aa35..75c4291c158 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -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("[M] has been implanted by the [src.name].") diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 0bb3f2f7235..5ec85b1f17c 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -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("\The [T] smacks into \the [src] and rapidly flashes to ash.",\ "You hear a loud crack as you are washed with a wave of heat.") diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index a80a611d619..38c5d72b334 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -52,7 +52,8 @@ else user.show_message("Unable to reset internal memory.", 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. diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index b40c8e881b2..ea8a135b4c0 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -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 diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index 0bc932047d5..9a4bdd9183f 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -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) diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm index 52a6bfac865..eea4519a819 100644 --- a/code/game/objects/items/weapons/tanks/watertank.dm +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -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 diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 2406d7b9d7b..6d2303a0483 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -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) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index f878422481f..b68d849e98a 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -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("[user] starts to fix some of the dents on [H]'s [affecting.getDisplayName()].", "You start fixing some of the dents on [H]'s [affecting.getDisplayName()].") - if(!do_mob(user, H, 50)) return + if(!do_mob(user, H, 50)) + return item_heal_robotic(H, user, 5, 0) return else diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 4b7309cd5bc..ce535fbd7e6 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -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 << "It's too heavy for you to wield fully." 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) ..() diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 7fbc76d9413..e4a853362e8 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -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) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index 7f9a39b89b3..aa5e743cbc2 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -42,7 +42,8 @@ if(src.broken) user << "It appears to be broken." return - if(!I || !I.registered_name) return + if(!I || !I.registered_name) + return if(src.allowed(user) || !src.registered_name || (istype(I) && (src.registered_name == I.registered_name))) //they can open all lockers, or nobody owns this, or they own this locker src.locked = !( src.locked ) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 90c267d2a2a..e700e03c8cd 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -91,7 +91,7 @@ for(var/i in 1 to 4) new /obj/item/clothing/suit/radiation(src) new /obj/item/clothing/head/radiation(src) - + /obj/structure/closet/crate/hydroponics name = "hydroponics crate" desc = "All you need to destroy those pesky weeds and pests." diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 293f881747f..3dfd2e7d0db 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -51,7 +51,8 @@ /obj/structure/grille/attack_alien(mob/living/user) user.do_attack_animation(src) - if(istype(user, /mob/living/carbon/alien/larva)) return + if(istype(user, /mob/living/carbon/alien/larva)) + return user.changeNext_move(CLICK_CD_MELEE) playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user] mangles [src].", \ @@ -66,7 +67,8 @@ /obj/structure/grille/attack_slime(mob/living/simple_animal/slime/user) user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src) - if(!user.is_adult) return + if(!user.is_adult) + return playsound(loc, 'sound/effects/grillehit.ogg', 80, 1) user.visible_message("[user] smashes against [src].", \ diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 027095266fb..92c0691d6d1 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -86,7 +86,8 @@ FLOOR SAFES /obj/structure/safe/Topic(href, href_list) - if(!ishuman(usr)) return + if(!ishuman(usr)) + return var/mob/living/carbon/human/user = usr var/canhear = 0 diff --git a/code/game/sound.dm b/code/game/sound.dm index 3021a0ba8aa..304634c1b12 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -82,7 +82,8 @@ src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) /client/proc/playtitlemusic() - if(!ticker || !ticker.login_music) return + if(!ticker || !ticker.login_music) + return if(prefs && (prefs.toggles & SOUND_LOBBY)) src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS @@ -92,15 +93,26 @@ /proc/get_sfx(soundin) if(istext(soundin)) switch(soundin) - if ("shatter") soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg') - if ("explosion") soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg') - if ("sparks") soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg') - if ("rustle") soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg') - if ("bodyfall") soundin = pick('sound/effects/bodyfall1.ogg','sound/effects/bodyfall2.ogg','sound/effects/bodyfall3.ogg','sound/effects/bodyfall4.ogg') - if ("punch") soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') - if ("clownstep") soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg') - if ("swing_hit") soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg') - if ("hiss") soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg') - if ("pageturn") soundin = pick('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg') - if ("gunshot") soundin = pick('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg') + if ("shatter") + soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg') + if ("explosion") + soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg') + if ("sparks") + soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg') + if ("rustle") + soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg') + if ("bodyfall") + soundin = pick('sound/effects/bodyfall1.ogg','sound/effects/bodyfall2.ogg','sound/effects/bodyfall3.ogg','sound/effects/bodyfall4.ogg') + if ("punch") + soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg') + if ("clownstep") + soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg') + if ("swing_hit") + soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg') + if ("hiss") + soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg') + if ("pageturn") + soundin = pick('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg') + if ("gunshot") + soundin = pick('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg') return soundin diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index ccb24864770..d7ad8f5fbc3 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -139,7 +139,8 @@ return //get the user's location - if( !istype(user.loc, /turf) ) return //can't do this stuff whilst inside objects and such + if( !istype(user.loc, /turf) ) + return //can't do this stuff whilst inside objects and such add_fingerprint(user) @@ -233,11 +234,13 @@ F.icon_state = "wall_thermite" F.add_hiddenprint(user) spawn(max(100,300-thermite)) - if(O) qdel(O) + if(O) + qdel(O) else thermite = 0 spawn(50) - if(O) qdel(O) + if(O) + qdel(O) return /turf/simulated/wall/singularity_pull(S, current_size) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 7f73a2da7ee..ae925323705 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -119,8 +119,10 @@ //Creates a new turf /turf/proc/ChangeTurf(path) - if(!path) return - if(path == type) return src + if(!path) + return + if(path == type) + return src SSair.remove_from_active(src) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index e733adb4016..e51ed08db8d 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -6,13 +6,15 @@ usr << "Speech is currently admin-disabled." return - if(!mob) return + if(!mob) + return if(IsGuestKey(key)) src << "Guests may not use OOC." return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - if(!msg) return + if(!msg) + return if(!(prefs.chat_toggles & CHAT_OOC)) src << "You have OOC muted." @@ -96,7 +98,8 @@ var/global/normal_ooc_colour = OOC_COLOR set category = "Preferences" if(!holder || check_rights_for(src, R_ADMIN)) - if(!is_content_unlocked()) return + if(!is_content_unlocked()) + return var/new_ooccolor = input(src, "Please select your OOC color.", "OOC color", prefs.ooccolor) as color|null if(new_ooccolor) @@ -111,7 +114,8 @@ var/global/normal_ooc_colour = OOC_COLOR set category = "Preferences" if(!holder || check_rights_for(src, R_ADMIN)) - if(!is_content_unlocked()) return + if(!is_content_unlocked()) + return prefs.ooccolor = initial(prefs.ooccolor) prefs.save_preferences() diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index f7cb35a8da3..276fe05fc37 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -3,7 +3,8 @@ //Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional. /datum/admins/proc/DB_ban_record(bantype, mob/banned_mob, duration = -1, reason, job = "", rounds = 0, banckey = null, banip = null, bancid = null) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return establish_db_connection() if(!dbcon.IsConnected()) @@ -140,7 +141,8 @@ /datum/admins/proc/DB_ban_unban(ckey, bantype, job = "") - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/bantype_str if(bantype) @@ -218,7 +220,8 @@ /datum/admins/proc/DB_ban_edit(banid = null, param = null) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return if(!isnum(banid) || !istext(param)) usr << "Cancelled" @@ -278,7 +281,8 @@ /datum/admins/proc/DB_ban_unban_by_id(id) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]" @@ -332,7 +336,8 @@ if(!usr.client) return - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return establish_db_connection() if(!dbcon.IsConnected()) diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index 7fb18b8e55f..6a5782c7d60 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -183,8 +183,10 @@ var/savefile/Banlist var/expiry if(Banlist["temp"]) expiry = GetExp(Banlist["minutes"]) - if(!expiry) expiry = "Removal Pending" - else expiry = "Permaban" + if(!expiry) + expiry = "Removal Pending" + else + expiry = "Permaban" dat += text("(U)(E) Key: [key]ComputerID: [id]IP: [ip] [expiry](By: [by])(Reason: [reason])") diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d5c56e5e5b0..f023e7de493 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -379,7 +379,8 @@ var/global/BSACooldown = 0 /datum/admins/proc/Game() - if(!check_rights(0)) return + if(!check_rights(0)) + return var/dat = {"
      Game Panel

      \n @@ -439,7 +440,8 @@ var/global/BSACooldown = 0 set category = "Special Verbs" set name = "Announce" set desc="Announce your desires to the world" - if(!check_rights(0)) return + if(!check_rights(0)) + return var/message = input("Global message to send:", "Admin Announce", null, null) as message if(message) @@ -453,7 +455,8 @@ var/global/BSACooldown = 0 set category = "Special Verbs" set name = "Set Admin Notice" set desc ="Set an announcement that appears to everyone who joins the server. Only lasts this round" - if(!check_rights(0)) return + if(!check_rights(0)) + return var/new_admin_notice = input(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",admin_notice) as message|null if(new_admin_notice == null) @@ -613,7 +616,8 @@ var/global/BSACooldown = 0 set desc = "(atom path) Spawn an atom" set name = "Spawn" - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/list/matches = get_fancy_list_of_types() if (!isnull(object) && object!="") diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 4c4ff2080a6..4a7950fb408 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -12,20 +12,24 @@ return file("[INVESTIGATE_DIR][subject].html") /proc/investigate_reset() - if(fdel(INVESTIGATE_DIR)) return 1 + if(fdel(INVESTIGATE_DIR)) + return 1 return 0 /atom/proc/investigate_log(message, subject) - if(!message) return + if(!message) + return var/F = investigate_subject2file(subject) - if(!F) return + if(!F) + return F << "[time_stamp()] \ref[src] ([x],[y],[z]) || [src] [message]
      " //ADMINVERBS /client/proc/investigate_show( subject in list("hrefs","notes","watchlist","singulo","wires","telesci", "gravity", "records", "cargo", "supermatter", "atmos", "experimentor", "kudzu") ) set name = "Investigate" set category = "Admin" - if(!holder) return + if(!holder) + return switch(subject) if("singulo", "wires", "telesci", "gravity", "records", "cargo", "supermatter", "atmos", "kudzu") //general one-round-only stuff var/F = investigate_subject2file(subject) diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index 883c7fcda0c..403f744925c 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -1,7 +1,8 @@ /client/proc/admin_memo() set name = "Memo" set category = "Server" - if(!check_rights(0)) return + if(!check_rights(0)) + return if(!dbcon.IsConnected()) src << "Failed to establish database connection." return diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index a2612b46ee2..0df0147c3e4 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -14,30 +14,48 @@ var/list/admin_ranks = list() //list of all admin_rank datums qdel(src) throw EXCEPTION("invalid admin-rank name") return - if(init_rights) rights = init_rights - if(!init_adds) init_adds = list() - if(!init_subs) init_subs = list() + if(init_rights) + rights = init_rights + if(!init_adds) + init_adds = list() + if(!init_subs) + init_subs = list() adds = init_adds subs = init_subs /proc/admin_keyword_to_flag(word, previous_rights=0) var/flag = 0 switch(ckey(word)) - if("buildmode","build") flag = R_BUILDMODE - if("admin") flag = R_ADMIN - if("ban") flag = R_BAN - if("fun") flag = R_FUN - if("server") flag = R_SERVER - if("debug") flag = R_DEBUG - if("permissions","rights") flag = R_PERMISSIONS - if("possess") flag = R_POSSESS - if("stealth") flag = R_STEALTH - if("rejuv","rejuvinate") flag = R_REJUVINATE - if("varedit") flag = R_VAREDIT - if("everything","host","all") flag = 65535 - if("sound","sounds") flag = R_SOUNDS - if("spawn","create") flag = R_SPAWN - if("@","prev") flag = previous_rights + if("buildmode","build") + flag = R_BUILDMODE + if("admin") + flag = R_ADMIN + if("ban") + flag = R_BAN + if("fun") + flag = R_FUN + if("server") + flag = R_SERVER + if("debug") + flag = R_DEBUG + if("permissions","rights") + flag = R_PERMISSIONS + if("possess") + flag = R_POSSESS + if("stealth") + flag = R_STEALTH + if("rejuv","rejuvinate") + flag = R_REJUVINATE + if("varedit") + flag = R_VAREDIT + if("everything","host","all") + flag = 65535 + if("sound","sounds") + flag = R_SOUNDS + if("spawn","create") + flag = R_SPAWN + if("@","prev") + flag = previous_rights return flag /proc/admin_keyword_to_path(word) //use this with verb keywords eg +/client/proc/blah @@ -48,8 +66,10 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/flag = admin_keyword_to_flag(word, previous_rights) if(flag) switch(text2ascii(word,1)) - if(43) rights |= flag //+ - if(45) rights &= ~flag //- + if(43) + rights |= flag //+ + if(45) + rights &= ~flag //- else //isn't a keyword so maybe it's a verbpath? var/path = admin_keyword_to_path(word) @@ -82,12 +102,15 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/previous_rights = 0 //load text from file and process each line seperately for(var/line in file2list("config/admin_ranks.txt")) - if(!line) continue - if(findtextEx(line,"#",1,2)) continue + if(!line) + continue + if(findtextEx(line,"#",1,2)) + continue var/next = findtext(line, "=") var/datum/admin_rank/R = new(ckeyEx(copytext(line, 1, next))) - if(!R) continue + if(!R) + continue admin_ranks += R var/prev = findchar(line, "+-", next, 0) @@ -111,9 +134,11 @@ var/list/admin_ranks = list() //list of all admin_rank datums while(query.NextRow()) var/rank_name = ckeyEx(query.item[1]) var/flags = query.item[2] - if(istext(flags)) flags = text2num(flags) + if(istext(flags)) + flags = text2num(flags) var/datum/admin_rank/R = new(rank_name, flags) - if(!R) continue + if(!R) + continue admin_ranks += R #ifdef TESTING @@ -121,7 +146,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums for(var/datum/admin_rank/R in admin_ranks) msg += "\t[R.name]" var/rights = rights2text(R.rights,"\n\t\t",R.adds,R.subs) - if(rights) msg += "\t\t[rights]\n" + if(rights) + msg += "\t\t[rights]\n" testing(msg) #endif @@ -145,16 +171,20 @@ var/list/admin_ranks = list() //list of all admin_rank datums //process each line seperately for(var/line in Lines) - if(!length(line)) continue - if(findtextEx(line,"#",1,2)) continue + if(!length(line)) + continue + if(findtextEx(line,"#",1,2)) + continue //Split the line at every "=" var/list/List = text2list(line, "=") - if(!List.len) continue + if(!List.len) + continue //ckey is before the first "=" var/ckey = ckey(List[1]) - if(!ckey) continue + if(!ckey) + continue //rank follows the first "=" var/rank = "" @@ -162,7 +192,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums rank = ckeyEx(List[2]) var/datum/admins/D = new(rank_names[rank], ckey) //create the admin datum and store it for later use - if(!D) continue //will occur if an invalid rank is provided + if(!D) + continue //will occur if an invalid rank is provided D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum else @@ -183,7 +214,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums WARNING("Admin rank ([rank]) does not exist.") continue var/datum/admins/D = new(rank_names[rank], ckey) //create the admin datum and store it for later use - if(!D) continue //will occur if an invalid rank is provided + if(!D) + continue //will occur if an invalid rank is provided D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum #ifdef TESTING @@ -225,7 +257,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums switch(task) if("add") var/new_ckey = ckey(input(usr,"New admin's ckey","Admin ckey", null) as text|null) - if(!new_ckey) return + if(!new_ckey) + return if(new_ckey in admin_datums) usr << "Error: Topic 'editrights': [new_ckey] is already an admin" return @@ -242,7 +275,8 @@ var/list/admin_ranks = list() //list of all admin_rank datums switch(task) if("remove") if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") - if(!D) return + if(!D) + return if(!check_if_greater_rights_than_holder(D)) message_admins("[key_name_admin(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.") log_admin("[key_name(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.") @@ -265,10 +299,12 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/new_rank = input("Please select a rank", "New rank", null, null) as null|anything in rank_names switch(new_rank) - if(null) return + if(null) + return if("*New Rank*") new_rank = ckeyEx(input("Please input a new rank", "New custom rank", null, null) as null|text) - if(!new_rank) return + if(!new_rank) + return if(D) if(!check_if_greater_rights_than_holder(D)) @@ -278,8 +314,10 @@ var/list/admin_ranks = list() //list of all admin_rank datums R = rank_names[new_rank] if(!R) //rank with that name doesn't exist yet - make it - if(D) R = new(new_rank, D.rank.rights, D.rank.adds, D.rank.subs) //duplicate our previous admin_rank but with a new name - else R = new(new_rank) //blank new admin_rank + if(D) + R = new(new_rank, D.rank.rights, D.rank.adds, D.rank.subs) //duplicate our previous admin_rank but with a new name + else + R = new(new_rank) //blank new admin_rank admin_ranks += R if(D) //they were previously an admin @@ -297,10 +335,12 @@ var/list/admin_ranks = list() //list of all admin_rank datums log_admin_rank_modification(adm_ckey, new_rank) if("permissions") - if(!D) return //they're not an admin! + if(!D) + return //they're not an admin! var/keyword = input("Input permission keyword (one at a time):\ne.g. +BAN or -FUN or +/client/proc/someverb", "Permission toggle", null, null) as null|text - if(!keyword) return + if(!keyword) + return if(!check_keyword(keyword) || !check_if_greater_rights_than_holder(D)) message_admins("[key_name_admin(usr)] attempted to give [adm_ckey] the keyword [keyword] without sufficient rights.") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index d0dc7652b51..b52ead67447 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -226,18 +226,30 @@ var/list/admin_verbs_hideable = list( var/rights = holder.rank.rights verbs += admin_verbs_default - if(rights & R_BUILDMODE) verbs += /client/proc/togglebuildmodeself - if(rights & R_ADMIN) verbs += admin_verbs_admin - if(rights & R_BAN) verbs += admin_verbs_ban - if(rights & R_FUN) verbs += admin_verbs_fun - if(rights & R_SERVER) verbs += admin_verbs_server - if(rights & R_DEBUG) verbs += admin_verbs_debug - if(rights & R_POSSESS) verbs += admin_verbs_possess - if(rights & R_PERMISSIONS) verbs += admin_verbs_permissions - if(rights & R_STEALTH) verbs += /client/proc/stealth - if(rights & R_REJUVINATE) verbs += admin_verbs_rejuv - if(rights & R_SOUNDS) verbs += admin_verbs_sounds - if(rights & R_SPAWN) verbs += admin_verbs_spawn + if(rights & R_BUILDMODE) + verbs += /client/proc/togglebuildmodeself + if(rights & R_ADMIN) + verbs += admin_verbs_admin + if(rights & R_BAN) + verbs += admin_verbs_ban + if(rights & R_FUN) + verbs += admin_verbs_fun + if(rights & R_SERVER) + verbs += admin_verbs_server + if(rights & R_DEBUG) + verbs += admin_verbs_debug + if(rights & R_POSSESS) + verbs += admin_verbs_possess + if(rights & R_PERMISSIONS) + verbs += admin_verbs_permissions + if(rights & R_STEALTH) + verbs += /client/proc/stealth + if(rights & R_REJUVINATE) + verbs += admin_verbs_rejuv + if(rights & R_SOUNDS) + verbs += admin_verbs_sounds + if(rights & R_SPAWN) + verbs += admin_verbs_spawn for(var/path in holder.rank.adds) verbs += path @@ -318,7 +330,8 @@ var/list/admin_verbs_hideable = list( /client/proc/admin_ghost() set category = "Admin" set name = "Aghost" - if(!holder) return + if(!holder) + return if(istype(mob,/mob/dead/observer)) //re-enter var/mob/dead/observer/ghost = mob @@ -432,7 +445,8 @@ var/list/admin_verbs_hideable = list( mob.name = initial(mob.name) else var/new_key = ckeyEx(input("Enter your desired display name.", "Fake Key", key) as text|null) - if(!new_key) return + if(!new_key) + return if(length(new_key) >= 26) new_key = copytext(new_key, 1, 26) holder.fakekey = new_key @@ -549,7 +563,8 @@ var/list/admin_verbs_hideable = list( /client/proc/toggle_log_hrefs() set name = "Toggle href logging" set category = "Server" - if(!holder) return + if(!holder) + return if(config) if(config.log_hrefs) config.log_hrefs = 0 diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm index 9b9aadc49bb..1fabfcc5b03 100644 --- a/code/modules/admin/banappearance.dm +++ b/code/modules/admin/banappearance.dm @@ -81,7 +81,8 @@ DEBUG log_admin("Updating appearancefile!") // Updates bans.. Or fixes them. Either way. for(var/T in appearance_keylist) - if(!T) continue + if(!T) + continue appearanceban_runonce++ //don't run this update again diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index 5e3cf4b4ac8..23c07c4228e 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -1,7 +1,8 @@ /client/proc/create_poll() set name = "Create Poll" set category = "Special Verbs" - if(!check_rights(R_PERMISSIONS)) return + if(!check_rights(R_PERMISSIONS)) + return if(!dbcon.IsConnected()) src << "Failed to establish database connection." return diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm index 6e34c25866b..63fe0ee3149 100644 --- a/code/modules/admin/permissionverbs/permissionedit.dm +++ b/code/modules/admin/permissionverbs/permissionedit.dm @@ -2,11 +2,13 @@ set category = "Admin" set name = "Permissions Panel" set desc = "Edit admin permissions" - if(!check_rights(R_PERMISSIONS)) return + if(!check_rights(R_PERMISSIONS)) + return usr.client.holder.edit_admin_permissions() /datum/admins/proc/edit_admin_permissions() - if(!check_rights(R_PERMISSIONS)) return + if(!check_rights(R_PERMISSIONS)) + return var/output = {" @@ -27,7 +29,8 @@ for(var/adm_ckey in admin_datums) var/datum/admins/D = admin_datums[adm_ckey] - if(!D) continue + if(!D) + continue var/rights = rights2text(D.rank.rights," ") if(!rights) rights = "*none*" @@ -48,7 +51,8 @@ usr << browse(output,"window=editrights;size=900x650") /datum/admins/proc/log_admin_rank_modification(adm_ckey, new_rank) - if(config.admin_legacy_system) return + if(config.admin_legacy_system) + return if(!usr.client) return @@ -98,9 +102,12 @@ /datum/admins/proc/log_admin_permission_modification(adm_ckey, new_permission) - if(config.admin_legacy_system) return - if(!usr.client) return - if(check_rights(R_PERMISSIONS)) return + if(config.admin_legacy_system) + return + if(!usr.client) + return + if(check_rights(R_PERMISSIONS)) + return establish_db_connection() if(!dbcon.IsConnected()) @@ -117,7 +124,8 @@ while(select_query.NextRow()) admin_id = text2num(select_query.item[1]) - if(!admin_id) return + if(!admin_id) + return var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET flags = [new_permission] WHERE id = [admin_id]") insert_query.Execute() diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index a513fb346d9..65fda253fe4 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -101,7 +101,8 @@ dat += "[line]
      " dat+= "*******

      " for(var/datum/job/job in SSjob.occupations) - if(!job) continue + if(!job) + continue dat += "job: [job.title], current_positions: [job.current_positions], total_positions: [job.total_positions]
      " usr << browse(dat, "window=jobdebug;size=600x500") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 86919772a26..7c0501aa0fd 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -135,7 +135,8 @@ log_admin("[key_name(usr)] failed to create a shadowling.") else if(href_list["forceevent"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return var/datum/round_event_control/E = locate(href_list["forceevent"]) in SSevent.control if(E) var/datum/round_event/event = E.runEvent() @@ -245,7 +246,8 @@ edit_rights_topic(href_list) else if(href_list["call_shuttle"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return switch(href_list["call_shuttle"]) @@ -273,7 +275,8 @@ href_list["secrets"] = "check_antagonist" else if(href_list["edit_shuttle_time"]) - if(!check_rights(R_SERVER)) return + if(!check_rights(R_SERVER)) + return var/timer = input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", SSshuttle.emergency.timeLeft() ) as num SSshuttle.emergency.setTimer(timer*10) @@ -283,7 +286,8 @@ href_list["secrets"] = "check_antagonist" else if(href_list["toggle_continuous"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(!config.continuous[ticker.mode.config_tag]) config.continuous[ticker.mode.config_tag] = 1 @@ -294,7 +298,8 @@ check_antagonists() else if(href_list["toggle_midround_antag"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(!config.midround_antag[ticker.mode.config_tag]) config.midround_antag[ticker.mode.config_tag] = 1 @@ -305,7 +310,8 @@ check_antagonists() else if(href_list["alter_midround_time_limit"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/timer = input("Enter new maximum time",, config.midround_antag_time_check ) as num if(timer) @@ -315,7 +321,8 @@ check_antagonists() else if(href_list["alter_midround_life_limit"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/ratio = input("Enter new life ratio",, config.midround_antag_life_check*100) as num if(ratio) @@ -325,7 +332,8 @@ check_antagonists() else if(href_list["toggle_noncontinuous_behavior"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(!ticker.mode.round_ends_with_antag_death) ticker.mode.round_ends_with_antag_death = 1 @@ -336,7 +344,8 @@ check_antagonists() else if(href_list["delay_round_end"]) - if(!check_rights(R_SERVER)) return + if(!check_rights(R_SERVER)) + return ticker.delay_end = !ticker.delay_end log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].") @@ -344,7 +353,8 @@ href_list["secrets"] = "check_antagonist" else if(href_list["end_round"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return message_admins("[key_name_admin(usr)] is considering ending the round.") if(alert(usr, "This will end the round, are you SURE you want to do this?", "Confirmation", "Yes", "No") == "Yes") @@ -358,7 +368,8 @@ message_admins("[key_name_admin(usr)] decided against ending the round.") else if(href_list["simplemake"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/M = locate(href_list["mob"]) if(!ismob(M)) @@ -367,42 +378,69 @@ var/delmob = 0 switch(alert("Delete old mob?","Message","Yes","No","Cancel")) - if("Cancel") return - if("Yes") delmob = 1 + if("Cancel") + return + if("Yes") + delmob = 1 log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") message_admins("[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") switch(href_list["simplemake"]) - if("observer") M.change_mob_type( /mob/dead/observer , null, null, delmob ) - if("drone") M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob ) - if("hunter") M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob ) - if("queen") M.change_mob_type( /mob/living/carbon/alien/humanoid/royal/queen , null, null, delmob ) - if("praetorian") M.change_mob_type( /mob/living/carbon/alien/humanoid/royal/praetorian , null, null, delmob ) - if("sentinel") M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob ) - if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob ) - if("human") M.change_mob_type( /mob/living/carbon/human , null, null, delmob ) - if("slime") M.change_mob_type( /mob/living/simple_animal/slime , null, null, delmob ) - if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob ) - if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob ) - if("cat") M.change_mob_type( /mob/living/simple_animal/pet/cat , null, null, delmob ) - if("runtime") M.change_mob_type( /mob/living/simple_animal/pet/cat/Runtime , null, null, delmob ) - if("corgi") M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi , null, null, delmob ) - if("ian") M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi/Ian , null, null, delmob ) - if("pug") M.change_mob_type( /mob/living/simple_animal/pet/dog/pug , null, null, delmob ) - if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob ) - if("coffee") M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob ) - if("parrot") M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob ) - if("polyparrot") M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob ) - if("constructarmored") M.change_mob_type( /mob/living/simple_animal/hostile/construct/armored , null, null, delmob ) - if("constructbuilder") M.change_mob_type( /mob/living/simple_animal/hostile/construct/builder , null, null, delmob ) - if("constructwraith") M.change_mob_type( /mob/living/simple_animal/hostile/construct/wraith , null, null, delmob ) - if("shade") M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob ) + if("observer") + M.change_mob_type( /mob/dead/observer , null, null, delmob ) + if("drone") + M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob ) + if("hunter") + M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob ) + if("queen") + M.change_mob_type( /mob/living/carbon/alien/humanoid/royal/queen , null, null, delmob ) + if("praetorian") + M.change_mob_type( /mob/living/carbon/alien/humanoid/royal/praetorian , null, null, delmob ) + if("sentinel") + M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob ) + if("larva") + M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob ) + if("human") + M.change_mob_type( /mob/living/carbon/human , null, null, delmob ) + if("slime") + M.change_mob_type( /mob/living/simple_animal/slime , null, null, delmob ) + if("monkey") + M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob ) + if("robot") + M.change_mob_type( /mob/living/silicon/robot , null, null, delmob ) + if("cat") + M.change_mob_type( /mob/living/simple_animal/pet/cat , null, null, delmob ) + if("runtime") + M.change_mob_type( /mob/living/simple_animal/pet/cat/Runtime , null, null, delmob ) + if("corgi") + M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi , null, null, delmob ) + if("ian") + M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi/Ian , null, null, delmob ) + if("pug") + M.change_mob_type( /mob/living/simple_animal/pet/dog/pug , null, null, delmob ) + if("crab") + M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob ) + if("coffee") + M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob ) + if("parrot") + M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob ) + if("polyparrot") + M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob ) + if("constructarmored") + M.change_mob_type( /mob/living/simple_animal/hostile/construct/armored , null, null, delmob ) + if("constructbuilder") + M.change_mob_type( /mob/living/simple_animal/hostile/construct/builder , null, null, delmob ) + if("constructwraith") + M.change_mob_type( /mob/living/simple_animal/hostile/construct/wraith , null, null, delmob ) + if("shade") + M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob ) /////////////////////////////////////new ban stuff else if(href_list["unbanf"]) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/banfolder = href_list["unbanf"] Banlist.cd = "/base/[banfolder]" @@ -415,7 +453,8 @@ unbanpanel() else if(href_list["unbane"]) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return UpdateTime() var/reason @@ -439,16 +478,19 @@ if(minutes > CMinutes) mins = minutes - CMinutes mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null - if(!mins) return + if(!mins) + return minutes = CMinutes + mins duration = GetExp(minutes) reason = input(usr,"Please State Reason","Reason",reason2) as message - if(!reason) return + if(!reason) + return if("No") temp = 0 duration = "Perma" reason = input(usr,"Please State Reason","Reason",reason2) as message - if(!reason) return + if(!reason) + return log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") @@ -535,9 +577,11 @@ jobs += "" jobs += "" for(var/jobPos in command_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -556,9 +600,11 @@ jobs += "
      Command Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in security_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -577,9 +623,11 @@ jobs += "
      Security Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in engineering_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -598,9 +646,11 @@ jobs += "
      Engineering Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in medical_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -619,9 +669,11 @@ jobs += "
      Medical Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in science_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -640,9 +692,11 @@ jobs += "
      Science Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in supply_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -661,9 +715,11 @@ jobs += "
      Supply Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in civilian_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -682,9 +738,11 @@ jobs += "
      Civilian Positions
      [replacetext(job.title, " ", " ")]
      " jobs += "" for(var/jobPos in nonhuman_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/job = SSjob.GetJob(jobPos) - if(!job) continue + if(!job) + continue if(jobban_isbanned(M, job.title)) jobs += "" @@ -808,7 +866,8 @@ //JOBBAN'S INNARDS else if(href_list["jobban3"]) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/mob/M = locate(href_list["jobban4"]) if(!ismob(M)) @@ -824,51 +883,67 @@ switch(href_list["jobban3"]) if("commanddept") for(var/jobPos in command_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("securitydept") for(var/jobPos in security_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("engineeringdept") for(var/jobPos in engineering_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("medicaldept") for(var/jobPos in medical_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("sciencedept") for(var/jobPos in science_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("supplydept") for(var/jobPos in supply_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("civiliandept") for(var/jobPos in civilian_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("nonhumandept") for(var/jobPos in nonhuman_positions) - if(!jobPos) continue + if(!jobPos) + continue var/datum/job/temp = SSjob.GetJob(jobPos) - if(!temp) continue + if(!temp) + continue joblist += temp.title if("ghostroles") joblist += list("pAI", "posibrain", "drone", "deathsquad") @@ -920,8 +995,10 @@ feedback_inc("ban_job",1) DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, job) feedback_add_details("ban_job","- [job]") - if(!msg) msg = job - else msg += ", [job]" + if(!msg) + msg = job + else + msg += ", [job]" add_note(M.ckey, "Banned from [msg] - [reason]", null, usr.ckey, 0) message_admins("[key_name_admin(usr)] banned [key_name_admin(M)] from [msg]") M << "You have been jobbanned by [usr.client.ckey] from: [msg]." @@ -938,7 +1015,8 @@ var/msg for(var/job in joblist) var/reason = jobban_isbanned(M, job) - if(!reason) continue //skip if it isn't jobbanned anyway + if(!reason) + continue //skip if it isn't jobbanned anyway switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No")) if("Yes") ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]") @@ -946,8 +1024,10 @@ DB_ban_unban(M.ckey, BANTYPE_ANY_JOB, job) feedback_inc("ban_job_unban",1) feedback_add_details("ban_job_unban","- [job]") - if(!msg) msg = job - else msg += ", [job]" + if(!msg) + msg = job + else + msg += ", [job]" else continue if(msg) @@ -1014,12 +1094,15 @@ usr << browse(edit_log,"window=noteedits") else if(href_list["newban"]) - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/mob/M = locate(href_list["newban"]) - if(!ismob(M)) return + if(!ismob(M)) + return - if(M.client && M.client.holder) return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway + if(M.client && M.client.holder) + return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway switch(alert("Temporary Ban?",,"Yes","No", "Cancel")) if("Yes") @@ -1050,7 +1133,8 @@ if(!reason) return switch(alert(usr,"IP ban?",,"Yes","No","Cancel")) - if("Cancel") return + if("Cancel") + return if("Yes") AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP) if("No") @@ -1115,11 +1199,13 @@ usr << browse(edit_log,"window=watchedits") else if(href_list["mute"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return cmd_admin_mute(href_list["mute"], text2num(href_list["mute_type"])) else if(href_list["c_mode"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) @@ -1132,7 +1218,8 @@ usr << browse(dat, "window=c_mode") else if(href_list["f_secret"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) @@ -1146,7 +1233,8 @@ usr << browse(dat, "window=f_secret") else if(href_list["c_mode2"]) - if(!check_rights(R_ADMIN|R_SERVER)) return + if(!check_rights(R_ADMIN|R_SERVER)) + return if (ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) @@ -1159,7 +1247,8 @@ .(href, list("c_mode"=1)) else if(href_list["f_secret2"]) - if(!check_rights(R_ADMIN|R_SERVER)) return + if(!check_rights(R_ADMIN|R_SERVER)) + return if(ticker && ticker.mode) return alert(usr, "The game has already started.", null, null, null, null) @@ -1172,7 +1261,8 @@ .(href, list("f_secret"=1)) else if(href_list["monkeyone"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/living/carbon/human/H = locate(href_list["monkeyone"]) if(!istype(H)) @@ -1184,7 +1274,8 @@ H.monkeyize() else if(href_list["humanone"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/living/carbon/monkey/Mo = locate(href_list["humanone"]) if(!istype(Mo)) @@ -1196,7 +1287,8 @@ Mo.humanize() else if(href_list["corgione"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/living/carbon/human/H = locate(href_list["corgione"]) if(!istype(H)) @@ -1209,21 +1301,24 @@ else if(href_list["forcespeech"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return var/mob/M = locate(href_list["forcespeech"]) if(!ismob(M)) usr << "this can only be used on instances of type /mob" var/speech = input("What will [key_name(M)] say?.", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins. - if(!speech) return + if(!speech) + return M.say(speech) speech = sanitize(speech) // Nah, we don't trust them log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]") message_admins("[key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]") else if(href_list["sendtoprison"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/mob/M = locate(href_list["sendtoprison"]) if(!ismob(M)) @@ -1267,7 +1362,8 @@ qdel(M) else if(href_list["tdome1"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return @@ -1296,7 +1392,8 @@ message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)") else if(href_list["tdome2"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return @@ -1325,7 +1422,8 @@ message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)") else if(href_list["tdomeadmin"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return @@ -1347,7 +1445,8 @@ message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)") else if(href_list["tdomeobserve"]) - if(!check_rights(R_FUN)) return + if(!check_rights(R_FUN)) + return if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return @@ -1380,7 +1479,8 @@ message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)") else if(href_list["revive"]) - if(!check_rights(R_REJUVINATE)) return + if(!check_rights(R_REJUVINATE)) + return var/mob/living/L = locate(href_list["revive"]) if(!istype(L)) @@ -1392,7 +1492,8 @@ log_admin("[key_name(usr)] healed / Revived [key_name(L)]") else if(href_list["makeai"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/living/carbon/human/H = locate(href_list["makeai"]) if(!istype(H)) @@ -1404,7 +1505,8 @@ H.AIize() 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)) @@ -1414,7 +1516,8 @@ usr.client.cmd_admin_alienize(H) 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)) @@ -1424,7 +1527,8 @@ usr.client.cmd_admin_slimeize(H) else if(href_list["makeblob"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/living/carbon/human/H = locate(href_list["makeblob"]) if(!istype(H)) @@ -1435,7 +1539,8 @@ 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)) @@ -1445,7 +1550,8 @@ usr.client.cmd_admin_robotize(H) else if(href_list["makeanimal"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/M = locate(href_list["makeanimal"]) if(istype(M, /mob/new_player)) @@ -1469,24 +1575,28 @@ show_player_panel(M) else if(href_list["adminplayerobservefollow"]) - if(!isobserver(usr) && !check_rights(R_ADMIN)) return + if(!isobserver(usr) && !check_rights(R_ADMIN)) + return var/atom/movable/AM = locate(href_list["adminplayerobservefollow"]) var/client/C = usr.client - if(!isobserver(usr)) C.admin_ghost() + if(!isobserver(usr)) + C.admin_ghost() var/mob/dead/observer/A = C.mob A.ManualFollow(AM) else if(href_list["adminplayerobservecoodjump"]) - if(!isobserver(usr) && !check_rights(R_ADMIN)) return + if(!isobserver(usr) && !check_rights(R_ADMIN)) + return var/x = text2num(href_list["X"]) var/y = text2num(href_list["Y"]) var/z = text2num(href_list["Z"]) var/client/C = usr.client - if(!isobserver(usr)) C.admin_ghost() + if(!isobserver(usr)) + C.admin_ghost() sleep(2) C.jumptocoord(x,y,z) @@ -1523,9 +1633,12 @@ var/mob/living/L = M var/status switch (M.stat) - if (0) status = "Alive" - if (1) status = "Unconscious" - if (2) status = "Dead" + if (0) + status = "Alive" + if (1) + status = "Unconscious" + if (2) + status = "Dead" health_description = "Status = [status]" health_description += "
      Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()] - Stamina: [L.getStaminaLoss()]" else @@ -1533,8 +1646,10 @@ //Gender switch(M.gender) - if(MALE,FEMALE) gender_description = "[M.gender]" - else gender_description = "[M.gender]" + if(MALE,FEMALE) + gender_description = "[M.gender]" + else + gender_description = "[M.gender]" src.owner << "Info about [M.name]: " src.owner << "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]" @@ -1544,7 +1659,8 @@ src.owner << "(PM) (PP) (VV) (SM) (FLW) (CA)" else if(href_list["addjobslot"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/Add = href_list["addjobslot"] @@ -1556,7 +1672,8 @@ src.manage_free_slots() else if(href_list["removejobslot"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/Remove = href_list["removejobslot"] @@ -1568,7 +1685,8 @@ src.manage_free_slots() else if(href_list["unlimitjobslot"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/Unlimit = href_list["unlimitjobslot"] @@ -1580,7 +1698,8 @@ src.manage_free_slots() else if(href_list["limitjobslot"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/Limit = href_list["limitjobslot"] @@ -1593,7 +1712,8 @@ else if(href_list["adminspawncookie"]) - if(!check_rights(R_ADMIN|R_FUN)) return + if(!check_rights(R_ADMIN|R_FUN)) + return var/mob/living/carbon/human/H = locate(href_list["adminspawncookie"]) if(!ishuman(H)) @@ -1631,7 +1751,8 @@ return var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcom", "") - if(!input) return + if(!input) + return src.owner << "You sent [input] to [H] via a secure channel." log_admin("[src.owner] replied to [key_name(H)]'s Centcom message with the message [input].") @@ -1648,7 +1769,8 @@ return var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from The Syndicate", "") - if(!input) return + if(!input) + return src.owner << "You sent [input] to [H] via a secure channel." log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].") @@ -1656,38 +1778,45 @@ H << "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"" else if(href_list["jumpto"]) - if(!isobserver(usr) && !check_rights(R_ADMIN)) return + if(!isobserver(usr) && !check_rights(R_ADMIN)) + return var/mob/M = locate(href_list["jumpto"]) usr.client.jumptomob(M) else if(href_list["getmob"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + return var/mob/M = locate(href_list["getmob"]) usr.client.Getmob(M) else if(href_list["sendmob"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/mob/M = locate(href_list["sendmob"]) usr.client.sendmob(M) else if(href_list["narrateto"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/mob/M = locate(href_list["narrateto"]) usr.client.cmd_admin_direct_narrate(M) else if(href_list["subtlemessage"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return var/mob/M = locate(href_list["subtlemessage"]) usr.client.cmd_admin_subtle_message(M) else if(href_list["traitor"]) - if(!check_rights(R_ADMIN)) return + if(!check_rights(R_ADMIN)) + return if(!ticker || !ticker.mode) alert("The game hasn't started yet!") @@ -1700,27 +1829,33 @@ show_traitor_panel(M) else if(href_list["create_object"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return return create_object(usr) else if(href_list["quick_create_object"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return return quick_create_object(usr) else if(href_list["create_turf"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return return create_turf(usr) else if(href_list["create_mob"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return return create_mob(usr) else if(href_list["dupe_marked_datum"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return return DuplicateObject(marked_datum, perfectcopy=1, newloc=get_turf(usr)) else if(href_list["object_list"]) //this is the laggiest thing ever - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/atom/loc = usr.loc diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index e7e89f2f8e4..83e4f3976dd 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -12,7 +12,8 @@ var/list/ckeys = list() for(var/mob/M in mob_list) var/list/indexing = list(M.real_name, M.name) - if(M.mind) indexing += M.mind.name + if(M.mind) + indexing += M.mind.name for(var/string in indexing) var/list/L = text2list(string, " ") @@ -80,7 +81,8 @@ return //clean the input msg - if(!msg) return + if(!msg) + return msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return var/original_msg = msg @@ -91,7 +93,8 @@ msg = keywords_lookup(msg) - if(!mob) return //this doesn't happen + if(!mob) + return //this doesn't happen var/ref_mob = "\ref[mob]" var/ref_client = "\ref[src]" diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 818a7050967..891bbf330a0 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -5,7 +5,8 @@ if(!holder) src << "Error: Admin-PM-Context: Only administrators may use this command." return - if( !ismob(M) || !M.client ) return + if( !ismob(M) || !M.client ) + return cmd_admin_pm(M.client,null) feedback_add_details("admin_verb","APMM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -44,7 +45,8 @@ else if(istype(whom,/client)) C = whom if(!C) - if(holder) src << "Error: Admin-PM: Client not found." + if(holder) + src << "Error: Admin-PM: Client not found." return message_admins("[key_name_admin(src)] has started replying to [key_name(C, 0, 0)]'s admin help.") var/msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null @@ -68,18 +70,23 @@ else if(istype(whom,/client)) C = whom if(!C) - if(holder) src << "Error: Admin-PM: Client not found." - else adminhelp(msg) //admin we are replying to left. adminhelp instead + if(holder) + src << "Error: Admin-PM: Client not found." + else + adminhelp(msg) //admin we are replying to left. adminhelp instead return //get message text, limit it's length.and clean/escape html if(!msg) msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null - if(!msg) return + if(!msg) + return if(!C) - if(holder) src << "Error: Admin-PM: Client not found." - else adminhelp(msg) //admin we are replying to has vanished, adminhelp instead + if(holder) + src << "Error: Admin-PM: Client not found." + else + adminhelp(msg) //admin we are replying to has vanished, adminhelp instead return if (src.handle_spam_prevention(msg,MUTE_ADMINHELP)) @@ -88,7 +95,8 @@ //clean the message if it's not sent by a high-rank admin if(!check_rights(R_SERVER|R_DEBUG,0)) msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) - if(!msg) return + if(!msg) + return msg = emoji_parse(msg) var/keywordparsedmsg = keywords_lookup(msg) diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 6e650566ae8..3dab6c26d6c 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -2,10 +2,12 @@ set category = "Special Verbs" set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite set hidden = 1 - if(!check_rights(0)) return + if(!check_rights(0)) + return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - if(!msg) return + if(!msg) + return log_adminsay("[key_name(src)] : [msg]") msg = keywords_lookup(msg) diff --git a/code/modules/admin/verbs/bluespacearty.dm b/code/modules/admin/verbs/bluespacearty.dm index da8eee4a2ad..4d1cf805f52 100644 --- a/code/modules/admin/verbs/bluespacearty.dm +++ b/code/modules/admin/verbs/bluespacearty.dm @@ -18,8 +18,10 @@ var/turf/simulated/floor/T = get_turf(target) if(istype(T)) - if(prob(80)) T.break_tile_to_plating() - else T.break_tile() + if(prob(80)) + T.break_tile_to_plating() + else + T.break_tile() target << "You're hit by bluespace artillery!" log_admin("[target.name] has been hit by Bluespace Artillery fired by [usr]") diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index 107c5310770..78294198d18 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -3,7 +3,8 @@ set category = "Fun" set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted. set hidden = 1 - if(!ticker) return + if(!ticker) + return switch(cinematic) if("explosion") var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index cc04962c1f5..8ed8d72c737 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1,7 +1,8 @@ /client/proc/Debug2() set category = "Debug" set name = "Debug-Game" - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(Debug2) Debug2 = 0 @@ -67,7 +68,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that targetselected = 0 var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null - if(!procname) return + if(!procname) + return if(targetselected && !hascall(target,procname)) usr << "Error: callproc(): target has no such call [procname]." return @@ -131,7 +133,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/get_callproc_args() var/argnum = input("Number of arguments","Number:",0) as num|null - if(!argnum && (argnum!=0)) return + if(!argnum && (argnum!=0)) + return var/list/lst = list() //TODO: make a list to store whether each argument was initialised as null. @@ -720,5 +723,6 @@ var/global/list/g_fancy_list_of_types = null set name = "Debug HUDs" set desc = "Debug the data or antag HUDs" - if(!holder) return + if(!holder) + return debug_variables(huds[i]) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 6ec65b1f71d..f558e469eb4 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -91,10 +91,12 @@ set name = "Reload Admins" set category = "Admin" - if(!src.holder) return + if(!src.holder) + return var/confirm = alert(src, "Are you sure you want to reload all admins?", "Confirm", "Yes", "No") - if(confirm !="Yes") return + if(confirm !="Yes") + return message_admins("[key_name_admin(usr)] manually reloaded admins") load_admins() diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm index 7e49860b1c9..6cb8107ba00 100644 --- a/code/modules/admin/verbs/fps.dm +++ b/code/modules/admin/verbs/fps.dm @@ -4,7 +4,8 @@ set name = "Set fps" set desc = "Sets game speed in frames-per-second. Can potentially break the game" - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return var/fps = round(input("Sets game frames-per-second. Can potentially break the game","FPS", config.fps) as num|null) diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index df153f62874..7dfd17e7538 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -5,7 +5,8 @@ var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL itms) - if(!check_rights(R_VAREDIT)) return + if(!check_rights(R_VAREDIT)) + return if(A && A.type) if(typesof(A.type)) @@ -24,7 +25,8 @@ /client/proc/massmodify_variables(atom/O, var_name = "", method = 0) - if(!check_rights(R_VAREDIT)) return + if(!check_rights(R_VAREDIT)) + return for(var/p in forbidden_varedit_object_types) if( istype(O,p) ) @@ -44,7 +46,8 @@ else variable = var_name - if(!variable) return + if(!variable) + return var/default var/var_value = O.vars[variable] var/dir @@ -53,9 +56,11 @@ usr << "It's forbidden to mass-modify ckeys. I'll crash everyone's client you dummy." return if(variable in VVlocked) - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(variable in VVicon_edit_lock) - if(!check_rights(R_FUN|R_DEBUG)) return + if(!check_rights(R_FUN|R_DEBUG)) + return if(isnull(var_value)) usr << "Unable to determine variable type." diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index d3b22c446c9..8e0bef8a7de 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -149,8 +149,10 @@ var/list/VVckey_edit = list("key", "ckey") message_admins("[key_name_admin(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]") /client/proc/mod_list(list/L, atom/O, original_name, objectvar) - if(!check_rights(R_VAREDIT)) return - if(!istype(L,/list)) src << "Not a List." + if(!check_rights(R_VAREDIT)) + return + if(!istype(L,/list)) + src << "Not a List." if(L.len > 1000) var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort") @@ -191,11 +193,14 @@ var/list/VVckey_edit = list("key", "ckey") var/dir if(variable in VVlocked) - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(variable in VVckey_edit) - if(!check_rights(R_SPAWN|R_DEBUG)) return + if(!check_rights(R_SPAWN|R_DEBUG)) + return if(variable in VVicon_edit_lock) - if(!check_rights(R_FUN|R_DEBUG)) return + if(!check_rights(R_FUN|R_DEBUG)) + return if(isnull(variable)) usr << "Unable to determine variable type." @@ -373,7 +378,8 @@ var/list/VVckey_edit = list("key", "ckey") message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]") /client/proc/modify_variables(atom/O, param_var_name = null, autodetect_class = 0) - if(!check_rights(R_VAREDIT)) return + if(!check_rights(R_VAREDIT)) + return for(var/p in forbidden_varedit_object_types) if( istype(O,p) ) @@ -394,11 +400,14 @@ var/list/VVckey_edit = list("key", "ckey") return if(param_var_name in VVlocked) - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(param_var_name in VVckey_edit) - if(!check_rights(R_SPAWN|R_DEBUG)) return + if(!check_rights(R_SPAWN|R_DEBUG)) + return if(param_var_name in VVicon_edit_lock) - if(!check_rights(R_FUN|R_DEBUG)) return + if(!check_rights(R_FUN|R_DEBUG)) + return variable = param_var_name @@ -452,15 +461,19 @@ var/list/VVckey_edit = list("key", "ckey") names = sortList(names) variable = input("Which var?","Var") as null|anything in names - if(!variable) return + if(!variable) + return var_value = O.vars[variable] if(variable in VVlocked) - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(variable in VVckey_edit) - if(!check_rights(R_SPAWN|R_DEBUG)) return + if(!check_rights(R_SPAWN|R_DEBUG)) + return if(variable in VVicon_edit_lock) - if(!check_rights(R_FUN|R_DEBUG)) return + if(!check_rights(R_FUN|R_DEBUG)) + return if(!autodetect_class) diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 00460d3a900..167f1bd4861 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -4,7 +4,8 @@ var/sound/admin_sound /client/proc/play_sound(S as sound) set category = "Fun" set name = "Play Global Sound" - if(!check_rights(R_SOUNDS)) return + if(!check_rights(R_SOUNDS)) + return admin_sound = sound(S, repeat = 0, wait = 1, channel = SOUND_CHANNEL_ADMIN) admin_sound.priority = 250 @@ -29,7 +30,8 @@ var/sound/admin_sound /client/proc/play_local_sound(S as sound) set category = "Fun" set name = "Play Local Sound" - if(!check_rights(R_SOUNDS)) return + if(!check_rights(R_SOUNDS)) + return log_admin("[key_name(src)] played a local sound [S]") message_admins("[key_name_admin(src)] played a local sound [S]") @@ -39,7 +41,8 @@ var/sound/admin_sound /client/proc/set_round_end_sound(S as sound) set category = "Fun" set name = "Set Round End Sound" - if(!check_rights(R_SOUNDS)) return + if(!check_rights(R_SOUNDS)) + return if(ticker) ticker.round_end_sound = fcopy_rsc(S) @@ -53,7 +56,8 @@ var/sound/admin_sound /client/proc/stop_sounds() set category = "Debug" set name = "Stop All Playing Sounds" - if(!src.holder) return + if(!src.holder) + return log_admin("[key_name(src)] stopped all currently playing sounds.") message_admins("[key_name_admin(src)] stopped all currently playing sounds.") diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index b23db1a03b9..5f4a809778c 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -7,7 +7,8 @@ return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - if(!msg) return + if(!msg) + return log_prayer("[src.key]/([src.name]): [msg]") if(usr.client) if(usr.client.prefs.muted & MUTE_PRAY) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 93bf512311a..b5d422f5c38 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -23,7 +23,8 @@ set category = "Special Verbs" set name = "Subtle Message" - if(!ismob(M)) return + if(!ismob(M)) + return if (!holder) src << "Only administrators may use this command." return @@ -127,13 +128,20 @@ var/muteunmute var/mute_string switch(mute_type) - if(MUTE_IC) mute_string = "IC (say and emote)" - if(MUTE_OOC) mute_string = "OOC" - if(MUTE_PRAY) mute_string = "pray" - if(MUTE_ADMINHELP) mute_string = "adminhelp, admin PM and ASAY" - if(MUTE_DEADCHAT) mute_string = "deadchat and DSAY" - if(MUTE_ALL) mute_string = "everything" - else return + if(MUTE_IC) + mute_string = "IC (say and emote)" + if(MUTE_OOC) + mute_string = "OOC" + if(MUTE_PRAY) + mute_string = "pray" + if(MUTE_ADMINHELP) + mute_string = "adminhelp, admin PM and ASAY" + if(MUTE_DEADCHAT) + mute_string = "deadchat and DSAY" + if(MUTE_ALL) + mute_string = "everything" + else + return var/client/C if(istype(whom, /client)) @@ -144,12 +152,16 @@ return var/datum/preferences/P - if(C) P = C.prefs - else P = preferences_datums[whom] - if(!P) return + if(C) + P = C.prefs + else + P = preferences_datums[whom] + if(!P) + return if(automute) - if(!config.automute_on) return + if(!config.automute_on) + return else if(!check_rights()) return @@ -159,7 +171,8 @@ P.muted |= mute_type log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(whom)] from [mute_string]") message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(whom)] from [mute_string].") - if(C) C << "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin." + if(C) + C << "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin." feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return @@ -172,7 +185,8 @@ log_admin("[key_name(usr)] has [muteunmute] [key_name(whom)] from [mute_string]") message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(whom)] from [mute_string].") - if(C) C << "You have been [muteunmute] from [mute_string]." + if(C) + C << "You have been [muteunmute] from [mute_string]." feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -183,7 +197,8 @@ src << "Only administrators may use this command." return var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") - if(confirm != "Yes") return + if(confirm != "Yes") + return log_admin("[key_name(src)] has added a random AI law.") message_admins("[key_name_admin(src)] has added a random AI law.") @@ -199,28 +214,40 @@ if(!ckey) var/list/candidates = list() for(var/mob/M in player_list) - if(M.stat != DEAD) continue //we are not dead! - if(!(ROLE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium - if(M.client.is_afk()) continue //we are afk - if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to + if(M.stat != DEAD) + continue //we are not dead! + if(!(ROLE_ALIEN in M.client.prefs.be_special)) + continue //we don't want to be an alium + if(M.client.is_afk()) + continue //we are afk + if(M.mind && M.mind.current && M.mind.current.stat != DEAD) + continue //we have a live body we are tied to candidates += M.ckey if(candidates.len) ckey = input("Pick the player you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates else usr << "Error: create_xeno(): no suitable candidates." - if(!istext(ckey)) return 0 + if(!istext(ckey)) + return 0 var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva") var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin) var/mob/living/carbon/alien/new_xeno switch(alien_caste) - if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/royal/queen(spawn_here) - if("Praetorian") new_xeno = new /mob/living/carbon/alien/humanoid/royal/praetorian(spawn_here) - if("Hunter") new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here) - if("Sentinel") new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here) - if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here) - if("Larva") new_xeno = new /mob/living/carbon/alien/larva(spawn_here) - else return 0 + if("Queen") + new_xeno = new /mob/living/carbon/alien/humanoid/royal/queen(spawn_here) + if("Praetorian") + new_xeno = new /mob/living/carbon/alien/humanoid/royal/praetorian(spawn_here) + if("Hunter") + new_xeno = new /mob/living/carbon/alien/humanoid/hunter(spawn_here) + if("Sentinel") + new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(spawn_here) + if("Drone") + new_xeno = new /mob/living/carbon/alien/humanoid/drone(spawn_here) + if("Larva") + new_xeno = new /mob/living/carbon/alien/larva(spawn_here) + else + return 0 new_xeno.ckey = ckey message_admins("[key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste].") @@ -257,16 +284,23 @@ Traitors and the like can also be revived with the previous role mostly intact. if(G_found.mind.assigned_role=="Alien") if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes") var/turf/T - if(xeno_spawn.len) T = pick(xeno_spawn) - else T = pick(latejoin) + if(xeno_spawn.len) + T = pick(xeno_spawn) + else + T = pick(latejoin) var/mob/living/carbon/alien/new_xeno switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were. - if("Hunter") new_xeno = new /mob/living/carbon/alien/humanoid/hunter(T) - if("Sentinel") new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(T) - if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(T) - if("Praetorian") new_xeno = new /mob/living/carbon/alien/humanoid/royal/praetorian(T) - if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/royal/queen(T) + if("Hunter") + new_xeno = new /mob/living/carbon/alien/humanoid/hunter(T) + if("Sentinel") + new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(T) + if("Drone") + new_xeno = new /mob/living/carbon/alien/humanoid/drone(T) + if("Praetorian") + new_xeno = new /mob/living/carbon/alien/humanoid/royal/praetorian(T) + if("Queen") + new_xeno = new /mob/living/carbon/alien/humanoid/royal/queen(T) else//If we don't know what special role they have, for whatever reason, or they're a larva. create_xeno(G_found.ckey) return @@ -542,9 +576,11 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") - if(confirm != "Yes") return + if(confirm != "Yes") + return //Due to the delay here its easy for something to have happened to the mob - if(!M) return + if(!M) + return log_admin("[key_name(usr)] has gibbed [key_name(M)]") message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]") @@ -608,7 +644,8 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") - if(confirm != "Yes") return + if(confirm != "Yes") + return SSshuttle.emergency.request() feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -619,8 +656,10 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/admin_cancel_shuttle() set category = "Admin" set name = "Cancel Shuttle" - if(!check_rights(0)) return - if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return + if(!check_rights(0)) + return + if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") + return if(SSshuttle.emergency.mode >= SHUTTLE_DOCKED) return @@ -710,7 +749,8 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Toggle Nuke" set category = "Fun" set popup_menu = 0 - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return if(!N.timing) var/newtime = input(usr, "Set activation timer.", "Activate Nuke", "[N.timeleft]") as num @@ -728,7 +768,8 @@ Traitors and the like can also be revived with the previous role mostly intact. set category = "Debug" set name = "Remove Latejoin Spawns" - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return latejoin.Cut() @@ -744,7 +785,8 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits set category = "Debug" set name = "Create Custom Outfit" - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return holder.create_outfit() diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm index 34c82ac8c6b..b753875e24b 100644 --- a/code/modules/assembly/health.dm +++ b/code/modules/assembly/health.dm @@ -14,7 +14,8 @@ /obj/item/device/assembly/health/activate() - if(!..()) return 0//Cooldown check + if(!..()) + return 0//Cooldown check toggle_scan() return 0 @@ -62,7 +63,8 @@ return /obj/item/device/assembly/health/proc/toggle_scan() - if(!secured) return 0 + if(!secured) + return 0 scanning = !scanning if(scanning) SSobj.processing |= src diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 6ac5e3ed958..a4b7720d0c8 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -103,8 +103,10 @@ return if(istype(a_left,a_right.type))//If they are the same type it causes issues due to window code switch(alert("Which side would you like to use?",,"Left","Right")) - if("Left") a_left.attack_self(user) - if("Right") a_right.attack_self(user) + if("Left") + a_left.attack_self(user) + if("Right") + a_right.attack_self(user) return else a_left.attack_self(user) diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm index 0b6c43f50a8..0431f5b222c 100644 --- a/code/modules/assembly/igniter.dm +++ b/code/modules/assembly/igniter.dm @@ -19,9 +19,11 @@ /obj/item/device/assembly/igniter/activate() - if(!..()) return 0//Cooldown check + if(!..()) + return 0//Cooldown check var/turf/location = get_turf(loc) - if(location) location.hotspot_expose(1000,1000) + if(location) + location.hotspot_expose(1000,1000) sparks.start() return 1 diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index e1260d519cd..9f63519f10f 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -24,7 +24,8 @@ return "The infrared trigger is [on?"on":"off"]." /obj/item/device/assembly/infra/activate() - if(!..()) return 0//Cooldown check + if(!..()) + return 0//Cooldown check on = !on update_icon() return 1 @@ -89,7 +90,8 @@ return /obj/item/device/assembly/infra/holder_movement() - if(!holder) return 0 + if(!holder) + return 0 // dir = holder.dir qdel(first) return 1 diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 3878898e95b..ce2f468e0d6 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -36,7 +36,8 @@ handle_move(w.holder.loc) /obj/item/device/assembly/prox_sensor/activate() - if(!..()) return 0//Cooldown check + if(!..()) + return 0//Cooldown check timing = !timing update_icon() return 1 @@ -52,12 +53,14 @@ /obj/item/device/assembly/prox_sensor/HasProximity(atom/movable/AM as mob|obj) - if (istype(AM, /obj/effect/beam)) return + if (istype(AM, /obj/effect/beam)) + return sense() /obj/item/device/assembly/prox_sensor/sense() - if((!secured)||(cooldown > 0)) return 0 + if((!secured)||(cooldown > 0)) + return 0 pulse(0) audible_message("\icon[src] *beep* *beep*", null, 3) cooldown = 2 @@ -81,7 +84,8 @@ /obj/item/device/assembly/prox_sensor/toggle_scan(scan) - if(!secured) return 0 + if(!secured) + return 0 scanning = scan if(scanning) add_to_proximity_list(src, sensitivity) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index ff0396423bc..6f9a7127184 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -25,7 +25,8 @@ return ..() /obj/item/device/assembly/signaler/activate() - if(cooldown > 0) return 0 + if(cooldown > 0) + return 0 cooldown = 2 spawn(10) process_cooldown() @@ -118,17 +119,23 @@ Code: return /* for(var/obj/item/device/assembly/signaler/S in world) - if(!S) continue - if(S == src) continue + if(!S) + continue + if(S == src) + continue if((S.frequency == src.frequency) && (S.code == src.code)) spawn(0) - if(S) S.pulse(0) + if(S) + S.pulse(0) return 0*/ /obj/item/device/assembly/signaler/receive_signal(datum/signal/signal) - if(!signal) return 0 - if(signal.encryption != code) return 0 - if(!(src.wires & WIRE_RADIO_RECEIVE)) return 0 + if(!signal) + return 0 + if(signal.encryption != code) + return 0 + if(!(src.wires & WIRE_RADIO_RECEIVE)) + return 0 pulse(1) audible_message("\icon[src] *beep* *beep*", null, 1) return diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 55f99638f2d..3432899486a 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -23,7 +23,8 @@ /obj/item/device/assembly/timer/activate() - if(!..()) return 0//Cooldown check + if(!..()) + return 0//Cooldown check timing = !timing update_icon() return 1 diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index a761abd4909..593b004d2bf 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -95,9 +95,12 @@ var/obj/machinery/gateway/centerstation/the_gateway = null /obj/machinery/gateway/centerstation/proc/toggleon(mob/user) - if(!ready) return - if(linked.len != 8) return - if(!powered()) return + if(!ready) + return + if(linked.len != 8) + return + if(!powered()) + return if(!awaygate) user << "Error: No destination found." return @@ -208,8 +211,10 @@ var/obj/machinery/gateway/centerstation/the_gateway = null /obj/machinery/gateway/centeraway/proc/toggleon(mob/user) - if(!ready) return - if(linked.len != 8) return + if(!ready) + return + if(linked.len != 8) + return if(!stationgate) user << "Error: No destination found." return diff --git a/code/modules/awaymissions/signpost.dm b/code/modules/awaymissions/signpost.dm index b25557db057..f6f3e1801b6 100644 --- a/code/modules/awaymissions/signpost.dm +++ b/code/modules/awaymissions/signpost.dm @@ -11,7 +11,8 @@ /obj/structure/signpost/attack_hand(mob/user) switch(alert("Travel back to ss13?",,"Yes","No")) if("Yes") - if(user.z != src.z) return + if(user.z != src.z) + return user.loc.loc.Exited(user) user.loc = pick(latejoin) if("No") diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index eb284af8c41..7fa75a4f31b 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -43,7 +43,8 @@ var/global/list/potentialSpaceRuins = generateMapList(filename = "config/spaceRu /proc/generateMapList(filename) var/list/potentialMaps = list() var/list/Lines = file2list(filename) - if(!Lines.len) return + if(!Lines.len) + return for (var/t in Lines) if (!t) continue diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 6fd6d507597..a13143bc65a 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -41,10 +41,14 @@ href_logfile << "[time2text(world.timeofday,"hh:mm")] [src] (usr:[usr]) || [hsrc ? "[hsrc] " : ""][href]
      " switch(href_list["_src_"]) - if("holder") hsrc = holder - if("usr") hsrc = mob - if("prefs") return prefs.process_link(usr,href_list) - if("vars") return view_var_Topic(href,href_list,hsrc) + if("holder") + hsrc = holder + if("usr") + hsrc = mob + if("prefs") + return prefs.process_link(usr,href_list) + if("vars") + return view_var_Topic(href,href_list,hsrc) ..() //redirect to hsrc.Topic() @@ -306,7 +310,8 @@ var/next_external_rsc = 0 //checks if a client is afk //3000 frames = 5 minutes /client/proc/is_afk(duration=3000) - if(inactivity > duration) return inactivity + if(inactivity > duration) + return inactivity return 0 // Byond seemingly calls stat, each tick. diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index ef4359a5861..8c5bc9d7683 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -115,7 +115,8 @@ var/list/preferences_datums = list() /datum/preferences/proc/ShowChoices(mob/user) - if(!user || !user.client) return + if(!user || !user.client) + return update_preview_icon() user << browse_rsc(preview_icon, "previewicon.png") var/dat = "
      " @@ -140,7 +141,8 @@ var/list/preferences_datums = list() for(var/i=1, i<=max_save_slots, i++) S.cd = "/character[i]" S["real_name"] >> name - if(!name) name = "Character[i]" + if(!name) + name = "Character[i]" //if(i!=1) dat += " | " dat += "[name] " dat += "
      " @@ -411,7 +413,8 @@ var/list/preferences_datums = list() popup.open(0) /datum/preferences/proc/SetChoices(mob/user, limit = 17, list/splitJobs = list("Chief Engineer"), widthPerColumn = 295, height = 620) - if(!SSjob) return + if(!SSjob) + return //limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice. //splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice. @@ -632,7 +635,8 @@ var/list/preferences_datums = list() /datum/preferences/proc/GetJobDepartment(datum/job/job, level) - if(!job || !level) return 0 + if(!job || !level) + return 0 switch(job.department_flag) if(CIVILIAN) switch(level) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 0b0245f4a41..2ebae5c1065 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -112,48 +112,78 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(current_version < 9) //an example, underwear were an index for a hardcoded list, converting to a string if(gender == MALE) switch(underwear) - if(1) underwear = "Mens White" - if(2) underwear = "Mens Grey" - if(3) underwear = "Mens Green" - if(4) underwear = "Mens Blue" - if(5) underwear = "Mens Black" - if(6) underwear = "Mankini" - if(7) underwear = "Mens Hearts Boxer" - if(8) underwear = "Mens Black Boxer" - if(9) underwear = "Mens Grey Boxer" - if(10) underwear = "Mens Striped Boxer" - if(11) underwear = "Mens Kinky" - if(12) underwear = "Mens Red" - if(13) underwear = "Nude" + if(1) + underwear = "Mens White" + if(2) + underwear = "Mens Grey" + if(3) + underwear = "Mens Green" + if(4) + underwear = "Mens Blue" + if(5) + underwear = "Mens Black" + if(6) + underwear = "Mankini" + if(7) + underwear = "Mens Hearts Boxer" + if(8) + underwear = "Mens Black Boxer" + if(9) + underwear = "Mens Grey Boxer" + if(10) + underwear = "Mens Striped Boxer" + if(11) + underwear = "Mens Kinky" + if(12) + underwear = "Mens Red" + if(13) + underwear = "Nude" else switch(underwear) - if(1) underwear = "Ladies Red" - if(2) underwear = "Ladies White" - if(3) underwear = "Ladies Yellow" - if(4) underwear = "Ladies Blue" - if(5) underwear = "Ladies Black" - if(6) underwear = "Ladies Thong" - if(7) underwear = "Babydoll" - if(8) underwear = "Ladies Baby-Blue" - if(9) underwear = "Ladies Green" - if(10) underwear = "Ladies Pink" - if(11) underwear = "Ladies Kinky" - if(12) underwear = "Tankini" - if(13) underwear = "Nude" + if(1) + underwear = "Ladies Red" + if(2) + underwear = "Ladies White" + if(3) + underwear = "Ladies Yellow" + if(4) + underwear = "Ladies Blue" + if(5) + underwear = "Ladies Black" + if(6) + underwear = "Ladies Thong" + if(7) + underwear = "Babydoll" + if(8) + underwear = "Ladies Baby-Blue" + if(9) + underwear = "Ladies Green" + if(10) + underwear = "Ladies Pink" + if(11) + underwear = "Ladies Kinky" + if(12) + underwear = "Tankini" + if(13) + underwear = "Nude" if(!(pref_species in species_list)) pref_species = new /datum/species/human() return /datum/preferences/proc/load_path(ckey,filename="preferences.sav") - if(!ckey) return + if(!ckey) + return path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/[filename]" /datum/preferences/proc/load_preferences() - if(!path) return 0 - if(!fexists(path)) return 0 + if(!path) + return 0 + if(!fexists(path)) + return 0 var/savefile/S = new /savefile(path) - if(!S) return 0 + if(!S) + return 0 S.cd = "/" var/needs_update = savefile_needs_update(S) @@ -202,9 +232,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return 1 /datum/preferences/proc/save_preferences() - if(!path) return 0 + if(!path) + return 0 var/savefile/S = new /savefile(path) - if(!S) return 0 + if(!S) + return 0 S.cd = "/" S["version"] << SAVEFILE_VERSION_MAX //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date @@ -229,12 +261,16 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return 1 /datum/preferences/proc/load_character(slot) - if(!path) return 0 - if(!fexists(path)) return 0 + if(!path) + return 0 + if(!fexists(path)) + return 0 var/savefile/S = new /savefile(path) - if(!S) return 0 + if(!S) + return 0 S.cd = "/" - if(!slot) slot = default_slot + if(!slot) + slot = default_slot slot = sanitize_integer(slot, 1, max_save_slots, initial(default_slot)) if(slot != default_slot) default_slot = slot @@ -315,7 +351,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car real_name = reject_bad_name(real_name) if(!features["mcolor"] || features["mcolor"] == "#000") features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F") - if(!real_name) real_name = random_unique_name(gender) + if(!real_name) + real_name = random_unique_name(gender) be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name)) be_random_body = sanitize_integer(be_random_body, 0, 1, initial(be_random_body)) gender = sanitize_gender(gender) @@ -360,9 +397,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return 1 /datum/preferences/proc/save_character() - if(!path) return 0 + if(!path) + return 0 var/savefile/S = new /savefile(path) - if(!S) return 0 + if(!S) + return 0 S.cd = "/character[default_slot]" S["version"] << SAVEFILE_VERSION_MAX //load_character will sanitize any bad data, so assume up-to-date. diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 4ac9a20fe8c..60ed195f9bf 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -58,7 +58,8 @@ set name = "Hear/Silence Adminhelps" set category = "Preferences" set desc = "Toggle hearing a notification when admin PMs are received" - if(!holder) return + if(!holder) + return prefs.toggles ^= SOUND_ADMINHELP prefs.save_preferences() usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive." @@ -68,7 +69,8 @@ set name = "Do/Don't Announce Login" set category = "Preferences" set desc = "Toggle if you want an announcement to admins when you login during a round" - if(!holder) return + if(!holder) + return prefs.toggles ^= ANNOUNCE_LOGIN prefs.save_preferences() usr << "You will [(prefs.toggles & ANNOUNCE_LOGIN) ? "now" : "no longer"] have an announcement to other admins when you login." @@ -214,7 +216,8 @@ var/global/list/ghost_forms = list("ghost","ghostking","ghostian2","skeleghost", set name = "Choose Ghost Form" set category = "Preferences" set desc = "Choose your preferred ghostly appearance." - if(!is_content_unlocked()) return + if(!is_content_unlocked()) + return var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in ghost_forms if(new_form) prefs.ghost_form = new_form @@ -258,7 +261,7 @@ var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS set name = "Toggle Ghost HUD" set category = "Preferences" set desc = "Hide/Show Ghost HUD" - + prefs.ghost_hud = !prefs.ghost_hud src << "Ghost HUD will now be [prefs.ghost_hud ? "visible" : "hidden"]." prefs.save_preferences() diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index 0f6e39d72cf..e4250170a4d 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -6,16 +6,16 @@ item_color = "cargo" var/flipped = 0 - dropped() - src.icon_state = "[item_color]soft" - src.flipped=0 - ..() +/obj/item/clothing/head/soft/dropped() + src.icon_state = "[item_color]soft" + src.flipped=0 + ..() - verb/flipcap() - set category = "Object" - set name = "Flip cap" +/obj/item/clothing/head/soft/verb/flipcap() + set category = "Object" + set name = "Flip cap" - flip(usr) + flip(usr) /obj/item/clothing/head/soft/AltClick(mob/user) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 88dd4e7d113..51cf2a1c2f6 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -25,8 +25,10 @@ icon_state = "[basestate][on]-[item_color]" user.update_inv_head() //so our mob-overlays update - if(on) user.AddLuminosity(brightness_on) - else user.AddLuminosity(-brightness_on) + if(on) + user.AddLuminosity(brightness_on) + else + user.AddLuminosity(-brightness_on) /obj/item/clothing/head/helmet/space/hardsuit/pickup(mob/user) diff --git a/code/modules/clothing/under/ties.dm b/code/modules/clothing/under/ties.dm index 90c3ca06834..bd53229055b 100644 --- a/code/modules/clothing/under/ties.dm +++ b/code/modules/clothing/under/ties.dm @@ -49,8 +49,10 @@ if(body_part) var/their = "their" switch(M.gender) - if(MALE) their = "his" - if(FEMALE) their = "her" + if(MALE) + their = "his" + if(FEMALE) + their = "her" var/sound = "pulse" var/sound_strength diff --git a/code/modules/detectivework/evidence.dm b/code/modules/detectivework/evidence.dm index 5f290278b75..d277998ef70 100644 --- a/code/modules/detectivework/evidence.dm +++ b/code/modules/detectivework/evidence.dm @@ -84,12 +84,13 @@ /obj/item/weapon/storage/box/evidence name = "evidence bag box" desc = "A box claiming to contain evidence bags." - New() - new /obj/item/weapon/evidencebag(src) - new /obj/item/weapon/evidencebag(src) - new /obj/item/weapon/evidencebag(src) - new /obj/item/weapon/evidencebag(src) - new /obj/item/weapon/evidencebag(src) - new /obj/item/weapon/evidencebag(src) - ..() - return \ No newline at end of file + +/obj/item/weapon/storage/box/evidence/New() + new /obj/item/weapon/evidencebag(src) + new /obj/item/weapon/evidencebag(src) + new /obj/item/weapon/evidencebag(src) + new /obj/item/weapon/evidencebag(src) + new /obj/item/weapon/evidencebag(src) + new /obj/item/weapon/evidencebag(src) + ..() + return \ No newline at end of file diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index 959a96de92e..d9939bedc56 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -25,7 +25,8 @@ /datum/round_event/presents/start() for(var/obj/structure/flora/tree/pine/xmas in world) - if(xmas.z != 1) continue + if(xmas.z != 1) + continue for(var/turf/simulated/floor/T in orange(1,xmas)) for(var/i=1,i<=rand(1,5),i++) new /obj/item/weapon/a_gift(T) diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm index 13c57a9a5a6..be99cd87469 100644 --- a/code/modules/events/radiation_storm.dm +++ b/code/modules/events/radiation_storm.dm @@ -20,8 +20,10 @@ /datum/round_event/radiation_storm/start() for(var/mob/living/carbon/C in living_mob_list) var/turf/T = get_turf(C) - if(!T) continue - if(T.z != 1) continue + if(!T) + continue + if(T.z != 1) + continue var/skip = 0 for(var/a in protected_areas) @@ -29,7 +31,8 @@ skip = 1 continue - if(skip) continue + if(skip) + continue if(locate(/obj/machinery/power/apc) in T) //damn you maint APCs!! continue diff --git a/code/modules/events/shuttle_loan.dm b/code/modules/events/shuttle_loan.dm index e3df65c5480..76ecd4a37fa 100644 --- a/code/modules/events/shuttle_loan.dm +++ b/code/modules/events/shuttle_loan.dm @@ -82,7 +82,8 @@ var/list/empty_shuttle_turfs = list() for(var/turf/simulated/floor/T in SSshuttle.supply.areaInstance) - if(T.density || T.contents.len) continue + if(T.density || T.contents.len) + continue empty_shuttle_turfs += T if(!empty_shuttle_turfs.len) return diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 72517dce58b..1f661c8bdba 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -506,7 +506,8 @@ var/list/obj/effect/spacevine/queue_end = list() for( var/obj/effect/spacevine/SV in growth_queue ) - if(SV.gc_destroyed) continue + if(SV.gc_destroyed) + continue i++ queue_end += SV growth_queue -= SV diff --git a/code/modules/events/wizard/aid.dm b/code/modules/events/wizard/aid.dm index 9e6008190f9..b472ab9796d 100644 --- a/code/modules/events/wizard/aid.dm +++ b/code/modules/events/wizard/aid.dm @@ -42,10 +42,15 @@ if(S.charge_max < S.charge_counter) S.charge_counter = S.charge_max switch(S.spell_level) - if(1) S.name = "Efficient [S.name]" - if(2) S.name = "Quickened [S.name]" - if(3) S.name = "Free [S.name]" - if(4) S.name = "Instant [S.name]" - if(5) S.name = "Ludicrous [S.name]" + if(1) + S.name = "Efficient [S.name]" + if(2) + S.name = "Quickened [S.name]" + if(3) + S.name = "Free [S.name]" + if(4) + S.name = "Instant [S.name]" + if(5) + S.name = "Ludicrous [S.name]" L << "You suddenly feel more competent with your casting!" diff --git a/code/modules/events/wizard/curseditems.dm b/code/modules/events/wizard/curseditems.dm index f437ccbe3f9..eb1d15c4038 100644 --- a/code/modules/events/wizard/curseditems.dm +++ b/code/modules/events/wizard/curseditems.dm @@ -21,7 +21,8 @@ if("wizardmimic") loadout = list(/obj/item/clothing/suit/wizrobe, /obj/item/clothing/shoes/sandal, /obj/item/clothing/head/wizard) ruins_spaceworthiness = 1 - if("swords") loadout[5] = /obj/item/weapon/katana/cursed + if("swords") + loadout[5] = /obj/item/weapon/katana/cursed if("bigfatdoobie") loadout[4] = /obj/item/clothing/mask/cigarette/rollie/trippy/ ruins_spaceworthiness = 1 @@ -29,15 +30,18 @@ loadout[4] = /obj/item/clothing/mask/luchador loadout[6] = /obj/item/clothing/gloves/boxing ruins_spaceworthiness = 1 - if("voicemodulators") loadout[4] = /obj/item/clothing/mask/gas/voice + if("voicemodulators") + loadout[4] = /obj/item/clothing/mask/gas/voice if("catgirls2015") loadout[3] = /obj/item/clothing/head/kitty ruins_spaceworthiness = 1 ruins_wizard_loadout = 1 for(var/mob/living/carbon/human/H in living_mob_list) - if(ruins_spaceworthiness && (H.z != 1 || istype(H.loc, /turf/space))) continue //#savetheminers - if(ruins_wizard_loadout && H.mind && ((H.mind in ticker.mode.wizards) || (H.mind in ticker.mode.apprentices))) continue + if(ruins_spaceworthiness && (H.z != 1 || istype(H.loc, /turf/space))) + continue //#savetheminers + if(ruins_wizard_loadout && H.mind && ((H.mind in ticker.mode.wizards) || (H.mind in ticker.mode.apprentices))) + continue if(item_set == "catgirls2015") //Wizard code means never having to say you're sorry H.gender = FEMALE var/list/slots = list(H.wear_suit, H.shoes, H.head, H.wear_mask, H.r_hand, H.gloves, H.ears) //add new slots as needed to back diff --git a/code/modules/events/wizard/imposter.dm b/code/modules/events/wizard/imposter.dm index ec6f4fa06c5..15b07a1c12d 100644 --- a/code/modules/events/wizard/imposter.dm +++ b/code/modules/events/wizard/imposter.dm @@ -8,10 +8,12 @@ /datum/round_event/wizard/imposter/start() for(var/datum/mind/M in ticker.mode.wizards) - if(!ishuman(M.current)) continue + if(!ishuman(M.current)) + continue var/mob/living/carbon/human/W = M.current var/list/candidates = get_candidates(ROLE_WIZARD) - if(!candidates) return //Sad Trombone + if(!candidates) + return //Sad Trombone var/client/C = pick(candidates) PoolOrNew(/obj/effect/particle_effect/smoke, W.loc) @@ -22,12 +24,18 @@ I.name = I.dna.real_name I.updateappearance(mutcolor_update=1) I.domutcheck() - if(W.ears) I.equip_to_slot_or_del(new W.ears.type, slot_ears) - if(W.w_uniform) I.equip_to_slot_or_del(new W.w_uniform.type , slot_w_uniform) - if(W.shoes) I.equip_to_slot_or_del(new W.shoes.type, slot_shoes) - if(W.wear_suit) I.equip_to_slot_or_del(new W.wear_suit.type, slot_wear_suit) - if(W.head) I.equip_to_slot_or_del(new W.head.type, slot_head) - if(W.back) I.equip_to_slot_or_del(new W.back.type, slot_back) + if(W.ears) + I.equip_to_slot_or_del(new W.ears.type, slot_ears) + if(W.w_uniform) + I.equip_to_slot_or_del(new W.w_uniform.type , slot_w_uniform) + if(W.shoes) + I.equip_to_slot_or_del(new W.shoes.type, slot_shoes) + if(W.wear_suit) + I.equip_to_slot_or_del(new W.wear_suit.type, slot_wear_suit) + if(W.head) + I.equip_to_slot_or_del(new W.head.type, slot_head) + if(W.back) + I.equip_to_slot_or_del(new W.back.type, slot_back) I.key = C.key //Operation: Fuck off and scare people diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index 623db831b6a..74076112f1d 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -13,17 +13,20 @@ var/list/mobs = list() for(var/mob/living/carbon/human/H in living_mob_list) - if(H.z != 1) continue //lets not try to strand people in space or stuck in the wizards den + if(H.z != 1) + continue //lets not try to strand people in space or stuck in the wizards den moblocs += H.loc mobs += H - if(!mobs) return + if(!mobs) + return shuffle(moblocs) shuffle(mobs) for(var/mob/living/carbon/human/H in mobs) - if(!moblocs) break //locs aren't always unique, so this may come into play + if(!moblocs) + break //locs aren't always unique, so this may come into play do_teleport(H, moblocs[moblocs.len]) moblocs.len -= 1 @@ -49,13 +52,15 @@ mobnames += H.real_name mobs += H - if(!mobs) return + if(!mobs) + return shuffle(mobnames) shuffle(mobs) for(var/mob/living/carbon/human/H in mobs) - if(!mobnames) break + if(!mobnames) + break H.real_name = mobnames[mobnames.len] mobnames.len -= 1 @@ -77,10 +82,12 @@ var/list/mobs = list() for(var/mob/living/carbon/human/H in living_mob_list) - if(!H.stat || !H.mind || (H.mind in ticker.mode.wizards) || (H.mind in ticker.mode.apprentices)) continue //the wizard(s) are spared on this one + if(!H.stat || !H.mind || (H.mind in ticker.mode.wizards) || (H.mind in ticker.mode.apprentices)) + continue //the wizard(s) are spared on this one mobs += H - if(!mobs) return + if(!mobs) + return shuffle(mobs) diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm index ba051b22f9d..7ae77f055d6 100644 --- a/code/modules/events/wormholes.dm +++ b/code/modules/events/wormholes.dm @@ -34,7 +34,8 @@ if(activeFor % shift_frequency == 0) for(var/obj/effect/portal/wormhole/O in wormholes) var/turf/T = pick(pick_turfs) - if(T) O.loc = T + if(T) + O.loc = T /datum/round_event/wormholes/end() portals.Remove(wormholes) @@ -67,5 +68,6 @@ var/obj/effect/portal/P = pick(portals) if(P && isturf(P.loc)) target = P.loc - if(!target) return + if(!target) + return do_teleport(M, target, 1, 1, 0, 0) ///You will appear adjacent to the beacon \ No newline at end of file diff --git a/code/modules/food&drinks/food/snacks.dm b/code/modules/food&drinks/food/snacks.dm index ec95ab2298d..cac9c7a6c51 100644 --- a/code/modules/food&drinks/food/snacks.dm +++ b/code/modules/food&drinks/food/snacks.dm @@ -22,7 +22,8 @@ //Placeholder for effect that trigger on eating that aren't tied to reagents. /obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume() - if(!usr) return + if(!usr) + return if(!reagents.total_volume) usr.unEquip(src) //so icons update :[ @@ -259,7 +260,7 @@ // name = "Xenoburger" //Name that displays in the UI. // desc = "Smells caustic. Tastes like heresy." //Duh // icon_state = "xburger" //Refers to an icon in food.dmi -// New() //Don't mess with this. +///obj/item/weapon/reagent_containers/food/snacks/xenoburger/New() //Don't mess with this. // ..() //Same here. // reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste // reagents.add_reagent("nutriment", 2) // this line of code for all the contents. diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index baec9c92ea7..3f570dcf2d8 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -77,14 +77,19 @@ user.visible_message("\The [user] shuffles [src].") /obj/item/weapon/deck/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params) - if(flag) return //It's adjacent, is the user, or is on the user's person + if(flag) + return //It's adjacent, is the user, or is on the user's person - if (istype(A, /mob/living)) src.dealTo(A, user) - else return ..() + if (istype(A, /mob/living)) + src.dealTo(A, user) + else + return ..() /obj/item/weapon/deck/attack(mob/living/M, mob/living/user, def_zone) - if (istype(M)) src.dealTo(M, user) - else return ..() + if (istype(M)) + src.dealTo(M, user) + else + return ..() /obj/item/weapon/deck/proc/dealTo(mob/living/target, mob/living/source) if (!cards.len) @@ -126,7 +131,8 @@ src.update_conceal() /obj/item/weapon/hand/Destroy() - if (src.hi) qdel(src.hi) + if (src.hi) + qdel(src.hi) return ..() @@ -139,14 +145,16 @@ H.update_icon() qdel(src) - else return ..() + else + return ..() /obj/item/weapon/hand/verb/discard(datum/playingcard/card in cards) set category = "Object" set name = "Discard" set desc = "Place a card from your hand in front of you." - if (!card) return + if (!card) + return var/obj/item/weapon/hand/H = new(src.loc) @@ -191,11 +199,14 @@ usr.show_message("The [card.name].", 1) /obj/item/weapon/hand/proc/update_conceal() - if (src.concealed) src.hi.updateContent("headbar", "You are currently concealing your hand. Reveal your hand.") - else src.hi.updateContent("headbar", "You are currently revealing your hand. Conceal your hand.") + if (src.concealed) + src.hi.updateContent("headbar", "You are currently concealing your hand. Reveal your hand.") + else + src.hi.updateContent("headbar", "You are currently revealing your hand. Conceal your hand.") /obj/item/weapon/hand/update_icon() - if (!cards.len) qdel (src) + if (!cards.len) + qdel (src) else if(cards.len > 1) name = "hand of cards" diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index ef83cd9d95e..13cfc2ea89d 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -86,15 +86,24 @@ var/game_age = text2num(time2text(world.timeofday, "YY")) - 3 var/Fact switch(game_age) - if(16) Fact = " SS13 is now old enough to drive!" - if(18) Fact = " SS13 is now legal!" - if(21) Fact = " SS13 can now drink!" - if(26) Fact = " SS13 can now rent a car!" - if(30) Fact = " SS13 can now go home and be a family man!" - if(40) Fact = " SS13 can now suffer a midlife crisis!" - if(50) Fact = " Happy golden anniversary!" - if(65) Fact = " SS13 can now start thinking about retirement!" - if(96) Fact = " Please send a time machine back to pick me up, I need to update the time formatting for this feature!" //See you later suckers + if(16) + Fact = " SS13 is now old enough to drive!" + if(18) + Fact = " SS13 is now legal!" + if(21) + Fact = " SS13 can now drink!" + if(26) + Fact = " SS13 can now rent a car!" + if(30) + Fact = " SS13 can now go home and be a family man!" + if(40) + Fact = " SS13 can now suffer a midlife crisis!" + if(50) + Fact = " Happy golden anniversary!" + if(65) + Fact = " SS13 can now start thinking about retirement!" + if(96) + Fact = " Please send a time machine back to pick me up, I need to update the time formatting for this feature!" //See you later suckers if(!Fact) Fact = " SS13 is now [game_age] years old!" diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm index e547b1ca813..d0beeca9d4d 100644 --- a/code/modules/holodeck/holo_effect.dm +++ b/code/modules/holodeck/holo_effect.dm @@ -8,17 +8,20 @@ icon = 'icons/mob/screen_gen.dmi' icon_state = "x2" invisibility = 101 - proc/activate(var/obj/machinery/computer/holodeck/HC) - return - proc/deactivate(var/obj/machinery/computer/holodeck/HC) - qdel(src) - return - // Called by the holodeck computer as long as the program is running - proc/tick(var/obj/machinery/computer/holodeck/HC) - return - proc/safety(var/active) - return +/obj/effect/holodeck_effect/proc/activate(var/obj/machinery/computer/holodeck/HC) + return + +/obj/effect/holodeck_effect/proc/deactivate(var/obj/machinery/computer/holodeck/HC) + qdel(src) + return + +// Called by the holodeck computer as long as the program is running +/obj/effect/holodeck_effect/proc/tick(var/obj/machinery/computer/holodeck/HC) + return + +/obj/effect/holodeck_effect/proc/safety(var/active) + return // Generates a holodeck-tracked card deck @@ -34,7 +37,8 @@ return D /obj/effect/holodeck_effect/cards/safety(active) - if(!D) return + if(!D) + return if(active) D.card_hitsound = null D.card_force = 0 @@ -67,7 +71,8 @@ var/mob/mob = null /obj/effect/holodeck_effect/mobspawner/activate(var/obj/machinery/computer/holodeck/HC) - if(islist(mobtype)) mobtype = pick(mobtype) + if(islist(mobtype)) + mobtype = pick(mobtype) mob = new mobtype(loc) // these vars are not really standardized but all would theoretically create stuff on death @@ -76,7 +81,8 @@ return mob /obj/effect/holodeck_effect/mobspawner/deactivate(var/obj/machinery/computer/holodeck/HC) - if(mob) HC.derez(mob) + if(mob) + HC.derez(mob) qdel(src) /obj/effect/holodeck_effect/mobspawner/pet @@ -84,4 +90,4 @@ /mob/living/simple_animal/butterfly, /mob/living/simple_animal/chick/holo, /mob/living/simple_animal/pet/cat, /mob/living/simple_animal/pet/cat/kitten, /mob/living/simple_animal/pet/dog/corgi, /mob/living/simple_animal/pet/dog/corgi/puppy, - /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/pet/fox) \ No newline at end of file + /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/pet/fox) diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index 769db5bddc7..d8c03fe3c8f 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -23,13 +23,11 @@ armour_penetration = 50 var/active = 0 -/obj/item/weapon/holo/esword/green - New() - item_color = "green" +/obj/item/weapon/holo/esword/green/New() + item_color = "green" -/obj/item/weapon/holo/esword/red - New() - item_color = "red" +/obj/item/weapon/holo/esword/red/New() + item_color = "red" /obj/item/weapon/holo/esword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance) if(active) diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index eed08060cfc..194a436024c 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -281,7 +281,8 @@ desc = "A synthetic banana peel." /obj/item/weapon/grown/bananapeel/specialpeel/Crossed(AM) - if(..()) qdel(src) + if(..()) + qdel(src) /obj/item/weapon/grown/bananapeel/mimanapeel name = "mimana peel" diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index cd6ed978b57..1ccab8f833b 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -430,14 +430,22 @@ // Requires 5 mutagen to possibly change species.// Poor man's mutagen. if(S.has_reagent("mutagen", 5) || S.has_reagent("radium", 10) || S.has_reagent("uranium", 10)) switch(rand(100)) - if(91 to 100) plantdies() - if(81 to 90) mutatespecie() - if(66 to 80) hardmutate() - if(41 to 65) mutate() - if(21 to 41) usr << "The plants don't seem to react..." - if(11 to 20) mutateweed() - if(1 to 10) mutatepest() - else usr << "Nothing happens..." + if(91 to 100) + plantdies() + if(81 to 90) + mutatespecie() + if(66 to 80) + hardmutate() + if(41 to 65) + mutate() + if(21 to 41) + usr << "The plants don't seem to react..." + if(11 to 20) + mutateweed() + if(1 to 10) + mutatepest() + else + usr << "Nothing happens..." // 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen else if(S.has_reagent("mutagen", 2) || S.has_reagent("radium", 5) || S.has_reagent("uranium", 5)) @@ -623,10 +631,14 @@ adjustWeeds(-rand(1,5)) if(S.has_reagent("adminordrazine", 5)) switch(rand(100)) - if(66 to 100) mutatespecie() - if(33 to 65) mutateweed() - if(1 to 32) mutatepest() - else usr << "Nothing happens..." + if(66 to 100) + mutatespecie() + if(33 to 65) + mutateweed() + if(1 to 32) + mutatepest() + else + usr << "Nothing happens..." /obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params) @@ -843,7 +855,8 @@ while(t_amount < getYield()) var/obj/item/weapon/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, potency) result.Add(t_prod) // User gets a consumable - if(!t_prod) return + if(!t_prod) + return t_prod.lifespan = lifespan t_prod.endurance = endurance t_prod.maturation = maturation diff --git a/code/modules/mining/machine_input_output_plates.dm b/code/modules/mining/machine_input_output_plates.dm index e17cc7107f9..0049c86ae92 100644 --- a/code/modules/mining/machine_input_output_plates.dm +++ b/code/modules/mining/machine_input_output_plates.dm @@ -6,8 +6,9 @@ name = "Input area" density = 0 anchored = 1 - New() - icon_state = "blank" + +/obj/machinery/mineral/input/New() + icon_state = "blank" /obj/machinery/mineral/output icon = 'icons/mob/screen_gen.dmi' @@ -15,8 +16,9 @@ name = "Output area" density = 0 anchored = 1 - New() - icon_state = "blank" + +/obj/machinery/mineral/output/New() + icon_state = "blank" /obj/machinery/mineral var/input_dir = NORTH diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 65643040b5c..7e7deb0f100 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -52,7 +52,8 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi mind = body.mind //we don't transfer the mind but we keep a reference to it. - if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position + if(!T) + T = pick(latejoin) //Safety in case we cannot find the body's position loc = T if(!name) //To prevent nameless ghosts @@ -105,7 +106,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp ghostize(1) else var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst still alive you may not play again this round! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body") - if(response != "Ghost") return //didn't want to ghost after-all + if(response != "Ghost") + return //didn't want to ghost after-all ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 return @@ -146,7 +148,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/verb/reenter_corpse() set category = "Ghost" set name = "Re-enter Corpse" - if(!client) return + if(!client) + return if(!(mind && mind.current)) src << "You have no body." return @@ -185,7 +188,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/A A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas var/area/thearea = A - if(!thearea) return + if(!thearea) + return var/list/L = list() for(var/turf/T in get_area_turfs(thearea.type)) diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm index b4e99618555..5fc95dcfeef 100644 --- a/code/modules/mob/interactive.dm +++ b/code/modules/mob/interactive.dm @@ -636,26 +636,23 @@ nearby += M //END OF MODULES -/mob/living/carbon/human/interactive/angry - New() - TRAITS |= TRAIT_ROBUST - TRAITS |= TRAIT_MEAN - faction = list("bot_angry") - ..() +/mob/living/carbon/human/interactive/angry/New() + TRAITS |= TRAIT_ROBUST + TRAITS |= TRAIT_MEAN + faction = list("bot_angry") + ..() -/mob/living/carbon/human/interactive/friendly - New() - TRAITS |= TRAIT_FRIENDLY - TRAITS |= TRAIT_UNROBUST - faction = list("bot_friendly") - ..() +/mob/living/carbon/human/interactive/friendly/New() + TRAITS |= TRAIT_FRIENDLY + TRAITS |= TRAIT_UNROBUST + faction = list("bot_friendly") + ..() -/mob/living/carbon/human/interactive/greytide - New() - TRAITS |= TRAIT_ROBUST - TRAITS |= TRAIT_MEAN - TRAITS |= TRAIT_THIEVING - TRAITS |= TRAIT_DUMB - faction = list("bot_grey") - graytide = 1 - ..() +/mob/living/carbon/human/interactive/greytide/New() + TRAITS |= TRAIT_ROBUST + TRAITS |= TRAIT_MEAN + TRAITS |= TRAIT_THIEVING + TRAITS |= TRAIT_DUMB + faction = list("bot_grey") + graytide = 1 + ..() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 753b66235b6..ea40fe9548b 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -3,14 +3,18 @@ //Returns the thing in our active hand /mob/proc/get_active_hand() - if(hand) return l_hand - else return r_hand + if(hand) + return l_hand + else + return r_hand //Returns the thing in our inactive hand /mob/proc/get_inactive_hand() - if(hand) return r_hand - else return l_hand + if(hand) + return r_hand + else + return l_hand //Returns if a certain item can be equipped to a certain slot. @@ -28,8 +32,10 @@ W.layer = 20 //TODO: move to equipped? // l_hand.screen_loc = ui_lhand W.equipped(src,slot_l_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(client) + client.screen |= W + if(pulling == W) + stop_pulling() update_inv_l_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) @@ -46,8 +52,10 @@ r_hand = W W.layer = 20 W.equipped(src,slot_r_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(client) + client.screen |= W + if(pulling == W) + stop_pulling() update_inv_r_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) @@ -55,29 +63,38 @@ return 0 /mob/proc/put_in_hand_check(obj/item/W) - if(lying && !(W.flags&ABSTRACT)) return 0 - if(!istype(W)) return 0 + if(lying && !(W.flags&ABSTRACT)) + return 0 + if(!istype(W)) + return 0 return 1 //Puts the item into our active hand if possible. returns 1 on success. /mob/proc/put_in_active_hand(obj/item/W) - if(hand) return put_in_l_hand(W) - else return put_in_r_hand(W) + if(hand) + return put_in_l_hand(W) + else + return put_in_r_hand(W) //Puts the item into our inactive hand if possible. returns 1 on success. /mob/proc/put_in_inactive_hand(obj/item/W) - if(hand) return put_in_r_hand(W) - else return put_in_l_hand(W) + if(hand) + return put_in_r_hand(W) + else + return put_in_l_hand(W) //Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success. //If both fail it drops it on the floor and returns 0. //This is probably the main one you need to know :) /mob/proc/put_in_hands(obj/item/W) - if(!W) return 0 - if(put_in_active_hand(W)) return 1 - else if(put_in_inactive_hand(W)) return 1 + if(!W) + return 0 + if(put_in_active_hand(W)) + return 1 + else if(put_in_inactive_hand(W)) + return 1 else W.loc = get_turf(src) W.layer = initial(W.layer) @@ -107,8 +124,10 @@ //Drops the item in our active hand. /mob/proc/drop_item() - if(hand) return drop_l_hand() - else return drop_r_hand() + if(hand) + return drop_l_hand() + else + return drop_r_hand() //Here lie drop_from_inventory and before_item_take, already forgotten and not missed. @@ -156,21 +175,49 @@ /mob/proc/get_equipped_items() var/list/items = new/list() - if(hasvar(src,"back")) if(src:back) items += src:back - if(hasvar(src,"belt")) if(src:belt) items += src:belt - if(hasvar(src,"ears")) if(src:ears) items += src:ears - if(hasvar(src,"glasses")) if(src:glasses) items += src:glasses - if(hasvar(src,"gloves")) if(src:gloves) items += src:gloves - if(hasvar(src,"head")) if(src:head) items += src:head - if(hasvar(src,"shoes")) if(src:shoes) items += src:shoes - if(hasvar(src,"wear_id")) if(src:wear_id) items += src:wear_id - if(hasvar(src,"wear_mask")) if(src:wear_mask) items += src:wear_mask - if(hasvar(src,"wear_suit")) if(src:wear_suit) items += src:wear_suit -// if(hasvar(src,"w_radio")) if(src:w_radio) items += src:w_radio commenting this out since headsets go on your ears now PLEASE DON'T BE MAD KEELIN - if(hasvar(src,"w_uniform")) if(src:w_uniform) items += src:w_uniform + if(hasvar(src,"back")) + if(src:back) + items += src:back + if(hasvar(src,"belt")) + if(src:belt) + items += src:belt + if(hasvar(src,"ears")) + if(src:ears) + items += src:ears + if(hasvar(src,"glasses")) + if(src:glasses) + items += src:glasses + if(hasvar(src,"gloves")) + if(src:gloves) + items += src:gloves + if(hasvar(src,"head")) + if(src:head) + items += src:head + if(hasvar(src,"shoes")) + if(src:shoes) + items += src:shoes + if(hasvar(src,"wear_id")) + if(src:wear_id) + items += src:wear_id + if(hasvar(src,"wear_mask")) + if(src:wear_mask) + items += src:wear_mask + if(hasvar(src,"wear_suit")) + if(src:wear_suit) + items += src:wear_suit +/* if(hasvar(src,"w_radio")) + if(src:w_radio) + items += src:w_radio commenting this out since headsets go on your ears now PLEASE DON'T BE MAD KEELIN */ + if(hasvar(src,"w_uniform")) + if(src:w_uniform) + items += src:w_uniform - //if(hasvar(src,"l_hand")) if(src:l_hand) items += src:l_hand - //if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand +/* if(hasvar(src,"l_hand")) + if(src:l_hand) + items += src:l_hand + if(hasvar(src,"r_hand")) + if(src:r_hand) + items += src:r_hand*/ return items diff --git a/code/modules/mob/living/carbon/alien/humanoid/death.dm b/code/modules/mob/living/carbon/alien/humanoid/death.dm index 9e2d3706d6c..4db8c18ac71 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/death.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/death.dm @@ -1,17 +1,21 @@ /mob/living/carbon/alien/humanoid/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health6" + if(stat == DEAD) + return + if(healths) + healths.icon_state = "health6" stat = DEAD if(!gibbed) playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1) visible_message("[src] lets out a waning guttural screech, green blood bubbling from its maw...") update_canmove() - if(client) blind.layer = 0 + if(client) + blind.layer = 0 update_icons() status_flags |=CANPUSH tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) + if(mind) + mind.store_memory("Time of death: [tod]", 0) return ..(gibbed) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index e8e94b0f044..74e23947a4c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -27,8 +27,10 @@ /mob/living/carbon/alien/humanoid/royal/queen/New() //there should only be one queen for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in living_mob_list) - if(Q == src) continue - if(Q.stat == DEAD) continue + if(Q == src) + continue + if(Q.stat == DEAD) + continue if(Q.client) name = "alien princess ([rand(1, 999)])" //if this is too cutesy feel free to change it/remove it. break diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index 67edcfd04ca..61acfbe26a0 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -1,6 +1,8 @@ /mob/living/carbon/alien/larva/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health6" + if(stat == DEAD) + return + if(healths) + healths.icon_state = "health6" stat = DEAD icon_state = "larva_dead" @@ -10,7 +12,8 @@ if(client) blind.layer = 0 tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) + if(mind) + mind.store_memory("Time of death: [tod]", 0) living_mob_list -= src return ..(gibbed) diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index fbaa5e16486..c8d4b15e040 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -16,8 +16,10 @@ return ..() /mob/living/carbon/brain/update_canmove() - if(in_contents_of(/obj/mecha)) canmove = 1 - else canmove = 0 + if(in_contents_of(/obj/mecha)) + canmove = 1 + else + canmove = 0 return canmove /mob/living/carbon/brain/toggle_throw_mode() diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/carbon/brain/death.dm index 889c0826459..0bf4f3f3e01 100644 --- a/code/modules/mob/living/carbon/brain/death.dm +++ b/code/modules/mob/living/carbon/brain/death.dm @@ -1,5 +1,6 @@ /mob/living/carbon/brain/death(gibbed) - if(stat == DEAD) return + if(stat == DEAD) + return if(!gibbed && container && istype(container, /obj/item/device/mmi))//If not gibbed but in a container. container.visible_message("[src]'s MMI flatlines!", \ "You hear something flatline.") @@ -15,7 +16,8 @@ see_invisible = SEE_INVISIBLE_LEVEL_TWO tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) //mind. ? + if(mind) + mind.store_memory("Time of death: [tod]", 0) //mind. ? return ..(gibbed) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 40727647cd7..024d73bab96 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -109,7 +109,8 @@ var/global/posibrain_notif_cooldown = 0 set src in oview() - if(!usr || !src) return + if(!usr || !src) + return if( (usr.disabilities & BLIND || usr.stat) && !istype(usr,/mob/dead/observer) ) usr << "Something is there but you can't see it." return @@ -120,9 +121,12 @@ var/global/posibrain_notif_cooldown = 0 if(brainmob && brainmob.key) switch(brainmob.stat) if(CONSCIOUS) - if(!src.brainmob.client) msg += "It appears to be in stand-by mode.\n" //afk - if(UNCONSCIOUS) msg += "It doesn't seem to be responsive.\n" - if(DEAD) msg += "It appears to be completely inactive.\n" + if(!src.brainmob.client) + msg += "It appears to be in stand-by mode.\n" //afk + if(UNCONSCIOUS) + msg += "It doesn't seem to be responsive.\n" + if(DEAD) + msg += "It appears to be completely inactive.\n" else msg += "It appears to be completely inactive. The reset light is blinking.\n" msg += "*---------*" diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 365c881dac9..efb95033f41 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -37,7 +37,8 @@ dna.species.spec_death(gibbed,src) tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) + if(mind) + mind.store_memory("Time of death: [tod]", 0) if(ticker && ticker.mode) // world.log << "k" sql_report_death(src) @@ -50,7 +51,8 @@ return 1 /mob/living/carbon/proc/ChangeToHusk() - if(disabilities & HUSK) return + if(disabilities & HUSK) + return disabilities |= HUSK status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools return 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index dd769db25f5..c2df7475688 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -156,12 +156,14 @@ update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05) if("r_leg") update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05) - if(update) update_damage_overlays(0) + if(update) + update_damage_overlays(0) ..() /mob/living/carbon/human/blob_act() - if(stat == DEAD) return + if(stat == DEAD) + return show_message("The blob attacks you!") var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") var/obj/item/organ/limb/affecting = get_organ(ran_zone(dam_zone)) @@ -378,8 +380,10 @@ var/datum/data/record/R = find_record("name", perpname, data_core.general) if(href_list["photo_front"] || href_list["photo_side"]) if(R) - if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud)) return + if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud)) + return var/obj/item/weapon/photo/P = null if(href_list["photo_front"]) P = R.fields["photo_front"] @@ -393,16 +397,20 @@ if(href_list["p_stat"]) var/health = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel") if(R) - if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health)) return + if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + return if(health && health != "Cancel") R.fields["p_stat"] = health return if(href_list["m_stat"]) var/health = input(usr, "Specify a new mental status for this person.", "Medical HUD", R.fields["m_stat"]) in list("Stable", "*Watch*", "*Unstable*", "*Insane*", "Cancel") if(R) - if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health)) return + if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health)) + return if(health && health != "Cancel") R.fields["m_stat"] = health return @@ -483,8 +491,10 @@ if(href_list["view"]) if(R) - if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) return + if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) + return usr << "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]" usr << "Minor Crimes:" for(var/datum/data/crime/c in R.fields["mi_crim"]) @@ -508,9 +518,12 @@ var/t1 = stripped_input("Please input minor crime names:", "Security HUD", "", null) var/t2 = stripped_multiline_input("Please input minor crime details:", "Security HUD", "", null) if(R) - if (!t1 || !t2 || !allowed_access) return - else if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) return + if (!t1 || !t2 || !allowed_access) + return + else if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) + return var/crime = data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) data_core.addMinorCrime(R.fields["id"], crime) usr << "Successfully added a minor crime." @@ -520,9 +533,12 @@ var/t1 = stripped_input("Please input major crime names:", "Security HUD", "", null) var/t2 = stripped_multiline_input("Please input major crime details:", "Security HUD", "", null) if(R) - if (!t1 || !t2 || !allowed_access) return - else if (!H.canUseHUD()) return - else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) return + if (!t1 || !t2 || !allowed_access) + return + else if (!H.canUseHUD()) + return + else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) + return var/crime = data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) data_core.addMajorCrime(R.fields["id"], crime) usr << "Successfully added a major crime." @@ -530,8 +546,10 @@ if(href_list["view_comment"]) if(R) - if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) return + if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) + return usr << "Comments/Log:" var/counter = 1 while(R.fields[text("com_[]", counter)]) @@ -544,9 +562,12 @@ if(R) var/t1 = stripped_multiline_input("Add Comment:", "Secure. records", null, null) if(R) - if (!t1 || !allowed_access) return - else if(!H.canUseHUD()) return - else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) return + if (!t1 || !allowed_access) + return + else if(!H.canUseHUD()) + return + else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security)) + return var/counter = 1 while(R.fields[text("com_[]", counter)]) counter++ diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 37f501760a5..860e0998915 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -78,7 +78,8 @@ //It automatically updates health status /mob/living/carbon/human/heal_organ_damage(brute, burn) var/list/obj/item/organ/limb/parts = get_damaged_organs(brute,burn) - if(!parts.len) return + if(!parts.len) + return var/obj/item/organ/limb/picked = pick(parts) if(picked.heal_damage(brute,burn,0)) update_damage_overlays(0) @@ -89,7 +90,8 @@ //It automatically updates health status /mob/living/carbon/human/take_organ_damage(brute, burn) var/list/obj/item/organ/limb/parts = get_damageable_organs() - if(!parts.len) return + if(!parts.len) + return var/obj/item/organ/limb/picked = pick(parts) if(picked.take_damage(brute,burn)) update_damage_overlays(0) @@ -115,11 +117,13 @@ parts -= picked updatehealth() - if(update) update_damage_overlays(0) + if(update) + update_damage_overlays(0) // damage MANY external organs, in random order /mob/living/carbon/human/take_overall_damage(brute, burn) - if(status_flags & GODMODE) return //godmode + if(status_flags & GODMODE) + return //godmode var/list/obj/item/organ/limb/parts = get_damageable_organs() var/update = 0 @@ -141,7 +145,8 @@ updatehealth() - if(update) update_damage_overlays(0) + if(update) + update_damage_overlays(0) /mob/living/carbon/human/proc/restore_blood() if(!(NOBLOOD in dna.species.specflags)) @@ -152,7 +157,8 @@ /mob/living/carbon/human/proc/get_organ(zone) - if(!zone) zone = "chest" + if(!zone) + zone = "chest" for(var/obj/item/organ/limb/O in organs) if(O.name == zone) return O diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7c0df56c7b8..3e3e62ea25d 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -17,11 +17,13 @@ /mob/living/carbon/human/proc/checkarmor(obj/item/organ/limb/def_zone, type) - if(!type) return 0 + if(!type) + return 0 var/protection = 0 var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform, back, gloves, shoes, belt, s_store, glasses, ears, wear_id) //Everything but pockets. Pockets are l_store and r_store. (if pockets were allowed, putting something armored, gloves or hats for example, would double up on the armor) for(var/bp in body_parts) - if(!bp) continue + if(!bp) + continue if(bp && istype(bp ,/obj/item/clothing)) var/obj/item/clothing/C = bp if(C.body_parts_covered & def_zone.body_part) @@ -93,7 +95,8 @@ /mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone) - if(!I || !user) return 0 + if(!I || !user) + return 0 var/obj/item/organ/limb/target_limb = get_organ(check_zone(user.zone_sel.selecting)) var/obj/item/organ/limb/affecting = get_organ(ran_zone(user.zone_sel.selecting)) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index d54dc627d9c..1ea6aed3130 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -66,10 +66,14 @@ var/obj/item/weapon/storage/wallet/wallet = wear_id var/obj/item/device/pda/pda = wear_id var/obj/item/weapon/card/id/id = wear_id - if(istype(wallet)) id = wallet.front_id - if(istype(id)) . = id.registered_name - else if(istype(pda)) . = pda.owner - if(!.) . = if_no_id //to prevent null-names making the mob unclickable + if(istype(wallet)) + id = wallet.front_id + if(istype(id)) + . = id.registered_name + else if(istype(pda)) + . = pda.owner + if(!.) + . = if_no_id //to prevent null-names making the mob unclickable return //gets ID card object from special clothes slot or null. diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 27a76f7eec2..fab5f83fbda 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -265,9 +265,11 @@ /mob/living/carbon/human/handle_vision() client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) if(machine) - if(!machine.check_eye(src)) reset_view(null) + if(!machine.check_eye(src)) + reset_view(null) else - if(!remote_view && !client.adminobs) reset_view(null) + if(!remote_view && !client.adminobs) + reset_view(null) dna.species.handle_vision(src) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 061a26d4387..6d9fd7638c1 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -669,7 +669,8 @@ if( H.stat == DEAD ) H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + if(!H.druggy) + H.see_invisible = SEE_INVISIBLE_LEVEL_TWO else if(!(SEE_TURFS & H.permanent_sight_flags)) H.sight &= ~SEE_TURFS @@ -723,7 +724,8 @@ if( H.disabilities & NEARSIGHT && !istype(H.glasses, /obj/item/clothing/glasses/regular) ) H.client.screen += global_hud.vimpaired - if(H.eye_blurry) H.client.screen += global_hud.blurry + if(H.eye_blurry) + H.client.screen += global_hud.blurry if(H.druggy) H.client.screen += global_hud.druggy H.throw_alert("high", /obj/screen/alert/high) @@ -732,8 +734,10 @@ if(H.eye_stat > 20) - if(H.eye_stat > 30) H.client.screen += global_hud.darkMask - else H.client.screen += global_hud.vimpaired + if(H.eye_stat > 30) + H.client.screen += global_hud.darkMask + else + H.client.screen += global_hud.vimpaired return 1 @@ -743,18 +747,28 @@ H.healths.icon_state = "health7" else switch(H.hal_screwyhud) - if(1) H.healths.icon_state = "health6" - if(2) H.healths.icon_state = "health7" - if(5) H.healths.icon_state = "health0" + if(1) + H.healths.icon_state = "health6" + if(2) + H.healths.icon_state = "health7" + if(5) + H.healths.icon_state = "health0" else switch(H.health - H.staminaloss) - if(100 to INFINITY) H.healths.icon_state = "health0" - if(80 to 100) H.healths.icon_state = "health1" - if(60 to 80) H.healths.icon_state = "health2" - if(40 to 60) H.healths.icon_state = "health3" - if(20 to 40) H.healths.icon_state = "health4" - if(0 to 20) H.healths.icon_state = "health5" - else H.healths.icon_state = "health6" + if(100 to INFINITY) + H.healths.icon_state = "health0" + if(80 to 100) + H.healths.icon_state = "health1" + if(60 to 80) + H.healths.icon_state = "health2" + if(40 to 60) + H.healths.icon_state = "health3" + if(20 to 40) + H.healths.icon_state = "health4" + if(0 to 20) + H.healths.icon_state = "health5" + else + H.healths.icon_state = "health6" if(H.healthdoll) H.healthdoll.overlays.Cut() @@ -1102,7 +1116,8 @@ /datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H) blocked = (100-(blocked+armor))/100 - if(!damage || blocked <= 0) return 0 + if(!damage || blocked <= 0) + return 0 var/obj/item/organ/limb/organ = null if(islimb(def_zone)) @@ -1110,7 +1125,8 @@ else if(!def_zone) def_zone = ran_zone(def_zone) organ = H.get_organ(check_zone(def_zone)) - if(!organ) return 0 + if(!organ) + return 0 damage = (damage * blocked) @@ -1157,7 +1173,8 @@ if(H.reagents.has_reagent("epinephrine")) return if(H.health >= config.health_threshold_crit) - if(NOBREATH in specflags) return 1 + if(NOBREATH in specflags) + return 1 H.adjustOxyLoss(HUMAN_MAX_OXYLOSS) H.failed_last_breath = 1 else diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index e288ac22b9b..f1e46b40055 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -178,7 +178,8 @@ Please contact me on #coderbus IRC. ~Carnie x var/t_color = w_uniform.item_color - if(!t_color) t_color = w_uniform.icon_state + if(!t_color) + t_color = w_uniform.icon_state var/image/standing @@ -223,7 +224,8 @@ Please contact me on #coderbus IRC. ~Carnie x client.screen += gloves //Either way, add the item to the HUD var/t_state = gloves.item_state - if(!t_state) t_state = gloves.icon_state + if(!t_state) + t_state = gloves.icon_state var/image/standing = gloves.build_worn_icon(state = t_state, default_layer = GLOVES_LAYER, default_icon_file = 'icons/mob/hands.dmi') @@ -293,7 +295,8 @@ Please contact me on #coderbus IRC. ~Carnie x client.screen += s_store var/t_state = s_store.item_state - if(!t_state) t_state = s_store.icon_state + if(!t_state) + t_state = s_store.icon_state overlays_standing[SUIT_STORE_LAYER] = image("icon"='icons/mob/belt_mirror.dmi', "icon_state"="[t_state]", "layer"=-SUIT_STORE_LAYER) apply_overlay(SUIT_STORE_LAYER) @@ -322,7 +325,8 @@ Please contact me on #coderbus IRC. ~Carnie x var/t_state = belt.item_state - if(!t_state) t_state = belt.icon_state + if(!t_state) + t_state = belt.icon_state var/image/standing = belt.build_worn_icon(state = t_state, default_layer = BELT_LAYER, default_icon_file = 'icons/mob/belt.dmi') overlays_standing[BELT_LAYER] = standing diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 00fbd98a442..dfa0a8427d7 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -400,7 +400,8 @@ //this handles hud updates. Calls update_vision() and handle_hud_icons() /mob/living/carbon/handle_regular_hud_updates() - if(!client) return 0 + if(!client) + return 0 if(damageoverlay) if(damageoverlay.overlays) diff --git a/code/modules/mob/living/carbon/monkey/death.dm b/code/modules/mob/living/carbon/monkey/death.dm index 7e90fb4d386..82b056ec48e 100644 --- a/code/modules/mob/living/carbon/monkey/death.dm +++ b/code/modules/mob/living/carbon/monkey/death.dm @@ -8,15 +8,18 @@ ..() /mob/living/carbon/monkey/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health5" + if(stat == DEAD) + return + if(healths) + healths.icon_state = "health5" stat = DEAD if(!gibbed) visible_message("[src] lets out a faint chimper as it collapses and stops moving...") //ded -- Urist update_canmove() - if(blind) blind.layer = 0 + if(blind) + blind.layer = 0 if(ticker && ticker.mode) ticker.mode.check_win() diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 2afbf5c033b..66b8af40c49 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -10,7 +10,8 @@ */ /mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0) blocked = (100-blocked)/100 - if(!damage || (blocked <= 0)) return 0 + if(!damage || (blocked <= 0)) + return 0 switch(damagetype) if(BRUTE) adjustBruteLoss(damage * blocked) @@ -29,20 +30,28 @@ /mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = 0, stamina = 0) - if(blocked >= 100) return 0 - if(brute) apply_damage(brute, BRUTE, def_zone, blocked) - if(burn) apply_damage(burn, BURN, def_zone, blocked) - if(tox) apply_damage(tox, TOX, def_zone, blocked) - if(oxy) apply_damage(oxy, OXY, def_zone, blocked) - if(clone) apply_damage(clone, CLONE, def_zone, blocked) - if(stamina) apply_damage(stamina, STAMINA, def_zone, blocked) + if(blocked >= 100) + return 0 + if(brute) + apply_damage(brute, BRUTE, def_zone, blocked) + if(burn) + apply_damage(burn, BURN, def_zone, blocked) + if(tox) + apply_damage(tox, TOX, def_zone, blocked) + if(oxy) + apply_damage(oxy, OXY, def_zone, blocked) + if(clone) + apply_damage(clone, CLONE, def_zone, blocked) + if(stamina) + apply_damage(stamina, STAMINA, def_zone, blocked) return 1 /mob/living/proc/apply_effect(effect = 0,effecttype = STUN, blocked = 0) blocked = (100-blocked)/100 - if(!effect || (blocked <= 0)) return 0 + if(!effect || (blocked <= 0)) + return 0 switch(effecttype) if(STUN) Stun(effect * blocked) @@ -69,15 +78,26 @@ /mob/living/proc/apply_effects(stun = 0, weaken = 0, paralyze = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = 0, stamina = 0, jitter = 0) - if(blocked >= 100) return 0 - if(stun) apply_effect(stun, STUN, blocked) - if(weaken) apply_effect(weaken, WEAKEN, blocked) - if(paralyze) apply_effect(paralyze, PARALYZE, blocked) - if(irradiate) apply_effect(irradiate, IRRADIATE, blocked) - if(slur) apply_effect(slur, SLUR, blocked) - if(stutter) apply_effect(stutter, STUTTER, blocked) - if(eyeblur) apply_effect(eyeblur, EYE_BLUR, blocked) - if(drowsy) apply_effect(drowsy, DROWSY, blocked) - if(stamina) apply_damage(stamina, STAMINA, null, blocked) - if(jitter) apply_effect(jitter, JITTER, blocked) + if(blocked >= 100) + return 0 + if(stun) + apply_effect(stun, STUN, blocked) + if(weaken) + apply_effect(weaken, WEAKEN, blocked) + if(paralyze) + apply_effect(paralyze, PARALYZE, blocked) + if(irradiate) + apply_effect(irradiate, IRRADIATE, blocked) + if(slur) + apply_effect(slur, SLUR, blocked) + if(stutter) + apply_effect(stutter, STUTTER, blocked) + if(eyeblur) + apply_effect(eyeblur, EYE_BLUR, blocked) + if(drowsy) + apply_effect(drowsy, DROWSY, blocked) + if(stamina) + apply_damage(stamina, STAMINA, null, blocked) + if(jitter) + apply_effect(jitter, JITTER, blocked) return 1 \ No newline at end of file diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 3d34f72f240..dce416293da 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -65,5 +65,7 @@ qdel(src) else spawn(15) - if(animate) qdel(animate) - if(src) qdel(src) \ No newline at end of file + if(animate) + qdel(animate) + if(src) + qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 86e7256edce..c3aca245c6b 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -172,7 +172,8 @@ //this handles hud updates. Calls update_vision() and handle_hud_icons() /mob/living/proc/handle_regular_hud_updates() - if(!client) return 0 + if(!client) + return 0 handle_vision() handle_hud_icons() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 72dfd0cfdbc..4dc37e4e069 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -236,7 +236,8 @@ Sorry Giacom. Please don't be mad :( return bruteloss /mob/living/proc/adjustBruteLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 bruteloss = Clamp(bruteloss + amount, 0, maxHealth*2) handle_regular_status_updates() //we update our health right away. @@ -244,12 +245,14 @@ Sorry Giacom. Please don't be mad :( return oxyloss /mob/living/proc/adjustOxyLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 oxyloss = Clamp(oxyloss + amount, 0, maxHealth*2) handle_regular_status_updates() /mob/living/proc/setOxyLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 oxyloss = amount handle_regular_status_updates() @@ -257,12 +260,14 @@ Sorry Giacom. Please don't be mad :( return toxloss /mob/living/proc/adjustToxLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 toxloss = Clamp(toxloss + amount, 0, maxHealth*2) handle_regular_status_updates() /mob/living/proc/setToxLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 toxloss = amount handle_regular_status_updates() @@ -270,7 +275,8 @@ Sorry Giacom. Please don't be mad :( return fireloss /mob/living/proc/adjustFireLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 fireloss = Clamp(fireloss + amount, 0, maxHealth*2) handle_regular_status_updates() //we update our health right away. @@ -278,12 +284,14 @@ Sorry Giacom. Please don't be mad :( return cloneloss /mob/living/proc/adjustCloneLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 cloneloss = Clamp(cloneloss + amount, 0, maxHealth*2) handle_regular_status_updates() /mob/living/proc/setCloneLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 cloneloss = amount handle_regular_status_updates() @@ -291,12 +299,14 @@ Sorry Giacom. Please don't be mad :( return brainloss /mob/living/proc/adjustBrainLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 brainloss = Clamp(brainloss + amount, 0, maxHealth*2) handle_regular_status_updates() /mob/living/proc/setBrainLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 brainloss = amount handle_regular_status_updates() //we update our health right away. @@ -304,11 +314,13 @@ Sorry Giacom. Please don't be mad :( return staminaloss /mob/living/proc/adjustStaminaLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2) /mob/living/proc/setStaminaLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 staminaloss = amount /mob/living/proc/getMaxHealth() diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index df7fe9f149c..c1939b30910 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -15,7 +15,8 @@ update_canmove() if(src.eyeobj) src.eyeobj.setLoc(get_turf(src)) - if(blind) blind.layer = 0 + if(blind) + blind.layer = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO @@ -48,6 +49,7 @@ loc.icon_state = "aicard-404" tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) + if(mind) + mind.store_memory("Time of death: [tod]", 0) return ..(gibbed) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 2af2a5f720b..14849006ea5 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -66,7 +66,8 @@ see_invisible = see_override var/area/home = get_area(src) - if(!home) return//something to do with malf fucking things up I guess. <-- aisat is gone. is this still necessary? ~Carn + if(!home) + return//something to do with malf fucking things up I guess. <-- aisat is gone. is this still necessary? ~Carn if(home.powered(EQUIP)) home.use_power(1000, EQUIP) diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm index b17e1c66afc..9d646bee151 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -42,8 +42,10 @@ /mob/living/silicon/proc/make_laws() switch(config.default_laws) - if(0) laws = new /datum/ai_laws/default/asimov() - if(1) laws = new /datum/ai_laws/custom() + if(0) + laws = new /datum/ai_laws/default/asimov() + if(1) + laws = new /datum/ai_laws/custom() if(2) var/datum/ai_laws/lawtype = pick(subtypesof(/datum/ai_laws/default)) laws = new lawtype() diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 75e30dda3f9..2e4f9b94d63 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -1,8 +1,10 @@ /mob/living/silicon/pai/death(gibbed) - if(stat == DEAD) return + if(stat == DEAD) + return stat = DEAD canmove = 0 - if(blind) blind.layer = 0 + if(blind) + blind.layer = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO @@ -12,7 +14,8 @@ //New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here. //Read as: I have no idea what I'm doing but asking for help got me nowhere so this is what you get. - Nodrak - if(mind) del(mind) + if(mind) + del(mind) living_mob_list -= src ghostize() qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 0915e26e3f6..c7a996f54f4 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -626,7 +626,8 @@ dat += "
        " if(!pda.toff) for (var/obj/item/device/pda/P in sortNames(get_viewable_pdas())) - if (P == src.pda) continue + if (P == src.pda) + continue dat += "
      • [P]" dat += "
      • " dat += "
      " diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 96439b2d1a5..d8b22eed453 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -39,7 +39,8 @@ see_invisible = SEE_INVISIBLE_LEVEL_TWO update_icons() tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) + if(mind) + mind.store_memory("Time of death: [tod]", 0) sql_report_cyborg_death(src) diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index 4a6392266c7..fc82775ddce 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -35,9 +35,12 @@ switch(src.stat) if(CONSCIOUS) - if(!src.client) msg += "It appears to be in stand-by mode.\n" //afk - if(UNCONSCIOUS) msg += "It doesn't seem to be responding.\n" - if(DEAD) msg += "It looks like its system is corrupted and requires a reset.\n" + if(!src.client) + msg += "It appears to be in stand-by mode.\n" //afk + if(UNCONSCIOUS) + msg += "It doesn't seem to be responding.\n" + if(DEAD) + msg += "It looks like its system is corrupted and requires a reset.\n" msg += "*---------*" user << msg diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ac3bdbfd83c..3a97ef253c9 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -132,7 +132,8 @@ /mob/living/silicon/robot/Destroy() if(mmi && mind)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside. var/turf/T = get_turf(loc)//To hopefully prevent run time errors. - if(T) mmi.loc = T + if(T) + mmi.loc = T if(mmi.brainmob) mind.transfer_to(mmi.brainmob) mmi.update_icon() @@ -1178,4 +1179,4 @@ notify_ai(3, oldname, newname) if(camera) camera.c_tag = real_name - custom_name = newname \ No newline at end of file + custom_name = newname diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index 5b714c1e0d5..336db3581f8 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -2,8 +2,10 @@ if(module) for(var/obj/item/weapon/tank/jetpack/J in module.modules) if(J && istype(J, /obj/item/weapon/tank/jetpack)) - if(J.allow_thrust(0.01)) return 1 - if(..()) return 1 + if(J.allow_thrust(0.01)) + return 1 + if(..()) + return 1 return 0 /mob/living/silicon/robot/movement_delay() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index fb71eca98c0..5c9e80a66c0 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -144,7 +144,8 @@ /mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0) blocked = (100-blocked)/100 - if(!damage || (blocked <= 0)) return 0 + if(!damage || (blocked <= 0)) + return 0 switch(damagetype) if(BRUTE) adjustBruteLoss(damage * blocked) @@ -175,7 +176,8 @@ /mob/living/silicon/apply_effect(effect = 0,effecttype = STUN, blocked = 0) return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now /* - if(!effect || (blocked >= 2)) return 0 + if(!effect || (blocked >= 2)) + return 0 switch(effecttype) if(STUN) stunned = max(stunned,(effect/(blocked+1))) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 92be6ad92d3..638c57a13d8 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -775,4 +775,4 @@ Pass a positive integer as an argument to override a bot's default speed. /mob/living/simple_animal/bot/revive() ..() - update_icon() \ No newline at end of file + update_icon() diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index c945aff44fc..01afccc9566 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -51,8 +51,10 @@ if(istype(W, /obj/item/weapon/pen)) var/t = stripped_input(user, "Enter new robot name", name, created_name,MAX_NAME_LEN) - if(!t) return - if(!in_range(src, usr) && loc != usr) return + if(!t) + return + if(!in_range(src, usr) && loc != usr) + return created_name = t return diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index e6a11108acd..bfb95d5d498 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -97,8 +97,10 @@ /mob/living/simple_animal/pet/cat/attack_hand(mob/living/carbon/human/M) . = ..() switch(M.a_intent) - if("help") wuv(1,M) - if("harm") wuv(-1,M) + if("help") + wuv(1,M) + if("harm") + wuv(-1,M) /mob/living/simple_animal/pet/cat/proc/wuv(change, mob/M) if(change) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 9fcc023c4b2..88af1143648 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -210,7 +210,8 @@ return if(inventory_head) - if(user) user << "You can't put more than one hat on [src]!" + if(user) + user << "You can't put more than one hat on [src]!" return if(!item_to_add) user.visible_message("[user] pets [src].","You rest your hand on [src]'s head for a moment.") @@ -378,7 +379,7 @@ emote_see = list("plays tricks.", "slips.") else special_hat = 0 - + var/special_back = 0 if(inventory_back) special_back = 1 @@ -571,8 +572,10 @@ /mob/living/simple_animal/pet/dog/attack_hand(mob/living/carbon/human/M) . = ..() switch(M.a_intent) - if("help") wuv(1,M) - if("harm") wuv(-1,M) + if("help") + wuv(1,M) + if("harm") + wuv(-1,M) /mob/living/simple_animal/pet/dog/proc/wuv(change, mob/M) if(change) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index b717b0ac252..3efd4d48f15 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -81,8 +81,10 @@ /mob/living/simple_animal/drone/equip_to_slot(obj/item/I, slot) - if(!slot) return - if(!istype(I)) return + if(!slot) + return + if(!istype(I)) + return if(I == l_hand) l_hand = null diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 66d27a3f586..47d22286afa 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -47,7 +47,8 @@ health = 170 /mob/living/simple_animal/hostile/syndicate/melee/bullet_act(obj/item/projectile/Proj) - if(!Proj) return + if(!Proj) + return if(prob(50)) if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) src.health -= Proj.damage diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 4d09c229e8a..78434d0eab0 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -24,7 +24,8 @@ /mob/living/simple_animal/slime/proc/AIprocess() // the master AI process - if(AIproc || stat == DEAD || client) return + if(AIproc || stat == DEAD || client) + return var/hungry = 0 if (nutrition < get_starve_nutrition()) @@ -94,7 +95,8 @@ break var/sleeptime = movement_delay() - if(sleeptime <= 0) sleeptime = 1 + if(sleeptime <= 0) + sleeptime = 1 sleep(sleeptime + 2) // this is about as fast as a player slime can go @@ -256,7 +258,8 @@ else canmove = 1 - if(attacked > 50) attacked = 50 + if(attacked > 50) + attacked = 50 if(attacked > 0) attacked-- @@ -264,15 +267,18 @@ if(Discipline > 0) if(Discipline >= 5 && rabid) - if(prob(60)) rabid = 0 + if(prob(60)) + rabid = 0 if(prob(10)) Discipline-- if(!client) - if(!canmove) return + if(!canmove) + return - if(buckled) return // if it's eating someone already, continue eating! + if(buckled) + return // if it's eating someone already, continue eating! if(Target) --target_patience @@ -280,7 +286,8 @@ target_patience = 0 Target = null - if(AIproc && SStun) return + if(AIproc && SStun) + return var/hungry = 0 // determines if the slime is hungry @@ -479,11 +486,14 @@ if (L in Friends) t += 20 friends_near += L - if (nutrition < get_hunger_nutrition()) t += 10 - if (nutrition < get_starve_nutrition()) t += 10 + if (nutrition < get_hunger_nutrition()) + t += 10 + if (nutrition < get_starve_nutrition()) + t += 10 if (prob(2) && prob(t)) var/phrases = list() - if (Target) phrases += "[Target]... looks tasty..." + if (Target) + phrases += "[Target]... looks tasty..." if (nutrition < get_starve_nutrition()) phrases += "So... hungry..." phrases += "Very... hungry..." @@ -515,13 +525,20 @@ if (buckled) phrases += "Nom..." phrases += "Tasty..." - if (powerlevel > 3) phrases += "Bzzz..." - if (powerlevel > 5) phrases += "Zap..." - if (powerlevel > 8) phrases += "Zap... Bzz..." - if (mood == "sad") phrases += "Bored..." - if (slimes_near) phrases += "Brother..." - if (slimes_near > 1) phrases += "Brothers..." - if (dead_slimes) phrases += "What happened?" + if (powerlevel > 3) + phrases += "Bzzz..." + if (powerlevel > 5) + phrases += "Zap..." + if (powerlevel > 8) + phrases += "Zap... Bzz..." + if (mood == "sad") + phrases += "Bored..." + if (slimes_near) + phrases += "Brother..." + if (slimes_near > 1) + phrases += "Brothers..." + if (dead_slimes) + phrases += "What happened?" if (!slimes_near) phrases += "Lonely..." for (var/M in friends_near) @@ -531,24 +548,36 @@ say (pick(phrases)) /mob/living/simple_animal/slime/proc/get_max_nutrition() // Can't go above it - if (is_adult) return 1200 - else return 1000 + if (is_adult) + return 1200 + else + return 1000 /mob/living/simple_animal/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat - if (is_adult) return 1000 - else return 800 + if (is_adult) + return 1000 + else + return 800 /mob/living/simple_animal/slime/proc/get_hunger_nutrition() // Below it we will always eat - if (is_adult) return 600 - else return 500 + if (is_adult) + return 600 + else + return 500 /mob/living/simple_animal/slime/proc/get_starve_nutrition() // Below it we will eat before everything else - if(is_adult) return 300 - else return 200 + if(is_adult) + return 300 + else + return 200 /mob/living/simple_animal/slime/proc/will_hunt(hunger = -1) // Check for being stopped from feeding and chasing - if (docile) return 0 - if (hunger == 2 || rabid || attacked) return 1 - if (Leader) return 0 - if (holding_still) return 0 + if (docile) + return 0 + if (hunger == 2 || rabid || attacked) + return 1 + if (Leader) + return 0 + if (holding_still) + return 0 return 1 diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index cf703bf95e6..4f838717b87 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -44,7 +44,8 @@ choices += C var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices - if(!M) return 0 + if(!M) + return 0 if(CanFeedon(M)) Feedon(M) return 1 @@ -164,9 +165,11 @@ M.colour = slime_mutation[rand(1,4)] else M.colour = colour - if(ckey) M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature! + if(ckey) + M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature! M.powerlevel = new_powerlevel - if(i != 1) step_away(M,src) + if(i != 1) + step_away(M,src) M.Friends = Friends.Copy() babies += M M.mutation_chance = Clamp(mutation_chance+(rand(5,-5)),0,100) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index af6de1b80bc..3c3cda43cff 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -134,12 +134,18 @@ if(!client && powerlevel > 0) var/probab = 10 switch(powerlevel) - if(1 to 2) probab = 20 - if(3 to 4) probab = 30 - if(5 to 6) probab = 40 - if(7 to 8) probab = 60 - if(9) probab = 70 - if(10) probab = 95 + if(1 to 2) + probab = 20 + if(3 to 4) + probab = 30 + if(5 to 6) + probab = 40 + if(7 to 8) + probab = 60 + if(9) + probab = 70 + if(10) + probab = 95 if(prob(probab)) if(istype(O, /obj/structure/window) || istype(O, /obj/structure/grille)) if(nutrition <= get_hunger_nutrition() && !Atkcool) diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index f17d5a6ad9a..5ddc3aeb993 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -44,156 +44,156 @@ var/atom/currentlyEating //what the worm is currently eating var/eatingDuration = 0 //how long he's been eating it for - head - name = "space worm head" - icon_state = "spacewormhead" - icon_living = "spacewormhead" - icon_dead = "spacewormdead" +/mob/living/simple_animal/space_worm/head + name = "space worm head" + icon_state = "spacewormhead" + icon_living = "spacewormhead" + icon_dead = "spacewormdead" - maxHealth = 20 - health = 20 + maxHealth = 20 + health = 20 - melee_damage_lower = 10 - melee_damage_upper = 15 - attacktext = "bites" + melee_damage_lower = 10 + melee_damage_upper = 15 + attacktext = "bites" - animate_movement = SLIDE_STEPS + animate_movement = SLIDE_STEPS - New(var/location, var/segments = 6) - ..() +/mob/living/simple_animal/space_worm/head/New(var/location, var/segments = 6) + ..() - var/mob/living/simple_animal/space_worm/current = src + var/mob/living/simple_animal/space_worm/current = src - for(var/i = 1 to segments) - var/mob/living/simple_animal/space_worm/newSegment = new /mob/living/simple_animal/space_worm(loc) - current.Attach(newSegment) - current = newSegment + for(var/i = 1 to segments) + var/mob/living/simple_animal/space_worm/newSegment = new /mob/living/simple_animal/space_worm(loc) + current.Attach(newSegment) + current = newSegment - update_icon() - if(stat == CONSCIOUS || stat == UNCONSCIOUS) - icon_state = "spacewormhead[previous?1:0]" - if(previous) - dir = get_dir(previous,src) - else - icon_state = "spacewormheaddead" +/mob/living/simple_animal/space_worm/head/update_icon() + if(stat == CONSCIOUS || stat == UNCONSCIOUS) + icon_state = "spacewormhead[previous?1:0]" + if(previous) + dir = get_dir(previous,src) + else + icon_state = "spacewormheaddead" - Life() - ..() +/mob/living/simple_animal/space_worm/Life() + ..() - if(next && !(next in view(src,1))) - Detach() + if(next && !(next in view(src,1))) + Detach() - if(stat == DEAD) //dead chunks fall off and die immediately - if(previous) - previous.Detach() - if(next) - Detach(1) - - if(prob(stomachProcessProbability)) - ProcessStomach() - - update_icon() - - return - - Delete() //if a chunk a destroyed, make a new worm out of the split halves + if(stat == DEAD) //dead chunks fall off and die immediately if(previous) previous.Detach() - ..() + if(next) + Detach(1) - Move() - var/attachementNextPosition = loc - if(..()) - if(previous) - previous.Move(attachementNextPosition) - update_icon() + if(prob(stomachProcessProbability)) + ProcessStomach() - Bump(atom/obstacle) - if(currentlyEating != obstacle) - currentlyEating = obstacle - eatingDuration = 0 + update_icon() - if(!AttemptToEat(obstacle)) - eatingDuration++ - else - currentlyEating = null - eatingDuration = 0 + return - return - - proc/update_icon() //only for the sake of consistency with the other update icon procs - if(stat == CONSCIOUS || stat == UNCONSCIOUS) - if(previous) //midsection - icon_state = "spaceworm[get_dir(src,previous) | get_dir(src,next)]" //see 3 lines below - else //tail - icon_state = "spacewormtail" - dir = get_dir(src,next) //next will always be present since it's not a head and if it's dead, it goes in the other if branch - else - icon_state = "spacewormdead" - - return - - proc/AttemptToEat(atom/target) - if(istype(target,/turf/simulated/wall)) - if((!istype(target,/turf/simulated/wall/r_wall) && eatingDuration >= 100) || eatingDuration >= 200) //need 20 ticks to eat an rwall, 10 for a regular one - var/turf/simulated/wall/wall = target - wall.ChangeTurf(/turf/simulated/floor/plasteel) - new /obj/item/stack/sheet/metal(src, flatPlasmaValue) - return 1 - else if(istype(target,/atom/movable)) - if(istype(target,/mob) || eatingDuration >= 50) //5 ticks to eat stuff like airlocks - var/atom/movable/objectOrMob = target - contents += objectOrMob - return 1 - - return 0 - - proc/Attach(mob/living/simple_animal/space_worm/attachement) - if(!attachement) - return - - previous = attachement - attachement.next = src - - return - - proc/Detach(die = 0) - var/mob/living/simple_animal/space_worm/newHead = new /mob/living/simple_animal/space_worm/head(loc,0) - var/mob/living/simple_animal/space_worm/newHeadPrevious = previous - - previous = null //so that no extra heads are spawned - - newHead.Attach(newHeadPrevious) - - if(die) - newHead.Die() - - qdel(src) - - proc/ProcessStomach() - for(var/atom/movable/stomachContent in contents) - if(prob(digestionProbability)) - if(istype(stomachContent,/obj/item/stack)) //converts to plasma, keeping the stack value - if(!istype(stomachContent,/obj/item/stack/sheet/mineral/plasma)) - var/obj/item/stack/oldStack = stomachContent - new /obj/item/stack/sheet/mineral/plasma(src, oldStack.amount) - qdel(oldStack) - continue - else if(istype(stomachContent,/obj/item)) //converts to plasma, keeping the w_class - var/obj/item/oldItem = stomachContent - new /obj/item/stack/sheet/mineral/plasma(src, oldItem.w_class) - qdel(oldItem) - continue - else - new /obj/item/stack/sheet/mineral/plasma(src, flatPlasmaValue) //just flat amount - qdel(stomachContent) - continue +/mob/living/simple_animal/space_worm/Delete() //if a chunk a destroyed, make a new worm out of the split halves + if(previous) + previous.Detach() + ..() +/mob/living/simple_animal/space_worm/Move() + var/attachementNextPosition = loc + if(..()) if(previous) - for(var/atom/movable/stomachContent in contents) //transfer it along the digestive tract - previous.contents += stomachContent - else - for(var/atom/movable/stomachContent in contents) //or poop it out - loc.contents += stomachContent + previous.Move(attachementNextPosition) + update_icon() - return \ No newline at end of file +/mob/living/simple_animal/space_worm/Bump(atom/obstacle) + if(currentlyEating != obstacle) + currentlyEating = obstacle + eatingDuration = 0 + + if(!AttemptToEat(obstacle)) + eatingDuration++ + else + currentlyEating = null + eatingDuration = 0 + + return + +/mob/living/simple_animal/space_worm/proc/update_icon() //only for the sake of consistency with the other update icon procs + if(stat == CONSCIOUS || stat == UNCONSCIOUS) + if(previous) //midsection + icon_state = "spaceworm[get_dir(src,previous) | get_dir(src,next)]" //see 3 lines below + else //tail + icon_state = "spacewormtail" + dir = get_dir(src,next) //next will always be present since it's not a head and if it's dead, it goes in the other if branch + else + icon_state = "spacewormdead" + + return + +/mob/living/simple_animal/space_worm/proc/AttemptToEat(atom/target) + if(istype(target,/turf/simulated/wall)) + if((!istype(target,/turf/simulated/wall/r_wall) && eatingDuration >= 100) || eatingDuration >= 200) //need 20 ticks to eat an rwall, 10 for a regular one + var/turf/simulated/wall/wall = target + wall.ChangeTurf(/turf/simulated/floor/plasteel) + new /obj/item/stack/sheet/metal(src, flatPlasmaValue) + return 1 + else if(istype(target,/atom/movable)) + if(istype(target,/mob) || eatingDuration >= 50) //5 ticks to eat stuff like airlocks + var/atom/movable/objectOrMob = target + contents += objectOrMob + return 1 + + return 0 + +/mob/living/simple_animal/space_worm/proc/Attach(mob/living/simple_animal/space_worm/attachement) + if(!attachement) + return + + previous = attachement + attachement.next = src + + return + +/mob/living/simple_animal/space_worm/proc/Detach(die = 0) + var/mob/living/simple_animal/space_worm/newHead = new /mob/living/simple_animal/space_worm/head(loc,0) + var/mob/living/simple_animal/space_worm/newHeadPrevious = previous + + previous = null //so that no extra heads are spawned + + newHead.Attach(newHeadPrevious) + + if(die) + newHead.Die() + + qdel(src) + +/mob/living/simple_animal/space_worm/proc/ProcessStomach() + for(var/atom/movable/stomachContent in contents) + if(prob(digestionProbability)) + if(istype(stomachContent,/obj/item/stack)) //converts to plasma, keeping the stack value + if(!istype(stomachContent,/obj/item/stack/sheet/mineral/plasma)) + var/obj/item/stack/oldStack = stomachContent + new /obj/item/stack/sheet/mineral/plasma(src, oldStack.amount) + qdel(oldStack) + continue + else if(istype(stomachContent,/obj/item)) //converts to plasma, keeping the w_class + var/obj/item/oldItem = stomachContent + new /obj/item/stack/sheet/mineral/plasma(src, oldItem.w_class) + qdel(oldItem) + continue + else + new /obj/item/stack/sheet/mineral/plasma(src, flatPlasmaValue) //just flat amount + qdel(stomachContent) + continue + + if(previous) + for(var/atom/movable/stomachContent in contents) //transfer it along the digestive tract + previous.contents += stomachContent + else + for(var/atom/movable/stomachContent in contents) //or poop it out + loc.contents += stomachContent + + return diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 5ee45022174..edbe63ec666 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -6,13 +6,15 @@ log_access("Login: [key_name(src)] from [lastKnownIP ? lastKnownIP : "localhost"]-[computer_id] || BYOND v[client.byond_version]") if(config.log_access) for(var/mob/M in player_list) - if(M == src) continue + if(M == src) + continue if( M.key && (M.key != key) ) var/matches if( (M.lastKnownIP == client.address) ) matches += "IP ([client.address])" if( (M.computer_id == client.computer_id) ) - if(matches) matches += " and " + if(matches) + matches += " and " matches += "ID ([client.computer_id])" spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!") if(matches) @@ -27,7 +29,7 @@ player_list |= src update_Login_details() world.update_status() - + client.images = null //remove the images such as AIs being unable to see runes client.screen = list() //remove hud items just in case if(hud_used) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3dd4ced7b69..9d90cf1a385 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -561,10 +561,14 @@ var/next_mob_id = 0 /mob/MouseDrop(mob/M) ..() - if(M != usr) return - if(usr == src) return - if(!Adjacent(usr)) return - if(istype(M, /mob/living/silicon/ai)) return + if(M != usr) + return + if(usr == src) + return + if(!Adjacent(usr)) + return + if(istype(M, /mob/living/silicon/ai)) + return show_inv(usr) /mob/proc/is_active() @@ -673,13 +677,20 @@ var/next_mob_id = 0 // facing verbs /mob/proc/canface() - if(!canmove) return 0 - if(client.moving) return 0 - if(world.time < client.move_delay) return 0 - if(stat==2) return 0 - if(anchored) return 0 - if(notransform) return 0 - if(restrained()) return 0 + if(!canmove) + return 0 + if(client.moving) + return 0 + if(world.time < client.move_delay) + return 0 + if(stat==2) + return 0 + if(anchored) + return 0 + if(notransform) + return 0 + if(restrained()) + return 0 return 1 @@ -718,7 +729,8 @@ var/next_mob_id = 0 /mob/verb/eastface() set hidden = 1 - if(!canface()) return 0 + if(!canface()) + return 0 dir = EAST client.move_delay += movement_delay() return 1 @@ -726,7 +738,8 @@ var/next_mob_id = 0 /mob/verb/westface() set hidden = 1 - if(!canface()) return 0 + if(!canface()) + return 0 dir = WEST client.move_delay += movement_delay() return 1 @@ -734,7 +747,8 @@ var/next_mob_id = 0 /mob/verb/northface() set hidden = 1 - if(!canface()) return 0 + if(!canface()) + return 0 dir = NORTH client.move_delay += movement_delay() return 1 @@ -742,7 +756,8 @@ var/next_mob_id = 0 /mob/verb/southface() set hidden = 1 - if(!canface()) return 0 + if(!canface()) + return 0 dir = SOUTH client.move_delay += movement_delay() return 1 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 72605103043..e83cea9042e 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -8,7 +8,8 @@ return 0 /proc/check_zone(zone) - if(!zone) return "chest" + if(!zone) + return "chest" switch(zone) if("eyes") zone = "head" @@ -36,12 +37,18 @@ var/t = rand(1, 18) // randomly pick a different zone, or maybe the same one switch(t) - if(1) return "head" - if(2) return "chest" - if(3 to 6) return "l_arm" - if(7 to 10) return "r_arm" - if(11 to 14) return "l_leg" - if(15 to 18) return "r_leg" + if(1) + return "head" + if(2) + return "chest" + if(3 to 6) + return "l_arm" + if(7 to 10) + return "r_arm" + if(11 to 14) + return "l_leg" + if(15 to 18) + return "r_leg" return zone @@ -83,18 +90,28 @@ while(counter>=1) newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2) if(rand(1,3)==3) - if(lowertext(newletter)=="o") newletter="u" - if(lowertext(newletter)=="s") newletter="ch" - if(lowertext(newletter)=="a") newletter="ah" - if(lowertext(newletter)=="u") newletter="oo" - if(lowertext(newletter)=="c") newletter="k" + if(lowertext(newletter)=="o") + newletter="u" + if(lowertext(newletter)=="s") + newletter="ch" + if(lowertext(newletter)=="a") + newletter="ah" + if(lowertext(newletter)=="u") + newletter="oo" + if(lowertext(newletter)=="c") + newletter="k" if(rand(1,20)==20) - if(newletter==" ") newletter="...huuuhhh..." - if(newletter==".") newletter=" *BURP*." + if(newletter==" ") + newletter="...huuuhhh..." + if(newletter==".") + newletter=" *BURP*." switch(rand(1,20)) - if(1) newletter+="'" - if(10) newletter+="[newletter]" - if(20) newletter+="[newletter][newletter]" + if(1) + newletter+="'" + if(10) + newletter+="[newletter]" + if(20) + newletter+="[newletter][newletter]" newphrase+="[newletter]";counter-=1 return newphrase @@ -222,16 +239,24 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/intent_numeric(argument) if(istext(argument)) switch(argument) - if("help") return 0 - if("disarm") return 1 - if("grab") return 2 - else return 3 + if("help") + return 0 + if("disarm") + return 1 + if("grab") + return 2 + else + return 3 else switch(argument) - if(0) return "help" - if(1) return "disarm" - if(2) return "grab" - else return "harm" + if(0) + return "help" + if(1) + return "disarm" + if(2) + return "grab" + else + return "harm" //change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left /mob/verb/a_intent_change(input as text) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 3c57f7c9463..ded58659e79 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -84,7 +84,8 @@ if(mob && mob.control_object) if(mob.control_object.density) step(mob.control_object,direct) - if(!mob.control_object) return + if(!mob.control_object) + return mob.control_object.dir = direct else mob.control_object.loc = get_step(mob.control_object,direct) @@ -113,7 +114,8 @@ Process_Incorpmove(direct) return 0 - if(Process_Grab()) return + if(Process_Grab()) + return if(mob.buckled) //if we're buckled to something, tell it we moved. return mob.buckled.relaymove(mob, direct) @@ -281,7 +283,8 @@ spawn(0) anim(T,L,'icons/mob/mob.dmi',,"shadow",,L.dir) limit-- - if(limit<=0) break + if(limit<=0) + break else spawn(0) anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,L.dir) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 2475e5ddde9..f33fecd16d6 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -86,7 +86,8 @@ if(src != usr) return 0 - if(!client) return 0 + if(!client) + return 0 //Determines Relevent Population Cap var/relevant_cap @@ -112,7 +113,8 @@ if(href_list["observe"]) if(alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No") == "Yes") - if(!client) return 1 + if(!client) + return 1 var/mob/dead/observer/observer = new() spawning = 1 diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index 97fec9be03e..b8fb08bb18e 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -17,20 +17,28 @@ conversion in savefile.dm */ /proc/init_sprite_accessory_subtypes(prototype, list/L, list/male, list/female) - if(!istype(L)) L = list() - if(!istype(male)) male = list() - if(!istype(female)) female = list() + if(!istype(L)) + L = list() + if(!istype(male)) + male = list() + if(!istype(female)) + female = list() for(var/path in typesof(prototype)) - if(path == prototype) continue + if(path == prototype) + continue var/datum/sprite_accessory/D = new path() - if(D.icon_state) L[D.name] = D - else L += D.name + if(D.icon_state) + L[D.name] = D + else + L += D.name switch(D.gender) - if(MALE) male += D.name - if(FEMALE) female += D.name + if(MALE) + male += D.name + if(FEMALE) + female += D.name else male += D.name female += D.name diff --git a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm index 8d82ae40c5d..9a3849e202e 100644 --- a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm +++ b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm @@ -61,8 +61,10 @@ It is possible to destroy the net by the occupant or someone else. health = INFINITY//Make the net invincible so that an explosion/something else won't kill it while, spawn() is running. for(var/obj/item/W in M) if(istype(M,/mob/living/carbon/human)) - if(W==M:w_uniform) continue//So all they're left with are shoes and uniform. - if(W==M:shoes) continue + if(W==M:w_uniform) + continue//So all they're left with are shoes and uniform. + if(W==M:shoes) + continue M.unEquip(W) spawn(0) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 4d071708fb3..8d6174cbe77 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -114,7 +114,8 @@ if(virgin) for(var/datum/data/record/G in data_core.general) var/datum/data/record/S = find_record("name", G.fields["name"], data_core.security) - if(!S) continue + if(!S) + continue var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src) P.info = "
      Security Record

      " P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]
      \nSex: [G.fields["sex"]]
      \nAge: [G.fields["age"]]
      \nFingerprint: [G.fields["fingerprint"]]
      \nPhysical Status: [G.fields["p_stat"]]
      \nMental Status: [G.fields["m_stat"]]
      " @@ -144,7 +145,8 @@ if(virgin) for(var/datum/data/record/G in data_core.general) var/datum/data/record/M = find_record("name", G.fields["name"], data_core.medical) - if(!M) continue + if(!M) + continue var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src) P.info = "
      Medical Record

      " P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]
      \nSex: [G.fields["sex"]]
      \nAge: [G.fields["age"]]
      \nFingerprint: [G.fields["fingerprint"]]
      \nPhysical Status: [G.fields["p_stat"]]
      \nMental Status: [G.fields["m_stat"]]
      " diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 414ece61407..670bea53361 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -87,7 +87,8 @@ /obj/item/weapon/pen/sleepy/attack(mob/living/M, mob/user) - if(!istype(M)) return + if(!istype(M)) + return if(..()) if(reagents.total_volume) diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 46edaac9892..985247e2203 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -44,7 +44,8 @@ /obj/machinery/power/am_control_unit/process() if(exploding) explosion(get_turf(src),8,12,18,12) - if(src) qdel(src) + if(src) + qdel(src) if(update_shield_icons && !shield_icon_delay) check_shield_icons() @@ -71,17 +72,22 @@ /obj/machinery/power/am_control_unit/proc/produce_power() playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with - if(core_power <= 0) return 0//Something is wrong + if(core_power <= 0) + return 0//Something is wrong var/core_damage = 0 var/fuel = fueljar.usefuel(fuel_injection) stored_power = (fuel/core_power)*fuel*200000 //Now check if the cores could deal with it safely, this is done after so you can overload for more power if needed, still a bad idea if(fuel > (2*core_power))//More fuel has been put in than the current cores can deal with - if(prob(50))core_damage = 1//Small chance of damage - if((fuel-core_power) > 5) core_damage = 5//Now its really starting to overload the cores - if((fuel-core_power) > 10) core_damage = 20//Welp now you did it, they wont stand much of this - if(core_damage == 0) return + if(prob(50)) + core_damage = 1//Small chance of damage + if((fuel-core_power) > 5) + core_damage = 5//Now its really starting to overload the cores + if((fuel-core_power) > 10) + core_damage = 20//Welp now you did it, they wont stand much of this + if(core_damage == 0) + return for(var/obj/machinery/am_shielding/AMS in linked_cores) AMS.stability -= core_damage AMS.check_stability(1) @@ -92,10 +98,12 @@ /obj/machinery/power/am_control_unit/emp_act(severity) switch(severity) if(1) - if(active) toggle_power() + if(active) + toggle_power() stability -= rand(15,30) if(2) - if(active) toggle_power() + if(active) + toggle_power() stability -= rand(10,20) ..() return 0 @@ -132,7 +140,8 @@ /obj/machinery/power/am_control_unit/update_icon() - if(active) icon_state = "control_on" + if(active) + icon_state = "control_on" else icon_state = "control" //No other icons for it atm @@ -186,19 +195,24 @@ /obj/machinery/power/am_control_unit/proc/add_shielding(obj/machinery/am_shielding/AMS, AMS_linking = 0) - if(!istype(AMS)) return 0 - if(!anchored) return 0 - if(!AMS_linking && !AMS.link_control(src)) return 0 + if(!istype(AMS)) + return 0 + if(!anchored) + return 0 + if(!AMS_linking && !AMS.link_control(src)) + return 0 linked_shielding.Add(AMS) update_shield_icons = 1 return 1 /obj/machinery/power/am_control_unit/proc/remove_shielding(obj/machinery/am_shielding/AMS) - if(!istype(AMS)) return 0 + if(!istype(AMS)) + return 0 linked_shielding.Remove(AMS) update_shield_icons = 2 - if(active) toggle_power() + if(active) + toggle_power() return 1 @@ -221,11 +235,13 @@ /obj/machinery/power/am_control_unit/proc/check_shield_icons()//Forces icon_update for all shields - if(shield_icon_delay) return + if(shield_icon_delay) + return shield_icon_delay = 1 if(update_shield_icons == 2)//2 means to clear everything and rebuild for(var/obj/machinery/am_shielding/AMS in linked_shielding) - if(AMS.processing) AMS.shutdown_core() + if(AMS.processing) + AMS.shutdown_core() AMS.control_unit = null spawn(10) AMS.controllerscan() @@ -240,7 +256,8 @@ /obj/machinery/power/am_control_unit/proc/check_core_stability() - if(stored_core_stability_delay || linked_cores.len <= 0) return + if(stored_core_stability_delay || linked_cores.len <= 0) + return stored_core_stability_delay = 1 stored_core_stability = 0 for(var/obj/machinery/am_shielding/AMS in linked_cores) @@ -317,7 +334,8 @@ if(href_list["strengthdown"]) fuel_injection-- - if(fuel_injection < 0) fuel_injection = 0 + if(fuel_injection < 0) + fuel_injection = 0 if(href_list["refreshstability"]) check_core_stability() diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index c7955529b65..1fa86b2fb12 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -39,7 +39,8 @@ qdel(src) return for(var/obj/machinery/am_shielding/AMS in loc.contents) - if(AMS == src) continue + if(AMS == src) + continue qdel(src) return @@ -64,20 +65,24 @@ /obj/machinery/am_shielding/Destroy() - if(control_unit) control_unit.remove_shielding(src) - if(processing) shutdown_core() + if(control_unit) + control_unit.remove_shielding(src) + if(processing) + shutdown_core() visible_message("The [src.name] melts!") //Might want to have it leave a mess on the floor but no sprites for now return ..() /obj/machinery/am_shielding/CanPass(atom/movable/mover, turf/target, height=0) - if(height==0) return 1 + if(height==0) + return 1 return 0 /obj/machinery/am_shielding/process() - if(!processing) . = PROCESS_KILL + if(!processing) + . = PROCESS_KILL //TODO: core functions and stability //TODO: think about checking the airmix for plasma and increasing power output return @@ -121,8 +126,10 @@ if(core_check()) overlays += "core" - if(!processing) setup_core() - else if(processing) shutdown_core() + if(!processing) + setup_core() + else if(processing) + shutdown_core() /obj/machinery/am_shielding/attackby(obj/item/W, mob/user, params) @@ -134,8 +141,10 @@ //Call this to link a detected shilding unit to the controller /obj/machinery/am_shielding/proc/link_control(obj/machinery/power/am_control_unit/AMC) - if(!istype(AMC)) return 0 - if(control_unit && control_unit != AMC) return 0//Already have one + if(!istype(AMC)) + return 0 + if(control_unit && control_unit != AMC) + return 0//Already have one control_unit = AMC control_unit.add_shielding(src,1) return 1 @@ -145,8 +154,10 @@ /obj/machinery/am_shielding/proc/core_check() for(var/direction in alldirs) var/machine = locate(/obj/machinery, get_step(loc, direction)) - if(!machine) return 0//Need all for a core - if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit)) return 0 + if(!machine) + return 0//Need all for a core + if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit)) + return 0 return 1 @@ -154,7 +165,8 @@ processing = 1 machines |= src SSmachine.processing |= src - if(!control_unit) return + if(!control_unit) + return control_unit.linked_cores.Add(src) control_unit.reported_core_efficiency += efficiency return @@ -162,14 +174,16 @@ /obj/machinery/am_shielding/proc/shutdown_core() processing = 0 - if(!control_unit) return + if(!control_unit) + return control_unit.linked_cores.Remove(src) control_unit.reported_core_efficiency -= efficiency return /obj/machinery/am_shielding/proc/check_stability(injecting_fuel = 0) - if(stability > 0) return + if(stability > 0) + return if(injecting_fuel && control_unit) control_unit.exploding = 1 if(src) @@ -178,7 +192,8 @@ /obj/machinery/am_shielding/proc/recalc_efficiency(new_efficiency)//tbh still not 100% sure how I want to deal with efficiency so this is likely temp - if(!control_unit || !processing) return + if(!control_unit || !processing) + return if(stability < 50) new_efficiency /= 2 control_unit.reported_core_efficiency += (new_efficiency - efficiency) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9a021cd1b4e..e61242cba39 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -329,7 +329,8 @@ By design, d1 is the smallest direction and d2 is the highest if(istype(AM,/obj/structure/cable)) var/obj/structure/cable/C = AM if(C.d1 == d1 || C.d2 == d1 || C.d1 == d2 || C.d2 == d2) //only connected if they have a common direction - if(C.powernet == powernet) continue + if(C.powernet == powernet) + continue if(C.powernet) merge_powernets(powernet, C.powernet) else @@ -337,7 +338,8 @@ By design, d1 is the smallest direction and d2 is the highest else if(istype(AM,/obj/machinery/power/apc)) var/obj/machinery/power/apc/N = AM - if(!N.terminal) continue // APC are connected through their terminal + if(!N.terminal) + continue // APC are connected through their terminal if(N.terminal.powernet == powernet) continue @@ -416,7 +418,8 @@ By design, d1 is the smallest direction and d2 is the highest /obj/structure/cable/proc/cut_cable_from_powernet() var/turf/T1 = loc var/list/P_list - if(!T1) return + if(!T1) + return if(d1) T1 = get_step(T1, d1) P_list = power_list(T1, src, turn(d1,180),0,cable_only = 1) // what adjacently joins on to cut cable... @@ -520,7 +523,8 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \ var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) if(affecting.status == ORGAN_ROBOTIC) user.visible_message("[user] starts to fix some of the wires in [H]'s [affecting.getDisplayName()].", "You start fixing some of the wires in [H]'s [affecting.getDisplayName()].") - if(!do_mob(user, H, 50)) return + if(!do_mob(user, H, 50)) + return item_heal_robotic(H, user, 0, 5) src.use(1) return diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 009dfeba438..c746754e5bd 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -42,7 +42,8 @@ if(rigged && amount > 0) explode() return 0 - if(charge < amount) return 0 + if(charge < amount) + return 0 charge = (charge - amount) if(!istype(loc, /obj/machinery/power/apc)) feedback_add_details("cell_used","[src.type]") @@ -56,7 +57,8 @@ if(maxcharge < amount) amount = maxcharge var/power_used = min(maxcharge-charge,amount) - if(crit_fail) return 0 + if(crit_fail) + return 0 if(!prob(reliability)) minor_fault++ if(prob(minor_fault)) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 34f3a6de8eb..0de92685532 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -161,7 +161,8 @@ /obj/machinery/light/Move() - if(status != LIGHT_BROKEN) broken(1) + if(status != LIGHT_BROKEN) + broken(1) return ..() /obj/machinery/light/built/New() @@ -396,7 +397,8 @@ return /obj/machinery/light/attack_animal(mob/living/simple_animal/M) - if(M.melee_damage_upper == 0) return + if(M.melee_damage_upper == 0) + return if(status == LIGHT_EMPTY||status == LIGHT_BROKEN) M << "That object is useless to you." return diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 213b288b724..d1b4c5a01ec 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -152,7 +152,8 @@ cdir = get_dir(T,loc) for(var/obj/structure/cable/C in T) - if(C.powernet) continue + if(C.powernet) + continue if(C.d1 == cdir || C.d2 == cdir) . += C return . @@ -179,7 +180,8 @@ /obj/machinery/power/proc/get_indirect_connections() . = list() for(var/obj/structure/cable/C in loc) - if(C.powernet) continue + if(C.powernet) + continue if(C.d1 == 0) // the cable is a node cable . += C return . @@ -197,11 +199,13 @@ //var/fdir = (!d)? 0 : turn(d, 180) // the opposite direction to d (or 0 if d==0) for(var/AM in T) - if(AM == source) continue //we don't want to return source + if(AM == source) + continue //we don't want to return source if(!cable_only && istype(AM,/obj/machinery/power)) var/obj/machinery/power/P = AM - if(P.powernet == 0) continue // exclude APCs which have powernet=0 + if(P.powernet == 0) + continue // exclude APCs which have powernet=0 if(!unmarked || !P.powernet) //if unmarked=1 we only return things with no powernet if(d == 0) @@ -281,12 +285,14 @@ //source is an object caused electrocuting (airlock, grille, etc) //No animations will be performed by this proc. /proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1) - if(istype(M.loc,/obj/mecha)) return 0 //feckin mechs are dumb + if(istype(M.loc,/obj/mecha)) + return 0 //feckin mechs are dumb if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves - if(G.siemens_coefficient == 0) return 0 //to avoid spamming with insulated glvoes on + if(G.siemens_coefficient == 0) + return 0 //to avoid spamming with insulated glvoes on var/area/source_area if(istype(power_source,/area)) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index e9dda2cb13b..7e0669991de 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -116,7 +116,8 @@ /obj/singularity/proc/admin_investigate_setup() last_warning = world.time var/count = locate(/obj/machinery/field/containment) in ultra_range(30, src, 1) - if(!count) message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1) + if(!count) + message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1) investigate_log("was created. [count?"":"No containment fields were active"]","singulo") /obj/singularity/proc/dissipate() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 635be1a91d8..d1585e5b40f 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -194,7 +194,8 @@ /obj/machinery/power/smes/update_icon() overlays.Cut() - if(stat & BROKEN) return + if(stat & BROKEN) + return if(panel_open) return @@ -236,7 +237,8 @@ /obj/machinery/power/smes/process() - if(stat & BROKEN) return + if(stat & BROKEN) + return //store machine state to see if we need to update the icon overlays var/last_disp = chargedisplay() @@ -434,10 +436,11 @@ /obj/machinery/power/smes/magical name = "magical power storage unit" desc = "A high-capacity superconducting magnetic energy storage (SMES) unit. Magically produces power." - process() - capacity = INFINITY - charge = INFINITY - ..() + +/obj/machinery/power/smes/magical/process() + capacity = INFINITY + charge = INFINITY + ..() #undef SMESRATE diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index 2406e1e2280..685483285a3 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -55,13 +55,15 @@ /obj/item/weapon/gun/magic/Destroy() - if(can_charge) SSobj.processing.Remove(src) + if(can_charge) + SSobj.processing.Remove(src) return ..() /obj/item/weapon/gun/magic/process() charge_tick++ - if(charge_tick < recharge_rate || charges >= max_charges) return 0 + if(charge_tick < recharge_rate || charges >= max_charges) + return 0 charge_tick = 0 charges++ return 1 diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 5d5bd451982..adc787c0679 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -30,7 +30,8 @@ return (chambered.BB ? 1 : 0) /obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user) - if(recentpump) return + if(recentpump) + return pump(user) recentpump = 1 spawn(10) @@ -52,7 +53,8 @@ chambered = null /obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M) - if(!magazine.ammo_count()) return 0 + if(!magazine.ammo_count()) + return 0 var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing. chambered = AC diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 9a28155154b..060fd1e7377 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -151,12 +151,11 @@ reagents.handle_reactions() return 1 -/obj/item/projectile/bullet/dart/metalfoam - New() - ..() - reagents.add_reagent("aluminium", 15) - reagents.add_reagent("foaming_agent", 5) - reagents.add_reagent("facid", 5) +/obj/item/projectile/bullet/dart/metalfoam/New() + ..() + reagents.add_reagent("aluminium", 15) + reagents.add_reagent("foaming_agent", 5) + reagents.add_reagent("facid", 5) //This one is for future syringe guns update /obj/item/projectile/bullet/dart/syringe diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index dcb762346e0..46441fbd696 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -123,7 +123,8 @@ /proc/wabbajack(mob/living/M) if(istype(M)) if(istype(M, /mob/living) && M.stat != DEAD) - if(M.notransform) return + if(M.notransform) + return M.notransform = 1 M.canmove = 0 M.icon = null @@ -132,7 +133,8 @@ if(istype(M, /mob/living/silicon/robot)) var/mob/living/silicon/robot/Robot = M - if(Robot.mmi) qdel(Robot.mmi) + if(Robot.mmi) + qdel(Robot.mmi) Robot.notify_ai(1) else for(var/obj/item/W in M) @@ -149,8 +151,10 @@ if("robot") var/robot = pick("cyborg","syndiborg","drone") switch(robot) - if("cyborg") new_mob = new /mob/living/silicon/robot(M.loc) - if("syndiborg") new_mob = new /mob/living/silicon/robot/syndicate(M.loc) + if("cyborg") + new_mob = new /mob/living/silicon/robot(M.loc) + if("syndiborg") + new_mob = new /mob/living/silicon/robot/syndicate(M.loc) if("drone") new_mob = new /mob/living/simple_animal/drone(M.loc) var/mob/living/simple_animal/drone/D = new_mob @@ -179,42 +183,70 @@ /*var/alien_caste = pick("Hunter","Sentinel","Drone","Larva") switch(alien_caste) - if("Hunter") new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc) - if("Sentinel") new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc) - if("Drone") new_mob = new /mob/living/carbon/alien/humanoid/drone(M.loc) - else new_mob = new /mob/living/carbon/alien/larva(M.loc) + if("Hunter") + new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc) + if("Sentinel") + new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc) + if("Drone") + new_mob = new /mob/living/carbon/alien/humanoid/drone(M.loc) + else + new_mob = new /mob/living/carbon/alien/larva(M.loc) new_mob.languages |= HUMAN*/ if("animal") if(prob(50)) var/beast = pick("carp","bear","mushroom","statue", "bat", "goat","killertomato", "spiderbase", "spiderhunter", "blobbernaut", "magicarp", "chaosmagicarp") switch(beast) - if("carp") new_mob = new /mob/living/simple_animal/hostile/carp(M.loc) - if("bear") new_mob = new /mob/living/simple_animal/hostile/bear(M.loc) - if("mushroom") new_mob = new /mob/living/simple_animal/hostile/mushroom(M.loc) - if("statue") new_mob = new /mob/living/simple_animal/hostile/statue(M.loc) - if("bat") new_mob = new /mob/living/simple_animal/hostile/retaliate/bat(M.loc) - if("goat") new_mob = new /mob/living/simple_animal/hostile/retaliate/goat(M.loc) - if("killertomato") new_mob = new /mob/living/simple_animal/hostile/killertomato(M.loc) - if("spiderbase") new_mob = new /mob/living/simple_animal/hostile/poison/giant_spider(M.loc) - if("spiderhunter") new_mob = new /mob/living/simple_animal/hostile/poison/giant_spider/hunter(M.loc) - if("blobbernaut") new_mob = new /mob/living/simple_animal/hostile/blob/blobbernaut(M.loc) - if("magicarp") new_mob = new /mob/living/simple_animal/hostile/carp/ranged(M.loc) - if("chaosmagicarp") new_mob = new /mob/living/simple_animal/hostile/carp/ranged/chaos(M.loc) + if("carp") + new_mob = new /mob/living/simple_animal/hostile/carp(M.loc) + if("bear") + new_mob = new /mob/living/simple_animal/hostile/bear(M.loc) + if("mushroom") + new_mob = new /mob/living/simple_animal/hostile/mushroom(M.loc) + if("statue") + new_mob = new /mob/living/simple_animal/hostile/statue(M.loc) + if("bat") + new_mob = new /mob/living/simple_animal/hostile/retaliate/bat(M.loc) + if("goat") + new_mob = new /mob/living/simple_animal/hostile/retaliate/goat(M.loc) + if("killertomato") + new_mob = new /mob/living/simple_animal/hostile/killertomato(M.loc) + if("spiderbase") + new_mob = new /mob/living/simple_animal/hostile/poison/giant_spider(M.loc) + if("spiderhunter") + new_mob = new /mob/living/simple_animal/hostile/poison/giant_spider/hunter(M.loc) + if("blobbernaut") + new_mob = new /mob/living/simple_animal/hostile/blob/blobbernaut(M.loc) + if("magicarp") + new_mob = new /mob/living/simple_animal/hostile/carp/ranged(M.loc) + if("chaosmagicarp") + new_mob = new /mob/living/simple_animal/hostile/carp/ranged/chaos(M.loc) else var/animal = pick("parrot","corgi","crab","pug","cat","mouse","chicken","cow","lizard","chick","fox","butterfly") switch(animal) - if("parrot") new_mob = new /mob/living/simple_animal/parrot(M.loc) - if("corgi") new_mob = new /mob/living/simple_animal/pet/dog/corgi(M.loc) - if("crab") new_mob = new /mob/living/simple_animal/crab(M.loc) - if("pug") new_mob = new /mob/living/simple_animal/pet/dog/pug(M.loc) - if("cat") new_mob = new /mob/living/simple_animal/pet/cat(M.loc) - if("mouse") new_mob = new /mob/living/simple_animal/mouse(M.loc) - if("chicken") new_mob = new /mob/living/simple_animal/chicken(M.loc) - if("cow") new_mob = new /mob/living/simple_animal/cow(M.loc) - if("lizard") new_mob = new /mob/living/simple_animal/hostile/lizard(M.loc) - if("fox") new_mob = new /mob/living/simple_animal/pet/fox(M.loc) - if("butterfly") new_mob = new /mob/living/simple_animal/butterfly(M.loc) - else new_mob = new /mob/living/simple_animal/chick(M.loc) + if("parrot") + new_mob = new /mob/living/simple_animal/parrot(M.loc) + if("corgi") + new_mob = new /mob/living/simple_animal/pet/dog/corgi(M.loc) + if("crab") + new_mob = new /mob/living/simple_animal/crab(M.loc) + if("pug") + new_mob = new /mob/living/simple_animal/pet/dog/pug(M.loc) + if("cat") + new_mob = new /mob/living/simple_animal/pet/cat(M.loc) + if("mouse") + new_mob = new /mob/living/simple_animal/mouse(M.loc) + if("chicken") + new_mob = new /mob/living/simple_animal/chicken(M.loc) + if("cow") + new_mob = new /mob/living/simple_animal/cow(M.loc) + if("lizard") + new_mob = new /mob/living/simple_animal/hostile/lizard(M.loc) + if("fox") + new_mob = new /mob/living/simple_animal/pet/fox(M.loc) + if("butterfly") + new_mob = new /mob/living/simple_animal/butterfly(M.loc) + else + new_mob = new /mob/living/simple_animal/chick(M.loc) new_mob.languages |= HUMAN if("humanoid") new_mob = new /mob/living/carbon/human(M.loc) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 976a0d9bebf..6a3e2b9d4d7 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -71,10 +71,13 @@ var/const/INJECT = 5 //injection current_list_element = rand(1,reagent_list.len) while(total_transfered != amount) - if(total_transfered >= amount) break - if(total_volume <= 0 || !reagent_list.len) break + if(total_transfered >= amount) + break + if(total_volume <= 0 || !reagent_list.len) + break - if(current_list_element > reagent_list.len) current_list_element = 1 + if(current_list_element > reagent_list.len) + current_list_element = 1 var/datum/reagent/current_reagent = reagent_list[current_list_element] remove_reagent(current_reagent.id, 1) @@ -321,11 +324,13 @@ var/const/INJECT = 5 //injection var/required_temp = C.required_temp for(var/B in C.required_reagents) - if(!has_reagent(B, C.required_reagents[B])) break + if(!has_reagent(B, C.required_reagents[B])) + break total_matching_reagents++ multipliers += round(get_reagent_amount(B) / C.required_reagents[B]) for(var/B in C.required_catalysts) - if(!has_reagent(B, C.required_catalysts[B])) break + if(!has_reagent(B, C.required_catalysts[B])) + break total_matching_catalysts++ if(!C.required_container) @@ -462,7 +467,8 @@ var/const/INJECT = 5 //injection if(!isnum(amount) || !amount) return 1 update_total() - if(total_volume + amount > maximum_volume) amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen. + if(total_volume + amount > maximum_volume) + amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen. chem_temp = round(((amount * reagtemp) + (total_volume * chem_temp)) / (total_volume + amount)) //equalize with new chems for(var/A in reagent_list) @@ -508,7 +514,8 @@ var/const/INJECT = 5 //injection /datum/reagents/proc/remove_reagent(reagent, amount, safety)//Added a safety check for the trans_id_to - if(!isnum(amount)) return 1 + if(!isnum(amount)) + return 1 for(var/A in reagent_list) var/datum/reagent/R = A @@ -527,10 +534,13 @@ var/const/INJECT = 5 //injection for(var/A in reagent_list) var/datum/reagent/R = A if (R.id == reagent) - if(!amount) return R + if(!amount) + return R else - if(R.volume >= amount) return R - else return 0 + if(R.volume >= amount) + return R + else + return 0 return 0 @@ -545,7 +555,8 @@ var/const/INJECT = 5 //injection /datum/reagents/proc/get_reagents() var/res = "" for(var/datum/reagent/A in reagent_list) - if (res != "") res += "," + if (res != "") + res += "," res += A.name return res @@ -585,8 +596,10 @@ var/const/INJECT = 5 //injection D.data = new_data /datum/reagents/proc/copy_data(datum/reagent/current_reagent) - if (!current_reagent || !current_reagent.data) return null - if (!istype(current_reagent.data, /list)) return current_reagent.data + if (!current_reagent || !current_reagent.data) + return null + if (!istype(current_reagent.data, /list)) + return current_reagent.data var/list/trans_data = current_reagent.data.Copy() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 2f624d883d2..0eb0e12aa40 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -297,12 +297,18 @@ for(var/i=1, i<=len, i+=1) var/ascii = text2ascii(N.dna.features["mcolor"],i) switch(ascii) - if(48) newcolor += "0" - if(49 to 57) newcolor += ascii2text(ascii-1) //numbers 1 to 9 - if(97) newcolor += "9" - if(98 to 102) newcolor += ascii2text(ascii-1) //letters b to f lowercase - if(65) newcolor +="9" - if(66 to 70) newcolor += ascii2text(ascii+31) //letters B to F - translates to lowercase + if(48) + newcolor += "0" + if(49 to 57) + newcolor += ascii2text(ascii-1) //numbers 1 to 9 + if(97) + newcolor += "9" + if(98 to 102) + newcolor += ascii2text(ascii-1) //letters b to f lowercase + if(65) + newcolor +="9" + if(66 to 70) + newcolor += ascii2text(ascii+31) //letters B to F - translates to lowercase else break N.dna.features["mcolor"] = newcolor diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 6b48a8eb4eb..353b3276e18 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -20,9 +20,12 @@ /obj/item/weapon/reagent_containers/blood/update_icon() var/percent = round((reagents.total_volume / volume) * 100) switch(percent) - if(0 to 9) icon_state = "empty" - if(10 to 50) icon_state = "half" - if(51 to INFINITY) icon_state = "full" + if(0 to 9) + icon_state = "empty" + if(10 to 50) + icon_state = "half" + if(51 to INFINITY) + icon_state = "full" /obj/item/weapon/reagent_containers/blood/random/New() blood_type = pick("A+", "A-", "B+", "B-", "O+", "O-") @@ -53,7 +56,7 @@ /obj/item/weapon/reagent_containers/blood/attackby(obj/item/I, mob/user, params) if (istype(I, /obj/item/weapon/pen) || istype(I, /obj/item/toy/crayon)) - + var/t = stripped_input(user, "What would you like to label the blood pack?", name, null, 53) if(!user.canUseTopic(src)) return diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 11ad8afc028..cdb16a8d1a3 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -179,13 +179,20 @@ var/percent = round((reagents.total_volume / volume) * 100) switch(percent) - if(0 to 9) filling.icon_state = "[icon_state]-10" - if(10 to 24) filling.icon_state = "[icon_state]10" - if(25 to 49) filling.icon_state = "[icon_state]25" - if(50 to 74) filling.icon_state = "[icon_state]50" - if(75 to 79) filling.icon_state = "[icon_state]75" - if(80 to 90) filling.icon_state = "[icon_state]80" - if(91 to INFINITY) filling.icon_state = "[icon_state]100" + if(0 to 9) + filling.icon_state = "[icon_state]-10" + if(10 to 24) + filling.icon_state = "[icon_state]10" + if(25 to 49) + filling.icon_state = "[icon_state]25" + if(50 to 74) + filling.icon_state = "[icon_state]50" + if(75 to 79) + filling.icon_state = "[icon_state]75" + if(80 to 90) + filling.icon_state = "[icon_state]80" + if(91 to INFINITY) + filling.icon_state = "[icon_state]100" filling.color = mix_color_from_reagents(reagents.reagent_list) overlays += filling diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 524348b117c..35913d7759c 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -124,11 +124,13 @@ user << "You remove the conveyor belt." qdel(src) return - if(isrobot(user)) return //Carn: fix for borgs dropping their modules on conveyor belts + if(isrobot(user)) + return //Carn: fix for borgs dropping their modules on conveyor belts if(!user.drop_item()) user << "\The [I] is stuck to your hand, you cannot place it on the conveyor!" return - if(I && I.loc) I.loc = src.loc + if(I && I.loc) + I.loc = src.loc return // attack with hand, move pulled object onto conveyor diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 852437a948e..a851e59cab4 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -590,9 +590,12 @@ usr << "Shuttle already in transit." return switch(SSshuttle.moveShuttle(shuttleId, href_list["move"], 1)) - if(0) usr << "Shuttle received message and will be sent shortly." - if(1) usr << "Invalid shuttle requested." - else usr << "Unable to comply." + if(0) + usr << "Shuttle received message and will be sent shortly." + if(1) + usr << "Invalid shuttle requested." + else + usr << "Unable to comply." /obj/machinery/computer/shuttle/emag_act(mob/user) if(!emagged) diff --git a/code/modules/surgery/generic_steps.dm b/code/modules/surgery/generic_steps.dm index d9eaa9136d0..ee324e432b4 100644 --- a/code/modules/surgery/generic_steps.dm +++ b/code/modules/surgery/generic_steps.dm @@ -52,15 +52,18 @@ if(istype(tool, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = tool - if(WT.isOn()) return 1 + if(WT.isOn()) + return 1 else if(istype(tool, /obj/item/weapon/lighter)) var/obj/item/weapon/lighter/L = tool - if(L.lit) return 1 + if(L.lit) + return 1 else if(istype(tool, /obj/item/weapon/match)) var/obj/item/weapon/match/M = tool - if(M.lit) return 1 + if(M.lit) + return 1 return 0 diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 981a8f4a22a..26de8b0b6a5 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -36,15 +36,18 @@ /datum/surgery_step/manipulate_organs/tool_check(mob/user, obj/item/tool) if(istype(tool, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = tool - if(!WT.isOn()) return 0 + if(!WT.isOn()) + return 0 else if(istype(tool, /obj/item/weapon/lighter)) var/obj/item/weapon/lighter/L = tool - if(!L.lit) return 0 + if(!L.lit) + return 0 else if(istype(tool, /obj/item/weapon/match)) var/obj/item/weapon/match/M = tool - if(!M.lit) return 0 + if(!M.lit) + return 0 return 1 diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 2e931859bd2..d947bb16cc8 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -79,7 +79,8 @@ //Damage will not exceed max_damage using this proc //Cannot apply negative damage /obj/item/organ/limb/proc/take_damage(brute, burn) - if(owner && (owner.status_flags & GODMODE)) return 0 //godmode + if(owner && (owner.status_flags & GODMODE)) + return 0 //godmode brute = max(brute,0) burn = max(burn,0) @@ -89,7 +90,8 @@ burn = max(0, burn - 4) var/can_inflict = max_damage - (brute_dam + burn_dam) - if(!can_inflict) return 0 + if(!can_inflict) + return 0 if((brute + burn) < can_inflict) brute_dam += brute @@ -149,13 +151,20 @@ //Returns a display name for the organ /obj/item/organ/limb/proc/getDisplayName() //Added "Chest" and "Head" just in case, this may not be needed switch(name) - if("l_leg") return "left leg" - if("r_leg") return "right leg" - if("l_arm") return "left arm" - if("r_arm") return "right arm" - if("chest") return "chest" - if("head") return "head" - else return name + if("l_leg") + return "left leg" + if("r_leg") + return "right leg" + if("l_arm") + return "left arm" + if("r_arm") + return "right arm" + if("chest") + return "chest" + if("head") + return "head" + else + return name //Remove all embedded objects from all limbs on the human mob diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index ecee25e7b13..36839fa0617 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -19,7 +19,8 @@ /datum/surgery/proc/next_step(mob/user, mob/living/carbon/target) - if(step_in_progress) return + if(step_in_progress) + return var/datum/surgery_step/S = get_surgery_step() if(S) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 1ef38cf1383..11d60ca07b8 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -32,64 +32,64 @@ Notes: /datum/tooltip - var - client/owner - control = "mainwindow.tooltip" - file = 'code/modules/tooltip/tooltip.html' - showing = 0 - queueHide = 0 - init = 0 + var/client/owner + var/control = "mainwindow.tooltip" + var/file = 'code/modules/tooltip/tooltip.html' + var/showing = 0 + var/queueHide = 0 + var/init = 0 - New(client/C) - if (C) - src.owner = C - src.owner << browse(file2text(src.file), "window=[src.control]") +/datum/tooltip/New(client/C) + if (C) + src.owner = C + src.owner << browse(file2text(src.file), "window=[src.control]") - ..() + ..() - proc/show(atom/movable/thing, params = null, title = null, content = null, theme = "default", special = "none") - if (!thing || !params || (!title && !content) || !src.owner || !isnum(world.icon_size)) return 0 - if (!src.init) - //Initialize some vars - src.init = 1 - src.owner << output(list2params(list(world.icon_size, src.control)), "[src.control]:tooltip.init") +/datum/tooltip/proc/show(atom/movable/thing, params = null, title = null, content = null, theme = "default", special = "none") + if (!thing || !params || (!title && !content) || !src.owner || !isnum(world.icon_size)) + return 0 + if (!src.init) + //Initialize some vars + src.init = 1 + src.owner << output(list2params(list(world.icon_size, src.control)), "[src.control]:tooltip.init") - src.showing = 1 + src.showing = 1 - if (title && content) - title = "

      [title]

      " - content = "

      [content]

      " - else if (title && !content) - title = "

      [title]

      " - else if (!title && content) - content = "

      [content]

      " + if (title && content) + title = "

      [title]

      " + content = "

      [content]

      " + else if (title && !content) + title = "

      [title]

      " + else if (!title && content) + content = "

      [content]

      " - //Make our dumb param object - params = {"{ "cursor": "[params]", "screenLoc": "[thing.screen_loc]" }"} + //Make our dumb param object + params = {"{ "cursor": "[params]", "screenLoc": "[thing.screen_loc]" }"} - //Send stuff to the tooltip - src.owner << output(list2params(list(params, src.owner.view, "[title][content]", theme, special)), "[src.control]:tooltip.update") + //Send stuff to the tooltip + src.owner << output(list2params(list(params, src.owner.view, "[title][content]", theme, special)), "[src.control]:tooltip.update") - //If a hide() was hit while we were showing, run hide() again to avoid stuck tooltips - src.showing = 0 - if (src.queueHide) - src.hide() + //If a hide() was hit while we were showing, run hide() again to avoid stuck tooltips + src.showing = 0 + if (src.queueHide) + src.hide() - return 1 + return 1 - proc/hide() - if (src.queueHide) - spawn(1) - winshow(src.owner, src.control, 0) - else +/datum/tooltip/proc/hide() + if (src.queueHide) + spawn(1) winshow(src.owner, src.control, 0) + else + winshow(src.owner, src.control, 0) - src.queueHide = src.showing ? 1 : 0 + src.queueHide = src.showing ? 1 : 0 - return 1 + return 1 /* TG SPECIFIC CODE */ diff --git a/tools/Redirector/Redirector.dm b/tools/Redirector/Redirector.dm index 9ba2096e73c..b19aee82f9d 100644 --- a/tools/Redirector/Redirector.dm +++ b/tools/Redirector/Redirector.dm @@ -18,9 +18,9 @@ var/admin_substr = "admins=" // search for this to locate # of admins world name = "TGstation Redirector" - New() - ..() - gen_configs() +world/New() + ..() + gen_configs() /datum/server var/players = 0
      Non-human Positions
      [replacetext(job.title, " ", " ")]