diff --git a/_maps/deprecated/Ruins/oldAIsat.dmm b/_maps/deprecated/Ruins/oldAIsat.dmm index 622873e4f7ae..ea8e4ad1d1e0 100644 --- a/_maps/deprecated/Ruins/oldAIsat.dmm +++ b/_maps/deprecated/Ruins/oldAIsat.dmm @@ -564,7 +564,7 @@ "bU" = ( /obj/effect/decal/cleanable/blood, /obj/structure/chair, -/obj/item/clothing/under/rank/centcom/officer, +/obj/item/clothing/under/rank/centcom/official, /obj/item/restraints/handcuffs, /obj/effect/decal/remains/human, /turf/open/floor/plating/airless, diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index 24f28ce738c6..86538c6fc45d 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -680,7 +680,7 @@ "alS" = ( /obj/structure/fans/tiny/invisible, /turf/open/floor/holofloor/hyperspace, -/area/centcom/supplypod/flyMeToTheMoon) +/area/centcom/supplypod/supplypod_temp_holding) "alW" = ( /obj/structure/chair{ dir = 8 @@ -4244,7 +4244,7 @@ /area/centcom/ferry) "aNE" = ( /turf/open/floor/plasteel, -/area/centcom/supplypod/podStorage) +/area/centcom/supplypod/pod_storage) "aNF" = ( /obj/machinery/computer/communications{ dir = 1 @@ -9186,8 +9186,6 @@ /turf/open/floor/plasteel/dark, /area/ctf) "hYc" = ( -/obj/structure/destructible/cult/tome, -/obj/item/book/codex_gigas, /obj/machinery/airalarm/directional/east, /obj/effect/turf_decal/corner/transparent/neutral{ dir = 1 @@ -9199,6 +9197,7 @@ /obj/effect/turf_decal/corner/transparent/neutral{ dir = 8 }, +/obj/machinery/vending/wardrobe/cent_wardrobe, /turf/open/floor/plasteel/dark, /area/centcom/ferry) "hZs" = ( diff --git a/_maps/map_files/generic/blank.dmm b/_maps/map_files/generic/blank.dmm index b8744ca3eca5..b918e3fcaead 100644 --- a/_maps/map_files/generic/blank.dmm +++ b/_maps/map_files/generic/blank.dmm @@ -38,7 +38,7 @@ "N" = ( /obj/structure/fans/tiny/invisible, /turf/open/floor/holofloor/hyperspace, -/area/centcom/supplypod/flyMeToTheMoon) +/area/centcom/supplypod/supplypod_temp_holding) "P" = ( /obj/structure/signpost/salvation{ icon = 'icons/obj/structures.dmi'; diff --git a/check_regex.yaml b/check_regex.yaml index c28639172af2..7e5269c30a78 100644 --- a/check_regex.yaml +++ b/check_regex.yaml @@ -38,7 +38,7 @@ standards: - exactly: [ - 297, + 298, "non-bitwise << uses", '(? 20 || O.pixel_x < -20 || O.pixel_y > 20 || O.pixel_y < -20) + #define isbook(O) (is_type_in_typecache(O, GLOB.book_types)) GLOBAL_LIST_INIT(book_types, typecacheof(list( diff --git a/code/__DEFINES/lag_switch.dm b/code/__DEFINES/lag_switch.dm new file mode 100644 index 000000000000..022880c1a461 --- /dev/null +++ b/code/__DEFINES/lag_switch.dm @@ -0,0 +1,24 @@ +// All of the possible Lag Switch lag mitigation measures +// If you add more do not forget to update MEASURES_AMOUNT accordingly +/// Stops ghosts flying around freely, they can still jump and orbit, staff exempted +#define DISABLE_DEAD_KEYLOOP 1 +/// Stops ghosts using zoom/t-ray verbs and resets their view if zoomed out, staff exempted +#define DISABLE_GHOST_ZOOM_TRAY 2 +/// Disable runechat and enable the bubbles, speaking mobs with TRAIT_BYPASS_MEASURES exempted +#define DISABLE_RUNECHAT 3 +/// Disable icon2html procs from verbs like examine, mobs calling with TRAIT_BYPASS_MEASURES exempted +#define DISABLE_USR_ICON2HTML 4 +/// Prevents anyone from joining the game as anything but observer +#define DISABLE_NON_OBSJOBS 5 +/// Limit IC/dchat spam to one message every x seconds per client, TRAIT_BYPASS_MEASURES exempted +#define SLOWMODE_SAY 6 +/// Disables parallax, as if everyone had disabled their preference, TRAIT_BYPASS_MEASURES exempted +#define DISABLE_PARALLAX 7 +/// Disables footsteps, TRAIT_BYPASS_MEASURES exempted +#define DISABLE_FOOTSTEPS 8 +/// Disables planet deletion +#define DISABLE_PLANETDEL 9 +/// Disables ALL new planet generation, TRAIT_BYPASS_MEASURES exempted +#define DISABLE_PLANETGEN 10 + +#define MEASURES_AMOUNT 10 // The total number of switches defined above diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index d9c57e5d3efa..dfecc6f8af6b 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -59,3 +59,7 @@ #define ORGAN_VITAL (1<<4) //Currently only the brain #define ORGAN_EDIBLE (1<<5) //is a snack? :D #define ORGAN_SYNTHETIC_EMP (1<<6) //Synthetic organ affected by an EMP. Deteriorates over time. + +/// Flags for the pod_flags var on /obj/structure/closet/supplypod + +#define FIRST_SOUNDS (1<<0) // If it shouldn't play sounds the first time it lands, used for reverse mode diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 4603279a7672..361a24697a39 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -60,7 +60,6 @@ GLOBAL_LIST_INIT(special_roles, list( ROLE_NINJA, ROLE_OBSESSED, ROLE_SPACE_DRAGON, - ROLE_MONKEY = /datum/game_mode/monkey, ROLE_REVENANT, ROLE_ABDUCTOR, ROLE_DEVIL = /datum/game_mode/devil, diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 26d82fba3278..529274a50b39 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -263,6 +263,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_SCOOPABLE "scoopable" //your smooches actually deal damage to their target #define TRAIT_KISS_OF_DEATH "kiss_of_death" +/// This mob overrides certian SSlag_switch measures with this special trait +#define TRAIT_BYPASS_MEASURES "bypass_lagswitch_measures" //non-mob traits /// Used for limb-based paralysis, where replacing the limb will fix it. #define TRAIT_PARALYSIS "paralysis" diff --git a/code/__HELPERS/datums.dm b/code/__HELPERS/datums.dm new file mode 100644 index 000000000000..7cf87c203b73 --- /dev/null +++ b/code/__HELPERS/datums.dm @@ -0,0 +1,9 @@ +///Check if a datum has not been deleted and is a valid source +/proc/is_valid_src(datum/source_datum) + if(istype(source_datum)) + return !QDELETED(source_datum) + return FALSE + +/proc/call_async(datum/source, proc_type, list/arguments) + set waitfor = FALSE + return call(source, proc_type)(arglist(arguments)) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index f8cc644c6649..126d93fe352a 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1244,6 +1244,8 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico /proc/icon2html(atom/thing, client/target, icon_state, dir = SOUTH, frame = 1, moving = FALSE, sourceonly = FALSE, extra_classes = null) if (!thing) return + if(SSlag_switch.measures[DISABLE_USR_ICON2HTML] && usr && !HAS_TRAIT(usr, TRAIT_BYPASS_MEASURES)) + return var/key var/icon/icon2collapse = thing @@ -1354,6 +1356,8 @@ GLOBAL_DATUM_INIT(dummySave, /savefile, new("tmp/dummySave.sav")) //Cache of ico /proc/costly_icon2html(thing, target, sourceonly = FALSE) if (!thing) return + if(SSlag_switch.measures[DISABLE_USR_ICON2HTML] && usr && !HAS_TRAIT(usr, TRAIT_BYPASS_MEASURES)) + return if (isicon(thing)) return icon2html(thing, target) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index ded23733220c..0c28353395d4 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -12,6 +12,7 @@ GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, //This is for procs to replace all the goddamn 'in world's that are chilling around the code GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**. +GLOBAL_LIST_EMPTY(keyloop_list) //as above but can be limited to boost performance GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless GLOBAL_LIST_EMPTY(mob_directory) //mob_id -> mob GLOBAL_LIST_EMPTY(alive_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index b08504daae29..3239cb53b8d0 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -84,6 +84,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_CANNOT_OPEN_PRESENTS" = TRAIT_CANNOT_OPEN_PRESENTS, "TRAIT_PRESENT_VISION" = TRAIT_PRESENT_VISION, "TRAIT_DISK_VERIFIER" = TRAIT_DISK_VERIFIER, + "TRAIT_BYPASS_MEASURES" = TRAIT_BYPASS_MEASURES, "TRAIT_NOMOBSWAP" = TRAIT_NOMOBSWAP, "TRAIT_XRAY_VISION" = TRAIT_XRAY_VISION, "TRAIT_THERMAL_VISION" = TRAIT_THERMAL_VISION, diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 334dabd9198e..36d278adac0d 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -46,6 +46,10 @@ /datum/hud/proc/apply_parallax_pref(mob/viewmob) var/mob/screenmob = viewmob || mymob + + if (SSlag_switch.measures[DISABLE_PARALLAX] && !HAS_TRAIT(viewmob, TRAIT_BYPASS_MEASURES)) + return FALSE + var/client/C = screenmob.client if(C.prefs) var/pref = C.prefs.parallax diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index bf9b8d24a05c..41a470aac610 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -325,6 +325,10 @@ /datum/config_entry/flag/maprotation +/datum/config_entry/number/auto_lag_switch_pop //Number of clients at which drastic lag mitigation measures kick in + config_entry_value = null + min_val = 0 + /datum/config_entry/number/soft_popcap config_entry_value = null min_val = 0 diff --git a/code/controllers/subsystem/input.dm b/code/controllers/subsystem/input.dm index 07de18a43c2c..8bdc53089e12 100644 --- a/code/controllers/subsystem/input.dm +++ b/code/controllers/subsystem/input.dm @@ -93,7 +93,5 @@ SUBSYSTEM_DEF(input) user.set_macros() /datum/controller/subsystem/input/fire() - var/list/clients = GLOB.clients // Let's sing the list cache song - for(var/i in 1 to clients.len) - var/client/C = clients[i] - C.keyLoop() + for(var/mob/user as anything in GLOB.keyloop_list) + user.focus?.keyLoop(user.client) diff --git a/code/controllers/subsystem/lag_switch.dm b/code/controllers/subsystem/lag_switch.dm new file mode 100644 index 000000000000..eadf8d219324 --- /dev/null +++ b/code/controllers/subsystem/lag_switch.dm @@ -0,0 +1,156 @@ +/// The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience +SUBSYSTEM_DEF(lag_switch) + name = "Lag Switch" + flags = SS_NO_FIRE + + /// If the lag switch measures should attempt to trigger automatically, TRUE if a config value exists + var/auto_switch = FALSE + /// Amount of connected clients at which the Lag Switch should engage, set via config or admin panel + var/trigger_pop = INFINITY - 1337 + /// List of bools corresponding to code/__DEFINES/lag_switch.dm + var/static/list/measures[MEASURES_AMOUNT] + /// List of measures that toggle automatically + var/list/auto_measures = list(DISABLE_GHOST_ZOOM_TRAY, DISABLE_RUNECHAT, DISABLE_USR_ICON2HTML, DISABLE_PARALLAX, DISABLE_FOOTSTEPS, DISABLE_PLANETDEL) + /// Timer ID for the automatic veto period + var/veto_timer_id + /// Cooldown between say verb uses when slowmode is enabled + var/slowmode_cooldown = 3 SECONDS + +/datum/controller/subsystem/lag_switch/Initialize(start_timeofday) + for(var/i = 1, i <= measures.len, i++) + measures[i] = FALSE + var/auto_switch_pop = CONFIG_GET(number/auto_lag_switch_pop) + if(auto_switch_pop) + auto_switch = TRUE + trigger_pop = auto_switch_pop + RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, .proc/client_connected) + return ..() + +/datum/controller/subsystem/lag_switch/proc/client_connected(datum/source, client/connected) + SIGNAL_HANDLER + if(TGS_CLIENT_COUNT < trigger_pop) + return + + auto_switch = FALSE + UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT) + veto_timer_id = addtimer(CALLBACK(src, .proc/set_all_measures, TRUE, TRUE), 20 SECONDS, TIMER_STOPPABLE) + message_admins("Lag Switch population threshold reached. Automatic activation of lag mitigation measures occuring in 20 seconds. (CANCEL)") + log_admin("Lag Switch population threshold reached. Automatic activation of lag mitigation measures occuring in 20 seconds.") + +/// (En/Dis)able automatic triggering of switches based on client count +/datum/controller/subsystem/lag_switch/proc/toggle_auto_enable() + auto_switch = !auto_switch + if(auto_switch) + RegisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT, .proc/client_connected) + else + UnregisterSignal(SSdcs, COMSIG_GLOB_CLIENT_CONNECT) + +/// Called from an admin chat link +/datum/controller/subsystem/lag_switch/proc/cancel_auto_enable_in_progress() + if(!veto_timer_id) + return FALSE + + deltimer(veto_timer_id) + veto_timer_id = null + return TRUE + +/// Update the slowmode timer length and clear existing ones if reduced +/datum/controller/subsystem/lag_switch/proc/change_slowmode_cooldown(length) + if(!length) + return FALSE + + var/length_secs = length SECONDS + if(length_secs <= 0) + length_secs = 1 // one tick because cooldowns do not like 0 + + if(length_secs < slowmode_cooldown) + for(var/client/C as anything in GLOB.clients) + COOLDOWN_RESET(C, say_slowmode) + + slowmode_cooldown = length_secs + if(measures[SLOWMODE_SAY]) + to_chat(world, span_boldannounce("Slowmode timer has been changed to [length] seconds by an admin.")) + return TRUE + +/// Handle the state change for individual measures +/datum/controller/subsystem/lag_switch/proc/set_measure(measure_key, state) + if(isnull(measure_key) || isnull(state)) + stack_trace("SSlag_switch.set_measure() was called with a null arg") + return FALSE + if(isnull(LAZYACCESS(measures, measure_key))) + stack_trace("SSlag_switch.set_measure() was called with a measure_key not in the list of measures") + return FALSE + if(measures[measure_key] == state) + return TRUE + + measures[measure_key] = state + + switch(measure_key) + if(DISABLE_DEAD_KEYLOOP) + if(state) + for(var/mob/user as anything in GLOB.player_list) + if(user.stat == DEAD && !user.client?.holder) + GLOB.keyloop_list -= user + deadchat_broadcast(span_big("To increase performance Observer freelook is now disabled. Please use Orbit, Teleport, and Jump to look around."), message_type = DEADCHAT_ANNOUNCEMENT) + else + GLOB.keyloop_list |= GLOB.player_list + deadchat_broadcast("Observer freelook has been re-enabled. Enjoy your wooshing.", message_type = DEADCHAT_ANNOUNCEMENT) + if(DISABLE_GHOST_ZOOM_TRAY) + if(state) // if enabling make sure current ghosts are updated + for(var/mob/dead/observer/ghost in GLOB.dead_mob_list) + if(!ghost.client) + continue + if(!ghost.client.holder && ghost.client.view_size.getView() != ghost.client.view_size.default) + ghost.client.view_size.resetToDefault() + if(SLOWMODE_SAY) + if(state) + to_chat(world, span_boldannounce("Slowmode for IC/dead chat has been enabled with [slowmode_cooldown/10] seconds between messages.")) + else + for(var/client/C as anything in GLOB.clients) + COOLDOWN_RESET(C, say_slowmode) + to_chat(world, span_boldannounce("Slowmode for IC/dead chat has been disabled by an admin.")) + if(DISABLE_NON_OBSJOBS) + world.update_status() + if(DISABLE_PARALLAX) + if (state) + to_chat(world, span_boldannounce("Parallax has been disabled for performance concerns.")) + else + to_chat(world, span_boldannounce("Parallax has been re-enabled.")) + + for (var/mob/mob as anything in GLOB.mob_list) + mob.hud_used?.update_parallax_pref() + if(DISABLE_FOOTSTEPS) + if (state) + to_chat(world, span_boldannounce("Footstep sounds have been disabled for performance concerns.")) + else + to_chat(world, span_boldannounce("Footstep sounds have been re-enabled.")) + if(DISABLE_PLANETDEL) + if (state) + to_chat(world, span_boldannounce("Planet deletion and regeneration has been disabled for performance concerns.")) + else + to_chat(world, span_boldannounce("Planet deletion has been re-enabled.")) + if(DISABLE_PLANETGEN) + if (state) + to_chat(world, span_boldannounce("Planet generation has been disabled for performance concerns. You can still dock at already-generated planets.")) + else + to_chat(world, span_boldannounce("Planet generation has been re-enabled.")) + + return TRUE + +/// Helper to loop over all measures for mass changes +/datum/controller/subsystem/lag_switch/proc/set_all_measures(state, automatic = FALSE) + if(isnull(state)) + stack_trace("SSlag_switch.set_all_measures() was called with a null state arg") + return FALSE + + if(automatic) + message_admins("Lag Switch enabling automatic measures now.") + log_admin("Lag Switch enabling automatic measures now.") + veto_timer_id = null + for(var/i = 1, i <= auto_measures.len, i++) + set_measure(auto_measures[i], state) + return TRUE + + for(var/i = 1, i <= measures.len, i++) + set_measure(i, state) + return TRUE diff --git a/code/controllers/subsystem/traumas.dm b/code/controllers/subsystem/traumas.dm index 87628785caf0..ab220b4382b4 100644 --- a/code/controllers/subsystem/traumas.dm +++ b/code/controllers/subsystem/traumas.dm @@ -96,7 +96,7 @@ SUBSYSTEM_DEF(traumas) /obj/item/clothing/under/rank/security/head_of_security/parade/female, //WS Edit - Better Command Uniforms /obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/melee/baton/abductor, /obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer, - /obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/officer, + /obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/official, /obj/item/clothing/suit/space/hardsuit/ert, /obj/item/clothing/suit/space/hardsuit/ert/sec, /obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med, /obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad, @@ -119,7 +119,7 @@ SUBSYSTEM_DEF(traumas) /obj/item/clothing/under/rank/command/captain, /obj/item/clothing/under/rank/command/head_of_personnel, /obj/item/clothing/under/rank/security/head_of_security, /obj/item/clothing/under/rank/rnd/research_director, /obj/item/clothing/under/rank/medical/chief_medical_officer, /obj/item/clothing/under/rank/engineering/chief_engineer, - /obj/item/clothing/under/rank/centcom/officer, /obj/item/clothing/under/rank/centcom/commander, + /obj/item/clothing/under/rank/centcom/official, /obj/item/clothing/under/rank/centcom/commander, /obj/item/melee/classic_baton/telescopic, /obj/item/card/id/silver, /obj/item/card/id/gold, /obj/item/card/id/captains_spare, /obj/item/card/id/centcom, /obj/machinery/door/airlock/command)), diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index 684ec401e290..0b4b33ce5942 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -212,6 +212,8 @@ * * spans - Additional classes to be added to the message */ /mob/proc/create_chat_message(atom/movable/speaker, datum/language/message_language, raw_message, list/spans, runechat_flags = NONE) + if(SSlag_switch.measures[DISABLE_RUNECHAT] && !HAS_TRAIT(speaker, TRAIT_BYPASS_MEASURES)) + return // Ensure the list we are using, if present, is a copy so we don't modify the list provided to us spans = spans ? spans.Copy() : list() diff --git a/code/datums/components/footstep.dm b/code/datums/components/footstep.dm index d433e03b6934..95099164eec2 100644 --- a/code/datums/components/footstep.dm +++ b/code/datums/components/footstep.dm @@ -1,3 +1,5 @@ +#define SHOULD_DISABLE_FOOTSTEPS(source) ((SSlag_switch.measures[DISABLE_FOOTSTEPS] && !(HAS_TRAIT(source, TRAIT_BYPASS_MEASURES))) || HAS_TRAIT(source, TRAIT_SILENT_FOOTSTEPS)) + ///Footstep component. Plays footsteps at parents location when it is appropriate. /datum/component/footstep ///How many steps the parent has taken since the last time a footstep was played. @@ -71,6 +73,9 @@ /datum/component/footstep/proc/play_simplestep() SIGNAL_HANDLER + if (SHOULD_DISABLE_FOOTSTEPS(parent)) + return + var/turf/open/T = prepare_step() if(!T) return @@ -94,8 +99,9 @@ /datum/component/footstep/proc/play_humanstep() SIGNAL_HANDLER - if(HAS_TRAIT(parent, TRAIT_SILENT_FOOTSTEPS)) + if (SHOULD_DISABLE_FOOTSTEPS(parent)) return + var/turf/open/T = prepare_step() if(!T) return @@ -115,3 +121,5 @@ GLOB.barefootstep[T.barefootstep][2] * volume, TRUE, GLOB.barefootstep[T.barefootstep][3] + e_range, falloff_distance = 1) + +#undef SHOULD_DISABLE_FOOTSTEPS diff --git a/code/datums/components/pellet_cloud.dm b/code/datums/components/pellet_cloud.dm index d0998c41e5b8..b726489ad2a9 100644 --- a/code/datums/components/pellet_cloud.dm +++ b/code/datums/components/pellet_cloud.dm @@ -47,7 +47,7 @@ var/mob/living/shooter /datum/component/pellet_cloud/Initialize(projectile_type=/obj/item/shrapnel, magnitude=5) - if(!isammocasing(parent) && !isgrenade(parent) && !islandmine(parent)) + if(!isammocasing(parent) && !isgrenade(parent) && !islandmine(parent) && !issupplypod(parent)) return COMPONENT_INCOMPATIBLE if(magnitude < 1) @@ -58,7 +58,7 @@ if(isammocasing(parent)) num_pellets = magnitude - else if(isgrenade(parent) || islandmine(parent)) + else if(isgrenade(parent) || islandmine(parent) || issupplypod(parent)) radius = magnitude /datum/component/pellet_cloud/Destroy(force, silent) @@ -77,6 +77,8 @@ RegisterSignal(parent, COMSIG_GRENADE_PRIME, .proc/create_blast_pellets) else if(islandmine(parent)) RegisterSignal(parent, COMSIG_MINE_TRIGGERED, .proc/create_blast_pellets) + else if(issupplypod(parent)) + RegisterSignal(parent, COMSIG_SUPPLYPOD_LANDED, .proc/create_blast_pellets) /datum/component/pellet_cloud/UnregisterFromParent() UnregisterSignal(parent, list(COMSIG_PARENT_PREQDELETED, COMSIG_PELLET_CLOUD_INIT, COMSIG_GRENADE_PRIME, COMSIG_GRENADE_ARMED, COMSIG_MOVABLE_MOVED, COMSIG_MINE_TRIGGERED, COMSIG_ITEM_DROPPED)) diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index a3884dcf6d3c..6d3959753a9e 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -92,67 +92,6 @@ new_mob.ghostize(can_reenter_corpse = FALSE) new_mob.key = null -/datum/disease/transformation/jungle_fever - name = "Jungle Fever" - cure_text = "Death." - cures = list(/datum/reagent/medicine/adminordrazine) - spread_text = "Monkey Bites" - spread_flags = DISEASE_SPREAD_SPECIAL - viable_mobtypes = list(/mob/living/carbon/monkey, /mob/living/carbon/human) - permeability_mod = 1 - cure_chance = 1 - disease_flags = CAN_CARRY|CAN_RESIST - desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey." - severity = DISEASE_SEVERITY_BIOHAZARD - stage_prob = 4 - visibility_flags = 0 - agent = "Kongey Vibrion M-909" - new_form = /mob/living/carbon/monkey - bantype = ROLE_MONKEY - - - stage1 = list() - stage2 = list() - stage3 = list() - stage4 = list("Your back hurts.", "You breathe through your mouth.", - "You have a craving for bananas.", "Your mind feels clouded.") - stage5 = list("You feel like monkeying around.") - -/datum/disease/transformation/jungle_fever/do_disease_transformation(mob/living/carbon/affected_mob) - if(affected_mob.mind && !is_monkey(affected_mob.mind)) - add_monkey(affected_mob.mind) - if(ishuman(affected_mob)) - var/mob/living/carbon/monkey/M = affected_mob.monkeyize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_KEEPSE) - M.ventcrawler = VENTCRAWLER_ALWAYS - -/datum/disease/transformation/jungle_fever/stage_act() - ..() - switch(stage) - if(2) - if(prob(2)) - to_chat(affected_mob, "Your [pick("back", "arm", "leg", "elbow", "head")] itches.") - if(3) - if(prob(4)) - to_chat(affected_mob, "You feel a stabbing pain in your head.") - affected_mob.confused += 10 - if(4) - if(prob(3)) - affected_mob.say(pick("Eeek, ook ook!", "Eee-eeek!", "Eeee!", "Ungh, ungh."), forced = "jungle fever") - -/datum/disease/transformation/jungle_fever/cure() - remove_monkey(affected_mob.mind) - ..() - -/datum/disease/transformation/jungle_fever/monkeymode - visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC - disease_flags = CAN_CARRY //no vaccines! no cure! - -/datum/disease/transformation/jungle_fever/monkeymode/after_add() - if(affected_mob && !is_monkey_leader(affected_mob.mind)) - visibility_flags = NONE - - - /datum/disease/transformation/robot name = "Robotic Transformation" diff --git a/code/datums/saymode.dm b/code/datums/saymode.dm index 1bcc94853456..848940d4e9d9 100644 --- a/code/datums/saymode.dm +++ b/code/datums/saymode.dm @@ -124,25 +124,3 @@ AI.holopad_talk(message, language) return FALSE return TRUE - -/datum/saymode/monkey - key = "k" - mode = MODE_MONKEY - -/datum/saymode/monkey/handle_message(mob/living/user, message, datum/language/language) - var/datum/mind = user.mind - if(!mind) - return TRUE - if(is_monkey_leader(mind) || (ismonkey(user) && is_monkey(mind))) - user.log_talk(message, LOG_SAY, tag="monkey") - if(prob(75) && ismonkey(user)) - user.visible_message("\The [user] chimpers.") - var/msg = "\[[is_monkey_leader(mind) ? "Monkey Leader" : "Monkey"]\] [user]: [message]" - for(var/_M in GLOB.mob_list) - var/mob/M = _M - if(M in GLOB.dead_mob_list) - var/link = FOLLOW_LINK(M, user) - to_chat(M, "[link] [msg]") - if((is_monkey_leader(M.mind) || ismonkey(M)) && (M.mind in SSticker.mode.ape_infectees)) - to_chat(M, msg) - return FALSE diff --git a/code/datums/skills/_skill.dm b/code/datums/skills/_skill.dm index 46c3a1d2bc4d..368a1991a015 100644 --- a/code/datums/skills/_skill.dm +++ b/code/datums/skills/_skill.dm @@ -73,9 +73,9 @@ GLOBAL_LIST_INIT(skill_types, subtypesof(/datum/skill)) to_chat(mind.current, "It seems the Professional [title] Association won't send me another status symbol.") return var/obj/structure/closet/supplypod/bluespacepod/pod = new() - pod.landingDelay = 150 + pod.delays = list(POD_TRANSIT = 15, POD_FALLING = 4, POD_OPENING = 30, POD_LEAVING = 30) pod.explosionSize = list(0,0,0,0) to_chat(mind.current, "My legendary skill has attracted the attention of the Professional [title] Association. It seems they are sending me a status symbol to commemorate my abilities.") var/turf/T = get_turf(mind.current) - new /obj/effect/DPtarget(T, pod , new skill_cape_path(T)) + new /obj/effect/pod_landingzone(T, pod , new skill_cape_path(T)) LAZYADD(mind.skills_rewarded, src.type) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 07f93bc431fb..3069a050a04d 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -152,8 +152,7 @@ .["version"] = GLOB.game_version .["mode"] = GLOB.master_mode .["respawn"] = config ? !CONFIG_GET(flag/norespawn) : FALSE - .["enter"] = GLOB.enter_allowed - .["vote"] = CONFIG_GET(flag/allow_vote_mode) + .["enter"] = !LAZYACCESS(SSlag_switch.measures, DISABLE_NON_OBSJOBS) .["ai"] = CONFIG_GET(flag/allow_ai) .["host"] = world.host ? world.host : null .["round_id"] = GLOB.round_id diff --git a/code/game/area/areas/centcom.dm b/code/game/area/areas/centcom.dm index a41152d29044..8ca63ad47e4f 100644 --- a/code/game/area/areas/centcom.dm +++ b/code/game/area/areas/centcom.dm @@ -28,7 +28,7 @@ /area/centcom/holding name = "Holding Facility" -/area/centcom/supplypod/flyMeToTheMoon +/area/centcom/supplypod/supplypod_temp_holding name = "Supplypod Shipping lane" icon_state = "supplypod_flight" @@ -37,28 +37,43 @@ icon_state = "supplypod" dynamic_lighting = DYNAMIC_LIGHTING_DISABLED -/area/centcom/supplypod/podStorage +/area/centcom/supplypod/pod_storage name = "Supplypod Storage" icon_state = "supplypod_holding" /area/centcom/supplypod/loading name = "Supplypod Loading Facility" icon_state = "supplypod_loading" + var/loading_id = "" + +/area/centcom/supplypod/loading/Initialize() + . = ..() + if(!loading_id) + CRASH("[type] created without a loading_id") + if(GLOB.supplypod_loading_bays[loading_id]) + CRASH("Duplicate loading bay area: [type] ([loading_id])") + GLOB.supplypod_loading_bays[loading_id] = src /area/centcom/supplypod/loading/one name = "Bay #1" + loading_id = "1" /area/centcom/supplypod/loading/two name = "Bay #2" + loading_id = "2" /area/centcom/supplypod/loading/three name = "Bay #3" + loading_id = "3" /area/centcom/supplypod/loading/four name = "Bay #4" + loading_id = "4" /area/centcom/supplypod/loading/ert name = "ERT Bay" + loading_id = "5" + //THUNDERDOME /area/tdome diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 8152f5d8bd87..3e97c843fd13 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1656,3 +1656,19 @@ /atom/proc/join_player_here(mob/M) // By default, just place the mob on the same turf as the marker or whatever. M.forceMove(get_turf(src)) + +/* +* Used to set something as 'open' if it's being used as a supplypod +* +* Override this if you want an atom to be usable as a supplypod. +*/ +/atom/proc/setOpened() + return + +/* +* Used to set something as 'closed' if it's being used as a supplypod +* +* Override this if you want an atom to be usable as a supplypod. +*/ +/atom/proc/setClosed() + return diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index 61ae80615592..29333ce332d4 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -438,69 +438,6 @@ else objective.find_target() -////////////////////////////////////////////// -// // -// MONKEY // -// // -////////////////////////////////////////////// - -/datum/dynamic_ruleset/roundstart/monkey - name = "Monkey" - antag_flag = ROLE_MONKEY - antag_datum = /datum/antagonist/monkey/leader - restricted_roles = list("Cyborg", "AI", "Prisoner") - required_candidates = 1 - weight = 3 - cost = 0 - requirements = list(101,101,101,101,101,101,101,101,101,101) - high_population_requirement = 101 - var/players_per_carrier = 30 - var/monkeys_to_win = 1 - var/escaped_monkeys = 0 - var/datum/team/monkey/monkey_team - -/datum/dynamic_ruleset/roundstart/monkey/pre_execute() - . = ..() - var/carriers_to_make = max(round(mode.roundstart_pop_ready / players_per_carrier, 1), 1) - mode.antags_rolled += carriers_to_make - - for(var/j = 0, j < carriers_to_make, j++) - if (!candidates.len) - break - var/mob/carrier = pick_n_take(candidates) - assigned += carrier.mind - carrier.mind.special_role = "Monkey Leader" - carrier.mind.restricted_roles = restricted_roles - log_game("[key_name(carrier)] has been selected as a Jungle Fever carrier") - return TRUE - -/datum/dynamic_ruleset/roundstart/monkey/execute() - for(var/datum/mind/carrier in assigned) - var/datum/antagonist/monkey/M = add_monkey_leader(carrier) - if(M) - monkey_team = M.monkey_team - return TRUE - -/datum/dynamic_ruleset/roundstart/monkey/proc/check_monkey_victory() - if(SSshuttle.jump_mode != BS_JUMP_COMPLETED) - return FALSE - var/datum/disease/D = new /datum/disease/transformation/jungle_fever() - for(var/mob/living/carbon/monkey/M in GLOB.alive_mob_list) - if (M.HasDisease(D)) - if(M.onCentCom() || M.onSyndieBase()) - escaped_monkeys++ - if(escaped_monkeys >= monkeys_to_win) - return TRUE - else - return FALSE - -// This does not get called. Look into making it work. -/datum/dynamic_ruleset/roundstart/monkey/round_result() - if(check_monkey_victory()) - SSticker.mode_result = "win - monkey win" - else - SSticker.mode_result = "loss - staff stopped the monkeys" - ////////////////////////////////////////////// // // // METEOR // diff --git a/code/game/gamemodes/monkey/monkey.dm b/code/game/gamemodes/monkey/monkey.dm deleted file mode 100644 index 639f0c5c87b2..000000000000 --- a/code/game/gamemodes/monkey/monkey.dm +++ /dev/null @@ -1,130 +0,0 @@ -/datum/game_mode - var/list/ape_infectees = list() - var/list/ape_leaders = list() - -/datum/game_mode/monkey - name = "monkey" - config_tag = "monkey" - report_type = "monkey" - antag_flag = ROLE_MONKEY - false_report_weight = 1 - - required_players = 20 - required_enemies = 1 - recommended_enemies = 1 - - restricted_jobs = list("Prisoner", "Cyborg", "AI") - - announce_span = "Monkey" - announce_text = "One or more crewmembers have been infected with Jungle Fever! Crew: Contain the outbreak. None of the infected monkeys may escape alive to CentCom. Monkeys: Ensure that your kind lives on! Rise up against your captors!" - - var/carriers_to_make = 1 - var/list/carriers = list() - - var/monkeys_to_win = 1 - var/escaped_monkeys = 0 - - var/players_per_carrier = 30 - - var/datum/team/monkey/monkey_team - - - -/datum/game_mode/monkey/pre_setup() - carriers_to_make = max(round(num_players()/players_per_carrier, 1), 1) - - for(var/j = 0, j < carriers_to_make, j++) - if (!antag_candidates.len) - break - var/datum/mind/carrier = pick(antag_candidates) - carriers += carrier - carrier.special_role = "Monkey Leader" - carrier.restricted_roles = restricted_jobs - log_game("[key_name(carrier)] has been selected as a Jungle Fever carrier") - antag_candidates -= carrier - - if(!carriers.len) - setup_error = "No monkey candidates" - return FALSE - return TRUE - -/datum/game_mode/monkey/post_setup() - for(var/datum/mind/carriermind in carriers) - var/datum/antagonist/monkey/M = add_monkey_leader(carriermind, monkey_team) - if(M) - monkey_team = M.monkey_team - return ..() - -/datum/game_mode/monkey/check_finished() - if(SSshuttle.jump_mode == BS_JUMP_COMPLETED) - return TRUE - - if(!round_converted) - for(var/datum/mind/monkey_mind in ape_infectees) - continuous_sanity_checked = TRUE - if(monkey_mind.current && monkey_mind.current.stat != DEAD) - return FALSE - - var/datum/disease/D = new /datum/disease/transformation/jungle_fever() //ugly but unfortunately needed - for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(H.mind && H.client && H.stat != DEAD) - if(H.HasDisease(D)) - return FALSE - - return ..() - -/datum/game_mode/monkey/proc/check_monkey_victory() - if(SSshuttle.jump_mode != BS_JUMP_COMPLETED) - return FALSE - var/datum/disease/D = new /datum/disease/transformation/jungle_fever() - for(var/mob/living/carbon/monkey/M in GLOB.alive_mob_list) - if (M.HasDisease(D)) - if(M.onCentCom() || M.onSyndieBase()) - escaped_monkeys++ - if(escaped_monkeys >= monkeys_to_win) - return TRUE - else - return FALSE - - -/datum/game_mode/monkey/set_round_result() - ..() - if(check_monkey_victory()) - SSticker.mode_result = "win - monkey win" - else - SSticker.mode_result = "loss - staff stopped the monkeys" - -/datum/game_mode/monkey/special_report() - if(check_monkey_victory()) - return "