Files
Bubberstation/code/datums/mutations/active.dm
Ghom 14fb86e3e8 Mutation code cleanup, mutations now have sources to avoid concurrency problems. (#91346)
## About The Pull Request
This PR aims to clean or bring up to date portions of code about dna,
the dna console and mutations. This includes taking care of or removing
some of the awful choices like the pratically useless
`datum/mutation/human` pathing, or the class variable, in favor of using
sources to avoid potential issues with extraneous sources of a mutation.

The files changed are over a hundred just because I removed the
`datum/mutation/human` path, but the actual bulk of the code is mainly
shared between the datum/dna.dm, _mutations.dm and dna_console.dm.

## Why It's Good For The Game
Mutation shitcode is hurting my future plans for infusions a little.
Also it's a much needed refactor. Drafted 'till I'm sure it works
without issues.

## Changelog

🆑
refactor: Refactored mutation code backend. Report any issue.
/🆑
2025-06-08 13:57:10 +02:00

50 lines
2.0 KiB
Plaintext

/datum/mutation/adrenaline_rush
name = "Adrenaline Rush"
desc = "Allows the host to trigger their body's adrenaline response at will."
quality = POSITIVE
text_gain_indication = span_notice("You feel pumped up!")
instability = POSITIVE_INSTABILITY_MODERATE
power_path = /datum/action/cooldown/adrenaline
energy_coeff = 1
synchronizer_coeff = 1
power_coeff = 1
/datum/mutation/adrenaline_rush/setup()
. = ..()
var/datum/action/cooldown/adrenaline/to_modify = .
if(!istype(to_modify)) // null or invalid
return
to_modify.adrenaline_amount = 10 * GET_MUTATION_POWER(src)
to_modify.comedown_amount = 7 / GET_MUTATION_SYNCHRONIZER(src)
/datum/action/cooldown/adrenaline
name = "Adrenaline!"
desc = "Energize yourself, pushing your body to its limits!"
button_icon = 'icons/mob/actions/actions_genetic.dmi'
button_icon_state = "adrenaline"
cooldown_time = 2 MINUTES
check_flags = AB_CHECK_CONSCIOUS
/// How many units of each positive reagent injected during adrenaline.
var/adrenaline_amount = 10
/// How many units of each negative reagent injected after comedown.
var/comedown_amount = 7
/datum/action/cooldown/adrenaline/Activate(mob/living/carbon/cast_on)
. = ..()
to_chat(cast_on, span_userdanger("You feel pumped up! It's time to GO!"))
cast_on.reagents.add_reagent(/datum/reagent/drug/pumpup, adrenaline_amount)
cast_on.reagents.add_reagent(/datum/reagent/medicine/synaptizine, adrenaline_amount)
cast_on.reagents.add_reagent(/datum/reagent/determination, adrenaline_amount)
addtimer(CALLBACK(src, PROC_REF(get_tired), cast_on), 25 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE)
return TRUE
/datum/action/cooldown/adrenaline/proc/get_tired(mob/living/carbon/cast_on)
to_chat(cast_on, span_danger("Your adrenaline rush makes way for a bout of nausea and a deep feeling of exhaustion in your muscles."))
cast_on.reagents.add_reagent(/datum/reagent/peaceborg/tire, comedown_amount)
cast_on.reagents.add_reagent(/datum/reagent/peaceborg/confuse, comedown_amount)
cast_on.set_dizzy_if_lower(10 SECONDS)