From 4db698181368f041c8ce144e6c83e597d2248d04 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Sun, 15 Dec 2024 16:17:04 -0600 Subject: [PATCH 1/3] Update chem_booster.dm --- code/datums/components/chem_booster.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/chem_booster.dm b/code/datums/components/chem_booster.dm index 8fdf605c03233..30c10b29bf143 100644 --- a/code/datums/components/chem_booster.dm +++ b/code/datums/components/chem_booster.dm @@ -378,7 +378,7 @@ return if(resource_storage_current >= resource_storage_max) return - update_resource(round(20*connected_weapon.attack_speed/11)) + update_resource(round(5*connected_weapon.attack_speed/11)) ///Adds or removes resource from the suit. Signal gets sent at every 25% of stored resource /datum/component/chem_booster/proc/update_resource(amount) From 1de8f898beba3180ee053d0314999d45c95ccc7c Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:08:32 -0600 Subject: [PATCH 2/3] 1/2 kuro said so --- code/datums/components/chem_booster.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/components/chem_booster.dm b/code/datums/components/chem_booster.dm index 30c10b29bf143..80e2a8db65bd7 100644 --- a/code/datums/components/chem_booster.dm +++ b/code/datums/components/chem_booster.dm @@ -378,7 +378,7 @@ return if(resource_storage_current >= resource_storage_max) return - update_resource(round(5*connected_weapon.attack_speed/11)) + update_resource(round(10*connected_weapon.attack_speed/11)) ///Adds or removes resource from the suit. Signal gets sent at every 25% of stored resource /datum/component/chem_booster/proc/update_resource(amount) From afd71db89cf8bc6cf51cb7aed7cfda3681cf6ff4 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:07:36 -0600 Subject: [PATCH 3/3] resource decays over time --- code/datums/components/chem_booster.dm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/code/datums/components/chem_booster.dm b/code/datums/components/chem_booster.dm index 80e2a8db65bd7..e256aed56f59d 100644 --- a/code/datums/components/chem_booster.dm +++ b/code/datums/components/chem_booster.dm @@ -24,6 +24,8 @@ var/resource_storage_max = 200 ///Amount of substance stored currently var/resource_storage_current = 0 + ///Amount decayed passively when healing is off + var/resource_decay_amount = 2 ///Amount required for operation var/resource_drain_amount = 10 ///Actions that the component provides @@ -48,7 +50,7 @@ ///Item connected to the system var/obj/item/connected_weapon ///When was the effect activated. Used to activate negative effects after a certain amount of use - var/processing_start = 0 + var/healing_start = 0 ///Internal reagent storage used to store and automatically inject reagents into the wearer var/obj/item/reagent_containers/glass/beaker/meds_beaker ///Whether the contents on the meds_beaker will be injected into the wearer when the system is turned on @@ -156,6 +158,7 @@ if(boost_on) on_off() manage_weapon_connection() + STOP_PROCESSING(SSobj, src) if(!wearer) return @@ -178,8 +181,13 @@ wearer.overlays += resource_overlay update_resource(0) + START_PROCESSING(SSobj, src) /datum/component/chem_booster/process() + if(!boost_on) + if(resource_storage_current >= resource_decay_amount) + update_resource(-resource_decay_amount) + return if(resource_storage_current < resource_drain_amount) to_chat(wearer, span_warning("Insufficient green blood to maintain operation.")) on_off() @@ -190,7 +198,7 @@ wearer.adjustToxLoss(-tox_heal*boost_amount) wearer.heal_overall_damage(6*boost_amount*brute_heal_amp, 6*boost_amount*burn_heal_amp) - vali_necro_timer = world.time - processing_start + vali_necro_timer = world.time - healing_start if(vali_necro_timer > 20 SECONDS) return if(connected_weapon) @@ -236,7 +244,7 @@ if(VALI_INFO) to_chat(wearer, span_notice("[reagent_info]")) -///Handles turning on/off the processing part of the component, along with the negative effects related to this +///Handles turning on/off the healing part of the component, along with the negative effects related to this /datum/component/chem_booster/proc/on_off(datum/source) SIGNAL_HANDLER if(!boost_on) @@ -252,9 +260,8 @@ boost_on = !boost_on SEND_SIGNAL(src, COMSIG_CHEMSYSTEM_TOGGLED, boost_on) if(!boost_on) - STOP_PROCESSING(SSobj, src) wearer.clear_fullscreen("degeneration") - vali_necro_timer = world.time - processing_start + vali_necro_timer = world.time - healing_start var/necrotized_counter = FLOOR(min(vali_necro_timer, 20 SECONDS)/200 + (vali_necro_timer-20 SECONDS)/100, 1) if(necrotized_counter >= 1) for(var/datum/limb/limb_to_ruin AS in shuffle(wearer.limbs)) @@ -270,8 +277,7 @@ setup_bonus_effects() return - processing_start = world.time - START_PROCESSING(SSobj, src) + healing_start = world.time RegisterSignal(wearer, COMSIG_MOB_DEATH, PROC_REF(on_off)) playsound(get_turf(wearer), 'sound/effects/bubbles.ogg', 30, 1) to_chat(wearer, span_notice("Commensing green blood injection.[(automatic_meds_use && meds_beaker.reagents.total_volume) ? " Adding additional reagents." : ""]"))