Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Fixes some grab jank #321

Merged
merged 6 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions code/mob/living/critter/flock/flockdrone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// antigrab powers
var/antigrab_counter = 0
var/antigrab_fires_at = 100
var/antigrab_fires_at = 2

var/glow_color = "#26ffe6a2"

Expand Down Expand Up @@ -399,6 +399,20 @@
if (src.dormant)
return

//if we're blocking that means we're not grabbed
if (!length(src.grabbed_by) || src.find_type_in_hand(/obj/item/grab/block))
src.antigrab_counter = 0
else
src.antigrab_counter++
if (src.antigrab_counter >= src.antigrab_fires_at)
playsound(src, "sound/effects/electric_shock.ogg", 40, 1, -3)
boutput(src, "<span class='flocksay'><b>\[SYSTEM: Anti-grapple countermeasures deployed.\]</b></span>")
for(var/obj/item/grab/G in src.grabbed_by)
var/mob/living/L = G.assailant
L.shock(src, 5000)
qdel(G) //in case they don't fall over from our shock
src.antigrab_counter = 0

var/obj/item/I = absorber.item

if (!I)
Expand Down Expand Up @@ -456,20 +470,6 @@


/mob/living/critter/flock/drone/process_move(keys)
if(keys && length(src.grabbed_by))
if (length(src.grabbed_by) == 1 && src.find_type_in_hand(/obj/item/grab/block))
src.antigrab_counter = 0
else
++src.antigrab_counter
if(src.antigrab_counter >= src.antigrab_fires_at)
playsound(src, "sound/effects/electric_shock.ogg", 40, 1, -3)
boutput(src, "<span class='flocksay'><b>\[SYSTEM: Anti-grapple countermeasures deployed.\]</b></span>")
for(var/obj/item/grab/G in src.grabbed_by)
var/mob/living/L = G.assailant
L.shock(src, 5000)
src.antigrab_counter = 0
else
src.antigrab_counter = 0
if(keys & KEY_RUN && src.resources >= 1)
if(!src.floorrunning && isfeathertile(src.loc))
if (length(src.grabbed_by))
Expand Down
3 changes: 3 additions & 0 deletions code/turf/turf_flock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
// do not call parent, this is not an ordinary floor
if(!C || !user)
return
if (istype(C, /obj/item/grab))
grab_smash(C, user)
return
if(ispryingtool(C) && src.broken)
playsound(src, "sound/items/Crowbar.ogg", 80, 1)
src.break_tile_to_plating()
Expand Down