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

RPG Fixes #3480

Merged
merged 6 commits into from
Oct 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@
// for guns firing on their own without a user
/obj/item/gun/proc/discharge(cause, seek_chance = 10)
var/target
if(!safety)
if(!safety && has_safety)
// someone is very unlucky and about to be shot
if(prob(seek_chance))
for(var/mob/living/target_mob in range(6, get_turf(src)))
Expand Down
52 changes: 29 additions & 23 deletions code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
return

if(sealed_magazine)
to_chat(user, span_warning("The magazine on [src] is sealed and cannot be reloaded!"))
to_chat(user, span_warning("The [magazine_wording] on [src] is sealed and cannot be reloaded!"))
return
if(!internal_magazine && istype(A, /obj/item/ammo_box/magazine))
var/obj/item/ammo_box/magazine/AM = A
Expand Down Expand Up @@ -287,30 +287,35 @@

//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/gun/ballistic/attack_hand(mob/user)
if(!internal_magazine && loc == user && user.is_holding(src) && magazine)
eject_magazine(user)
return
if(user.is_holding(src) && loc == user)
if(sealed_magazine)
to_chat(user, span_warning("The [magazine_wording] on [src] is sealed and cannot be accessed!"))
return
if(bolt_type == BOLT_TYPE_NO_BOLT && (chambered || internal_magazine))
chambered = null
var/num_unloaded = 0
for(var/obj/item/ammo_casing/CB in get_ammo_list(FALSE, TRUE))
CB.forceMove(drop_location())

var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180))
CB.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, _bounce_sound = CB.bounce_sfx_override)

num_unloaded++
SSblackbox.record_feedback("tally", "station_mess_created", 1, CB.name)
if (num_unloaded)
to_chat(user, span_notice("You unload [num_unloaded] [cartridge_wording]\s from [src]."))
playsound(user, eject_sound, eject_sound_volume, eject_sound_vary)
update_appearance()
else
to_chat(user, span_warning("[src] is empty!"))
return
if(!internal_magazine && magazine)
eject_magazine(user)
return
return ..()
return ..()

/obj/item/gun/ballistic/unique_action(mob/living/user)
if(bolt_type == BOLT_TYPE_NO_BOLT)
chambered = null
var/num_unloaded = 0
for(var/obj/item/ammo_casing/CB in get_ammo_list(FALSE, TRUE))
CB.forceMove(drop_location())

var/angle_of_movement =(rand(-3000, 3000) / 100) + dir2angle(turn(user.dir, 180))
CB.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, _bounce_sound = CB.bounce_sfx_override)

num_unloaded++
SSblackbox.record_feedback("tally", "station_mess_created", 1, CB.name)
if (num_unloaded)
to_chat(user, "<span class='notice'>You unload [num_unloaded] [cartridge_wording]\s from [src].</span>")
playsound(user, eject_sound, eject_sound_volume, eject_sound_vary)
update_appearance()
else
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return
if((bolt_type == BOLT_TYPE_LOCKING || bolt_type == BOLT_TYPE_CLIP) && bolt_locked)
drop_bolt(user)
return
Expand All @@ -335,7 +340,8 @@
. += "It does not seem to have a round chambered."
if (bolt_locked)
. += "The [bolt_wording] is locked back and needs to be released before firing."
. += "You can [bolt_wording] [src] by pressing the <b>unique action</b> key. By default, this is <b>space</b>"
if(bolt_type != BOLT_TYPE_NO_BOLT)
. += "You can [bolt_wording] [src] by pressing the <b>unique action</b> key. By default, this is <b>space</b>"

///Gets the number of bullets in the gun
/obj/item/gun/ballistic/proc/get_ammo(countchambered = TRUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
sealed_magazine = TRUE
manufacturer = MANUFACTURER_IMPORT
slot_flags = ITEM_SLOT_BACK
has_safety = FALSE
safety = FALSE


/obj/item/gun/ballistic/rocketlauncher/oneshot/Initialize()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/projectiles/projectile/special/rocket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
desc = "USE A WEEL GUN"
icon_state= "84mm-hedp"
damage = 80
var/anti_armour_damage = 200
var/anti_armour_damage = 120
armour_penetration = 100
dismemberment = 100
dismemberment = 30

/obj/projectile/bullet/a84mm/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, 1, 1, 2, 1, 0, flame_range = 4)
explosion(target, 0, 1, 2, 1, 0, flame_range = 4)

if(ismecha(target))
var/obj/mecha/M = target
Expand Down
Loading