Fix lazarus injector not working (#20100)

Fix lazarus injector not working.
Fix corgi attack resolution not returning parent result.

Fixes #19861
This commit is contained in:
Fluffy
2024-10-25 19:55:26 +02:00
committed by GitHub
parent 641d9fa3b0
commit a0632afa95
3 changed files with 90 additions and 29 deletions
+30 -28
View File
@@ -807,36 +807,38 @@
item_state = icon_state
update_held_icon()
/obj/item/lazarus_injector/afterattack(atom/target, mob/user, proximity_flag)
if(!loaded)
return
if(isliving(target) && proximity_flag)
if(istype(target, /mob/living/simple_animal))
var/mob/living/simple_animal/M = target
if(!(M.find_type() & revive_type) || !(M.tameable))
to_chat(user, SPAN_INFO("\The [src] does not work on this sort of creature."))
return
if(M.stat == DEAD)
if(emagged) //if emagged, will set anything revived to the user's faction. convert station pets to the traitor side!
M.faction = user.faction
if(malfunctioning) //when EMP'd, will set the mob faction to its initial faction, so any taming will be reverted.
M.faction = initial(M.faction)
M.revive()
M.icon_state = M.icon_living
M.desc = initial(M.desc)
loaded = FALSE
user.visible_message(SPAN_NOTICE("\The [user] revives \the [M] by injecting it with \the [src]."))
feedback_add_details("lazarus_injector", "[M.type]")
playsound(src, 'sound/effects/refill.ogg', 50, TRUE)
update_icon()
return
else
to_chat(user, SPAN_INFO("\The [src] is only effective on the dead."))
return
else
to_chat(user, SPAN_INFO("\The [src] is only effective on lesser beings."))
/obj/item/lazarus_injector/attack(mob/living/target_mob, mob/living/user, target_zone)
//If we're not loaded, the target is not a living mob, or we're further from 1 tile away, not our problem
if(!loaded || !isliving(target_mob) || get_dist(target_mob, user) > 1)
return ..()
if(istype(target_mob, /mob/living/simple_animal))
var/mob/living/simple_animal/M = target_mob
if(!(M.find_type() & revive_type) || !(M.tameable))
to_chat(user, SPAN_INFO("\The [src] does not work on this sort of creature."))
return
if(M.stat == DEAD)
if(emagged) //if emagged, will set anything revived to the user's faction. convert station pets to the traitor side!
M.faction = user.faction
if(malfunctioning) //when EMP'd, will set the mob faction to its initial faction, so any taming will be reverted.
M.faction = initial(M.faction)
M.revive()
M.icon_state = M.icon_living
M.desc = initial(M.desc)
loaded = FALSE
user.visible_message(SPAN_NOTICE("\The [user] revives \the [M] by injecting it with \the [src]."))
feedback_add_details("lazarus_injector", "[M.type]")
playsound(src, 'sound/effects/refill.ogg', 50, TRUE)
update_icon()
else
to_chat(user, SPAN_INFO("\The [src] is only effective on the dead."))
else
to_chat(user, SPAN_INFO("\The [src] is only effective on lesser beings."))
/obj/item/lazarus_injector/emp_act()
. = ..()