diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm index f60dddd0758..86ecb31fc79 100644 --- a/code/__DEFINES/genetics.dm +++ b/code/__DEFINES/genetics.dm @@ -25,6 +25,8 @@ #define CHAV "Chav" #define ELVIS "Elvis" +#define CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY 204 + // String identifiers for associative list lookup //Types of usual mutations diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index 9a17e523f9c..c47f4771b77 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -73,6 +73,9 @@ /datum/mutation/human/proc/on_ranged_attack(mob/living/carbon/human/owner, atom/target) return +/datum/mutation/human/proc/on_move(mob/living/carbon/human/owner, new_loc) + return + /datum/mutation/human/proc/on_life(mob/living/carbon/human/owner) return @@ -375,16 +378,17 @@ lowest_value = 256 * 14 text_gain_indication = "You feel one with your surroundings." text_lose_indication = "You feel oddly exposed." - var/last_location + +/datum/mutation/human/chameleon/on_acquiring(mob/living/carbon/human/owner) + if(..()) + return + owner.alpha = CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY /datum/mutation/human/chameleon/on_life(mob/living/carbon/human/owner) - if(owner.loc != last_location) - owner.alpha = round(255 * 0.80) - last_location = owner.loc - if((world.time - owner.next_move) >= 30 && !owner.stat && owner.canmove && !owner.restrained()) - owner.alpha -= 25 - else - owner.alpha = round(255 * 0.80) + owner.alpha = max(0, owner.alpha - 25) + +/datum/mutation/human/chameleon/on_move(mob/living/carbon/human/owner) + owner.alpha = CHAMELEON_MUTATION_DEFAULT_TRANSPARENCY /datum/mutation/human/chameleon/on_losing(mob/living/carbon/human/owner) if(..()) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index b9321879663..5dc30d5535a 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -46,6 +46,9 @@ /mob/living/carbon/human/Move(NewLoc, direct) ..() + if(dna) + for(var/datum/mutation/human/HM in dna.mutations) + HM.on_move(src, NewLoc) if(shoes) if(!lying) if(loc == NewLoc)