diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c05d84e8122d..339d48c9fe39 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -74,10 +74,10 @@ These are the few directives we have for project maintainers. - Try to get secondary maintainer approval before merging if you are able to. - PRs with empty commits intended to generate a changelog. - Do not merge PRs that contain content from the [banned content list](./CONTRIBUTING.md#banned-content). -- Do not merge PRs that contain balance changes without GA approval. Exceptions include: - - Any PR that has been un-reviewed by a GA for 7 days. +- Do not merge PRs that contain balance changes without Maintainer Manager approval. Exceptions include: + - Any PR that has been un-reviewed by a Maintainer Manager for 7 days. - Do not remove the DNM label that another Maintainer has applied. Exceptions include: - - GAs removing a DNM label placed by a Maintainer for Balance/Design reasons + - Maintainer Managers removing a DNM label placed by a Maintainer for Balance/Design reasons These are not steadfast rules as maintainers are expected to use their best judgement when operating. diff --git a/.github/guides/STANDARDS.md b/.github/guides/STANDARDS.md index fc764d09c816..c9b988bd07ff 100644 --- a/.github/guides/STANDARDS.md +++ b/.github/guides/STANDARDS.md @@ -126,7 +126,7 @@ While we normally encourage (and in some cases, even require) bringing out of da This is a simple one - as we will eventually move to 515, we will need to ditch this kind of callback. So please don't add any new ones. Make our lives easier. ### PROC_REF Macros - When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF,TYPE_PROC_REF and GLOBAL_PROC_REF macros. + When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF, TYPE_PROC_REF and GLOBAL_PROC_REF macros. They ensure compilation fails if the reffered to procs change names or get removed. The macro to be used depends on how the proc you're in relates to the proc you want to use: @@ -168,6 +168,8 @@ This is a simple one - as we will eventually move to 515, we will need to ditch addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(funny)), 100)) ``` + Note that the same rules go for verbs too! We have VERB_REF() and TYPE_VERB_REF() as you need it in these same cases. GLOBAL_VERB_REF() isn't a thing however, as verbs are not global. + ### Signal Handlers All procs that are registered to listen for signals using `RegisterSignal()` must contain at the start of the proc `SIGNAL_HANDLER` eg; diff --git a/.github/workflows/generate_documentation.yml b/.github/workflows/generate_documentation.yml index 6075e3029acd..59e6d1144c68 100644 --- a/.github/workflows/generate_documentation.yml +++ b/.github/workflows/generate_documentation.yml @@ -21,7 +21,7 @@ jobs: run: | ~/dmdoc touch dmdoc/.nojekyll - echo codedocs.tgstation13.org > dmdoc/CNAME + echo docs.cm-ss13.com > dmdoc/CNAME - name: Deploy uses: JamesIves/github-pages-deploy-action@3.7.1 with: diff --git a/code/__DEFINES/conflict.dm b/code/__DEFINES/conflict.dm index 09be4793c552..141d69c69b11 100644 --- a/code/__DEFINES/conflict.dm +++ b/code/__DEFINES/conflict.dm @@ -232,6 +232,7 @@ //OB timings #define OB_TRAVEL_TIMING 12 SECONDS #define OB_CRASHING_DOWN 1 SECONDS +#define OB_CLUSTER_DURATION 45 SECONDS //================================================= //Health of various items diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 3c2527136ed6..662bcb458c55 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -113,7 +113,8 @@ #define SS_INIT_INPUT 85 #define SS_INIT_FAIL_TO_TOPIC 84 #define SS_INIT_TOPIC 83 -#define SS_INIT_RUST 26 +#define SS_INIT_RUST 30 +#define SS_INIT_INFLUXDRIVER 28 #define SS_INIT_SUPPLY_SHUTTLE 25 #define SS_INIT_GARBAGE 24 #define SS_INIT_EVENTS 23.5 @@ -133,7 +134,9 @@ #define SS_INIT_MORE_INIT 16 #define SS_INIT_AIR 15 #define SS_INIT_TELEPORTER 13 -#define SS_INIT_LIGHTING 12 +#define SS_INIT_INFLUXMCSTATS 12 +#define SS_INIT_INFLUXSTATS 11 +#define SS_INIT_LIGHTING 10 #define SS_INIT_DEFCON 9 #define SS_INIT_LAW 6 #define SS_INIT_FZ_TRANSITIONS 5 @@ -212,12 +215,15 @@ #define SS_PRIORITY_UNSPECIFIED 30 #define SS_PRIORITY_PROCESS 25 #define SS_PRIORITY_SOUNDSCAPE 24 +#define SS_PRIORITY_INFLUXDRIVER 23 #define SS_PRIORITY_PAGER_STATUS 22 #define SS_PRIORITY_LIGHTING 20 #define SS_PRIORITY_TRACKING 19 +#define SS_PRIORITY_DATABASE 15 #define SS_PRIORITY_MINIMAPS 11 #define SS_PRIORITY_PING 10 -#define SS_PRIORITY_DATABASE 15 +#define SS_PRIORITY_INFLUXMCSTATS 9 +#define SS_PRIORITY_INFLUXSTATS 8 #define SS_PRIORITY_PLAYTIME 5 #define SS_PRIORITY_PERFLOGGING 4 #define SS_PRIORITY_CORPSESPAWNER 3 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e5441090d60c..dd700ccde996 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -211,6 +211,9 @@ //ie. naming a regulation tape "example" will become regulation tape (example) #define TRAIT_ITEM_RENAME_SPECIAL "t_item_rename_special" +// This item can't be implanted into someone, regardless of the size of the item. +#define TRAIT_ITEM_NOT_IMPLANTABLE "t_item_not_implantable" + //-- structure traits -- // TABLE TRAITS /// If the table is being flipped, prevent any changes that will mess with adjacency handling diff --git a/code/__DEFINES/weapon_stats.dm b/code/__DEFINES/weapon_stats.dm index 58dad90b0710..bef8413e9615 100644 --- a/code/__DEFINES/weapon_stats.dm +++ b/code/__DEFINES/weapon_stats.dm @@ -1,7 +1,7 @@ #define HUMAN_UNIVERSAL_DAMAGEMULT 1 #define RECOIL_BUILDUP_VIEWPUNCH_MULTIPLIER 0.1 - +#define BASE_VELOCITY_BONUS 0 #define PROJ_BASE_ACCURACY_MULT 0.01 #define PROJ_BASE_DAMAGE_MULT 0.01 diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 83da41b515a6..d4d9eb320633 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -164,6 +164,11 @@ t = "0[t]" return t +/proc/pad_trailing(text, padding, size) + while (length(text) < size) + text = "[text][padding]" + return text + //Adds 'u' number of spaces ahead of the text 't' /proc/add_lspace(t, u) while(length(t) < u) diff --git a/code/_byond_version_compat.dm b/code/_byond_version_compat.dm index b5379a3b6d5c..719d85654b5f 100644 --- a/code/_byond_version_compat.dm +++ b/code/_byond_version_compat.dm @@ -31,19 +31,49 @@ #define LIBCALL call_ext #endif -// So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the .proc/procname syntax so we have to use nameof() +// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof() +// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global. + #if DM_VERSION < 515 -/// Call by name proc reference, checks if the proc exists on this type or as a global proc + +/// Call by name proc references, checks if the proc exists on either this type or as a global proc. #define PROC_REF(X) (.proc/##X) -/// Call by name proc reference, checks if the proc exists on given type or as a global proc +/// Call by name verb references, checks if the verb exists on either this type or as a global verb. +#define VERB_REF(X) (.verb/##X) + +/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc #define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X) -/// Call by name proc reference, checks if the proc is existing global proc +/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb +#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X) + +/// Call by name proc reference, checks if the proc is an existing global proc #define GLOBAL_PROC_REF(X) (/proc/##X) + #else -/// Call by name proc reference, checks if the proc exists on this type or as a global proc + +/// Call by name proc references, checks if the proc exists on either this type or as a global proc. #define PROC_REF(X) (nameof(.proc/##X)) -/// Call by name proc reference, checks if the proc exists on given type or as a global proc +/// Call by name verb references, checks if the verb exists on either this type or as a global verb. +#define VERB_REF(X) (nameof(.verb/##X)) + +/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc #define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) -/// Call by name proc reference, checks if the proc is existing global proc +/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb +#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X)) + +/// Call by name proc reference, checks if the proc is an existing global proc #define GLOBAL_PROC_REF(X) (/proc/##X) + +#endif + +#if (DM_VERSION == 515) +/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows +/// var case matches documentation for fcopy. +/world/proc/__fcopy(Src, Dst) + if (istext(Src) && !fexists(Src)) + return 0 + return fcopy(Src, Dst) + +#define fcopy(Src, Dst) world.__fcopy(Src, Dst) + #endif diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index f0279907f635..586d5e71a92d 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -10,6 +10,7 @@ GLOBAL_LIST_EMPTY(GeneralFaxes) //Inter-machine faxes GLOBAL_LIST_EMPTY(fax_contents) //List of fax contents to maintain it even if source paper is deleted GLOBAL_LIST_EMPTY(failed_fultons) //A list of fultoned items which weren't collected and fell back down +GLOBAL_LIST_EMPTY(larva_burst_by_hive) GLOBAL_LIST_INIT_TYPED(custom_huds_list, /datum/custom_hud, setup_all_huds()) GLOBAL_LIST_INIT_TYPED(custom_human_huds, /datum/custom_hud, setup_human_huds()) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index affbc28cdd45..df7dd48a1dd1 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -82,7 +82,7 @@ return face_atom(A) - if(mods["middle"]) + if(mods["middle"]) return // Special type of click. if (is_mob_restrained()) @@ -334,7 +334,7 @@ if(prefs.adaptive_zoom) INVOKE_ASYNC(src, PROC_REF(adaptive_zoom)) else if(prefs.auto_fit_viewport) - INVOKE_ASYNC(src, .verb/fit_viewport) + INVOKE_ASYNC(src, VERB_REF(fit_viewport)) /client/proc/get_adaptive_zoom_factor() if(!prefs.adaptive_zoom) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 29dd0a88d3e0..7988ff6d1a95 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -529,6 +529,25 @@ This maintains a list of ip addresses that are able to bypass topic filtering. /datum/config_entry/string/round_results_webhook_url +/// InfluxDB v2 Host to connect to for sending statistics (over HTTP API) +/datum/config_entry/string/influxdb_host +/// InfluxDB v2 Bucket to send staistics to +/datum/config_entry/string/influxdb_bucket +/// InfluxDB v2 Organization to access buckets of +/datum/config_entry/string/influxdb_org +/// InfluxDB v2 API Token to access the organization and bucket +/datum/config_entry/string/influxdb_token + +/// How often to snapshot general game statistics to influxdb driver +/datum/config_entry/number/influxdb_stats_period + config_entry_value = 30 +/// How often to snapshot MC statistics +/datum/config_entry/number/influxdb_mcstats_period + config_entry_value = 60 +/// How often to send queued influxdb statistics +/datum/config_entry/number/influxdb_send_period + config_entry_value = 10 + /// logs all timers in buckets on automatic bucket reset (Useful for timer debugging) /datum/config_entry/flag/log_timers_on_bucket_reset diff --git a/code/controllers/subsystem/influxdriver.dm b/code/controllers/subsystem/influxdriver.dm new file mode 100644 index 000000000000..7e5289dfc518 --- /dev/null +++ b/code/controllers/subsystem/influxdriver.dm @@ -0,0 +1,132 @@ +/// Sends collected statistics to an influxdb v2 backend periodically +SUBSYSTEM_DEF(influxdriver) + name = "InfluxDB Driver" + wait = 10 SECONDS + init_order = SS_INIT_INFLUXDRIVER + priority = SS_PRIORITY_INFLUXDRIVER + runlevels = RUNLEVELS_DEFAULT|RUNLEVEL_LOBBY + + var/list/send_queue = list() + + /// Maximum amount of metric lines to send at most in one request + /// This is neccessary because sending a lot of metrics can get expensive + /// and drive the subsystem into overtime, but we can't split the work as it'd be even less efficient + var/max_batch = 150 + + /// Last timestamp in microseconds + var/timestamp_cache_realtime + /// Last tick time the timestamp was taken at + var/timestamp_cache_worldtime + +/datum/controller/subsystem/influxdriver/Initialize() + var/period = text2num(CONFIG_GET(number/influxdb_send_period)) + if(isnum(period)) + wait = max(period * (1 SECONDS), 2 SECONDS) + return SS_INIT_SUCCESS + +/datum/controller/subsystem/influxdriver/stat_entry(msg) + msg += "period=[wait] queue=[length(send_queue)]" + return ..() + +/datum/controller/subsystem/influxdriver/proc/unix_timestamp_string() // pending change to rust-g + return RUSTG_CALL(RUST_G, "unix_timestamp")() + +/datum/controller/subsystem/influxdriver/proc/update_timestamp() + PRIVATE_PROC(TRUE) + // We make only one request to rustg per game tick, so we cache the result per world.time + var/whole_timestamp = unix_timestamp_string() // Format "7129739474.4758981" - timestamp with up to 7-8 decimals + var/list/tsparts = splittext(whole_timestamp, ".") + var/fractional = copytext(pad_trailing(tsparts[2], "0", 6), 1, 7) // in microseconds + timestamp_cache_worldtime = world.time + timestamp_cache_realtime = "[tsparts[1]][fractional]" + +/datum/controller/subsystem/influxdriver/fire(resumed) + var/maxlen = min(length(send_queue)+1, max_batch) + var/list/queue = send_queue.Copy(1, maxlen) + send_queue.Cut(1, maxlen) + flush_queue(queue) + +/// Flushes measurements batch to InfluxDB backend +/datum/controller/subsystem/influxdriver/proc/flush_queue(list/queue) + PRIVATE_PROC(TRUE) + + var/host = CONFIG_GET(string/influxdb_host) + var/token = CONFIG_GET(string/influxdb_token) + var/bucket = CONFIG_GET(string/influxdb_bucket) + var/org = CONFIG_GET(string/influxdb_org) + + if(!host || !token || !bucket || !org) + can_fire = FALSE + return + + if(!length(queue)) + return // Nothing to do + + var/url = "[host]/api/v2/write?org=[org]&bucket=[bucket]&precision=us" // microseconds + var/list/headers = list() + headers["Authorization"] = "Token [token]" + headers["Content-Type"] = "text/plain; charset=utf-8" + headers["Accept"] = "application/json" + + var/datum/http_request/request = new + var/payload = "" + for(var/line in queue) + payload += "[line]\n" + request.prepare(RUSTG_HTTP_METHOD_POST, url, payload, headers) + request.begin_async() + // TODO possibly check back result of request later + +/// Enqueues sending to InfluxDB Backend selected measurement values - round_id and timestamp are filled in automatically +/datum/controller/subsystem/influxdriver/proc/enqueue_stats(measurement, list/tags, list/fields) + . = FALSE + var/valid = FALSE + var/serialized = "[measurement],round_id=[GLOB.round_id]" + if(tags) + for(var/tag in tags) + var/serialized_tag = serialize_field(tag, tags[tag]) + if(serialized_tag) + serialized += ",[serialized_tag]" + serialized += " " + var/comma = "" + for(var/field in fields) + var/serialized_field = serialize_field(field, fields[field]) + if(serialized_field) + valid = TRUE + serialized += "[comma][serialized_field]" + comma = "," + if(!valid) + CRASH("Attempted to serialize to InfluxDB backend an invalid measurement (likely has no fields)") + if(timestamp_cache_worldtime != world.time) + update_timestamp() + serialized += " [timestamp_cache_realtime]" + send_queue += serialized + return TRUE + +/// Enqueues sending varied stats in a dumb and simpler format directly as: measurement count= +/datum/controller/subsystem/influxdriver/proc/enqueue_stats_crude(measurement, value, field_name = "count") + . = FALSE + var/serialized_field = serialize_field(field_name, value) + if(!length(serialized_field)) + return + if(timestamp_cache_worldtime != world.time) + update_timestamp() + var/serialized = "[measurement],round_id=[GLOB.round_id] [serialized_field] [timestamp_cache_realtime]" + send_queue += serialized + return TRUE + +/// Puts a single field or tag value into InfluxDB Line format +/datum/controller/subsystem/influxdriver/proc/serialize_field(field, value) + var/static/regex/whitelistedCharacters = regex(@{"([^a-zA-Z0-9_]+)"}, "g") + var/sanitized_field = whitelistedCharacters.Replace("[field]", "") + if(!length(sanitized_field) || copytext(sanitized_field, 1, 2) == "_") + CRASH("Invalid tag/field for InfluxDB serialization: '[sanitized_field]' (original: '[field]')") + var/sanitized_value + if(isnum(value)) + sanitized_value = value + else if(istext(value)) + sanitized_value = whitelistedCharacters.Replace("[value]", "") + if(!length(sanitized_value) || copytext(sanitized_value, 1, 2) == "_") + CRASH("Invalid value for InfluxDB serialization: '[sanitized_value]' (original: '[value]')") + else + CRASH("Invalid value type passed for InfluxDB serialization: '[value]'") + return "[sanitized_field]=[sanitized_value]" diff --git a/code/controllers/subsystem/influxmcstats.dm b/code/controllers/subsystem/influxmcstats.dm new file mode 100644 index 000000000000..a1bf171d81a3 --- /dev/null +++ b/code/controllers/subsystem/influxmcstats.dm @@ -0,0 +1,47 @@ +SUBSYSTEM_DEF(influxmcstats) + name = "InfluxDB MC Stats" + wait = 60 SECONDS + priority = SS_PRIORITY_INFLUXMCSTATS + init_order = SS_INIT_INFLUXMCSTATS + runlevels = RUNLEVEL_LOBBY|RUNLEVELS_DEFAULT + flags = SS_KEEP_TIMING + var/checkpoint = 0 + var/list/subsystem_name_cache = list() + +/datum/controller/subsystem/influxmcstats/Initialize() + var/period = text2num(CONFIG_GET(number/influxdb_mcstats_period)) + if(isnum(period)) + wait = max(period * (1 SECONDS), 10 SECONDS) + return SS_INIT_SUCCESS + +/datum/controller/subsystem/influxmcstats/stat_entry(msg) + msg += "period=[wait] checkpoint=[checkpoint]" + return ..() + +/datum/controller/subsystem/influxmcstats/fire(resumed) + if(!SSinfluxdriver.can_fire) + can_fire = FALSE + return + + var/list/data = list() + data["time_dilation_current"] = SStime_track.time_dilation_current + data["time_dilation_avg"] = SStime_track.time_dilation_avg + data["time_dilation_avg_slow"] = SStime_track.time_dilation_avg_slow + data["time_dilation_avg_fast"] = SStime_track.time_dilation_avg_fast + SSinfluxdriver.enqueue_stats("tidi", null, data) + + SSinfluxdriver.enqueue_stats("cpu", null, list("cpu" = world.cpu, "map_cpu" = world.map_cpu)) + + var/static/regex/get_last_path_element = regex(@{"/([^/]+)$"}) + checkpoint++ + for(var/datum/controller/subsystem/SS in Master.subsystems) + if(!SS.can_fire) + continue + if(!subsystem_name_cache[SS.type]) + get_last_path_element.Find("[SS.type]") + subsystem_name_cache[SS.type] = "SS[get_last_path_element.group[1]]" + var/SSname = subsystem_name_cache[SS.type] + if(!SSname) + stack_trace("Influx MC Stats couldnt name a subsystem, type=[SS.type]") + continue + SSinfluxdriver.enqueue_stats("sstimings", list("ss" = SSname), list("cost" = SS.cost, "tick_overrun" = SS.tick_overrun, "tick_usage" = SS.tick_usage, "wait" = SS.wait)) diff --git a/code/controllers/subsystem/influxstats.dm b/code/controllers/subsystem/influxstats.dm new file mode 100644 index 000000000000..01015b83191d --- /dev/null +++ b/code/controllers/subsystem/influxstats.dm @@ -0,0 +1,156 @@ +/// Sends generic round running statistics to the InfluxDB backend +SUBSYSTEM_DEF(influxstats) + name = "InfluxDB Game Stats" + wait = 60 SECONDS + priority = SS_PRIORITY_INFLUXSTATS + init_order = SS_INIT_INFLUXSTATS + runlevels = RUNLEVEL_LOBBY|RUNLEVELS_DEFAULT + flags = SS_KEEP_TIMING + + var/checkpoint = 0 //! Counter of data snapshots sent + var/step = 1 //! Current task in progress, for pausing/resuming + +/datum/controller/subsystem/influxstats/Initialize() + var/period = text2num(CONFIG_GET(number/influxdb_stats_period)) + if(isnum(period)) + wait = max(period * (1 SECONDS), 10 SECONDS) + return SS_INIT_SUCCESS + +/datum/controller/subsystem/influxstats/stat_entry(msg) + msg += "period=[wait] checkpoint=[checkpoint] step=[step]" + return ..() + +/datum/controller/subsystem/influxstats/fire(resumed) + if(!SSinfluxdriver.can_fire) + can_fire = FALSE + return + + checkpoint++ + while(step < 5) // Yes, you could make one SS per stats category, and have proper scheduling and variable periods, but... + switch(step++) + if(1) // Connected players statistics + run_player_statistics() + if(2) // Job occupations + if(SSticker.current_state == GAME_STATE_PLAYING) + run_job_statistics() + if(3) // Round-wide gameplay statistics held in entity + if(SSticker.current_state == GAME_STATE_PLAYING) + run_round_statistics() + if(4) // Handpicked Round-wide gameplay statistics + if(SSticker.current_state == GAME_STATE_PLAYING) + run_special_round_statistics() + if(MC_TICK_CHECK) + return + + step = 1 + +/datum/controller/subsystem/influxstats/proc/flatten_entity_list(list/data) + var/list/result = list() + for(var/key in data) + var/datum/entity/statistic/entry = data[key] + result[key] = entry.value + return result + +/datum/controller/subsystem/influxstats/proc/run_special_round_statistics() + for(var/hive_tag in GLOB.hive_datum) + var/datum/hive_status/hive = GLOB.hive_datum[hive_tag] + SSinfluxdriver.enqueue_stats("pooled_larva", list("hive" = hive.reporting_id), list("count" = hive.stored_larva)) + var/burst_larvas = GLOB.larva_burst_by_hive[hive] || 0 + SSinfluxdriver.enqueue_stats("burst_larva", list("hive" = hive.reporting_id), list("count" = burst_larvas)) + +/datum/controller/subsystem/influxstats/proc/run_round_statistics() + var/datum/entity/statistic/round/stats = SSticker?.mode?.round_stats + if(!stats) + return // Sadge + + SSinfluxdriver.enqueue_stats_crude("chestbursts", stats.total_larva_burst) + SSinfluxdriver.enqueue_stats_crude("hugged", stats.total_huggers_applied) + SSinfluxdriver.enqueue_stats_crude("friendlyfire", stats.total_friendly_fire_instances) + + var/list/participants = flatten_entity_list(stats.participants) + if(length(participants)) + SSinfluxdriver.enqueue_stats("participants", list(), participants) + + var/list/total_deaths = flatten_entity_list(stats.total_deaths) + if(length(total_deaths)) + SSinfluxdriver.enqueue_stats("deaths", list(), total_deaths) + + SSinfluxdriver.enqueue_stats("shots", list(), + list("fired" = stats.total_projectiles_fired, "hits" = stats.total_projectiles_hit, + "hits_human" = stats.total_projectiles_hit_human, "hits_xeno" = stats.total_projectiles_hit_xeno) + ) + +/datum/controller/subsystem/influxstats/proc/run_player_statistics() + var/staff_count = 0 + var/mentor_count = 0 + for(var/client/client in GLOB.admins) + if(CLIENT_IS_STAFF(client)) + staff_count++ + else if(CLIENT_HAS_RIGHTS(client, R_MENTOR)) + mentor_count++ + SSinfluxdriver.enqueue_stats("online", null, list("count" = length(GLOB.clients))) + + var/list/adm = get_admin_counts() + var/present_admins = length(adm["present"]) + var/afk_admins = length(adm["afk"]) + SSinfluxdriver.enqueue_stats("online_staff", null, list("total" = staff_count, "mentors" = mentor_count, "present" = present_admins, "afk" = afk_admins)) + + // Grab ahelp stats + SSinfluxdriver.enqueue_stats("tickets", null, list( + "open" = length(GLOB.ahelp_tickets.active_tickets), + "closed" = length(GLOB.ahelp_tickets.closed_tickets), + "resolved" = length(GLOB.ahelp_tickets.resolved_tickets), + )) + +/datum/controller/subsystem/influxstats/proc/run_job_statistics() + var/list/team_job_stats = list() + var/list/squad_job_stats = ROLES_SQUAD_ALL.Copy() + for(var/squad in squad_job_stats) + squad_job_stats[squad] = list() + + for(var/client/client in GLOB.clients) + var/team + var/mob/mob = client.mob + if(!mob || mob.statistic_exempt) + continue + var/area/area = get_area(mob) + if(!area || area.statistic_exempt) + continue + var/job = mob.job + if(isobserver(mob) || mob.stat == DEAD) + job = JOB_OBSERVER + team = "observers" + else if(!job) + continue + else if(mob.faction == FACTION_MARINE || mob.faction == FACTION_SURVIVOR) + team = "humans" + var/mob/living/carbon/human/employed_human = mob + if(istype(employed_human)) + var/squad = employed_human.assigned_squad?.name + if(squad in squad_job_stats) + squad_job_stats[squad][job] = (squad_job_stats[squad][job] || 0) + 1 + continue // Defer to squad stats instead + // else: So you're in the USCM and have a job but aren't an human? Tell me more Dr Jones... + else if(ishuman(mob)) + team = "humans_others" + else if(isxeno(mob)) + var/mob/living/xeno_enabled_mob = mob + var/datum/hive_status/hive = GLOB.hive_datum[xeno_enabled_mob.hivenumber] + if(!hive) + team = "xenos_others" + else + team = "xenos_[hive.reporting_id]" + else + team = "others" + LAZYINITLIST(team_job_stats[team]) + if(!team_job_stats[team][job]) + team_job_stats[team][job] = 0 + team_job_stats[team][job] += 1 + + for(var/team in team_job_stats) + for(var/job in team_job_stats[team]) + SSinfluxdriver.enqueue_stats("job_stats", list("team" = team, "job" = job), list("count" = team_job_stats[team][job])) + + for(var/squad in squad_job_stats) + for(var/job in squad_job_stats[squad]) + SSinfluxdriver.enqueue_stats("job_stats", list("team" = "humans", "job" = job, "squad" = squad), list("count" = squad_job_stats[squad][job])) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index e365a9b60781..c3b2d36b8177 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -262,8 +262,12 @@ SUBSYSTEM_DEF(minimaps) * removes an image from raw tracked lists, invoked by callback */ /datum/controller/subsystem/minimaps/proc/removeimage(image/blip, atom/target) + var/turf/turf_gotten = get_turf(target) + if(!turf_gotten) + return + var/z_level = turf_gotten.z for(var/flag in GLOB.all_minimap_flags) - minimaps_by_z["[target.z]"].images_raw["[flag]"] -= blip + minimaps_by_z["[z_level]"].images_raw["[flag]"] -= blip blip.UnregisterSignal(target, COMSIG_MOVABLE_MOVED) removal_cbs -= target @@ -391,18 +395,24 @@ SUBSYSTEM_DEF(minimaps) owner.client.screen += map minimap_displayed = !minimap_displayed -/datum/action/minimap/give_to(mob/M) +/datum/action/minimap/give_to(mob/target) . = ..() if(default_overwatch_level) map = SSminimaps.fetch_minimap_object(default_overwatch_level, minimap_flags) else - RegisterSignal(M, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change)) - if(!SSminimaps.minimaps_by_z["[M.z]"] || !SSminimaps.minimaps_by_z["[M.z]"].hud_image) + RegisterSignal(target, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change)) + + var/turf/turf_gotten = get_turf(target) + if(!turf_gotten) + return + var/z_level = turf_gotten.z + + if(!SSminimaps.minimaps_by_z["[z_level]"] || !SSminimaps.minimaps_by_z["[z_level]"].hud_image) return - map = SSminimaps.fetch_minimap_object(M.z, minimap_flags) + map = SSminimaps.fetch_minimap_object(z_level, minimap_flags) -/datum/action/minimap/remove_from(mob/M) +/datum/action/minimap/remove_from(mob/target) . = ..() if(minimap_displayed) owner?.client?.screen -= map diff --git a/code/datums/emergency_calls/cryo_marines.dm b/code/datums/emergency_calls/cryo_marines.dm index e5992a62ecdd..9bec8b3593dd 100644 --- a/code/datums/emergency_calls/cryo_marines.dm +++ b/code/datums/emergency_calls/cryo_marines.dm @@ -13,10 +13,12 @@ shuttle_id = "" var/leaders = 0 -/datum/emergency_call/cryo_squad/spawn_candidates(announce, override_spawn_loc) +/datum/emergency_call/cryo_squad/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message) var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] leaders = cryo_squad.num_leaders - return ..() + . = ..() + if(length(members)) + shipwide_ai_announcement("Successfully deployed [length(members)] Foxtrot marines.") /datum/emergency_call/cryo_squad/create_member(datum/mind/M, turf/override_spawn_loc) set waitfor = 0 diff --git a/code/datums/emergency_calls/cryo_marines_heavy.dm b/code/datums/emergency_calls/cryo_marines_heavy.dm index 6a3636568856..70ce52443573 100644 --- a/code/datums/emergency_calls/cryo_marines_heavy.dm +++ b/code/datums/emergency_calls/cryo_marines_heavy.dm @@ -16,10 +16,12 @@ var/leaders = 0 -/datum/emergency_call/cryo_squad_equipped/spawn_candidates(announce, override_spawn_loc) +/datum/emergency_call/cryo_squad_equipped/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message) var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo] leaders = cryo_squad.num_leaders - return ..() + . = ..() + if(length(members)) + shipwide_ai_announcement("Successfully deployed [length(members)] Foxtrot marines.") /datum/emergency_call/cryo_squad_equipped/create_member(datum/mind/M, turf/override_spawn_loc) set waitfor = 0 diff --git a/code/datums/statistics/entities/panel_stats.dm b/code/datums/statistics/entities/panel_stats.dm index 44f95f2d91d9..d6e391e1731f 100644 --- a/code/datums/statistics/entities/panel_stats.dm +++ b/code/datums/statistics/entities/panel_stats.dm @@ -741,7 +741,6 @@ "total_projectiles_hit_xeno" = total_projectiles_hit_xeno, "total_slashes" = total_slashes, "total_friendly_fire_instances" = total_friendly_fire_instances, - "total_friendly_fire_kills" = total_friendly_fire_kills, "total_huggers_applied" = total_huggers_applied, "total_larva_burst" = total_larva_burst, "participants" = participants_list, diff --git a/code/datums/statistics/entities/round_stats.dm b/code/datums/statistics/entities/round_stats.dm index ec6aa4ac5bdc..0e1fb6e387db 100644 --- a/code/datums/statistics/entities/round_stats.dm +++ b/code/datums/statistics/entities/round_stats.dm @@ -20,7 +20,6 @@ var/total_projectiles_hit_human = 0 var/total_projectiles_hit_xeno = 0 var/total_friendly_fire_instances = 0 - var/total_friendly_fire_kills = 0 var/total_slashes = 0 // untracked data @@ -360,7 +359,6 @@ stats += "Total shots fired: [total_projectiles_fired]\n" stats += "Total friendly fire instances: [total_friendly_fire_instances]\n" - stats += "Total friendly fire kills: [total_friendly_fire_kills]\n" stats += "Marines remaining: [end_of_round_marines]\n" stats += "Xenos remaining: [end_of_round_xenos]\n" diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index 01858ed486d0..ade74531bc91 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -22,6 +22,7 @@ item_state = "motion_detector" flags_atom = FPRINT| CONDUCT flags_equip_slot = SLOT_WAIST + inherent_traits = list(TRAIT_ITEM_NOT_IMPLANTABLE) var/list/blip_pool = list() var/detector_range = 14 var/detector_mode = MOTION_DETECTOR_LONG @@ -309,7 +310,7 @@ name = "hacked motion detector" desc = "A device that usually picks up non-USCM signals, but this one's been hacked to detect all non-freelancer movement instead. Fight fire with fire!" iff_signal = FACTION_MERCENARY - + /obj/item/device/motiondetector/hacked/pmc name = "corporate motion detector" desc = "A device that usually picks up non-USCM signals, but this one's been reprogrammed to detect all non-PMC movement instead. Very corporate." diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 42a3a2f0b9ea..e98e3b527c5f 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -302,11 +302,9 @@ src.add_fingerprint(user) afterbuckle(target) if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset - var/matrix/M = matrix() - var/matrix/L = matrix() //Counterrotation for langchat text. - M.Turn(90) - L.Turn(270) - target.apply_transform(M) + var/matrix/new_matrix = matrix() + new_matrix.Turn(90) + target.apply_transform(new_matrix) return TRUE /obj/proc/send_buckling_message(mob/M, mob/user) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 05355feeb154..e6c215d0208f 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -149,7 +149,7 @@ /obj/structure/closet/proc/toggle(mob/living/user) user.next_move = world.time + 5 - if(!(src.opened ? src.close() : src.open())) + if(!(src.opened ? src.close(user) : src.open())) to_chat(user, SPAN_NOTICE("It won't budge!")) return diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index e306b894b021..37d46cbe6d5d 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -289,11 +289,12 @@ if(buckled_human.stat == DEAD ) buckled_mob_density = FALSE - . = ..() - var/mob/dead/observer/G = ghost_of_buckled_mob var/datum/mind/M = G?.mind ghost_of_buckled_mob = null + + . = ..() //Very important that this comes after, since it deletes the nest and clears ghost_of_buckled_mob + if(!istype(buckled_human) || !istype(G) || !istype(M) || buckled_human.undefibbable || buckled_human.mind || M.original != buckled_human || buckled_human.chestburst) return // Zealous checking as most is handled by ghost code to_chat(G, FONT_SIZE_HUGE(SPAN_DANGER("You have been freed from your nest and may go back to your body! (Look for 'Re-enter Corpse' in Ghost verbs, or click here!)"))) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index f1b35e56ef86..dfa21fcec71a 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -825,7 +825,6 @@ if(isnull(OBShell.double_explosion_delay)) return statsmessage = "Custom HE OB ([OBShell.name]) Stats from [key_name(usr)]: Clear Power: [OBShell.clear_power], Clear Falloff: [OBShell.clear_falloff], Clear Delay: [OBShell.clear_delay], Blast Power: [OBShell.standard_power], Blast Falloff: [OBShell.standard_falloff], Blast Delay: [OBShell.double_explosion_delay]." warhead = OBShell - qdel(OBShell) if("Custom Cluster") var/obj/structure/ob_ammo/warhead/cluster/OBShell = new OBShell.name = input("What name should the warhead have?", "Set name", "Cluster orbital warhead") @@ -842,7 +841,6 @@ if(isnull(OBShell.explosion_falloff)) return statsmessage = "Custom Cluster OB ([OBShell.name]) Stats from [key_name(usr)]: Salvos: [OBShell.total_amount], Shot per Salvo: [OBShell.instant_amount], Explosion Power: [OBShell.explosion_power], Explosion Falloff: [OBShell.explosion_falloff]." warhead = OBShell - qdel(OBShell) if("Custom Incendiary") var/obj/structure/ob_ammo/warhead/incendiary/OBShell = new OBShell.name = input("What name should the warhead have?", "Set name", "Incendiary orbital warhead") @@ -871,19 +869,28 @@ if(isnull(OBShell.fire_color)) return statsmessage = "Custom Incendiary OB ([OBShell.name]) Stats from [key_name(usr)]: Clear Power: [OBShell.clear_power], Clear Falloff: [OBShell.clear_falloff], Clear Delay: [OBShell.clear_delay], Fire Distance: [OBShell.distance], Fire Duration: [OBShell.fire_level], Fire Strength: [OBShell.burn_level]." warhead = OBShell - qdel(OBShell) if(custom) - if(alert(usr, statsmessage, "Confirm Stats", "Yes", "No") != "Yes") return + if(alert(usr, statsmessage, "Confirm Stats", "Yes", "No") != "Yes") + qdel(warhead) + return message_admins(statsmessage) var/turf/target = get_turf(usr.loc) if(alert(usr, "Fire or Spawn Warhead?", "Mode", "Fire", "Spawn") == "Fire") - if(alert("Are you SURE you want to do this? It will create an OB explosion!",, "Yes", "No") != "Yes") return + if(alert("Are you SURE you want to do this? It will create an OB explosion!",, "Yes", "No") != "Yes") + qdel(warhead) + return + message_admins("[key_name(usr)] has fired \an [warhead.name] at ([target.x],[target.y],[target.z]).") warhead.warhead_impact(target) - QDEL_IN(warhead, OB_CRASHING_DOWN) + + if(istype(warhead, /obj/structure/ob_ammo/warhead/cluster)) + // so the user's screen can shake for the duration of the cluster, otherwise we get a runtime. + QDEL_IN(warhead, OB_CLUSTER_DURATION) + else + QDEL_IN(warhead, OB_CRASHING_DOWN) else warhead.loc = target diff --git a/code/modules/character_traits/biology_traits.dm b/code/modules/character_traits/biology_traits.dm index e7625c391b75..87fb0b70ec36 100644 --- a/code/modules/character_traits/biology_traits.dm +++ b/code/modules/character_traits/biology_traits.dm @@ -59,11 +59,13 @@ return ADD_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK) + target.speech_problem_flag = TRUE ..() /datum/character_trait/biology/lisp/unapply_trait(mob/living/carbon/human/target) REMOVE_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK) + target.speech_problem_flag = FALSE ..() /datum/character_trait/biology/bad_leg diff --git a/code/modules/cm_marines/dropship_ammo.dm b/code/modules/cm_marines/dropship_ammo.dm index b4b585e1de89..3c01688b70d7 100644 --- a/code/modules/cm_marines/dropship_ammo.dm +++ b/code/modules/cm_marines/dropship_ammo.dm @@ -287,9 +287,8 @@ /obj/structure/ship_ammo/rocket/widowmaker/detonate_on(turf/impact) impact.ceiling_debris_check(3) - spawn(5) - cell_explosion(impact, 300, 40, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)) //Your standard HE splash damage rocket. Good damage, good range, good speed, it's an all rounder - qdel(src) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 300, 40, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) //Your standard HE splash damage rocket. Good damage, good range, good speed, it's an all rounder + QDEL_IN(src, 0.5 SECONDS) /obj/structure/ship_ammo/rocket/banshee name = "\improper AGM-227 'Banshee'" @@ -301,10 +300,9 @@ /obj/structure/ship_ammo/rocket/banshee/detonate_on(turf/impact) impact.ceiling_debris_check(3) - spawn(5) - cell_explosion(impact, 175, 20, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)) //Small explosive power with a small fall off for a big explosion range - fire_spread(impact, create_cause_data(initial(name), source_mob), 4, 15, 50, "#00b8ff") //Very intense but the fire doesn't last very long - qdel(src) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 175, 20, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) //Small explosive power with a small fall off for a big explosion range + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(fire_spread), impact, create_cause_data(initial(name), source_mob), 4, 15, 50, "#00b8ff"), 0.5 SECONDS) //Very intense but the fire doesn't last very long + QDEL_IN(src, 0.5 SECONDS) /obj/structure/ship_ammo/rocket/keeper name = "\improper GBU-67 'Keeper II'" @@ -317,9 +315,8 @@ /obj/structure/ship_ammo/rocket/keeper/detonate_on(turf/impact) impact.ceiling_debris_check(3) - spawn(5) - cell_explosion(impact, 450, 100, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, create_cause_data(initial(name), source_mob)) //Insane fall off combined with insane damage makes the Keeper useful for single targets, but very bad against multiple. - qdel(src) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 450, 100, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) //Insane fall off combined with insane damage makes the Keeper useful for single targets, but very bad against multiple. + QDEL_IN(src, 0.5 SECONDS) /obj/structure/ship_ammo/rocket/harpoon name = "\improper AGM-84 'Harpoon'" @@ -333,9 +330,8 @@ //Looks kinda OP but all it can actually do is just to blow windows and some of other things out, cant do much damage. /obj/structure/ship_ammo/rocket/harpoon/detonate_on(turf/impact) impact.ceiling_debris_check(3) - spawn(5) - cell_explosion(impact, 150, 16, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)) - qdel(src) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 150, 16, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) + QDEL_IN(src, 0.5 SECONDS) /obj/structure/ship_ammo/rocket/napalm name = "\improper XN-99 'Napalm'" @@ -347,10 +343,9 @@ /obj/structure/ship_ammo/rocket/napalm/detonate_on(turf/impact) impact.ceiling_debris_check(3) - spawn(5) - cell_explosion(impact, 200, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)) - fire_spread(impact, create_cause_data(initial(name), source_mob), 6, 60, 30, "#EE6515") //Color changed into napalm's color to better convey how intense the fire actually is. - qdel(src) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), impact, 200, 25, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name)), source_mob), 0.5 SECONDS) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(fire_spread), impact, create_cause_data(initial(name), source_mob), 6, 60, 30, "#EE6515"), 0.5 SECONDS) //Color changed into napalm's color to better convey how intense the fire actually is. + QDEL_IN(src, 0.5 SECONDS) diff --git a/code/modules/cm_marines/dropship_equipment.dm b/code/modules/cm_marines/dropship_equipment.dm index 42bbd7f746e7..89d33134bdb8 100644 --- a/code/modules/cm_marines/dropship_equipment.dm +++ b/code/modules/cm_marines/dropship_equipment.dm @@ -256,6 +256,13 @@ deployed_turret.start_processing() deployed_turret.set_range() + deployed_turret.linked_cam = new(deployed_turret.loc, "[capitalize_first_letters(ship_base.name)] [capitalize_first_letters(name)]") + if (linked_shuttle.id == DROPSHIP_ALAMO) + deployed_turret.linked_cam.network = list(CAMERA_NET_ALAMO) + else if (linked_shuttle.id == DROPSHIP_NORMANDY) + deployed_turret.linked_cam.network = list(CAMERA_NET_NORMANDY) + + /obj/structure/dropship_equipment/sentry_holder/proc/undeploy_sentry() if(!deployed_turret) return @@ -267,8 +274,12 @@ deployed_turret.stop_processing() deployed_turret.unset_range() icon_state = "sentry_system_installed" + QDEL_NULL(deployed_turret.linked_cam) - +/obj/structure/dropship_equipment/sentry_holder/Destroy() + if(deployed_turret) + QDEL_NULL(deployed_turret.linked_cam) + . = ..() /// Holder for the dropship mannable machinegun system diff --git a/code/modules/cm_marines/equipment/gear.dm b/code/modules/cm_marines/equipment/gear.dm index 98e7dbcf49df..ff6c715b520b 100644 --- a/code/modules/cm_marines/equipment/gear.dm +++ b/code/modules/cm_marines/equipment/gear.dm @@ -58,6 +58,8 @@ var/is_animating = FALSE var/first_open = TRUE exit_stun = 0 + /// used to implement a delay before tarp can be entered again after opened (anti-exploit) + COOLDOWN_DECLARE(toggle_delay) /obj/structure/closet/bodybag/tarp/snow icon_state = "snowtarp_closed" @@ -91,9 +93,9 @@ exit_stun = 1 can_store_dead = TRUE -/obj/structure/closet/bodybag/tarp/reactive/scout/close() +/obj/structure/closet/bodybag/tarp/reactive/scout/close(mob/user) if(!skillcheck(usr, SKILL_SPEC_WEAPONS, SKILL_SPEC_ALL) && usr.skills.get_skill_level(SKILL_SPEC_WEAPONS) != SKILL_SPEC_SCOUT) - to_chat(usr, SPAN_WARNING("You don't seem to know how to use [src]...")) + to_chat(user, SPAN_WARNING("You don't seem to know how to use [src]...")) return . = ..() @@ -137,10 +139,14 @@ return /obj/structure/closet/bodybag/tarp/open() + COOLDOWN_START(src, toggle_delay, 3 SECONDS) //3 seconds must pass before tarp can be closed . = ..() handle_cloaking() -/obj/structure/closet/bodybag/tarp/close() +/obj/structure/closet/bodybag/tarp/close(mob/user) + if(!COOLDOWN_FINISHED(src, toggle_delay)) + to_chat(user, SPAN_WARNING("It is too soon to close [src]!")) + return FALSE . = ..() handle_cloaking() diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index 14e990809f4f..ad214c954915 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -353,6 +353,9 @@ var/list/ob_type_fuel_requirements /obj/structure/ob_ammo/warhead name = "theoretical orbital ammo" var/warhead_kind + var/shake_frequency + var/max_shake_factor + var/max_knockdown_time /obj/structure/ob_ammo/warhead/proc/warhead_impact(turf/target) // make damn sure everyone hears it @@ -398,10 +401,37 @@ var/list/ob_type_fuel_requirements return TRUE return FALSE +/// proc designed for handling ob camera shakes, takes the target location as input and calculates camera shake based off user location. +/obj/structure/ob_ammo/warhead/proc/handle_ob_shake(turf/epicenter) + + var/radius_size = 30 + + for(var/mob/living/user in urange(radius_size, epicenter)) + + var/distance = get_accurate_dist(get_turf(user), epicenter) + var/distance_percent = ((radius_size - distance) / radius_size) + var/total_shake_factor = abs(max_shake_factor * distance_percent) + + // it's of type cluster. + if(!max_knockdown_time) + shake_camera(user, 0.5, total_shake_factor, shake_frequency) + continue + + shake_camera(user, 3, total_shake_factor, shake_frequency) + user.KnockDown(rand(max_knockdown_time * distance_percent, (max_knockdown_time * distance_percent + 1))) + + if(!user.knocked_down) + continue + to_chat(user, SPAN_WARNING("You are thrown off balance and fall to the ground!")) + /obj/structure/ob_ammo/warhead/explosive name = "\improper HE orbital warhead" warhead_kind = "explosive" icon_state = "ob_warhead_1" + shake_frequency = 3 + max_shake_factor = 15 + max_knockdown_time = 6 + var/clear_power = 1200 var/clear_falloff = 400 var/standard_power = 600 @@ -419,16 +449,20 @@ var/list/ob_type_fuel_requirements var/datum/cause_data/cause_data = create_cause_data(initial(name), source_mob) cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //break shit around sleep(clear_delay) - //ACTUALLY BLOW SHIT UP + + // Explosion if turf is not a wall. if(!target.density) cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + handle_ob_shake(target) sleep(double_explosion_delay) cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) return + // Checks turf around the target for(var/turf/T in range(2, target)) if(!T.density) cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + handle_ob_shake(target) sleep(double_explosion_delay) cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) return @@ -437,6 +471,9 @@ var/list/ob_type_fuel_requirements name = "\improper Incendiary orbital warhead" warhead_kind = "incendiary" icon_state = "ob_warhead_2" + shake_frequency = 1 + max_shake_factor = 8 + max_knockdown_time = 3 var/clear_power = 1200 var/clear_falloff = 400 var/clear_delay = 3 @@ -457,6 +494,8 @@ var/list/ob_type_fuel_requirements sleep(10) var/datum/cause_data/cause_data = create_cause_data(initial(name), source_mob) cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //break shit around + handle_ob_shake(target) + sleep(clear_delay) fire_spread(target, cause_data, distance, fire_level, burn_level, fire_color, fire_type, TURF_PROTECTION_OB) @@ -464,6 +503,9 @@ var/list/ob_type_fuel_requirements name = "\improper Cluster orbital warhead" warhead_kind = "cluster" icon_state = "ob_warhead_3" + shake_frequency = 2 + max_shake_factor = 1 + var/total_amount = 75 // how many times will the shell fire? var/instant_amount = 3 // how many explosions per time it fires? var/explosion_power = 350 @@ -492,11 +534,13 @@ var/list/ob_type_fuel_requirements if(protected_by_pylon(TURF_PROTECTION_OB, U)) //If the turf somehow gained OB protection while the cluster was firing continue fire_in_a_hole(U) + sleep(delay_between_clusters) /obj/structure/ob_ammo/warhead/cluster/proc/fire_in_a_hole(turf/loc) new /obj/effect/overlay/temp/blinking_laser (loc) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(cell_explosion), loc, explosion_power, explosion_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, create_cause_data(initial(name), source_mob)), 1 SECONDS) + addtimer(CALLBACK(src, PROC_REF(handle_ob_shake), loc), 1 SECONDS) /obj/structure/ob_ammo/ob_fuel name = "solid fuel" @@ -607,3 +651,4 @@ var/list/ob_type_fuel_requirements return TRUE tgui_interact(user) + diff --git a/code/modules/defenses/sentry.dm b/code/modules/defenses/sentry.dm index 3d485f3abda7..946c347efaa0 100644 --- a/code/modules/defenses/sentry.dm +++ b/code/modules/defenses/sentry.dm @@ -539,11 +539,13 @@ choice_categories = list() selected_categories = list() var/obj/structure/dropship_equipment/sentry_holder/deployment_system + var/obj/structure/machinery/camera/cas/linked_cam /obj/structure/machinery/defenses/sentry/premade/dropship/Destroy() if(deployment_system) deployment_system.deployed_turret = null deployment_system = null + QDEL_NULL(linked_cam) . = ..() #define SENTRY_SNIPER_RANGE 10 diff --git a/code/modules/gear_presets/survivors.dm b/code/modules/gear_presets/survivors.dm index 42d5ec0915bb..97b974b8a5ec 100644 --- a/code/modules/gear_presets/survivors.dm +++ b/code/modules/gear_presets/survivors.dm @@ -346,6 +346,20 @@ ..() +/datum/equipment_preset/survivor/corporate/solaris + name = "Survivor - Solaris Ridge Corporate Liaison" + assignment = "Solaris Ridge Corporate Liaison" + +/datum/equipment_preset/survivor/corporate/solaris/load_gear(mob/living/carbon/human/new_human) + new_human.equip_to_slot_or_del(new /obj/item/clothing/under/liaison_suit/outing/red(new_human), WEAR_BODY) + if(new_human.disabilities & NEARSIGHTED) + new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/prescription(new_human), WEAR_EYES) + else + new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(new_human), WEAR_EYES) + new_human.equip_to_slot_or_del(new /obj/item/clothing/shoes/marine/knife(new_human), WEAR_FEET) + + ..() + // ----- Security Survivor /datum/equipment_preset/survivor/security diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index fcb95a6fd783..a22e46ad2911 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -398,7 +398,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/is_nested = (buckled && istype(buckled, /obj/structure/bed/nest)) ? TRUE : FALSE var/obj/structure/bed/nest/nest = FALSE if(is_nested) - text_prompt += "\nSince you're nested, you will be given a chance to reenter your body upon being freed." + text_prompt += "\nSince you're nested, you will get a chance to reenter your body if freed." nest = buckled var/response = tgui_alert(src, text_prompt, "Are you sure you want to ghost?", options) if(response == "Aghost") diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 00659389decb..5c685cc3acac 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -287,7 +287,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t apply_damage(burn, BURN, picked, sharp, edge) UpdateDamageIcon() updatehealth() - speech_problem_flag = 1 + speech_problem_flag = TRUE //Heal MANY limbs, in random order @@ -308,7 +308,7 @@ In most cases it makes more sense to use apply_damage() instead! And make sure t parts -= picked updatehealth() - speech_problem_flag = 1 + speech_problem_flag = TRUE if(update) UpdateDamageIcon() // damage MANY limbs, in random order diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 7f9801145a8e..989ee52fa63c 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -64,7 +64,7 @@ var/voice - var/speech_problem_flag = 0 + var/speech_problem_flag = FALSE var/special_voice = "" // For changing our voice. Used by a symptom. diff --git a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm index 46b1f3e15515..9ab234212108 100644 --- a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm +++ b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm @@ -17,7 +17,7 @@ return if(disabilities & TOURETTES) - speech_problem_flag = 1 + speech_problem_flag = TRUE if((prob(10) && knocked_out <= 1)) apply_effect(10, STUN) spawn() @@ -36,7 +36,7 @@ return if(disabilities & NERVOUS) - speech_problem_flag = 1 + speech_problem_flag = TRUE if(prob(10)) stuttering = max(10, stuttering) return diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm index 4a6596104d4a..5c951a8112bf 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm @@ -59,7 +59,7 @@ if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) - speech_problem_flag = 1 + speech_problem_flag = TRUE if(regular_update) handle_dreams() apply_damage(-3, HALLOSS) @@ -122,7 +122,7 @@ handle_statuses() if(paralyzed) - speech_problem_flag = 1 + speech_problem_flag = TRUE apply_effect(1, WEAKEN) silent = 1 blinded = TRUE diff --git a/code/modules/mob/living/carbon/human/life/life_helpers.dm b/code/modules/mob/living/carbon/human/life/life_helpers.dm index 0339bf6ec742..fedeaf9fd48c 100644 --- a/code/modules/mob/living/carbon/human/life/life_helpers.dm +++ b/code/modules/mob/living/carbon/human/life/life_helpers.dm @@ -216,18 +216,18 @@ /mob/living/carbon/human/handle_silent() if(..()) - speech_problem_flag = 1 + speech_problem_flag = TRUE return silent /mob/living/carbon/human/handle_slurring() if(..()) - speech_problem_flag = 1 + speech_problem_flag = TRUE return slurring /mob/living/carbon/human/handle_stunned() if(stunned) adjust_effect(-species.stun_reduction, STUN, EFFECT_FLAG_LIFE) - speech_problem_flag = 1 + speech_problem_flag = TRUE return stunned /mob/living/carbon/human/handle_dazed() @@ -237,7 +237,7 @@ var/final_reduction = skill_resistance + 1 adjust_effect(-final_reduction, DAZE, EFFECT_FLAG_LIFE) if(dazed) - speech_problem_flag = 1 + speech_problem_flag = TRUE return dazed /mob/living/carbon/human/handle_knocked_down() @@ -262,7 +262,7 @@ /mob/living/carbon/human/handle_stuttering() if(..()) - speech_problem_flag = 1 + speech_problem_flag = TRUE return stuttering #define HUMAN_TIMER_TO_EFFECT_CONVERSION (0.05) //(1/20) //once per 2 seconds, with effect equal to endurance, which is used later diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 46a44fc16611..4b86c827a069 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -262,20 +262,20 @@ for it but just ignore it. /mob/living/carbon/human/proc/handle_speech_problems(message) var/list/returns[3] var/verb = "says" - var/handled = 0 + var/handled = FALSE if(silent) message = "" - handled = 1 + handled = TRUE if(sdisabilities & DISABILITY_MUTE) message = "" - handled = 1 + handled = TRUE if(wear_mask) if(istype(wear_mask, /obj/item/clothing/mask/horsehead)) var/obj/item/clothing/mask/horsehead/hoers = wear_mask if(hoers.voicechange) message = pick("NEEIIGGGHHHH!", "NEEEIIIIGHH!", "NEIIIGGHH!", "HAAWWWWW!", "HAAAWWW!") verb = pick("whinnies","neighs", "says") - handled = 1 + handled = TRUE var/braindam = getBrainLoss() if(slurring || stuttering || dazed || braindam >= 60) @@ -283,17 +283,17 @@ for it but just ignore it. if(slurring) message = slur(message) verb = pick("stammers","stutters") - handled = 1 + handled = TRUE if(stuttering) message = NewStutter(message) verb = pick("stammers", "stutters") - handled = 1 + handled = TRUE if(dazed) message = DazedText(message) verb = pick("mumbles", "babbles") - handled = 1 + handled = TRUE if(braindam >= 60) - handled = 1 + handled = TRUE if(prob(braindam/4)) message = stutter(message, stuttering) verb = pick("stammers", "stutters") @@ -301,6 +301,7 @@ for it but just ignore it. message = uppertext(message) verb = pick("yells like an idiot","says rather loudly") if(HAS_TRAIT(src, TRAIT_LISPING)) + handled = TRUE var/old_message = message message = lisp_replace(message) if(old_message != message) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 355f69ca05a9..f74b65c2606d 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -94,23 +94,19 @@ There are several things that need to be remembered: if(lying == lying_prev && !force) return lying_prev = lying - var/matrix/M = matrix() - var/matrix/L = matrix() //Counter-rotation for langchat text. + var/matrix/new_matrix = matrix() if(lying) if(pulledby && pulledby.grab_level >= GRAB_CARRY) - M.Turn(90) - L.Turn(270) + new_matrix.Turn(90) else if(prob(50)) - M.Turn(90) - L.Turn(270) + new_matrix.Turn(90) else - M.Turn(270) - L.Turn(90) - M.Translate(rand(-10,10),rand(-10,10)) - apply_transform(M) + new_matrix.Turn(270) + new_matrix.Translate(rand(-10,10), rand(-10,10)) + apply_transform(new_matrix) else - apply_transform(M) + apply_transform(new_matrix) /mob/living/carbon/human/UpdateDamageIcon() for(var/obj/limb/O in limbs) diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index 29779480f143..8b890de8a727 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -22,8 +22,8 @@ affected_mob.status_flags |= XENO_HOST START_PROCESSING(SSobj, src) if(iscarbon(affected_mob)) - var/mob/living/carbon/C = affected_mob - C.med_hud_set_status() + var/mob/living/carbon/affected_carbon = affected_mob + affected_carbon.med_hud_set_status() else return INITIALIZE_HINT_QDEL @@ -31,8 +31,8 @@ if(affected_mob) affected_mob.status_flags &= ~(XENO_HOST) if(iscarbon(affected_mob)) - var/mob/living/carbon/C = affected_mob - C.med_hud_set_status() + var/mob/living/carbon/affected_carbon = affected_mob + affected_carbon.med_hud_set_status() STOP_PROCESSING(SSobj, src) affected_mob = null GLOB.player_embryo_list -= src @@ -48,24 +48,24 @@ affected_mob.status_flags &= ~(XENO_HOST) STOP_PROCESSING(SSobj, src) if(iscarbon(affected_mob)) - var/mob/living/carbon/C = affected_mob - C.med_hud_set_status() + var/mob/living/carbon/affected_carbon = affected_mob + affected_carbon.med_hud_set_status() affected_mob = null return FALSE if(affected_mob.stat == DEAD) if(ishuman(affected_mob)) - var/mob/living/carbon/human/H = affected_mob - if(world.time > H.timeofdeath + H.revive_grace_period) //Can't be defibbed. - var/mob/living/carbon/xenomorph/larva/L = locate() in affected_mob - if(L) - L.chest_burst(affected_mob) + var/mob/living/carbon/human/affected_human = affected_mob + if(world.time > affected_human.timeofdeath + affected_human.revive_grace_period) //Can't be defibbed. + var/mob/living/carbon/xenomorph/larva/larva_embryo = locate() in affected_mob + if(larva_embryo) + larva_embryo.chest_burst(affected_mob) qdel(src) return FALSE else - var/mob/living/carbon/xenomorph/larva/L = locate() in affected_mob - if(L) - L.chest_burst(affected_mob) + var/mob/living/carbon/xenomorph/larva/larva_embryo = locate() in affected_mob + if(larva_embryo) + larva_embryo.chest_burst(affected_mob) STOP_PROCESSING(SSobj, src) return FALSE @@ -89,12 +89,12 @@ if(stage < 5) counter += 1 * hive.larva_gestation_multiplier - if(stage < 5 && counter >= 120) + if(stage < 5 && counter >= 90) counter = 0 stage++ if(iscarbon(affected_mob)) - var/mob/living/carbon/C = affected_mob - C.med_hud_set_status() + var/mob/living/carbon/affected_carbon = affected_mob + affected_carbon.med_hud_set_status() switch(stage) if(2) @@ -132,9 +132,9 @@ if(6) larva_autoburst_countdown-- if(!larva_autoburst_countdown) - var/mob/living/carbon/xenomorph/larva/L = locate() in affected_mob - if(L) - L.chest_burst(affected_mob) + var/mob/living/carbon/xenomorph/larva/larva_embryo = locate() in affected_mob + if(larva_embryo) + larva_embryo.chest_burst(affected_mob) //We look for a candidate. If found, we spawn the candidate as a larva //Order of priority is bursted individual (if xeno is enabled), then random candidate, and then it's up for grabs and spawns braindead @@ -256,36 +256,37 @@ victim.spawn_gibs() - for(var/mob/living/carbon/xenomorph/larva/L in victim) - var/datum/hive_status/hive = GLOB.hive_datum[L.hivenumber] - L.forceMove(get_turf(victim)) //moved to the turf directly so we don't get stuck inside a cryopod or another mob container. - playsound(L, pick('sound/voice/alien_chestburst.ogg','sound/voice/alien_chestburst2.ogg'), 25) + for(var/mob/living/carbon/xenomorph/larva/larva_embryo in victim) + var/datum/hive_status/hive = GLOB.hive_datum[larva_embryo.hivenumber] + larva_embryo.forceMove(get_turf(victim)) //moved to the turf directly so we don't get stuck inside a cryopod or another mob container. + playsound(larva_embryo, pick('sound/voice/alien_chestburst.ogg','sound/voice/alien_chestburst2.ogg'), 25) - if(L.client) - L.set_lighting_alpha_from_prefs(L.client) + if(larva_embryo.client) + larva_embryo.set_lighting_alpha_from_prefs(larva_embryo.client) - L.attack_log += "\[[time_stamp()]\] chestbursted from [key_name(victim)]" - victim.attack_log += "\[[time_stamp()]\] Was chestbursted, larva was [key_name(L)]" + larva_embryo.attack_log += "\[[time_stamp()]\] chestbursted from [key_name(victim)]" + victim.attack_log += "\[[time_stamp()]\] Was chestbursted, larva was [key_name(larva_embryo)]" if(burstcount) - step(L, pick(cardinal)) + step(larva_embryo, pick(cardinal)) if(round_statistics) round_statistics.total_larva_burst++ + GLOB.larva_burst_by_hive[hive] = (GLOB.larva_burst_by_hive[hive] || 0) + 1 burstcount++ - if(!L.ckey && L.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && hive.living_xeno_queen && hive.living_xeno_queen.z == loc.z) - L.visible_message(SPAN_XENODANGER("[L] quickly burrows into the ground.")) - if(round_statistics && !L.statistic_exempt) + if(!larva_embryo.ckey && larva_embryo.burrowable && loc && is_ground_level(loc.z) && (locate(/obj/structure/bed/nest) in loc) && hive.living_xeno_queen && hive.living_xeno_queen.z == loc.z) + larva_embryo.visible_message(SPAN_XENODANGER("[larva_embryo] quickly burrows into the ground.")) + if(round_statistics && !larva_embryo.statistic_exempt) round_statistics.track_new_participant(faction, -1) // keep stats sane hive.stored_larva++ hive.hive_ui.update_burrowed_larva() - qdel(L) + qdel(larva_embryo) if(!victim.first_xeno) - to_chat(L, SPAN_XENOHIGHDANGER("The Queen's will overwhelms your instincts...")) - to_chat(L, SPAN_XENOHIGHDANGER("\"[hive.hive_orders]\"")) - log_attack("[key_name(victim)] chestbursted, the larva was [key_name(L)].") //this is so that admins are not spammed with los logs + to_chat(larva_embryo, SPAN_XENOHIGHDANGER("The Queen's will overwhelms your instincts...")) + to_chat(larva_embryo, SPAN_XENOHIGHDANGER("\"[hive.hive_orders]\"")) + log_attack("[key_name(victim)] chestbursted, the larva was [key_name(larva_embryo)].") //this is so that admins are not spammed with los logs for(var/obj/item/alien_embryo/AE in victim) qdel(AE) @@ -295,31 +296,31 @@ victim.gib(cause) else if(ishuman(victim)) - var/mob/living/carbon/human/H = victim - H.last_damage_data = cause + var/mob/living/carbon/human/victim_human = victim + victim_human.last_damage_data = cause var/datum/internal_organ/O var/i for(i in list("heart","lungs")) //This removes (and later garbage collects) both organs. No heart means instant death. - O = H.internal_organs_by_name[i] - H.internal_organs_by_name -= i - H.internal_organs -= O + O = victim_human.internal_organs_by_name[i] + victim_human.internal_organs_by_name -= i + victim_human.internal_organs -= O victim.death(cause) // Certain species were still surviving bursting (predators), DEFINITELY kill them this time. victim.chestburst = 2 victim.update_burst() // Squeeze thru dense objects as a larva, as airlocks -/mob/living/carbon/xenomorph/larva/proc/scuttle(obj/structure/S) +/mob/living/carbon/xenomorph/larva/proc/scuttle(obj/structure/target) var/move_dir = get_dir(src, loc) - for(var/atom/movable/AM in get_turf(S)) - if(AM != S && AM.density && AM.BlockedPassDirs(src, move_dir)) - to_chat(src, SPAN_WARNING("\The [AM] prevents you from squeezing under \the [S]!")) + for(var/atom/movable/AM in get_turf(target)) + if(AM != target && AM.density && AM.BlockedPassDirs(src, move_dir)) + to_chat(src, SPAN_WARNING("\The [AM] prevents you from squeezing under \the [target]!")) return // Is it an airlock? - if(istype(S, /obj/structure/machinery/door/airlock)) - var/obj/structure/machinery/door/airlock/A = S - if(A.locked || A.welded) //Can't pass through airlocks that have been bolted down or welded - to_chat(src, SPAN_WARNING("\The [A] is locked down tight. You can't squeeze underneath!")) + if(istype(target, /obj/structure/machinery/door/airlock)) + var/obj/structure/machinery/door/airlock/selected_airlock = target + if(selected_airlock.locked || selected_airlock.welded) //Can't pass through airlocks that have been bolted down or welded + to_chat(src, SPAN_WARNING("\The [selected_airlock] is locked down tight. You can't squeeze underneath!")) return - visible_message(SPAN_WARNING("\The [src] scuttles underneath \the [S]!"), \ - SPAN_WARNING("You squeeze and scuttle underneath \the [S]."), null, 5) - forceMove(S.loc) + visible_message(SPAN_WARNING("\The [src] scuttles underneath \the [target]!"), \ + SPAN_WARNING("You squeeze and scuttle underneath \the [target]."), null, 5) + forceMove(target.loc) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_abilities.dm index e0a29a034029..0c9358119def 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_abilities.dm @@ -14,20 +14,21 @@ can_be_shield_blocked = TRUE /datum/action/xeno_action/activable/pounce/lurker/additional_effects_always() - var/mob/living/carbon/xenomorph/X = owner - if (!istype(X)) + var/mob/living/carbon/xenomorph/xeno = owner + if (!istype(xeno)) return - - if (X.mutation_type == LURKER_NORMAL) + if (xeno.mutation_type == LURKER_NORMAL) var/found = FALSE - for (var/mob/living/carbon/human/H in get_turf(X)) + for (var/mob/living/carbon/human/human in get_turf(xeno)) + if(human.stat == DEAD) + continue found = TRUE break if (found) - var/datum/action/xeno_action/onclick/lurker_invisibility/LIA = get_xeno_action_by_type(X, /datum/action/xeno_action/onclick/lurker_invisibility) - if (istype(LIA)) - LIA.invisibility_off() + var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invis = get_xeno_action_by_type(xeno, /datum/action/xeno_action/onclick/lurker_invisibility) + if (istype(lurker_invis)) + lurker_invis.invisibility_off() /datum/action/xeno_action/activable/pounce/lurker/additional_effects(mob/living/L) var/mob/living/carbon/xenomorph/X = owner diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm index 0c4ba1f2e86d..b58d94a6ed5b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm @@ -288,6 +288,11 @@ if(!do_after(xeno, 0.8 SECONDS, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 2)) // would be 0.75 but that doesn't really work with numticks return + // To make sure that the headbite does nothing if the target is moved away. + if(!xeno.Adjacent(target_carbon)) + to_chat(xeno, SPAN_XENOHIGHDANGER("You missed! Your target was moved away before you could finish headbiting them!")) + return + if(target_carbon.stat == DEAD) to_chat(xeno, SPAN_XENODANGER("They died before you could finish headbiting them! Be more careful next time!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index 5d3ee0b04ba7..7506788c2576 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -239,6 +239,9 @@ // Used for the faction of the xenomorph. Not recommended to modify. var/internal_faction + /// Short Hive ID as string used in stats reporting + var/reporting_id = "normal" + var/hivenumber = XENO_HIVE_NORMAL var/mob/living/carbon/xenomorph/queen/living_xeno_queen var/egg_planting_range = 15 @@ -286,7 +289,7 @@ var/bonus_larva_spawn_chance = 1 var/hijack_burrowed_surge = FALSE //at hijack, start spawning lots of burrowed /// how many burrowed is going to spawn during larva surge - var/hijack_burrowed_left = 0 + var/hijack_burrowed_left = 0 var/ignore_slots = FALSE var/dynamic_evolution = TRUE @@ -1006,7 +1009,10 @@ /datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user) if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber]) - return + return FALSE + if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned + to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph.")) + return FALSE if(world.time < hugger_timelock) to_chat(user, SPAN_WARNING("The hive cannot support facehuggers yet...")) return FALSE @@ -1050,6 +1056,7 @@ /datum/hive_status/corrupted name = "Corrupted Hive" + reporting_id = "corrupted" hivenumber = XENO_HIVE_CORRUPTED prefix = "Corrupted " color = "#80ff80" @@ -1073,6 +1080,7 @@ /datum/hive_status/alpha name = "Alpha Hive" + reporting_id = "alpha" hivenumber = XENO_HIVE_ALPHA prefix = "Alpha " color = "#ff4040" @@ -1083,6 +1091,7 @@ /datum/hive_status/bravo name = "Bravo Hive" + reporting_id = "bravo" hivenumber = XENO_HIVE_BRAVO prefix = "Bravo " color = "#ffff80" @@ -1093,6 +1102,7 @@ /datum/hive_status/charlie name = "Charlie Hive" + reporting_id = "charlie" hivenumber = XENO_HIVE_CHARLIE prefix = "Charlie " color = "#bb40ff" @@ -1103,6 +1113,7 @@ /datum/hive_status/delta name = "Delta Hive" + reporting_id = "delta" hivenumber = XENO_HIVE_DELTA prefix = "Delta " color = "#8080ff" @@ -1113,6 +1124,7 @@ /datum/hive_status/feral name = "Feral Hive" + reporting_id = "feral" hivenumber = XENO_HIVE_FERAL prefix = "Feral " color = "#828296" @@ -1128,6 +1140,7 @@ /datum/hive_status/forsaken name = "Forsaken Hive" + reporting_id = "forsaken" hivenumber = XENO_HIVE_FORSAKEN prefix = "Forsaken " color = "#cc8ec4" @@ -1146,6 +1159,7 @@ /datum/hive_status/yautja name = "Hellhound Pack" + reporting_id = "hellhounds" hivenumber = XENO_HIVE_YAUTJA internal_faction = FACTION_YAUTJA @@ -1162,6 +1176,7 @@ /datum/hive_status/mutated name = "Mutated Hive" + reporting_id = "mutated" hivenumber = XENO_HIVE_MUTATED prefix = "Mutated " color = "#6abd99" @@ -1172,6 +1187,7 @@ /datum/hive_status/corrupted/tamed name = "Tamed Hive" + reporting_id = "tamed" hivenumber = XENO_HIVE_TAMED prefix = "Tamed " color = "#80ff80" diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 5528755cf87c..263f5b07cca4 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -309,6 +309,7 @@ damage_mult = BASE_BULLET_DAMAGE_MULT damage_falloff_mult = DAMAGE_FALLOFF_TIER_10 damage_buildup_mult = DAMAGE_BUILDUP_TIER_1 + velocity_add = BASE_VELOCITY_BONUS recoil = RECOIL_OFF recoil_unwielded = RECOIL_OFF movement_onehanded_acc_penalty_mult = MOVEMENT_ACCURACY_PENALTY_MULT_TIER_1 diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index cebd4b44da7d..8f2e6156831a 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -106,6 +106,8 @@ if(.) if(is_surgery_tool(tool)) //Make sure you still have all your tools after a surgery. return FALSE + if(HAS_TRAIT(tool, TRAIT_ITEM_NOT_IMPLANTABLE)) + return FALSE if(tool.w_class > get_max_wclass(surgery)) to_chat(user, SPAN_WARNING("[tool] is too big to implant into [surgery.target]'s [surgery.affected_limb.cavity]!")) return FALSE diff --git a/colonialmarines.dme b/colonialmarines.dme index ebd73b3544dd..204c144c8916 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -241,6 +241,9 @@ #include "code\controllers\subsystem\htmlui.dm" #include "code\controllers\subsystem\human.dm" #include "code\controllers\subsystem\inactivity.dm" +#include "code\controllers\subsystem\influxdriver.dm" +#include "code\controllers\subsystem\influxmcstats.dm" +#include "code\controllers\subsystem\influxstats.dm" #include "code\controllers\subsystem\input.dm" #include "code\controllers\subsystem\interior.dm" #include "code\controllers\subsystem\item_cleanup.dm" diff --git a/html/changelogs/AutoChangeLog-pr-3298.yml b/html/changelogs/AutoChangeLog-pr-3298.yml deleted file mode 100644 index 0a75d2215043..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3298.yml +++ /dev/null @@ -1,15 +0,0 @@ -author: "realforest2001" -delete-after: True -changes: - - rscadd: "Added an admin button for an ARES bioscan. Slightly refactored how Bioscans trigger for marines, relying on an ARES processor." - - rscadd: "Added individual proccessors for ARES systems. These are WIP and will eventually have damage and repair interactions." - - rscadd: "Added an ARES interaction console in the AI Core room, which holds logs for most ARES functions." - - rscadd: "Added the ability for ARES console to call ERT or Distress." - - rscadd: "Added motion triggers in ARES core and shipside comms that send alerts over Apollo." - - rscadd: "Added a 1to1 conversation feature between ARES and users of the interface console." - - rscadd: "Added preset open versions of blended poddoors." - - rscadd: "Added a console for directing Working Joes. This is largely WIP for future PR(s)." - - rscadd: "Added subtypes of air pipes that don't explode on hijack, used these in ARES core." - - maptweak: "Remodelled ARES Core onto a fake-z, and added the new processors." - - bugfix: "door_control buttons now respect being indestructable when processing explosions." - - maptweak: "Fixed the M39s overflowing in brig armory due to use of landmarks." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3666.yml b/html/changelogs/AutoChangeLog-pr-3666.yml deleted file mode 100644 index d7d8860c237e..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3666.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Morrow" -delete-after: True -changes: - - balance: "Xenos no longer can pull dead xenos" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3717.yml b/html/changelogs/AutoChangeLog-pr-3717.yml deleted file mode 100644 index 6d6327ea63a7..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3717.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Drathek" -delete-after: True -changes: - - bugfix: "Fixed the crashsite offset for a hijack shuttle that gets deterred by the MGAD System" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3718.yml b/html/changelogs/AutoChangeLog-pr-3718.yml deleted file mode 100644 index 41f5322a2493..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3718.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "TheGamerdk" -delete-after: True -changes: - - balance: "Queen boosted building no longer has 2 second cooldown when far from hive" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3723.yml b/html/changelogs/AutoChangeLog-pr-3723.yml deleted file mode 100644 index 987b7eeec708..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3723.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "TheGamerdk" -delete-after: True -changes: - - bugfix: "Communications intel objective now actually works" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3730.yml b/html/changelogs/AutoChangeLog-pr-3730.yml deleted file mode 100644 index 9ae18e6bc788..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3730.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "fira" -delete-after: True -changes: - - bugfix: "Fixed a MC crash related to NPC huggers rebounding logic." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3731.yml b/html/changelogs/AutoChangeLog-pr-3731.yml deleted file mode 100644 index 21fd76664d2b..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3731.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "blackdragonTOW" -delete-after: True -changes: - - maptweak: "Added a small light to unlit rooms." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3732.yml b/html/changelogs/AutoChangeLog-pr-3732.yml new file mode 100644 index 000000000000..1fcec99781cb --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-3732.yml @@ -0,0 +1,4 @@ +author: "blackdragonTOW" +delete-after: True +changes: + - refactor: "refactored dropship_ammo so that missiles don't use Spawn()" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3736.yml b/html/changelogs/AutoChangeLog-pr-3736.yml deleted file mode 100644 index c1eba0beabfd..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3736.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Morrow" -delete-after: True -changes: - - rscdel: "Removed toxin mags on shivas" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3742.yml b/html/changelogs/AutoChangeLog-pr-3742.yml deleted file mode 100644 index 7319ac52f8d9..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3742.yml +++ /dev/null @@ -1,6 +0,0 @@ -author: "SpartanBobby" -delete-after: True -changes: - - maptweak: "Minor decal changes to LV522" - - maptweak: "Buffed sec armory on LV522" - - maptweak: "LV522 Breaching charge moved to the PROP APC made UNACIDABLE" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3743.yml b/html/changelogs/AutoChangeLog-pr-3743.yml deleted file mode 100644 index 084e74fc2c2e..000000000000 --- a/html/changelogs/AutoChangeLog-pr-3743.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Katskan" -delete-after: True -changes: - - balance: "Removed G8A storage from various snow suits and parkas" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-3762.yml b/html/changelogs/AutoChangeLog-pr-3762.yml new file mode 100644 index 000000000000..708eac96abb7 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-3762.yml @@ -0,0 +1,4 @@ +author: "ghostsheet" +delete-after: True +changes: + - bugfix: "Fixed Extended Barrel bug of building up free bullet velocity." \ No newline at end of file diff --git a/html/changelogs/archive/2023-06.yml b/html/changelogs/archive/2023-06.yml index 71aeb035f4b8..e2d9dfed44d7 100644 --- a/html/changelogs/archive/2023-06.yml +++ b/html/changelogs/archive/2023-06.yml @@ -383,3 +383,62 @@ - balance: explosive barricade upgrade provides strong protection against brute-based projectiles (50%) - balance: explosive barricade upgrade provides strong protection against fire (50%) +2023-06-29: + Diegoflores31: + - balance: reduced Larva Burst time from 10 minutes to 7.5 minutes + - refactor: changed 1 letter vars. + Drathek: + - bugfix: Fixed the crashsite offset for a hijack shuttle that gets deterred by + the MGAD System + IowaPotatoFarmer: + - rscadd: Solaris Ridge now has a Corporate Liaison survivor. + Katskan: + - balance: Removed G8A storage from various snow suits and parkas + Morrow: + - balance: Xenos no longer can pull dead xenos + - rscdel: Removed toxin mags on shivas + SpartanBobby: + - maptweak: Minor decal changes to LV522 + - maptweak: Buffed sec armory on LV522 + - maptweak: LV522 Breaching charge moved to the PROP APC made UNACIDABLE + TheGamerdk: + - bugfix: Communications intel objective now actually works + - balance: Queen boosted building no longer has 2 second cooldown when far from + hive + blackdragonTOW: + - maptweak: Added a small light to unlit rooms. + fira: + - bugfix: Fixed a MC crash related to NPC huggers rebounding logic. + realforest2001: + - rscadd: Added an admin button for an ARES bioscan. Slightly refactored how Bioscans + trigger for marines, relying on an ARES processor. + - rscadd: Added individual proccessors for ARES systems. These are WIP and will + eventually have damage and repair interactions. + - rscadd: Added an ARES interaction console in the AI Core room, which holds logs + for most ARES functions. + - rscadd: Added the ability for ARES console to call ERT or Distress. + - rscadd: Added motion triggers in ARES core and shipside comms that send alerts + over Apollo. + - rscadd: Added a 1to1 conversation feature between ARES and users of the interface + console. + - rscadd: Added preset open versions of blended poddoors. + - rscadd: Added a console for directing Working Joes. This is largely WIP for future + PR(s). + - rscadd: Added subtypes of air pipes that don't explode on hijack, used these in + ARES core. + - maptweak: Remodelled ARES Core onto a fake-z, and added the new processors. + - bugfix: door_control buttons now respect being indestructable when processing + explosions. + - maptweak: Fixed the M39s overflowing in brig armory due to use of landmarks. +2023-06-30: + Drathek: + - bugfix: Fix runtimes with minimap subsystem not handling targets inside of objects + during removal + - code_imp: Ported VERB_REF and TYPE_VERB_REF from TG for 515 compatibility + - code_imp: Removed unnecessary calculations when updating a mob's transform. + Morrow: + - rscdel: Removed wrong warden locker + TheGamerdk: + - bugfix: You can now re-enter your body when unnested, marine mains, rejoice! + - bugfix: Lurkers no longer lose their pounce if they happen to end their pounce + on a tile with a dead human diff --git a/html/changelogs/archive/2023-07.yml b/html/changelogs/archive/2023-07.yml new file mode 100644 index 000000000000..eb01ed3f4007 --- /dev/null +++ b/html/changelogs/archive/2023-07.yml @@ -0,0 +1,29 @@ +2023-07-01: + Ben10083: + - bugfix: lisps now occur over radio as well + - refactor: Relevant variables relating to speech problems now use true and false + instead of 1 and 0 + - bugfix: fixes exploit relating to cloaking tarps by adding a delay before tarp + can be closed again. + Drathek: + - bugfix: Fixed missing xeno ban check for playing as a facehugger + - spellcheck: Tweaked message when ghosting while nested + TheGamerdk: + - rscadd: ARES will announce how many Foxtrot marines that woke up. + harryob: + - rscadd: you can no longer implant yourself with a motion detector + ihatethisengine: + - rscadd: Added cameras to dropship deployable sentries. +2023-07-02: + Clairion: + - bugfix: Vampire Lurker headbite will no longer trigger if the target is moved + away during windup. + Cthulhu80: + - rscadd: added camera shake and stun to OB. + fira: + - rscadd: Added InfluxDB backed metrics logging for some of the most used game statistics. + This will allow to graph them over time and give better insight as to what happens + in rounds. + theselfish: + - qol: Made the MP beret to be clickable. + - imageadd: Updated the MP beret obj sprite to be easier to click. diff --git a/icons/obj/items/clothing/cm_hats.dmi b/icons/obj/items/clothing/cm_hats.dmi index 33f600015a6f..7f798c2cd0bc 100644 Binary files a/icons/obj/items/clothing/cm_hats.dmi and b/icons/obj/items/clothing/cm_hats.dmi differ diff --git a/maps/bigredv2.json b/maps/bigredv2.json index ecb2e1472c57..0a6db01cd498 100644 --- a/maps/bigredv2.json +++ b/maps/bigredv2.json @@ -12,6 +12,7 @@ "/datum/equipment_preset/survivor/trucker/solaris", "/datum/equipment_preset/survivor/security/solaris", "/datum/equipment_preset/survivor/colonial_marshal/solaris", + "/datum/equipment_preset/survivor/corporate/solaris", "/datum/equipment_preset/survivor/clf", "/datum/equipment_preset/survivor/civilian" ], diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index 63562239f4dc..b15ee29dd20a 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -56372,7 +56372,6 @@ "pbh" = ( /obj/structure/disposalpipe/segment, /obj/structure/pipes/standard/simple/hidden/supply, -/obj/structure/closet/secure_closet/warden, /obj/structure/machinery/light{ dir = 4 }, diff --git a/nano/templates/cm_stat_panel.tmpl b/nano/templates/cm_stat_panel.tmpl index 97feebde5971..26de08f17054 100644 --- a/nano/templates/cm_stat_panel.tmpl +++ b/nano/templates/cm_stat_panel.tmpl @@ -159,9 +159,6 @@ Used in: /code/datums/statistics/entities/player_entity.dm
Total Friendly Fire Kills:
-
- {{:data.round.total_friendly_fire_kills}} -
Total Slashes: