Merge branch 'master' into cool-ipcs

This commit is contained in:
Timothy Teakettle
2020-10-01 21:06:16 +01:00
committed by GitHub
522 changed files with 181605 additions and 92979 deletions
+13 -12
View File
@@ -79,21 +79,22 @@
//DNA - Because fuck you and your magic numbers being all over the codebase.
#define DNA_BLOCK_SIZE 3
#define DNA_UNI_IDENTITY_BLOCKS 14
#define DNA_UNI_IDENTITY_BLOCKS 15
#define DNA_HAIR_COLOR_BLOCK 1
#define DNA_FACIAL_HAIR_COLOR_BLOCK 2
#define DNA_SKIN_TONE_BLOCK 3
#define DNA_EYE_COLOR_BLOCK 4
#define DNA_GENDER_BLOCK 5
#define DNA_FACIAL_HAIR_STYLE_BLOCK 6
#define DNA_HAIR_STYLE_BLOCK 7
#define DNA_COLOR_ONE_BLOCK 8
#define DNA_COLOR_TWO_BLOCK 9
#define DNA_COLOR_THREE_BLOCK 10
#define DNA_MUTANTTAIL_BLOCK 11
#define DNA_MUTANTEAR_BLOCK 12
#define DNA_MUTANTMARKING_BLOCK 13
#define DNA_TAUR_BLOCK 14
#define DNA_LEFT_EYE_COLOR_BLOCK 4
#define DNA_RIGHT_EYE_COLOR_BLOCK 5
#define DNA_GENDER_BLOCK 6
#define DNA_FACIAL_HAIR_STYLE_BLOCK 7
#define DNA_HAIR_STYLE_BLOCK 8
#define DNA_COLOR_ONE_BLOCK 9
#define DNA_COLOR_TWO_BLOCK 10
#define DNA_COLOR_THREE_BLOCK 11
#define DNA_MUTANTTAIL_BLOCK 12
#define DNA_MUTANTEAR_BLOCK 13
#define DNA_MUTANTMARKING_BLOCK 14
#define DNA_TAUR_BLOCK 15
#define DNA_SEQUENCE_LENGTH 4
#define DNA_MUTATION_BLOCKS 8
+6 -1
View File
@@ -9,7 +9,12 @@
#define DISABLE_BITFIELD(variable, flag) (variable &= ~(flag))
#define CHECK_BITFIELD(variable, flag) (variable & (flag))
#define TOGGLE_BITFIELD(variable, flag) (variable ^= (flag))
#define COPY_SPECIFIC_BITFIELDS(a,b,flags)\
do{\
var/_old = a & ~(flags);\
var/_cleaned = b & (flags);\
a = _old | _cleaned;\
} while(0);
#define CHECK_MULTIPLE_BITFIELDS(flagvar, flags) (((flagvar) & (flags)) == (flags))
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
+1 -1
View File
@@ -1,6 +1,6 @@
// Defines for managed input/keybinding system.
/// Max length of a keypress command before it's considered to be a forged packet/bogus command
#define MAX_KEYPRESS_COMMANDLENGTH 32
#define MAX_KEYPRESS_COMMANDLENGTH 64
/// Maximum keys that can be bound to one button
#define MAX_COMMANDS_PER_KEY 5
/// Maximum keys per keybind
+12
View File
@@ -0,0 +1,12 @@
#define TRAY_NAME_UPDATE name = myseed ? "[initial(name)] ([myseed.plantname])" : initial(name)
#define YIELD_WEED_MINIMUM 3
#define YIELD_WEED_MAXIMUM 10
#define STATIC_NUTRIENT_CAPACITY 10
//Both available scanning modes for the plant analyzer.
#define PLANT_SCANMODE_STATS 0
#define PLANT_SCANMODE_CHEMICALS 1
//Seed flags.
#define MUTATE_EARLY (1<<0)
+2 -2
View File
@@ -47,7 +47,7 @@
#define BALLS_SIZE_DEF 2
#define BALLS_SIZE_MAX 3
#define CUM_RATE 2 // holy shit what a really shitty define name - relates to units per arbitrary measure of time?
#define CUM_RATE 2 // units per 10 seconds
#define CUM_RATE_MULT 1
#define CUM_EFFICIENCY 1 //amount of nutrition required per life()
@@ -58,7 +58,7 @@
#define DEF_BREASTS_SHAPE "Pair"
#define MILK_RATE 5
#define MILK_RATE 3
#define MILK_RATE_MULT 1
#define MILK_EFFICIENCY 1
-3
View File
@@ -230,9 +230,6 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define EXPLODE_LIGHT 3
#define EXPLODE_GIB_THRESHOLD 50
#define EMP_HEAVY 1
#define EMP_LIGHT 2
#define GRENADE_CLUMSY_FUMBLE 1
#define GRENADE_NONCLUMSY_FUMBLE 2
#define GRENADE_NO_FUMBLE 3
+2
View File
@@ -18,3 +18,5 @@
#define POLICYCONFIG_ON_DEFIB_INTACT "ON_DEFIB_INTACT"
/// Displayed to defibbed/revival surgery'd patients after the memory loss time threshold
#define POLICYCONFIG_ON_DEFIB_LATE "ON_DEFIB_LATE"
/// Displayed to pyroclastic slimes on spawn
#define POLICYCONFIG_ON_PYROCLASTIC_SENTIENT "PYROCLASTIC_SLIME"
+2
View File
@@ -246,6 +246,8 @@
#define COMPONENT_BLOCK_SWAP 1
#define COMSIG_PROCESS_BORGCHARGER_OCCUPANT "living_charge"
///from base of mob/AltClickOn(): (atom/A)
#define COMSIG_MOB_ALTCLICKON "mob_altclickon"
// /client signals
#define COMSIG_MOB_CLIENT_LOGIN "mob_client_login" //sent when a mob/login() finishes: (client)
+13
View File
@@ -54,3 +54,16 @@
//donator items
#define LOADOUT_CATEGORY_DONATOR "Donator"
//how many prosthetics can we have
#define MAXIMUM_LOADOUT_PROSTHETICS 2
//what limbs can be amputated or be prosthetic
#define LOADOUT_ALLOWED_LIMB_TARGETS list(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM,BODY_ZONE_L_LEG,BODY_ZONE_R_LEG)
//options for modifiying limbs
#define LOADOUT_LIMB_NORMAL "Normal"
#define LOADOUT_LIMB_PROSTHETIC "Prosthetic"
#define LOADOUT_LIMB_AMPUTATED "Amputated"
#define LOADOUT_LIMBS list(LOADOUT_LIMB_NORMAL,LOADOUT_LIMB_PROSTHETIC,LOADOUT_LIMB_AMPUTATED) //you can amputate your legs/arms though
+2 -2
View File
@@ -199,8 +199,8 @@
#define EXP_DISTRIBUTION(desired_mean) ( -(1/(1/desired_mean)) * log(rand(1, 1000) * 0.001) )
#define LORENTZ_DISTRIBUTION(x, s) ( s*tan(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
#define LORENTZ_DISTRIBUTION(x, s) ( s*tan((rand()-0.5)*180) + x )
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/180)*(arctan((x-y)/s)) + 1/2 )
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
// )
+1 -1
View File
@@ -312,7 +312,7 @@
#define HUMAN_FIRE_STACK_ICON_NUM 3
#define TYPING_INDICATOR_TIMEOUT 5 MINUTES
#define TYPING_INDICATOR_TIMEOUT 20 MINUTES
#define GRAB_PIXEL_SHIFT_PASSIVE 6
#define GRAB_PIXEL_SHIFT_AGGRESSIVE 12
+2
View File
@@ -22,3 +22,5 @@
var/category as text
/// Only clients/mobs with `see_invisibility` higher can use the verb.
var/invisibility as num
/// Whether or not the verb appears in statpanel and commandbar when you press space
var/hidden as num
+4 -1
View File
@@ -51,7 +51,8 @@
#define INIT_ORDER_FAIL2TOPIC 99
#define INIT_ORDER_TITLE 98
#define INIT_ORDER_GARBAGE 95
#define INIT_ORDER_DBCORE 93
#define INIT_ORDER_DBCORE 94
#define INIT_ORDER_STATPANELS 93
#define INIT_ORDER_BLACKBOX 92
#define INIT_ORDER_SERVER_MAINT 91
#define INIT_ORDER_INPUT 90
@@ -86,6 +87,7 @@
#define INIT_ORDER_MINOR_MAPPING -40
#define INIT_ORDER_PATH -50
#define INIT_ORDER_PERSISTENCE -95
#define INIT_ORDER_DEMO -99 // o avoid a bunch of changes related to initialization being written, do this last
#define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.
@@ -120,6 +122,7 @@
#define FIRE_PRIORITY_PROJECTILES 200
#define FIRE_PRIORITY_TICKER 200
#define FIRE_PRIORITY_ATMOS_ADJACENCY 300
#define FIRE_PRIORITY_STATPANEL 390
#define FIRE_PRIORITY_CHAT 400
#define FIRE_PRIORITY_OVERLAYS 500
#define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
+1 -1
View File
@@ -1,5 +1,5 @@
#define WOUND_DAMAGE_EXPONENT 1.225
#define WOUND_DAMAGE_EXPONENT 1.2
/// an attack must do this much damage after armor in order to roll for being a wound (incremental pressure damage need not apply)
#define WOUND_MINIMUM_DAMAGE 5
-6
View File
@@ -553,12 +553,6 @@
if(D.vars[varname] == value)
return D
//remove all nulls from a list
/proc/removeNullsFromList(list/L)
while(L.Remove(null))
continue
return L
//Copies a list, and all lists inside it recusively
//Does not copy any other reference type
/proc/deepCopyList(list/l)
+28 -10
View File
@@ -205,18 +205,36 @@
/proc/start_log(log)
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
/* ui logging */
/proc/log_tgui(user_or_client, text)
/**
* Appends a tgui-related log entry. All arguments are optional.
*/
/proc/log_tgui(user, message, context,
datum/tgui_window/window,
datum/src_object)
var/entry = ""
if(!user_or_client)
entry += "no user"
else if(istype(user_or_client, /mob))
var/mob/user = user_or_client
entry += "[user.ckey] (as [user])"
else if(istype(user_or_client, /client))
var/client/client = user_or_client
// Insert user info
if(!user)
entry += "<nobody>"
else if(istype(user, /mob))
var/mob/mob = user
entry += "[mob.ckey] (as [mob] at [mob.x],[mob.y],[mob.z])"
else if(istype(user, /client))
var/client/client = user
entry += "[client.ckey]"
entry += ":\n[text]"
// Insert context
if(context)
entry += " in [context]"
else if(window)
entry += " in [window.id]"
// Resolve src_object
if(!src_object && window && window.locked_by)
src_object = window.locked_by.src_object
// Insert src_object info
if(src_object)
entry += "\nUsing: [src_object.type] [REF(src_object)]"
// Insert message
if(message)
entry += "\n[message]"
WRITE_LOG(GLOB.tgui_log, entry)
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
+3 -2
View File
@@ -1223,7 +1223,7 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico
return "<img class='icon icon-[A.icon_state]' src='data:image/png;base64,[bicon_cache[key]]'>"
//Costlier version of icon2html() that uses getFlatIcon() to account for overlays, underlays, etc. Use with extreme moderation, ESPECIALLY on mobs.
/proc/costly_icon2html(thing, target)
/proc/costly_icon2html(thing, target, sourceonly = FALSE)
if (!thing)
return
@@ -1231,4 +1231,5 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico
return icon2html(thing, target)
var/icon/I = getFlatIcon(thing)
return icon2html(I, target)
return icon2html(I, target, sourceonly = sourceonly)
+1 -1
View File
@@ -349,7 +349,7 @@
if(!previous)
var/list/report_parts = list(personal_report(C), GLOB.common_report)
content = report_parts.Join()
C.verbs -= /client/proc/show_previous_roundend_report
remove_verb(C, /client/proc/show_previous_roundend_report)
fdel(filename)
text2file(content, filename)
else
+4
View File
@@ -1254,6 +1254,10 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
var/obj/structure/window/W = O
if(W.ini_dir == dir_to_check || W.ini_dir == FULLTILE_WINDOW_DIR || dir_to_check == FULLTILE_WINDOW_DIR)
return FALSE
if(istype(O, /obj/structure/railing))
var/obj/structure/railing/rail = O
if(rail.ini_dir == dir_to_check || rail.ini_dir == FULLTILE_WINDOW_DIR || dir_to_check == FULLTILE_WINDOW_DIR)
return FALSE
return TRUE
/proc/pass()
+96
View File
@@ -0,0 +1,96 @@
/**
* handles adding verbs and updating the stat panel browser
*
* pass the verb type path to this instead of adding it directly to verbs so the statpanel can update
* Arguments:
* * target - Who the verb is being added to, client or mob typepath
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
*/
/proc/add_verb(client/target, verb_or_list_to_add)
if(!target)
CRASH("add_verb called without a target")
if(IsAdminAdvancedProcCall())
return
var/mob/mob_target = null
if(ismob(target))
mob_target = target
target = mob_target.client
else if(!istype(target, /client))
CRASH("add_verb called on a non-mob and non-client")
var/list/verbs_list = list()
if(!islist(verb_or_list_to_add))
verbs_list += verb_or_list_to_add
else
var/list/verb_listref = verb_or_list_to_add
var/list/elements_to_process = verb_listref.Copy()
while(length(elements_to_process))
var/element_or_list = elements_to_process[length(elements_to_process)] //Last element
elements_to_process.len--
if(islist(element_or_list))
elements_to_process += element_or_list //list/a += list/b adds the contents of b into a, not the reference to the list itself
else
verbs_list += element_or_list
if(mob_target)
mob_target.verbs += verbs_list
if(!target)
return //Our work is done.
else
target.verbs += verbs_list
var/list/output_list = list()
for(var/thing in verbs_list)
var/procpath/verb_to_add = thing
output_list[++output_list.len] = list(verb_to_add.category, verb_to_add.name)
output_list = url_encode(json_encode(output_list))
target << output("[output_list];", "statbrowser:add_verb_list")
/**
* handles removing verb and sending it to browser to update, use this for removing verbs
*
* pass the verb type path to this instead of removing it from verbs so the statpanel can update
* Arguments:
* * target - Who the verb is being removed from, client or mob typepath
* * verb - typepath to a verb, or a list of verbs, supports lists of lists
*/
/proc/remove_verb(client/target, verb_or_list_to_remove)
if(IsAdminAdvancedProcCall())
return
var/mob/mob_target = null
if(ismob(target))
mob_target = target
target = mob_target.client
else if(!istype(target, /client))
CRASH("remove_verb called on a non-mob and non-client")
var/list/verbs_list = list()
if(!islist(verb_or_list_to_remove))
verbs_list += verb_or_list_to_remove
else
var/list/verb_listref = verb_or_list_to_remove
var/list/elements_to_process = verb_listref.Copy()
while(length(elements_to_process))
var/element_or_list = elements_to_process[length(elements_to_process)] //Last element
elements_to_process.len--
if(islist(element_or_list))
elements_to_process += element_or_list //list/a += list/b adds the contents of b into a, not the reference to the list itself
else
verbs_list += element_or_list
if(mob_target)
mob_target.verbs -= verbs_list
if(!target)
return //Our work is done.
else
target.verbs -= verbs_list
var/list/output_list = list()
for(var/thing in verbs_list)
var/procpath/verb_to_remove = thing
output_list[++output_list.len] = list(verb_to_remove.category, verb_to_remove.name)
output_list = url_encode(json_encode(output_list))
target << output("[output_list];", "statbrowser:remove_verb_list")
+4 -3
View File
@@ -267,7 +267,7 @@ GLOBAL_LIST_INIT(redacted_strings, list("\[REDACTED\]", "\[CLASSIFIED\]", "\[ARC
GLOBAL_LIST_INIT(wisdoms, world.file2list("strings/wisdoms.txt"))
GLOBAL_LIST_INIT(speech_verbs, list("default","says","gibbers", "states", "chitters", "declares", "bellows", "buzzes" ,"beeps", "chirps" ,"hisses" ,"poofs" ,"rattles", "mewls" ,"barks", "blorbles", "squeaks", "squawks", "flutters"))
GLOBAL_LIST_INIT(speech_verbs, list("default","says","gibbers", "states", "chitters", "chimpers", "declares", "bellows", "buzzes" ,"beeps", "chirps" ,"hisses" ,"poofs" , "puffs", "rattles", "mewls" ,"barks", "blorbles", "squeaks", "squawks", "flutters", "warbles"))
GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/organ/tongue, "lizard tongue" = /obj/item/organ/tongue/lizard, "skeleton tongue" = /obj/item/organ/tongue/bone, "fly tongue" = /obj/item/organ/tongue/fly, "ipc tongue" = /obj/item/organ/tongue/robot/ipc))
@@ -279,7 +279,8 @@ GLOBAL_LIST_INIT(unlocked_mutant_parts, list("horns", "insect_fluff"))
//parts in either of the above two lists that require a second option that allows them to be coloured
GLOBAL_LIST_INIT(colored_mutant_parts, list("insect_wings" = "wings_color", "deco_wings" = "wings_color", "horns" = "horns_color"))
//species ids that have greyscale sprites
//body ids that have greyscale sprites
GLOBAL_LIST_INIT(greyscale_limb_types, list("human","moth","lizard","pod","plant","jelly","slime","golem","lum","stargazer","mush","ethereal","snail","c_golem","b_golem","mammal","xeno","ipc","insect","synthliz","avian","aquatic"))
//species ids that need snowflake coloring applied
//body ids that have prosthetic sprites
GLOBAL_LIST_INIT(prosthetic_limb_types, list("xion","bishop","cybersolutions","grayson","hephaestus","nanotrasen","talon"))
+2 -2
View File
@@ -112,8 +112,8 @@
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
A.AICtrlClick(src)
/mob/living/silicon/ai/AltClickOn(var/atom/A)
if(!A.AIAltClick(src))
altclick_listed_turf(A)
A.AIAltClick(src)
/*
The following criminally helpful code is just the previous code cleaned up;
+17 -13
View File
@@ -319,20 +319,13 @@
return ..()
/*
Alt click
Unused except for AI
Used as an alternate way to interact with things.
*/
/mob/proc/AltClickOn(atom/A)
if(!A.AltClick(src))
altclick_listed_turf(A)
/mob/proc/altclick_listed_turf(atom/A)
var/turf/T = get_turf(A)
if(T == A.loc || T == A)
if(T == listed_turf)
listed_turf = null
else if(TurfAdjacent(T))
listed_turf = T
client.statpanel = T.name
. = SEND_SIGNAL(src, COMSIG_MOB_ALTCLICKON, A)
if(. & COMSIG_MOB_CANCEL_CLICKON)
return
A.AltClick(src)
/mob/living/carbon/AltClickOn(atom/A)
if(!stat && mind && iscarbon(A) && A != src)
@@ -344,7 +337,18 @@
..()
/atom/proc/AltClick(mob/user)
. = SEND_SIGNAL(src, COMSIG_CLICK_ALT, user)
SEND_SIGNAL(src, COMSIG_CLICK_ALT, user)
var/turf/T = get_turf(src)
if(T && (isturf(loc) || isturf(src)) && user.TurfAdjacent(T))
user.listed_turf = T
user.client << output("[url_encode(json_encode(T.name))];", "statbrowser:create_listedturf")
/// Use this instead of [/mob/proc/AltClickOn] where you only want turf content listing without additional atom alt-click interaction
/atom/proc/AltClickNoInteract(mob/user, atom/A)
var/turf/T = get_turf(A)
if(T && user.TurfAdjacent(T))
user.listed_turf = T
user.client << output("[url_encode(json_encode(T.name))];", "statbrowser:create_listedturf")
/mob/proc/TurfAdjacent(turf/T)
return T.Adjacent(src)
+1 -2
View File
@@ -98,8 +98,7 @@
/mob/living/silicon/robot/CtrlClickOn(atom/A)
A.BorgCtrlClick(src)
/mob/living/silicon/robot/AltClickOn(atom/A)
if(!A.BorgAltClick(src))
altclick_listed_turf(A)
A.BorgAltClick(src)
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
CtrlShiftClick(user)
+21
View File
@@ -149,6 +149,27 @@
name = "Choking (Plasma)"
desc = "There's highly flammable, toxic plasma in the air and you're breathing it in. Find some fresh air. The box in your backpack has an oxygen tank and gas mask in it."
icon_state = "too_much_tox"
/obj/screen/alert/not_enough_ch4
name = "Choking (No CH4)"
desc = "You're not getting enough methane. Find some good air before you pass out!"
icon_state = "not_enough_ch4"
/obj/screen/alert/too_much_ch4
name = "Choking (CH4)"
desc = "There's too much methane in the air, and you're breathing it in! Find some good air before you pass out!"
icon_state = "too_much_ch4"
/obj/screen/alert/not_enough_ch3br
name = "Choking (No CH3Br)"
desc = "You're not getting enough methyl bromide. Find some good air before you pass out!"
icon_state = "not_enough_tox"
/obj/screen/alert/too_much_ch3br
name = "Choking (CH3Br)"
desc = "There's highly toxic methyl bromide in the air and you're breathing it in. Find some fresh air. The box in your backpack has an oxygen tank and gas mask in it."
icon_state = "too_much_tox"
//End gas alerts
+3 -3
View File
@@ -11,7 +11,7 @@
var/icon/credits_icon = new(CREDITS_PATH)
LAZYINITLIST(credits)
var/list/_credits = credits
verbs += /client/proc/ClearCredits
add_verb(src, /client/proc/ClearCredits)
var/static/list/credit_order_for_this_round
if(isnull(credit_order_for_this_round))
credit_order_for_this_round = list("Thanks for playing!") + (shuffle(icon_states(credits_icon)) - "Thanks for playing!")
@@ -21,13 +21,13 @@
_credits += new /obj/screen/credit(null, I, src, credits_icon)
sleep(CREDIT_SPAWN_SPEED)
sleep(CREDIT_ROLL_SPEED - CREDIT_SPAWN_SPEED)
verbs -= /client/proc/ClearCredits
remove_verb(src, /client/proc/ClearCredits)
qdel(credits_icon)
/client/proc/ClearCredits()
set name = "Hide Credits"
set category = "OOC"
verbs -= /client/proc/ClearCredits
remove_verb(src, /client/proc/ClearCredits)
QDEL_LIST(credits)
credits = null
+1 -1
View File
@@ -31,7 +31,7 @@
ShiftClickOn(A)
return
if(modifiers["alt"])
altclick_listed_turf(A)
AltClickNoInteract(src, A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
@@ -197,10 +197,9 @@
var/list/banned_edits = list(NAMEOF(src, entries_by_type), NAMEOF(src, entries), NAMEOF(src, directory))
return !(var_name in banned_edits) && ..()
/datum/controller/configuration/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Edit", src)
stat("[name]:", statclick)
/datum/controller/configuration/stat_entry(msg)
msg = "Edit"
return msg
/// Your typical GET but returns a config.
/datum/controller/configuration/proc/GetEntryDatum(entry_type)
@@ -535,3 +535,15 @@
/datum/config_entry/number/max_shuttle_size
config_entry_value = 500
//wound config stuff (increases the max injury roll, making injuries more likely)
/datum/config_entry/number/wound_exponent
config_entry_value = WOUND_DAMAGE_EXPONENT
min_val = 0
integer = FALSE
//adds a set amount to any injury rolls on a limb using get_damage() multiplied by this number
/datum/config_entry/number/wound_damage_multiplier
config_entry_value = 0.333
min_val = 0
integer = FALSE
+1 -1
View File
@@ -16,4 +16,4 @@
/datum/controller/proc/Recover()
/datum/controller/proc/stat_entry()
/datum/controller/proc/stat_entry(msg)
+3 -5
View File
@@ -95,8 +95,6 @@ GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
/datum/controller/failsafe/proc/defcon_pretty()
return defcon
/datum/controller/failsafe/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
stat("Failsafe Controller:", statclick.update("Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])"))
/datum/controller/failsafe/stat_entry(msg)
msg = "Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])"
return msg
+3 -5
View File
@@ -24,11 +24,9 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
//fuck off kevinz
return QDEL_HINT_IWILLGC
/datum/controller/global_vars/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
stat("Globals:", statclick.update("Edit"))
/datum/controller/global_vars/stat_entry(msg)
msg = "Edit"
return msg
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
if(gvars_datum_protected_varlist[var_name])
+3 -6
View File
@@ -615,13 +615,10 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
skip_ticks = 1
/datum/controller/master/stat_entry()
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
/datum/controller/master/stat_entry(msg)
msg = "(TickRate:[Master.processing]) (Iteration:[Master.iteration]) (TickLimit: [round(Master.current_ticklimit, 0.1)])"
return msg
stat("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_INTERNAL_TICK_USAGE,0.1)]%)")
stat("Master Controller:", statclick.update("(TickRate:[Master.processing]) (Iteration:[Master.iteration]) (TickLimit: [round(Master.current_ticklimit, 0.1)])"))
stat("Misc Subsystems", misc_statclick)
/datum/controller/master/StartLoadingMap()
//disallow more than one map to load at once, multithreading it will just cause race conditions
+1 -12
View File
@@ -223,23 +223,12 @@
log_subsystem("INIT", msg)
return time
//hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc.
/datum/controller/subsystem/stat_entry(msg)
if(!statclick)
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%([round(tick_overrun,1)]%)|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"
var/title = name
if (can_fire)
title = "\[[state_letter()]][title]"
stat(title, statclick.update(msg))
return msg
/datum/controller/subsystem/proc/state_letter()
switch (state)
+3 -2
View File
@@ -7,8 +7,9 @@ SUBSYSTEM_DEF(acid)
var/list/currentrun = list()
var/list/processing = list()
/datum/controller/subsystem/acid/stat_entry()
..("P:[processing.len]")
/datum/controller/subsystem/acid/stat_entry(msg)
msg = "P:[length(processing)]"
return ..()
/datum/controller/subsystem/acid/fire(resumed = 0)
+4 -3
View File
@@ -6,12 +6,13 @@ SUBSYSTEM_DEF(adjacent_air)
priority = FIRE_PRIORITY_ATMOS_ADJACENCY
var/list/queue = list()
/datum/controller/subsystem/adjacent_air/stat_entry()
/datum/controller/subsystem/adjacent_air/stat_entry(msg)
#ifdef TESTING
..("P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]")
msg = "P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]"
#else
..("P:[length(queue)]")
msg = "P:[length(queue)]"
#endif
return ..()
/datum/controller/subsystem/adjacent_air/Initialize()
while(length(queue))
+36 -22
View File
@@ -16,7 +16,6 @@ SUBSYSTEM_DEF(air)
var/cost_atmos_machinery = 0
var/cost_equalize = 0
var/list/active_turfs = list()
var/list/hotspots = list()
var/list/networks = list()
var/list/pipenets_needing_rebuilt = list()
@@ -54,14 +53,17 @@ SUBSYSTEM_DEF(air)
msg += "PN:[round(cost_pipenets,1)]|"
msg += "AM:[round(cost_atmos_machinery,1)]"
msg += "} "
msg += "AT:[active_turfs.len]|"
var/active_turfs_len = get_amt_active_turfs()
msg += "AT:[active_turfs_len]|"
msg += "EG:[get_amt_excited_groups()]|"
msg += "HS:[hotspots.len]|"
msg += "PN:[networks.len]|"
msg += "HP:[high_pressure_delta.len]|"
msg += "AS:[active_super_conductivity.len]|"
msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
..(msg)
msg += "GA:[get_amt_gas_mixes()]|"
msg += "MG:[get_max_gas_mixes()]|"
msg += "AT/MS:[round((cost ? active_turfs_len/cost : 0),0.1)]"
return ..()
/datum/controller/subsystem/air/Initialize(timeofday)
extools_update_ssair()
@@ -70,9 +72,11 @@ SUBSYSTEM_DEF(air)
setup_atmos_machinery()
setup_pipenets()
gas_reactions = init_gas_reactions()
extools_update_reactions()
return ..()
/datum/controller/subsystem/air/proc/extools_update_ssair()
/datum/controller/subsystem/air/proc/extools_update_reactions()
/datum/controller/subsystem/air/fire(resumed = 0)
var/timer = TICK_USAGE_REAL
@@ -237,6 +241,8 @@ SUBSYSTEM_DEF(air)
return
/datum/controller/subsystem/air/proc/process_turf_equalize(resumed = 0)
return process_turf_equalize_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag)
/*
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
@@ -251,8 +257,11 @@ SUBSYSTEM_DEF(air)
//equalize_pressure_in_zone(T, fire_count)
if (MC_TICK_CHECK)
return
*/
/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0)
return process_active_turfs_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag)
/*
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
@@ -266,10 +275,10 @@ SUBSYSTEM_DEF(air)
T.process_cell(fire_count)
if (MC_TICK_CHECK)
return
*/
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
if(process_excited_groups_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag))
sleep()
return process_excited_groups_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag)
/*
if (!resumed)
src.currentrun = excited_groups.Copy()
@@ -288,13 +297,20 @@ SUBSYSTEM_DEF(air)
return
*/
/datum/controller/subsystem/air/proc/process_active_turfs_extools()
/datum/controller/subsystem/air/proc/process_turf_equalize_extools()
/datum/controller/subsystem/air/proc/process_excited_groups_extools()
/datum/controller/subsystem/air/proc/get_amt_excited_groups()
/datum/controller/subsystem/air/proc/get_amt_active_turfs()
/datum/controller/subsystem/air/proc/get_amt_gas_mixes()
/datum/controller/subsystem/air/proc/get_max_gas_mixes()
/datum/controller/subsystem/air/proc/add_to_active_extools()
/datum/controller/subsystem/air/proc/remove_from_active_extools()
/datum/controller/subsystem/air/proc/get_active_turfs()
/datum/controller/subsystem/air/proc/clear_active_turfs()
/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
active_turfs -= T
if(currentpart == SSAIR_ACTIVETURFS)
currentrun -= T
remove_from_active_extools(T)
#ifdef VISUALIZE_ACTIVE_TURFS
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#00ff00")
#endif
@@ -308,9 +324,7 @@ SUBSYSTEM_DEF(air)
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
#endif
T.set_excited(TRUE)
active_turfs |= T
if(currentpart == SSAIR_ACTIVETURFS)
currentrun |= T
add_to_active_extools(T)
if(blockchanges)
T.eg_garbage_collect()
else if(T.flags_1 & INITIALIZED_1)
@@ -335,12 +349,11 @@ SUBSYSTEM_DEF(air)
/datum/controller/subsystem/air/proc/setup_allturfs()
var/list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))
var/list/active_turfs = src.active_turfs
var/times_fired = ++src.times_fired
// Clear active turfs - faster than removing every single turf in the world
// one-by-one, and Initalize_Atmos only ever adds `src` back in.
active_turfs.Cut()
clear_active_turfs()
for(var/thing in turfs_to_init)
var/turf/T = thing
@@ -348,28 +361,27 @@ SUBSYSTEM_DEF(air)
continue
T.Initalize_Atmos(times_fired)
CHECK_TICK
if(active_turfs.len)
var/starting_ats = active_turfs.len
var/starting_ats = get_amt_active_turfs()
if(starting_ats)
sleep(world.tick_lag)
var/timer = world.timeofday
log_mapping("There are [starting_ats] active turfs at roundstart caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required).")
for(var/turf/T in active_turfs)
var/list/turfs_to_check = get_active_turfs()
for(var/T in turfs_to_check)
GLOB.active_turfs_startlist += T
//now lets clear out these active turfs
var/list/turfs_to_check = active_turfs.Copy()
do
var/list/new_turfs_to_check = list()
for(var/turf/open/T in turfs_to_check)
new_turfs_to_check += T.resolve_active_graph()
CHECK_TICK
active_turfs += new_turfs_to_check
for(var/T in new_turfs_to_check)
add_to_active_extools(T)
turfs_to_check = new_turfs_to_check
while (turfs_to_check.len)
var/ending_ats = active_turfs.len
var/ending_ats = get_amt_active_turfs()
/*for(var/thing in excited_groups)
var/datum/excited_group/EG = thing
//EG.self_breakdown(space_is_all_consuming = 1)
@@ -445,6 +457,8 @@ SUBSYSTEM_DEF(air)
return pipe_init_dirs_cache[type]["[dir]"]
/proc/get_extools_benchmarks()
#undef SSAIR_PIPENETS
#undef SSAIR_ATMOSMACHINERY
#undef SSAIR_ACTIVETURFS
+2 -1
View File
@@ -9,7 +9,8 @@ SUBSYSTEM_DEF(augury)
var/list/observers_given_action = list()
/datum/controller/subsystem/augury/stat_entry(msg)
..("W:[watchers.len]|D:[doombringers.len]")
msg = "W:[watchers.len]|D:[length(doombringers)]"
return ..()
/datum/controller/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity
+10 -11
View File
@@ -1,3 +1,8 @@
/**
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
SUBSYSTEM_DEF(chat)
name = "Chat"
flags = SS_TICKER
@@ -16,24 +21,18 @@ SUBSYSTEM_DEF(chat)
// Send to tgchat
client.tgui_panel?.window.send_message("chat/message", payload)
// Send to old chat
for(var/msg in payload)
SEND_TEXT(client, msg["text"])
for(var/message in payload)
SEND_TEXT(client, message_to_html(message))
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/chat/proc/queue(target, text, flags)
/datum/controller/subsystem/chat/proc/queue(target, message)
if(islist(target))
for(var/_target in target)
var/client/client = CLIENT_FROM_VAR(_target)
if(client)
LAZYADD(payload_by_client[client], list(list(
"text" = text,
"flags" = flags,
)))
LAZYADD(payload_by_client[client], list(message))
return
var/client/client = CLIENT_FROM_VAR(target)
if(client)
LAZYADD(payload_by_client[client], list(list(
"text" = text,
"flags" = flags,
)))
LAZYADD(payload_by_client[client], list(message))
+2 -1
View File
@@ -20,7 +20,8 @@ SUBSYSTEM_DEF(disease)
return ..()
/datum/controller/subsystem/disease/stat_entry(msg)
..("P:[active_diseases.len]")
msg = "P:[length(active_diseases)]"
return ..()
/datum/controller/subsystem/disease/proc/get_disease_name(id)
var/datum/disease/advance/A = archive_diseases[id]
+3 -3
View File
@@ -7,8 +7,9 @@ SUBSYSTEM_DEF(fire_burning)
var/list/currentrun = list()
var/list/processing = list()
/datum/controller/subsystem/fire_burning/stat_entry()
..("P:[processing.len]")
/datum/controller/subsystem/fire_burning/stat_entry(msg)
msg = "P:[length(processing)]"
return ..()
/datum/controller/subsystem/fire_burning/fire(resumed = 0)
@@ -34,4 +35,3 @@ SUBSYSTEM_DEF(fire_burning)
if (MC_TICK_CHECK)
return
+1 -1
View File
@@ -58,7 +58,7 @@ SUBSYSTEM_DEF(garbage)
msg += "TGR:[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%"
msg += " P:[pass_counts.Join(",")]"
msg += "|F:[fail_counts.Join(",")]"
..(msg)
return ..()
/datum/controller/subsystem/garbage/Shutdown()
//Adds the del() log to the qdel log file
+3 -2
View File
@@ -8,10 +8,11 @@ SUBSYSTEM_DEF(idlenpcpool)
var/list/currentrun = list()
var/static/list/idle_mobs_by_zlevel[][]
/datum/controller/subsystem/idlenpcpool/stat_entry()
/datum/controller/subsystem/idlenpcpool/stat_entry(msg)
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
var/list/zlist = GLOB.simple_animals[AI_Z_OFF]
..("IdleNPCS:[idlelist.len]|Z:[zlist.len]")
msg = "IdleNPCS:[length(idlelist)]|Z:[length(zlist)]"
return ..()
/datum/controller/subsystem/idlenpcpool/proc/MaxZChanged()
if (!islist(idle_mobs_by_zlevel))
+3 -2
View File
@@ -7,8 +7,9 @@ SUBSYSTEM_DEF(lighting)
wait = 2
init_order = INIT_ORDER_LIGHTING
/datum/controller/subsystem/lighting/stat_entry()
..("L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]")
/datum/controller/subsystem/lighting/stat_entry(msg)
msg = "L:[length(GLOB.lighting_update_lights)]|C:[length(GLOB.lighting_update_corners)]|O:[length(GLOB.lighting_update_objects)]"
return ..()
/datum/controller/subsystem/lighting/Initialize(timeofday)
+3 -2
View File
@@ -22,8 +22,9 @@ SUBSYSTEM_DEF(machines)
NewPN.add_cable(PC)
propagate_network(PC,PC.powernet)
/datum/controller/subsystem/machines/stat_entry()
..("M:[processing.len]|PN:[powernets.len]")
/datum/controller/subsystem/machines/stat_entry(msg)
msg = "M:[length(processing)]|PN:[length(powernets)]"
return ..()
/datum/controller/subsystem/machines/fire(resumed = 0)
+3 -2
View File
@@ -10,8 +10,9 @@ SUBSYSTEM_DEF(mobs)
var/static/list/cubemonkeys = list()
var/static/list/cheeserats = list()
/datum/controller/subsystem/mobs/stat_entry()
..("P:[GLOB.mob_living_list.len]")
/datum/controller/subsystem/mobs/stat_entry(msg)
msg = "P:[length(GLOB.mob_living_list)]"
return ..()
/datum/controller/subsystem/mobs/proc/MaxZChanged()
if (!islist(clients_by_zlevel))
+3 -2
View File
@@ -6,9 +6,10 @@ SUBSYSTEM_DEF(npcpool)
var/list/currentrun = list()
/datum/controller/subsystem/npcpool/stat_entry()
/datum/controller/subsystem/npcpool/stat_entry(msg)
var/list/activelist = GLOB.simple_animals[AI_ON]
..("NPCS:[activelist.len]")
msg = "NPCS:[length(activelist)]"
return ..()
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
+3 -2
View File
@@ -22,8 +22,9 @@ SUBSYSTEM_DEF(overlays)
return ..()
/datum/controller/subsystem/overlays/stat_entry()
..("Ov:[length(queue)]")
/datum/controller/subsystem/overlays/stat_entry(msg)
msg = "Ov:[length(queue)]"
return ..()
/datum/controller/subsystem/overlays/Shutdown()
-19
View File
@@ -48,25 +48,6 @@ SUBSYSTEM_DEF(persistence)
/datum/controller/subsystem/persistence/proc/LoadSatchels()
var/placed_satchel = 0
var/path
if(fexists("data/npc_saves/SecretSatchels.sav")) //legacy conversion. Will only ever run once.
var/savefile/secret_satchels = new /savefile("data/npc_saves/SecretSatchels.sav")
for(var/map in secret_satchels)
var/json_file = file("data/npc_saves/SecretSatchels[map].json")
var/list/legacy_secret_satchels = splittext(secret_satchels[map],"#")
var/list/satchels = list()
for(var/i=1,i<=legacy_secret_satchels.len,i++)
var/satchel_string = legacy_secret_satchels[i]
var/list/chosen_satchel = splittext(satchel_string,"|")
if(chosen_satchel.len == 3)
var/list/data = list()
data["x"] = text2num(chosen_satchel[1])
data["y"] = text2num(chosen_satchel[2])
data["saved_obj"] = chosen_satchel[3]
satchels += list(data)
var/list/file_data = list()
file_data["data"] = satchels
WRITE_FILE(json_file, json_encode(file_data))
fdel("data/npc_saves/SecretSatchels.sav")
var/json_file = file("data/npc_saves/SecretSatchels[SSmapping.config.map_name].json")
var/list/json = list()
@@ -10,8 +10,9 @@ SUBSYSTEM_DEF(processing)
var/list/processing = list()
var/list/currentrun = list()
/datum/controller/subsystem/processing/stat_entry()
..("[stat_tag]:[processing.len]")
/datum/controller/subsystem/processing/stat_entry(msg)
msg = "[stat_tag]:[length(processing)]"
return ..()
/datum/controller/subsystem/processing/fire(resumed = 0)
if (!resumed)
+1 -1
View File
@@ -12,7 +12,7 @@ SUBSYSTEM_DEF(profiler)
/datum/controller/subsystem/profiler/stat_entry(msg)
msg += "F:[round(fetch_cost,1)]ms"
msg += "|W:[round(write_cost,1)]ms"
..(msg)
return msg
/datum/controller/subsystem/profiler/Initialize()
if(CONFIG_GET(flag/auto_profile))
+3 -3
View File
@@ -8,8 +8,9 @@ SUBSYSTEM_DEF(spacedrift)
var/list/currentrun = list()
var/list/processing = list()
/datum/controller/subsystem/spacedrift/stat_entry()
..("P:[processing.len]")
/datum/controller/subsystem/spacedrift/stat_entry(msg)
msg = "P:[length(processing)]"
return ..()
/datum/controller/subsystem/spacedrift/fire(resumed = 0)
@@ -56,4 +57,3 @@ SUBSYSTEM_DEF(spacedrift)
AM.inertia_last_loc = AM.loc
if (MC_TICK_CHECK)
return
+195
View File
@@ -0,0 +1,195 @@
SUBSYSTEM_DEF(statpanels)
name = "Stat Panels"
wait = 4
init_order = INIT_ORDER_STATPANELS
priority = FIRE_PRIORITY_STATPANEL
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
var/list/currentrun = list()
var/encoded_global_data
var/mc_data_encoded
var/list/cached_images = list()
/datum/controller/subsystem/statpanels/fire(resumed = FALSE)
if (!resumed)
var/datum/map_config/cached = SSmapping.next_map_config
var/round_time = world.time - SSticker.round_start_time
var/list/global_data = list(
"Map: [SSmapping.config?.map_name || "Loading..."]",
cached ? "Next Map: [cached.map_name]" : null,
"Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]",
"Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]",
"Round Time: [round_time > MIDNIGHT_ROLLOVER ? "[round(round_time/MIDNIGHT_ROLLOVER)]:[worldtime2text()]" : worldtime2text()]",
"Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]",
"Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)"
)
if(SSshuttle.emergency)
var/ETA = SSshuttle.emergency.getModeStr()
if(ETA)
global_data += "[ETA] [SSshuttle.emergency.getTimerStr()]"
/* Please fix
if(SSvote.mode)
var/static/list/supported = list(PLURALITY_VOTING, APPROVAL_VOTING)
global_data += "Vote active!, There is currently a vote running. Question: [SSvote.question]"
if(!(SSvote.vote_system in supported))
global_data += "<STATPANEL VOTING DISABLED>, The current vote system is not supported by statpanel rendering. Please vote manually by opening the vote popup using the action button or chat link."
return
global_data += "Time Left:, [round(SSvote.end_time - world.time)] seconds"
global_data += "Choices:"
for(var/i in 1 to SSvote.choice_statclicks.len)
var/choice = SSvote.choice_statclicks[i]
var/ivotedforthis = FALSE
if(usr.ckey)
switch(SSvote.vote_system)
if(APPROVAL_VOTING)
ivotedforthis = SSvote.voted[usr.ckey] && (i in SSvote.voted[usr.ckey])
if(PLURALITY_VOTING)
ivotedforthis = SSvote.voted[usr.ckey] == i
global_data += (ivotedforthis? "\[X\]" : "\[ \]", SSvote.choice_statclicks[choice])
*/
encoded_global_data = url_encode(json_encode(global_data))
src.currentrun = GLOB.clients.Copy()
mc_data_encoded = null
var/list/currentrun = src.currentrun
while(length(currentrun))
var/client/target = currentrun[length(currentrun)]
currentrun.len--
if(!target.statbrowser_ready)
continue
if(target.stat_tab == "Status")
var/ping_str = url_encode("Ping: [round(target.lastping, 1)]ms (Average: [round(target.avgping, 1)]ms)")
var/other_str = url_encode(json_encode(target.mob.get_status_tab_items()))
target << output("[encoded_global_data];[ping_str];[other_str]", "statbrowser:update")
if(!target.holder)
target << output("", "statbrowser:remove_admin_tabs")
else
if(!("MC" in target.panel_tabs) || !("Tickets" in target.panel_tabs))
target << output("[url_encode(target.holder.href_token)]", "statbrowser:add_admin_tabs")
if(target.stat_tab == "MC")
var/turf/eye_turf = get_turf(target.eye)
var/coord_entry = url_encode(COORD(eye_turf))
if(!mc_data_encoded)
generate_mc_data()
target << output("[mc_data_encoded];[coord_entry]", "statbrowser:update_mc")
if(target.stat_tab == "Tickets")
var/list/ahelp_tickets = GLOB.ahelp_tickets.stat_entry()
target << output("[url_encode(json_encode(ahelp_tickets))];", "statbrowser:update_tickets")
if(!length(GLOB.sdql2_queries) && ("SDQL2" in target.panel_tabs))
target << output("", "statbrowser:remove_sdql2")
else if(length(GLOB.sdql2_queries) && (target.stat_tab == "SDQL2" || !("SDQL2" in target.panel_tabs)))
var/list/sdql2A = list()
sdql2A[++sdql2A.len] = list("", "Access Global SDQL2 List", REF(GLOB.sdql2_vv_statobj))
var/list/sdql2B = list()
for(var/i in GLOB.sdql2_queries)
var/datum/SDQL2_query/Q = i
sdql2B = Q.generate_stat()
sdql2A += sdql2B
target << output(url_encode(json_encode(sdql2A)), "statbrowser:update_sdql2")
if(target.mob)
var/mob/M = target.mob
if((target.stat_tab in target.spell_tabs) || !length(target.spell_tabs) && (length(M.mob_spell_list) || length(M.mind?.spell_list)))
var/list/proc_holders = M.get_proc_holders()
target.spell_tabs.Cut()
for(var/phl in proc_holders)
var/list/proc_holder_list = phl
target.spell_tabs |= proc_holder_list[1]
var/proc_holders_encoded = ""
if(length(proc_holders))
proc_holders_encoded = url_encode(json_encode(proc_holders))
target << output("[url_encode(json_encode(target.spell_tabs))];[proc_holders_encoded]", "statbrowser:update_spells")
if(M?.listed_turf)
var/mob/target_mob = M
if(!target_mob.TurfAdjacent(target_mob.listed_turf))
target << output("", "statbrowser:remove_listedturf")
target_mob.listed_turf = null
else if(target.stat_tab == M?.listed_turf.name || !(M?.listed_turf.name in target.panel_tabs))
var/list/overrides = list()
var/list/turfitems = list()
for(var/img in target.images)
var/image/target_image = img
if(!target_image.loc || target_image.loc.loc != target_mob.listed_turf || !target_image.override)
continue
overrides += target_image.loc
turfitems[++turfitems.len] = list("[target_mob.listed_turf]", REF(target_mob.listed_turf), icon2html(target_mob.listed_turf, target, sourceonly=TRUE))
for(var/tc in target_mob.listed_turf)
var/atom/movable/turf_content = tc
if(turf_content.mouse_opacity == MOUSE_OPACITY_TRANSPARENT)
continue
if(turf_content.invisibility > target_mob.see_invisible)
continue
if(turf_content in overrides)
continue
if(turf_content.IsObscured())
continue
if(length(turfitems) < 30) // only create images for the first 30 items on the turf, for performance reasons
if(!(REF(turf_content) in cached_images))
cached_images += REF(turf_content)
turf_content.RegisterSignal(turf_content, COMSIG_PARENT_QDELETING, /atom/.proc/remove_from_cache) // we reset cache if anything in it gets deleted
if(ismob(turf_content) || length(turf_content.overlays) > 2)
turfitems[++turfitems.len] = list("[turf_content.name]", REF(turf_content), costly_icon2html(turf_content, target, sourceonly=TRUE))
else
turfitems[++turfitems.len] = list("[turf_content.name]", REF(turf_content), icon2html(turf_content, target, sourceonly=TRUE))
else
turfitems[++turfitems.len] = list("[turf_content.name]", REF(turf_content))
else
turfitems[++turfitems.len] = list("[turf_content.name]", REF(turf_content))
turfitems = url_encode(json_encode(turfitems))
target << output("[turfitems];", "statbrowser:update_listedturf")
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/statpanels/proc/generate_mc_data()
var/list/mc_data = list(
list("CPU:", world.cpu),
list("Instances:", "[num2text(world.contents.len, 10)]"),
list("World Time:", "[world.time]"),
list("Globals:", GLOB.stat_entry(), "\ref[GLOB]"),
list("[config]:", config.stat_entry(), "\ref[config]"),
list("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_INTERNAL_TICK_USAGE,0.1)]%)"),
list("Master Controller:", Master.stat_entry(), "\ref[Master]"),
list("Failsafe Controller:", Failsafe.stat_entry(), "\ref[Failsafe]"),
list("","")
)
for(var/ss in Master.subsystems)
var/datum/controller/subsystem/sub_system = ss
mc_data[++mc_data.len] = list("\[[sub_system.state_letter()]][sub_system.name]", sub_system.stat_entry(), "\ref[sub_system]")
mc_data[++mc_data.len] = list("Camera Net", "Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]", "\ref[GLOB.cameranet]")
mc_data_encoded = url_encode(json_encode(mc_data))
/atom/proc/remove_from_cache()
SSstatpanels.cached_images -= REF(src)
/// verbs that send information from the browser UI
/client/verb/set_tab(tab as text|null)
set name = "Set Tab"
set hidden = TRUE
stat_tab = tab
/client/verb/send_tabs(tabs as text|null)
set name = "Send Tabs"
set hidden = TRUE
panel_tabs |= tabs
/client/verb/remove_tabs(tabs as text|null)
set name = "Remove Tabs"
set hidden = TRUE
panel_tabs -= tabs
/client/verb/reset_tabs()
set name = "Reset Tabs"
set hidden = TRUE
panel_tabs = list()
/client/verb/panel_ready()
set name = "Panel Ready"
set hidden = TRUE
statbrowser_ready = TRUE
+9 -7
View File
@@ -24,15 +24,16 @@ SUBSYSTEM_DEF(tgui)
var/basehtml
/datum/controller/subsystem/tgui/PreInit()
basehtml = file2text('tgui/packages/tgui/public/tgui.html')
basehtml = file2text('tgui/public/tgui.html')
/datum/controller/subsystem/tgui/Shutdown()
close_all_uis()
/datum/controller/subsystem/tgui/stat_entry()
..("P:[open_uis.len]")
/datum/controller/subsystem/tgui/stat_entry(msg)
msg = "P:[length(open_uis)]"
return ..()
/datum/controller/subsystem/tgui/fire(resumed = 0)
/datum/controller/subsystem/tgui/fire(resumed = FALSE)
if(!resumed)
src.current_run = open_uis.Copy()
// Cache for sanic speed (lists are references anyways)
@@ -81,7 +82,8 @@ SUBSYSTEM_DEF(tgui)
window_found = TRUE
break
if(!window_found)
log_tgui(user, "Error: Pool exhausted")
log_tgui(user, "Error: Pool exhausted",
context = "SStgui/request_pooled_window")
return null
return window
@@ -93,7 +95,7 @@ SUBSYSTEM_DEF(tgui)
* required user mob
*/
/datum/controller/subsystem/tgui/proc/force_close_all_windows(mob/user)
log_tgui(user, "force_close_all_windows")
log_tgui(user, context = "SStgui/force_close_all_windows")
if(user.client)
user.client.tgui_windows = list()
for(var/i in 1 to TGUI_WINDOW_HARD_LIMIT)
@@ -109,7 +111,7 @@ SUBSYSTEM_DEF(tgui)
* required window_id string
*/
/datum/controller/subsystem/tgui/proc/force_close_window(mob/user, window_id)
log_tgui(user, "force_close_window")
log_tgui(user, context = "SStgui/force_close_window")
// Close all tgui datums based on window_id.
for(var/datum/tgui/ui in user.tgui_open_uis)
if(ui.window && ui.window.id == window_id)
+3 -2
View File
@@ -11,8 +11,9 @@ SUBSYSTEM_DEF(throwing)
var/list/currentrun
var/list/processing = list()
/datum/controller/subsystem/throwing/stat_entry()
..("P:[processing.len]")
/datum/controller/subsystem/throwing/stat_entry(msg)
msg = "P:[length(processing)]"
return ..()
/datum/controller/subsystem/throwing/fire(resumed = 0)
+2
View File
@@ -396,6 +396,7 @@ SUBSYSTEM_DEF(ticker)
SSjob.EquipRank(N, player.mind.assigned_role, 0)
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N)
N.client.prefs.post_copy_to(player)
CHECK_TICK
if(captainless)
for(var/mob/dead/new_player/N in GLOB.player_list)
@@ -416,6 +417,7 @@ SUBSYSTEM_DEF(ticker)
living.client.prefs.chat_toggles ^= CHAT_OOC
var/obj/screen/splash/S = new(living.client, TRUE)
S.Fade(TRUE)
living.client.init_verbs()
livings += living
if(livings.len)
addtimer(CALLBACK(src, .proc/release_characters, livings), 30, TIMER_CLIENT_TIME)
+2 -1
View File
@@ -34,7 +34,8 @@ SUBSYSTEM_DEF(timer)
bucket_resolution = world.tick_lag
/datum/controller/subsystem/timer/stat_entry(msg)
..("B:[bucket_count] P:[length(second_queue)] H:[length(hashes)] C:[length(clienttime_timers)] S:[length(timer_id_dict)]")
msg = "B:[bucket_count] P:[length(second_queue)] H:[length(hashes)] C:[length(clienttime_timers)] S:[length(timer_id_dict)]"
return ..()
/datum/controller/subsystem/timer/fire(resumed = FALSE)
var/lit = last_invoke_tick
+4
View File
@@ -65,10 +65,14 @@
detonate(user)
/datum/component/killerqueen/proc/bump_detonate(datum/source, atom/A)
var/atom/us = parent
if(!us.density) // lazy anti-item-throw-OHKO, we need something better at some point
return
detonate(A)
/datum/component/killerqueen/proc/touch_detonate(datum/source, mob/user)
detonate(user)
return COMPONENT_NO_ATTACK_HAND
/datum/component/killerqueen/proc/on_examine(datum/source, mob/examiner, list/examine_return)
if(examine_message)
@@ -99,7 +99,6 @@ Bonus
*/
/datum/symptom/alkali
name = "Alkali perspiration"
desc = "The virus attaches to sudoriparous glands, synthesizing a chemical that bursts into flames when reacting with water, leading to self-immolation."
stealth = 2
@@ -32,7 +32,7 @@ Bonus
"Stage Speed 10" = "Further increases cooling speed."
)
/datum/symptom/fever/Start(datum/disease/advance/A)
/datum/symptom/shivering/Start(datum/disease/advance/A)
if(!..())
return
if(A.properties["stage_rate"] >= 5) //dangerous cold
@@ -58,4 +58,4 @@ Bonus
if(unsafe)
limit = 0
M.adjust_bodytemperature(-get_cold * A.stage, limit)
return 1
return 1
+8 -4
View File
@@ -132,7 +132,8 @@
L[DNA_FACIAL_HAIR_STYLE_BLOCK] = construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len)
L[DNA_FACIAL_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.facial_hair_color)
L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len)
L[DNA_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.eye_color)
L[DNA_LEFT_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.left_eye_color)
L[DNA_RIGHT_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.right_eye_color)
L[DNA_COLOR_ONE_BLOCK] = sanitize_hexcolor(features["mcolor"], 6)
L[DNA_COLOR_TWO_BLOCK] = sanitize_hexcolor(features["mcolor2"], 6)
L[DNA_COLOR_THREE_BLOCK] = sanitize_hexcolor(features["mcolor3"], 6)
@@ -224,8 +225,10 @@
setblock(uni_identity, blocknumber, sanitize_hexcolor(H.facial_hair_color))
if(DNA_SKIN_TONE_BLOCK)
setblock(uni_identity, blocknumber, construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len))
if(DNA_EYE_COLOR_BLOCK)
setblock(uni_identity, blocknumber, sanitize_hexcolor(H.eye_color))
if(DNA_LEFT_EYE_COLOR_BLOCK)
setblock(uni_identity, blocknumber, sanitize_hexcolor(H.left_eye_color))
if(DNA_RIGHT_EYE_COLOR_BLOCK)
setblock(uni_identity, blocknumber, sanitize_hexcolor(H.right_eye_color))
if(DNA_GENDER_BLOCK)
switch(H.gender)
if(MALE)
@@ -464,7 +467,8 @@
hair_color = sanitize_hexcolor(getblock(structure, DNA_HAIR_COLOR_BLOCK))
facial_hair_color = sanitize_hexcolor(getblock(structure, DNA_FACIAL_HAIR_COLOR_BLOCK))
skin_tone = dna.skin_tone_override || GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)]
eye_color = sanitize_hexcolor(getblock(structure, DNA_EYE_COLOR_BLOCK))
left_eye_color = sanitize_hexcolor(getblock(structure, DNA_LEFT_EYE_COLOR_BLOCK))
right_eye_color = sanitize_hexcolor(getblock(structure, DNA_RIGHT_EYE_COLOR_BLOCK))
facial_hair_style = GLOB.facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), GLOB.facial_hair_styles_list.len)]
hair_style = GLOB.hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), GLOB.hair_styles_list.len)]
if(icon_update)
+1 -1
View File
@@ -51,7 +51,7 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
LAZYREMOVE(GLOB.mobs_with_editable_flavor_text[M], src)
if(!GLOB.mobs_with_editable_flavor_text[M])
GLOB.mobs_with_editable_flavor_text -= M
M.verbs -= /mob/proc/manage_flavor_tests
remove_verb(M, /mob/proc/manage_flavor_tests)
/datum/element/flavor_text/proc/show_flavor(atom/target, mob/user, list/examine_list)
if(!always_show && isliving(target))
+2 -2
View File
@@ -64,7 +64,7 @@
else if(make_temporary)
base = H.mind.default_martial_art
if(help_verb)
H.verbs += help_verb
add_verb(H, help_verb)
H.mind.martial_art = src
if(pugilist)
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
@@ -90,7 +90,7 @@
/datum/martial_art/proc/on_remove(mob/living/carbon/human/H)
if(help_verb)
H.verbs -= help_verb
remove_verb(H, help_verb)
return
///Gets called when a projectile hits the owner. Returning anything other than BULLET_ACT_HIT will stop the projectile from hitting the mob.
+2
View File
@@ -132,6 +132,7 @@
new_character.key = key //now transfer the key to link the client to our new body
if(new_character.client)
LAZYCLEARLIST(new_character.client.recent_examines)
new_character.client.init_verbs() // re-initialize character specific verbs
current.update_atom_languages()
//CIT CHANGE - makes arousal update when transfering bodies
@@ -693,6 +694,7 @@
if(istype(S, spell))
spell_list -= S
qdel(S)
current?.client << output(null, "statbrowser:check_spells")
/datum/mind/proc/RemoveAllSpells()
for(var/obj/effect/proc_holder/S in spell_list)
+1 -1
View File
@@ -11,7 +11,7 @@
var/lowest_value = 256 * 8
var/text_gain_indication = ""
var/text_lose_indication = ""
var/list/mutable_appearance/visual_indicators = list()
var/list/visual_indicators = list()
var/obj/effect/proc_holder/spell/power
var/layer_used = MUTATIONS_LAYER //which mutation layer to use
var/list/species_allowed = list() //to restrict mutation to only certain species
+16 -49
View File
@@ -211,24 +211,27 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
H.gain_trauma(T, TRAUMA_RESILIENCE_ABSOLUTE)
/datum/quirk/paraplegic/on_spawn()
if(quirk_holder.buckled) // Handle late joins being buckled to arrival shuttle chairs.
quirk_holder.buckled.unbuckle_mob(quirk_holder)
if(quirk_holder.client)
var/modified_limbs = quirk_holder.client.prefs.modified_limbs
if(!(modified_limbs[BODY_ZONE_L_LEG] == LOADOUT_LIMB_AMPUTATED && modified_limbs[BODY_ZONE_R_LEG] == LOADOUT_LIMB_AMPUTATED && !isjellyperson(quirk_holder)))
if(quirk_holder.buckled) // Handle late joins being buckled to arrival shuttle chairs.
quirk_holder.buckled.unbuckle_mob(quirk_holder)
var/turf/T = get_turf(quirk_holder)
var/obj/structure/chair/spawn_chair = locate() in T
var/turf/T = get_turf(quirk_holder)
var/obj/structure/chair/spawn_chair = locate() in T
var/obj/vehicle/ridden/wheelchair/wheels = new(T)
if(spawn_chair) // Makes spawning on the arrivals shuttle more consistent looking
wheels.setDir(spawn_chair.dir)
var/obj/vehicle/ridden/wheelchair/wheels = new(T)
if(spawn_chair) // Makes spawning on the arrivals shuttle more consistent looking
wheels.setDir(spawn_chair.dir)
wheels.buckle_mob(quirk_holder)
wheels.buckle_mob(quirk_holder)
// During the spawning process, they may have dropped what they were holding, due to the paralysis
// So put the things back in their hands.
// During the spawning process, they may have dropped what they were holding, due to the paralysis
// So put the things back in their hands.
for(var/obj/item/I in T)
if(I.fingerprintslast == quirk_holder.ckey)
quirk_holder.put_in_hands(I)
for(var/obj/item/I in T)
if(I.fingerprintslast == quirk_holder.ckey)
quirk_holder.put_in_hands(I)
/datum/quirk/poor_aim
name = "Poor Aim"
@@ -244,42 +247,6 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
mob_trait = TRAIT_PROSOPAGNOSIA
medical_record_text = "Patient suffers from prosopagnosia and cannot recognize faces."
/datum/quirk/prosthetic_limb
name = "Prosthetic Limb"
desc = "An accident caused you to lose one of your limbs. Because of this, you now have a random prosthetic!"
value = -1
var/slot_string = "limb"
/datum/quirk/prosthetic_limb/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
var/limb_slot
if(HAS_TRAIT(H, TRAIT_PARA))//Prevent paraplegic legs being replaced
limb_slot = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)
else
limb_slot = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
var/obj/item/bodypart/old_part = H.get_bodypart(limb_slot)
var/obj/item/bodypart/prosthetic
switch(limb_slot)
if(BODY_ZONE_L_ARM)
prosthetic = new/obj/item/bodypart/l_arm/robot/surplus(quirk_holder)
slot_string = "left arm"
if(BODY_ZONE_R_ARM)
prosthetic = new/obj/item/bodypart/r_arm/robot/surplus(quirk_holder)
slot_string = "right arm"
if(BODY_ZONE_L_LEG)
prosthetic = new/obj/item/bodypart/l_leg/robot/surplus(quirk_holder)
slot_string = "left leg"
if(BODY_ZONE_R_LEG)
prosthetic = new/obj/item/bodypart/r_leg/robot/surplus(quirk_holder)
slot_string = "right leg"
prosthetic.replace_limb(H)
qdel(old_part)
H.regenerate_icons()
/datum/quirk/prosthetic_limb/post_add()
to_chat(quirk_holder, "<span class='boldannounce'>Your [slot_string] has been replaced with a surplus prosthetic. It is fragile and will easily come apart under duress. Additionally, \
you need to use a welding tool and cables to repair it, instead of bruise packs and ointment.</span>")
/datum/quirk/insanity
name = "Reality Dissociation Syndrome"
desc = "You suffer from a severe disorder that causes very vivid hallucinations. Mindbreaker toxin can suppress its effects, and you are immune to mindbreaker's hallucinogenic properties. <b>This is not a license to grief.</b>"
+2 -2
View File
@@ -204,12 +204,12 @@
return S
/// Called from [/atom/proc/emp_act]
/datum/wires/proc/emp_pulse()
/datum/wires/proc/emp_pulse(severity)
var/list/possible_wires = shuffle(wires)
var/remaining_pulses = MAXIMUM_EMP_WIRES
for(var/wire in possible_wires)
if(prob(33))
if(prob(10 + severity/3.5))
pulse(wire)
remaining_pulses--
if(!remaining_pulses)
+2 -2
View File
@@ -71,7 +71,7 @@
/datum/wires/airlock/on_pulse(wire)
set waitfor = FALSE
var/obj/machinery/door/airlock/A = holder
if(!A.hasSiliconAccessInArea(usr) && A.isElectrified() && A.shock(usr, 100))
if(usr && !A.hasSiliconAccessInArea(usr) && A.isElectrified() && A.shock(usr, 100))
return FALSE
switch(wire)
if(WIRE_POWER1, WIRE_POWER2) // Pulse to loose power.
@@ -127,7 +127,7 @@
/datum/wires/airlock/on_cut(wire, mend)
var/obj/machinery/door/airlock/A = holder
if(!A.hasSiliconAccessInArea(usr) && A.isElectrified() && A.shock(usr, 100))
if(usr && !A.hasSiliconAccessInArea(usr) && A.isElectrified() && A.shock(usr, 100))
return FALSE
switch(wire)
if(WIRE_POWER1, WIRE_POWER2) // Cut to loose power, repair all to gain power.
+2 -2
View File
@@ -40,7 +40,7 @@
new_ai = select_active_ai(R)
R.notify_ai(DISCONNECT)
if(new_ai && (new_ai != R.connected_ai))
R.connected_ai = new_ai
R.set_connected_ai(new_ai)
if(R.shell)
R.undeploy() //If this borg is an AI shell, disconnect the controlling AI and assign ti to a new AI
R.notify_ai(AI_SHELL)
@@ -69,7 +69,7 @@
R.notify_ai(DISCONNECT)
if(R.shell)
R.undeploy()
R.connected_ai = null
R.set_connected_ai(null)
if(WIRE_LAWSYNC) // Cut the law wire, and the borg will no longer receive law updates from its AI. Repair and it will re-sync.
if(mend)
if(!R.emagged)
+2 -1
View File
@@ -43,6 +43,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
outdoors = TRUE
ambientsounds = SPACE
blob_allowed = FALSE //Eating up space doesn't count for victory as a blob.
considered_hull_exterior = TRUE
/area/space/nearstation
icon_state = "space_near"
@@ -1592,4 +1593,4 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
valid_territory = FALSE
outdoors = TRUE
ambientsounds = SPACE
blob_allowed = FALSE //While part of the station, what good will it do you?
blob_allowed = FALSE //While part of the station, what good will it do you?
+3
View File
@@ -34,6 +34,9 @@
/// If megafauna can be spawned by natural random generation
var/megafauna_spawn_allowed = FALSE
/// Considered space for hull shielding
var/considered_hull_exterior = FALSE
var/fire = null
var/atmos = TRUE
var/atmosalm = FALSE
+68
View File
@@ -150,6 +150,74 @@
name = "Space Diner Solar Array"
icon_state = "yellow"
//Ruin of "Skelter" ship
/area/ruin/space/has_grav/skelter
name = "The Skelter"
icon_state = "red"
/area/ruin/space/has_grav/skelter/admin
name = "Administration"
icon_state = "bridge"
/area/ruin/space/has_grav/skelter/comms
name = "Communications"
icon_state = "tcomsatcomp"
/area/ruin/space/has_grav/skelter/sec
name = "Security Office"
icon_state = "security"
/area/ruin/space/has_grav/skelter/cafe
name = "Cafeteria"
icon_state = "cafeteria"
/area/ruin/space/has_grav/skelter/crew
name = "Crew Quarters"
icon_state = "crew_quarters"
/area/ruin/space/has_grav/skelter/med
name = "Med Bay"
icon_state = "medbay3"
/area/ruin/space/has_grav/skelter/engine
name = "Reactor"
icon_state = "engine"
/area/ruin/space/has_grav/skelter/engine/upper
name = "Port Engine"
/area/ruin/space/has_grav/skelter/engine/lower
name = "Starboard Engine"
/area/ruin/space/has_grav/skelter/engine/powerstorage
name = "Electrical"
icon_state = "engine_smes"
/area/ruin/space/has_grav/skelter/oxy
name = "02"
icon_state = "atmos"
/area/ruin/space/has_grav/skelter/nav
name = "Navigation"
icon_state = "start"
/area/ruin/space/has_grav/skelter/forehall
name = "Forward Hallway"
icon_state = "hallF"
/area/ruin/space/has_grav/skelter/afthall
name = "Aft Hallway"
icon_state = "hallA"
/area/ruin/space/has_grav/skelter/storage
name = "Storage"
icon_state = "storage"
/area/ruin/space/has_grav/skelter/shields
name = "Shields"
icon_state = "green"
//Ruin of Derelict Oupost
/area/ruin/space/has_grav/derelictoutpost
+19 -1
View File
@@ -296,7 +296,7 @@
/atom/proc/emp_act(severity)
var/protection = SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity)
if(!(protection & EMP_PROTECT_WIRES) && istype(wires))
wires.emp_pulse()
wires.emp_pulse(severity)
return protection // Pass the protection value collected here upwards
/atom/proc/bullet_act(obj/item/projectile/P, def_zone)
@@ -1127,3 +1127,21 @@
*/
/atom/proc/rust_heretic_act()
return
///Passes Stat Browser Panel clicks to the game and calls client click on an atom
/atom/Topic(href, list/href_list)
. = ..()
if(!usr?.client)
return
var/client/usr_client = usr.client
var/list/paramslist = list()
if(href_list["statpanel_item_shiftclick"])
paramslist["shift"] = "1"
if(href_list["statpanel_item_ctrlclick"])
paramslist["ctrl"] = "1"
if(href_list["statpanel_item_altclick"])
paramslist["alt"] = "1"
if(href_list["statpanel_item_click"])
// first of all make sure we valid
var/mouseparams = list2params(paramslist)
usr_client.Click(src, loc, null, mouseparams)
+4 -6
View File
@@ -173,7 +173,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null)
dat += "[DR.ruletype] - <b>[DR.name]</b><br>"
else
dat += "none.<br>"
dat += "<br>Injection Timers: (<b>[storyteller.get_injection_chance(TRUE)]%</b> chance)<BR>"
dat += "<br>Injection Timers:<BR>"
dat += "Latejoin: [(latejoin_injection_cooldown-world.time)>60*10 ? "[round((latejoin_injection_cooldown-world.time)/60/10,0.1)] minutes" : "[(latejoin_injection_cooldown-world.time)/10] seconds"] <a href='?src=\ref[src];[HrefToken()];injectlate=1'>\[Now!\]</a><BR>"
dat += "Midround: [(midround_injection_cooldown-world.time)>60*10 ? "[round((midround_injection_cooldown-world.time)/60/10,0.1)] minutes" : "[(midround_injection_cooldown-world.time)/10] seconds"] <a href='?src=\ref[src];[HrefToken()];injectmid=1'>\[Now!\]</a><BR>"
usr << browse(dat.Join(), "window=gamemode_panel;size=500x500")
@@ -513,7 +513,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null)
drafted_rules -= starting_rule
starting_rule.trim_candidates()
starting_rule.scale_up(extra_rulesets_amount, threat_level)
starting_rule.scale_up(extra_rulesets_amount, threat_level-added_threat)
if (starting_rule.pre_execute())
log_threat("[starting_rule.ruletype] - <b>[starting_rule.name]</b> [starting_rule.cost + starting_rule.scaled_times * starting_rule.scaling_cost] threat", verbose = TRUE)
if(starting_rule.flags & HIGHLANDER_RULESET)
@@ -675,13 +675,12 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null)
log_game("DYNAMIC: Checking for midround injection.")
update_playercounts()
if (prob(storyteller.get_injection_chance()))
if (storyteller.should_inject_antag())
SSblackbox.record_feedback("tally","dynamic",1,"Attempted midround injections")
var/list/drafted_rules = storyteller.midround_draft()
if (drafted_rules.len > 0)
SSblackbox.record_feedback("tally","dynamic",1,"Successful midround injections")
picking_midround_latejoin_rule(drafted_rules)
// get_injection_chance can do things on fail
/// Updates current_players.
/datum/game_mode/dynamic/proc/update_playercounts()
@@ -757,12 +756,11 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null)
picking_midround_latejoin_rule(list(forced_latejoin_rule), forced = TRUE)
forced_latejoin_rule = null
else if (latejoin_injection_cooldown < world.time && prob(storyteller.get_injection_chance()))
else if (storyteller.should_inject_antag())
SSblackbox.record_feedback("tally","dynamic",1,"Attempted latejoin injections")
var/list/drafted_rules = storyteller.latejoin_draft(newPlayer)
if (drafted_rules.len > 0 && picking_midround_latejoin_rule(drafted_rules))
SSblackbox.record_feedback("tally","dynamic",1,"Successful latejoin injections")
latejoin_injection_cooldown = storyteller.get_latejoin_cooldown() + world.time
/// Increase the threat level.
/datum/game_mode/dynamic/proc/create_threat(gain)
@@ -96,17 +96,11 @@ Property weights are added to the config weight of the ruleset. They are:
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
return round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
/datum/dynamic_storyteller/proc/get_latejoin_cooldown()
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
return round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
/datum/dynamic_storyteller/proc/get_injection_chance(dry_run = FALSE)
/datum/dynamic_storyteller/proc/should_inject_antag(dry_run = FALSE)
if(mode.forced_injection)
mode.forced_injection = !dry_run
return 100
var/threat_perc = mode.threat/mode.threat_level
return clamp(round(100*(1-(threat_perc*threat_perc))**2,1),0,100)
return TRUE
return mode.threat < mode.threat_level
/datum/dynamic_storyteller/proc/roundstart_draft()
var/list/drafted_rules = list()
@@ -210,9 +204,6 @@ Property weights are added to the config weight of the ruleset. They are:
/datum/dynamic_storyteller/chaotic/get_midround_cooldown()
return ..() / 4
/datum/dynamic_storyteller/chaotic/get_latejoin_cooldown()
return ..() / 4
/datum/dynamic_storyteller/team
name = "Teamwork"
config_tag = "teamwork"
@@ -224,8 +215,8 @@ Property weights are added to the config weight of the ruleset. They are:
flags = WAROPS_ALWAYS_ALLOWED | USE_PREV_ROUND_WEIGHTS
property_weights = list("valid" = 3, "trust" = 5)
/datum/dynamic_storyteller/team/get_injection_chance(dry_run = FALSE)
return (mode.current_players[CURRENT_LIVING_ANTAGS].len ? 0 : ..())
/datum/dynamic_storyteller/team/should_inject_antag(dry_run = FALSE)
return (mode.current_players[CURRENT_LIVING_ANTAGS].len ? FALSE : ..())
/datum/dynamic_storyteller/conversion
name = "Conversion"
@@ -250,11 +241,8 @@ Property weights are added to the config weight of the ruleset. They are:
/datum/dynamic_storyteller/random/get_midround_cooldown()
return rand(GLOB.dynamic_midround_delay_min/2, GLOB.dynamic_midround_delay_max*2)
/datum/dynamic_storyteller/random/get_latejoin_cooldown()
return rand(GLOB.dynamic_latejoin_delay_min/2, GLOB.dynamic_latejoin_delay_max*2)
/datum/dynamic_storyteller/random/get_injection_chance()
return 50 // i would do rand(0,100) but it's actually the same thing when you do the math
/datum/dynamic_storyteller/random/should_inject_antag()
return prob(50)
/datum/dynamic_storyteller/random/roundstart_draft()
var/list/drafted_rules = list()
@@ -318,7 +306,7 @@ Property weights are added to the config weight of the ruleset. They are:
curve_width = 2
dead_player_weight = 2
flags = USE_PREV_ROUND_WEIGHTS
property_weights = list("trust" = -3)
property_weights = list("trust" = -2)
/datum/dynamic_storyteller/liteextended
name = "Calm"
@@ -326,7 +314,7 @@ Property weights are added to the config weight of the ruleset. They are:
desc = "Low-chaos round. Few antags. No conversion."
curve_centre = -3
curve_width = 0.5
flags = NO_ASSASSIN | FORCE_IF_WON
flags = NO_ASSASSIN
weight = 1
dead_player_weight = 5
property_weights = list("extended" = 2, "chaos" = -1, "valid" = -1, "conversion" = -10)
@@ -344,5 +332,5 @@ Property weights are added to the config weight of the ruleset. They are:
/datum/dynamic_storyteller/no_antag/roundstart_draft()
return list()
/datum/dynamic_storyteller/no_antag/get_injection_chance(dry_run)
return 0
/datum/dynamic_storyteller/no_antag/should_inject_antag(dry_run)
return FALSE
+6 -7
View File
@@ -1,14 +1,15 @@
# DYNAMIC
Tries to keep the round at a certain level of action, based on the round's "threat level".
## ROUNDSTART
Dynamic rolls threat based on a special sauce formula:
"dynamic_curve_width \* tan((3.1416 \* (rand() - 0.5) \* 57.2957795)) + dynamic_curve_centre"
"dynamic_curve_width \* tan((rand() - 0.5) \* 180) + dynamic_curve_centre"
Latejoin and midround injection cooldowns are set using exponential distribution between
5 minutes and 25 for latejoin
15 minutes and 35 for midround
this value is then added to world.time and assigned to the injection cooldown variables.
Midround injection cooldowns are set using exponential distribution between 15 minutes and 35 minutes. This value is then added to world.time and assigned to the injection cooldown variables.
Latejoins are aggressively assigned whenever possible, to keep the round at a certain threat level.
rigged_roundstart() is called instead if there are forced rules (an admin set the mode)
@@ -26,8 +27,6 @@ If midround injection time is lower than world.time, it updates playercounts aga
make_antag_chance(newPlayer) -> [For each latespawn rule...]
-> acceptable(living players, threat_level) -> trim_candidates() -> ready(forced=FALSE)
**If true, add to drafted rules
**NOTE that acceptable uses threat_level not threat!
**NOTE Latejoin timer is ONLY reset if at least one rule was drafted.
**NOTE the new_player.dm AttemptLateSpawn() calls OnPostSetup for all roles (unless assigned role is MODE)
[After collecting all draftble rules...]
-> picking_latejoin_ruleset(drafted_rules) -> spend threat -> ruleset.execute()
+1 -1
View File
@@ -42,7 +42,7 @@
return ..()
/obj/machinery/dominator/emp_act(severity)
take_damage(100, BURN, "energy", 0)
take_damage(75+severity/4, BURN, "energy", 0)
..()
/obj/machinery/dominator/hulk_damage()
+2 -2
View File
@@ -56,7 +56,7 @@
<li>There are many other ways; be creative!</li>\
</ul>"
/datum/sabotage_objective/processing/supermatter
/*/datum/sabotage_objective/processing/supermatter
name = "Sabotage the supermatter so that it goes under 50% integrity. If it is delaminated, you will fail."
sabotage_type = "supermatter"
special_equipment = list(/obj/item/paper/guides/antag/supermatter_sabotage)
@@ -77,7 +77,7 @@
/datum/sabotage_objective/processing/supermatter/can_run()
return (locate(/obj/machinery/power/supermatter_crystal) in GLOB.machines)
/*
/datum/sabotage_objective/station_integrity
name = "Make sure the station is at less than 80% integrity by the end. Smash walls, windows etc. to reach this goal."
sabotage_type = "integrity"
+2 -1
View File
@@ -8,7 +8,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE)
sandbox.owner = src.ckey
if(src.client.holder)
sandbox.admin = 1
verbs += new/mob/proc/sandbox_panel
add_verb(src, /mob/proc/sandbox_panel)
/mob/proc/sandbox_panel()
set name = "Sandbox Panel"
if(sandbox)
+1 -1
View File
@@ -95,7 +95,7 @@
inject_chem(R.type, occupant)
open_machine()
//Is this too much? Cit specific
if(severity == EMP_HEAVY)
if(severity >= 80)
var/chem = pick(available_chems)
available_chems -= chem
available_chems += get_random_reagent_id()
+3 -2
View File
@@ -175,7 +175,7 @@ Class Procs:
/obj/machinery/emp_act(severity)
. = ..()
if(use_power && !stat && !(. & EMP_PROTECT_SELF))
use_power(7500/severity)
use_power(1000 + severity*65)
new /obj/effect/temp_visual/emp(loc)
/obj/machinery/proc/open_machine(drop = TRUE)
@@ -381,6 +381,7 @@ Class Procs:
/obj/machinery/obj_break(damage_flag)
if(!(flags_1 & NODECONSTRUCT_1))
stat |= BROKEN
return TRUE
/obj/machinery/contents_explosion(severity, target)
if(occupant)
@@ -534,7 +535,7 @@ Class Procs:
else if(zap_flags & ZAP_OBJ_DAMAGE)
take_damage(power/2000, BURN, "energy")
if(prob(40))
emp_act(EMP_LIGHT)
emp_act(50)
/obj/machinery/Exited(atom/movable/AM, atom/newloc)
. = ..()
+1 -1
View File
@@ -160,7 +160,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/emp_act(severity)
. = ..()
if(!(stat & (NOPOWER|BROKEN)) && !(. & EMP_PROTECT_SELF))
if(!(stat & (NOPOWER|BROKEN)) && !(. & EMP_PROTECT_SELF) && severity >= 30)
act_up()
/obj/machinery/announcement_system/emag_act()
+1 -1
View File
@@ -97,7 +97,7 @@
if(!status)
return
if(!(. & EMP_PROTECT_SELF))
if(prob(150/severity))
if(prob(severity/0.7))
update_icon()
var/list/previous_network = network
network = list()
+1 -1
View File
@@ -431,7 +431,7 @@
. = ..()
if (!(. & EMP_PROTECT_SELF))
var/mob/living/mob_occupant = occupant
if(mob_occupant && prob(100/(severity*efficiency)))
if(mob_occupant && prob((25+severity/1.34)/efficiency))
connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of, ERROR: John Doe, prematurely." ,0))
mob_occupant.copy_from_prefs_vr()
+2 -7
View File
@@ -104,13 +104,8 @@
/obj/machinery/computer/emp_act(severity)
. = ..()
if (!(. & EMP_PROTECT_SELF))
switch(severity)
if(1)
if(prob(50))
obj_break("energy")
if(2)
if(prob(10))
obj_break("energy")
if(prob(severity/1.8))
obj_break("energy")
/obj/machinery/computer/deconstruct(disassembled = TRUE, mob/user)
on_deconstruction()
+1 -6
View File
@@ -126,12 +126,7 @@
return
var/empprize = null
var/num_of_prizes = 0
switch(severity)
if(1)
num_of_prizes = rand(1,4)
if(2)
num_of_prizes = rand(0,2)
var/num_of_prizes = rand(round(severity/50),round(severity/100))
for(var/i = num_of_prizes; i > 0; i--)
empprize = pickweight(prizes)
new empprize(loc)
+2 -2
View File
@@ -541,7 +541,7 @@
. = ..()
if(!(stat & (BROKEN|NOPOWER)) && !(. & EMP_PROTECT_SELF))
for(var/datum/data/record/R in GLOB.data_core.medical)
if(prob(10/severity))
if(prob(severity/10))
switch(rand(1,6))
if(1)
if(prob(10))
@@ -560,7 +560,7 @@
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue
else if(prob(1))
else if(prob(severity/80))
qdel(R)
continue
+2 -2
View File
@@ -769,7 +769,7 @@ What a mess.*/
return
for(var/datum/data/record/R in GLOB.data_core.security)
if(prob(10/severity))
if(prob(severity/10))
switch(rand(1,8))
if(1)
if(prob(10))
@@ -794,7 +794,7 @@ What a mess.*/
R.fields["photo_side"] = G.fields["photo_side"]
continue
else if(prob(1))
else if(prob(severity/80))
qdel(R)
continue
+13 -13
View File
@@ -355,23 +355,23 @@
cryo_items -= I
//Update any existing objectives involving this mob.
for(var/datum/objective/O in GLOB.objectives)
for(var/i in GLOB.objectives)
var/datum/objective/O = i
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(istype(O,/datum/objective/mutiny) && O.target == mob_occupant.mind)
qdel(O)
else if(O.target && istype(O.target, /datum/mind))
if(O.target == mob_occupant.mind)
if(O.owner && O.owner.current)
to_chat(O.owner.current, "<BR><span class='userdanger'>You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!</span>")
O.target = null
spawn(10) //This should ideally fire after the occupant is deleted.
if(!O)
return
O.find_target()
O.update_explanation_text()
if(!(O.target))
qdel(O)
else if(O.target && istype(O.target, /datum/mind) && !O.check_completion())
if(O.target == mob_occupant.mind && O.owner?.current)
to_chat(O.owner.current, "<BR><span class='userdanger'>You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!</span>")
O.target = null
spawn(10) //This should ideally fire after the occupant is deleted.
if(!O)
return
O.find_target()
O.update_explanation_text()
if(!(O.target))
qdel(O)
if(mob_occupant.mind)
//Handle job slot/tater cleanup.
+1 -1
View File
@@ -612,7 +612,7 @@
. += "<span class='alloy'>The cogwheel has been <i>loosened</i>, but remains <b>connected loosely</b> to the door!</span>"
/obj/machinery/door/airlock/clockwork/emp_act(severity)
if(prob(80/severity))
if(prob(severity/1.25))
open()
/obj/machinery/door/airlock/clockwork/canAIControl(mob/user)
+1 -6
View File
@@ -243,13 +243,8 @@
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(prob(20/severity) && (istype(src, /obj/machinery/door/airlock) || istype(src, /obj/machinery/door/window)) )
if(prob(severity/5) && (istype(src, /obj/machinery/door/airlock) || istype(src, /obj/machinery/door/window)) )
INVOKE_ASYNC(src, .proc/open)
if(prob(severity*10 - 20))
if(secondsElectrified == MACHINE_NOT_ELECTRIFIED)
secondsElectrified = MACHINE_ELECTRIFIED_PERMANENT
LAZYADD(shockedby, "\[[TIME_STAMP("hh:mm:ss", FALSE)]\]EM Pulse")
addtimer(CALLBACK(src, .proc/unelectrify), 300)
/obj/machinery/door/proc/unelectrify()
secondsElectrified = MACHINE_NOT_ELECTRIFIED
+1 -1
View File
@@ -397,7 +397,7 @@
return ..()
/obj/machinery/door/window/clockwork/emp_act(severity)
if(prob(80/severity))
if(prob(severity/1.25))
open()
/obj/machinery/door/window/clockwork/ratvar_act()
+1 -1
View File
@@ -103,7 +103,7 @@
if (. & EMP_PROTECT_SELF)
return
if(prob(50 / severity))
if(prob(severity/1.8))
alarm()
/obj/machinery/firealarm/emag_act(mob/user)
@@ -300,6 +300,7 @@
else
to_chat(user, "<span class='notice'>You remove the turret but did not manage to salvage anything.</span>")
qdel(src)
return
else if((istype(I, /obj/item/wrench)) && (!on))
if(raised)
@@ -718,9 +719,7 @@
/obj/machinery/porta_turret/syndicate/ComponentInitialize()
. = ..()
// AddComponent(/datum/component/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES) //this one or ^ one?
AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES)
/obj/machinery/porta_turret/syndicate/setup()
return
@@ -151,6 +151,7 @@
turret.installation = installed_gun.type
turret.setup(installed_gun)
qdel(src)
return
else if(istype(I, /obj/item/crowbar))
I.play_tool_sound(src, 75)
@@ -0,0 +1,100 @@
/obj/machinery/fan_assembly
name = "fan assembly"
desc = "A basic microfan assembly."
icon = 'icons/obj/poweredfans.dmi'
icon_state = "mfan_assembly"
max_integrity = 150
use_power = NO_POWER_USE
power_channel = ENVIRON
idle_power_usage = 0
active_power_usage = 0
layer = ABOVE_NORMAL_TURF_LAYER
anchored = FALSE
density = FALSE
CanAtmosPass = ATMOS_PASS_YES
stat = 1
var/buildstacktype = /obj/item/stack/sheet/plasteel
var/buildstackamount = 5
/*
1 = Wrenched in place
2 = Welded in place
3 = Wires attached to it, this makes it change to the full thing.
*/
/obj/machinery/fan_assembly/attackby(obj/item/W, mob/living/user, params)
switch(stat)
if(1)
// Stat 1
if(istype(W, /obj/item/weldingtool))
if(weld(W, user))
to_chat(user, "<span class='notice'>You weld the fan assembly securely into place.</span>")
setAnchored(TRUE)
stat = 2
update_icon_state()
return
if(2)
// Stat 2
if(istype(W, /obj/item/stack/cable_coil))
if(!W.tool_start_check(user, amount=2))
to_chat(user, "<span class='warning'>You need two lengths of cable to wire the fan assembly!</span>")
return
to_chat(user, "<span class='notice'>You start to add wires to the assembly...</span>")
if(W.use_tool(src, user, 30, volume=50, amount=2))
to_chat(user, "<span class='notice'>You add wires to the fan assembly.</span>")
stat = 3
var/obj/machinery/poweredfans/F = new(loc, src)
forceMove(F)
F.setDir(src.dir)
return
else if(istype(W, /obj/item/weldingtool))
if(weld(W, user))
to_chat(user, "<span class='notice'>You unweld the fan assembly from its place.</span>")
stat = 1
update_icon_state()
setAnchored(FALSE)
return
return ..()
/obj/machinery/fan_assembly/wrench_act(mob/user, obj/item/I)
if(stat != 1)
return FALSE
user.visible_message("<span class='warning'>[user] disassembles [src].</span>",
"<span class='notice'>You start to disassemble [src]...</span>", "You hear wrenching noises.")
if(I.use_tool(src, user, 30, volume=50))
deconstruct()
return TRUE
/obj/machinery/fan_assembly/proc/weld(obj/item/weldingtool/W, mob/living/user)
if(!W.tool_start_check(user, amount=0))
return FALSE
switch(stat)
if(1)
to_chat(user, "<span class='notice'>You start to weld \the [src]...</span>")
if(2)
to_chat(user, "<span class='notice'>You start to unweld \the [src]...</span>")
if(W.use_tool(src, user, 30, volume=50))
return TRUE
return FALSE
/obj/machinery/fan_assembly/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new buildstacktype(loc,buildstackamount)
qdel(src)
/obj/machinery/fan_assembly/examine(mob/user)
. = ..()
switch(stat)
if(1)
to_chat(user, "<span class='notice'>The fan assembly seems to be <b>unwelded</b> and loose.</span>")
if(2)
to_chat(user, "<span class='notice'>The fan assembly seems to be welded, but missing <b>wires</b>.</span>")
if(3)
to_chat(user, "<span class='notice'>The outer plating is <b>wired</b> firmly in place.</span>")
/obj/machinery/fan_assembly/update_icon_state()
. = ..()
switch(stat)
if(1)
icon_state = "mfan_assembly"
if(2)
icon_state = "mfan_welded"
@@ -0,0 +1,56 @@
/obj/machinery/poweredfans
icon = 'icons/obj/poweredfans.dmi'
icon_state = "mfan_powered"
name = "micro powered fan"
desc = "A handmade fan, releasing a thin gust of air."
use_power = ACTIVE_POWER_USE
power_channel = ENVIRON
idle_power_usage = 5
active_power_usage = 10
max_integrity = 150
layer = ABOVE_NORMAL_TURF_LAYER
anchored = TRUE
density = FALSE
CanAtmosPass = ATMOS_PASS_NO
var/obj/machinery/fan_assembly/assembly
/obj/machinery/poweredfans/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!assembly)
assembly = new()
assembly.forceMove(drop_location())
assembly.stat = 2
assembly.setAnchored(TRUE)
assembly.setDir(dir)
assembly = null
new /obj/item/stack/cable_coil(loc, 2)
qdel(src)
/obj/machinery/poweredfans/wirecutter_act(mob/living/user, obj/item/I)
user.visible_message("<span class='warning'>[user] removes the wires from the [src].</span>",
"<span class='notice'>You start to remove the wires from the [src]...</span>", "You hear clanking and banging noises.")
if(I.use_tool(src, user, 30, volume=50))
deconstruct()
return TRUE
/obj/machinery/poweredfans/Initialize(mapload, obj/machinery/fan_assembly/FA)
. = ..()
if(FA)
assembly = FA
else
assembly = new(src)
assembly.stat = 3
air_update_turf(1)
/obj/machinery/poweredfans/power_change()
..()
if(powered())
icon_state = "mfan_powered"
CanAtmosPass = ATMOS_PASS_NO
air_update_turf(1)
else
icon_state = "mfan_unpowered"
CanAtmosPass = ATMOS_PASS_YES
air_update_turf(1)
update_icon_state()
+4 -5
View File
@@ -25,11 +25,10 @@
. = ..()
if (. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
qdel(src)
if(2)
take_damage(50, BRUTE, "energy", 0)
if(severity >= 70)
qdel(src)
else
take_damage(severity/1.3, BRUTE, "energy", 0)
/obj/structure/emergency_shield/play_attack_sound(damage, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+2 -2
View File
@@ -150,9 +150,9 @@
. = ..()
if(stat & (NOPOWER|BROKEN) || . & EMP_PROTECT_SELF)
return
if(prob(15 * severity))
if(prob(1500 / severity))
return
if(prob(1)) // :^)
if(prob(1 * severity/100)) // :^)
obj_flags |= EMAGGED
var/severity_ascending = 4 - severity
money = max(rand(money - (200 * severity_ascending), money + (200 * severity_ascending)), 0)
@@ -119,7 +119,7 @@ GLOBAL_LIST_EMPTY(telecomms_list)
/obj/machinery/telecomms/proc/update_power()
if(toggled)
// if powered, on. if not powered, off. if too damaged, off
if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
on = FALSE
else
on = TRUE
@@ -139,9 +139,9 @@ GLOBAL_LIST_EMPTY(telecomms_list)
. = ..()
if(CHECK_BITFIELD(., EMP_PROTECT_SELF))
return
if(prob(100 / severity))
if(prob(severity))
if(!CHECK_BITFIELD(stat, EMPED))
ENABLE_BITFIELD(stat, EMPED)
var/duration = (300 * 10) / severity
var/duration = severity * 35
spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot.
DISABLE_BITFIELD(stat, EMPED)

Some files were not shown because too many files have changed in this diff Show More