mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 05:57:24 +01:00
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:
@@ -207,6 +207,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
#define TRAIT_NOSELFIGNITION_HEAD_ONLY "no_selfignition_head_only"
|
||||
#define TRAIT_CONTORTED_BODY "contorted_body"
|
||||
#define TRAIT_DEFLECTS_PROJECTILES "trait_deflects_projectiles"
|
||||
#define TRAIT_XENO_INTERACTABLE "can_be_interacted_with_by_xenos"
|
||||
|
||||
//***** ITEM AND MOB TRAITS *****//
|
||||
/// Show what machine/door wires do when held.
|
||||
|
||||
@@ -86,7 +86,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
"TRAIT_BUTCHER_HUMANS" = TRAIT_BUTCHERS_HUMANS,
|
||||
"TRAIT_CMAGGED" = TRAIT_CMAGGED,
|
||||
"TRAIT_FORCES_OPEN_DOORS" = TRAIT_FORCES_OPEN_DOORS_ITEM,
|
||||
"TRAIT_OBSCURED_WIRES" = TRAIT_OBSCURED_WIRES
|
||||
"TRAIT_OBSCURED_WIRES" = TRAIT_OBSCURED_WIRES,
|
||||
"TRAIT_XENO_INTERACTABLE" = TRAIT_XENO_INTERACTABLE
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
/obj/item/attack_alien(mob/user)
|
||||
var/mob/living/carbon/alien/A = user
|
||||
|
||||
if(!A.has_fine_manipulation)
|
||||
if(!A.has_fine_manipulation && !HAS_TRAIT(src, TRAIT_XENO_INTERACTABLE))
|
||||
if(src in A.contents) // To stop Aliens having items stuck in their pockets
|
||||
A.unEquip(src)
|
||||
to_chat(user, "<span class='warning'>Your claws aren't capable of such fine manipulation!</span>")
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
Reference in New Issue
Block a user