From b9a113c1b11de033fd94d48069a3193618092c54 Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:08:23 -0500 Subject: [PATCH] Changes Gamemode Flags (#7778) # About the pull request Changes the gamemode flags to datums, and updates the admin UI for it Also replaced the No OB flag since i have never seen anyone use it before # Explain why it's good for the game Better UI, will stop people from accidentally clicking it, and actually explains what it does # Testing Photographs and Procedure
Screenshots & Videos
# Changelog :cl: code: Changed gamemode flags to datums admin: Changed gamemode flags from many buttons to one UI /:cl: --- code/__DEFINES/mode.dm | 23 +- code/_globalvars/bitfields.dm | 17 -- code/_onclick/item_attack.dm | 2 +- code/controllers/subsystem/ticker.dm | 4 - code/datums/elements/strippable.dm | 2 +- code/datums/mob_hud.dm | 2 +- code/game/gamemodes/cm_initialize.dm | 13 +- .../colonialmarines/colonialmarines.dm | 6 +- .../colonialmarines/whiskey_outpost.dm | 2 +- code/game/gamemodes/extended/cm_vs_upp.dm | 2 +- .../game/gamemodes/extended/extended_clash.dm | 2 +- code/game/gamemodes/game_mode.dm | 1 + code/game/gamemodes/round_modifiers.dm | 117 +++++++++ .../effects/decals/cleanable/blood/blood.dm | 4 +- code/game/objects/effects/spawners/random.dm | 6 - code/game/objects/items/devices/binoculars.dm | 2 +- .../objects/items/devices/defibrillator.dm | 4 +- code/game/objects/items/stacks/medical.dm | 2 +- code/modules/admin/admin_verbs.dm | 22 +- .../modules/admin/gamemode_modifiers_panel.dm | 71 +++++ code/modules/admin/tabs/admin_tab.dm | 245 ------------------ .../cm_marines/equipment/mortar/mortars.dm | 4 +- code/modules/cm_marines/overwatch.dm | 4 + .../cm_marines/vehicle_part_fabricator.dm | 8 +- code/modules/cm_preds/yaut_bracers.dm | 4 +- code/modules/defenses/handheld.dm | 4 +- code/modules/mob/living/carbon/human/death.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 10 +- .../mob/living/carbon/human/human_helpers.dm | 2 +- .../living/carbon/human/human_stripping.dm | 8 +- .../living/carbon/xenomorph/attack_alien.dm | 4 +- .../carbon/xenomorph/resin_constructions.dm | 2 - code/modules/organs/limbs.dm | 2 +- code/modules/paperwork/paper.dm | 4 - code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- code/modules/recycling/disposal.dm | 4 +- .../shuttle/computers/dropship_computer.dm | 4 +- colonialmarines.dme | 2 + .../tgui/interfaces/ModifiersPanel.tsx | 57 ++++ 40 files changed, 309 insertions(+), 371 deletions(-) create mode 100644 code/game/gamemodes/round_modifiers.dm create mode 100644 code/modules/admin/gamemode_modifiers_panel.dm create mode 100644 tgui/packages/tgui/interfaces/ModifiersPanel.tsx diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 5acb27352794..1bf5fd08fa38 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -40,7 +40,8 @@ #define IS_MODE_COMPILED(MODE) (ispath(text2path("/datum/game_mode/"+(MODE)))) #define MODE_HAS_FLAG(flag) (SSticker.mode.flags_round_type & flag) -#define MODE_HAS_TOGGLEABLE_FLAG(flag) (SSticker.mode.toggleable_flags & flag) +#define MODE_HAS_MODIFIER(modifier_type) (SSticker.mode?.get_gamemode_modifier(modifier_type)) +#define MODE_SET_MODIFIER(modifier_type, enabled) (SSticker.mode?.set_gamemode_modifier(modifier_type, enabled)) // Gamemode Flags #define MODE_INFESTATION (1<<0) @@ -59,26 +60,6 @@ #define MODE_THUNDERSTORM (1<<13)// Enables thunderstorm effects on maps that are compatible with it. (Lit exterior tiles, rain effects) #define MODE_FACTION_CLASH (1<<14)// Disables scopes, sniper sentries, OBs, shooting corpses, dragging enemy corpses, stripping enemy corpses, increase armor bullet/bomb/internal damage protection -// Gamemode Toggleable Flags -#define MODE_NO_SNIPER_SENTRY (1<<0) /// Upgrade kits will no longer allow you to select long-range upgrades -#define MODE_NO_ATTACK_DEAD (1<<1) /// People will not be able to shoot at corpses -#define MODE_NO_STRIPDRAG_ENEMY (1<<2) /// Can't strip or drag dead enemies -#define MODE_STRIP_NONUNIFORM_ENEMY (1<<3) /// Can strip enemy, but not their boots, uniform, armor, helmet, or ID -#define MODE_STRONG_DEFIBS (1<<4) /// Defibs Ignore Armor -#define MODE_BLOOD_OPTIMIZATION (1<<5) /// Blood spawns without a dry timer, and do not cause footprints -#define MODE_NO_COMBAT_CAS (1<<6) /// Prevents POs and DCCs from creating combat CAS equipment -#define MODE_LZ_PROTECTION (1<<7) /// Prevents the LZ from being mortared -#define MODE_SHIPSIDE_SD (1<<8) /// Toggles whether Predators can big SD when not on the groundmap -#define MODE_HARDCORE_PERMA (1<<9) /// Toggles Hardcore for all marines, meaning they instantly perma upon death -#define MODE_DISPOSABLE_MOBS (1<<10) // Toggles if mobs fit in disposals or not. Off by default. -#define MODE_BYPASS_JOE (1<<11) // Toggles if ghosts can bypass Working Joe spawn limitations, does NOT bypass WL requirement. Off by default. -#define MODE_DISABLE_JOE_RESPAWN (1<<12) // Toggles if ghosts can respawn as Working Joes after dying as one when 15 minutes have passed. Off by default -#define MODE_INDESTRUCTIBLE_SPLINTS (1<<13) //Toggle is splints are to become nanosplints -#define MODE_NO_INTERNAL_BLEEDING (1<<14) // Toggles all internal bleeding behavior to cause normal bleeding instead -#define MODE_LZ_HAZARD_ACTIVATED (1<<15) // Distress Signal: Spawns miasma 3 minutes after round start -#define MODE_MORTAR_LASER_WARNING (1<<16) // Blinking laser before mortar impact - - #define ROUNDSTATUS_FOG_DOWN 1 #define ROUNDSTATUS_PODDOORS_OPEN 2 diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index da6e3b10cf03..e625f010e9d4 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -424,23 +424,6 @@ DEFINE_BITFIELD(flags_round_type, list( "MODE_FACTION_CLASH" = MODE_FACTION_CLASH, )) -DEFINE_BITFIELD(toggleable_flags, list( - "MODE_NO_SNIPER_SENTRY" = MODE_NO_SNIPER_SENTRY, - "MODE_NO_ATTACK_DEAD" = MODE_NO_ATTACK_DEAD, - "MODE_NO_STRIPDRAG_ENEMY" = MODE_NO_STRIPDRAG_ENEMY, - "MODE_STRIP_NONUNIFORM_ENEMY" = MODE_STRIP_NONUNIFORM_ENEMY, - "MODE_STRONG_DEFIBS" = MODE_STRONG_DEFIBS, - "MODE_BLOOD_OPTIMIZATION" = MODE_BLOOD_OPTIMIZATION, - "MODE_NO_COMBAT_CAS" = MODE_NO_COMBAT_CAS, - "MODE_LZ_PROTECTION" = MODE_LZ_PROTECTION, - "MODE_SHIPSIDE_SD" = MODE_SHIPSIDE_SD, - "MODE_HARDCORE_PERMA" = MODE_HARDCORE_PERMA, - "MODE_DISPOSABLE_MOBS" = MODE_DISPOSABLE_MOBS, - "MODE_BYPASS_JOE" = MODE_BYPASS_JOE, - "MODE_DISABLE_JOE_RESPAWN" = MODE_DISABLE_JOE_RESPAWN, - "MODE_LZ_HAZARD_ACTIVATED" = MODE_LZ_HAZARD_ACTIVATED -)) - DEFINE_BITFIELD(state, list( "OBJECTIVE_INACTIVE" = OBJECTIVE_INACTIVE, "OBJECTIVE_ACTIVE" = OBJECTIVE_ACTIVE, diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 1a3c279db8b3..db1e56438e92 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -45,7 +45,7 @@ /obj/item/proc/attack(mob/living/M, mob/living/user) - if((flags_item & NOBLUDGEON) || (MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_ATTACK_DEAD) && M.stat == DEAD && !user.get_target_lock(M.faction_group))) + if((flags_item & NOBLUDGEON) || (MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_attacking_corpses) && M.stat == DEAD && !user.get_target_lock(M.faction_group))) return FALSE if(SEND_SIGNAL(M, COMSIG_ITEM_ATTEMPT_ATTACK, user, src) & COMPONENT_CANCEL_ATTACK) //Sent by target mob. diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 3141b9fd2369..b5d008852229 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -144,10 +144,6 @@ SUBSYSTEM_DEF(ticker) REDIS_PUBLISH("byond.round", "type" = "round-start") - for(var/client/C in GLOB.admins) - remove_verb(C, GLOB.roundstart_mod_verbs) - GLOB.admin_verbs_minor_event -= GLOB.roundstart_mod_verbs - return TRUE /// Try to effectively setup gamemode and start now diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index d93b07234c9d..b43695b84bdc 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -139,7 +139,7 @@ if (ishuman(source)) var/mob/living/carbon/human/sourcehuman = source - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) to_chat(user, SPAN_WARNING("You can't strip items of a crit or dead member of another faction!")) return FALSE diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index c2cb0d8791f0..7a8239615016 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -488,7 +488,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( holder2_set = 1 return - holder.icon_state = HAS_TRAIT(src, TRAIT_HARDCORE) || MODE_HAS_TOGGLEABLE_FLAG(MODE_HARDCORE_PERMA) ? "hudhcdead" : "huddead" + holder.icon_state = HAS_TRAIT(src, TRAIT_HARDCORE) || MODE_HAS_MODIFIER(/datum/gamemode_modifier/permadeath) ? "hudhcdead" : "huddead" if(!holder2_set) holder2.icon_state = holder.icon_state holder3.icon_state = "huddead" diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 9c6a804862f5..5c2564c4deeb 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -104,7 +104,10 @@ Additional game mode variables. var/evolution_ovipositor_threshold = FALSE var/flags_round_type = NO_FLAGS - var/toggleable_flags = NO_FLAGS + ///List of references to all non-abstract /datum/gamemode_modifiers + var/round_modifiers = list() + ///List of typepaths of all /datum/gamemode_modifiers that start enabled + var/starting_round_modifiers = list() /datum/game_mode/proc/get_roles_list() @@ -1169,24 +1172,24 @@ Additional game mode variables. to_chat(joe_candidate, SPAN_WARNING("You are not whitelisted! You may apply on the forums to be whitelisted as a synth.")) return - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_DISABLE_JOE_RESPAWN) && (joe_candidate.ckey in joes)) // No joe respawns if already a joe before + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_wj_respawns) && (joe_candidate.ckey in joes)) // No joe respawns if already a joe before to_chat(joe_candidate, SPAN_WARNING("Working Joe respawns are disabled!")) return FALSE var/deathtime = world.time - joe_candidate.timeofdeath - if((deathtime < JOE_JOIN_DEAD_TIME && (joe_candidate.ckey in joes)) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if((deathtime < JOE_JOIN_DEAD_TIME && (joe_candidate.ckey in joes)) && !MODE_HAS_MODIFIER(/datum/gamemode_modifier/ignore_wj_restrictions)) to_chat(joe_candidate, SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)]. You need to wait [DisplayTimeText(JOE_JOIN_DEAD_TIME - deathtime)] before rejoining as a Working Joe!")) return FALSE // council doesn't count towards this conditional. if(joe_job.get_whitelist_status(joe_candidate.client) == WHITELIST_NORMAL) var/joe_max = joe_job.total_positions - if((joe_job.current_positions >= joe_max) && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if((joe_job.current_positions >= joe_max) && !MODE_HAS_MODIFIER(/datum/gamemode_modifier/ignore_wj_restrictions)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("Only [joe_max] Working Joes may spawn per round.")) return - if(!GLOB.enter_allowed && !MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE)) + if(!GLOB.enter_allowed && !MODE_HAS_MODIFIER(/datum/gamemode_modifier/ignore_wj_restrictions)) if(show_warning) to_chat(joe_candidate, SPAN_WARNING("There is an administrative lock from entering the game.")) return diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 9fb0553a35c2..d3dd9a7d97bc 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -212,7 +212,7 @@ /datum/game_mode/colonialmarines/proc/start_lz_hazards() if(SSobjectives.first_drop_complete) return // Just for sanity - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_HAZARD_ACTIVATED)) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/lz_roundstart_miasma)) return log_game("Distress Signal LZ hazards active!") @@ -419,8 +419,8 @@ evolution_ovipositor_threshold = TRUE msg_admin_niche("Xenomorphs now require the queen's ovipositor for evolution progress.") - if(!GLOB.resin_lz_allowed && world.time >= SSticker.round_start_time + round_time_resin) - set_lz_resin_allowed(TRUE) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/lz_weeding) && world.time >= SSticker.round_start_time + round_time_resin) + MODE_SET_MODIFIER(/datum/gamemode_modifier/lz_weeding, TRUE) if(next_stat_check <= world.time) add_current_round_status_to_end_results((next_stat_check ? "" : "Round Start")) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index 6194f665aa8f..aa9e56069b63 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -74,6 +74,7 @@ var/list/whiskey_outpost_waves = list() hardcore = TRUE + starting_round_modifiers = list(/datum/gamemode_modifier/permadeath) votable = TRUE vote_cycle = 75 // approx. once every 5 days, if it wins the vote @@ -91,7 +92,6 @@ return 1 /datum/game_mode/whiskey_outpost/pre_setup() - SSticker.mode.toggleable_flags ^= MODE_HARDCORE_PERMA for(var/obj/effect/landmark/whiskey_outpost/xenospawn/X) xeno_spawns += X.loc for(var/obj/effect/landmark/whiskey_outpost/supplydrops/S) diff --git a/code/game/gamemodes/extended/cm_vs_upp.dm b/code/game/gamemodes/extended/cm_vs_upp.dm index 305e59399ee7..44919935ea73 100644 --- a/code/game/gamemodes/extended/cm_vs_upp.dm +++ b/code/game/gamemodes/extended/cm_vs_upp.dm @@ -2,7 +2,7 @@ name = "Faction Clash UPP CM" config_tag = "Faction Clash UPP CM" flags_round_type = MODE_THUNDERSTORM|MODE_FACTION_CLASH - toggleable_flags = MODE_NO_SNIPER_SENTRY|MODE_NO_ATTACK_DEAD|MODE_NO_STRIPDRAG_ENEMY|MODE_STRONG_DEFIBS|MODE_BLOOD_OPTIMIZATION|MODE_NO_COMBAT_CAS|MODE_INDESTRUCTIBLE_SPLINTS|MODE_NO_INTERNAL_BLEEDING|MODE_MORTAR_LASER_WARNING + starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_ib, /datum/gamemode_modifier/disable_attacking_corpses, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning) taskbar_icon = 'icons/taskbar/gml_hvh.png' /datum/game_mode/extended/faction_clash/cm_vs_upp/get_roles_list() diff --git a/code/game/gamemodes/extended/extended_clash.dm b/code/game/gamemodes/extended/extended_clash.dm index 24b672dced7b..db5ad4babcf9 100644 --- a/code/game/gamemodes/extended/extended_clash.dm +++ b/code/game/gamemodes/extended/extended_clash.dm @@ -2,7 +2,7 @@ name = "Faction Clash" config_tag = "Faction Clash" flags_round_type = MODE_THUNDERSTORM|MODE_FACTION_CLASH - toggleable_flags = MODE_NO_SNIPER_SENTRY|MODE_NO_ATTACK_DEAD|MODE_NO_STRIPDRAG_ENEMY|MODE_STRONG_DEFIBS|MODE_BLOOD_OPTIMIZATION|MODE_NO_COMBAT_CAS|MODE_INDESTRUCTIBLE_SPLINTS|MODE_MORTAR_LASER_WARNING + starting_round_modifiers = list(/datum/gamemode_modifier/blood_optimization, /datum/gamemode_modifier/defib_past_armor, /datum/gamemode_modifier/disable_combat_cas, /datum/gamemode_modifier/disable_long_range_sentry, /datum/gamemode_modifier/disable_stripdrag_enemy, /datum/gamemode_modifier/indestructible_splints, /datum/gamemode_modifier/mortar_laser_warning) /datum/game_mode/extended/faction_clash/get_roles_list() return GLOB.ROLES_FACTION_CLASH diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index d746248034a1..e1a1a6e30dea 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -78,6 +78,7 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t spawn_static_comms() if(corpses_to_spawn) generate_corpses() + initialize_gamemode_modifiers() SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MODE_PRESETUP) return 1 diff --git a/code/game/gamemodes/round_modifiers.dm b/code/game/gamemodes/round_modifiers.dm new file mode 100644 index 000000000000..4bc8a2f362bd --- /dev/null +++ b/code/game/gamemodes/round_modifiers.dm @@ -0,0 +1,117 @@ +/// Sets and enables all applicable gamemode modifiers +/datum/game_mode/proc/initialize_gamemode_modifiers() + var/list/default_modifiers = starting_round_modifiers + + for(var/datum/gamemode_modifier/current_modifier as anything in subtypesof(/datum/gamemode_modifier)) + if(current_modifier == current_modifier::abstract_type) + continue + + var/starts_enabled = FALSE + for(var/starting_modifier in default_modifiers) + if(starting_modifier != current_modifier) + continue + starts_enabled = TRUE + default_modifiers -= starting_modifier + break + + var/datum/gamemode_modifier/modifier = new current_modifier + if(starts_enabled) + modifier.active = TRUE + round_modifiers[current_modifier] += modifier + +/// Returns the state of the modifier, using its typepath +/datum/game_mode/proc/get_gamemode_modifier(modifier_typepath) + var/datum/gamemode_modifier/modifier = round_modifiers[modifier_typepath] + if(!modifier) + CRASH("Invalid gamemode modifier, [modifier_typepath], was attempted to be checked.") + return modifier.active + +/// Sets the state of the modifier, using its typepath and the state to set it to +/datum/game_mode/proc/set_gamemode_modifier(modifier_typepath, enabled = FALSE) + var/datum/gamemode_modifier/modifier = round_modifiers[modifier_typepath] + if(!modifier) + CRASH("Invalid gamemode modifier, [modifier_typepath], was attempted to be set.") + modifier.active = enabled + return TRUE + +/datum/gamemode_modifier + var/active = FALSE + var/modifier_name + var/modifier_desc + var/datum/gamemode_modifier/abstract_type = /datum/gamemode_modifier + +/datum/gamemode_modifier/blood_optimization + modifier_name = "Blood Optimizations" + modifier_desc = "Blood dries instantly, footsteps cannot get bloodied." + +/datum/gamemode_modifier/defib_past_armor + modifier_name = "Strong Defibrillators" + modifier_desc = "Allows defibrillators to ignore armor when reviving." + +/datum/gamemode_modifier/disable_combat_cas + modifier_name = "Disable Combat CAS" + modifier_desc = "Prevents purchasing weapons or ammo in the dropship's part fabricators." + +/datum/gamemode_modifier/disable_attacking_corpses + modifier_name = "Disable Attacking Corpses" + modifier_desc = "Prevents weapons from hitting dead mobs, and blocks executions." + +/datum/gamemode_modifier/disable_ib + modifier_name = "Disable Internal Bleeding" + modifier_desc = "Prevents mobs from getting internal bleeding when injured." + +/datum/gamemode_modifier/disable_long_range_sentry + modifier_name = "Disable Long Range Sentry Upgrades" + modifier_desc = "Prevents sentries from upgrading to long range variants. Applies to DMR and Long-Range Plasma upgrades." + +/datum/gamemode_modifier/disable_ob + modifier_name = "Disable Orbital Bombardment Cannon" + modifier_desc = "Prevents the Orbital Bombardment system from firing OB warheads." + +/datum/gamemode_modifier/disable_strip_essentials + modifier_name = "Disable Stripping Hostiles Essentials" + modifier_desc = "Requires Disable Stripping Hostiles enabled. Allows factions to strip non-essentials from other factions. Essentials are ID, helmet, armor, uniform, and boots." + +/datum/gamemode_modifier/disable_stripdrag_enemy + modifier_name = "Disable Stripping Hostiles" + modifier_desc = "Prevents factions from stripping or dragging other factions. Applies to stripping, dragging, sensors, splints, and internals." + +/datum/gamemode_modifier/disable_wj_respawns + modifier_name = "Disable Working Joe Respawning" + modifier_desc = "Prevents players from joining as Working Joe multiple times in a round." + +/datum/gamemode_modifier/disposable_mobs + modifier_name = "Allow Disposing Mobs" + modifier_desc = "Allows non-crawler mobs to enter non-narrow disposals systems." + +/datum/gamemode_modifier/ignore_wj_restrictions + modifier_name = "Disable Working Joe Joining Restrictions" + modifier_desc = "Removes all restrictions on Working Joe's joining. Applies to respawn cooldown, slot cap, and administrative locks." + +/datum/gamemode_modifier/indestructible_splints + modifier_name = "Indestructible Splints" + modifier_desc = "Turns splints into nanosplints when the splint is created." + +/datum/gamemode_modifier/lz_mortar_protection + modifier_name = "Landing Zone Mortar Protection" + modifier_desc = "Prevents mortars from targetting the primary landing zone." + +/datum/gamemode_modifier/lz_roundstart_miasma + modifier_name = "Roundstart Landing Zone Miasma" + modifier_desc = "Miasma is applied to both landing zones roundstart. Does nothing if activated after miasma trigger 3 minutes into round." + +/datum/gamemode_modifier/lz_weeding + modifier_name = "Landing Zone Weeding" + modifier_desc = "Allows xenomorphs to weed all landing zones." + +/datum/gamemode_modifier/mortar_laser_warning + modifier_name = "Mortar Telegraphing" + modifier_desc = "Shows a visual warning of where a mortar will hit." + +/datum/gamemode_modifier/permadeath + modifier_name = "Human Permadeath" + modifier_desc = "Humans will permanently die without possibility of revival." + +/datum/gamemode_modifier/yautja_shipside_large_sd + modifier_name = "Yautja Shipside Large SD" + modifier_desc = "Allows Yautja to large self destruct on the mainship z-level." diff --git a/code/game/objects/effects/decals/cleanable/blood/blood.dm b/code/game/objects/effects/decals/cleanable/blood/blood.dm index e0c50e8fa6c9..440722dbb6be 100644 --- a/code/game/objects/effects/decals/cleanable/blood/blood.dm +++ b/code/game/objects/effects/decals/cleanable/blood/blood.dm @@ -31,7 +31,7 @@ basecolor = b_color update_icon() - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_BLOOD_OPTIMIZATION)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/blood_optimization)) amount = 0 return @@ -49,7 +49,7 @@ if(!amount || !ishuman(AM)) return - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_BLOOD_OPTIMIZATION)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/blood_optimization)) return var/mob/living/carbon/human/H = AM diff --git a/code/game/objects/effects/spawners/random.dm b/code/game/objects/effects/spawners/random.dm index c408ee2bd94b..0deac38469af 100644 --- a/code/game/objects/effects/spawners/random.dm +++ b/code/game/objects/effects/spawners/random.dm @@ -576,9 +576,6 @@ // OB spawners */ - -GLOBAL_VAR_INIT(spawn_ob, TRUE) - /obj/effect/spawner/random/warhead name = "random orbital warhead" desc = "This is a random orbital warhead." @@ -588,9 +585,6 @@ GLOBAL_VAR_INIT(spawn_ob, TRUE) spawn_on_roundstart = TRUE /obj/effect/spawner/random/warhead/item_to_spawn() - if(!GLOB.spawn_ob) - return /obj/item/paper/warhead_recycle - var/list/spawnables = list( /obj/structure/ob_ammo/warhead/explosive, /obj/structure/ob_ammo/warhead/incendiary, diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 04b4f82dafd0..883819dfdbfd 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -30,7 +30,7 @@ if(SEND_SIGNAL(user, COMSIG_BINOCULAR_ATTACK_SELF, src)) return - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_SNIPER_SENTRY)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_long_range_sentry)) zoom(user, hvh_tile_offset, hvh_zoom_viewsize) else zoom(user, tile_offset, viewsize) diff --git a/code/game/objects/items/devices/defibrillator.dm b/code/game/objects/items/devices/defibrillator.dm index a9b26e018e47..aa4affa7b0f8 100644 --- a/code/game/objects/items/devices/defibrillator.dm +++ b/code/game/objects/items/devices/defibrillator.dm @@ -99,7 +99,7 @@ currentuses = floor(dcell.charge / charge_cost) if(maxuses != 1) . += SPAN_INFO("It has [currentuses] out of [maxuses] uses left in its internal battery.") - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_STRONG_DEFIBS) || !blocked_by_suit && !istype(src, /obj/item/device/defibrillator/synthetic)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/defib_past_armor) || !blocked_by_suit && !istype(src, /obj/item/device/defibrillator/synthetic)) . += SPAN_NOTICE("This defibrillator will ignore worn armor.") /obj/item/device/defibrillator/attack_self(mob/living/carbon/human/user) @@ -172,7 +172,7 @@ user.visible_message(SPAN_WARNING("[icon2html(src, viewers(src))] \The [src] buzzes: Patient's general condition does not allow reviving.")) return - if((!MODE_HAS_TOGGLEABLE_FLAG(MODE_STRONG_DEFIBS) && blocked_by_suit) && H.wear_suit && (istype(H.wear_suit, /obj/item/clothing/suit/armor) || istype(H.wear_suit, /obj/item/clothing/suit/storage/marine)) && prob(95)) + if((!MODE_HAS_MODIFIER(/datum/gamemode_modifier/defib_past_armor) && blocked_by_suit) && H.wear_suit && (istype(H.wear_suit, /obj/item/clothing/suit/armor) || istype(H.wear_suit, /obj/item/clothing/suit/storage/marine)) && prob(95)) user.visible_message(SPAN_WARNING("[icon2html(src, viewers(src))] \The [src] buzzes: Paddles registering >100,000 ohms, Possible cause: Suit or Armor interfering.")) return diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index d7c29319592f..7beec12ebd6a 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -278,7 +278,7 @@ /obj/item/stack/medical/splint/Initialize(mapload, amount) . = ..() - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_INDESTRUCTIBLE_SPLINTS)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/indestructible_splints)) icon_state = "nanosplint" indestructible_splints = TRUE update_icon() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index e2096bcdac7b..b0e803cc4284 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -48,7 +48,6 @@ GLOBAL_LIST_INIT(admin_verbs_default, list( /client/proc/hide_admin_verbs, /client/proc/vehicle_panel, /client/proc/in_view_panel, /*allows application of aheal/sleep in an AOE*/ - /client/proc/toggle_lz_resin, /client/proc/strip_all_in_view, /client/proc/rejuvenate_all_in_view, /client/proc/rejuvenate_all_humans_in_view, @@ -57,7 +56,6 @@ GLOBAL_LIST_INIT(admin_verbs_default, list( /datum/admins/proc/togglesleep, /datum/admins/proc/sleepall, /datum/admins/proc/wakeall, - /client/proc/toggle_lz_protection, /client/proc/jump_to_object, /client/proc/jumptomob, /client/proc/toggle_own_ghost_vis, @@ -124,31 +122,17 @@ GLOBAL_LIST_INIT(admin_verbs_minor_event, list( /client/proc/cmd_admin_object_narrate, /client/proc/cmd_admin_create_centcom_report, //Messages from USCM command/other factions. /client/proc/cmd_admin_create_predator_report, //Predator ship AI report - /client/proc/toggle_ob_spawn, - /client/proc/toggle_sniper_upgrade, - /client/proc/toggle_attack_dead, - /client/proc/toggle_strip_drag, - /client/proc/toggle_disposal_mobs, - /client/proc/toggle_uniform_strip, - /client/proc/toggle_strong_defibs, - /client/proc/toggle_blood_optimization, - /client/proc/toggle_combat_cas, - /client/proc/toggle_lz_protection, //Mortar hitting LZ /client/proc/cmd_admin_medals_panel, // Marine and Xeno medals editor panel /client/proc/force_event, /client/proc/toggle_events, - /client/proc/toggle_shipside_sd, /client/proc/shakeshipverb, /client/proc/adminpanelweapons, /client/proc/admin_general_quarters, /client/proc/admin_biohazard_alert, /client/proc/admin_aicore_alert, - /client/proc/toggle_hardcore_perma, - /client/proc/toggle_bypass_joe_restriction, - /client/proc/toggle_joe_respawns, - /client/proc/toggle_lz_hazards, /datum/admins/proc/open_shuttlepanel, /client/proc/get_whitelisted_clients, + /client/proc/modifiers_panel, )) GLOBAL_LIST_INIT(admin_verbs_major_event, list( @@ -317,10 +301,6 @@ GLOBAL_LIST_INIT(admin_verbs_teleport, list( /client/proc/toggle_noclip )) -GLOBAL_LIST_INIT(roundstart_mod_verbs, list( - /client/proc/toggle_ob_spawn -)) - GLOBAL_LIST_INIT(mentor_verbs, list( /client/proc/cmd_mentor_say, /datum/admins/proc/imaginary_friend, diff --git a/code/modules/admin/gamemode_modifiers_panel.dm b/code/modules/admin/gamemode_modifiers_panel.dm new file mode 100644 index 000000000000..7b34ba139ce1 --- /dev/null +++ b/code/modules/admin/gamemode_modifiers_panel.dm @@ -0,0 +1,71 @@ +/client + var/datum/modifiers_panel/modifiers_panel + +/client/proc/modifiers_panel() + set name = "Modifiers Panel" + set category = "Admin.Panels" + + if(!SSticker.mode) + to_chat(mob, SPAN_WARNING("The round has not started yet.")) + return + + if(modifiers_panel) + qdel(modifiers_panel) + modifiers_panel = new + modifiers_panel.tgui_interact(mob) + +/datum/modifiers_panel + var/target_modifier + var/new_state + +/datum/modifiers_panel/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "ModifiersPanel", "Modifiers Panel") + ui.open() + +/datum/modifiers_panel/ui_state(mob/user) + return GLOB.admin_state + +/datum/modifiers_panel/ui_close(mob/user) + . = ..() + if(user?.client.modifiers_panel) + qdel(user.client.modifiers_panel) + +/datum/modifiers_panel/ui_data(mob/user) + var/list/data = list() + data["target_modifier"] = target_modifier + data["new_state"] = new_state + return data + +/datum/modifiers_panel/ui_static_data(mob/user) + var/list/data = list() + var/list/modifiers = list() + var/list/round_modifiers = SSticker.mode.round_modifiers + for(var/modifier_type in round_modifiers) + var/datum/gamemode_modifier/modifier = round_modifiers[modifier_type] + var/list/modifier_info = list() + modifier_info["path"] = modifier_type + modifier_info["name"] = modifier.modifier_name + modifier_info["desc"] = modifier.modifier_desc + modifier_info["state"] = modifier.active + modifiers += list(modifier_info) + + data["all_modifiers"] = modifiers + return data + + +/datum/modifiers_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return FALSE + var/mob/user = ui.user + if(!CLIENT_HAS_RIGHTS(user.client, R_MOD)) + return FALSE + + if(action != "set_modifier_state") + return FALSE + to_chat(user, SPAN_NOTICE("You have [params["state"] ? "enabled" : "disabled" ] [params["name"]] modifier.")) + message_admins("[key_name_admin(user)] has [params["state"] ? "enabled" : "disabled" ] [params["name"]] modifier.") + MODE_SET_MODIFIER(text2path(params["path"]), params["state"]) + update_static_data(user, ui) diff --git a/code/modules/admin/tabs/admin_tab.dm b/code/modules/admin/tabs/admin_tab.dm index ecc1471b69a3..a1eb9bf2f93a 100644 --- a/code/modules/admin/tabs/admin_tab.dm +++ b/code/modules/admin/tabs/admin_tab.dm @@ -664,248 +664,3 @@ return admin_holder.in_view_panel() - -/client/proc/toggle_lz_resin() - set name = "Toggle LZ Weeding" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - set_lz_resin_allowed(!GLOB.resin_lz_allowed) - message_admins("[src] has [GLOB.resin_lz_allowed ? "allowed xenos to weed" : "disallowed from weeding"] near the LZ.") - -/proc/set_lz_resin_allowed(allowed = TRUE) - if(allowed) - for(var/area/A in GLOB.all_areas) - if(A.flags_area & AREA_UNWEEDABLE) - continue - A.is_resin_allowed = TRUE - msg_admin_niche("Areas close to landing zones are now weedable.") - else - for(var/area/A in GLOB.all_areas) - if(A.flags_area & AREA_UNWEEDABLE) - continue - A.is_resin_allowed = initial(A.is_resin_allowed) - msg_admin_niche("Areas close to landing zones cannot be weeded now.") - GLOB.resin_lz_allowed = allowed - -/client/proc/toggle_ob_spawn() // not really a flag but i'm cheating here - set name = "Toggle OB Spawn" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - GLOB.spawn_ob = !GLOB.spawn_ob - message_admins("[src] has [GLOB.spawn_ob ? "allowed OBs to spawn" : "prevented OBs from spawning"] at roundstart.") - -/client/proc/toggle_sniper_upgrade() - set name = "Toggle Engi Sniper Upgrade" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_NO_SNIPER_SENTRY - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_SNIPER_SENTRY) ? "disallowed engineers from picking" : "allowed engineers to pick"] long-range sentry upgrades.") - -/client/proc/toggle_attack_dead() - set name = "Toggle Attack Dead" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_NO_ATTACK_DEAD - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_ATTACK_DEAD) ? "prevented dead mobs from being" : "allowed dead mobs to be"] attacked.") - -/client/proc/toggle_disposal_mobs() - set name = "Toggle Disposable Mobs" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_EVENT, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_DISPOSABLE_MOBS - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_DISPOSABLE_MOBS) ? "allowed mobs to fit" : "prevented mobs fitting"] inside disposals.") - -/client/proc/toggle_strip_drag() - set name = "Toggle Strip/Drag Dead" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_NO_STRIPDRAG_ENEMY - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) ? "prevented dead humans from being" : "allowed dead humans to be"] stripped and dragged around by non-matching IFF players.") - -/client/proc/toggle_uniform_strip() - set name = "Toggle Uniform Strip Dead" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_STRIP_NONUNIFORM_ENEMY - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_STRIP_NONUNIFORM_ENEMY) ? "allowed dead humans to be stripped of everything but their uniform, boots, armor, helmet, and ID" : "prevented dead humans from being stripped of anything"].") - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY)) - message_admins("WARNING: Dead enemy players can still be stripped of everything, as the Strip/Drag toggle flag isn't active.") - -/client/proc/toggle_strong_defibs() - set name = "Toggle Strong Defibs" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_STRONG_DEFIBS - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_STRONG_DEFIBS) ? "allowed defibs to ignore armor" : "made defibs operate normally"].") - -/client/proc/toggle_blood_optimization() - set name = "Toggle Blood Optimization" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_BLOOD_OPTIMIZATION - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_BLOOD_OPTIMIZATION) ? "toggled blood optimization on" : "toggled blood optimization off"].") - -/client/proc/toggle_combat_cas() - set name = "Toggle Combat CAS Equipment" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_NO_COMBAT_CAS - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_COMBAT_CAS) ? "toggled combat CAS off" : "toggled combat CAS on"].") - -/client/proc/toggle_lz_protection() - set name = "Toggle LZ Mortar Protection" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_LZ_PROTECTION - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_PROTECTION) ? "toggled LZ protection on, mortars can no longer fire there" : "toggled LZ protection off, mortars can now fire there"].") - -/client/proc/toggle_shipside_sd() - set name = "Toggle Shipside SD Protection" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_SHIPSIDE_SD - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_SHIPSIDE_SD) ? "toggled SD protection off, Yautja can now big self destruct anywhere" : "toggled SD protection on, Yautja can now only big self destruct on the hunting grounds"].") - -/client/proc/toggle_hardcore_perma() - set name = "Toggle Hardcore" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_MOD, FALSE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_HARDCORE_PERMA) && tgui_alert(usr, "Are you sure you want to toggle Hardcore mode on? This will cause all humans to instantly go perma on death.", "Confirmation", list("Yes", "Cancel")) != "Yes") - return - - SSticker.mode.toggleable_flags ^= MODE_HARDCORE_PERMA - message_admins("[src] has toggled Hardcore [MODE_HAS_TOGGLEABLE_FLAG(MODE_HARDCORE_PERMA) ? "on, causing all humans to instantly go perma on death" : "off, causing all humans to die like normal"].") - -/client/proc/toggle_bypass_joe_restriction() - set name = "Toggle Working Joe Restrictions" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_EVENT, TRUE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_BYPASS_JOE - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_BYPASS_JOE) ? "allowed players to bypass (except whitelist)" : "prevented players from bypassing"] Working Joe spawn conditions.") - -/client/proc/toggle_joe_respawns() - set name = "Toggle Working Joe Respawns" - set category = "Admin.Flags" - - if(!admin_holder || !check_rights(R_EVENT, TRUE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - SSticker.mode.toggleable_flags ^= MODE_DISABLE_JOE_RESPAWN - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_DISABLE_JOE_RESPAWN) ? "disabled" : "enabled"] Working Joe respawns.") - -/client/proc/toggle_lz_hazards() - set name = "Toggle LZ Hazards" - set category = "Admin.Flags" - set desc = "Distress Signal: Whether miasma smoke is spawned 3 minutes after the start of the round." - - if(!admin_holder || !check_rights(R_EVENT, TRUE)) - return - - if(!SSticker.mode) - to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!")) - return - - if(!istype(SSticker.mode, /datum/game_mode/colonialmarines)) - to_chat(usr, SPAN_WARNING("LZ hazards are only applicable to distress signal!")) - return - - if(ROUND_TIME > LZ_HAZARD_START) - to_chat(usr, SPAN_WARNING("Its too late to toggle this!")) - return - - SSticker.mode.toggleable_flags ^= MODE_LZ_HAZARD_ACTIVATED - message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_HAZARD_ACTIVATED) ? "enabled" : "disabled"] LZ hazards.") diff --git a/code/modules/cm_marines/equipment/mortar/mortars.dm b/code/modules/cm_marines/equipment/mortar/mortars.dm index e973517be9b1..b0437718aea6 100644 --- a/code/modules/cm_marines/equipment/mortar/mortars.dm +++ b/code/modules/cm_marines/equipment/mortar/mortars.dm @@ -243,7 +243,7 @@ if(CEILING_IS_PROTECTED(target_area.ceiling, CEILING_PROTECTION_TIER_2) || protected_by_pylon(TURF_PROTECTION_MORTAR, target_turf)) to_chat(user, SPAN_WARNING("You cannot hit the target. It is probably underground.")) return - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_PROTECTION) && target_area.is_landing_zone) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/lz_mortar_protection) && target_area.is_landing_zone) to_chat(user, SPAN_WARNING("You cannot bomb the landing zone!")) return @@ -365,7 +365,7 @@ SPAN_HIGHDANGER("A SHELL IS ABOUT TO IMPACT [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_VISIBLE, \ SPAN_HIGHDANGER("YOU HEAR SOMETHING VERY CLOSE COMING DOWN [SPAN_UNDERLINE(relative_dir ? uppertext(("TO YOUR " + dir2text(relative_dir))) : uppertext("right above you"))]!"), SHOW_MESSAGE_AUDIBLE \ ) - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_MORTAR_LASER_WARNING)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/mortar_laser_warning)) new /obj/effect/overlay/temp/blinking_laser(target) sleep(2 SECONDS) // Wait out the rest of the landing time target.ceiling_debris_check(2) diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index f283b3496d8e..f92def3e1be2 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -757,6 +757,10 @@ if(!user) return + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_ob)) + to_chat(user, "[icon2html(src, user)] [SPAN_WARNING("A remote lock has been placed on the orbital cannon.")]") + return + if(busy) to_chat(user, "[icon2html(src, user)] [SPAN_WARNING("The [name] is busy processing another action!")]") return diff --git a/code/modules/cm_marines/vehicle_part_fabricator.dm b/code/modules/cm_marines/vehicle_part_fabricator.dm index 8049bcb411fd..4375ec006ef2 100644 --- a/code/modules/cm_marines/vehicle_part_fabricator.dm +++ b/code/modules/cm_marines/vehicle_part_fabricator.dm @@ -149,7 +149,7 @@ continue produce_list += produce var/obj/structure/dropship_equipment/produce = produce_list[index] - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_COMBAT_CAS) && produce.combat_equipment) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_combat_cas) && produce.combat_equipment) log_admin("Bad topic: [user] may be trying to HREF exploit [src] to bypass no combat cas") return cost = initial(produce.point_cost) @@ -166,7 +166,7 @@ continue produce_list += produce var/obj/structure/dropship_equipment/produce = produce_list[index] - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_COMBAT_CAS) && produce.combat_equipment) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_combat_cas) && produce.combat_equipment) log_admin("Bad topic: [user] may be trying to HREF exploit [src] to bypass no combat cas") return cost = initial(produce.point_cost) @@ -251,7 +251,7 @@ if(faction != dropship_equipment_data.faction_exclusive) continue - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_COMBAT_CAS) && dropship_equipment_data.combat_equipment) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_combat_cas) && dropship_equipment_data.combat_equipment) index += 1 continue var/build_name = initial(dropship_equipment_data.name) @@ -275,7 +275,7 @@ if(ship_ammo_data.faction_exclusive) if(faction != ship_ammo_data.faction_exclusive) continue - if(SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_COMBAT_CAS) && ship_ammo_data.combat_equipment) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_combat_cas) && ship_ammo_data.combat_equipment) index = index + 1 continue var/build_name = initial(ship_ammo_data.name) diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index b5020894be5f..770372ba3eba 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -875,7 +875,7 @@ exploding = 1 var/turf/T = get_turf(src) - if(explosion_type == SD_TYPE_BIG && (is_ground_level(T.z) || MODE_HAS_TOGGLEABLE_FLAG(MODE_SHIPSIDE_SD))) + if(explosion_type == SD_TYPE_BIG && (is_ground_level(T.z) || MODE_HAS_MODIFIER(/datum/gamemode_modifier/yautja_shipside_large_sd))) playsound(src, 'sound/voice/pred_deathlaugh.ogg', 100, 0, 17, status = 0) playsound(src, 'sound/effects/pred_countdown.ogg', 100, 0, 17, status = 0) @@ -889,7 +889,7 @@ victim.gib() // kills the pred qdel(victim) var/datum/cause_data/cause_data = create_cause_data("yautja self-destruct", victim) - if(explosion_type == SD_TYPE_BIG && (is_ground_level(T.z) || MODE_HAS_TOGGLEABLE_FLAG(MODE_SHIPSIDE_SD))) + if(explosion_type == SD_TYPE_BIG && (is_ground_level(T.z) || MODE_HAS_MODIFIER(/datum/gamemode_modifier/yautja_shipside_large_sd))) cell_explosion(T, 600, 50, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //Dramatically BIG explosion. else cell_explosion(T, 800, 550, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) diff --git a/code/modules/defenses/handheld.dm b/code/modules/defenses/handheld.dm index 1482a08e90db..8b36514a88de 100644 --- a/code/modules/defenses/handheld.dm +++ b/code/modules/defenses/handheld.dm @@ -110,7 +110,7 @@ /obj/item/defenses/handheld/sentry/get_upgrade_list() . = list() - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_SNIPER_SENTRY)) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_long_range_sentry)) . += list("DMR Upgrade" = image(icon = 'icons/obj/structures/machinery/defenses/sentry.dmi', icon_state = "DMR uac_sentry_handheld")) . += list( "Shotgun Upgrade" = image(icon = 'icons/obj/structures/machinery/defenses/sentry.dmi', icon_state = "Shotgun uac_sentry_handheld"), @@ -198,7 +198,7 @@ /obj/item/defenses/handheld/sentry/flamer/get_upgrade_list() . = list() - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_SNIPER_SENTRY)) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_long_range_sentry)) . += list("Long-Range Plasma Upgrade" = image(icon = 'icons/obj/structures/machinery/defenses/flamer.dmi', icon_state = "Plasma uac_flamer_handheld")) . += list( "Mini-Flamer Upgrade" = image(icon = 'icons/obj/structures/machinery/defenses/flamer.dmi', icon_state = "Mini uac_flamer_handheld") diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 1b9e3fa1a3aa..795de20367d2 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -1,6 +1,6 @@ /mob/living/carbon/human/gib(datum/cause_data/cause = create_cause_data("gibbing", src)) var/is_a_synth = issynth(src) - ghostize() + ghostize() for(var/obj/limb/E in limbs) if(istype(E, /obj/limb/chest)) continue @@ -49,7 +49,7 @@ GLOB.alive_human_list -= src if(!gibbed) - if(HAS_TRAIT(src, TRAIT_HARDCORE) || MODE_HAS_TOGGLEABLE_FLAG(MODE_HARDCORE_PERMA)) + if(HAS_TRAIT(src, TRAIT_HARDCORE) || MODE_HAS_MODIFIER(/datum/gamemode_modifier/permadeath)) if(!(species.flags & IS_SYNTHETIC)) // Synths wont perma status_flags |= PERMANENTLY_DEAD if(HAS_TRAIT(src, TRAIT_INTENT_EYES)) //their eyes need to be 'offline' diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0b95e15b4482..ecb35b363734 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -398,7 +398,7 @@ if(href_list["item"]) if(!usr.is_mob_incapacitated() && Adjacent(usr)) if(href_list["item"] == "id") - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) to_chat(usr, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(istype(wear_id, /obj/item/card/id/dogtag) && (undefibbable || !skillcheck(usr, SKILL_POLICE, SKILL_POLICE_SKILLED))) @@ -423,8 +423,8 @@ if(!usr.action_busy || skillcheck(usr, SKILL_POLICE, SKILL_POLICE_SKILLED)) var/slot = href_list["item"] var/obj/item/what = get_item_by_slot(slot) - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) - if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_STRIP_NONUNIFORM_ENEMY) || (what in list(head, wear_suit, w_uniform, shoes))) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_strip_essentials) || (what in list(head, wear_suit, w_uniform, shoes))) to_chat(usr, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(what) @@ -435,7 +435,7 @@ if(href_list["sensor"]) if(!usr.action_busy && !usr.is_mob_incapacitated() && Adjacent(usr)) - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(usr.faction_group)) to_chat(usr, SPAN_WARNING("You can't tweak the sensors of a crit or dead member of another faction!")) return attack_log += text("\[[time_stamp()]\] Has had their sensors toggled by [key_name(usr)]") @@ -1767,7 +1767,7 @@ /// generates realistic-ish pulse output based on preset levels. /// method == GETPULSE_HAND is for hands, GETPULSE_TOOL is for machines, more accurate -/mob/living/carbon/human/proc/get_pulse(method) +/mob/living/carbon/human/proc/get_pulse(method) var/temp = 0 //see setup.dm:694 if(species && species.flags & NO_BLOOD) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 337efc05a76d..e0925dc55e13 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -419,7 +419,7 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M ignores_stripdrag_flag = H.species.ignores_stripdrag_flag - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(M.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && !ignores_stripdrag_flag && (stat == DEAD || health < HEALTH_THRESHOLD_CRIT) && !get_target_lock(M.faction_group)) to_chat(M, SPAN_WARNING("You can't pull a crit or dead member of another faction!")) return FALSE return TRUE diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 9fc916fc4288..e55f0cb3f33c 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -58,7 +58,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcehuman = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcehuman.stat == DEAD || sourcehuman.health < HEALTH_THRESHOLD_CRIT) && !sourcehuman.get_target_lock(user.faction_group)) to_chat(user, SPAN_WARNING("You can't toggle internals of a crit or dead member of another faction!")) return @@ -122,7 +122,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) to_chat(user, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(!sourcemob.w_uniform || !istype(sourcemob.w_uniform, /obj/item/clothing)) @@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) to_chat(user, SPAN_WARNING("You can't remove splints of a crit or dead member of another faction!")) return sourcemob.attack_log += text("\[[time_stamp()]\] Has had their splints removed by [key_name(user)]") @@ -219,7 +219,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/sourcemob = source if(user.action_busy || user.is_mob_incapacitated() || !source.Adjacent(user)) return - if(MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_STRIPDRAG_ENEMY) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) + if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy) && (sourcemob.stat == DEAD || sourcemob.health < HEALTH_THRESHOLD_CRIT) && !sourcemob.get_target_lock(user.faction_group)) to_chat(user, SPAN_WARNING("You can't strip a crit or dead member of another faction!")) return if(!istype(sourcemob.wear_id, /obj/item/card/id/dogtag)) diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index 41345aef0597..345e1b8552b3 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -779,8 +779,8 @@ message = "We have wrested away remote control of the metal crawler! Rejoice!" else message = "We have wrested away remote control of the metal bird! Rejoice!" - if(!GLOB.resin_lz_allowed) - set_lz_resin_allowed(TRUE) + if(!MODE_HAS_MODIFIER(/datum/gamemode_modifier/lz_weeding)) + MODE_SET_MODIFIER(/datum/gamemode_modifier/lz_weeding, TRUE) to_chat(M, SPAN_XENONOTICE("We interact with the machine and disable remote control.")) xeno_message(SPAN_XENOANNOUNCE("[message]"),3,M.hivenumber) diff --git a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm index 29ef996b6e87..ba2f6f3fe0d8 100644 --- a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm +++ b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm @@ -1,5 +1,3 @@ -GLOBAL_VAR_INIT(resin_lz_allowed, FALSE) - /datum/resin_construction var/name var/desc diff --git a/code/modules/organs/limbs.dm b/code/modules/organs/limbs.dm index 8e9a755a2ea0..5839dae7d30b 100644 --- a/code/modules/organs/limbs.dm +++ b/code/modules/organs/limbs.dm @@ -539,7 +539,7 @@ This function completely restores a damaged organ to perfect condition. if(internal && !can_bleed_internally) internal = FALSE - if(internal && SSticker.mode && MODE_HAS_TOGGLEABLE_FLAG(MODE_NO_INTERNAL_BLEEDING)) + if(internal && MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_ib)) internal = FALSE diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index cc935b1f1b4a..5260f8f00231 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -504,10 +504,6 @@ name = "DJ Listening Outpost" info = "Welcome new owner!

You have purchased the latest in listening equipment. The telecommunication setup we created is the best in listening to common and private radio fequencies. Here is a step by step guide to start listening in on those saucy radio channels:
  1. Equip yourself with a multi-tool
  2. Use the multitool on each machine, that is the broadcaster, receiver and the relay.
  3. Turn all the machines on, it has already been configured for you to listen on.
Simple as that. Now to listen to the private channels, you'll have to configure the intercoms, located on the front desk. Here is a list of frequencies for you to listen on.