Dual wielding!

This commit is contained in:
Couls
2019-07-18 00:05:35 -04:00
parent f0abbd38d2
commit fae76166c2
11 changed files with 63 additions and 37 deletions
+25 -10
View File
@@ -21,6 +21,12 @@
/obj/item/gun/energy/emp_act(severity)
power_supply.use(round(power_supply.charge / severity))
if(chambered)//phil235
if(chambered.BB)
qdel(chambered.BB)
chambered.BB = null
chambered = null
newshot() //phil235
update_icon()
/obj/item/gun/energy/get_cell()
@@ -34,6 +40,7 @@
power_supply = new(src)
power_supply.give(power_supply.maxcharge)
update_ammo_types()
on_recharge()
if(selfcharge)
START_PROCESSING(SSobj, src)
update_icon()
@@ -67,8 +74,12 @@
if(!external || !external.use(E.e_cost)) //Take power from the borg...
return //Note, uses /10 because of shitty mods to the cell system
power_supply.give(100) //... to recharge the shot
on_recharge()
update_icon()
/obj/item/gun/energy/proc/on_recharge()
newshot()
/obj/item/gun/energy/attack_self(mob/living/user as mob)
if(ammo_type.len > 1)
select_fire(user)
@@ -78,10 +89,6 @@
H.update_inv_l_hand()
H.update_inv_r_hand()
/obj/item/gun/energy/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
newshot() //prepare a new shot
..()
/obj/item/gun/energy/can_shoot()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
return power_supply.charge >= shot.e_cost
@@ -89,18 +96,20 @@
/obj/item/gun/energy/newshot()
if(!ammo_type || !power_supply)
return
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(power_supply.charge >= shot.e_cost) //if there's enough power in the power_supply cell...
chambered = shot //...prepare a new shot based on the current ammo type selected
chambered.newshot()
return
if(!chambered)
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
if(power_supply.charge >= shot.e_cost) //if there's enough power in the power_supply cell...
chambered = shot //...prepare a new shot based on the current ammo type selected
if(!chambered.BB)
chambered.newshot()
/obj/item/gun/energy/process_chamber()
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
var/obj/item/ammo_casing/energy/shot = chambered
power_supply.use(shot.e_cost)//... drain the power_supply cell
robocharge()
chambered = null //either way, released the prepared shot
return
newshot()
/obj/item/gun/energy/proc/select_fire(mob/living/user)
select++
@@ -111,6 +120,12 @@
fire_delay = shot.delay
if(shot.select_name)
to_chat(user, "<span class='notice'>[src] is now set to [shot.select_name].</span>")
if(chambered)//phil235
if(chambered.BB)
qdel(chambered.BB)
chambered.BB = null
chambered = null
newshot()
update_icon()
return
@@ -121,6 +121,7 @@
/obj/item/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(500)
on_recharge()
if(!suppressed)
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else if(isliving(loc))
@@ -79,7 +79,7 @@
slot_flags = null
w_class = WEIGHT_CLASS_HUGE
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
@@ -168,11 +168,13 @@
var/obj/item/stack/sheet/S = A
S.use(1)
power_supply.give(1000)
on_recharge()
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else if(istype(A, /obj/item/stack/ore/plasma))
var/obj/item/stack/ore/S = A
S.use(1)
power_supply.give(500)
on_recharge()
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else
..()
@@ -251,10 +253,6 @@
/obj/item/gun/energy/printer/emp_act()
return
/obj/item/gun/energy/printer/newshot()
..()
robocharge()
// Instakill Lasers //
/obj/item/gun/energy/laser/instakill
name = "instakill rifle"
@@ -7,7 +7,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/gunshots/gunshot_mg.ogg'
magin_sound = 'sound/weapons/gun_interactions/lmg_magin.ogg'
magout_sound = 'sound/weapons/gun_interactions/lmg_magout.ogg'
@@ -11,6 +11,7 @@
mag_type = /obj/item/ammo_box/magazine/internal/shot
fire_sound = 'sound/weapons/gunshots/gunshot_shotgun.ogg'
var/recentpump = 0 // to prevent spammage
weapon_weight = WEAPON_MEDIUM
/obj/item/gun/projectile/shotgun/attackby(obj/item/A, mob/user, params)
. = ..()
@@ -4,7 +4,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_sound = 'sound/weapons/gunshots/gunshot_sniper.ogg'
magin_sound = 'sound/weapons/gun_interactions/batrifle_magin.ogg'