From ea95ed29c52e660cbf531f7de11a2fb51f592d01 Mon Sep 17 00:00:00 2001 From: DeityLink Date: Sun, 4 Oct 2015 07:21:34 +0200 Subject: [PATCH] changelog 5944 also fixes #4314 --- code/game/dna/genes/goon_powers.dm | 7 ++++--- code/game/gamemodes/vampire/vampire_powers.dm | 10 +++++----- code/modules/mob/living/carbon/human/life.dm | 17 +++++++++++++++++ code/modules/mob/mob.dm | 9 +++++++++ code/modules/mob/mob_defines.dm | 2 ++ code/modules/spells/targeted/ethereal_jaunt.dm | 7 ++++--- html/changelogs/DeityLink_5944.yml | 4 ++++ 7 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/DeityLink_5944.yml diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index 797171732b8..6d03808c3f7 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -37,7 +37,8 @@ deactivate(var/mob/M, var/connected, var/flags) if(..(M,connected,flags)) - M.alpha=255 + M.alphas -= "chameleon_stealth" + M.handle_alpha() // WAS: /datum/bioEffect/darkcloak /*/datum/dna/gene/basic/stealth/darkcloak @@ -70,9 +71,9 @@ OnMobLife(var/mob/M) if((world.time - M.last_movement) >= 30 && !M.stat && M.canmove && !M.restrained()) - M.alpha -= 25 + M.alphas["chameleon_stealth"] = max(M.alphas["chameleon_stealth"] - 25, 0) else - M.alpha = round(255 * 0.80) + M.alphas["chameleon_stealth"] = round(255 * 0.80) ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index d6a3005fad4..7792f3655b6 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -348,27 +348,27 @@ /mob/proc/handle_vampire_cloak() //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/handle_vampire_cloak() called tick#: [world.time]") if(!mind || !mind.vampire || !ishuman(src)) - alpha = 255 + alphas["vampire_cloak"] = 255 color = "#FFFFFF" return var/turf/T = get_turf(src) if(!mind.vampire.iscloaking) - alpha = 255 + alphas["vampire_cloak"] = 255 color = "#FFFFFF" return 0 if((T.get_lumcount() * 10) <= 2) - alpha = round((255 * 0.15)) + alphas["vampire_cloak"] = round((255 * 0.15)) if(VAMP_SHADOW in mind.vampire.powers) color = "#000000" return 1 else if(VAMP_SHADOW in mind.vampire.powers) - alpha = round((255 * 0.15)) + alphas["vampire_cloak"] = round((255 * 0.15)) else - alpha = round((255 * 0.80)) + alphas["vampire_cloak"] = round((255 * 0.80)) /mob/proc/can_enthrall(mob/living/carbon/C) //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/can_enthrall() called tick#: [world.time]") diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1c39f13c617..b97878cbbdb 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -416,6 +416,9 @@ var/global/list/organ_damage_overlays = list( #ifdef PROFILE_LIFE debug_life("Handle HUD", "Successfully handled hud update") #endif + + + #ifdef PROFILE_LIFE profile_life_start() #endif @@ -426,6 +429,10 @@ var/global/list/organ_damage_overlays = list( #ifdef PROFILE_LIFE debug_life("Handle pulse", "Successfully handled pulse") #endif + + + + #ifdef PROFILE_LIFE //Grabbing profile_life_start() @@ -448,6 +455,16 @@ var/global/list/organ_damage_overlays = list( #endif #ifdef PROFILE_LIFE debug_life("Handle vampire", "Successfully handled vampire") +#endif +#ifdef PROFILE_LIFE + profile_life_start() +#endif + handle_alpha() +#ifdef PROFILE_LIFE + profile_life_end("handle_alpha") +#endif +#ifdef PROFILE_LIFE + debug_life("Handle alpha", "Successfully handled alpha") #endif if(update_overlays) update_overlays = 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4fb542e2a14..abd6ca50f0e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1806,5 +1806,14 @@ mob/proc/walking() /mob/attack_pai(mob/user as mob) ShiftClick(user) +/mob/proc/handle_alpha() + if(alphas.len < 1) + alpha = 255 + else + var/lowest_alpha = 255 + for(var/alpha_modification in alphas) + lowest_alpha = min(lowest_alpha,alphas[alpha_modification]) + alpha = lowest_alpha + #undef MOB_SPACEDRUGS_HALLUCINATING #undef MOB_MINDBREAKER_HALLUCINATING diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 43cb69995af..62b26a0b149 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -274,6 +274,8 @@ var/event/on_uattack forceinvertredraw = 1 + var/list/alphas = list() + /mob/resetVariables() ..("callOnFace", "pinned", "embedded", "abilities", "grabbed_by", "requests", "mapobjs", "mutations", "spell_list", "viruses", "resistances", "radar_blips", "active_genes", "attack_log", "speak_emote", args) callOnFace = list() diff --git a/code/modules/spells/targeted/ethereal_jaunt.dm b/code/modules/spells/targeted/ethereal_jaunt.dm index f4b35bb3a68..d131db0a2ed 100644 --- a/code/modules/spells/targeted/ethereal_jaunt.dm +++ b/code/modules/spells/targeted/ethereal_jaunt.dm @@ -29,7 +29,6 @@ /proc/ethereal_jaunt(var/mob/living/target, duration, enteranim = "liquify", exitanim = "reappear", mist = 1) var/mobloc = get_turf(target) var/previncorp = target.incorporeal_move //This shouldn't ever matter under usual circumstances - var/prevalpha = target.alpha if(target.incorporeal_move == 3) //they're already jaunting, we have another fix for this but this is sane) return target.unlock_from() @@ -44,7 +43,8 @@ target.incorporeal_move = 3 target.invisibility = INVISIBILITY_MAXIMUM target.flags |= INVULNERABLE - target.alpha = 125 //Spoopy mode to know you are jaunting + target.alphas["etheral_jaunt"] = 125 //Spoopy mode to know you are jaunting + target.handle_alpha() for(var/obj/screen/movable/spell_master/SM in target.spell_masters) SM.silence_spells(duration+25) target.delayNextAttack(duration+25) @@ -68,7 +68,8 @@ SM.silence_spells(0) target.flags &= ~INVULNERABLE target.incorporeal_move = previncorp - target.alpha = prevalpha + target.alphas -= "etheral_jaunt" + target.handle_alpha() /spell/targeted/ethereal_jaunt/shift name = "Phase Shift" diff --git a/html/changelogs/DeityLink_5944.yml b/html/changelogs/DeityLink_5944.yml new file mode 100644 index 00000000000..89c2962820e --- /dev/null +++ b/html/changelogs/DeityLink_5944.yml @@ -0,0 +1,4 @@ +author: Deity Link +delete-after: true +changes: + - bugfix: Chameleon gene now properly works on vampires. In that regards, when multiple alpha-affecting modifications are applied on a player, the lowest one will be the one used.