Adds the SPRK-12 Energy Pistol (#24869)

* Adds the SPRK-12 Pistol

* I Was improper and forgot to name it right

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* check it

* Update gun.dm

* less copypasta

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>

* early return

---------

Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
This commit is contained in:
Qwertytoforty
2024-04-28 22:03:14 +00:00
committed by GitHub
co-authored by Luc Henri215 warriorstar-orion
parent fb027f73dd
commit a50683ef28
10 changed files with 99 additions and 15 deletions
@@ -42,6 +42,11 @@
select_name = "anti-vehicle"
fire_sound = 'sound/weapons/lasercannonfire.ogg'
/obj/item/ammo_casing/energy/laser/sparker
projectile_type = /obj/item/projectile/beam/laser/sparker
select_name = "spark"
e_cost = (100 / 3) * 2 // 15 * 12.5 damage = 187.5 damage. Almost as much as a base laser gun, but takes longer to get all the shots out.
/obj/item/ammo_casing/energy/laser/pulse
projectile_type = /obj/item/projectile/beam/pulse/hitscan
muzzle_flash_color = LIGHT_COLOR_DARKBLUE
+19 -12
View File
@@ -195,19 +195,26 @@
//DUAL WIELDING
var/bonus_spread = 0
var/loop_counter = 0
if(ishuman(user) && user.a_intent == INTENT_HARM)
var/mob/living/carbon/human/H = user
for(var/obj/item/gun/G in get_both_hands(H))
if(G == src || G.weapon_weight >= WEAPON_MEDIUM)
continue
else if(G.can_trigger_gun(user))
if(!HAS_TRAIT(user, TRAIT_BADASS))
bonus_spread += dual_wield_spread * G.weapon_weight
loop_counter++
addtimer(CALLBACK(G, PROC_REF(process_fire), target, user, 1, params, null, bonus_spread), loop_counter)
if(!(ishuman(user) && user.a_intent == INTENT_HARM))
process_fire(target, user, TRUE, params, null, bonus_spread)
return
var/mob/living/carbon/human/H = user
var/obj/item/gun/GUN_1 = H.get_active_hand()
if(istype(H.get_inactive_hand(), /obj/item/gun)) //We do not need to check gun one, as it is controlled by the afterattack
var/obj/item/gun/GUN_2 = H.get_inactive_hand()
process_fire(target,user,1,params, null, bonus_spread)
if(GUN_2.weapon_weight >= WEAPON_MEDIUM)
process_fire(target, user, TRUE, params, null, bonus_spread)
return
if(GUN_2.can_trigger_gun(user))
if(!HAS_TRAIT(user, TRAIT_BADASS))
var/temporary_weapon_weight = GUN_2.weapon_weight
if(GUN_1.type != GUN_2.type)
temporary_weapon_weight = max(temporary_weapon_weight, WEAPON_LIGHT) //Can't hold the sparker in the off hand to make both guns perfectly accurate, must be 2 sparkers
bonus_spread += dual_wield_spread * temporary_weapon_weight
addtimer(CALLBACK(GUN_2, PROC_REF(process_fire), target, user, TRUE, params, null, bonus_spread), 1)
process_fire(target, user, TRUE, params, null, bonus_spread)
/obj/item/gun/proc/can_trigger_gun(mob/living/user)
if(!user.can_use_guns(src))
@@ -980,3 +980,25 @@
transform = M
animate(src, transform = M * 10, time = 0.3 SECONDS, alpha = 0)
QDEL_IN(src, 0.3 SECONDS)
/obj/item/gun/energy/sparker
name = "\improper SPRK-12"
desc = "A small, pistol-sized laser gun designed to regain charges from EMPs. Energy efficient, though its beams are weaker. Good at dual wielding, however."
icon_state = "dueling_pistol"
item_state = "dueling_pistol"
w_class = WEIGHT_CLASS_SMALL
can_holster = TRUE
execution_speed = 4 SECONDS
weapon_weight = WEAPON_DUAL_WIELD
shaded_charge = TRUE
ammo_type = list(/obj/item/ammo_casing/energy/laser/sparker)
/// The cooldown tracking when we were last EMP'd
COOLDOWN_DECLARE(emp_cooldown)
/obj/item/gun/energy/sparker/emp_act(severity)
if(!COOLDOWN_FINISHED(src, emp_cooldown))
return
cell.charge = cell.maxcharge
COOLDOWN_START(src, emp_cooldown, 1 MINUTES)
atom_say("Energy coils recharged!")
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
@@ -336,3 +336,14 @@
eyeblur = 0
impact_effect_type = /obj/effect/temp_visual/impact_effect/blue_laser
light_color = LIGHT_COLOR_CYAN
/obj/item/projectile/beam/laser/sparker
name = "sparker beam"
icon_state = "scatterlaser"
damage = 12.5
range = 12
/obj/item/projectile/beam/laser/sparker/on_range()
new /obj/effect/particle_effect/sparks(get_turf(src))
return ..()