mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-18 09:38:43 +01:00
Optmizes handle_mutations_and_radiation
Saving about 90% CPU power on blank humanoids
This commit is contained in:
@@ -170,11 +170,10 @@
|
||||
emote("drool")
|
||||
|
||||
/mob/living/carbon/human/handle_mutations_and_radiation()
|
||||
for(var/datum/mutation/mutation in GLOB.dna_mutations)
|
||||
if(!mutation.block)
|
||||
continue
|
||||
if(mutation.is_active(src))
|
||||
mutation.on_life(src)
|
||||
for(var/mutation_type in active_mutations)
|
||||
var/datum/mutation/mutation = GLOB.dna_mutations[mutation_type]
|
||||
mutation.on_life(src)
|
||||
|
||||
if(!ignore_gene_stability && gene_stability < GENETIC_DAMAGE_STAGE_1)
|
||||
var/instability = DEFAULT_GENE_STABILITY - gene_stability
|
||||
if(prob(instability * 0.1))
|
||||
|
||||
@@ -152,11 +152,9 @@
|
||||
verb = pick("whinnies", "neighs", "says")
|
||||
|
||||
if(dna)
|
||||
for(var/datum/mutation/mutation in GLOB.dna_mutations)
|
||||
if(!mutation.block)
|
||||
continue
|
||||
if(mutation.is_active(src))
|
||||
S.message = mutation.on_say(src, S.message)
|
||||
for(var/mutation_type in active_mutations)
|
||||
var/datum/mutation/mutation = GLOB.dna_mutations[mutation_type]
|
||||
S.message = mutation.on_say(src, S.message)
|
||||
|
||||
var/braindam = getBrainLoss()
|
||||
if(braindam >= 60)
|
||||
|
||||
@@ -450,14 +450,13 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
|
||||
if(gender == FEMALE)
|
||||
g = "f"
|
||||
// DNA2 - Drawing underlays.
|
||||
for(var/datum/mutation/mutation in GLOB.dna_mutations)
|
||||
if(!mutation.block)
|
||||
continue
|
||||
if(mutation.is_active(src))
|
||||
var/underlay = mutation.on_draw_underlays(src, g)
|
||||
if(underlay)
|
||||
standing.underlays += underlay
|
||||
add_image = 1
|
||||
for(var/mutation_type in active_mutations)
|
||||
var/datum/mutation/mutation = GLOB.dna_mutations[mutation_type]
|
||||
var/underlay = mutation.on_draw_underlays(src, g)
|
||||
if(underlay)
|
||||
standing.underlays += underlay
|
||||
add_image = TRUE
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_LASEREYES))
|
||||
standing.overlays += "lasereyes_s"
|
||||
add_image = 1
|
||||
|
||||
@@ -174,6 +174,7 @@
|
||||
|
||||
var/stance_damage = 0 //Whether this mob's ability to stand has been affected
|
||||
|
||||
/// List of the active mutation types
|
||||
var/list/active_mutations = list()
|
||||
|
||||
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.
|
||||
|
||||
Reference in New Issue
Block a user