From f01ded9dd41c954874a689c6b2920f924153a363 Mon Sep 17 00:00:00 2001 From: _0Steven <42909981+00-Steven@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:22:12 +0100 Subject: [PATCH 01/19] Fixes screwdriver cocktail not being a screwdriver. (#81030) ## About The Pull Request Alternative title: The screwdriver cocktail is now the world's worst screwdriver (for real this time). As mentioned in my writeup in the related issue (#81017), as far as I know, it has never actually worked. Tl;dr: It requires `on_transfer` to be called with the method as ingestion, but in no way does transferring into a drinking glass ever use that method, and most ways don't even specify a method and thus `on_transfer` doesn't even get called in the first place. Then I went back to the original pr and tried it, and it didn't work. Then for resolving it, it feels unwieldy to do all this trickery on the reagent to change a value on the drinking glass when the drinking glass already has the perfect procs for this: the `on_cup_change` and `on_cup_reset` callbacks. Instead of using `on_transfer` and registering a hell of a lot of signals to re-check the master reagent every time the contents get changed, we just check whether the style we changed into is that of a screwdriver cocktail. This actually works. Oh, and I also added use sounds because it didn't have them, which I believe only actually get used when using it as a tool and thus only when it's a screwdriver. ## Why It's Good For The Game Fixes #81017. ## Changelog :cl: fix: As they should've for a while, screwdrivers (cocktail) actually work as screwdrivers (tool). sound: The screwdriver cocktail also actually plays the screwdriver sound when used. /:cl: --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> --- .../reagents/drinks/alcohol_reagents.dm | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm index 1381ed81f12da..2cc88da41ade8 100644 --- a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm @@ -589,37 +589,55 @@ taste_description = "oranges" chemical_flags = REAGENT_CAN_BE_SYNTHESIZED -/datum/reagent/consumable/ethanol/screwdrivercocktail/on_transfer(atom/atom, methods = TOUCH, trans_volume) - if(!(methods & INGEST)) - return ..() - - if(src == atom.reagents.get_master_reagent() && istype(atom, /obj/item/reagent_containers/cup/glass/drinkingglass)) - var/obj/item/reagent_containers/cup/glass/drinkingglass/drink = atom - drink.tool_behaviour = TOOL_SCREWDRIVER +/datum/reagent/consumable/ethanol/screwdrivercocktail/on_new(data) + . = ..() + // We want to turn only base drinking glasses with screwdriver(cocktail) into screwdrivers(tool), + // but we can't check style so we have to check type, and we don't want it match subtypes like istype does + if(holder?.my_atom && holder.my_atom.type == /obj/item/reagent_containers/cup/glass/drinkingglass/) var/list/reagent_change_signals = list( COMSIG_REAGENTS_ADD_REAGENT, COMSIG_REAGENTS_NEW_REAGENT, COMSIG_REAGENTS_REM_REAGENT, - COMSIG_REAGENTS_DEL_REAGENT, - COMSIG_REAGENTS_CLEAR_REAGENTS, - COMSIG_REAGENTS_REACTED, ) - RegisterSignals(drink.reagents, reagent_change_signals, PROC_REF(on_reagent_change)) - - return ..() + RegisterSignals(holder, reagent_change_signals, PROC_REF(on_reagent_change)) + RegisterSignal(holder, COMSIG_REAGENTS_CLEAR_REAGENTS, PROC_REF(on_reagents_clear)) + RegisterSignal(holder, COMSIG_REAGENTS_DEL_REAGENT, PROC_REF(on_reagent_delete)) + if(src == holder.get_master_reagent()) + var/obj/item/reagent_containers/cup/glass/drinkingglass/drink = holder.my_atom + drink.tool_behaviour = TOOL_SCREWDRIVER + drink.usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg') /datum/reagent/consumable/ethanol/screwdrivercocktail/proc/on_reagent_change(datum/reagents/reagents) SIGNAL_HANDLER - if(src != reagents.get_master_reagent()) - var/obj/item/reagent_containers/cup/glass/drinkingglass/drink = reagents.my_atom + var/obj/item/reagent_containers/cup/glass/drinkingglass/drink = reagents.my_atom + if(reagents.get_master_reagent() == src) + drink.tool_behaviour = TOOL_SCREWDRIVER + drink.usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.ogg') + else + drink.tool_behaviour = initial(drink.tool_behaviour) + drink.usesound = initial(drink.usesound) + +/datum/reagent/consumable/ethanol/screwdrivercocktail/proc/on_reagents_clear(datum/reagents/reagents) + SIGNAL_HANDLER + unregister_screwdriver(reagents) + +/datum/reagent/consumable/ethanol/screwdrivercocktail/proc/on_reagent_delete(datum/reagents/reagents, datum/reagent/deleted_reagent) + SIGNAL_HANDLER + if(deleted_reagent != src) + return + unregister_screwdriver(reagents) + +/datum/reagent/consumable/ethanol/screwdrivercocktail/proc/unregister_screwdriver(datum/reagents/reagents) + var/obj/item/reagent_containers/cup/glass/drinkingglass/drink = reagents.my_atom + if(drink.tool_behaviour == TOOL_SCREWDRIVER) drink.tool_behaviour = initial(drink.tool_behaviour) - UnregisterSignal(reagents, list( + drink.usesound = initial(drink.usesound) + UnregisterSignal(reagents, list( COMSIG_REAGENTS_ADD_REAGENT, COMSIG_REAGENTS_NEW_REAGENT, COMSIG_REAGENTS_REM_REAGENT, COMSIG_REAGENTS_DEL_REAGENT, COMSIG_REAGENTS_CLEAR_REAGENTS, - COMSIG_REAGENTS_REACTED, )) /datum/reagent/consumable/ethanol/screwdrivercocktail/on_mob_life(mob/living/carbon/drinker, seconds_per_tick, times_fired) From 7159e051386d9b80bbabd9663105d6762d30611e Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 11:22:30 +1300 Subject: [PATCH 02/19] Automatic changelog for PR #81030 [ci skip] --- html/changelogs/AutoChangeLog-pr-81030.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81030.yml diff --git a/html/changelogs/AutoChangeLog-pr-81030.yml b/html/changelogs/AutoChangeLog-pr-81030.yml new file mode 100644 index 0000000000000..bbbbfc7575265 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81030.yml @@ -0,0 +1,5 @@ +author: "00-Steven" +delete-after: True +changes: + - bugfix: "As they should've for a while, screwdrivers (cocktail) actually work as screwdrivers (tool)." + - sound: "The screwdriver cocktail also actually plays the screwdriver sound when used." \ No newline at end of file From 7054f85a8d755b0b9c151143a45f7cf4070511bb Mon Sep 17 00:00:00 2001 From: Changelogs Date: Sat, 10 Feb 2024 00:19:18 +0000 Subject: [PATCH 03/19] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-81030.yml | 5 ---- html/changelogs/AutoChangeLog-pr-81190.yml | 4 --- html/changelogs/AutoChangeLog-pr-81228.yml | 4 --- html/changelogs/AutoChangeLog-pr-81292.yml | 4 --- html/changelogs/AutoChangeLog-pr-81306.yml | 4 --- html/changelogs/AutoChangeLog-pr-81339.yml | 4 --- html/changelogs/AutoChangeLog-pr-81345.yml | 5 ---- html/changelogs/AutoChangeLog-pr-81347.yml | 4 --- html/changelogs/AutoChangeLog-pr-81348.yml | 4 --- html/changelogs/AutoChangeLog-pr-81349.yml | 4 --- html/changelogs/AutoChangeLog-pr-81352.yml | 4 --- html/changelogs/AutoChangeLog-pr-81353.yml | 4 --- html/changelogs/AutoChangeLog-pr-81355.yml | 4 --- html/changelogs/archive/2024-02.yml | 33 ++++++++++++++++++++++ 14 files changed, 33 insertions(+), 54 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-81030.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81190.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81228.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81292.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81306.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81339.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81345.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81347.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81348.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81349.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81352.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81353.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-81355.yml diff --git a/html/changelogs/AutoChangeLog-pr-81030.yml b/html/changelogs/AutoChangeLog-pr-81030.yml deleted file mode 100644 index bbbbfc7575265..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81030.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "00-Steven" -delete-after: True -changes: - - bugfix: "As they should've for a while, screwdrivers (cocktail) actually work as screwdrivers (tool)." - - sound: "The screwdriver cocktail also actually plays the screwdriver sound when used." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81190.yml b/html/changelogs/AutoChangeLog-pr-81190.yml deleted file mode 100644 index b4adc2b12a12e..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81190.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Ben10Omintrix" -delete-after: True -changes: - - rscadd: "settlers can rename their pets" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81228.yml b/html/changelogs/AutoChangeLog-pr-81228.yml deleted file mode 100644 index 20b504aa51a86..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81228.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "FernandoJ8" -delete-after: True -changes: - - code_imp: "added an IS_CHANGELING() helper and used it where applicable" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81292.yml b/html/changelogs/AutoChangeLog-pr-81292.yml deleted file mode 100644 index 88999998073f5..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81292.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Holoo-1" -delete-after: True -changes: - - admin: "remade everyone is traitor into everyone is antag in secrets panel" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81306.yml b/html/changelogs/AutoChangeLog-pr-81306.yml deleted file mode 100644 index 98c9d89afa146..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81306.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "LT3" -delete-after: True -changes: - - qol: "Health analyzer will now display blood alcohol content" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81339.yml b/html/changelogs/AutoChangeLog-pr-81339.yml deleted file mode 100644 index 70e0496102887..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81339.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "JohnFulpWillard" -delete-after: True -changes: - - rscadd: "Changeling's reviving stasis ability now puts you in stasis." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81345.yml b/html/changelogs/AutoChangeLog-pr-81345.yml deleted file mode 100644 index 0bbc14b258605..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81345.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "1393F" -delete-after: True -changes: - - bugfix: "The HFR now provides the max temperature for recipes" - - bugfix: "the crystallizer now provides the dangerous object created instead of itself in admin logging" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81347.yml b/html/changelogs/AutoChangeLog-pr-81347.yml deleted file mode 100644 index ed3b938860a1d..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81347.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "Fixed Finger Guns giving a misleading chat message" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81348.yml b/html/changelogs/AutoChangeLog-pr-81348.yml deleted file mode 100644 index 5e7867c9d1b6b..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81348.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "You know that one bug that makes the cryo cells on Deltastation unusuable? Well it's not fixed but at least those cryo cells are usuable again, maybe at the cost of another station's cryo cells. Who knows!" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81349.yml b/html/changelogs/AutoChangeLog-pr-81349.yml deleted file mode 100644 index 23efa8d682eb7..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81349.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "Fixed some situations in which you couldn't interact with heretic runes" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81352.yml b/html/changelogs/AutoChangeLog-pr-81352.yml deleted file mode 100644 index 57c2cef8c56a0..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81352.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "IndieanaJones" -delete-after: True -changes: - - bugfix: "Bolas in your pockets no longer slow you down." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81353.yml b/html/changelogs/AutoChangeLog-pr-81353.yml deleted file mode 100644 index a33ebc0cbae1e..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81353.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "larentoun" -delete-after: True -changes: - - bugfix: "Now falsewalls visually don't close when they shouldn't." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-81355.yml b/html/changelogs/AutoChangeLog-pr-81355.yml deleted file mode 100644 index 970c4c6432176..0000000000000 --- a/html/changelogs/AutoChangeLog-pr-81355.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "LemonInTheDark" -delete-after: True -changes: - - rscdel: "Removes halloween screen tint, we're taking him to retire by the seaside (he was alone and unloved)" \ No newline at end of file diff --git a/html/changelogs/archive/2024-02.yml b/html/changelogs/archive/2024-02.yml index aec4c211b5605..e9299211d16b6 100644 --- a/html/changelogs/archive/2024-02.yml +++ b/html/changelogs/archive/2024-02.yml @@ -236,3 +236,36 @@ - rscadd: Adds a new suicide_act() to the smite spell Zergspower: - bugfix: icebox ore generation underground is normal again +2024-02-10: + 00-Steven: + - bugfix: As they should've for a while, screwdrivers (cocktail) actually work as + screwdrivers (tool). + - sound: The screwdriver cocktail also actually plays the screwdriver sound when + used. + 1393F: + - bugfix: The HFR now provides the max temperature for recipes + - bugfix: the crystallizer now provides the dangerous object created instead of + itself in admin logging + Ben10Omintrix: + - rscadd: settlers can rename their pets + FernandoJ8: + - code_imp: added an IS_CHANGELING() helper and used it where applicable + Holoo-1: + - admin: remade everyone is traitor into everyone is antag in secrets panel + IndieanaJones: + - bugfix: Bolas in your pockets no longer slow you down. + JohnFulpWillard: + - rscadd: Changeling's reviving stasis ability now puts you in stasis. + LT3: + - qol: Health analyzer will now display blood alcohol content + LemonInTheDark: + - rscdel: Removes halloween screen tint, we're taking him to retire by the seaside + (he was alone and unloved) + Melbert: + - bugfix: Fixed some situations in which you couldn't interact with heretic runes + - bugfix: Fixed Finger Guns giving a misleading chat message + - bugfix: You know that one bug that makes the cryo cells on Deltastation unusuable? + Well it's not fixed but at least those cryo cells are usuable again, maybe at + the cost of another station's cryo cells. Who knows! + larentoun: + - bugfix: Now falsewalls visually don't close when they shouldn't. From d9243d1016e3e370e4564495472a2f8d0ec59dc6 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:26:00 -0600 Subject: [PATCH 04/19] Refactors fire overlays once again to make it not get stuck so often (#81367) ## About The Pull Request Maybe finally fixes #77701 A big reason why this kept happening is because fire uses standing overlays. But fire isn't managed by mobs anymore. Meaning in some situations, fire can cease to exist but the overlay can still be on the mob. So it gets stuck. So like, why use standing overlays anymore? We can just hook `update_overlays` signal. Isn't that neat. ## Changelog :cl: Melbert refactor: Fire effects get added to mobs in a different way now. Maybe it will get stuck less. Report any oddities. /:cl: --- code/__DEFINES/mobs.dm | 9 ++--- code/__DEFINES/status_effects.dm | 5 +++ code/__DEFINES/traits/declarations.dm | 4 +- code/_globalvars/traits/_traits.dm | 2 +- code/_globalvars/traits/admin_tooling.dm | 2 +- .../datums/elements/permanent_fire_overlay.dm | 26 ++++++++++++ .../status_effects/debuffs/fire_stacks.dm | 40 +++++++++---------- code/game/turfs/open/lava.dm | 7 ++-- code/modules/mob/living/basic/basic.dm | 22 +++++----- .../mob/living/carbon/carbon_update_icons.dm | 31 +++++--------- .../carbon/human/species_types/plasmamen.dm | 2 +- .../modules/mob/living/carbon/init_signals.dm | 12 ------ code/modules/mob/living/living.dm | 24 +++++------ .../modules/mob/living/silicon/robot/robot.dm | 26 +++++------- tgstation.dme | 1 + 15 files changed, 103 insertions(+), 110 deletions(-) create mode 100644 code/datums/elements/permanent_fire_overlay.dm diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index d85e62615d48b..2e1eac6672d2a 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -486,9 +486,6 @@ #define ROBOTIC_BRUTE_EXAMINE_TEXT "denting" #define ROBOTIC_BURN_EXAMINE_TEXT "charring" -// If a mob has a higher threshold than this, the icon shown will be increased to the big fire icon. -#define MOB_BIG_FIRE_STACK_THRESHOLD 3 - #define GRAB_PIXEL_SHIFT_PASSIVE 6 #define GRAB_PIXEL_SHIFT_AGGRESSIVE 12 #define GRAB_PIXEL_SHIFT_NECK 16 @@ -756,8 +753,8 @@ GLOBAL_LIST_INIT(human_heights_to_offsets, list( #define WOUND_LAYER 3 /// Blood cult ascended halo layer, because there's currently no better solution for adding/removing #define HALO_LAYER 2 -/// Fire layer when you're on fire -#define FIRE_LAYER 1 +/// The highest most layer for mob overlays. Unused +#define HIGHEST_LAYER 1 #define UPPER_BODY "upper body" #define LOWER_BODY "lower body" @@ -798,7 +795,7 @@ GLOBAL_LIST_INIT(layers_to_offset, list( // BODY_BEHIND_LAYER (external organs like wings) // BODY_FRONT_LAYER (external organs like wings) // DAMAGE_LAYER (full body) - // FIRE_LAYER (full body) + // HIGHEST_LAYER (full body) // UNIFORM_LAYER (full body) // WOUND_LAYER (full body) )) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 768f1faa514f1..4e901c4ba2ce2 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -31,6 +31,11 @@ /// If the incapacitated status effect will ignore a mob being agressively grabbed #define IGNORE_GRAB (1<<2) +/// Maxamounts of fire stacks a mob can get +#define MAX_FIRE_STACKS 20 +/// If a mob has a higher threshold than this, the icon shown will be increased to the big fire icon. +#define MOB_BIG_FIRE_STACK_THRESHOLD 3 + // Grouped effect sources, see also code/__DEFINES/traits.dm #define STASIS_MACHINE_EFFECT "stasis_machine" diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 867f567be00fa..4e0a0f5b8f984 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -353,8 +353,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_TUMOR_SUPPRESSED "brain_tumor_suppressed" /// Prevents hallucinations from the hallucination brain trauma (RDS) #define TRAIT_RDS_SUPPRESSED "rds_suppressed" -/// mobs that have this trait cannot be extinguished -#define TRAIT_PERMANENTLY_ONFIRE "permanently_onfire" +/// Mobs that have this trait cannot be extinguished +#define TRAIT_NO_EXTINGUISH "no_extinguish" /// Indicates if the mob is currently speaking with sign language #define TRAIT_SIGN_LANG "sign_language" /// This mob is able to use sign language over the radio. diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index aba502d16ee71..d58940485ac88 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -318,6 +318,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_NO_DEBRAIN_OVERLAY" = TRAIT_NO_DEBRAIN_OVERLAY, "TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY, "TRAIT_NO_DNA_SCRAMBLE" = TRAIT_NO_DNA_SCRAMBLE, + "TRAIT_NO_EXTINGUISH" = TRAIT_NO_EXTINGUISH, "TRAIT_NO_FLOATING_ANIM" = TRAIT_NO_FLOATING_ANIM, "TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE, "TRAIT_NO_GUN_AKIMBO" = TRAIT_NO_GUN_AKIMBO, @@ -353,7 +354,6 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_PASSTABLE" = TRAIT_PASSTABLE, "TRAIT_PERFECT_ATTACKER" = TRAIT_PERFECT_ATTACKER, "TRAIT_PERMANENTLY_MORTAL" = TRAIT_PERMANENTLY_MORTAL, - "TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE, "TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER, "TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE, "TRAIT_PLANT_SAFE" = TRAIT_PLANT_SAFE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index c2148f2b7b698..01269087d3660 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -129,6 +129,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_NO_AUGMENTS" = TRAIT_NO_AUGMENTS, "TRAIT_NO_BLOOD_OVERLAY" = TRAIT_NO_BLOOD_OVERLAY, "TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY, + "TRAIT_NO_EXTINGUISH" = TRAIT_NO_EXTINGUISH, "TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE, "TRAIT_NO_PLASMA_TRANSFORM" = TRAIT_NO_PLASMA_TRANSFORM, "TRAIT_NO_SLIP_ALL" = TRAIT_NO_SLIP_ALL, @@ -162,7 +163,6 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_PARALYSIS_R_LEG" = TRAIT_PARALYSIS_R_LEG, "TRAIT_PASSTABLE" = TRAIT_PASSTABLE, "TRAIT_PERFECT_ATTACKER" = TRAIT_PERFECT_ATTACKER, - "TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE, "TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER, "TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE, "TRAIT_PLANT_SAFE" = TRAIT_PLANT_SAFE, diff --git a/code/datums/elements/permanent_fire_overlay.dm b/code/datums/elements/permanent_fire_overlay.dm new file mode 100644 index 0000000000000..e4a61852aed74 --- /dev/null +++ b/code/datums/elements/permanent_fire_overlay.dm @@ -0,0 +1,26 @@ +/// When applied to a mob, they will always have a fire overlay regardless of if they are *actually* on fire. +/datum/element/perma_fire_overlay + +/datum/element/perma_fire_overlay/Attach(atom/target) + . = ..() + if(!isliving(target)) + return ELEMENT_INCOMPATIBLE + + RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay)) + target.update_appearance(UPDATE_OVERLAYS) + ADD_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type)) + +/datum/element/perma_fire_overlay/Detach(atom/target) + . = ..() + UnregisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS) + REMOVE_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type)) + target.update_appearance(UPDATE_OVERLAYS) + +/datum/element/perma_fire_overlay/proc/add_fire_overlay(mob/living/source, list/overlays) + SIGNAL_HANDLER + + var/mutable_appearance/created_overlay = source.get_fire_overlay(stacks = MAX_FIRE_STACKS, on_fire = TRUE) + if(isnull(created_overlay)) + return + + overlays |= created_overlay diff --git a/code/datums/status_effects/debuffs/fire_stacks.dm b/code/datums/status_effects/debuffs/fire_stacks.dm index 4a6e7b6b730f6..2f32ff5b3bedf 100644 --- a/code/datums/status_effects/debuffs/fire_stacks.dm +++ b/code/datums/status_effects/debuffs/fire_stacks.dm @@ -7,7 +7,7 @@ /// Current amount of stacks we have var/stacks /// Maximum of stacks that we could possibly get - var/stack_limit = 20 + var/stack_limit = MAX_FIRE_STACKS /// What status effect types do we remove uppon being applied. These are just deleted without any deduction from our or their stacks when forced. var/list/enemy_types /// What status effect types do we merge into if they exist. Ignored when forced. @@ -116,12 +116,8 @@ owner.clear_alert(ALERT_FIRE) else if(!was_on_fire && owner.on_fire) owner.throw_alert(ALERT_FIRE, /atom/movable/screen/alert/fire) - -/** - * Used to update owner's effect overlay - */ - -/datum/status_effect/fire_handler/proc/update_overlay() + owner.update_appearance(UPDATE_OVERLAYS) + update_particles() /datum/status_effect/fire_handler/fire_stacks id = "fire_stacks" //fire_stacks and wet_stacks should have different IDs or else has_status_effect won't work @@ -132,8 +128,6 @@ /// If we're on fire var/on_fire = FALSE - /// Stores current fire overlay icon state, for optimisation purposes - var/last_icon_state /// Reference to the mob light emitter itself var/obj/effect/dummy/lighting_obj/moblight /// Type of mob light emitter we use when on fire @@ -160,8 +154,6 @@ return TRUE deal_damage(seconds_between_ticks) - update_overlay() - update_particles() /datum/status_effect/fire_handler/fire_stacks/update_particles() if(on_fire) @@ -239,8 +231,6 @@ moblight = new moblight_type(owner) cache_stacks() - update_overlay() - update_particles() SEND_SIGNAL(owner, COMSIG_LIVING_IGNITED, owner) return TRUE @@ -254,8 +244,6 @@ owner.clear_mood_event("on_fire") SEND_SIGNAL(owner, COMSIG_LIVING_EXTINGUISHED, owner) cache_stacks() - update_overlay() - update_particles() for(var/obj/item/equipped in owner.get_equipped_items()) equipped.extinguish() @@ -263,16 +251,26 @@ if(on_fire) extinguish() set_stacks(0) - update_overlay() - update_particles() + UnregisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS) + owner.update_appearance(UPDATE_OVERLAYS) return ..() -/datum/status_effect/fire_handler/fire_stacks/update_overlay() - last_icon_state = owner.update_fire_overlay(stacks, on_fire, last_icon_state) - /datum/status_effect/fire_handler/fire_stacks/on_apply() . = ..() - update_overlay() + RegisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay)) + owner.update_appearance(UPDATE_OVERLAYS) + +/datum/status_effect/fire_handler/fire_stacks/proc/add_fire_overlay(mob/living/source, list/overlays) + SIGNAL_HANDLER + + if(stacks <= 0 || !on_fire) + return + + var/mutable_appearance/created_overlay = owner.get_fire_overlay(stacks, on_fire) + if(isnull(created_overlay)) + return + + overlays |= created_overlay /obj/effect/dummy/lighting_obj/moblight/fire name = "fire" diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index 1a174723d85b8..30bed8fc87c1c 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -52,7 +52,7 @@ /turf/open/lava/Destroy() for(var/mob/living/leaving_mob in contents) - REMOVE_TRAIT(leaving_mob, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT) + leaving_mob.RemoveElement(/datum/element/perma_fire_overlay) return ..() /turf/open/lava/update_overlays() @@ -144,7 +144,7 @@ /turf/open/lava/Exited(atom/movable/gone, direction) . = ..() if(isliving(gone) && !islava(gone.loc)) - REMOVE_TRAIT(gone, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT) + gone.RemoveElement(/datum/element/perma_fire_overlay) /turf/open/lava/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) if(burn_stuff(AM)) @@ -311,10 +311,9 @@ return var/mob/living/burn_living = burn_target - ADD_TRAIT(burn_living, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT) + burn_living.AddElement(/datum/element/perma_fire_overlay) burn_living.ignite_mob() burn_living.adjust_fire_stacks(lava_firestacks * seconds_per_tick) - burn_living.update_fire() burn_living.adjustFireLoss(lava_damage * seconds_per_tick) /turf/open/lava/can_cross_safely(atom/movable/crossing) diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index ba07c944652e4..d69665d6bcdec 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -270,17 +270,17 @@ /mob/living/basic/on_fire_stack(seconds_per_tick, datum/status_effect/fire_handler/fire_stacks/fire_handler) adjust_bodytemperature((maximum_survivable_temperature + (fire_handler.stacks * 12)) * 0.5 * seconds_per_tick) -/mob/living/basic/update_fire_overlay(stacks, on_fire, last_icon_state, suffix = "") - var/mutable_appearance/fire_overlay = mutable_appearance('icons/mob/effects/onfire.dmi', "generic_fire") - if(on_fire && isnull(last_icon_state)) - add_overlay(fire_overlay) - return fire_overlay - else if(!on_fire && !isnull(last_icon_state)) - cut_overlay(fire_overlay) - return null - else if(on_fire && !isnull(last_icon_state)) - return last_icon_state - return null +/mob/living/basic/get_fire_overlay(stacks, on_fire) + var/fire_icon = "generic_fire" + if(!GLOB.fire_appearances[fire_icon]) + GLOB.fire_appearances[fire_icon] = mutable_appearance( + 'icons/mob/effects/onfire.dmi', + fire_icon, + -HIGHEST_LAYER, + appearance_flags = RESET_COLOR, + ) + + return GLOB.fire_appearances[fire_icon] /mob/living/basic/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, ignore_animation = TRUE) . = ..() diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 7aa9afba95ea1..8dfa0be5e2b0c 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -278,8 +278,8 @@ update_held_items() update_worn_handcuffs() update_worn_legcuffs() - update_fire() update_body() + update_appearance(UPDATE_OVERLAYS) /mob/living/carbon/update_held_items() . = ..() @@ -315,27 +315,18 @@ hands += I.build_worn_icon(default_layer = HANDS_LAYER, default_icon_file = icon_file, isinhands = TRUE) return hands -/mob/living/carbon/update_fire_overlay(stacks, on_fire, last_icon_state, suffix = "") - var/fire_icon = "[dna?.species.fire_overlay || "human"]_[stacks > MOB_BIG_FIRE_STACK_THRESHOLD ? "big_fire" : "small_fire"][suffix]" +/mob/living/carbon/get_fire_overlay(stacks, on_fire) + var/fire_icon = "[dna?.species.fire_overlay || "human"]_[stacks > MOB_BIG_FIRE_STACK_THRESHOLD ? "big_fire" : "small_fire"]" if(!GLOB.fire_appearances[fire_icon]) - GLOB.fire_appearances[fire_icon] = mutable_appearance('icons/mob/effects/onfire.dmi', fire_icon, -FIRE_LAYER, appearance_flags = RESET_COLOR) - - if((stacks > 0 && on_fire) || HAS_TRAIT(src, TRAIT_PERMANENTLY_ONFIRE)) - if(fire_icon == last_icon_state) - return last_icon_state - - remove_overlay(FIRE_LAYER) - overlays_standing[FIRE_LAYER] = GLOB.fire_appearances[fire_icon] - apply_overlay(FIRE_LAYER) - return fire_icon - - if(!last_icon_state) - return last_icon_state - - remove_overlay(FIRE_LAYER) - apply_overlay(FIRE_LAYER) - return null + GLOB.fire_appearances[fire_icon] = mutable_appearance( + 'icons/mob/effects/onfire.dmi', + fire_icon, + -HIGHEST_LAYER, + appearance_flags = RESET_COLOR, + ) + + return GLOB.fire_appearances[fire_icon] /mob/living/carbon/update_damage_overlays() remove_overlay(DAMAGE_LAYER) diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index 8ce8be6f6d6b5..c9fa732b2880d 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -115,7 +115,7 @@ else internal_fire = FALSE - H.update_fire() + H.update_appearance(UPDATE_OVERLAYS) /datum/species/plasmaman/handle_fire(mob/living/carbon/human/H, seconds_per_tick, no_protection = FALSE) if(internal_fire) diff --git a/code/modules/mob/living/carbon/init_signals.dm b/code/modules/mob/living/carbon/init_signals.dm index 190fe9d845342..e64410ab63573 100644 --- a/code/modules/mob/living/carbon/init_signals.dm +++ b/code/modules/mob/living/carbon/init_signals.dm @@ -13,12 +13,6 @@ RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_TOXIMMUNE), PROC_REF(on_toximmune_trait_gain)) RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_GENELESS), PROC_REF(on_geneless_trait_gain)) - - RegisterSignals(src, list( - SIGNAL_ADDTRAIT(TRAIT_PERMANENTLY_ONFIRE), - SIGNAL_REMOVETRAIT(TRAIT_PERMANENTLY_ONFIRE), - ), PROC_REF(update_permanently_on_fire)) - /** * On gain of TRAIT_AGENDER * @@ -90,12 +84,6 @@ reagents.end_metabolization(keep_liverless = TRUE) -///On gain of TRAIT_PERMANENTLY_ONFIRE, update the visuals if not on fire -/mob/living/carbon/proc/update_permanently_on_fire(datum/source) - SIGNAL_HANDLER - if(!on_fire) - update_fire() - /** * On gain of TRAIT_VIRUSIMMUNE * diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f518e29a2b426..e096434cbb966 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1580,11 +1580,6 @@ GLOBAL_LIST_EMPTY(fire_appearances) return fire_status.ignite(silent) -/mob/living/proc/update_fire() - var/datum/status_effect/fire_handler/fire_stacks/fire_stacks = has_status_effect(/datum/status_effect/fire_handler/fire_stacks) - if(fire_stacks) - fire_stacks.update_overlay() - /** * Extinguish all fire on the mob * @@ -1592,7 +1587,7 @@ GLOBAL_LIST_EMPTY(fire_appearances) * Signals the extinguishing. */ /mob/living/proc/extinguish_mob() - if(HAS_TRAIT(src, TRAIT_PERMANENTLY_ONFIRE)) //The everlasting flames will not be extinguished + if(HAS_TRAIT(src, TRAIT_NO_EXTINGUISH)) //The everlasting flames will not be extinguished return var/datum/status_effect/fire_handler/fire_stacks/fire_status = has_status_effect(/datum/status_effect/fire_handler/fire_stacks) if(!fire_status || !fire_status.on_fire) @@ -1611,13 +1606,13 @@ GLOBAL_LIST_EMPTY(fire_appearances) /mob/living/proc/adjust_fire_stacks(stacks, fire_type = /datum/status_effect/fire_handler/fire_stacks) if(stacks < 0) - if(HAS_TRAIT(src, TRAIT_PERMANENTLY_ONFIRE)) //You can't reduce fire stacks of the everlasting flames + if(HAS_TRAIT(src, TRAIT_NO_EXTINGUISH)) //You can't reduce fire stacks of the everlasting flames return stacks = max(-fire_stacks, stacks) apply_status_effect(fire_type, stacks) /mob/living/proc/adjust_wet_stacks(stacks, wet_type = /datum/status_effect/fire_handler/wet_stacks) - if(HAS_TRAIT(src, TRAIT_PERMANENTLY_ONFIRE)) //The everlasting flames will not be extinguished + if(HAS_TRAIT(src, TRAIT_NO_EXTINGUISH)) //The everlasting flames will not be extinguished return if(stacks < 0) stacks = max(fire_stacks, stacks) @@ -1695,19 +1690,18 @@ GLOBAL_LIST_EMPTY(fire_appearances) ignite_mob() /** - * Sets fire overlay of the mob. + * Gets the fire overlay to use for this mob * - * Vars: + * Args: * * stacks: Current amount of fire_stacks * * on_fire: If we're lit on fire - * * last_icon_state: Holds last fire overlay icon state, used for optimization - * * suffix: Suffix for the fire icon state for special fire types * - * This should return last_icon_state for the fire status efect + * Return a mutable appearance, the overlay that will be applied. */ -/mob/living/proc/update_fire_overlay(stacks, on_fire, last_icon_state, suffix = "") - return last_icon_state +/mob/living/proc/get_fire_overlay(stacks, on_fire) + RETURN_TYPE(/mutable_appearance) + return null /** * Handles effects happening when mob is on normal fire diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index ed9cbe09352c3..f73336fe963d7 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -352,7 +352,7 @@ var/mutable_appearance/head_overlay = hat.build_worn_icon(default_layer = 20, default_icon_file = 'icons/mob/clothing/head/default.dmi') head_overlay.pixel_z += hat_offset add_overlay(head_overlay) - update_fire() + update_appearance(UPDATE_OVERLAYS) /mob/living/silicon/robot/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents) if(same_z_layer) @@ -1017,25 +1017,19 @@ /mob/living/silicon/robot/proc/untip_roleplay() to_chat(src, span_notice("Your frustration has empowered you! You can now right yourself faster!")) -/mob/living/silicon/robot/update_fire_overlay(stacks, on_fire, last_icon_state, suffix = "") - var/fire_icon = "generic_fire[suffix]" +/mob/living/silicon/robot/get_fire_overlay(stacks, on_fire) + var/fire_icon = "generic_fire" if(!GLOB.fire_appearances[fire_icon]) - var/mutable_appearance/new_fire_overlay = mutable_appearance('icons/mob/effects/onfire.dmi', fire_icon, -FIRE_LAYER) - new_fire_overlay.appearance_flags = RESET_COLOR + var/mutable_appearance/new_fire_overlay = mutable_appearance( + 'icons/mob/effects/onfire.dmi', + fire_icon, + -HIGHEST_LAYER, + appearance_flags = RESET_COLOR, + ) GLOB.fire_appearances[fire_icon] = new_fire_overlay - if(stacks && on_fire) - if(last_icon_state == fire_icon) - return last_icon_state - add_overlay(GLOB.fire_appearances[fire_icon]) - return fire_icon - - if(!last_icon_state) - return last_icon_state - - cut_overlay(GLOB.fire_appearances[fire_icon]) - return null + return GLOB.fire_appearances[fire_icon] /// Draw power from the robot /mob/living/silicon/robot/proc/draw_power(power_to_draw) diff --git a/tgstation.dme b/tgstation.dme index d14bab6c226f4..0c076bc191d09 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1444,6 +1444,7 @@ #include "code\datums\elements\openspace_item_click_handler.dm" #include "code\datums\elements\ore_collecting.dm" #include "code\datums\elements\organ_set_bonus.dm" +#include "code\datums\elements\permanent_fire_overlay.dm" #include "code\datums\elements\pet_bonus.dm" #include "code\datums\elements\plant_backfire.dm" #include "code\datums\elements\point_of_interest.dm" From addb9e0a3cb415f1a68bbe3602bb7c143004b19a Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:26:16 -0600 Subject: [PATCH 05/19] Nerfs probability that a rat decides to bite a cable (#81364) ## About The Pull Request Rats are 5x less likely to decide to bite a cable ## Why It's Good For The Game Way back when I converted rats to basic mobs, *something* went wrong and rats bite cables wayyyy too often now - it's not uncommon to see a rat has de-cabled an entire section of maint due to some good luck. Funny but not how it functioned originally. I always intended to tone it back down and just never got around to it. ## Changelog :cl: Melbert balance: Rats are now 5x less likely to decide to eat a cable when idling. (1%, down from 5%) /:cl: --- code/datums/ai/hunting_behavior/hunting_mouse.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/ai/hunting_behavior/hunting_mouse.dm b/code/datums/ai/hunting_behavior/hunting_mouse.dm index d4160f826dd6b..d0e7161fd2de6 100644 --- a/code/datums/ai/hunting_behavior/hunting_mouse.dm +++ b/code/datums/ai/hunting_behavior/hunting_mouse.dm @@ -11,7 +11,7 @@ finding_behavior = /datum/ai_behavior/find_hunt_target/mouse_cable hunt_targets = list(/obj/structure/cable) hunt_range = 0 // Only look below us - hunt_chance = 5 + hunt_chance = 1 // When looking for a cable, we can only bite things we can reach. /datum/ai_behavior/find_hunt_target/mouse_cable From 657f0d2ff0e9456f56a17ea5b01278f0dfbb71c2 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 13:26:18 +1300 Subject: [PATCH 06/19] Automatic changelog for PR #81367 [ci skip] --- html/changelogs/AutoChangeLog-pr-81367.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81367.yml diff --git a/html/changelogs/AutoChangeLog-pr-81367.yml b/html/changelogs/AutoChangeLog-pr-81367.yml new file mode 100644 index 0000000000000..336fefb2e7497 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81367.yml @@ -0,0 +1,4 @@ +author: "Melbert" +delete-after: True +changes: + - refactor: "Fire effects get added to mobs in a different way now. Maybe it will get stuck less. Report any oddities." \ No newline at end of file From 708cec1e5166ba4348573691f9b283b9ec36403d Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 13:26:39 +1300 Subject: [PATCH 07/19] Automatic changelog for PR #81364 [ci skip] --- html/changelogs/AutoChangeLog-pr-81364.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81364.yml diff --git a/html/changelogs/AutoChangeLog-pr-81364.yml b/html/changelogs/AutoChangeLog-pr-81364.yml new file mode 100644 index 0000000000000..aa8ad537b2ed6 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81364.yml @@ -0,0 +1,4 @@ +author: "Melbert" +delete-after: True +changes: + - balance: "Rats are now 5x less likely to decide to eat a cable when idling. (1%, down from 5%)" \ No newline at end of file From 18a5b5011f7cb1ab9a8eeac2fc1832338db5fd4c Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 10 Feb 2024 00:15:41 -0500 Subject: [PATCH 08/19] Cucumber Lemonade now has a price (#81368) ## About The Pull Request One of the bar restaurant bots asks for cucumber lemonade but it has no price attached to it, so it takes this drink (that requires help from botany) and gives nothing in exchange, this fixes that. ## Why It's Good For The Game bug fix ## Changelog :cl: fix: Bar bots asking for Cucumber Lemonade now gives you money for completing it. /:cl: --- .../modules/reagents/chemistry/reagents/drinks/drink_reagents.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/reagents/chemistry/reagents/drinks/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drinks/drink_reagents.dm index e76e0e8fbb5c5..5365cea34841f 100644 --- a/code/modules/reagents/chemistry/reagents/drinks/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drinks/drink_reagents.dm @@ -1170,6 +1170,7 @@ quality = DRINK_GOOD taste_description = "citrus soda with cucumber" chemical_flags = REAGENT_CAN_BE_SYNTHESIZED + glass_price = DRINK_PRICE_HIGH /datum/reagent/consumable/cucumberlemonade/on_mob_life(mob/living/carbon/doll, seconds_per_tick, times_fired) . = ..() From 4bb50476b86d593e743a2fd77412134cc7200dc0 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:16:00 +1300 Subject: [PATCH 09/19] Automatic changelog for PR #81368 [ci skip] --- html/changelogs/AutoChangeLog-pr-81368.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81368.yml diff --git a/html/changelogs/AutoChangeLog-pr-81368.yml b/html/changelogs/AutoChangeLog-pr-81368.yml new file mode 100644 index 0000000000000..e4e5edda82dc5 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81368.yml @@ -0,0 +1,4 @@ +author: "JohnFulpWillard" +delete-after: True +changes: + - bugfix: "Bar bots asking for Cucumber Lemonade now gives you money for completing it." \ No newline at end of file From 3e325829ab96f966e4cd2b41a8c1597719a7a057 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 10 Feb 2024 00:17:29 -0500 Subject: [PATCH 10/19] Space dragon no longer turns the entire roundend report bold (#81370) ## About The Pull Request Fixes the entire roundend report turning bold if there was a space dragon with carp. ## Why It's Good For The Game yet another roundend report issue fixed. ## Changelog :cl: fix: Space Dragon's carp allies no longer turn the entire roundend report into bold. /:cl: --- code/modules/antagonists/space_dragon/space_dragon.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/antagonists/space_dragon/space_dragon.dm b/code/modules/antagonists/space_dragon/space_dragon.dm index 4b385b70e596c..25543fbc8fe86 100644 --- a/code/modules/antagonists/space_dragon/space_dragon.dm +++ b/code/modules/antagonists/space_dragon/space_dragon.dm @@ -263,7 +263,7 @@ players_to_carp_taken[carpy.key] += 1 var/list = "" for(var/carp_user in players_to_carp_taken) - list += "
  • [carp_user], who played [players_to_carp_taken[carp_user]] space carps.
  • " + list += "
  • [carp_user], who played [players_to_carp_taken[carp_user]] space carps.
  • " parts += list parts += "" From a0092ac0e33dd2c42df6957b6f4be448a70fc0f4 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:19:47 +1300 Subject: [PATCH 11/19] Automatic changelog for PR #81370 [ci skip] --- html/changelogs/AutoChangeLog-pr-81370.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81370.yml diff --git a/html/changelogs/AutoChangeLog-pr-81370.yml b/html/changelogs/AutoChangeLog-pr-81370.yml new file mode 100644 index 0000000000000..62147dfb7e88c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81370.yml @@ -0,0 +1,4 @@ +author: "JohnFulpWillard" +delete-after: True +changes: + - bugfix: "Space Dragon's carp allies no longer turn the entire roundend report into bold." \ No newline at end of file From 07cb0d9a0caced35a5898ef6dd06d4c76efecab4 Mon Sep 17 00:00:00 2001 From: necromanceranne <40847847+necromanceranne@users.noreply.github.com> Date: Sat, 10 Feb 2024 17:07:18 +1100 Subject: [PATCH 12/19] Fixes the typepath of the shove blocker module. (#81374) ## About The Pull Request The bulwark module had the wrong typepath for most of the descriptive elements and its complexity. So the shove block was a free module. And technically not incompatible with itself. Oh my. Not super relevant for actual play, as there is no access to this module anywhere currently, but who knows. ## Why It's Good For The Game Typepaths. ## Changelog :cl: fix: The shove blocker module parent type now has the correct typepath. /:cl: --- code/modules/mod/modules/modules_security.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mod/modules/modules_security.dm b/code/modules/mod/modules/modules_security.dm index fddec2ef13d6c..0b8c0299f04b9 100644 --- a/code/modules/mod/modules/modules_security.dm +++ b/code/modules/mod/modules/modules_security.dm @@ -579,7 +579,7 @@ #undef STORMTROOPER_MODE #undef SHARPSHOOTER_MODE -/obj/item/mod/module/anti_stagger +/obj/item/mod/module/shove_blocker name = "MOD bulwark module" desc = "Layers upon layers of shock dampening plates, just to stop you from getting shoved into a wall by an angry mob." icon_state = "bulwark" From 3d59db14267ee1acab584106dbf842df2614ce53 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:07:37 +1300 Subject: [PATCH 13/19] Automatic changelog for PR #81374 [ci skip] --- html/changelogs/AutoChangeLog-pr-81374.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81374.yml diff --git a/html/changelogs/AutoChangeLog-pr-81374.yml b/html/changelogs/AutoChangeLog-pr-81374.yml new file mode 100644 index 0000000000000..718ea78e81c20 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81374.yml @@ -0,0 +1,4 @@ +author: "necromanceranne" +delete-after: True +changes: + - bugfix: "The shove blocker module parent type now has the correct typepath." \ No newline at end of file From 2f93bbdd4c10069f80596cc2dc7295323b8f4bbf Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Sat, 10 Feb 2024 21:45:09 +0530 Subject: [PATCH 14/19] Fixes high power consumption for lathes (#81375) ## About The Pull Request This employs a formula that creates a relationship between total stacks of material used & the machines active power consumption - When inserting/ejecting a full stack of materials, lathes use 1% of the machine active power usage. To put it in player terms if your apc has a normal high capacity power cell it will use 2% of power when inserting a full stack(50 sheets) of material or when ejecting a full stack of materials - Fixes #81366. When printing multiple items that would require a full stack of materials (50 sheets or roughly 5000 matter units) It now uses 5% of the machine active power usage. To see the comparision we will see the same examples used in the issue **Old Behaviour** - Printing 10 large beakers for tier 1 lathe would consume 48% of apc cell - Printing 1 circular saw for tier 1 lathe would consume 32% of apc cell **New Behaviour** - Printing 10 large beakers for tier 1 lathe now consumes just 5% of apc cell - Printing 1 circular saw for tier 1 lathe now consumes just 1% of apc cell - Higher tier parts will consume more power to compensate for the lower material costs because the machines active power usage increases with higher tier parts, assuming your apc has a normal high capacity power cell - Printing 10 large beakers for tier 4 lathe now consumes 12% of apc cell - Printing 1 circular saw for tier 4 lathe now consumes 5% of apc cell This formula is experimental and i just made it up so let's see how this plays out ## Changelog :cl: fix: lathes now use moderate power for printing operations /:cl: --- code/game/machinery/autolathe.dm | 5 +++-- code/modules/research/machinery/_production.dm | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index f6600942cdeee..ba9667b3e5809 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -97,7 +97,8 @@ flick("autolathe_[item_inserted.has_material_type(/datum/material/glass) ? "r" : "o"]", src) - directly_use_power(round((amount_inserted / SHEET_MATERIAL_AMOUNT) * active_power_usage * 0.0025)) + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + directly_use_power(ROUND_UP((amount_inserted / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * 0.01 * initial(active_power_usage))) /obj/machinery/autolathe/ui_interact(mob/user, datum/tgui/ui) if(!is_operational) @@ -273,7 +274,7 @@ var/charge_per_item = 0 for(var/material in design.materials) charge_per_item += design.materials[material] - charge_per_item = min(active_power_usage, round(charge_per_item * material_cost_coefficient)) + charge_per_item = ROUND_UP((charge_per_item / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * material_cost_coefficient * 0.05 * active_power_usage) var/build_time_per_item = (design.construction_time * design.lathe_time_factor) ** 0.8 //do the printing sequentially diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index d71e6244e886f..f95145b4b9406 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -23,6 +23,7 @@ . = ..() cached_designs = list() + materials = AddComponent( /datum/component/remote_materials, \ mapload, \ @@ -65,7 +66,6 @@ stripe.color = stripe_color . += stripe - /obj/machinery/rnd/production/examine(mob/user) . = ..() if(!in_range(user, src) && !isobserver(user)) @@ -144,7 +144,8 @@ /obj/machinery/rnd/proc/process_item(obj/item/item_inserted, list/mats_consumed, amount_inserted) PRIVATE_PROC(TRUE) - if(directly_use_power(round((amount_inserted / SHEET_MATERIAL_AMOUNT) * active_power_usage * 0.00025))) + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + if(directly_use_power(ROUND_UP((amount_inserted / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * 0.01 * initial(active_power_usage)))) var/mat_name = "iron" var/highest_mat = 0 @@ -206,6 +207,7 @@ */ /obj/machinery/rnd/production/proc/build_efficiency(path) PRIVATE_PROC(TRUE) + SHOULD_BE_PURE(TRUE) if(ispath(path, /obj/item/stack/sheet) || ispath(path, /obj/item/stack/ore/bluespace_crystal)) return 1 @@ -285,6 +287,11 @@ if(isnull(amount)) return + //we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it + if(!directly_use_power(ROUND_UP((amount / MAX_STACK_SIZE) * 0.01 * initial(active_power_usage)))) + say("No power to dispense sheets") + return + materials.eject_sheets(material, amount) return TRUE @@ -330,7 +337,7 @@ var/charge_per_item = 0 for(var/material in design.materials) charge_per_item += design.materials[material] - charge_per_item = min(active_power_usage, round(charge_per_item * coefficient)) + charge_per_item = ROUND_UP((charge_per_item / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * coefficient * 0.05 * active_power_usage) var/build_time_per_item = (design.construction_time * design.lathe_time_factor) ** 0.8 //start production From f37ddd575f47e7e85155216c199e1128df577c62 Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sun, 11 Feb 2024 05:15:28 +1300 Subject: [PATCH 15/19] Automatic changelog for PR #81375 [ci skip] --- html/changelogs/AutoChangeLog-pr-81375.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81375.yml diff --git a/html/changelogs/AutoChangeLog-pr-81375.yml b/html/changelogs/AutoChangeLog-pr-81375.yml new file mode 100644 index 0000000000000..a45fe58737d5d --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81375.yml @@ -0,0 +1,4 @@ +author: "SyncIt21" +delete-after: True +changes: + - bugfix: "lathes now use moderate power for printing operations" \ No newline at end of file From 33d59877392a9a832a19c6336db3a4a6aaed5292 Mon Sep 17 00:00:00 2001 From: Rhials <28870487+Rhials@users.noreply.github.com> Date: Sat, 10 Feb 2024 11:29:26 -0500 Subject: [PATCH 16/19] [NO GBP] Fixes raw ectoplasmic anomaly refining (#81377) ## About The Pull Request This adds a proper cap for raw ectoplasmic cores, so they can actually be refined now. Cool! ## Why It's Good For The Game Broken thing need fix oops argh. Closes #81369. ## Changelog :cl: Rhials fix: You can now refine ectoplasmic raw cores at the implosion machine thing. /:cl: --- code/__DEFINES/research/anomalies.dm | 1 + code/controllers/subsystem/research.dm | 1 + 2 files changed, 2 insertions(+) diff --git a/code/__DEFINES/research/anomalies.dm b/code/__DEFINES/research/anomalies.dm index 12a114439c7d9..707b7bd7a02e1 100644 --- a/code/__DEFINES/research/anomalies.dm +++ b/code/__DEFINES/research/anomalies.dm @@ -7,6 +7,7 @@ #define MAX_CORES_HALLUCINATION 8 #define MAX_CORES_BIOSCRAMBLER 8 #define MAX_CORES_DIMENSIONAL 8 +#define MAX_CORES_ECTOPLASMIC 8 ///Defines for the different types of explosion a flux anomaly can have #define FLUX_NO_EXPLOSION 0 diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index d0ebe00089380..612c599c0f62c 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -62,6 +62,7 @@ SUBSYSTEM_DEF(research) /obj/item/assembly/signaler/anomaly/hallucination = MAX_CORES_HALLUCINATION, /obj/item/assembly/signaler/anomaly/bioscrambler = MAX_CORES_BIOSCRAMBLER, /obj/item/assembly/signaler/anomaly/dimensional = MAX_CORES_DIMENSIONAL, + /obj/item/assembly/signaler/anomaly/ectoplasm = MAX_CORES_ECTOPLASMIC, ) /// Lookup list for ordnance briefers. From d850977c7cb1ceeabfc7568beb211fb2185e33cd Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sun, 11 Feb 2024 05:29:46 +1300 Subject: [PATCH 17/19] Automatic changelog for PR #81377 [ci skip] --- html/changelogs/AutoChangeLog-pr-81377.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81377.yml diff --git a/html/changelogs/AutoChangeLog-pr-81377.yml b/html/changelogs/AutoChangeLog-pr-81377.yml new file mode 100644 index 0000000000000..12be442e6a62f --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81377.yml @@ -0,0 +1,4 @@ +author: "Rhials" +delete-after: True +changes: + - bugfix: "You can now refine ectoplasmic raw cores at the implosion machine thing." \ No newline at end of file From fdcd4d39799552a406765d209cf0dc99f97ae5dc Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:57:19 -0500 Subject: [PATCH 18/19] Adds a signal to buying items from the uplink (& fixes TC misinfo) (#81372) ## About The Pull Request Adds a signal when someone buys an item from the uplink and removes single-letter vars from the ``spawn_item`` proc, and adds/standardizes add/removing of telecrystals from uplinks (and admin setting how much TC they have) to ensure the UI always has the right amount of telecrystals displayed in it. ## Why It's Good For The Game There are reasons why someone would want to hook up to a traitor's uplink and listen to items they purchase to do any special effect on-purchase, so this adds support to do anything in the future with it. Also tells players how much TC they actually have without forcing them to close/reopen the UI every time they insert some TC in it by hand. ## Changelog :cl: fix: Uplinks now update their UI when you add telecrystals in them, so you don't need to close and reopen it. /:cl: --- code/__DEFINES/dcs/signals/uplink.dm | 2 + code/datums/components/uplink.dm | 11 +---- code/datums/elements/uplink_reimburse.dm | 7 ++-- code/datums/mind/_mind.dm | 11 +++-- code/game/objects/items/stacks/telecrystal.dm | 2 +- .../nukeop/equipment/nuclear_challenge.dm | 2 +- code/modules/antagonists/nukeop/nukeop.dm | 4 +- .../antagonists/traitor/traitor_objective.dm | 4 +- .../antagonists/traitor/uplink_handler.dm | 9 ++++ .../living/basic/drone/extra_drone_types.dm | 2 +- .../computers/item/disks/virus_disk.dm | 2 +- code/modules/uplink/uplink_items.dm | 42 ++++++++++++------- tgstation.dme | 1 + 13 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 code/__DEFINES/dcs/signals/uplink.dm diff --git a/code/__DEFINES/dcs/signals/uplink.dm b/code/__DEFINES/dcs/signals/uplink.dm new file mode 100644 index 0000000000000..1daa4f312705c --- /dev/null +++ b/code/__DEFINES/dcs/signals/uplink.dm @@ -0,0 +1,2 @@ +///Signal sent to a mob when they purchase an item from their uplink: (datum/uplink_handler/uplink_handler_source, atom/spawned_item, mob/user) +#define COMSIG_ON_UPLINK_PURCHASE "comsig_on_uplink_purchase" diff --git a/code/datums/components/uplink.dm b/code/datums/components/uplink.dm index e418988c05806..e4e6e611ebca1 100644 --- a/code/datums/components/uplink.dm +++ b/code/datums/components/uplink.dm @@ -113,15 +113,6 @@ new /obj/effect/decal/cleanable/ash(get_turf(uplink_item)) qdel(uplink_item) -/// Adds telecrystals to the uplink. It is bad practice to use this outside of the component itself. -/datum/component/uplink/proc/add_telecrystals(telecrystals_added) - set_telecrystals(uplink_handler.telecrystals + telecrystals_added) - -/// Sets the telecrystals of the uplink. It is bad practice to use this outside of the component itself. -/datum/component/uplink/proc/set_telecrystals(new_telecrystal_amount) - uplink_handler.telecrystals = new_telecrystal_amount - uplink_handler.on_update() - /datum/component/uplink/InheritComponent(datum/component/uplink/uplink) lockable |= uplink.lockable active |= uplink.active @@ -135,7 +126,7 @@ if(!silent) to_chat(user, span_notice("You slot [telecrystals] into [parent] and charge its internal uplink.")) var/amt = telecrystals.amount - uplink_handler.telecrystals += amt + uplink_handler.add_telecrystals(amt) telecrystals.use(amt) log_uplink("[key_name(user)] loaded [amt] telecrystals into [parent]'s uplink") diff --git a/code/datums/elements/uplink_reimburse.dm b/code/datums/elements/uplink_reimburse.dm index 3ff182ec2314d..73a2032fee1df 100644 --- a/code/datums/elements/uplink_reimburse.dm +++ b/code/datums/elements/uplink_reimburse.dm @@ -22,7 +22,7 @@ RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) RegisterSignal(target, COMSIG_ITEM_ATTEMPT_TC_REIMBURSE, PROC_REF(reimburse)) RegisterSignal(target,COMSIG_TRAITOR_ITEM_USED(target.type), PROC_REF(used)) - + /datum/element/uplink_reimburse/Detach(datum/target) UnregisterSignal(target, list(COMSIG_ATOM_EXAMINE, COMSIG_TRAITOR_ITEM_USED(target.type), COMSIG_ITEM_ATTEMPT_TC_REIMBURSE)) @@ -47,10 +47,11 @@ to_chat(user, span_notice("You tap [uplink_comp.uplink_handler] with [refund_item], and a moment after [refund_item] disappears in a puff of red smoke!")) do_sparks(2, source = uplink_comp.uplink_handler) - uplink_comp.add_telecrystals(refundable_tc) + uplink_comp.uplink_handler.add_telecrystals(refundable_tc) qdel(refund_item) + /// If the item is used, it needs to no longer be refundable /datum/element/uplink_reimburse/proc/used(datum/target) SIGNAL_HANDLER - + Detach(target) diff --git a/code/datums/mind/_mind.dm b/code/datums/mind/_mind.dm index 84942a9684c3c..6bfdd6070c746 100644 --- a/code/datums/mind/_mind.dm +++ b/code/datums/mind/_mind.dm @@ -457,9 +457,14 @@ if(check_rights(R_FUN)) var/datum/component/uplink/U = find_syndicate_uplink() if(U) - var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.uplink_handler.telecrystals) as null | num - if(!isnull(crystals)) - U.uplink_handler.telecrystals = crystals + var/crystals = tgui_input_number( + user = usr, + message = "Amount of telecrystals for [key]", + title = "Syndicate uplink", + default = U.uplink_handler.telecrystals, + ) + if(crystals && isnum(crystals)) + U.uplink_handler.set_telecrystals(crystals) message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].") log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].") if("progression") diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index 51d21d6ef6cc3..a6bbe3bfe19d8 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -21,7 +21,7 @@ var/datum/component/uplink/hidden_uplink = uplink.GetComponent(/datum/component/uplink) if(hidden_uplink) - hidden_uplink.add_telecrystals(amount) + hidden_uplink.uplink_handler.add_telecrystals(amount) use(amount) to_chat(user, span_notice("You press [src] onto yourself and charge your hidden uplink.")) return ITEM_INTERACT_SUCCESS diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm index 734025e9a370e..a7611c2444821 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm @@ -118,7 +118,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) var/tc_per_nukie = round(tc_to_distribute / (length(orphans)+length(uplinks))) for (var/datum/component/uplink/uplink in uplinks) - uplink.add_telecrystals(tc_per_nukie) + uplink.uplink_handler.add_telecrystals(tc_per_nukie) tc_to_distribute -= tc_per_nukie for (var/mob/living/L in orphans) diff --git a/code/modules/antagonists/nukeop/nukeop.dm b/code/modules/antagonists/nukeop/nukeop.dm index cf7d90bccf6c3..6278d5ddaea91 100644 --- a/code/modules/antagonists/nukeop/nukeop.dm +++ b/code/modules/antagonists/nukeop/nukeop.dm @@ -63,7 +63,7 @@ var/extra_tc = CEILING(GLOB.joined_player_list.len/5, 5) var/datum/component/uplink/uplink = owner.find_syndicate_uplink() if (uplink) - uplink.add_telecrystals(extra_tc) + uplink.uplink_handler.add_telecrystals(extra_tc) var/datum/component/uplink/uplink = owner.find_syndicate_uplink() if(uplink) @@ -617,7 +617,7 @@ nukie.mind.add_antag_datum(antag_datum, src) var/datum/component/uplink/uplink = nukie.mind.find_syndicate_uplink() - uplink?.set_telecrystals(tc_to_spawn) + uplink?.uplink_handler.set_telecrystals(tc_to_spawn) // add some pizzazz do_sparks(4, FALSE, spawn_loc) diff --git a/code/modules/antagonists/traitor/traitor_objective.dm b/code/modules/antagonists/traitor/traitor_objective.dm index d60820c3fceeb..3e13340157334 100644 --- a/code/modules/antagonists/traitor/traitor_objective.dm +++ b/code/modules/antagonists/traitor/traitor_objective.dm @@ -191,7 +191,7 @@ handle_cleanup() log_traitor("[key_name(handler.owner)] [objective_state == OBJECTIVE_STATE_INACTIVE? "missed" : "failed"] [to_debug_string()]") if(penalty_cost) - handler.telecrystals -= penalty_cost + handler.add_telecrystals(-penalty_cost) objective_state = OBJECTIVE_STATE_FAILED else objective_state = OBJECTIVE_STATE_INVALID @@ -227,7 +227,7 @@ /// Called when rewards should be given to the user. /datum/traitor_objective/proc/completion_payout() handler.progression_points += progression_reward - handler.telecrystals += telecrystal_reward + handler.add_telecrystals(telecrystal_reward) /// Used for sending data to the uplink UI /datum/traitor_objective/proc/uplink_ui_data(mob/user) diff --git a/code/modules/antagonists/traitor/uplink_handler.dm b/code/modules/antagonists/traitor/uplink_handler.dm index aa26b360a7561..f78ddb0247892 100644 --- a/code/modules/antagonists/traitor/uplink_handler.dm +++ b/code/modules/antagonists/traitor/uplink_handler.dm @@ -254,3 +254,12 @@ return to_act_on.ui_perform_action(user, action) + +///Helper to add telecrystals to the uplink handler, calling set_telecrystals. +/datum/uplink_handler/proc/add_telecrystals(amount) + set_telecrystals(telecrystals + amount) + +///Sets how many telecrystals the uplink handler has, then updates the UI for any players watching. +/datum/uplink_handler/proc/set_telecrystals(amount) + telecrystals = amount + on_update() diff --git a/code/modules/mob/living/basic/drone/extra_drone_types.dm b/code/modules/mob/living/basic/drone/extra_drone_types.dm index 927d28f0ca249..08c9278b75331 100644 --- a/code/modules/mob/living/basic/drone/extra_drone_types.dm +++ b/code/modules/mob/living/basic/drone/extra_drone_types.dm @@ -33,7 +33,7 @@ /mob/living/basic/drone/syndrone/Initialize(mapload) . = ..() var/datum/component/uplink/hidden_uplink = internal_storage.GetComponent(/datum/component/uplink) - hidden_uplink.set_telecrystals(telecrystal_count) + hidden_uplink.uplink_handler.set_telecrystals(telecrystal_count) /obj/effect/mob_spawn/ghost_role/drone/syndrone name = "syndrone shell" diff --git a/code/modules/modular_computers/computers/item/disks/virus_disk.dm b/code/modules/modular_computers/computers/item/disks/virus_disk.dm index e3eac7736f504..3f646b22d8a06 100644 --- a/code/modules/modular_computers/computers/item/disks/virus_disk.dm +++ b/code/modules/modular_computers/computers/item/disks/virus_disk.dm @@ -154,7 +154,7 @@ hidden_uplink.uplink_handler.generate_objectives() SStraitor.register_uplink_handler(hidden_uplink.uplink_handler) else - hidden_uplink.add_telecrystals(telecrystals) + hidden_uplink.uplink_handler.add_telecrystals(telecrystals) telecrystals = 0 hidden_uplink.locked = FALSE hidden_uplink.active = TRUE diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 32783504fe871..65935f077e33d 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1,4 +1,3 @@ - // TODO: Work into reworked uplinks. /// Selects a set number of unique items from the uplink, and deducts a percentage discount from them /proc/create_uplink_sales(num, datum/uplink_category/category, limited_stock, list/sale_items) @@ -8,7 +7,20 @@ var/datum/uplink_item/taken_item = pick_n_take(sale_items_copy) var/datum/uplink_item/uplink_item = new taken_item.type() var/discount = uplink_item.get_discount() - var/list/disclaimer = list("Void where prohibited.", "Not recommended for children.", "Contains small parts.", "Check local laws for legality in region.", "Do not taunt.", "Not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.", "Keep away from fire or flames.", "Product is provided \"as is\" without any implied or expressed warranties.", "As seen on TV.", "For recreational use only.", "Use only as directed.", "16% sales tax will be charged for orders originating within Space Nebraska.") + var/static/list/disclaimer = list( + "Void where prohibited.", + "Not recommended for children.", + "Contains small parts.", + "Check local laws for legality in region.", + "Do not taunt.", + "Not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.", + "Keep away from fire or flames.", + "Product is provided \"as is\" without any implied or expressed warranties.", + "As seen on TV.", + "For recreational use only.", + "Use only as directed.", + "16% sales tax will be charged for orders originating within Space Nebraska.", + ) uplink_item.limited_stock = limited_stock if(uplink_item.cost >= 20) //Tough love for nuke ops discount *= 0.5 @@ -111,10 +123,10 @@ /// Spawns an item and logs its purchase /datum/uplink_item/proc/purchase(mob/user, datum/uplink_handler/uplink_handler, atom/movable/source) - var/atom/A = spawn_item(item, user, uplink_handler, source) + var/atom/spawned_item = spawn_item(item, user, uplink_handler, source) log_uplink("[key_name(user)] purchased [src] for [cost] telecrystals from [source]'s uplink") if(purchase_log_vis && uplink_handler.purchase_log) - uplink_handler.purchase_log.LogPurchase(A, src, cost) + uplink_handler.purchase_log.LogPurchase(spawned_item, src, cost) if(lock_other_purchases) uplink_handler.shop_locked = TRUE @@ -122,20 +134,20 @@ /datum/uplink_item/proc/spawn_item(spawn_path, mob/user, datum/uplink_handler/uplink_handler, atom/movable/source) if(!spawn_path) return - var/atom/A + var/atom/spawned_item if(ispath(spawn_path)) - A = new spawn_path(get_turf(user)) + spawned_item = new spawn_path(get_turf(user)) else - A = spawn_path + spawned_item = spawn_path if(refundable) - A.AddElement(/datum/element/uplink_reimburse, (refund_amount ? refund_amount : cost)) - if(ishuman(user) && isitem(A)) - var/mob/living/carbon/human/H = user - if(H.put_in_hands(A)) - to_chat(H, span_boldnotice("[A] materializes into your hands!")) - return A - to_chat(user, span_boldnotice("[A] materializes onto the floor!")) - return A + spawned_item.AddElement(/datum/element/uplink_reimburse, (refund_amount ? refund_amount : cost)) + var/mob/living/carbon/human/human_user = user + if(istype(human_user) && isitem(spawned_item) && human_user.put_in_hands(spawned_item)) + to_chat(human_user, span_boldnotice("[spawned_item] materializes into your hands!")) + else + to_chat(user, span_boldnotice("[spawned_item] materializes onto the floor!")) + SEND_SIGNAL(uplink_handler, COMSIG_ON_UPLINK_PURCHASE, spawned_item, user) + return spawned_item ///For special overrides if an item can be bought or not. /datum/uplink_item/proc/can_be_bought(datum/uplink_handler/source) diff --git a/tgstation.dme b/tgstation.dme index 0c076bc191d09..29c504f216880 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -357,6 +357,7 @@ #include "code\__DEFINES\dcs\signals\signals_wash.dm" #include "code\__DEFINES\dcs\signals\signals_wizard.dm" #include "code\__DEFINES\dcs\signals\signals_xeno_control.dm" +#include "code\__DEFINES\dcs\signals\uplink.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_explosion.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_lighting.dm" From 4f4b33f9ce3750639e2dd80165c4016777bc013d Mon Sep 17 00:00:00 2001 From: orange man <61334995+comfyorange@users.noreply.github.com> Date: Sun, 11 Feb 2024 06:57:41 +1300 Subject: [PATCH 19/19] Automatic changelog for PR #81372 [ci skip] --- html/changelogs/AutoChangeLog-pr-81372.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-81372.yml diff --git a/html/changelogs/AutoChangeLog-pr-81372.yml b/html/changelogs/AutoChangeLog-pr-81372.yml new file mode 100644 index 0000000000000..efbf7ba1c6739 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-81372.yml @@ -0,0 +1,4 @@ +author: "JohnFulpWillard" +delete-after: True +changes: + - bugfix: "Uplinks now update their UI when you add telecrystals in them, so you don't need to close and reopen it." \ No newline at end of file