mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into BookClub
This commit is contained in:
@@ -299,26 +299,38 @@
|
||||
///Called by client/Move()
|
||||
///Checks to see if you are being grabbed and if so attemps to break it
|
||||
/client/proc/Process_Grab()
|
||||
if(locate(/obj/item/weapon/grab, locate(/obj/item/weapon/grab, mob.grabbed_by.len)))
|
||||
if(mob.grabbed_by.len)
|
||||
var/list/grabbing = list()
|
||||
|
||||
if(istype(mob.l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = mob.l_hand
|
||||
grabbing += G.affecting
|
||||
|
||||
if(istype(mob.r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = mob.r_hand
|
||||
grabbing += G.affecting
|
||||
for(var/obj/item/weapon/grab/G in mob.grabbed_by)
|
||||
if((G.state == 1)&&(!grabbing.Find(G.assailant))) qdel(G)
|
||||
if(G.state == 2)
|
||||
move_delay = world.time + 10
|
||||
if(!prob(25)) return 1
|
||||
mob.visible_message("\red [mob] has broken free of [G.assailant]'s grip!")
|
||||
qdel(G)
|
||||
if(G.state == 3)
|
||||
move_delay = world.time + 10
|
||||
if(!prob(5)) return 1
|
||||
mob.visible_message("\red [mob] has broken free of [G.assailant]'s headlock!")
|
||||
qdel(G)
|
||||
|
||||
for(var/X in mob.grabbed_by)
|
||||
var/obj/item/weapon/grab/G = X
|
||||
switch(G.state)
|
||||
|
||||
if(GRAB_PASSIVE)
|
||||
if(!grabbing.Find(G.assailant)) //moving always breaks a passive grab unless we are also grabbing our grabber.
|
||||
qdel(G)
|
||||
|
||||
if(GRAB_AGGRESSIVE)
|
||||
move_delay = world.time + 10
|
||||
if(!prob(25))
|
||||
return 1
|
||||
mob.visible_message("<span class='danger'>[mob] has broken free of [G.assailant]'s grip!</span>")
|
||||
qdel(G)
|
||||
|
||||
if(GRAB_NECK)
|
||||
move_delay = world.time + 10
|
||||
if(!prob(5))
|
||||
return 1
|
||||
mob.visible_message("<span class='danger'>[mob] has broken free of [G.assailant]'s headlock!</span>")
|
||||
qdel(G)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user