Skip to content

Commit

Permalink
stop skittering when grabbed
Browse files Browse the repository at this point in the history
  • Loading branch information
TobleroneSwordfish committed Feb 9, 2025
1 parent a563d26 commit c71ee96
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
47 changes: 25 additions & 22 deletions code/modules/medical/genetics/bioEffects/beneficial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1086,29 +1086,32 @@ var/list/radio_brains = list()

proc/on_sprint()
set waitfor = FALSE
if (src.owner.lying && !is_incapacitated(src.owner) && !ON_COOLDOWN(src.owner, "skitter", 7 SECONDS))
src.owner.visible_message(SPAN_ALERT("[src.owner] skitters away!"))
playsound(src.owner, 'sound/voice/animal/bugchitter.ogg', 80, TRUE)
src.owner.flags |= TABLEPASS
src.owner.layer = OBJ_LAYER-0.2
var/initial_glide = src.owner.glide_size
APPLY_ATOM_PROPERTY(src.owner, PROP_MOB_CANTMOVE, src) //stop them from rolling out from under the table
var/stop_delay = 0
for (var/i in 1 to 4)
src.owner.glide_size = (32 / 1) * world.tick_lag
step(src.owner, src.owner.dir)
if (locate(/obj/table) in src.owner.loc)
stop_delay = 1 SECOND
break
sleep(0.1 SECONDS)
src.owner.glide_size = initial_glide
src.owner.flags &= ~TABLEPASS
if (!src.owner.lying || is_incapacitated(src.owner) || length(src.owner.grabbed_by))
return
if (ON_COOLDOWN(src.owner, "skitter", 7 SECONDS))
return
src.owner.visible_message(SPAN_ALERT("[src.owner] skitters away!"))
playsound(src.owner, 'sound/voice/animal/bugchitter.ogg', 80, TRUE)
src.owner.flags |= TABLEPASS
src.owner.layer = OBJ_LAYER-0.2
var/initial_glide = src.owner.glide_size
APPLY_ATOM_PROPERTY(src.owner, PROP_MOB_CANTMOVE, src) //stop them from rolling out from under the table
var/stop_delay = 0
for (var/i in 1 to 4)
src.owner.glide_size = (32 / 1) * world.tick_lag
step(src.owner, src.owner.dir)
if (locate(/obj/table) in src.owner.loc)
src.owner.setStatus("undertable", INFINITE_STATUS)
else
src.owner.layer = initial(src.owner.layer)
sleep(stop_delay)
REMOVE_ATOM_PROPERTY(src.owner, PROP_MOB_CANTMOVE, src)
stop_delay = 1 SECOND
break
sleep(0.1 SECONDS)
src.owner.glide_size = initial_glide
src.owner.flags &= ~TABLEPASS
if (locate(/obj/table) in src.owner.loc)
src.owner.setStatus("undertable", INFINITE_STATUS)
else
src.owner.layer = initial(src.owner.layer)
sleep(stop_delay)
REMOVE_ATOM_PROPERTY(src.owner, PROP_MOB_CANTMOVE, src)

OnRemove()
UnregisterSignal(src.owner, COMSIG_MOB_SPRINT)
Expand Down
2 changes: 2 additions & 0 deletions strings/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

(t)sun feb 09 25
(u)LeahTheTech
(+)Roaches can no longer skitter out of grabs.
(u)Lord_Earthfire
(p)22230
(e)🔎💅📦|C-Code-Quality, C-QoL, A-Game-Objects
Expand Down

0 comments on commit c71ee96

Please sign in to comment.