fixes petting pAI and improves proc performance

This commit is contained in:
Cactus
2019-08-26 04:23:24 -04:00
parent 45858e19ab
commit 8d2dbf8a8e
+25 -24
View File
@@ -380,32 +380,33 @@
return
/mob/living/silicon/pai/attack_hand(mob/user as mob)
//Chompstation edit
if(user.a_intent == I_HELP)
visible_message("<span class='notice'>[user.name] [rand("pets","pats")] [src].</span>")
else if(user.a_intent == I_GRAB)
if(user == src || anchored)
return 0
for(var/obj/item/weapon/grab/G in src.grabbed_by)
if(G.assailant == user)
user << "<span class='notice'>You already grabbed [src].</span>"
//Chompstation edit
switch(user.a_intent)
if(I_HELP)
visible_message("<span class='notice'>[user.name] [pick("pets","pats")] [src].</span>")
if(I_GRAB)
if(user == src || anchored)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(user, src)
if(buckled)
user << "<span class='notice'>You cannot grab [src], they're buckled in!</span>"
if(!G) //the grab will delete itself in New if affecting is anchored
return
user.put_in_active_hand(G)
G.synch()
LAssailant = user
for(var/obj/item/weapon/grab/G in src.grabbed_by)
if(G.assailant == user)
user << "<span class='notice'>You already grabbed [src].</span>"
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(user, src)
if(buckled)
user << "<span class='notice'>You cannot grab [src], they're buckled in!</span>"
if(!G) //the grab will delete itself in New if affecting is anchored
return
user.put_in_active_hand(G)
G.synch()
LAssailant = user
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='warning'>[user] has grabbed [src] passively!</span>")
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='warning'>[user] has grabbed [src] passively!</span>")
//End Chompstation edit
else
visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>")
close_up()
else
visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>")
close_up()
//End Chompstation edit
//I'm not sure how much of this is necessary, but I would rather avoid issues.
/mob/living/silicon/pai/proc/close_up()