Skip to content

Commit

Permalink
Shovels can now be used to collapse tunnels (#4013)
Browse files Browse the repository at this point in the history
# About the pull request

This PR makes it so shovels can be used to collapse tunnels.

# Explain why it's good for the game

I'd like to see C4/explosives be used to manipulate a marine's
environment rather than horded for the eventual tunnel that needs
cleared.

Gives shovels another use past sandbags/snow which you can go entire
rounds and not mess with or run into either.

Sound: https://freesound.org/people/SoundsForHim/sounds/395567/

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

:cl: Morrow
add: Shovels can now be used to collapse tunnels
/:cl:
  • Loading branch information
morrowwolf committed Jul 27, 2023
1 parent ac0a37e commit 3c84769
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions code/modules/cm_aliens/structures/tunnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Tunnels
*/

#define TUNNEL_COLLAPSING_TIME (60 SECONDS)

/obj/structure/tunnel
name = "tunnel"
desc = "A tunnel entrance. Looks like it was dug by some kind of clawed beast."
Expand Down Expand Up @@ -83,6 +85,25 @@

/obj/structure/tunnel/attackby(obj/item/W as obj, mob/user as mob)
if(!isxeno(user))
if(istype(W, /obj/item/tool/shovel))
var/obj/item/tool/shovel/destroying_shovel = W

if(destroying_shovel.folded)
return

playsound(user.loc, 'sound/effects/thud.ogg', 40, 1, 6)

user.visible_message(SPAN_NOTICE("[user] starts to collapse [src]!"), SPAN_NOTICE("You start collapsing [src]!"))

if(user.action_busy || !do_after(user, TUNNEL_COLLAPSING_TIME * ((100 - destroying_shovel.shovelspeed) * 0.01), INTERRUPT_ALL, BUSY_ICON_BUILD))
return

playsound(loc, 'sound/effects/tunnel_collapse.ogg', 50)

visible_message(SPAN_NOTICE("[src] collapses in on itself."))

qdel(src)

return ..()
return attack_alien(user)

Expand Down
Binary file added sound/effects/tunnel_collapse.ogg
Binary file not shown.

0 comments on commit 3c84769

Please sign in to comment.