mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
Dual (or more!) Wielding (#21397)
* Dual (or more!) Wielding * Removes an extra line * Shotguns can't be dual wielded
This commit is contained in:
@@ -119,12 +119,6 @@
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user] fires [src]!</span>", null, null, COMBAT_MESSAGE_RANGE)
|
||||
|
||||
if(weapon_weight >= WEAPON_MEDIUM)
|
||||
if(user.get_inactive_held_item())
|
||||
if(prob(15))
|
||||
if(user.drop_item())
|
||||
user.visible_message("<span class='danger'>[src] flies out of [user]'s hands!</span>", "<span class='userdanger'>[src] kicks out of your grip!</span>")
|
||||
|
||||
/obj/item/weapon/gun/emp_act(severity)
|
||||
for(var/obj/O in contents)
|
||||
O.emp_act(severity)
|
||||
@@ -170,7 +164,21 @@
|
||||
user << "<span class='userdanger'>You need both hands free to fire [src]!</span>"
|
||||
return
|
||||
|
||||
process_fire(target,user,1,params)
|
||||
//DUAL (or more!) WIELDING
|
||||
var/bonus_spread = 0
|
||||
var/loop_counter = 0
|
||||
if(ishuman(user) && user.a_intent == "harm")
|
||||
var/mob/living/carbon/human/H = user
|
||||
for(var/obj/item/weapon/gun/G in H.held_items)
|
||||
if(G == src || G.weapon_weight >= WEAPON_MEDIUM)
|
||||
continue
|
||||
else if(G.can_trigger_gun(user))
|
||||
bonus_spread += 24 * G.weapon_weight
|
||||
loop_counter++
|
||||
spawn(loop_counter)
|
||||
G.process_fire(target,user,1,params, null, bonus_spread)
|
||||
|
||||
process_fire(target,user,1,params, null, bonus_spread)
|
||||
|
||||
|
||||
|
||||
@@ -195,17 +203,17 @@
|
||||
obj/item/weapon/gun/proc/recharge_newshot()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
/obj/item/weapon/gun/proc/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override, bonus_spread = 0)
|
||||
add_fingerprint(user)
|
||||
|
||||
if(semicd)
|
||||
return
|
||||
|
||||
if(weapon_weight)
|
||||
if(user.get_inactive_held_item())
|
||||
recoil = 4 //one-handed kick
|
||||
else
|
||||
recoil = initial(recoil)
|
||||
var/sprd = 0
|
||||
var/randomized_gun_spread = 0
|
||||
if(spread)
|
||||
randomized_gun_spread = rand(0,spread)
|
||||
var/randomized_bonus_spread = rand(0, bonus_spread)
|
||||
|
||||
if(burst_size > 1)
|
||||
firing_burst = 1
|
||||
@@ -216,11 +224,10 @@ obj/item/weapon/gun/proc/recharge_newshot()
|
||||
if( i>1 && !(user.is_holding(src))) //for burst firing
|
||||
break
|
||||
if(chambered && chambered.BB)
|
||||
var/sprd = 0
|
||||
if(randomspread)
|
||||
sprd = round((rand() - 0.5) * spread)
|
||||
sprd = round((rand() - 0.5) * (randomized_gun_spread + randomized_bonus_spread))
|
||||
else //Smart spread
|
||||
sprd = round((i / burst_size - 0.5) * spread)
|
||||
sprd = round((i / burst_size - 0.5) * (randomized_gun_spread + randomized_bonus_spread))
|
||||
|
||||
if(!chambered.fire_casing(target, user, params, ,suppressed, zone_override, sprd))
|
||||
shoot_with_empty_chamber(user)
|
||||
@@ -239,7 +246,8 @@ obj/item/weapon/gun/proc/recharge_newshot()
|
||||
firing_burst = 0
|
||||
else
|
||||
if(chambered)
|
||||
if(!chambered.fire_casing(target, user, params, , suppressed, zone_override, spread))
|
||||
sprd = round((pick(1,-1)) * (randomized_gun_spread + randomized_bonus_spread))
|
||||
if(!chambered.fire_casing(target, user, params, , suppressed, zone_override, sprd))
|
||||
shoot_with_empty_chamber(user)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=6;engineering=3;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/mm556x45
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
var/cover_open = 0
|
||||
can_suppress = 0
|
||||
@@ -356,7 +356,7 @@
|
||||
icon_state = "sniper"
|
||||
item_state = "sniper"
|
||||
recoil = 2
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
|
||||
fire_delay = 40
|
||||
burst_size = 1
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot
|
||||
casing_ejector = 0
|
||||
var/recentpump = 0 // to prevent spammage
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
|
||||
/obj/item/weapon/gun/ballistic/shotgun/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
slot_flags = null
|
||||
w_class = 5
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
can_flashlight = 0
|
||||
trigger_guard = TRIGGER_GUARD_NONE
|
||||
ammo_x_offset = 2
|
||||
|
||||
Reference in New Issue
Block a user