fixes cherry bombs (#20921)

* fixes cherry bombs

moves prime to AFTER the auto-throw is toggled
added a sleep before the explosion trigger to prevent instant explosions
reafactor'd black powder to explode at its container's location instead of where the black powder's trigger is, to prevent desync between the explosion location and a thrown object

* removed sleep

mistook the desync before as an instant explosion. now that desync was fixed it is shown to not be needed

* Update code/modules/hydroponics/grown/misc_seeds.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* comments added

* renames location to prime_location

---------

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Kyani
2023-05-05 21:21:11 +02:00
committed by GitHub
co-authored by Ryan
parent 12c154532e
commit 87201198ef
2 changed files with 6 additions and 3 deletions
@@ -166,12 +166,15 @@
do_sparks(2, 1, location)
addtimer(CALLBACK(src, PROC_REF(blackpowder_detonate), holder, location, created_volume), rand(5, 15))
/datum/chemical_reaction/blackpowder_explosion/proc/blackpowder_detonate(datum/reagents/holder, turf/location, created_volume)
/datum/chemical_reaction/blackpowder_explosion/proc/blackpowder_detonate(datum/reagents/holder, turf/prime_location, created_volume)
var/ex_severe = round(created_volume / 100)
var/ex_heavy = round(created_volume / 42)
var/ex_light = round(created_volume / 20)
var/ex_flash = round(created_volume / 8)
explosion(location, ex_severe, ex_heavy,ex_light, ex_flash, 1)
if(istype(holder.my_atom)) //ensures the explosion happens at the container, not where its primed at
explosion(holder.my_atom.loc, ex_severe, ex_heavy,ex_light, ex_flash, 1)
else
explosion(prime_location, ex_severe, ex_heavy,ex_light, ex_flash, 1)
// If this black powder is in a decal, remove the decal, because it just exploded
if(istype(holder.my_atom, /obj/effect/decal/cleanable/dirt/blackpowder))
qdel(holder.my_atom)