Grab Stuff (#16337)

* Grab Stuff

* Extra Stuff

* typo on main

* matt changes

* update cl
This commit is contained in:
Geeves
2023-09-22 21:48:25 +00:00
committed by GitHub
parent 6d0dc3e5a4
commit f6f018d8d5
9 changed files with 46 additions and 22 deletions
+2 -1
View File
@@ -768,10 +768,11 @@ default behaviour is:
if(prob(resist_chance))
visible_message(resist_msg)
qdel(G)
break
if(resisting)
visible_message(SPAN_WARNING("[src] resists!"))
setClickCooldown(25)
setClickCooldown(2.5 SECONDS)
/mob/living/verb/lay_down()
set name = "Rest"
+1 -1
View File
@@ -864,7 +864,7 @@
else
lying = MOB_IS_INCAPACITATED(INCAPACITATION_KNOCKDOWN)
lying_is_intentional = FALSE
canmove = !MOB_IS_INCAPACITATED(INCAPACITATION_KNOCKOUT)
canmove = !MOB_IS_INCAPACITATED(INCAPACITATION_KNOCKOUT) && !weakened
if(lying)
density = 0
-1
View File
@@ -57,7 +57,6 @@
var/computer_id = null
var/character_id = 0
var/obj/machinery/machine = null
var/other_mobs = null
var/height = HEIGHT_NOT_USED
var/sdisabilities = 0 //Carbon
var/disabilities = 0 //Carbon
+11 -14
View File
@@ -10,17 +10,6 @@
return 1
///Process_Grab()
///Called by client/Move()
///Checks to see if you are grabbing or being grabbed by anything and if moving will affect your grab.
/client/proc/Process_Grab()
if(isliving(mob)) //if we are being grabbed
var/mob/living/L = mob
if(!L.canmove && L.grabbed_by.len)
L.resist() //shortcut for resisting grabs
for(var/obj/item/grab/G in list(mob.l_hand, mob.r_hand))
G.reset_kill_state() //no wandering across the station/asteroid while choking someone
/obj/item/grab
name = "grab"
icon = 'icons/mob/screen/generic.dmi'
@@ -177,6 +166,11 @@
adjust_position()
/obj/item/grab/proc/handle_eye_mouth_covering_wrapper()
SIGNAL_HANDLER
INVOKE_ASYNC(src, PROC_REF(handle_eye_mouth_covering), affecting, assailant, assailant.zone_sel.selecting)
/obj/item/grab/proc/handle_eye_mouth_covering(mob/living/carbon/target, mob/user, var/target_zone)
var/announce = (target_zone != last_hit_zone) //only display messages when switching between different target zones
last_hit_zone = target_zone
@@ -288,6 +282,8 @@
state = GRAB_AGGRESSIVE
icon_state = "grabbed1"
hud.icon_state = "reinforce1"
RegisterSignal(assailant, COMSIG_MOB_ZONE_SEL_CHANGE, PROC_REF(handle_eye_mouth_covering_wrapper))
handle_eye_mouth_covering(affecting, assailant, assailant.zone_sel.selecting)
else if(state < GRAB_NECK)
if(isslime(affecting))
assailant.visible_message(SPAN_WARNING("[assailant] tries to squeeze [affecting], but [assailant.get_pronoun("his")] hands sink right through!"), SPAN_WARNING("You try to squeeze [affecting], but your hands sink right through!"))
@@ -354,8 +350,7 @@
last_action = world.time
reset_kill_state() //using special grab moves will interrupt choking them
//clicking on the victim while grabbing them
if(M == affecting)
if(M == affecting) //clicking on the victim while grabbing them
if(ishuman(affecting))
var/hit_zone = target_zone
flick(hud.icon_state, hud)
@@ -385,7 +380,7 @@
hair_pull(affecting, assailant)
//clicking on yourself while grabbing them
if(M == assailant && assailant.a_intent == I_GRAB && state >= GRAB_AGGRESSIVE)
else if(M == assailant && assailant.a_intent == I_GRAB && state >= GRAB_AGGRESSIVE)
devour(affecting, assailant)
/obj/item/grab/dropped()
@@ -407,6 +402,8 @@
if(!QDELETED(linked_grab))
qdel(linked_grab)
UnregisterSignal(assailant, COMSIG_MOB_ZONE_SEL_CHANGE)
if(wielded)
if(affecting.buckled_to == assailant)
affecting.buckled_to = null
+16 -5
View File
@@ -3,8 +3,12 @@
if(ismob(mover))
var/mob/moving_mob = mover
if ((other_mobs && moving_mob.other_mobs))
return 1
if(moving_mob.pulledby == src)
return TRUE
if(length(moving_mob.grabbed_by))
for(var/obj/item/grab/G in moving_mob.grabbed_by)
if(G.assailant == src)
return TRUE
return (!mover.density || !density || lying)
else
return (!mover.density || !density || lying)
@@ -238,9 +242,16 @@
console.jump_on_click(mob,T)
return
// Only meaningful for living mobs.
if(Process_Grab())
return
if(length(mob.grabbed_by))
var/turf/target_turf = get_step(mob, direct)
for(var/obj/item/grab/G in mob.grabbed_by)
// can't move, try resisting and stop movement
if(G.state > GRAB_PASSIVE || get_dist(G.assailant, target_turf) > 1)
L.resist()
return
for(var/obj/item/grab/G in list(mob.l_hand, mob.r_hand))
G.reset_kill_state() //no wandering across the station/asteroid while choking someone
if(!mob.canmove || mob.paralysis)
return