diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm index e4d0b3b0d8b..572854dfe28 100644 --- a/code/modules/crafting/guncrafting.dm +++ b/code/modules/crafting/guncrafting.dm @@ -93,6 +93,12 @@ origin_tech = "combat=4;magnets=4;powerstorage=3" outcome = /obj/item/gun/energy/plasma_pistol +/obj/item/weaponcrafting/gunkit/sparker + name = "\improper SPRK-12 pistol parts kit" + desc = "A suitcase containing the necessary gun parts to transform a mini energy gun into a SPRK-12 pistol. Double or nothing!" + origin_tech = "combat=4;magnets=4;powerstorage=3" + outcome = /obj/item/gun/energy/sparker + /obj/item/weaponcrafting/gunkit/u_ionsilencer name = "u-ion silencer parts kit" desc = "A suitcase containing the necessary gun parts to transform a standard disabler into a silenced and lethal disabling weapon. Look officer, he has no wounds from me!" @@ -114,13 +120,21 @@ if(!gunkit_to_use.outcome) to_chat(user, "That gunkit can not be used to craft a weapon.") return + playsound(user, 'sound/items/drill_use.ogg', 50, TRUE, SILENCED_SOUND_EXTRARANGE) if(!do_after(user, 5 SECONDS, target = user)) return playsound(user, 'sound/items/drill_use.ogg', 50, TRUE, SILENCED_SOUND_EXTRARANGE) - var/obj/item/gun_produced = new gunkit_to_use.outcome - user.unEquip(src) - user.put_in_hands(gun_produced) + if(istype(gunkit_to_use, /obj/item/weaponcrafting/gunkit/sparker)) //Snowflake checking, but I don't want a person with a self assembling kit to be robbed + var/obj/item/gun_produceda = new gunkit_to_use.outcome + var/obj/item/gun_producedb = new gunkit_to_use.outcome + user.unEquip(src) + user.put_in_hands(gun_produceda) + user.put_in_hands(gun_producedb) + else + var/obj/item/gun_produced = new gunkit_to_use.outcome + user.unEquip(src) + user.put_in_hands(gun_produced) qdel(gunkit_to_use) qdel(src) diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index e178aa0c44e..c1c7916fe86 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -221,6 +221,21 @@ ..() blacklist += subtypesof(/obj/item/gun/energy/laser) +/datum/crafting_recipe/sparker + name = "SPRK-12 Pistol" + tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER) + result = list(/obj/item/gun/energy/sparker) + reqs = list(/obj/item/gun/energy/gun/mini = 1, + /obj/item/stack/cable_coil = 5, + /obj/item/weaponcrafting/gunkit/sparker = 1) + time = 10 SECONDS + category = CAT_WEAPONRY + subcategory = CAT_WEAPON + +/datum/crafting_recipe/sparker/New() + ..() + blacklist += subtypesof(/obj/item/gun/energy/gun/mini) + /datum/crafting_recipe/teslarevolver name = "Arc Revolver" tools = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER) diff --git a/code/modules/projectiles/ammunition/energy_lens.dm b/code/modules/projectiles/ammunition/energy_lens.dm index 17964d6c365..f1b453ec833 100644 --- a/code/modules/projectiles/ammunition/energy_lens.dm +++ b/code/modules/projectiles/ammunition/energy_lens.dm @@ -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 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index b5365256fe8..b195704ce15 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -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)) diff --git a/code/modules/projectiles/guns/energy/special_eguns.dm b/code/modules/projectiles/guns/energy/special_eguns.dm index ef229890645..46cf2b9ea53 100644 --- a/code/modules/projectiles/guns/energy/special_eguns.dm +++ b/code/modules/projectiles/guns/energy/special_eguns.dm @@ -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) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index d934d34dbe9..214698db282 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -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 ..() + diff --git a/code/modules/research/designs/weapon_designs.dm b/code/modules/research/designs/weapon_designs.dm index c01c219ac55..5e08df463b2 100644 --- a/code/modules/research/designs/weapon_designs.dm +++ b/code/modules/research/designs/weapon_designs.dm @@ -145,6 +145,16 @@ build_path = /obj/item/weaponcrafting/gunkit/plasma category = list("Weapons") +/datum/design/sparker + name = "SPRK-12 Pistol Parts Kit" + desc = "A small, pistol-sized laser gun designed to regain charges from EMPs. Energy efficient, though it's beams are weaker. Good at dual wielding, however." + id = "sparker" + req_tech = list("combat" = 5, "magnets" = 5, "powerstorage" = 5, "plasmatech" = 5) + build_type = PROTOLATHE + materials = list(MAT_METAL = 2500, MAT_GLASS = 1000, MAT_SILVER = 1500) + build_path = /obj/item/weaponcrafting/gunkit/sparker + category = list("Weapons") + //WT550 Mags /datum/design/mag_oldsmg name = "WT-550 PDW Magazine (4.6x30mm)" diff --git a/icons/mob/inhands/guns_lefthand.dmi b/icons/mob/inhands/guns_lefthand.dmi index 53d11a4380b..6ba217d1d51 100644 Binary files a/icons/mob/inhands/guns_lefthand.dmi and b/icons/mob/inhands/guns_lefthand.dmi differ diff --git a/icons/mob/inhands/guns_righthand.dmi b/icons/mob/inhands/guns_righthand.dmi index 6993a2881f0..1aee6bb9652 100644 Binary files a/icons/mob/inhands/guns_righthand.dmi and b/icons/mob/inhands/guns_righthand.dmi differ diff --git a/icons/obj/guns/energy.dmi b/icons/obj/guns/energy.dmi index 1add4cb71ec..f40e9ec0aea 100644 Binary files a/icons/obj/guns/energy.dmi and b/icons/obj/guns/energy.dmi differ