Merge pull request #5944 from DeityLink/shadow

Fixes #4314
This commit is contained in:
clusterfack
2015-10-04 00:25:38 -05:00
7 changed files with 45 additions and 11 deletions

View File

@@ -37,7 +37,8 @@
deactivate(var/mob/M, var/connected, var/flags) deactivate(var/mob/M, var/connected, var/flags)
if(..(M,connected,flags)) if(..(M,connected,flags))
M.alpha=255 M.alphas -= "chameleon_stealth"
M.handle_alpha()
// WAS: /datum/bioEffect/darkcloak // WAS: /datum/bioEffect/darkcloak
/*/datum/dna/gene/basic/stealth/darkcloak /*/datum/dna/gene/basic/stealth/darkcloak
@@ -70,9 +71,9 @@
OnMobLife(var/mob/M) OnMobLife(var/mob/M)
if((world.time - M.last_movement) >= 30 && !M.stat && M.canmove && !M.restrained()) 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 else
M.alpha = round(255 * 0.80) M.alphas["chameleon_stealth"] = round(255 * 0.80)
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -348,27 +348,27 @@
/mob/proc/handle_vampire_cloak() /mob/proc/handle_vampire_cloak()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/handle_vampire_cloak() called tick#: [world.time]") //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/handle_vampire_cloak() called tick#: [world.time]")
if(!mind || !mind.vampire || !ishuman(src)) if(!mind || !mind.vampire || !ishuman(src))
alpha = 255 alphas["vampire_cloak"] = 255
color = "#FFFFFF" color = "#FFFFFF"
return return
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
if(!mind.vampire.iscloaking) if(!mind.vampire.iscloaking)
alpha = 255 alphas["vampire_cloak"] = 255
color = "#FFFFFF" color = "#FFFFFF"
return 0 return 0
if((T.get_lumcount() * 10) <= 2) 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) if(VAMP_SHADOW in mind.vampire.powers)
color = "#000000" color = "#000000"
return 1 return 1
else else
if(VAMP_SHADOW in mind.vampire.powers) if(VAMP_SHADOW in mind.vampire.powers)
alpha = round((255 * 0.15)) alphas["vampire_cloak"] = round((255 * 0.15))
else else
alpha = round((255 * 0.80)) alphas["vampire_cloak"] = round((255 * 0.80))
/mob/proc/can_enthrall(mob/living/carbon/C) /mob/proc/can_enthrall(mob/living/carbon/C)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/can_enthrall() called tick#: [world.time]") //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/proc/can_enthrall() called tick#: [world.time]")

View File

@@ -416,6 +416,9 @@ var/global/list/organ_damage_overlays = list(
#ifdef PROFILE_LIFE #ifdef PROFILE_LIFE
debug_life("Handle HUD", "Successfully handled hud update") debug_life("Handle HUD", "Successfully handled hud update")
#endif #endif
#ifdef PROFILE_LIFE #ifdef PROFILE_LIFE
profile_life_start() profile_life_start()
#endif #endif
@@ -426,6 +429,10 @@ var/global/list/organ_damage_overlays = list(
#ifdef PROFILE_LIFE #ifdef PROFILE_LIFE
debug_life("Handle pulse", "Successfully handled pulse") debug_life("Handle pulse", "Successfully handled pulse")
#endif #endif
#ifdef PROFILE_LIFE #ifdef PROFILE_LIFE
//Grabbing //Grabbing
profile_life_start() profile_life_start()
@@ -448,6 +455,16 @@ var/global/list/organ_damage_overlays = list(
#endif #endif
#ifdef PROFILE_LIFE #ifdef PROFILE_LIFE
debug_life("Handle vampire", "Successfully handled vampire") 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 #endif
if(update_overlays) if(update_overlays)
update_overlays = 0 update_overlays = 0

View File

@@ -1806,5 +1806,14 @@ mob/proc/walking()
/mob/attack_pai(mob/user as mob) /mob/attack_pai(mob/user as mob)
ShiftClick(user) 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_SPACEDRUGS_HALLUCINATING
#undef MOB_MINDBREAKER_HALLUCINATING #undef MOB_MINDBREAKER_HALLUCINATING

View File

@@ -274,6 +274,8 @@
var/event/on_uattack var/event/on_uattack
forceinvertredraw = 1 forceinvertredraw = 1
var/list/alphas = list()
/mob/resetVariables() /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", "pinned", "embedded", "abilities", "grabbed_by", "requests", "mapobjs", "mutations", "spell_list", "viruses", "resistances", "radar_blips", "active_genes", "attack_log", "speak_emote", args)
callOnFace = list() callOnFace = list()

View File

@@ -29,7 +29,6 @@
/proc/ethereal_jaunt(var/mob/living/target, duration, enteranim = "liquify", exitanim = "reappear", mist = 1) /proc/ethereal_jaunt(var/mob/living/target, duration, enteranim = "liquify", exitanim = "reappear", mist = 1)
var/mobloc = get_turf(target) var/mobloc = get_turf(target)
var/previncorp = target.incorporeal_move //This shouldn't ever matter under usual circumstances 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) if(target.incorporeal_move == 3) //they're already jaunting, we have another fix for this but this is sane)
return return
target.unlock_from() target.unlock_from()
@@ -44,7 +43,8 @@
target.incorporeal_move = 3 target.incorporeal_move = 3
target.invisibility = INVISIBILITY_MAXIMUM target.invisibility = INVISIBILITY_MAXIMUM
target.flags |= INVULNERABLE 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) for(var/obj/screen/movable/spell_master/SM in target.spell_masters)
SM.silence_spells(duration+25) SM.silence_spells(duration+25)
target.delayNextAttack(duration+25) target.delayNextAttack(duration+25)
@@ -68,7 +68,8 @@
SM.silence_spells(0) SM.silence_spells(0)
target.flags &= ~INVULNERABLE target.flags &= ~INVULNERABLE
target.incorporeal_move = previncorp target.incorporeal_move = previncorp
target.alpha = prevalpha target.alphas -= "etheral_jaunt"
target.handle_alpha()
/spell/targeted/ethereal_jaunt/shift /spell/targeted/ethereal_jaunt/shift
name = "Phase Shift" name = "Phase Shift"

View File

@@ -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.