Skip to content

Commit

Permalink
fix(flashbang): clusterbang fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BaraBarax authored Feb 5, 2024
1 parent 2cb28e0 commit d155126
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/game/objects/items/grenades/flashbang.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
icon_state = "clusterbang"

/obj/item/grenade/flashbang/clusterbang/detonate()
var/cluster_loc = loc
var/numspawned = rand(4,8)
var/again = 0
for(var/more = numspawned,more > 0,more--)
Expand All @@ -114,12 +115,12 @@

for(,numspawned > 0, numspawned--)
spawn(0)
new /obj/item/grenade/flashbang/cluster(src.loc)//Launches flashbangs
new /obj/item/grenade/flashbang/cluster(cluster_loc)//Launches flashbangs
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)

for(,again > 0, again--)
spawn(0)
new /obj/item/grenade/flashbang/clusterbang/segment(src.loc)//Creates a 'segment' that launches a few more flashbangs
new /obj/item/grenade/flashbang/clusterbang/segment(cluster_loc)//Creates a 'segment' that launches a few more flashbangs
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
qdel(src)
return
Expand All @@ -135,22 +136,23 @@
active = 1
banglet = 1
var/stepdist = rand(1,4)//How far to step
var/temploc = src.loc//Saves the current location to know where to step away from
var/temploc = loc//Saves the current location to know where to step away from
walk_away(src,temploc,stepdist)//I must go, my people need me
var/dettime = rand(15,60)
spawn(dettime)
detonate()
..()

/obj/item/grenade/flashbang/clusterbang/segment/detonate()
var/cluster_loc = loc
var/numspawned = rand(4,8)
for(var/more = numspawned,more > 0,more--)
if(prob(35))
numspawned --

for(,numspawned > 0, numspawned--)
spawn(0)
new /obj/item/grenade/flashbang/cluster(src.loc)
new /obj/item/grenade/flashbang/cluster(cluster_loc)
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
qdel(src)
return
Expand Down

0 comments on commit d155126

Please sign in to comment.