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

more upp nades #597

Closed
wants to merge 2 commits into from
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
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@
list("Spare PDT/L Battle Buddy Kit", round(scale * 3), /obj/item/storage/box/pdt_kit/advanced, VENDOR_ITEM_REGULAR),
list("Rail Flashlight", round(scale * 5), /obj/item/attachable/flashlight, VENDOR_ITEM_REGULAR),
list("Type 80 Bayonet", round(scale * 5), /obj/item/attachable/bayonet/upp, null, VENDOR_ITEM_REGULAR),
list("Type 83 Grenade Launcher", 1, /obj/item/attachable/attached_gun/grenade/upp, null, VENDOR_ITEM_REGULAR),
list("VOG-73 HE Grenade Packet", 2, /obj/item/storage/box/packet/high_explosive/upp/impact, null, VENDOR_ITEM_REGULAR),

list("CLOTHING", -1, null, null),
list("Cap", round(scale * 5), /obj/item/clothing/head/uppcap, VENDOR_ITEM_REGULAR),
Expand Down
11 changes: 1 addition & 10 deletions code/game/objects/items/explosives/grenades/grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var/det_time = 40
var/dangerous = FALSE //Make an danger overlay for humans?
var/arm_sound = 'sound/weapons/armbomb.ogg'
var/has_arm_sound = FALSE
var/has_arm_sound = TRUE
var/underslug_launchable = FALSE
var/hand_throwable = TRUE
harmful = TRUE //Is it harmful? Are they banned for synths?
Expand Down Expand Up @@ -85,15 +85,6 @@
SPAN_WARNING("You prime \a [name]!"))
msg_admin_attack("[key_name(user)] primed \a grenade ([name]) in [get_area(src)] ([src.loc.x],[src.loc.y],[src.loc.z]).", src.loc.x, src.loc.y, src.loc.z)
user.attack_log += text("\[[time_stamp()]\] <font color='red'> [key_name(user)] primed \a grenade ([name]) at ([src.loc.x],[src.loc.y],[src.loc.z])</font>")
if(initial(dangerous))
var/nade_sound
if(has_species(user, "Human"))
nade_sound = get_sfx("sound/weapons/grenade.ogg") ///In a perfect world, we'd make the M40 style grenades use this sound and the rest retain the old callout
//nade_sound = user.gender == FEMALE ? get_sfx("female_fragout") : get_sfx("male_fragout") ///But this is not a perfect world. Keeping this here in case someone wants to do that
else if(ismonkey(user))
nade_sound = sound('sound/voice/monkey_scream.ogg')
if(nade_sound)
playsound(user, nade_sound, 35)

var/mob/living/carbon/C = user
if(istype(C) && !C.throw_mode)
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 @@ -23,6 +23,7 @@
var/shrapnel_type = /datum/ammo/bullet/shrapnel
var/fire_resistance = 15 //to prevent highly controlled massive explosions
falloff_mode = EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF
arm_sound = "sound/weapons/grenade.ogg"


/obj/item/explosive/grenade/high_explosive/New()
Expand Down Expand Up @@ -106,6 +107,8 @@
shrapnel_count = 0
dual_purpose = FALSE
falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR
has_arm_sound = TRUE
arm_sound = 'sound/weapons/pinpull.ogg'

/obj/item/explosive/grenade/high_explosive/upp
name = "\improper Type 6 grenade"
Expand All @@ -119,6 +122,7 @@
shrapnel_count = 48
dual_purpose = FALSE
falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR
arm_sound = 'sound/weapons/pinpull.ogg'

/*
//================================================
Expand Down Expand Up @@ -291,6 +295,7 @@
flameshape = FLAMESHAPE_DEFAULT
radius = 2
fire_type = FIRE_VARIANT_DEFAULT
has_arm_sound = FALSE

/obj/item/explosive/grenade/incendiary/impact/prime()
return
Expand Down Expand Up @@ -328,6 +333,7 @@
explosion_power = 100 //hedp
shrapnel_count = 0
falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR
has_arm_sound = FALSE

/obj/item/explosive/grenade/high_explosive/impact/prime()
// We don't prime, we use launch_impact.
Expand All @@ -344,6 +350,12 @@
cell_explosion(loc, explosion_power, explosion_falloff, falloff_mode, last_move_dir, cause_data)
qdel(src)

/obj/item/explosive/grenade/high_explosive/impact/upp
name = "\improper VOG-73 HE grenade"
desc = "This is a 40mm grenade, designed to be launched by a grenade launcher and detonate on impact. This one bears markings of the UPP."
icon_state = "grenade_40mm_upp"
item_state = "grenade_hedp"

/obj/item/explosive/grenade/high_explosive/airburst/buckshot
name = "\improper 40mm Buckshot Shell"
desc = "A classic of grenade launchers everywhere, this is a 40mm shell loaded with buckshot; very dangerous, watch your fire."
Expand Down Expand Up @@ -453,6 +465,7 @@
radius = 2
var/shrapnel_count = 5
var/shrapnel_type = /datum/ammo/bullet/shrapnel/incendiary
has_arm_sound = FALSE

/obj/item/explosive/grenade/incendiary/airburst/prime()

Expand Down Expand Up @@ -497,6 +510,8 @@
var/datum/effect_system/smoke_spread/bad/smoke
var/smoke_radius = 3
dual_purpose = TRUE
has_arm_sound = TRUE
arm_sound = "sound/weapons/grenade.ogg"

/obj/item/explosive/grenade/smokebomb/New()
..()
Expand Down Expand Up @@ -531,6 +546,12 @@
smoke.start()
qdel(src)

/obj/item/explosive/grenade/smokebomb/upp
name = "RDG-17 smoke grenade"
desc = "Handgrenade, smoke, model 17. Simple, old and efficient design, these grenades are produced basically everywhere for use in the UPP Armed Collective."
icon_state = "grenade_upp_smoke"
arm_sound = 'sound/weapons/pinpull.ogg'

/obj/item/explosive/grenade/phosphorus
name = "\improper M60 WPSI grenade"
desc = "The M60 WPSI is a small, but powerful chemical compound grenade, designated as such with a white cap. Usable for both smoke-screen purposes and as an incendiary device. Two second fuse."
Expand Down Expand Up @@ -573,6 +594,7 @@
desc = "A deadly gas grenade found within the ranks of the UPP. Designed to spill white phosphorus on the target. It explodes 2 seconds after the pin has been pulled."
icon_state = "grenade_upp_wp"
item_state = "grenade_upp_wp"
arm_sound = 'sound/weapons/pinpull.ogg'

/obj/item/explosive/grenade/phosphorus/clf
name = "\improper improvised phosphorus bomb"
Expand Down Expand Up @@ -847,6 +869,7 @@
det_time = 0 // Unused, because we don't use prime.
hand_throwable = FALSE
smoke_radius = 2
has_arm_sound = FALSE

/obj/item/explosive/grenade/smokebomb/airburst/New()
..()
Expand Down Expand Up @@ -997,6 +1020,7 @@
explosion_power = 0
shrapnel_type = /datum/ammo/bullet/shrapnel/rubber
antigrief_protection = FALSE
arm_sound = 'sound/weapons/pinpull.ogg'

/// Baton slugs
/obj/item/explosive/grenade/baton
Expand All @@ -1006,6 +1030,7 @@
item_state = "rubber_grenade"
hand_throwable = FALSE
antigrief_protection = FALSE
has_arm_sound = FALSE


/obj/item/explosive/grenade/baton/flamer_fire_act()
Expand All @@ -1030,6 +1055,7 @@
explosion_power = 300
det_time = 50
unacidable = TRUE

arm_sound = 'sound/voice/holy_chorus.ogg'//https://www.youtube.com/watch?v=hNV5sPZFuGg
falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR

Expand All @@ -1042,6 +1068,7 @@
underslug_launchable = TRUE
harmful = FALSE
var/foam_metal_type = FOAM_METAL_TYPE_IRON
arm_sound = "sound/weapons/grenade.ogg"

/obj/item/explosive/grenade/metal_foam/prime()
var/datum/effect_system/foam_spread/s = new()
Expand All @@ -1055,6 +1082,7 @@
name = "bursting pipe"
alpha = 0
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
has_arm_sound = FALSE

/obj/item/explosive/grenade/incendiary/bursting_pipe
name = "bursting pipe"
Expand All @@ -1065,6 +1093,7 @@
burn_level = BURN_LEVEL_TIER_3
radius = 2
fire_type = FIRE_VARIANT_DEFAULT
has_arm_sound = FALSE

//Royal marine grenades

Expand All @@ -1085,3 +1114,4 @@
burn_level = BURN_LEVEL_TIER_8
radius = 3
fire_type = FIRE_VARIANT_DEFAULT
arm_sound = "sound/weapons/grenade.ogg"
16 changes: 13 additions & 3 deletions code/modules/projectiles/ammo_boxes/grenade_packets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,22 @@ GLOBAL_LIST_INIT(grenade_packets, list(

/obj/item/storage/box/packet/high_explosive/upp
name = "\improper Type 6 fragmentation grenade packet"
desc = "It contains three Type 6 fragmentation grenades."
desc = "It contains six Type 6 fragmentation grenades."
icon = 'icons/obj/items/storage/kits.dmi'
icon_state = "woodbox"

icon_state = "nadeboxupp"
storage_slots = 6
content_type = /obj/item/explosive/grenade/high_explosive/upp

/obj/item/storage/box/packet/high_explosive/upp/smoke
name = "\improper RDG-17 smoke grenade packet"
desc = "It contains six RDG-17 smoke grenades."
content_type = /obj/item/explosive/grenade/smokebomb/upp

/obj/item/storage/box/packet/high_explosive/upp/impact
name = "\improper VOG-73 fragmentation grenade packet"
desc = "It contains six VOG-73 fragmentation grenades."
content_type = /obj/item/explosive/grenade/high_explosive/impact/upp

/obj/item/storage/box/packet/baton_slug
name = "\improper HIRR baton slug packet"
desc = "It contains three HIRR (High Impact Rubber Rounds) Baton Slugs."
Expand Down
25 changes: 21 additions & 4 deletions code/modules/projectiles/gun_attachables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2839,6 +2839,7 @@ Defined in conflicts.dm of the #defines folder.
var/cocked = TRUE // has the UGL been cocked via opening and closing the breech?
var/open_sound = 'sound/weapons/handling/ugl_open.ogg'
var/close_sound = 'sound/weapons/handling/ugl_close.ogg'
var/has_breech = TRUE

/obj/item/attachable/attached_gun/grenade/Initialize()
. = ..()
Expand All @@ -2855,6 +2856,8 @@ Defined in conflicts.dm of the #defines folder.
else . += "It's empty."

/obj/item/attachable/attached_gun/grenade/unique_action(mob/user)
if(!has_breech)
return
if(!ishuman(usr))
return
if(user.is_mob_incapacitated() || !isturf(usr.loc))
Expand Down Expand Up @@ -2897,7 +2900,7 @@ Defined in conflicts.dm of the #defines folder.
update_icon()

/obj/item/attachable/attached_gun/grenade/reload_attachment(obj/item/explosive/grenade/G, mob/user)
if(!breech_open)
if(!breech_open && has_breech)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!breech_open && has_breech)
if(has_breech && !breech_open)

Real minor nitpick, but reads better if has_breech is checked before breech_open. breech_open depends on has_breech to mean something, so flows better to check has_breech first.

to_chat(user, SPAN_WARNING("\The [src]'s breech must be open to load grenades! (use unique-action)"))
return
if(!istype(G) || istype(G, /obj/item/explosive/grenade/spawnergrenade/))
Expand All @@ -2918,7 +2921,7 @@ Defined in conflicts.dm of the #defines folder.

/obj/item/attachable/attached_gun/grenade/unload_attachment(mob/user, reload_override = FALSE, drop_override = FALSE, loc_override = FALSE)
. = TRUE //Always uses special unloading.
if(!breech_open)
if(!breech_open && has_breech)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!breech_open && has_breech)
if(has_breech && !breech_open)

to_chat(user, SPAN_WARNING("\The [src] is closed! You must open it to take out grenades!"))
return
if(!current_rounds)
Expand All @@ -2943,12 +2946,12 @@ Defined in conflicts.dm of the #defines folder.
if(user)
to_chat(user, SPAN_WARNING("You must hold [gun] with two hands to use \the [src]."))
return
if(breech_open)
if(breech_open && has_breech)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(breech_open && has_breech)
if(has_breech && breech_open)

if(user)
to_chat(user, SPAN_WARNING("You must close the breech to fire \the [src]!"))
playsound(user, 'sound/weapons/gun_empty.ogg', 50, TRUE, 5)
return
if(!cocked)
if(!cocked && has_breech)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!cocked && has_breech)
if(has_breech && !cocked)

Same as with breech_open: since cocked relies on has_breech, just reads better to check has_breech first.

if(user)
to_chat(user, SPAN_WARNING("You must cock \the [src] to fire it! (open and close the breech)"))
playsound(user, 'sound/weapons/gun_empty.ogg', 50, TRUE, 5)
Expand Down Expand Up @@ -3033,6 +3036,20 @@ Defined in conflicts.dm of the #defines folder.
. = ..()
grenade_pass_flags = NO_FLAGS

/obj/item/attachable/attached_gun/grenade/upp
name = "\improper Type 83 overslung grenade launcher"
desc = "Unorthodox design, this single-round grenade launchers was made specifically for use with Type 71 pulse rifles. It can be quickly connected to electronic firing mechanism of the rifle, albeit wiring is prone to failures."
icon_state = "type83"
attach_icon = "type83_a"
current_rounds = 0
max_rounds = 1
max_range = 14
attachment_firing_delay = 5
slot = "special"
pixel_shift_x = 0
pixel_shift_y = 0
has_breech = FALSE

//"ammo/flamethrower" is a bullet, but the actual process is handled through fire_attachment, linked through Fire().
/obj/item/attachable/attached_gun/flamer
name = "mini flamethrower"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1354,14 +1354,15 @@
/obj/item/attachable/attached_gun/flamer,
/obj/item/attachable/attached_gun/flamer/advanced,
/obj/item/attachable/attached_gun/extinguisher,
/obj/item/attachable/attached_gun/grenade/upp,
)

flags_gun_features = GUN_AUTO_EJECTOR|GUN_CAN_POINTBLANK|GUN_AMMO_COUNTER
flags_equip_slot = SLOT_BACK
start_automatic = TRUE

/obj/item/weapon/gun/rifle/type71/set_gun_attachment_offsets()
attachable_offset = list("muzzle_x" = 33, "muzzle_y" = 17,"rail_x" = 10, "rail_y" = 23, "under_x" = 20, "under_y" = 13, "stock_x" = 11, "stock_y" = 13)
attachable_offset = list("muzzle_x" = 33, "muzzle_y" = 17,"rail_x" = 10, "rail_y" = 23, "under_x" = 20, "under_y" = 13, "stock_x" = 11, "stock_y" = 13, "special_x" = 0, "special_y" = 0)

/obj/item/weapon/gun/rifle/type71/set_gun_config_values()
..()
Expand Down
Binary file modified icons/obj/items/storage/kits.dmi
Binary file not shown.
Binary file modified icons/obj/items/weapons/grenade.dmi
Binary file not shown.
Binary file modified icons/obj/items/weapons/guns/attachments/under.dmi
Binary file not shown.
34 changes: 12 additions & 22 deletions maps/map_files/chapaev/chapaev.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1895,21 +1895,13 @@
icon_state = "N";
pixel_y = 1
},
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C";
pixel_y = -5
},
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C";
pixel_y = 6
},
/obj/structure/closet/crate/secure/ammo{
Expand Down Expand Up @@ -2535,6 +2527,12 @@
name = "wooden cargo crate";
anchored = 1
},
/obj/item/storage/box/packet/high_explosive/upp/smoke{
pixel_y = 15
},
/obj/item/storage/box/packet/high_explosive/upp/smoke{
pixel_y = 21
},
/turf/open/floor/strata/floor3/east,
/area/golden_arrow/supply)
"vC" = (
Expand Down Expand Up @@ -4018,21 +4016,13 @@
icon_state = "N";
pixel_y = 1
},
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C";
pixel_y = -5
},
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp,
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C"
},
/obj/item/storage/box/packet/high_explosive/upp{
color = "#8B795C";
pixel_y = 6
},
/obj/structure/closet/crate/secure/ammo{
Expand Down
Loading