Adds size-based slowdowns to flipping tables. (#26452)

* Makes only humans able to flip tables

* tiny delay for humans too

* better wording

* No delay for humans

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/objects/structures/tables_racks.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
Luc
2024-08-25 18:52:20 +00:00
committed by GitHub
co-authored by Burzah DGamerL
parent 5fb580d0d2
commit d9e573f883
+31 -2
View File
@@ -328,22 +328,51 @@
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user) || !can_be_flipped || is_ventcrawling(user))
return
var/flip_speed = get_flip_speed(user)
if(!flipped)
if(flip_speed > 0)
user.visible_message("<span class='warning'>[user] starts trying to flip [src]!</span>", "<span class='warning'>You start trying to flip [src][flip_speed >= 5 SECONDS ? " (it'll take about [flip_speed / 10] seconds)." : ""].</span>")
if(!do_after(user, flip_speed, TRUE, src))
user.visible_message("<span class='notice'>[user] gives up on trying to flip [src].</span>")
return
if(!flip(get_cardinal_dir(user, src)))
to_chat(user, "<span class='notice'>It won't budge.</span>")
return
user.visible_message("<span class='warning'>[user] flips \the [src]!</span>")
user.visible_message("<span class='warning'>[user] flips [src]!</span>")
if(climbable)
structure_shaken()
else
if(flip_speed > 0)
user.visible_message("<span class='warning'>[user] starts trying to right [src]!</span>", "<span class='warning'>You start trying to right [src][flip_speed >= 5 SECONDS ? " (it'll take about [flip_speed / 10] seconds)." : ""]</span>")
if(!do_after(user, flip_speed, TRUE, src))
user.visible_message("<span class='notice'>[user] gives up on trying to right [src].</span>")
return
if(!unflip())
to_chat(user, "<span class='notice'>It won't budge.</span>")
user.visible_message("<span class='warning'>[user] rights [src]!</span>")
/obj/structure/table/proc/get_flip_speed(mob/living/flipper)
if(!istype(flipper))
return 0 SECONDS // sure
if(!issimple_animal(flipper))
return 0 SECONDS
switch(flipper.mob_size)
if(MOB_SIZE_TINY)
return 30 SECONDS // you can do it but you gotta *really* work for it
if(MOB_SIZE_SMALL)
return 5 SECONDS // not gonna terrorize anything
else
return 0 SECONDS
/obj/structure/table/proc/flip(direction)
if(flipped)
return FALSE
return 0
if(!straight_table_check(turn(direction, 90)) || !straight_table_check(turn(direction, -90)))
return FALSE