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 14:06:44 -04:00
committed by GitHub
parent 5e3dad1289
commit ee6f73973e
11 changed files with 118 additions and 30 deletions
+4 -2
View File
@@ -288,7 +288,8 @@
RegisterSignal(mod.wearer, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, PROC_REF(on_unarmed_attack))
RegisterSignal(mod.wearer, COMSIG_ATOM_BULLET_ACT, PROC_REF(on_bullet_act))
RegisterSignals(mod.wearer, list(COMSIG_MOB_ITEM_ATTACK, COMSIG_PARENT_ATTACKBY, COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_HITBY, COMSIG_ATOM_HULK_ATTACK, COMSIG_ATOM_ATTACK_PAW), PROC_REF(unstealth))
animate(mod.wearer, alpha = stealth_alpha, time = 1.5 SECONDS)
mod.wearer.set_alpha_tracking(stealth_alpha, src, update_alpha = FALSE)
animate(mod.wearer, alpha = mod.wearer.get_alpha(), time = 1.5 SECONDS)
drain_power(use_power_cost)
/obj/item/mod/module/stealth/on_deactivation(display_message = TRUE, deleting = FALSE)
@@ -298,7 +299,8 @@
if(bumpoff)
UnregisterSignal(mod.wearer, COMSIG_LIVING_MOB_BUMP)
UnregisterSignal(mod.wearer, list(COMSIG_HUMAN_MELEE_UNARMED_ATTACK, COMSIG_MOB_ITEM_ATTACK, COMSIG_PARENT_ATTACKBY, COMSIG_ATOM_ATTACK_HAND, COMSIG_ATOM_BULLET_ACT, COMSIG_ATOM_HITBY, COMSIG_ATOM_HULK_ATTACK, COMSIG_ATOM_ATTACK_PAW))
animate(mod.wearer, alpha = 255, time = 1.5 SECONDS)
mod.wearer.set_alpha_tracking(ALPHA_VISIBLE, src, update_alpha = FALSE)
animate(mod.wearer, alpha = mod.wearer.get_alpha(), time = 1.5 SECONDS)
/obj/item/mod/module/stealth/proc/unstealth(datum/source)
SIGNAL_HANDLER