From 02205bb2be0669b1415c3cb42e1b82a22181c85f Mon Sep 17 00:00:00 2001 From: Erika Fox <94164348+Erikafox@users.noreply.github.com> Date: Sun, 3 Nov 2024 05:44:14 -0500 Subject: [PATCH] Energy Bayonet (#3674) ## About The Pull Request saw this in the attachments sprite file. implemented it. Scarborough guns can use it right now. ## Changelog :cl: add: Energy Bayonets /:cl: --------- Co-authored-by: Bjarl <94164348+Bjarl@users.noreply.github.com> --- .../items/attachments/energy_bayonet.dm | 44 +++++++++++++++++++ .../projectiles/guns/ballistic/gauss.dm | 31 +++++++++++-- .../manufacturer/scarborough/ballistics.dm | 2 +- shiptest.dme | 1 + 4 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 code/game/objects/items/attachments/energy_bayonet.dm diff --git a/code/game/objects/items/attachments/energy_bayonet.dm b/code/game/objects/items/attachments/energy_bayonet.dm new file mode 100644 index 000000000000..d3f442fa3ab6 --- /dev/null +++ b/code/game/objects/items/attachments/energy_bayonet.dm @@ -0,0 +1,44 @@ +/obj/item/attachment/energy_bayonet + name = "energy bayonet" + desc = "Stabby-Stabby" + icon_state = "ebayonet" + force = 3 + throwforce = 2 + pickup_sound = 'sound/items/handling/knife1_pickup.ogg' + drop_sound = 'sound/items/handling/knife3_drop.ogg' + hitsound = 'sound/weapons/bladeslice.ogg' + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + sharpness = IS_BLUNT + slot = ATTACHMENT_SLOT_MUZZLE + attach_features_flags = ATTACH_TOGGLE + + light_range = 2 + light_power = 0.6 + light_on = FALSE + light_color = COLOR_MOSTLY_PURE_RED + light_system = MOVABLE_LIGHT + + toggle_on_sound = 'sound/weapons/saberon.ogg' + toggle_off_sound = 'sound/weapons/saberoff.ogg' + + pixel_shift_x = 1 + pixel_shift_y = 4 + spread_mod = 1 + wield_delay = 0.2 SECONDS + +/obj/item/attachment/energy_bayonet/on_preattack(obj/item/gun/gun, atom/target, mob/living/user, list/params) + if(user.a_intent == INTENT_HARM && user.CanReach(target, src, TRUE) && toggled != 0) + melee_attack_chain(user, target, params) + return COMPONENT_NO_ATTACK + + +/obj/item/attachment/energy_bayonet/toggle_attachment(obj/item/gun/gun, mob/user) + . = ..() + set_light_on(toggled) + update_icon() + sharpness = toggled ? IS_SHARP_ACCURATE : IS_BLUNT + force = toggled ? 19 : 3 + throwforce = toggled ? 14 : 2 + +/obj/item/attachment/energy_bayonet/attack_self(mob/user) + toggle_attachment() diff --git a/code/modules/projectiles/guns/ballistic/gauss.dm b/code/modules/projectiles/guns/ballistic/gauss.dm index 13e5b8aec75d..ec7eaede5c90 100644 --- a/code/modules/projectiles/guns/ballistic/gauss.dm +++ b/code/modules/projectiles/guns/ballistic/gauss.dm @@ -36,10 +36,7 @@ /obj/item/gun/ballistic/automatic/powered/gauss/modelh name = "Model H" desc = "A standard-issue pistol exported from the Solarian Confederation. It fires slow flesh-rending ferromagnetic slugs at a high energy cost, however they are ineffective on any armor." - default_ammo_type = /obj/item/ammo_box/magazine/modelh - allowed_ammo_types = list( - /obj/item/ammo_box/magazine/modelh, - ) + icon = 'icons/obj/guns/manufacturer/solararmories/48x32.dmi' lefthand_file = 'icons/obj/guns/manufacturer/solararmories/lefthand.dmi' righthand_file = 'icons/obj/guns/manufacturer/solararmories/righthand.dmi' @@ -48,10 +45,16 @@ item_state = "model-h" fire_sound = 'sound/weapons/gun/gauss/modelh.ogg' load_sound = 'sound/weapons/gun/gauss/pistol_reload.ogg' + + default_ammo_type = /obj/item/ammo_box/magazine/modelh + allowed_ammo_types = list( + /obj/item/ammo_box/magazine/modelh, + ) default_cell_type = /obj/item/stock_parts/cell/gun/solgov allowed_cell_types = list( /obj/item/stock_parts/cell/gun/solgov, ) + slot_flags = ITEM_SLOT_BELT w_class = WEIGHT_CLASS_SMALL fire_delay = 0.6 SECONDS //pistol, but heavy caliber. @@ -64,6 +67,11 @@ spread_unwielded = 12 fire_select_icon_state_prefix = "slug_" + valid_attachments = list( + /obj/item/attachment/laser_sight, + /obj/item/attachment/rail_light, + ) + /obj/item/gun/ballistic/automatic/powered/gauss/modelh/no_mag default_ammo_type = FALSE @@ -103,6 +111,14 @@ manufacturer = MANUFACTURER_SOLARARMORIES fire_select_icon_state_prefix = "pellet_" + valid_attachments = list( + /obj/item/attachment/laser_sight, + /obj/item/attachment/rail_light, + /obj/item/attachment/bayonet, + /obj/item/attachment/energy_bayonet + ) + + /obj/item/gun/ballistic/automatic/powered/gauss/claris/suns desc = "An antiquated Solarian rifle. Chambered in ferromagnetic pellets, just as the founding Solarians intended. Evidently, SUNS' founders echo the sentiment, as it appears to be painted in their colors." icon_state = "claris_suns" @@ -135,6 +151,13 @@ empty_indicator = FALSE manufacturer = MANUFACTURER_SOLARARMORIES + valid_attachments = list( + /obj/item/attachment/laser_sight, + /obj/item/attachment/rail_light, + /obj/item/attachment/bayonet, + /obj/item/attachment/energy_bayonet + ) + gun_firemodes = list(FIREMODE_SEMIAUTO, FIREMODE_FULLAUTO) default_firemode = FIREMODE_SEMIAUTO diff --git a/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm b/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm index 862e558ab1e1..200d608cbe61 100644 --- a/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm +++ b/code/modules/projectiles/guns/manufacturer/scarborough/ballistics.dm @@ -1,4 +1,4 @@ -#define SCARBOROUGH_ATTACHMENTS list(/obj/item/attachment/silencer, /obj/item/attachment/laser_sight, /obj/item/attachment/rail_light, /obj/item/attachment/bayonet) +#define SCARBOROUGH_ATTACHMENTS list(/obj/item/attachment/silencer, /obj/item/attachment/laser_sight, /obj/item/attachment/rail_light, /obj/item/attachment/bayonet, /obj/item/attachment/energy_bayonet) #define SCARBOROUGH_ATTACH_SLOTS list(ATTACHMENT_SLOT_MUZZLE = 1, ATTACHMENT_SLOT_SCOPE = 1, ATTACHMENT_SLOT_RAIL = 1) //########### PISTOLS ###########// diff --git a/shiptest.dme b/shiptest.dme index 27bf90ca3d34..55407e846972 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1248,6 +1248,7 @@ #include "code\game\objects\items\wayfinding.dm" #include "code\game\objects\items\attachments\_attachment.dm" #include "code\game\objects\items\attachments\bayonet.dm" +#include "code\game\objects\items\attachments\energy_bayonet.dm" #include "code\game\objects\items\attachments\laser_sight.dm" #include "code\game\objects\items\attachments\m17_barrel.dm" #include "code\game\objects\items\attachments\rail_light.dm"