Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buckshot type and canister added. now to figure #182

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions code/datums/ammo/bullet/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,64 @@
to_chat(living_mob, SPAN_HIGHDANGER("The impact knocks you off-balance!"))
living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET)

/datum/ammo/bullet/shotgun/buckshot/canister
//constructed with the assistance of vero5123.
name = "\improper M108 Canister Grenade"
handful_state = "grenade_hedp"
icon_state = "buckshot"
multiple_handful_name = TRUE
bonus_projectiles_type = "/datum/ammo/bullet/shotgun/spread/canister"

accuracy_var_low = PROJECTILE_VARIANCE_TIER_6
accuracy_var_high = PROJECTILE_VARIANCE_TIER_6
accurate_range = 5
max_range = 8
damage = 25
penetration = 0
shell_speed = AMMO_SPEED_TIER_1
damage_armor_punch = 1
pen_armor_punch = 0
bonus_projectiles_amount = EXTRA_PROJECTILES_TIER_10

/datum/ammo/bullet/shotgun/buckshot/canister/on_hit_mob(mob/M, obj/projectile/P)
knockback(M, P, 4)
slowdown(M, P)

/datum/ammo/bullet/shotgun/buckshot/canister/set_bullet_traits()
. = ..()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY_ID("turfs", /datum/element/bullet_trait_damage_boost, 7, GLOB.damage_boost_turfs),
BULLET_TRAIT_ENTRY_ID("breaching", /datum/element/bullet_trait_damage_boost, 12, GLOB.damage_boost_breaching),
BULLET_TRAIT_ENTRY_ID("pylons", /datum/element/bullet_trait_damage_boost, 5, GLOB.damage_boost_pylons)
))

/datum/ammo/bullet/shotgun/buckshot/canister/spread
name = "low velocity canister shot"
icon_state = "buckshot"

accuracy_var_low = PROJECTILE_VARIANCE_TIER_6
accuracy_var_high = PROJECTILE_VARIANCE_TIER_6
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/shotgun/spread/canister/on_hit_mob(mob/M, obj/projectile/P)
knockback(M, P, 4)
slowdown(M, P)


/datum/ammo/bullet/shotgun/spread/canister/set_bullet_traits()
. = ..()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY_ID("turfs", /datum/element/bullet_trait_damage_boost, 7, GLOB.damage_boost_turfs),
BULLET_TRAIT_ENTRY_ID("breaching", /datum/element/bullet_trait_damage_boost, 12, GLOB.damage_boost_breaching),
BULLET_TRAIT_ENTRY_ID("pylons", /datum/element/bullet_trait_damage_boost, 5, GLOB.damage_boost_pylons)
))

/datum/ammo/bullet/shotgun/beanbag
name = "beanbag slug"
headshot_state = HEADSHOT_OVERLAY_LIGHT //It's not meant to kill people... but if you put it in your mouth, it will.
Expand Down
30 changes: 30 additions & 0 deletions code/game/objects/items/explosives/grenades/marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,36 @@
shrapnel_count = 56
falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR


/*
//================================================
Canister Grenades
//================================================
Special thanks to vero5123 for making this work. He, uh, basically put this all together in an hour??? -koishi
*/
/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/shotgun/buckshot/canister
dispersion_angle = 20 //hopefully this means the cone spread is pretty small
/obj/item/explosive/grenade/high_explosive/airburst/canister/proc/canister_fire(obj/item/weapon/gun/launcher/grenade/gl, target)
var/direction = Get_Compass_Dir(gl, target)
var/position = get_step(gl, 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
Expand Down
11 changes: 11 additions & 0 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,17 @@
grenade_type = /obj/item/explosive/grenade/phosphorus
has_gamemode_skin = FALSE

/obj/item/storage/box/nade_box/canister
name = "\improper M108 canister grenade box"
desc = "Reinforced box of 25 30mm M108 canister grenades."
icon_state = "airburst_nade_placeholder" //ill get a sprite done for this
w_class = SIZE_LARGE
storage_slots = 25
max_storage_space = 25
can_hold = list(/obj/item/explosive/grenade/high_explosive/airburst/canister)
grenade_type = /obj/item/explosive/grenade/high_explosive/airburst/canister
has_gamemode_skin = FALSE

/obj/item/storage/box/nade_box/airburst
name = "\improper M74 AGM-F grenade box"
desc = "A secure box holding 25 M74 AGM Fragmentation grenades. Explosive, don't store near the flamer fuel."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@
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.
// section constructed by vero5123.
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(src, target)
return

fired.throw_range = 20
fired.det_time = min(10, fired.det_time)
fired.activate(user, FALSE)
Expand Down
Loading