mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
@@ -276,28 +276,41 @@
|
||||
icon_state = "plant-36"
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/Destroy()
|
||||
if(isliving(loc))
|
||||
if(iscarbon(loc))
|
||||
unhide_user(loc)
|
||||
|
||||
QDEL_NULL(mob_overlay)
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/equipped(mob/living/user)
|
||||
/obj/item/twohanded/required/kirbyplants/equipped(mob/living/carbon/user)
|
||||
. = ..()
|
||||
if(wielded)
|
||||
hide_user(user)
|
||||
return
|
||||
unhide_user(user)
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/proc/hide_user(mob/living/user)
|
||||
/// User has decided to hold a plant, apply stealth.
|
||||
/obj/item/twohanded/required/kirbyplants/proc/hide_user(mob/living/carbon/user)
|
||||
RegisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS, PROC_REF(reapply_hide))
|
||||
mob_overlay = mutable_appearance(icon, icon_state, user.layer, user.plane, 255, appearance_flags = RESET_COLOR | RESET_TRANSFORM | RESET_ALPHA | KEEP_APART)
|
||||
user.add_overlay(mob_overlay)
|
||||
user.alpha = 0
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/proc/unhide_user(mob/living/user)
|
||||
/// User has either dropped the plant, or plant is being destroyed, restore user to normal.
|
||||
/obj/item/twohanded/required/kirbyplants/proc/unhide_user(mob/living/carbon/user)
|
||||
UnregisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS)
|
||||
user.cut_overlay(mob_overlay)
|
||||
user.alpha = initial(user.alpha)
|
||||
QDEL_NULL(mob_overlay)
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/dropped(mob/living/user)
|
||||
/// Icon operation has occured, time to make sure we're showing a plant again if we need to be.
|
||||
/obj/item/twohanded/required/kirbyplants/proc/reapply_hide(mob/living/carbon/user)
|
||||
SIGNAL_HANDLER
|
||||
// Reset the state of the user
|
||||
unhide_user(user)
|
||||
hide_user(user)
|
||||
|
||||
/obj/item/twohanded/required/kirbyplants/dropped(mob/living/carbon/user)
|
||||
..()
|
||||
unhide_user(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user