Skip to content

Commit

Permalink
[s] Disguise with plant trick (ParadiseSS13#25260)
Browse files Browse the repository at this point in the history
* Fix plant-disguise trick

* Resolve name collision
  • Loading branch information
m-dzianishchyts authored Apr 25, 2024
1 parent af5d187 commit 1377fd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 11 additions & 10 deletions code/datums/status_effects/magic_disguise.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
tick_interval = -1
alert_type = /atom/movable/screen/alert/status_effect/magic_disguise
status_type = STATUS_EFFECT_REPLACE
var/mob/living/disguise_mob
var/datum/icon_snapshot/disguise

/atom/movable/screen/alert/status_effect/magic_disguise
Expand All @@ -12,27 +13,26 @@
icon = 'icons/mob/actions/actions.dmi'
icon_state = "chameleon_outfit"

/datum/status_effect/magic_disguise/on_creation(mob/living/new_owner, mob/living/disguise_mob)
/datum/status_effect/magic_disguise/on_creation(mob/living/new_owner, mob/living/_disguise_mob)
. = ..()
if(!ishuman(new_owner))
disguise_mob = _disguise_mob

/datum/status_effect/magic_disguise/on_apply()
. = ..()
if(!ishuman(owner))
return FALSE
if(!disguise_mob)
disguise_mob = select_disguise()
if(disguise_mob && ishuman(disguise_mob))
if(ishuman(disguise_mob))
create_disguise(disguise_mob)
if(disguise)
apply_disguise(new_owner)
return TRUE
apply_disguise(owner)
else
to_chat(owner, "<span class='warning'>Your spell fails to find a disguise!</span>")
return FALSE

/datum/status_effect/magic_disguise/on_apply()
. = ..()
if(!ishuman(owner))
return FALSE

RegisterSignal(owner, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(remove_disguise))
return TRUE

/datum/status_effect/magic_disguise/on_remove()
owner.regenerate_icons()
Expand Down Expand Up @@ -74,6 +74,7 @@
H.overlays = disguise.overlays
H.update_inv_r_hand()
H.update_inv_l_hand()
SEND_SIGNAL(H, COMSIG_CARBON_REGENERATE_ICONS)
to_chat(H, "<span class='notice'>You disguise yourself as [disguise.name].</span>")

/datum/status_effect/magic_disguise/proc/remove_disguise()
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/miniantags/abduction/abduction_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
M.overlays = disguise.overlays
M.update_inv_r_hand()
M.update_inv_l_hand()
SEND_SIGNAL(M, COMSIG_CARBON_REGENERATE_ICONS)

/obj/item/clothing/suit/armor/abductor/vest/proc/DeactivateStealth()
if(!stealth_active)
Expand Down

0 comments on commit 1377fd1

Please sign in to comment.