Skip to content

Commit

Permalink
Energy Bayonet (#3674)
Browse files Browse the repository at this point in the history
## 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:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Bjarl <94164348+Bjarl@users.noreply.github.com>
  • Loading branch information
Erikafox and Erikafox authored Nov 3, 2024
1 parent 199a973 commit 02205bb
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 5 deletions.
44 changes: 44 additions & 0 deletions code/game/objects/items/attachments/energy_bayonet.dm
Original file line number Diff line number Diff line change
@@ -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()
31 changes: 27 additions & 4 deletions code/modules/projectiles/guns/ballistic/gauss.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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 ###########//
Expand Down
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 02205bb

Please sign in to comment.