From 7df9a07ddab49be346544240d3a2e03eeffb0131 Mon Sep 17 00:00:00 2001 From: oranges Date: Wed, 19 Jun 2024 09:18:09 +1200 Subject: [PATCH 01/36] Revert "remove human requirement for invisible_wall" (#84096) Reverts tgstation/tgstation#83751 The person who added this has been abusing the shit out of it relentlessly, so they fail the vibe check. --- code/modules/spells/spell_types/conjure/invisible_wall.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/spells/spell_types/conjure/invisible_wall.dm b/code/modules/spells/spell_types/conjure/invisible_wall.dm index d2812912f0fc2..a61db7cf74e19 100644 --- a/code/modules/spells/spell_types/conjure/invisible_wall.dm +++ b/code/modules/spells/spell_types/conjure/invisible_wall.dm @@ -15,7 +15,7 @@ invocation_self_message = span_notice("You form a wall in front of yourself.") invocation_type = INVOCATION_EMOTE - spell_requirements = SPELL_REQUIRES_MIME_VOW + spell_requirements = SPELL_REQUIRES_HUMAN|SPELL_REQUIRES_MIME_VOW antimagic_flags = NONE spell_max_level = 1 From 48acfd680f0a592971ef825bd83083d4791c0524 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:14:13 -0500 Subject: [PATCH 02/36] Fix ambience pref not being toggleable in game (#84087) ## About The Pull Request The only time people were added to the ambience SS's list is when you log in, meaning if you toggle the preference on/off mid game, it does nothing. Fixes #61495 ## Changelog :cl: Melbert fix: Enabling or disabling ambience mid round will properly enable or disable ambience qol: Added descriptions differentiating "Ship ambience" from "ambience" /:cl: --- code/datums/mocking/client.dm | 3 +++ code/modules/client/preferences/sounds.dm | 3 +++ .../preferences/features/game_preferences/sounds.tsx | 2 ++ 3 files changed, 8 insertions(+) diff --git a/code/datums/mocking/client.dm b/code/datums/mocking/client.dm index dc1db213f34be..4b724ef705e82 100644 --- a/code/datums/mocking/client.dm +++ b/code/datums/mocking/client.dm @@ -48,3 +48,6 @@ /datum/client_interface/proc/set_macros() return + +/datum/client_interface/proc/update_ambience_pref() + return diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index f56430b53638a..3ace1b64326cc 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -4,6 +4,9 @@ savefile_key = "sound_ambience" savefile_identifier = PREFERENCE_PLAYER +/datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) + client.update_ambience_pref() + /// Controls hearing announcement sounds /datum/preference/toggle/sound_announcements category = PREFERENCE_CATEGORY_GAME_PREFERENCES diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx index 8516823a5587f..3f1c50c16f9f1 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx @@ -10,6 +10,7 @@ import { FeatureDropdownInput } from '../dropdowns'; export const sound_ambience: FeatureToggle = { name: 'Enable ambience', category: 'SOUND', + description: `Ambience refers to the more noticeable ambient sounds that play on occasion.`, component: CheckboxInput, }; @@ -81,6 +82,7 @@ export const sound_midi: FeatureToggle = { export const sound_ship_ambience: FeatureToggle = { name: 'Enable ship ambience', category: 'SOUND', + description: `Ship ambience refers to the low ambient buzz that plays on loop.`, component: CheckboxInput, }; From 751bf0bc9baf6f3da8ac4290b39ae62a4cbc98c2 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:15:07 +1200 Subject: [PATCH 03/36] Automatic changelog for PR #84087 [ci skip] --- html/changelogs/AutoChangeLog-pr-84087.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-84087.yml diff --git a/html/changelogs/AutoChangeLog-pr-84087.yml b/html/changelogs/AutoChangeLog-pr-84087.yml new file mode 100644 index 0000000000000..09cfa195999e8 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-84087.yml @@ -0,0 +1,5 @@ +author: "Melbert" +delete-after: True +changes: + - bugfix: "Enabling or disabling ambience mid round will properly enable or disable ambience" + - qol: "Added descriptions differentiating \"Ship ambience\" from \"ambience\"" \ No newline at end of file From d5ab01b3da8d703b554cfccb10d3b4a1f47f2402 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:15:37 -0500 Subject: [PATCH 04/36] Hand Tele Fix (#84078) ## About The Pull Request Fixes #84077 Self explanatory ## Changelog :cl: Melbert fix: Fixed hand tele portals being forever /:cl: --- code/game/objects/effects/portals.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index a7aabee6f4d2a..255f34eff51dd 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -101,7 +101,7 @@ . = INITIALIZE_HINT_QDEL CRASH("Somebody fucked up.") if(_lifespan > 0) - addtimer(src, PROC_REF(expire), _lifespan, TIMER_DELETE_ME) + addtimer(CALLBACK(src, PROC_REF(expire)), _lifespan, TIMER_DELETE_ME) link_portal(_linked) hardlinked = automatic_link if(isturf(hard_target_override)) From 4a75fa7dfde1a550a5e21daf1c1e1cad8c124547 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:16:14 +1200 Subject: [PATCH 05/36] Automatic changelog for PR #84078 [ci skip] --- html/changelogs/AutoChangeLog-pr-84078.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-84078.yml diff --git a/html/changelogs/AutoChangeLog-pr-84078.yml b/html/changelogs/AutoChangeLog-pr-84078.yml new file mode 100644 index 0000000000000..03f520a71d41b --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-84078.yml @@ -0,0 +1,4 @@ +author: "Melbert" +delete-after: True +changes: + - bugfix: "Fixed hand tele portals being forever" \ No newline at end of file From 0af50d0ca857b19c0632f8b0563588f2e9d6e25c Mon Sep 17 00:00:00 2001 From: Joshua Kidder <49173900+Metekillot@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:17:07 -0400 Subject: [PATCH 06/36] Activating a lighter or match while covered in flammable liquids now ignites you, even if you're really, really, really ridiculously good looking (#84085) ## About The Pull Request This pull request adds a couple of lines to the code for matches and lighters that has it check to see if its location (which would also be its user) is a living mob with flammable liquid on them. If so, they get lit on fire. ## Why It's Good For The Game It adds a goofy interaction for people unfortunate enough to get splashed with flammable liquid. Beyond a possible way of making a half-assed attempt to assassinate a smoker, it's also a good safety lesson. Just look at these poor young men below... https://github.com/tgstation/tgstation/assets/49173900/f073f71f-6b37-46ce-8ea3-eb30ec2378a1 ## Changelog :cl: Bisar add: The Nanotrasen safety commission reminds employees to properly clean themselves of all flammable material before going on smoke breaks. /:cl: --- code/game/objects/items/cigs_lighters.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 6ca951d262a67..be5d0b8ec2b1c 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -55,6 +55,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM desc = "A [initial(name)]. This one is lit." attack_verb_continuous = string_list(list("burns", "singes")) attack_verb_simple = string_list(list("burn", "singe")) + if(isliving(loc)) + var/mob/living/male_model = loc + if(male_model.fire_stacks && !(male_model.on_fire)) + male_model.ignite_mob() START_PROCESSING(SSobj, src) update_appearance() @@ -876,6 +880,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM attack_verb_continuous = string_list(list("burns", "singes")) attack_verb_simple = string_list(list("burn", "singe")) START_PROCESSING(SSobj, src) + if(isliving(loc)) + var/mob/living/male_model = loc + if(male_model.fire_stacks && !(male_model.on_fire)) + male_model.ignite_mob() else hitsound = SFX_SWING_HIT force = 0 From 4eb696095172bf4f1d457153384c7b15afe8c363 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:18:40 +1200 Subject: [PATCH 07/36] Automatic changelog for PR #84085 [ci skip] --- html/changelogs/AutoChangeLog-pr-84085.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-84085.yml diff --git a/html/changelogs/AutoChangeLog-pr-84085.yml b/html/changelogs/AutoChangeLog-pr-84085.yml new file mode 100644 index 0000000000000..995c311e4ef3f --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-84085.yml @@ -0,0 +1,4 @@ +author: "Bisar" +delete-after: True +changes: + - rscadd: "The Nanotrasen safety commission reminds employees to properly clean themselves of all flammable material before going on smoke breaks." \ No newline at end of file From e8157f4dfc2da8a6b92b935eff191c478846f2d1 Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Wed, 19 Jun 2024 01:15:27 +0100 Subject: [PATCH 08/36] Items in your hands can catch fire (#83867) ## About The Pull Request Recently we allowed items held in your hands to catch fire if you catch fire. This makes sense but the code had a few oversights, then we reverted it. This PR reintroduces the feature, but with a few refinements. The basic feature is simple: If you are on fire then items you are holding will also catch fire, in the same vein as items you are wearing on your head or hands. There are also a few caveats we forgot about the first time we added this: - If your gloves cannot catch fire, your held items will not catch fire (because your hands aren't on fire). - If you are extinguished, your held items will also be extinguished. - Stopping, Dropping, and Rolling on top of any items will also extinguish those items. As part of this change, after an argument about whether or not this is an oversight in coding-general, I've made the proc `get_equipped_items` take a bitflag instead of a series of booleans as an argument and added a new one for "include held items", so that we need no longer argue about whether holding something counts as "equipping" it (in all other parts of the game than this proc, it does). This is what gives the PR most of its code footprint, don't be scared. ## Why It's Good For The Game Items you are holding in your hands _should_ catch fire if everything else on your person is on fire, and taking an item off of your body to put it in your hands shouldn't protect it from fire, because those things don't make intuitive sense. If we want an item to be able to catch fire when worn, then it should do so. This might expose some issues where we were improperly setting the flammability flags on items, but any weapon which will burn in your hands now would also have burned if you were wearing it on your belt or back, so making those issues more visible should be a bonus (we'll also stop them from burning on your back or belt). If you see someone holding a piece of paper that you really don't want them to read you can now set them on fire to stop them from reading it, whereas previously they would deftly hold the very flammable object out of reach of their flaming body. ## Changelog :cl: balance: Items held in your hands can catch fire. balance: Items you are holding won't catch fire if your hands cannot catch fire. balance: When you stop being on fire so will items you are holding. balance: If you roll around on your burning items they will stop being on fire. /:cl: --- code/__DEFINES/obj_flags.dm | 5 ++++ code/datums/diseases/transformation.dm | 2 +- code/datums/elements/skill_reward.dm | 2 +- .../status_effects/buffs/stop_drop_roll.dm | 3 +++ .../status_effects/debuffs/fire_stacks.dm | 2 +- code/game/objects/items/tanks/tanks.dm | 2 +- code/modules/admin/verbs/ert.dm | 2 +- code/modules/admin/verbs/selectequipment.dm | 3 ++- code/modules/antagonists/obsessed/obsessed.dm | 2 +- code/modules/bitrunning/server/util.dm | 2 +- code/modules/buildmode/submodes/outfit.dm | 4 ++-- code/modules/clothing/outfits/standard.dm | 2 +- code/modules/mafia/outfits.dm | 2 +- code/modules/mob/inventory.dm | 23 +++++++++---------- .../mob/living/carbon/human/_species.dm | 2 +- code/modules/mob/living/carbon/human/dummy.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 6 ++++- .../mob/living/carbon/human/inventory.dm | 2 +- code/modules/mob/living/ventcrawling.dm | 2 +- code/modules/mob/transform_procs.dm | 2 +- code/modules/unit_tests/outfit_sanity.dm | 2 +- 21 files changed, 43 insertions(+), 31 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 9e38eada92313..62ae5a7394a0a 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -106,3 +106,8 @@ /// Flags for sharpness in obj/item #define SHARP_EDGED (1<<0) #define SHARP_POINTY (1<<1) + +/// Flags for specifically what kind of items to get in get_equipped_items +#define INCLUDE_POCKETS (1<<0) +#define INCLUDE_ACCESSORIES (1<<1) +#define INCLUDE_HELD (1<<2) diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index e672a86d72083..966987828bd54 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -62,7 +62,7 @@ if(HAS_TRAIT_FROM(affected_mob, TRAIT_NO_TRANSFORM, REF(src))) return ADD_TRAIT(affected_mob, TRAIT_NO_TRANSFORM, REF(src)) - for(var/obj/item/W in affected_mob.get_equipped_items(include_pockets = TRUE)) + for(var/obj/item/W in affected_mob.get_equipped_items(INCLUDE_POCKETS)) affected_mob.dropItemToGround(W) for(var/obj/item/I in affected_mob.held_items) affected_mob.dropItemToGround(I) diff --git a/code/datums/elements/skill_reward.dm b/code/datums/elements/skill_reward.dm index 7809eea85f715..891f933793ea0 100644 --- a/code/datums/elements/skill_reward.dm +++ b/code/datums/elements/skill_reward.dm @@ -29,7 +29,7 @@ ///We check if the item can be equipped, otherwise we drop it. /datum/element/skill_reward/proc/drop_if_unworthy(datum/source, mob/living/user) SIGNAL_HANDLER - if(check_equippable(user) || !(source in user.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE))) + if(check_equippable(user) || !(source in user.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES))) return NONE to_chat(user, span_warning("You feel completely and utterly unworthy to even touch \the [source].")) user.dropItemToGround(source, TRUE) diff --git a/code/datums/status_effects/buffs/stop_drop_roll.dm b/code/datums/status_effects/buffs/stop_drop_roll.dm index 43d37654e6177..17b4d6d768de3 100644 --- a/code/datums/status_effects/buffs/stop_drop_roll.dm +++ b/code/datums/status_effects/buffs/stop_drop_roll.dm @@ -24,6 +24,9 @@ // Start with one weaker roll owner.spin(spintime = actual_interval, speed = actual_interval / 4) owner.adjust_fire_stacks(-0.25) + + for (var/obj/item/dropped in owner.loc) + dropped.extinguish() // Effectively extinguish your items by rolling on them return TRUE /datum/status_effect/stop_drop_roll/on_remove() diff --git a/code/datums/status_effects/debuffs/fire_stacks.dm b/code/datums/status_effects/debuffs/fire_stacks.dm index 62f8c9ca24e32..dd625ab919aca 100644 --- a/code/datums/status_effects/debuffs/fire_stacks.dm +++ b/code/datums/status_effects/debuffs/fire_stacks.dm @@ -247,7 +247,7 @@ owner.clear_mood_event("on_fire") SEND_SIGNAL(owner, COMSIG_LIVING_EXTINGUISHED, owner) cache_stacks() - for(var/obj/item/equipped in owner.get_equipped_items()) + for(var/obj/item/equipped in (owner.get_equipped_items(INCLUDE_HELD))) equipped.extinguish() /datum/status_effect/fire_handler/fire_stacks/on_remove() diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 72c84c9ee995e..fe15dab29588e 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -445,7 +445,7 @@ balloon_alert(user, "can't reach!") return - if((src in user.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE)) && !user.canUnEquip(src)) + if((src in user.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES)) && !user.canUnEquip(src)) balloon_alert(user, "it's stuck!") return diff --git a/code/modules/admin/verbs/ert.dm b/code/modules/admin/verbs/ert.dm index c86d08151ee62..2d1ba075a4795 100644 --- a/code/modules/admin/verbs/ert.dm +++ b/code/modules/admin/verbs/ert.dm @@ -25,7 +25,7 @@ /datum/admins/proc/equipAntagOnDummy(mob/living/carbon/human/dummy/mannequin, datum/antagonist/antag) - for(var/I in mannequin.get_equipped_items(include_pockets = TRUE)) + for(var/I in mannequin.get_equipped_items(INCLUDE_POCKETS)) qdel(I) if (ispath(antag, /datum/antagonist/ert)) var/datum/antagonist/ert/ert = antag diff --git a/code/modules/admin/verbs/selectequipment.dm b/code/modules/admin/verbs/selectequipment.dm index b94fd5cb2e455..415130fa1b727 100644 --- a/code/modules/admin/verbs/selectequipment.dm +++ b/code/modules/admin/verbs/selectequipment.dm @@ -209,7 +209,8 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(select_equipment, R_FUN, "Select Equipment", mob/ta delete_pocket = TRUE BLACKBOX_LOG_ADMIN_VERB("Select Equipment") - for(var/obj/item/item in human_target.get_equipped_items(include_pockets = delete_pocket)) + var/includes_flags = delete_pocket ? INCLUDE_POCKETS : NONE + for(var/obj/item/item in human_target.get_equipped_items(includes_flags)) qdel(item) var/obj/item/organ/internal/brain/human_brain = human_target.get_organ_slot(BRAIN) diff --git a/code/modules/antagonists/obsessed/obsessed.dm b/code/modules/antagonists/obsessed/obsessed.dm index 3d0a0063bf709..db934c90df604 100644 --- a/code/modules/antagonists/obsessed/obsessed.dm +++ b/code/modules/antagonists/obsessed/obsessed.dm @@ -66,7 +66,7 @@ shoes = /obj/item/clothing/shoes/sneakers/black /datum/outfit/obsessed/post_equip(mob/living/carbon/human/H) - for(var/obj/item/carried_item in H.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE)) + for(var/obj/item/carried_item in H.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES)) carried_item.add_mob_blood(H)//Oh yes, there will be blood... H.regenerate_icons() diff --git a/code/modules/bitrunning/server/util.dm b/code/modules/bitrunning/server/util.dm index ac3e60b51ba64..6b5352bde6cb1 100644 --- a/code/modules/bitrunning/server/util.dm +++ b/code/modules/bitrunning/server/util.dm @@ -66,7 +66,7 @@ /// Removes all blacklisted items from a mob and returns them to base state /obj/machinery/quantum_server/proc/reset_equipment(mob/living/carbon/human/person) - for(var/obj/item in person.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE)) + for(var/obj/item in person.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES)) qdel(item) var/datum/antagonist/bitrunning_glitch/antag_datum = locate() in person.mind?.antag_datums diff --git a/code/modules/buildmode/submodes/outfit.dm b/code/modules/buildmode/submodes/outfit.dm index 5f8e3319cb95d..c3d507bf1e6c7 100644 --- a/code/modules/buildmode/submodes/outfit.dm +++ b/code/modules/buildmode/submodes/outfit.dm @@ -32,11 +32,11 @@ to_chat(c, span_warning("Pick an outfit first.")) return - for (var/item in dollie.get_equipped_items(include_pockets = TRUE)) + for (var/item in dollie.get_equipped_items(INCLUDE_POCKETS)) qdel(item) if(dressuptime != "Naked") dollie.equipOutfit(dressuptime) if(LAZYACCESS(modifiers, RIGHT_CLICK)) - for (var/item in dollie.get_equipped_items(include_pockets = TRUE)) + for (var/item in dollie.get_equipped_items(INCLUDE_POCKETS)) qdel(item) diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index a22691495ccc1..6c088760f07db 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -185,7 +185,7 @@ l_hand = /obj/item/fireaxe /datum/outfit/psycho/post_equip(mob/living/carbon/human/H) - for(var/obj/item/carried_item in H.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE)) + for(var/obj/item/carried_item in H.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES)) carried_item.add_mob_blood(H)//Oh yes, there will be blood... for(var/obj/item/I in H.held_items) I.add_mob_blood(H) diff --git a/code/modules/mafia/outfits.dm b/code/modules/mafia/outfits.dm index dc2d384b263f6..5c6450adb90d2 100644 --- a/code/modules/mafia/outfits.dm +++ b/code/modules/mafia/outfits.dm @@ -155,7 +155,7 @@ suit = /obj/item/clothing/suit/apron /datum/outfit/mafia/obsessed/post_equip(mob/living/carbon/human/H) - for(var/obj/item/carried_item in H.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE)) + for(var/obj/item/carried_item in H.get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES)) carried_item.add_mob_blood(H)//Oh yes, there will be blood... H.regenerate_icons() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index b118de06f057a..50ab6e82faa4d 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -388,38 +388,37 @@ * Used to return a list of equipped items on a mob; does not include held items (use get_all_gear) * * Argument(s): - * * Optional - include_pockets (TRUE/FALSE), whether or not to include the pockets and suit storage in the returned list - * * Optional - include_accessories (TRUE/FALSE), whether or not to include the accessories in the returned list + * * Optional - include_flags, (see obj.flags.dm) describes which optional things to include or not (pockets, accessories, held items) */ -/mob/living/proc/get_equipped_items(include_pockets = FALSE, include_accessories = FALSE) +/mob/living/proc/get_equipped_items(include_flags = NONE) var/list/items = list() for(var/obj/item/item_contents in contents) if(item_contents.item_flags & IN_INVENTORY) items += item_contents - items -= held_items + if (!(include_flags & INCLUDE_HELD)) + items -= held_items return items /** - * Used to return a list of equipped items on a human mob; does not include held items (use get_all_gear) + * Used to return a list of equipped items on a human mob; does not by default include held items, see include_flags * * Argument(s): - * * Optional - include_pockets (TRUE/FALSE), whether or not to include the pockets and suit storage in the returned list - * * Optional - include_accessories (TRUE/FALSE), whether or not to include the accessories in the returned list + * * Optional - include_flags, (see obj.flags.dm) describes which optional things to include or not (pockets, accessories, held items) */ -/mob/living/carbon/human/get_equipped_items(include_pockets = FALSE, include_accessories = FALSE) +/mob/living/carbon/human/get_equipped_items(include_flags = NONE) var/list/items = ..() - if(!include_pockets) + if(!(include_flags & INCLUDE_POCKETS)) items -= list(l_store, r_store, s_store) - if(include_accessories && w_uniform) + if((include_flags & INCLUDE_ACCESSORIES) && w_uniform) var/obj/item/clothing/under/worn_under = w_uniform items += worn_under.attached_accessories return items /mob/living/proc/unequip_everything() var/list/items = list() - items |= get_equipped_items(include_pockets = TRUE) + items |= get_equipped_items(INCLUDE_POCKETS) for(var/I in items) dropItemToGround(I) drop_all_held_items() @@ -558,7 +557,7 @@ //GetAllContents that is reasonable and not stupid /mob/living/proc/get_all_gear() - var/list/processing_list = get_equipped_items(include_pockets = TRUE, include_accessories = TRUE) + held_items + var/list/processing_list = get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES | INCLUDE_HELD) list_clear_nulls(processing_list) // handles empty hands var/i = 0 while(i < length(processing_list)) diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index d5d048a33f844..1e514ad13cedb 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -403,7 +403,7 @@ GLOBAL_LIST_EMPTY(features_by_species) replacement.Insert(organ_holder, special=TRUE, movement_flags = DELETE_IF_REPLACED) /datum/species/proc/worn_items_fit_body_check(mob/living/carbon/wearer) - for(var/obj/item/equipped_item in wearer.get_equipped_items(include_pockets = TRUE)) + for(var/obj/item/equipped_item in wearer.get_equipped_items(INCLUDE_POCKETS)) var/equipped_item_slot = wearer.get_slot_by_item(equipped_item) if(!equipped_item.mob_can_equip(wearer, equipped_item_slot, bypass_equip_delay_self = TRUE, ignore_equipped = TRUE)) wearer.dropItemToGround(equipped_item, force = TRUE) diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index 8d62ed5907948..3340e34064052 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -41,7 +41,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) //Instead of just deleting our equipment, we save what we can and reinsert it into SSwardrobe's store //Hopefully this makes preference reloading not the worst thing ever /mob/living/carbon/human/dummy/delete_equipment() - var/list/items_to_check = get_equipped_items(include_pockets = TRUE) + held_items + var/list/items_to_check = get_equipped_items(INCLUDE_POCKETS | INCLUDE_HELD) var/list/to_nuke = list() //List of items queued for deletion, can't qdel them before iterating their contents in case they hold something ///Travel to the bottom of the contents chain, expanding it out for(var/i = 1; i <= length(items_to_check); i++) //Needs to be a c style loop since it can expand diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 6e1f9037018b6..aa2daa1675e91 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -93,7 +93,7 @@ return TRUE var/block_chance_modifier = round(damage / -3) - for(var/obj/item/worn_thing in get_equipped_items(include_pockets = FALSE) + held_items) + for(var/obj/item/worn_thing in get_equipped_items(INCLUDE_HELD)) // Things that are supposed to be worn, being held = cannot block if(isclothing(worn_thing)) if(worn_thing in held_items) @@ -796,6 +796,10 @@ if(leg_clothes) burning_items |= leg_clothes + if (!gloves || (!(gloves.resistance_flags & FIRE_PROOF) && (gloves.resistance_flags & FLAMMABLE))) + for(var/obj/item/burnable_item in held_items) + burning_items |= burnable_item + for(var/obj/item/burning in burning_items) burning.fire_act((stacks * 25 * seconds_per_tick)) //damage taken is reduced to 2% of this value by fire_act() diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 32ab7ca1b900a..19e4b7a43deb6 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -347,7 +347,7 @@ //delete all equipment without dropping anything /mob/living/carbon/human/proc/delete_equipment() - for(var/slot in get_equipped_items(include_pockets = TRUE))//order matters, dependant slots go first + for(var/slot in get_equipped_items(INCLUDE_POCKETS))//order matters, dependant slots go first qdel(slot) for(var/obj/item/held_item in held_items) qdel(held_item) diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index 3d7be3ea47e29..e25a6f9b16e27 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -31,7 +31,7 @@ to_chat(src, span_warning("You can't vent crawl while buckled!")) return if(iscarbon(src) && required_nudity) - if(length(get_equipped_items(include_pockets = TRUE)) || get_num_held_items()) + if(length(get_equipped_items(INCLUDE_POCKETS)) || get_num_held_items()) if(provide_feedback) to_chat(src, span_warning("You can't crawl around in the ventilation ducts with items!")) return diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index b4fbd713065aa..123fb0de82cd7 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -312,7 +312,7 @@ SSblackbox.record_feedback("amount", "gorillas_created", 1) - var/Itemlist = get_equipped_items(include_pockets = TRUE) + var/Itemlist = get_equipped_items(INCLUDE_POCKETS) Itemlist += held_items for(var/obj/item/W in Itemlist) dropItemToGround(W, TRUE) diff --git a/code/modules/unit_tests/outfit_sanity.dm b/code/modules/unit_tests/outfit_sanity.dm index 18f5e9b8e6141..554d226ed2e72 100644 --- a/code/modules/unit_tests/outfit_sanity.dm +++ b/code/modules/unit_tests/outfit_sanity.dm @@ -49,7 +49,7 @@ for (var/outfit_type in outfits_to_check) // Only make one human and keep undressing it because it's much faster - for (var/obj/item/I in H.get_equipped_items(include_pockets = TRUE)) + for (var/obj/item/I in H.get_equipped_items(INCLUDE_POCKETS)) qdel(I) var/datum/outfit/outfit = new outfit_type From 9e0047f8f470b54e23adabd57123405a0b8b8cbd Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:17:06 +1200 Subject: [PATCH 09/36] Automatic changelog for PR #83867 [ci skip] --- html/changelogs/AutoChangeLog-pr-83867.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-83867.yml diff --git a/html/changelogs/AutoChangeLog-pr-83867.yml b/html/changelogs/AutoChangeLog-pr-83867.yml new file mode 100644 index 0000000000000..b34ce8b957e24 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-83867.yml @@ -0,0 +1,7 @@ +author: "Jacquerel" +delete-after: True +changes: + - balance: "Items held in your hands can catch fire." + - balance: "Items you are holding won't catch fire if your hands cannot catch fire." + - balance: "When you stop being on fire so will items you are holding." + - balance: "If you roll around on your burning items they will stop being on fire." \ No newline at end of file From 3ad7731897ac9e249562bd8ca414c04287af1ac4 Mon Sep 17 00:00:00 2001 From: Changelogs Date: Wed, 19 Jun 2024 00:26:20 +0000 Subject: [PATCH 10/36] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-83439.yml | 8 ---- html/changelogs/AutoChangeLog-pr-83673.yml | 5 --- html/changelogs/AutoChangeLog-pr-83744.yml | 4 -- html/changelogs/AutoChangeLog-pr-83792.yml | 4 -- html/changelogs/AutoChangeLog-pr-83867.yml | 7 ---- html/changelogs/AutoChangeLog-pr-83952.yml | 4 -- html/changelogs/AutoChangeLog-pr-83999.yml | 4 -- html/changelogs/AutoChangeLog-pr-84053.yml | 4 -- html/changelogs/AutoChangeLog-pr-84078.yml | 4 -- html/changelogs/AutoChangeLog-pr-84085.yml | 4 -- html/changelogs/AutoChangeLog-pr-84087.yml | 5 --- html/changelogs/archive/2024-06.yml | 43 ++++++++++++++++++++++ 12 files changed, 43 insertions(+), 53 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-83439.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83673.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83744.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83792.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83867.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83952.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-83999.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-84053.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-84078.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-84085.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-84087.yml diff --git a/html/changelogs/AutoChangeLog-pr-83439.yml b/html/changelogs/AutoChangeLog-pr-83439.yml deleted file mode 100644 index 9e721ae4ba0a4..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83439.yml +++ /dev/null @@ -1,8 +0,0 @@ -author: "carlarctg" -delete-after: True -changes: - - balance: "Negative mutations now allow you to have more positive mutations, via reducing your instability!" - - code_imp: "All mutations have been overall standardized via defines on their instability values. Many mediocre positive mutations have had their cost reduced significantly!" - - rscadd: "Added a new height mutation: Acromegaly! It's the opposite of Dwarfism and makes you uncannily tall. It also makes you hit your head 8% or 4% (with synch) of the time you pass through airlocks. Wear a helmet!" - - rscadd: "Gigantism is now a recipe mutation, mix Acromegaly with Strength to get it." - - qol: "Injectors and activators' duration is now dependent on the in/stability (absolute value) of the mutations to be injected! With a minimum of 5-10-15 seconds for each type of injector. Also changed up a bit how part upgrade cooldowns work, by making each tier reduce cooldowns by 25-15-10% for each injector type." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83673.yml b/html/changelogs/AutoChangeLog-pr-83673.yml deleted file mode 100644 index 0211d4508cf97..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83673.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "Bisar" -delete-after: True -changes: - - rscadd: "Sparks now ignite flammable things. Including you. Keep a fire extinguisher handy or stop dousing yourself in welding fuel!" - - bugfix: "Fixed a few oversights with welding fuel pools not igniting when you throw lit/hot things into them or when you walk into them while on fire." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83744.yml b/html/changelogs/AutoChangeLog-pr-83744.yml deleted file mode 100644 index 8425dfbfccd62..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83744.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Time-Green" -delete-after: True -changes: - - refactor: "Lizard and moth markings now use the bodypart overlay system" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83792.yml b/html/changelogs/AutoChangeLog-pr-83792.yml deleted file mode 100644 index c856d7586a8ce..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83792.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "TheRyeGuyWhoWillNowDie" -delete-after: True -changes: - - rscadd: "the advanced omnitool upgrade now hastens the mediborg's syringe too" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83867.yml b/html/changelogs/AutoChangeLog-pr-83867.yml deleted file mode 100644 index b34ce8b957e24..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83867.yml +++ /dev/null @@ -1,7 +0,0 @@ -author: "Jacquerel" -delete-after: True -changes: - - balance: "Items held in your hands can catch fire." - - balance: "Items you are holding won't catch fire if your hands cannot catch fire." - - balance: "When you stop being on fire so will items you are holding." - - balance: "If you roll around on your burning items they will stop being on fire." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83952.yml b/html/changelogs/AutoChangeLog-pr-83952.yml deleted file mode 100644 index 431aaa759582e..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83952.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "GPeckman" -delete-after: True -changes: - - bugfix: "Airlocks should no longer appear closed sometimes when fireman carrying someone into them." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-83999.yml b/html/changelogs/AutoChangeLog-pr-83999.yml deleted file mode 100644 index a04af9580bdf3..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-83999.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Jacquerel" -delete-after: True -changes: - - balance: "Gorillas have big fingers, which mostly just prevents them from using laser pointers and stun batons" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-84053.yml b/html/changelogs/AutoChangeLog-pr-84053.yml deleted file mode 100644 index 6aebdbc471f5f..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-84053.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "jlsnow301" -delete-after: True -changes: - - bugfix: "TGUI say will no longer spill your /me contents when you get attacked" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-84078.yml b/html/changelogs/AutoChangeLog-pr-84078.yml deleted file mode 100644 index 03f520a71d41b..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-84078.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "Fixed hand tele portals being forever" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-84085.yml b/html/changelogs/AutoChangeLog-pr-84085.yml deleted file mode 100644 index 995c311e4ef3f..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-84085.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Bisar" -delete-after: True -changes: - - rscadd: "The Nanotrasen safety commission reminds employees to properly clean themselves of all flammable material before going on smoke breaks." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-84087.yml b/html/changelogs/AutoChangeLog-pr-84087.yml deleted file mode 100644 index 09cfa195999e8..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-84087.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "Enabling or disabling ambience mid round will properly enable or disable ambience" - - qol: "Added descriptions differentiating \"Ship ambience\" from \"ambience\"" \ No newline at end of file diff --git a/html/changelogs/archive/2024-06.yml b/html/changelogs/archive/2024-06.yml index 9f757c45df58b..c1c7f194b7758 100644 --- a/html/changelogs/archive/2024-06.yml +++ b/html/changelogs/archive/2024-06.yml @@ -800,3 +800,46 @@ san7890: - qol: A message with a link to publicly accessible logs (if enabled by your server operators) should now be visible far earlier when a world is about to reboot. +2024-06-19: + Bisar: + - rscadd: The Nanotrasen safety commission reminds employees to properly clean themselves + of all flammable material before going on smoke breaks. + - rscadd: Sparks now ignite flammable things. Including you. Keep a fire extinguisher + handy or stop dousing yourself in welding fuel! + - bugfix: Fixed a few oversights with welding fuel pools not igniting when you throw + lit/hot things into them or when you walk into them while on fire. + GPeckman: + - bugfix: Airlocks should no longer appear closed sometimes when fireman carrying + someone into them. + Jacquerel: + - balance: Gorillas have big fingers, which mostly just prevents them from using + laser pointers and stun batons + - balance: Items held in your hands can catch fire. + - balance: Items you are holding won't catch fire if your hands cannot catch fire. + - balance: When you stop being on fire so will items you are holding. + - balance: If you roll around on your burning items they will stop being on fire. + Melbert: + - bugfix: Fixed hand tele portals being forever + - bugfix: Enabling or disabling ambience mid round will properly enable or disable + ambience + - qol: Added descriptions differentiating "Ship ambience" from "ambience" + TheRyeGuyWhoWillNowDie: + - rscadd: the advanced omnitool upgrade now hastens the mediborg's syringe too + Time-Green: + - refactor: Lizard and moth markings now use the bodypart overlay system + carlarctg: + - balance: Negative mutations now allow you to have more positive mutations, via + reducing your instability! + - code_imp: All mutations have been overall standardized via defines on their instability + values. Many mediocre positive mutations have had their cost reduced significantly! + - rscadd: 'Added a new height mutation: Acromegaly! It''s the opposite of Dwarfism + and makes you uncannily tall. It also makes you hit your head 8% or 4% (with + synch) of the time you pass through airlocks. Wear a helmet!' + - rscadd: Gigantism is now a recipe mutation, mix Acromegaly with Strength to get + it. + - qol: Injectors and activators' duration is now dependent on the in/stability (absolute + value) of the mutations to be injected! With a minimum of 5-10-15 seconds for + each type of injector. Also changed up a bit how part upgrade cooldowns work, + by making each tier reduce cooldowns by 25-15-10% for each injector type. + jlsnow301: + - bugfix: TGUI say will no longer spill your /me contents when you get attacked From b984c9d6f0a729c9010c47da3e8f5c9272fa704c Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 19 Jun 2024 15:31:19 +0300 Subject: [PATCH 11/36] APC channel wires (#84099) ## About The Pull Request Added wires for toggling channels between Auto and Off to the APC. ![image](https://github.com/tgstation/tgstation/assets/3625094/b4986bd1-3c10-4200-bc88-405fe6c40d6a) ## Why It's Good For The Game Allows for a few interesting setups, such as: - Connecting signaller to the lights channel to control lights remotely or using proximity sensors/infrared lasers. - Connecting signaller to the machinery channel to automatically disable machine power usage in an area for power saving with signaller or proximity sensors. ## Changelog :cl: qol: APC has wires for machinery/lights/environment channels /:cl: --- code/__DEFINES/wires.dm | 2 ++ code/datums/wires/apc.dm | 42 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/wires.dm b/code/__DEFINES/wires.dm index 2b4c528abc212..4926996f26bd3 100644 --- a/code/__DEFINES/wires.dm +++ b/code/__DEFINES/wires.dm @@ -64,6 +64,8 @@ #define WIRE_ZAP1 "High Voltage Circuit 1" #define WIRE_ZAP2 "High Voltage Circuit 2" #define WIRE_OVERCLOCK "Overclock" +#define WIRE_EQUIPMENT "Equipment" +#define WIRE_ENVIRONMENT "Environment" // Wire states for the AI #define AI_WIRE_NORMAL 0 diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm index 54d179802a311..50847df994372 100644 --- a/code/datums/wires/apc.dm +++ b/code/datums/wires/apc.dm @@ -4,8 +4,13 @@ /datum/wires/apc/New(atom/holder) wires = list( - WIRE_POWER1, WIRE_POWER2, - WIRE_IDSCAN, WIRE_AI + WIRE_EQUIPMENT, + WIRE_LIGHT, + WIRE_ENVIRONMENT, + WIRE_POWER1, + WIRE_POWER2, + WIRE_INTERFACE, + WIRE_AI ) add_duds(6) ..() @@ -22,17 +27,32 @@ var/list/status = list() status += "The interface light is [A.locked ? "red" : "green"]." status += "The short indicator is [A.shorted ? "lit" : "off"]." + status += "The channel one light is [A.equipment ? "on" : "off"]." + status += "The channel two light is [A.lighting ? "on" : "off"]." + status += "The channel three light is [A.environ ? "on" : "off"]." status += "The AI connection light is [!A.aidisabled ? "on" : "off"]." return status -/datum/wires/apc/on_pulse(wire) +/datum/wires/apc/on_pulse(wire, user) var/obj/machinery/power/apc/A = holder switch(wire) + if(WIRE_EQUIPMENT) + A.equipment = A.equipment > APC_CHANNEL_OFF ? APC_CHANNEL_OFF : APC_CHANNEL_AUTO_ON + A.update_appearance() + A.update() + if(WIRE_LIGHT) + A.lighting = A.lighting > APC_CHANNEL_OFF ? APC_CHANNEL_OFF : APC_CHANNEL_AUTO_ON + A.update_appearance() + A.update() + if(WIRE_ENVIRONMENT) + A.environ = A.environ > APC_CHANNEL_OFF ? APC_CHANNEL_OFF : APC_CHANNEL_AUTO_ON + A.update_appearance() + A.update() if(WIRE_POWER1, WIRE_POWER2) // Short for a long while. if(!A.shorted) A.shorted = TRUE addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/power/apc, reset), wire), 2 MINUTES) - if(WIRE_IDSCAN) // Unlock for a little while. + if(WIRE_INTERFACE) // Unlock for a little while. A.locked = FALSE addtimer(CALLBACK(A, TYPE_PROC_REF(/obj/machinery/power/apc, reset), wire), 30 SECONDS) if(WIRE_AI) // Disable AI control for a very short time. @@ -43,12 +63,26 @@ /datum/wires/apc/on_cut(wire, mend, source) var/obj/machinery/power/apc/A = holder switch(wire) + if(WIRE_EQUIPMENT) + A.equipment = mend ? APC_CHANNEL_AUTO_ON : APC_CHANNEL_OFF + A.update_appearance() + A.update() + if(WIRE_LIGHT) + A.lighting = mend ? APC_CHANNEL_AUTO_ON : APC_CHANNEL_OFF + A.update_appearance() + A.update() + if(WIRE_ENVIRONMENT) + A.environ = mend ? APC_CHANNEL_AUTO_ON : APC_CHANNEL_OFF + A.update_appearance() + A.update() if(WIRE_POWER1, WIRE_POWER2) // Short out. if(mend && !is_cut(WIRE_POWER1) && !is_cut(WIRE_POWER2)) A.shorted = FALSE else A.shorted = TRUE A.shock(usr, 50) + if(WIRE_INTERFACE) + A.locked = !mend if(WIRE_AI) // Disable AI control. A.aidisabled = !mend From 72ada6b7ae7e0e66570ba6f076010161a198e119 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:31:39 +1200 Subject: [PATCH 12/36] Automatic changelog for PR #84099 [ci skip] --- html/changelogs/AutoChangeLog-pr-84099.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-84099.yml diff --git a/html/changelogs/AutoChangeLog-pr-84099.yml b/html/changelogs/AutoChangeLog-pr-84099.yml new file mode 100644 index 0000000000000..da8c2a27966e1 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-84099.yml @@ -0,0 +1,4 @@ +author: "MTandi" +delete-after: True +changes: + - qol: "APC has wires for machinery/lights/environment channels" \ No newline at end of file From f5f9c5b0de31655f3190edb0e50d567220204cf2 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 19 Jun 2024 15:34:37 +0300 Subject: [PATCH 13/36] Power cell tiers consistency (#84074) ## About The Pull Request Tier 3 had both 20 and 30 MJ cells for some reason, while 10 MJ cell was considered tier 2. Now the scaling is proper: 10 MJ is tier 1, 20 MJ is tier 2, and so on... Also updated plasma crystal sprite, and gave unique sprites to the smallest cells. ![image](https://github.com/tgstation/tgstation/assets/3625094/308a88b2-a834-4256-894d-88743311c0b4) ## Why It's Good For The Game The scaling was off, and the sprites made them look out of place for their tier. ## Changelog :cl: fix: Made 10 MJ & 20 MJ cells properly correspond to tiers 1 & 2 in lathes. image: Updated cell sprites to correspond to other stock parts of their tiers. image: Updated plasma cell, 500KJ cell and 2.5MJ cell sprites /:cl: --- code/modules/power/cell.dm | 10 ++++++++++ .../modules/research/designs/power_designs.dm | 4 ++-- icons/obj/machines/cell_charger.dmi | Bin 3287 -> 3629 bytes 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index dc2b4e9812a03..b55593ec913e7 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -311,19 +311,29 @@ /obj/item/stock_parts/cell/crap name = "\improper Nanotrasen brand rechargeable AA battery" desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT + icon_state = "aa_cell" maxcharge = STANDARD_CELL_CHARGE * 0.5 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.4) +/obj/item/stock_parts/cell/crap/Initialize(mapload) + AddElement(/datum/element/update_icon_blocker) + return ..() + /obj/item/stock_parts/cell/crap/empty empty = TRUE /obj/item/stock_parts/cell/upgraded name = "upgraded power cell" desc = "A power cell with a slightly higher capacity than normal!" + icon_state = "9v_cell" maxcharge = STANDARD_CELL_CHARGE * 2.5 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.5) chargerate = STANDARD_CELL_RATE * 0.5 +/obj/item/stock_parts/cell/upgraded/Initialize(mapload) + AddElement(/datum/element/update_icon_blocker) + return ..() + /obj/item/stock_parts/cell/upgraded/plus name = "upgraded power cell+" desc = "A power cell with an even higher capacity than the base model!" diff --git a/code/modules/research/designs/power_designs.dm b/code/modules/research/designs/power_designs.dm index 85704c0c5b72e..700f99a643504 100644 --- a/code/modules/research/designs/power_designs.dm +++ b/code/modules/research/designs/power_designs.dm @@ -24,7 +24,7 @@ construction_time = 10 SECONDS build_path = /obj/item/stock_parts/cell/high/empty category = list( - RND_CATEGORY_STOCK_PARTS + RND_SUBCATEGORY_STOCK_PARTS_2 + RND_CATEGORY_STOCK_PARTS + RND_SUBCATEGORY_STOCK_PARTS_1 ) departmental_flags = DEPARTMENT_BITFLAG_SCIENCE | DEPARTMENT_BITFLAG_ENGINEERING @@ -37,7 +37,7 @@ construction_time = 10 SECONDS build_path = /obj/item/stock_parts/cell/super/empty category = list( - RND_CATEGORY_STOCK_PARTS + RND_SUBCATEGORY_STOCK_PARTS_3 + RND_CATEGORY_STOCK_PARTS + RND_SUBCATEGORY_STOCK_PARTS_2 ) departmental_flags = DEPARTMENT_BITFLAG_SCIENCE | DEPARTMENT_BITFLAG_ENGINEERING diff --git a/icons/obj/machines/cell_charger.dmi b/icons/obj/machines/cell_charger.dmi index 5ce285fc817826755ca6e66f3593fb9b74c0097a..0c9ca53544286bb1d40e6be608b5cbbf22623c56 100644 GIT binary patch literal 3629 zcma)9cTm&Yw*G~110q3eH%JR!6cD9Xr6XMeNEbvD5Tq9Yks5*&rHP>QB1jWyMmjZ6B=n@Ud%X#7g9x^fgW2fo zxA>*J7n1e+&&0P|ggCbHd(i?fJ!6x6X>ctguVBvPPS9nE#zCQ^e)fy!_1jv}ez$Yd zN~HszaE0&r33;^s;~uT=g*-jB6|5CPQ_d}1z!i%+q!z*Lub=KCH-wiY>e@2j-VH4q z1X*roCP*4J>fX{$xqd$Hg%WD*?Zwv+-3Si~%o3_E#VKC#iYPo`KP?gz`JptZr0P-Q zWSJLYW_@R9NWNugeQ0$Muhubql+C>}G}CZI_bWbPcB0WcrZ$F#9L8dQPhMF^JqpG- zYt>SKM-T{58Vf=`x(|r(^8rbJa`VczS)>fyRAm@zteRYdqVfP(mwb@wo?%)NuS~^h zpi0k2L3^sXRxxni=KbfOg`0X-I1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Log-pr-84074.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-84074.yml diff --git a/html/changelogs/AutoChangeLog-pr-84074.yml b/html/changelogs/AutoChangeLog-pr-84074.yml new file mode 100644 index 0000000000000..3ba774dadd0a4 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-84074.yml @@ -0,0 +1,6 @@ +author: "MTandi" +delete-after: True +changes: + - bugfix: "Made 10 MJ & 20 MJ cells properly correspond to tiers 1 & 2 in lathes." + - image: "Updated cell sprites to correspond to other stock parts of their tiers." + - image: "Updated plasma cell, 500KJ cell and 2.5MJ cell sprites" \ No newline at end of file From c7b27d01e20c0f6b2c5f4e84795854b07a36ed6b Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 19 Jun 2024 15:36:29 +0300 Subject: [PATCH 15/36] Fixed TechWeb app piling designs issue (#84104) ## About The Pull Request Fixes #81478 ## Why It's Good For The Game We had this issue since February. ## Changelog :cl: fix: Fixed techweb app showing wrong designs on Details button click /:cl: --- tgui/packages/tgui/interfaces/Techweb.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgui/packages/tgui/interfaces/Techweb.jsx b/tgui/packages/tgui/interfaces/Techweb.jsx index c041d646d7d99..dcafea78bf529 100644 --- a/tgui/packages/tgui/interfaces/Techweb.jsx +++ b/tgui/packages/tgui/interfaces/Techweb.jsx @@ -621,7 +621,7 @@ const TechNode = (props) => { {design_ids.map((k, i) => ( - - - - } - > - {!pressure && {'No Pressure Detected'}} - {usingLastData && ( - - {'Tank destroyed. Displaying last recorded data.'} - - )} - - - (value ? value.toFixed(2) : '-') + ' kPa'} - /> - - - - - - = leakPressure} - /> - - - - - = leakPressure && - pressure < fragmentPressure) || - leaking - } - /> - - - = fragmentPressure} - /> - - - - - - - -
- - - - act('change_rate', { target: new_rate }) - } - /> - - - - - -
-
- - - -
- {!inputData.total_moles && {'No Gas Present'}} - -
-
- -
- {!outputData.inputData && {'No Gas Present'}} - -
-
- -
- } - > - {!bufferData.total_moles && {'No Gas Present'}} - -
-
-
-
- - ); -}; - -const TankCompressorRecords = (props) => { - const { act, data } = useBackend(); - const { records = [], disk } = data; - const [activeRecordRef, setActiveRecordRef] = useSharedState( - 'recordRef', - records[0]?.ref, - ); - const activeRecord = - !!activeRecordRef && - records.find((record) => activeRecordRef === record.ref); - if (records.length === 0) { - return ( - - No Records - - ); - } - - return ( - - - - - {records.map((record) => ( - setActiveRecordRef(record.ref)} - > - {record.name} - - ))} - - - {activeRecord ? ( - -
{ - act('delete_record', { - ref: activeRecord.ref, - }); - }} - />, -
-
- ) : ( - - No Record Selected - - )} -
-
- ); -}; diff --git a/tgui/packages/tgui/interfaces/TankCompressor.tsx b/tgui/packages/tgui/interfaces/TankCompressor.tsx new file mode 100644 index 0000000000000..3f516e3c01803 --- /dev/null +++ b/tgui/packages/tgui/interfaces/TankCompressor.tsx @@ -0,0 +1,321 @@ +import { toFixed } from 'common/math'; +import { BooleanLike } from 'common/react'; + +import { useBackend, useSharedState } from '../backend'; +import { + Box, + Button, + Knob, + LabeledControls, + LabeledList, + NoticeBox, + RoundGauge, + Section, + Stack, + Tabs, +} from '../components'; +import { formatSiUnit } from '../format'; +import { Window } from '../layouts'; + +type Data = { + // Dynamic + tankPresent: BooleanLike; + tankPressure: number; + leaking: BooleanLike; + active: BooleanLike; + transferRate: number; + lastPressure: number; + disk: string; + storage: string; + records: Record[]; + // Static + maxTransfer: number; + leakPressure: number; + fragmentPressure: number; + ejectPressure: number; +}; + +type Record = { + ref: string; + name: string; + timestamp: string; + source: string; + gases: GasMoles[]; +}; + +type GasMoles = { + [key: string]: number; +}; + +const formatPressure = (value) => { + if (value < 10000) { + return toFixed(value) + ' kPa'; + } + return formatSiUnit(value * 1000, 1, 'Pa'); +}; + +export const TankCompressor = (props) => { + return ( + + + + + + ); +}; + +const TankCompressorContent = (props) => { + const { act, data } = useBackend(); + const { disk, storage } = data; + + return ( + + +
act('eject_disk')} + > + Eject Disk + + } + > + +
+
+
+ ); +}; + +const TankCompressorControls = (props) => { + const { act, data } = useBackend(); + const { + tankPresent, + leaking, + lastPressure, + leakPressure, + fragmentPressure, + tankPressure, + maxTransfer, + active, + transferRate, + ejectPressure, + } = data; + const pressure = tankPresent ? tankPressure : lastPressure; + const usingLastData = !!(lastPressure && !tankPresent); + const notice_color = + usingLastData || leaking || pressure > fragmentPressure + ? 'bad' + : !tankPresent + ? 'blue' + : pressure > leakPressure + ? 'average' + : 'good'; + const notice_text = usingLastData + ? 'Tank destroyed. Displaying last recorded data.' + : !tankPresent + ? 'No Tank Detected' + : leaking + ? 'Tank Leaking' + : !pressure + ? 'No Pressure Detected' + : pressure < leakPressure + ? 'Tank Pressure Nominal' + : pressure < fragmentPressure + ? 'Leak Hazard' + : 'Explosive Hazard'; + + return ( + +
ejectPressure} + onClick={() => act('eject_tank')} + > + {'Eject Tank'} + + } + > + {notice_text} + + + + + + + + act('change_rate', { + target: value, + }) + } + /> + + + +
+
+ ); +}; + +const TankCompressorRecords = (props) => { + const { act, data } = useBackend(); + const { records = [], disk } = data; + const [activeRecordRef, setActiveRecordRef] = useSharedState( + 'recordRef', + records[0]?.ref, + ); + const activeRecord = + !!activeRecordRef && + records.find((record) => activeRecordRef === record.ref); + if (records.length === 0) { + return ( + + No Records + + ); + } + + return ( + + + + + {records.map((record) => ( + setActiveRecordRef(record.ref)} + > + {record.name} + + ))} + + + {activeRecord ? ( + + + + {activeRecord.name} + + + {activeRecord.timestamp} + + + {activeRecord.source} + + + + {Object.keys(activeRecord.gases).map((gas_name) => ( + + {(activeRecord.gases[gas_name] + ? activeRecord.gases[gas_name].toFixed(2) + : '-') + ' moles'} + + ))} + + + +