mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 08:31:57 +00:00
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:
@@ -50,7 +50,7 @@
|
||||
fire_delay_wielded = 10
|
||||
accuracy_wielded = 0
|
||||
|
||||
action_button_name = "Wield rifle"
|
||||
is_wieldable = TRUE
|
||||
|
||||
/obj/item/weapon/gun/energy/blaster/rifle/update_icon()
|
||||
..()
|
||||
@@ -60,13 +60,6 @@
|
||||
item_state = initial(item_state)
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/blaster/rifle/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/blaster/rifle/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/blaster/rifle/verb/scope()
|
||||
set category = "Object"
|
||||
set name = "Use Scope"
|
||||
|
||||
@@ -131,19 +131,11 @@ obj/item/weapon/gun/energy/retro
|
||||
turret_sprite_set = "sniper"
|
||||
turret_is_lethal = 1
|
||||
|
||||
is_wieldable = TRUE
|
||||
|
||||
fire_delay_wielded = 35
|
||||
accuracy_wielded = 0
|
||||
|
||||
//action button for wielding
|
||||
action_button_name = "Wield rifle"
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/verb/scope()
|
||||
set category = "Object"
|
||||
set name = "Use Scope"
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
criticality = initial(criticality)
|
||||
fire_sound = initial(fire_sound)
|
||||
force = initial(force)
|
||||
is_wieldable = initial(is_wieldable)
|
||||
action_button_name = initial(action_button_name)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/prototype/proc/updatetype(var/mob/user)
|
||||
reset_vars()
|
||||
@@ -70,21 +72,7 @@
|
||||
disassemble(user)
|
||||
return
|
||||
|
||||
switch(origin_chassis)
|
||||
if(CHASSIS_SMALL)
|
||||
gun_type = CHASSIS_SMALL
|
||||
slot_flags = SLOT_BELT | SLOT_HOLSTER
|
||||
item_state = "retro"
|
||||
if(CHASSIS_MEDIUM)
|
||||
gun_type = CHASSIS_MEDIUM
|
||||
slot_flags = SLOT_BELT | SLOT_BACK
|
||||
item_state = "energystun"
|
||||
action_button_name = "Wield rifle"
|
||||
if(CHASSIS_LARGE)
|
||||
gun_type = CHASSIS_LARGE
|
||||
slot_flags = SLOT_BACK
|
||||
item_state = "heavyprotogun"
|
||||
action_button_name = "Wield rifle"
|
||||
update_chassis()
|
||||
|
||||
if(capacitor.reliability - capacitor.condition <= 0)
|
||||
if(prob(66))
|
||||
@@ -125,6 +113,24 @@
|
||||
w_class = gun_type
|
||||
reliability = max(reliability, 1)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/prototype/proc/update_chassis()
|
||||
switch(origin_chassis)
|
||||
if(CHASSIS_SMALL)
|
||||
gun_type = CHASSIS_SMALL
|
||||
slot_flags = SLOT_BELT | SLOT_HOLSTER
|
||||
item_state = "retro"
|
||||
if(CHASSIS_MEDIUM)
|
||||
gun_type = CHASSIS_MEDIUM
|
||||
slot_flags = SLOT_BELT | SLOT_BACK
|
||||
item_state = "energystun"
|
||||
is_wieldable = TRUE
|
||||
if(CHASSIS_LARGE)
|
||||
gun_type = CHASSIS_LARGE
|
||||
slot_flags = SLOT_BACK
|
||||
item_state = "heavyprotogun"
|
||||
is_wieldable = TRUE
|
||||
update_wield_verb()
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/prototype/proc/handle_mod()
|
||||
for(var/obj/item/laser_components/modifier/modifier in gun_mods)
|
||||
switch(modifier.mod_type)
|
||||
@@ -242,13 +248,6 @@
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/prototype/verb/wield_shotgun()
|
||||
set name = "Wield prototype"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/prototype/verb/scope()
|
||||
set category = "Object"
|
||||
set name = "Use Scope"
|
||||
|
||||
@@ -26,27 +26,13 @@
|
||||
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2, TECH_MAGNET = 3)
|
||||
modifystate = "eriflestun"
|
||||
|
||||
is_wieldable = TRUE
|
||||
|
||||
firemodes = list(
|
||||
list(mode_name="stun", projectile_type=/obj/item/projectile/beam/stun, modifystate="eriflestun", fire_sound='sound/weapons/Taser.ogg'),
|
||||
list(mode_name="lethal", projectile_type=/obj/item/projectile/beam, modifystate="eriflekill", fire_sound='sound/weapons/Laser.ogg')
|
||||
)
|
||||
|
||||
//action button for wielding
|
||||
action_button_name = "Wield rifle"
|
||||
|
||||
/obj/item/weapon/gun/energy/rifle/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/rifle/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/rifle/verb/wield_rifle()
|
||||
set name = "Wield rifle"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/rifle/laser
|
||||
name = "laser rifle"
|
||||
|
||||
@@ -252,28 +252,15 @@
|
||||
fire_delay = 10
|
||||
dispersion = GATLINGLASER_DISPERSION_CONCENTRATED
|
||||
|
||||
is_wieldable = TRUE
|
||||
|
||||
firemodes = list(
|
||||
list(mode_name="concentrated burst", burst=10, burst_delay = 1, fire_delay = 10, dispersion = GATLINGLASER_DISPERSION_CONCENTRATED),
|
||||
list(mode_name="spray", burst=20, burst_delay = 1, move_delay = 5, fire_delay = 30, dispersion = GATLINGLASER_DISPERSION_SPRAY)
|
||||
)
|
||||
|
||||
action_button_name = "Wield gatling laser"
|
||||
charge_cost = 50
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/gatlinglaser/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/gatlinglaser/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/gatlinglaser/verb/wield_rifle()
|
||||
set name = "Wield gatling laser"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/gatlinglaser/special_check(var/mob/user)
|
||||
if(is_charging)
|
||||
to_chat(user, "<span class='danger'>\The [src] is already spinning!</span>")
|
||||
@@ -354,22 +341,10 @@
|
||||
recharge_time = 2
|
||||
needspin = FALSE
|
||||
|
||||
is_wieldable = TRUE
|
||||
|
||||
action_button_name = "Wield thermal lance"
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/typec/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/typec/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/typec/verb/wield_rifle()
|
||||
set name = "Wield thermal lance"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/typec/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
|
||||
user.setClickCooldown(16)
|
||||
..()
|
||||
@@ -450,6 +425,8 @@
|
||||
can_turret = 1
|
||||
turret_sprite_set = "thermaldrill"
|
||||
|
||||
is_wieldable = TRUE
|
||||
|
||||
firemodes = list(
|
||||
list(mode_name="2 second burst", burst=10, burst_delay = 1, fire_delay = 20),
|
||||
list(mode_name="4 second burst", burst=20, burst_delay = 1, fire_delay = 40),
|
||||
@@ -460,20 +437,6 @@
|
||||
|
||||
needspin = FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/thermaldrill/can_wield()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/thermaldrill/ui_action_click()
|
||||
if(src in usr)
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/thermaldrill/verb/wield_rifle()
|
||||
set name = "Wield thermal drill"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
toggle_wield(usr)
|
||||
|
||||
/obj/item/weapon/gun/energy/vaurca/thermaldrill/special_check(var/mob/user)
|
||||
if(is_charging)
|
||||
to_chat(user, "<span class='danger'>\The [src] is already charging!</span>")
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>")
|
||||
|
||||
Reference in New Issue
Block a user