Files
VOREStation/code/modules/genetics/side_effects.dm
Cameron Lennox cdafe425a5 Adds Trait Genetics (#16921)
* Adds Trait Genetics from Outpost21

Adds trait genetics from Outpost 21
- Tried to update each file it touched to be equivalent to their Chomp specific variants in order to maintain functionality and make sure no oddities would happen due to code differences. (Some things like the eardeaf loop were left there but commented out)

* Morph trait

* Fixes a server crashing bug with flip

aa

* flip

* Makes morph superpower better

- Makes it use the appearance_changer instead of 1000 different  procs

- Makes cocoon weaver able to change eye and skin color.

I did NOT select you. BAD

* begone

* fix dna modifier

* Fixes massive memory leak

* Brain Runtime Fix

* There was no reason for this to be a spawn(0)

And no I didn't spawn with no blood - https://i.imgur.com/vPizqCD.png

* revert

revert the dna changes there

* Deconf

* gets rid of unused proc vars that did nothing

* expects enough free slots

* glob

* fixed and added two other tests

* another few tests

* this is a list

* fixed bad injector

* lets wrap these for sanity

* better feedback

* wrong name

* don't allow multiple occupants into the dna pod

* future traits will have activation levels instead of binary on/off

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com>
2025-02-11 02:01:27 -05:00

79 lines
3.0 KiB
Plaintext

/datum/genetics/side_effect
var/name // name of the side effect, to use as a header in the manual
var/duration = 0 // delay between start() and finish()
var/antidote_reagent // What type of reagent we require to stop the specific side effect from happening
/proc/trigger_side_effect(mob/living/carbon/human/H)
if(!ishuman(H)) return
var/tp = pick(subtypesof(/datum/genetics/side_effect))
var/datum/genetics/side_effect/S = new tp
S.start(H)
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, Weaken), 4), 2 SECONDS, TIMER_DELETE_ME)
addtimer(CALLBACK(S, TYPE_PROC_REF(/datum/genetics/side_effect, finish), WEAKREF(H)), S.duration, TIMER_DELETE_ME)
//above is doing: Call S.finish(H) in S.duration
/datum/genetics/side_effect/proc/start(mob/living/carbon/human/H)
if(H && ishuman(H))
H.genetic_side_effects += src
// start the side effect, this should give some cue as to what's happening,
// such as gasping. These cues need to be unique among side-effects.
/datum/genetics/side_effect/proc/finish(var/datum/weakref/WR)
var/mob/living/carbon/human/H = WR.resolve()
if(!H || !ishuman(H)) return FALSE
H.genetic_side_effects -= src
if(antidote_reagent && (H.reagents.has_reagent(antidote_reagent)|| H.ingested.has_reagent(antidote_reagent) || H.touching.has_reagent(antidote_reagent)))
return TRUE
return FALSE
// Finish the side-effect. This should first check whether the cure has been
// applied, and if not, cause bad things to happen.
/datum/genetics/side_effect/genetic_burn
name = "Genetic Burn"
duration = 30 SECONDS
antidote_reagent = REAGENT_ID_DEXALIN
/datum/genetics/side_effect/genetic_burn/start(mob/living/carbon/human/H)
..()
H.custom_emote(VISIBLE_MESSAGE, "starts turning very red..")
/datum/genetics/side_effect/genetic_burn/finish(datum/weakref/WR)
if(..()) return
var/mob/living/carbon/human/H = WR.resolve()
for(var/organ_name in BP_ALL)
var/obj/item/organ/external/E = H.get_organ(organ_name)
E.take_damage(0, 5, 0)
/datum/genetics/side_effect/bone_snap
name = "Genetic Bone Snap"
duration = 60 SECONDS
antidote_reagent = REAGENT_ID_BICARIDINE
/datum/genetics/side_effect/bone_snap/start(mob/living/carbon/human/H)
..()
H.custom_emote(VISIBLE_MESSAGE, "'s limbs start shivering uncontrollably.")
/datum/genetics/side_effect/bone_snap/finish(datum/weakref/WR)
if(..()) return
var/mob/living/carbon/human/H = WR.resolve()
var/organ_name = pick(BP_ALL)
var/obj/item/organ/external/E = H.get_organ(organ_name)
E.take_damage(20, 0, 0)
E.fracture()
/datum/genetics/side_effect/confuse
name = "Genetic Confusion"
duration = 30 SECONDS
antidote_reagent = REAGENT_ID_ANTITOXIN
/datum/genetics/side_effect/confuse/start(mob/living/carbon/human/H)
..()
var/datum/gender/T = gender_datums[H.get_visible_gender()]
H.custom_emote(VISIBLE_MESSAGE, "has drool running down from [T.his] mouth.")
/datum/genetics/side_effect/confuse/finish(datum/weakref/WR)
if(..()) return
var/mob/living/carbon/human/H = WR.resolve()
H.Confuse(100)