Files
Bubberstation/code/datums/mutations/webbing.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

33 lines
1.1 KiB
Plaintext

//spider webs
/datum/mutation/webbing
name = "Webbing Production"
desc = "Allows the user to lay webbing, and travel through it."
quality = POSITIVE
text_gain_indication = span_notice("Your skin feels webby.")
instability = POSITIVE_INSTABILITY_MODERATE // useful until you're lynched
power_path = /datum/action/cooldown/mob_cooldown/lay_web/genetic
energy_coeff = 1
/datum/mutation/webbing/setup()
. = ..()
var/datum/action/cooldown/mob_cooldown/lay_web/genetic/to_modify = .
if(!istype(to_modify)) // null or invalid
return
if(GET_MUTATION_ENERGY(src) == 1) // Energetic chromosome outputs a value less than 1 when present, 1 by default
to_modify.webbing_time = initial(to_modify.webbing_time)
return
to_modify.webbing_time = 2 SECONDS // Spin webs faster but not more often
/datum/mutation/webbing/on_acquiring(mob/living/carbon/human/owner)
. = ..()
if(!.)
return
ADD_TRAIT(owner, TRAIT_WEB_WEAVER, GENETIC_MUTATION)
/datum/mutation/webbing/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_WEB_WEAVER, GENETIC_MUTATION)