Unifies wield-shotgun and wield-rifle into wield-firearm. (#6591)

Title says it all.

This needed some changes to offhand (which is now a subtype of weapon, not /weapon/gun), but otherwise it seems to work well in testing.
This commit is contained in:
Matt Atlas
2019-07-21 21:53:27 +02:00
committed by Erki
parent e0240180be
commit d9fb393845
13 changed files with 108 additions and 268 deletions

View File

@@ -104,6 +104,8 @@
magazine_type = /obj/item/ammo_magazine/c762
allowed_magazines = list(/obj/item/ammo_magazine/c762)
is_wieldable = TRUE
firemodes = list(
list(mode_name="semiauto", burst=1, fire_delay=10, move_delay=null, burst_accuracy=null, dispersion=null),
list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=2, burst_accuracy=list(1,0,0), dispersion=list(0, 5, 10)),
@@ -118,23 +120,6 @@
fire_delay_wielded = 6
accuracy_wielded = 2
//action button for wielding
action_button_name = "Wield rifle"
/obj/item/weapon/gun/projectile/automatic/rifle/can_wield()
return 1
/obj/item/weapon/gun/projectile/automatic/rifle/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/automatic/rifle/verb/wield_rifle()
set name = "Wield rifle"
set category = "Object"
set src in usr
toggle_wield(usr)
usr.update_icon()
/obj/item/weapon/gun/projectile/automatic/rifle/sts35
name = "assault rifle"
@@ -386,6 +371,8 @@
auto_eject = 1
auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg'
is_wieldable = TRUE
firemodes = list(
list(mode_name="semiauto", burst=1, move_delay=null, burst_accuracy=null, dispersion=null),
list(mode_name="3-round bursts", burst=3, move_delay=2, burst_accuracy=list(2,1,1), dispersion=list(0, 10, 15)),
@@ -401,8 +388,6 @@
accuracy_wielded = 2
scoped_accuracy = 2
action_button_name = "Wield rifle"
/obj/item/weapon/gun/projectile/automatic/terminator/verb/scope()
set category = "Object"
set name = "Use Scope"
@@ -413,21 +398,6 @@
else
to_chat(usr, "<span class='warning'>You can't look through the scope without stabilizing the rifle!</span>")
/obj/item/weapon/gun/projectile/automatic/terminator/can_wield()
return 1
/obj/item/weapon/gun/projectile/automatic/terminator/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/automatic/terminator/verb/wield_rifle()
set name = "Wield rifle"
set category = "Object"
set src in usr
toggle_wield(usr)
usr.update_icon()
/obj/item/weapon/gun/projectile/automatic/rifle/shotgun
name = "assault shotgun"
desc = "A experimental, semi-automatic combat shotgun, designed for boarding operations and law enforcement agencies."

View File

@@ -19,8 +19,6 @@
can_sawoff = TRUE
sawnoff_workmsg = "shorten the barrel and stock"
action_button_name = "Wield rifle"
/obj/item/weapon/gun/projectile/shotgun/pump/rifle/saw_off(mob/user, obj/item/tool)
icon_state = "obrez"
w_class = 3
@@ -229,7 +227,7 @@
fire_delay_wielded = 10
accuracy_wielded = 2
action_button_name = "Wield rifle"
is_wieldable = TRUE
/obj/item/weapon/gun/projectile/gauss/update_icon()
..()
@@ -243,17 +241,3 @@
update_held_icon()
return
/obj/item/weapon/gun/projectile/gauss/can_wield()
return 1
/obj/item/weapon/gun/projectile/gauss/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/gauss/verb/wield_rifle()
set name = "Wield rifle"
set category = "Object"
set src in usr
toggle_wield(usr)
usr.update_icon()

View File

@@ -53,27 +53,12 @@
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
handle_casings = HOLD_CASINGS
fire_sound = 'sound/weapons/gunshot/gunshot_shotgun2.ogg'
is_wieldable = TRUE
var/recentpump = 0 // to prevent spammage
var/pump_fail_msg = "<span class='warning'>You cannot rack the shotgun without gripping it with both hands!</span>"
var/pump_snd = 'sound/weapons/shotgunpump.ogg'
var/has_wield_state = TRUE
action_button_name = "Wield shotgun"
/obj/item/weapon/gun/projectile/shotgun/pump/can_wield()
return 1
/obj/item/weapon/gun/projectile/shotgun/pump/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/shotgun/pump/verb/wield_shotgun()
set name = "Wield"
set category = "Object"
set src in usr
toggle_wield(usr)
/obj/item/weapon/gun/projectile/shotgun/pump/consume_next_projectile()
if(chambered)
return chambered.BB

View File

@@ -18,29 +18,13 @@
scoped_accuracy = 4
var/bolt_open = 0
is_wieldable = TRUE
fire_sound = 'sound/weapons/gunshot/gunshot_dmr.ogg'
recoil_wielded = 2
accuracy_wielded = -1
//action button for wielding
action_button_name = "Wield rifle"
/obj/item/weapon/gun/projectile/heavysniper/can_wield()
return 1
/obj/item/weapon/gun/projectile/heavysniper/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/heavysniper/verb/wield_rifle()
set name = "Wield rifle"
set category = "Object"
set src in usr
toggle_wield(usr)
usr.update_icon()
/obj/item/weapon/gun/projectile/heavysniper/update_icon()
if(bolt_open)
icon_state = "heavysniper-open"
@@ -153,12 +137,11 @@
accuracy = -4
scoped_accuracy = 3
is_wieldable = TRUE
recoil_wielded = 1
accuracy_wielded = 1
//action button for wielding
action_button_name = "Wield rifle"
/obj/item/weapon/gun/projectile/dragunov/update_icon()
if(ammo_magazine)
@@ -166,20 +149,6 @@
else
icon_state = "dragunov-empty"
/obj/item/weapon/gun/projectile/dragunov/can_wield()
return 1
/obj/item/weapon/gun/projectile/dragunov/ui_action_click()
if(src in usr)
toggle_wield(usr)
/obj/item/weapon/gun/projectile/dragunov/verb/wield_rifle()
set name = "Wield rifle"
set category = "Object"
set src in usr
toggle_wield(usr)
/obj/item/weapon/gun/projectile/dragunov/special_check(mob/user)
if(!wielded)
to_chat(user, "<span class='warning'>You can't fire without stabilizing the rifle!</span>")