From f0009f455935347e4b80bf5ee66bea9abecf5d1e Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Mon, 14 Dec 2020 11:44:17 +0000 Subject: [PATCH] Snowballs from snow tiles (#15082) * snow * Cooldown and sound effect Don't want snowball spam causing lag * qdel Co-authored-by: Farie82 Co-authored-by: Farie82 --- code/game/objects/effects/snowcloud.dm | 1 - code/game/objects/structures/snow.dm | 34 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/code/game/objects/effects/snowcloud.dm b/code/game/objects/effects/snowcloud.dm index 66535adc856..f0eb0b79c8d 100644 --- a/code/game/objects/effects/snowcloud.dm +++ b/code/game/objects/effects/snowcloud.dm @@ -125,7 +125,6 @@ /obj/item/snowball name = "snowball" desc = "Get ready for a snowball fight!" - force = 0 throwforce = 10 icon_state = "snowball" damtype = STAMINA diff --git a/code/game/objects/structures/snow.dm b/code/game/objects/structures/snow.dm index 02b2ae8c433..76329319be1 100644 --- a/code/game/objects/structures/snow.dm +++ b/code/game/objects/structures/snow.dm @@ -1,11 +1,25 @@ /obj/structure/snow - gender = PLURAL - name = "snow" - desc = "A crunchy layer of freshly fallen snow." - anchored = TRUE - density = FALSE - layer = TURF_LAYER - plane = FLOOR_PLANE - icon = 'icons/turf/snow.dmi' - icon_state = "snow" - max_integrity = 15 + name = "snow" + desc = "A crunchy layer of freshly fallen snow." + anchored = TRUE + density = FALSE + layer = TURF_LAYER + plane = FLOOR_PLANE + icon = 'icons/turf/snow.dmi' + icon_state = "snow" + max_integrity = 15 + var/cooldown = 0 // very cool down + +/obj/structure/snow/AltClick(mob/user) + . = ..() + if(cooldown > world.time) + return + if(ishuman(user) && Adjacent(user)) + var/mob/living/carbon/human/H = user + var/obj/item/snowball/S = new + cooldown = world.time + 3 SECONDS + + if(H.put_in_hands(S)) + playsound(src, 'sound/weapons/slashmiss.ogg', 15) // crunchy snow sound + else + qdel(S) // Spawn in hands only