Files
Paradise/code/game/dna/dna2_domutcheck.dm
S34N bdb8039c8f Adds gorillas and cargorillas (#20830)
* goril

* goril2

* arms

* goril3

* goril4

* rampaging

* emote

* trait

* more gorilla

* ooga

* Magillitis Serum Autoinjector, crates

* return to monke

* remove unused trait

* oops

* sirryan

* earth

* Update code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/reagents/chemistry/reagents/misc_reagents.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* fixes and stuff

* gorilla text clarification

* tweak probs, stop if dead

* volume

* gorilla sleeping attack

* Apply suggestions from code review

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
2023-06-01 18:36:07 -05:00

53 lines
1.5 KiB
Plaintext

// (Re-)Apply mutations.
// TODO: Turn into a /mob proc, change inj to a bitflag for various forms of differing behavior.
// M: Mob to mess with
// flags: See below, bitfield.
/proc/domutcheck(mob/living/M, flags = 0)
for(var/mutation_type in GLOB.dna_mutations)
var/datum/mutation/mutation = GLOB.dna_mutations[mutation_type]
if(!M || !M.dna)
return
if(!mutation.block)
continue
domutation(mutation, M, flags)
// Use this to force a mut check on a single mutation!
/proc/singlemutcheck(mob/living/M, block, flags = 0)
if(!M)
return
if(HAS_TRAIT(M, TRAIT_GENELESS))
return
if(block < 0)
return
var/datum/mutation/mutation = GLOB.assigned_mutation_blocks[block]
domutation(mutation, M, flags)
/proc/domutation(datum/mutation/mutation, mob/living/M, flags = 0)
if(!mutation || !istype(mutation))
return FALSE
// Current state
var/mutation_active = M.dna.GetSEState(mutation.block)
// Sanity checks, don't skip.
if(mutation_active && !mutation.can_activate(M, flags))
//testing("[M] - Failed to activate [gene.name] (can_activate fail).")
return FALSE
// Prior state
var/mutation_prior_status = (mutation.type in M.active_mutations)
var/changed = mutation_active != mutation_prior_status
// If gene state has changed:
if(changed)
// Gene active (or ALWAYS ACTIVATE)
if(mutation_active)
//testing("[gene.name] activated!")
mutation.activate(M)
// If Gene is NOT active:
else
//testing("[gene.name] deactivated!")
mutation.deactivate(M)