Fixes problems with multiple sources of alpha on humans (#25884)

* lets gooooo

* this too

* comments

* update code

* im so good

* tested, it works now

* Update code/game/dna/mutations/mutation_powers.dm

Co-authored-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

---------

Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
This commit is contained in:
Contrabang
2024-09-26 18:06:44 +00:00
committed by GitHub
co-authored by BiancaWilkson
parent 5e3dad1289
commit ee6f73973e
11 changed files with 118 additions and 30 deletions
@@ -16,6 +16,12 @@
var/recharge_slowdown = 0.15
var/chem_recharge_slowdown = 0
/datum/action/changeling/environmental_adaptation/Destroy(force, ...)
if(ishuman(cling.owner.current))
var/mob/living/carbon/human/H = cling.owner.current
H.set_alpha_tracking(ALPHA_VISIBLE, src)
return ..()
/datum/action/changeling/environmental_adaptation/sting_action(mob/living/carbon/human/cling) //SHOULD always be human, because req_human = TRUE
..()
is_active = !is_active
@@ -26,14 +32,16 @@
/datum/action/changeling/environmental_adaptation/proc/enable_ability(mob/living/carbon/human/cling) //Enable the adaptation
animate(cling, alpha = 65, time = 3 SECONDS)
cling.set_alpha_tracking(65, src, update_alpha = FALSE)
animate(cling, alpha = cling.get_alpha(), time = 3 SECONDS)
cling.visible_message("<span class='warning'>[cling]'s skin suddenly starts becoming translucent!</span>", \
"<span class='notice'>We adapt our pigmentation to suit the environment around us.</span>")
var/datum/antagonist/changeling/changeling_data = cling.mind?.has_antag_datum(/datum/antagonist/changeling)
changeling_data?.chem_recharge_slowdown -= recharge_slowdown //Slows down chem regeneration
/datum/action/changeling/environmental_adaptation/proc/disable_ability(mob/living/carbon/human/cling) //Restore the adaptation
animate(cling, alpha = 255, time = 3 SECONDS)
cling.set_alpha_tracking(ALPHA_VISIBLE, src, update_alpha = FALSE)
animate(cling, alpha = cling.get_alpha(), time = 3 SECONDS)
cling.visible_message(
"<span class='warning'>[cling] appears from thin air!</span>",
"<span class='notice'>We stop concentration on our pigmentation, allowing it to return to normal.</span>",
+16 -9
View File
@@ -36,11 +36,17 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
blurb_a = 1
/datum/antagonist/vampire/Destroy(force, ...)
owner.current.create_log(CONVERSION_LOG, "De-vampired")
draining = null
QDEL_NULL(subclass)
return ..()
/datum/antagonist/vampire/detach_from_owner()
owner.current.create_log(CONVERSION_LOG, "De-vampired")
if(ishuman(owner.current))
var/mob/living/carbon/human/human_owner = owner.current
human_owner.set_alpha_tracking(ALPHA_VISIBLE, src)
return ..()
/datum/antagonist/vampire/add_owner_to_gamemode()
SSticker.mode.vampires += owner
@@ -258,24 +264,25 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
if(!ishuman(owner.current))
owner.current.alpha = 255
return
var/turf/simulated/T = get_turf(owner.current)
var/mob/living/carbon/human/human_owner = owner.current
var/turf/simulated/T = get_turf(human_owner)
var/light_available = T.get_lumcount() * 10
if(!istype(T))
return
if(!iscloaking || owner.current.on_fire)
owner.current.alpha = 255
REMOVE_TRAIT(owner.current, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
if(!iscloaking || human_owner.on_fire)
human_owner.set_alpha_tracking(ALPHA_VISIBLE, src)
REMOVE_TRAIT(human_owner, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
return
if(light_available <= 2)
owner.current.alpha = 38 // round(255 * 0.15)
ADD_TRAIT(owner.current, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
human_owner.set_alpha_tracking(ALPHA_VISIBLE * 0.15, src)
ADD_TRAIT(human_owner, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
return
REMOVE_TRAIT(owner.current, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
owner.current.alpha = 204 // 255 * 0.80
REMOVE_TRAIT(human_owner, TRAIT_GOTTAGONOTSOFAST, VAMPIRE_TRAIT)
human_owner.set_alpha_tracking(ALPHA_VISIBLE * 0.80, src)
/**
* Handles unique drain ID checks and increases vampire's total and usable blood by blood_amount. Checks for ability upgrades.