Adds Stinger Grenades (#17474)

* balls

* lint this

* lint deez

* le change

* Update stinger.dm

* i am going to murder the new linter

* sprite

* Update CampinKiller24-ready-or-not.yml
This commit is contained in:
CampinKiller24
2023-10-05 10:16:21 +00:00
committed by GitHub
parent 4538e2a7cc
commit cea8ca8d9a
15 changed files with 169 additions and 5 deletions
@@ -0,0 +1,60 @@
///Stinger grenade projectile
/obj/item/projectile/bullet/rubberball/stinger_ball
damage = 2
agony = 50
armor_penetration = 10
range_step = 2
embed = FALSE
base_spread = 0
spread_step = 20
suppressed = TRUE //embedding messages are still produced so it's kind of weird when enabled.
no_attack_log = 1
muzzle_type = null
/obj/item/grenade/stinger
name = "stinger grenade"
desc = "A stinger grenade, designed to explode and expel rubber balls over an area for less-lethal takedowns. Popular with many law enforcement agencies."
icon_state = "stinger"
var/num_fragments = 70 ///total number of balls produced by the grenade
var/fragment_damage = 2
var/damage_step = 2 //projectiles lose a fragment each time they travel this distance. Can be a non-integer.
var/explosion_size = 1 ///size of the center explosion
//The radius of the circle used to launch projectiles. Lower values mean less projectiles are used but if set too low gaps may appear in the spread pattern
var/spread_range = 7
/obj/item/grenade/stinger/proc/sting(var/source, var/fragmin, var/fragmax, var/light_dam, var/flash_dam, var/p_dam, var/p_range, var/can_cover=TRUE, var/shard_range = 50)
var/turf/O = get_turf(source)
var/fragger = rand(fragmin,fragmax)
explosion(O, -1, -1, light_dam, flash_dam)
var/list/target_turfs = getcircle(O, 7)
var/fragments_per_projectile = round(fragger/target_turfs.len)
for(var/turf/T in target_turfs)
var/obj/item/projectile/bullet/rubberball/stinger_ball/P = new (O)
P.damage = p_dam
P.balls = fragments_per_projectile
P.range_step = p_range
P.shot_from = source
P.range = shard_range
P.name = "rubber ball"
P.launch_projectile(T)
if(can_cover)
for(var/mob/living/M in O)
if(M.lying && isturf(get_turf(source)))
P.attack_mob(M, 0, 0)
else
P.attack_mob(M, 0, 100)
/obj/item/grenade/stinger/prime()
..()
INVOKE_ASYNC(src, PROC_REF(sting), src, num_fragments, num_fragments, explosion_size, explosion_size+1, fragment_damage, damage_step, TRUE)
qdel(src)
@@ -387,6 +387,14 @@
illustration = "flashbang"
starts_with = list(/obj/item/grenade/flashbang = 7)
/obj/item/storage/box/stingers
name = "box of stinger grenades"
desc = "A box containing 7 antipersonnel stinger grenades. <br> WARNING: These devices are extremely dangerous and can cause injury."
icon_state = "secbox"
item_state = "secbox"
illustration = "stinger"
starts_with = list(/obj/item/grenade/stinger = 7)
/obj/item/storage/box/firingpins
name = "box of firing pins"
desc = "A box of NT brand Firearm authentication pins; Needed to operate most weapons."
+2 -1
View File
@@ -144,7 +144,8 @@
/obj/item/grenade/smokebomb,
/obj/item/grenade/flashbang,
/obj/item/grenade/empgrenade,
/obj/item/grenade/chem_grenade/incendiary
/obj/item/grenade/chem_grenade/incendiary,
/obj/item/grenade/stinger
)
var/obj/item/storage/bag/plasticbag/bag = new /obj/item/storage/bag/plasticbag(spawned.loc)
for(var/i in 1 to 7)
@@ -102,6 +102,7 @@
//Supply
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/box/ids(src)
new /obj/item/storage/box/stingers(src)
//Appearance
if(prob(50))
new /obj/item/storage/backpack/security(src)
@@ -170,6 +171,7 @@
new /obj/item/storage/box/ids(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/box/teargas(src)
new /obj/item/storage/box/stingers(src)
//Appearance
if(prob(50))
new /obj/item/storage/backpack/security(src)
@@ -42,6 +42,7 @@
new /obj/item/ammo_magazine/a10mm(src)
new /obj/item/storage/box/handcuffs(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/box/stingers(src)
new /obj/item/gun/energy/gun(src)
new /obj/item/gun/energy/gun(src)
new /obj/item/gun/energy/gun(src)