Skip to content

Commit

Permalink
updated revolver dm
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilum committed Jun 12, 2024
1 parent c88b263 commit 0fbe7ab
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions code/modules/projectiles/guns/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
. += "[base_icon_state || initial(icon_state)][safety ? "_hammer_up" : "_hammer_down"]"


/obj/item/gun/ballistic/revolver/process_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE)
/obj/item/gun/ballistic/revolver/process_chamber(empty_chamber = TRUE, from_firing = TRUE, chamber_next_round = TRUE, atom/shooter)
SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD)
return ..()

Expand All @@ -84,7 +84,9 @@
if(!casing_to_eject)
continue
casing_to_eject.forceMove(drop_location())
casing_to_eject.bounce_away(FALSE, NONE)
var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180))
casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(450, 550) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement)

num_unloaded++
SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_to_eject.name)
chamber_round(FALSE)
Expand All @@ -98,7 +100,7 @@
var/doafter_time = 0.4 SECONDS
if(!do_mob(user,user,doafter_time))
break
if(!eject_casing())
if(!eject_casing(user))
doafter_time = 0 SECONDS
else
num_unloaded++
Expand All @@ -121,7 +123,9 @@
return FALSE
playsound(src, eject_sound, eject_sound_volume, eject_sound_vary)
casing_to_eject.forceMove(drop_location())
casing_to_eject.bounce_away(FALSE, NONE)
var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180))
casing_to_eject.AddComponent(/datum/component/movable_physics, _horizontal_velocity = rand(350, 450) / 100, _vertical_velocity = rand(400, 450) / 100, _horizontal_friction = rand(20, 24) / 100, _z_gravity = PHYSICS_GRAV_STANDARD, _z_floor = 0, _angle_of_movement = angle_of_movement)

SSblackbox.record_feedback("tally", "station_mess_created", 1, casing_to_eject.name)
if(!gate_loaded)
magazine.stored_ammo[casing_index] = null
Expand All @@ -139,6 +143,12 @@
/obj/item/gun/ballistic/revolver/proc/insert_casing(mob/living/user, obj/item/ammo_casing/casing_to_insert, allow_ejection)
if(!casing_to_insert)
return FALSE

// Check if the bullet's caliber matches the magazine's caliber.If not, send a warning message to the user and return FALSE.
if(casing_to_insert.caliber != magazine.caliber)
to_chat(user, "<span class='warning'>\The [casing_to_insert] is not suitable for [src].</span>")
return FALSE

var/list/rounds = magazine.ammo_list()
var/obj/item/ammo_casing/slot = rounds[gate_offset+1] //byond arrays start at 1, so we add 1 to get the correct index
var/doafter_time = 0.4 SECONDS
Expand Down Expand Up @@ -270,7 +280,6 @@
playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)

chamber_round(TRUE)
//playsound(src, rack_sound, rack_sound_volume, rack_sound_vary)
SEND_SIGNAL(src, COMSIG_UPDATE_AMMO_HUD)
update_appearance()

Expand Down Expand Up @@ -680,6 +689,7 @@
manufacturer = MANUFACTURER_HUNTERSPRIDE
spread_unwielded = 50
fire_delay = 0
gate_offset = 4
semi_auto = TRUE
safety_wording = "safety"

Expand Down

0 comments on commit 0fbe7ab

Please sign in to comment.