prevents xenos catching thrown items they can't hold (#21766)

* prevents xenos catching thrown items they can't hold

* gogo gadget duplicate code

* trait solution
This commit is contained in:
GDN
2023-09-01 16:37:09 -05:00
committed by GitHub
parent acb7352265
commit e9acb9fde4
6 changed files with 10 additions and 7 deletions
@@ -1,5 +1,8 @@
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..(AM, hitpush = FALSE)
if(!skipcatch && in_throw_mode && !HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) && HAS_TRAIT(AM, TRAIT_XENO_INTERACTABLE) && !restrained())
throw_mode_off()
AM.attack_hand(src)
..(AM, skipcatch = TRUE, hitpush = FALSE)
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
@@ -27,6 +27,7 @@
/obj/item/clothing/mask/facehugger/Initialize(mapload)
. = ..()
AddComponent(/datum/component/proximity_monitor)
ADD_TRAIT(src, TRAIT_XENO_INTERACTABLE, UID())
/obj/item/clothing/mask/facehugger/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
..()
@@ -36,9 +37,6 @@
/obj/item/clothing/mask/facehugger/attackby(obj/item/O, mob/user, params)
return O.attack_obj(src, user, params)
/obj/item/clothing/mask/facehugger/attack_alien(mob/user) //can be picked up by aliens
return attack_hand(user)
/obj/item/clothing/mask/facehugger/attack_hand(mob/user)
if((stat != DEAD && !sterile) && !isalien(user))
if(Attach(user))
@@ -8,9 +8,9 @@
if(AM.GetComponent(/datum/component/two_handed))
if(get_inactive_hand())
return FALSE
throw_mode_off()
put_in_active_hand(AM)
visible_message("<span class='warning'>[src] catches [AM]!</span>")
throw_mode_off()
SEND_SIGNAL(src, COMSIG_CARBON_THROWN_ITEM_CAUGHT, AM)
return TRUE
return ..()