Adds Rocket Backblast (#55681)

This PR adds the backblast element, which when attached to a gun, creates giant plumes of fire when said gun is fired. The PM9 rocket launcher that nuke ops can buy kinda sucks and even a direct hit with the standard rockets loaded isn't enough to guarantee a one-hit crit on a direct hit against an armored opponent, which sucks for how much you pay for it. In that vein, I've also buffed the standard rockets a bit, they now do 50 brute up from 30 on a direct hit, and they create flames on their explosion.

Also makes a tweak to /proc/get_turf_in_angle(), since tile coordinates start at 1,1 instead of 0,0 that proc is now clamped to min 1,1 rather than 0,0
This commit is contained in:
Ryll Ryll
2021-01-09 23:27:03 -08:00
committed by GitHub
parent b96cdef992
commit 6d186482ef
10 changed files with 185 additions and 12 deletions
@@ -12,6 +12,11 @@
icon_state = "84mm-hedp"
projectile_type = /obj/projectile/bullet/a84mm
/obj/item/ammo_casing/caseless/rocket/weak
name = "\improper PM-9HE Low-Yield"
desc = "An 84mm High Explosive rocket. This one isn't quite as devastating."
projectile_type = /obj/projectile/bullet/a84mm_weak
/obj/item/ammo_casing/caseless/a75
desc = "A .75 bullet casing."
caliber = "75"
+2
View File
@@ -322,6 +322,8 @@
if(user)
SEND_SIGNAL(user, COMSIG_MOB_FIRED_GUN, user, target, params, zone_override)
SEND_SIGNAL(src, COMSIG_GUN_FIRED, user, target, params, zone_override)
add_fingerprint(user)
if(semicd)
@@ -44,7 +44,8 @@
/obj/item/gun/ballistic/rocketlauncher
name = "\improper PML-9"
desc = "A reusable rocket propelled grenade launcher. The words \"NT this way\" and an arrow have been written near the barrel."
desc = "A reusable rocket propelled grenade launcher. The words \"NT this way\" and an arrow have been written near the barrel. \
A sticker near the cheek rest reads, \"ENSURE AREA BEHIND IS CLEAR BEFORE FIRING\""
icon_state = "rocketlauncher"
inhand_icon_state = "rocketlauncher"
mag_type = /obj/item/ammo_box/magazine/internal/rocketlauncher
@@ -61,10 +62,22 @@
cartridge_wording = "rocket"
empty_indicator = TRUE
tac_reloads = FALSE
/// Do we shit flames behind us when we fire?
var/backblast = TRUE
/obj/item/gun/ballistic/rocketlauncher/Initialize()
. = ..()
if(backblast)
AddElement(/datum/element/backblast)
/obj/item/gun/ballistic/rocketlauncher/unrestricted
pin = /obj/item/firing_pin
/obj/item/gun/ballistic/rocketlauncher/nobackblast
name = "flameless PML-11"
desc = "A reusable rocket propelled grenade launcher. This one has been fitted with a special coolant loop to avoid embarassing teamkill 'accidents' from backblast."
backblast = FALSE
/obj/item/gun/ballistic/rocketlauncher/afterattack()
. = ..()
magazine.get_round(FALSE) //Hack to clear the mag after it's fired
@@ -15,3 +15,58 @@
if(location)
new /obj/effect/hotspot(location)
location.hotspot_expose(700, 50, 1)
/// Used in [the backblast element][/datum/element/backblast]
/obj/projectile/bullet/incendiary/backblast
damage = 15
range = 10 // actually overwritten in the backblast element
alpha = 0
pass_flags = PASSTABLE | PASSMOB
sharpness = SHARP_NONE
shrapnel_type = null
embedding = null
ricochet_chance = 10000
ricochets_max = 4
ricochet_incidence_leeway = 0
suppressed = SUPPRESSED_VERY
damage_type = BURN
flag = BOMB
speed = 1.2
wound_bonus = 30
bare_wound_bonus = 30
wound_falloff_tile = -4
fire_stacks = 3
/// Lazy attempt at knockback, any items this plume hits will be knocked back this far. Decrements with each tile passed.
var/knockback_range = 7
/// A lazylist of all the items we've already knocked back, so we don't do it again
var/list/launched_items
/// we only try to knock back the first 6 items per tile
#define BACKBLAST_MAX_ITEM_KNOCKBACK 6
/obj/projectile/bullet/incendiary/backblast/Move()
. = ..()
if(knockback_range <= 0)
return
knockback_range--
var/turf/current_turf = get_turf(src)
var/turf/throw_at_turf = get_turf_in_angle(Angle, current_turf, 7)
var/thrown_items = 0
for(var/iter in current_turf.contents)
if(thrown_items > BACKBLAST_MAX_ITEM_KNOCKBACK)
break
if(isitem(iter))
var/obj/item/iter_item = iter
if(iter_item.anchored || LAZYFIND(launched_items, iter_item) || iter_item.throwing)
continue
thrown_items++
iter_item.throw_at(throw_at_turf, knockback_range, knockback_range)
LAZYADD(launched_items, iter_item)
else if(isliving(iter))
var/mob/living/incineratee = iter
incineratee.take_bodypart_damage(0, damage, wound_bonus=wound_bonus, bare_wound_bonus=bare_wound_bonus)
incineratee.adjust_fire_stacks(fire_stacks)
#undef BACKBLAST_MAX_ITEM_KNOCKBACK
@@ -10,6 +10,7 @@
explosion(target, -1, 0, 2)
return BULLET_ACT_HIT
/// PM9 HEDP rocket
/obj/projectile/bullet/a84mm
name ="\improper HEDP rocket"
desc = "USE A WEEL GUN"
@@ -33,11 +34,12 @@
S.take_overall_damage(anti_armour_damage*0.75, anti_armour_damage*0.25)
return BULLET_ACT_HIT
/// PM9 standard rocket
/obj/projectile/bullet/a84mm_he
name ="\improper HE missile"
desc = "Boom."
icon_state = "missile"
damage = 30
damage = 50
ricochets_max = 0 //it's a MISSILE
embedding = null
shrapnel_type = null
@@ -45,11 +47,30 @@
/obj/projectile/bullet/a84mm_he/on_hit(atom/target, blocked=0)
..()
if(!isliving(target)) //if the target isn't alive, so is a wall or something
explosion(target, 0, 1, 2, 4)
explosion(target, 0, 1, 2, 4, flame_range = 3)
else
explosion(target, 0, 0, 2, 4)
explosion(target, 0, 0, 2, 4, flame_range = 3)
return BULLET_ACT_HIT
/// PM9 weak rocket
/obj/projectile/bullet/a84mm_weak
name ="low-yield HE missile"
desc = "Boom, but less so."
icon_state = "missile"
damage = 30
ricochets_max = 0 //it's a MISSILE
embedding = null
shrapnel_type = null
/obj/projectile/bullet/a84mm_weak/on_hit(atom/target, blocked=0)
..()
if(!isliving(target)) //if the target isn't alive, so is a wall or something
explosion(target, 0, 1, 2, 4, flame_range = 3)
else
explosion(target, 0, 0, 2, 4, flame_range = 3)
return BULLET_ACT_HIT
/// Mech BRM-6 missile
/obj/projectile/bullet/a84mm_br
name ="\improper HE missile"
desc = "Boom."