diff --git a/code/datums/ammo/shrapnel.dm b/code/datums/ammo/shrapnel.dm index e27caa4b27..ac48a3f909 100644 --- a/code/datums/ammo/shrapnel.dm +++ b/code/datums/ammo/shrapnel.dm @@ -34,6 +34,31 @@ stamina_damage = 25 shrapnel_chance = 0 +/datum/ammo/bullet/shrapnel/canister + name = "low velocity canister shot" + icon_state = "buckshot" + + accuracy_var_low = PROJECTILE_VARIANCE_TIER_6 + accuracy_var_high = PROJECTILE_VARIANCE_TIER_8 + accurate_range = 5 + max_range = 8 + damage = 25 + penetration = 0 + shell_speed = AMMO_SPEED_TIER_1 + damage_armor_punch = 1 + pen_armor_punch = 0 + +/datum/ammo/bullet/shrapnel/canister/on_hit_mob(mob/M, obj/projectile/P) + knockback(M, P, 4) + slowdown(M, P) + +/datum/ammo/bullet/shrapnel/canister/set_bullet_traits() + . = ..() + LAZYADD(traits_to_give, list( + BULLET_TRAIT_ENTRY_ID("turfs", /datum/element/bullet_trait_damage_boost, 6, GLOB.damage_boost_turfs), + BULLET_TRAIT_ENTRY_ID("breaching", /datum/element/bullet_trait_damage_boost, 6, GLOB.damage_boost_breaching), + BULLET_TRAIT_ENTRY_ID("pylons", /datum/element/bullet_trait_damage_boost, 5, GLOB.damage_boost_pylons) + )) /datum/ammo/bullet/shrapnel/hornet_rounds name = ".22 hornet round" diff --git a/code/game/objects/items/explosives/grenades/marines.dm b/code/game/objects/items/explosives/grenades/marines.dm index 46d2d4eba9..14c5b143cd 100644 --- a/code/game/objects/items/explosives/grenades/marines.dm +++ b/code/game/objects/items/explosives/grenades/marines.dm @@ -130,6 +130,36 @@ shrapnel_count = 56 falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR + /* ++//================================================ ++ Canister Grenades ++//================================================ ++*/ + +/obj/item/explosive/grenade/high_explosive/airburst/canister + name = "\improper M108 canister grenade" + desc = "30mm canister grenade, effectively low velocity buckshot. Substantial close combat impact when paired with the 5 round PN pump action grenade launcher. No, you can't set it off with a hammer, moron." + icon_state = "grenade" + item_state = "grenade_hedp" + hand_throwable = FALSE + underslug_launchable = TRUE + explosion_power = 0 + explosion_falloff = 25 + det_time = 0 //this should mean that it will explode instantly when fired and thus generate the shotshell effect. + shrapnel_count = 20 + shrapnel_type = /datum/ammo/bullet/shrapnel/canister + dispersion_angle = 15 //hopefully this means the cone spread is pretty small +/obj/item/explosive/grenade/high_explosive/airburst/canister/proc/canister_fire(mob/living/user, target) + var/direction = Get_Compass_Dir(user, target) + var/position = get_step(user, direction) //otherwise we buckshot ourselves + create_shrapnel(position, min(direct_hit_shrapnel, shrapnel_count), direction , dispersion_angle, shrapnel_type, cause_data, FALSE, 100) + if(shrapnel_count) + create_shrapnel(loc, shrapnel_count, direction, dispersion_angle, shrapnel_type, cause_data, FALSE, 0) + qdel(src) +// canister has no impact explosion. +/obj/item/explosive/grenade/high_explosive/airburst/canister/launch_impact(atom/hit_atom) + return + /* //================================================ Airburst Grenades diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 4f0daf2a2b..cbf7cb8c87 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2800,13 +2800,18 @@ Defined in conflicts.dm of the #defines folder. msg_admin_attack("[key_name_admin(user)] fired an underslung grenade launcher [ADMIN_JMP_USER(user)]") log_game("[key_name_admin(user)] used an underslung grenade launcher.") - var/pass_flags = NO_FLAGS - pass_flags |= grenade_pass_flags - G.det_time = min(15, G.det_time) - G.throw_range = max_range - G.activate(user, FALSE) - G.forceMove(get_turf(gun)) - G.throw_atom(target, max_range, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags) +// canister nades explode immediately and don't leave the barrel of the weapon. + if(istype(G, /obj/item/explosive/grenade/high_explosive/airburst/canister)) + var/obj/item/explosive/grenade/high_explosive/airburst/canister/canister_round = G + canister_round.canister_fire(user, target) + else + var/pass_flags = NO_FLAGS + pass_flags |= grenade_pass_flags + G.det_time = min(15, G.det_time) + G.throw_range = max_range + G.activate(user, FALSE) + G.forceMove(get_turf(gun)) + G.throw_atom(target, max_range, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags) current_rounds-- cocked = FALSE // we have fired so uncock the gun loaded_grenades.Cut(1,2) diff --git a/code/modules/projectiles/guns/specialist/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/specialist/launcher/grenade_launcher.dm index 0f767d679d..4cc0857907 100644 --- a/code/modules/projectiles/guns/specialist/launcher/grenade_launcher.dm +++ b/code/modules/projectiles/guns/specialist/launcher/grenade_launcher.dm @@ -195,14 +195,18 @@ msg_admin_attack("[key_name_admin(user)] fired a grenade ([fired.name]) from \a ([name]).") log_game("[key_name_admin(user)] used a grenade ([name]).") + // canister rounds explode before leaving the barrel of the launcher. + if(istype(fired, /obj/item/explosive/grenade/high_explosive/airburst/canister)) + var/obj/item/explosive/grenade/high_explosive/airburst/canister/canister_round = fired + canister_round.canister_fire(user, target) + return + fired.throw_range = 20 fired.det_time = min(10, fired.det_time) fired.activate(user, FALSE) fired.forceMove(get_turf(src)) fired.throw_atom(target, 20, SPEED_VERY_FAST, user, null, NORMAL_LAUNCH, pass_flags) - - //Doesn't use these. Listed for reference. /obj/item/weapon/gun/launcher/grenade/load_into_chamber() return