Adds TRAIT_NOINTERACT and applies it to guardian Time Erasure (#9362)

* Adds TRAIT_NOINTERACT

TRAIT_NOINTERACT currently disallows the touching (clicking) of anything and doesn't allow you to use items in hand

* Adds TRAIT_NOINTERACT to Time Erasure

TRAIT_NOINTERACT makes it so you primarily can't driveby drop grenades or stunbaton people while using this ability while also preventing future exploits by removing the ability to touch at all. TRAIT_PACIFISM should cover mostly everything else. Except bear traps I guess. Fuck you

* _globalvars/traits.dm doesn't exist anymore

this is so sad

* Update code/_onclick/item_attack.dm

I forgot to add "can't"

Co-authored-by: Hopekz <hopekxx@gmail.com>

Co-authored-by: Hopekz <hopekxx@gmail.com>
This commit is contained in:
ynot01
2020-08-01 22:10:54 -04:00
committed by GitHub
parent 691c025f87
commit 97bcdc1abd
5 changed files with 17 additions and 1 deletions

View File

@@ -21,6 +21,9 @@
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
/obj/item/proc/attack_self(mob/user)
if(HAS_TRAIT(user, TRAIT_NOINTERACT)) //sorry no using grenades
to_chat(user, "<span class='notice'>You can't use things!</span>")
return
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user) & COMPONENT_NO_INTERACT)
return
interact(user)

View File

@@ -6,6 +6,10 @@
*/
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity)
if(HAS_TRAIT(A, TRAIT_NOINTERACT))
to_chat(A, "<span class='notice'>You can't touch things!</span>")
return
if(!has_active_hand()) //can't attack without a hand.
to_chat(src, "<span class='notice'>You look at your arm and sigh.</span>")
return
@@ -54,6 +58,9 @@
return FALSE
if(!(interaction_flags_atom & INTERACT_ATOM_IGNORE_INCAPACITATED) && user.incapacitated((interaction_flags_atom & INTERACT_ATOM_IGNORE_RESTRAINED), !(interaction_flags_atom & INTERACT_ATOM_CHECK_GRAB)))
return FALSE
if(HAS_TRAIT(user, TRAIT_NOINTERACT))
to_chat(user, "<span class='notice'>You can't touch things!</span>")
return FALSE
return TRUE
/atom/ui_status(mob/user)

View File

@@ -13,6 +13,9 @@
#define TK_MAXRANGE 15
/atom/proc/attack_tk(mob/user)
if(HAS_TRAIT(user, TRAIT_NOINTERACT))
to_chat(user, "<span class='notice'>You can't touch things, even with your mind!</span>")
return
if(user.stat || !tkMaxRangeCheck(user, src))
return
new /obj/effect/temp_visual/telekinesis(get_turf(src))