Skip to content

Commit

Permalink
tweak: Bombarda tweaks (#3699)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladisvell authored Oct 17, 2023
1 parent 1201b2a commit b622417
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
12 changes: 8 additions & 4 deletions code/modules/projectiles/ammunition.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
var/multiload = 1
var/accept_subtypes = TRUE //Can you load rounds with the same caliber, but not same type
var/list/initial_mats
var/replacing_sound = 'sound/weapons/gun_interactions/shotguninsert.ogg'
var/remove_sound = 'sound/weapons/gun_interactions/remove_bullet.ogg'
var/insert_sound = 'sound/weapons/gun_interactions/bulletinsert.ogg'
var/load_sound = 'sound/weapons/gun_interactions/shotguninsert.ogg'

/obj/item/ammo_box/New()
..()
Expand Down Expand Up @@ -159,7 +163,7 @@
if(stored_ammo.len < max_ammo)
stored_ammo += R
R.loc = src
playsound(src, 'sound/weapons/gun_interactions/bulletinsert.ogg', 50, 1)
playsound(src, insert_sound, 50, 1)
update_mat_value()
return 1
//for accessibles magazines (e.g internal ones) when full, start replacing spent ammo
Expand All @@ -171,7 +175,7 @@

stored_ammo += R
R.loc = src
playsound(src, 'sound/weapons/gun_interactions/shotguninsert.ogg', 50, 1)
playsound(src, replacing_sound, 50, 1)
update_mat_value()
return 1

Expand Down Expand Up @@ -202,7 +206,7 @@
if(num_loaded)
if(!silent)
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
playsound(src, 'sound/weapons/gun_interactions/shotguninsert.ogg', 50, 1)
playsound(src, load_sound, 50, 1)
A.update_icon()
update_icon()

Expand All @@ -212,7 +216,7 @@
var/obj/item/ammo_casing/A = get_round()
if(A)
user.put_in_hands(A)
playsound(src, 'sound/weapons/gun_interactions/remove_bullet.ogg', 50, 1)
playsound(src, remove_sound, 50, 1)
to_chat(user, "<span class='notice'>You remove a round from \the [src]!</span>")
update_icon()

Expand Down
35 changes: 33 additions & 2 deletions code/modules/projectiles/guns/projectile/bombarda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,37 @@
fire_sound = 'sound/weapons/gunshots/1grenlauncher.ogg'
can_holster = FALSE
w_class = WEIGHT_CLASS_BULKY
weapon_weight = WEAPON_HEAVY
var/pump_sound_cooldown = 1 SECONDS
var/last_pump = 0

/obj/item/gun/projectile/bombarda/attackby(obj/item/A, mob/user, params)
. = ..()
if(.)
return
if(chambered)
return
var/num_loaded = magazine.attackby(A, user, params, 1)
if(num_loaded)
to_chat(user, "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>")
to_chat(user, span_notice("You load [num_loaded] shell\s into \the [src]!"))
A.update_icon()
update_icon()

/obj/item/gun/projectile/bombarda/update_icon()
. = ..()
if(!chambered)
icon_state = "bombarda_open"
else
icon_state = "bombarda"

/obj/item/gun/projectile/bombarda/process_chamber(eject_casing, empty_chamber)
var/obj/item/ammo_casing/AC = chambered
..(TRUE, TRUE)
if(!chambered)
AC.pixel_x = rand(-10.0, 10)
AC.pixel_y = rand(-10.0, 10)
AC.dir = pick(GLOB.alldirs)

/obj/item/gun/projectile/bombarda/chamber_round()
return

Expand All @@ -29,16 +49,23 @@


/obj/item/gun/projectile/bombarda/attack_self(mob/living/user)
if(world.time < last_pump + pump_sound_cooldown)
return
pump(user)
last_pump = world.time
return

/obj/item/gun/projectile/bombarda/proc/pump(mob/M)
playsound(M, 'sound/weapons/gun_interactions/sawclose.ogg', 60, 1)
playsound(M, 'sound/weapons/bombarda/pump.ogg', 60, 1)
if(chambered)
chambered.loc = get_turf(src)
chambered.SpinAnimation(5, 1)
chambered.pixel_x = rand(-10.0, 10)
chambered.pixel_y = rand(-10.0, 10)
chambered.dir = pick(GLOB.alldirs)
playsound(src, chambered.drop_sound, 60, 1)
chambered = null
update_icon()
if(!magazine.ammo_count())
return FALSE
var/obj/item/ammo_casing/AC = magazine.get_round()
Expand All @@ -51,6 +78,9 @@
ammo_type = /obj/item/ammo_casing/grenade/improvised
caliber = "40mm"
max_ammo = 1
insert_sound = 'sound/weapons/bombarda/load.ogg'
remove_sound = 'sound/weapons/bombarda/open.ogg'
load_sound = 'sound/weapons/bombarda/load.ogg'

/obj/item/ammo_box/magazine/internal/bombarda/New()
..()
Expand All @@ -73,6 +103,7 @@
icon_state = "exp_shell"
item_state = "exp_shell"
caliber = "40mm"
drop_sound = 'sound/weapons/gun_interactions/shotgun_fall.ogg'

/obj/item/ammo_casing/grenade/improvised/exp_shell
name = "Improvised explosive shell"
Expand Down
Binary file modified icons/obj/weapons/bombarda.dmi
Binary file not shown.
Binary file added sound/weapons/bombarda/load.ogg
Binary file not shown.
Binary file added sound/weapons/bombarda/open.ogg
Binary file not shown.
Binary file added sound/weapons/bombarda/pump.ogg
Binary file not shown.

0 comments on commit b622417

Please sign in to comment.