mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
[MIRROR] Effect grenade fix (#11983)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
87b4e8c3bf
commit
9310cc0a66
@@ -20,15 +20,7 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/grenade/confetti/detonate() //Find a good confetti firework or pop sound effect later
|
/obj/item/grenade/confetti/detonate() //Find a good confetti firework or pop sound effect later
|
||||||
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1, -3)
|
start_effect_sprayer(confetti_spread, confetti_strength, 'sound/effects/snap.ogg')
|
||||||
src.confetti_spread.set_up(10, 0, usr.loc)
|
|
||||||
spawn(0)
|
|
||||||
for(var/i = 1 to confetti_strength)
|
|
||||||
src.confetti_spread.start()
|
|
||||||
sleep(10)
|
|
||||||
qdel(src)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/grenade/confetti/party_ball //Intended to be used only with the confetti cannon.
|
/obj/item/grenade/confetti/party_ball //Intended to be used only with the confetti cannon.
|
||||||
name = "party ball"
|
name = "party ball"
|
||||||
@@ -40,12 +32,4 @@
|
|||||||
throwforce = 0 //Confetti cannon is only fun to shoot at people if it deals no damage.
|
throwforce = 0 //Confetti cannon is only fun to shoot at people if it deals no damage.
|
||||||
|
|
||||||
/obj/item/grenade/confetti/party_ball/detonate() //Could condense this by making the sound a variable in the parent but I'm lazy.
|
/obj/item/grenade/confetti/party_ball/detonate() //Could condense this by making the sound a variable in the parent but I'm lazy.
|
||||||
playsound(src.loc, 'sound/effects/confetti_ball.ogg', 50, 1, -3)
|
start_effect_sprayer(confetti_spread, confetti_strength, 'sound/effects/confetti_ball.ogg')
|
||||||
src.confetti_spread.set_up(10, 0, usr.loc)
|
|
||||||
spawn(0)
|
|
||||||
for(var/i = 1 to confetti_strength)
|
|
||||||
src.confetti_spread.start()
|
|
||||||
sleep(10)
|
|
||||||
qdel(src)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|||||||
@@ -116,3 +116,18 @@
|
|||||||
|
|
||||||
/obj/item/grenade/vendor_action(var/obj/machinery/vending/V)
|
/obj/item/grenade/vendor_action(var/obj/machinery/vending/V)
|
||||||
activate(V)
|
activate(V)
|
||||||
|
|
||||||
|
/obj/item/grenade/proc/start_effect_sprayer(var/datum/effect/effect/system/spraying, duration, sound_play, start_data = null)
|
||||||
|
playsound(loc, sound_play, 50, 1, -3)
|
||||||
|
spraying.set_up(10, 0, loc)
|
||||||
|
effect_spraying(spraying, duration, start_data)
|
||||||
|
|
||||||
|
/obj/item/grenade/proc/effect_spraying(var/datum/effect/effect/system/spraying, duration, start_data)
|
||||||
|
SHOULD_NOT_OVERRIDE(TRUE)
|
||||||
|
PRIVATE_PROC(TRUE)
|
||||||
|
|
||||||
|
spraying.start(start_data)
|
||||||
|
if(duration > 0)
|
||||||
|
addtimer(CALLBACK(src, PROC_REF(effect_spraying), spraying, --duration), 1 SECOND, TIMER_DELETE_ME)
|
||||||
|
return
|
||||||
|
qdel(src)
|
||||||
|
|||||||
@@ -22,15 +22,7 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/item/grenade/smokebomb/detonate()
|
/obj/item/grenade/smokebomb/detonate()
|
||||||
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
|
start_effect_sprayer(smoke, smoke_strength, 'sound/effects/smoke.ogg', smoke_color)
|
||||||
src.smoke.set_up(10, 0, usr.loc)
|
|
||||||
spawn(0)
|
|
||||||
for(var/i = 1 to smoke_strength)
|
|
||||||
src.smoke.start(smoke_color)
|
|
||||||
sleep(10)
|
|
||||||
qdel(src)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/grenade/smokebomb/attackby(obj/item/I as obj, mob/user as mob)
|
/obj/item/grenade/smokebomb/attackby(obj/item/I as obj, mob/user as mob)
|
||||||
if(istype(I,/obj/item/multitool))
|
if(istype(I,/obj/item/multitool))
|
||||||
|
|||||||
Reference in New Issue
Block a user