Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jul 15, 2023
1 parent cdac633 commit d75703f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
//the define for visible message range in combat
#define COMBAT_MESSAGE_RANGE 3
#define DEFAULT_MESSAGE_RANGE 7

#define BAYONET_DRAW_DELAY (1 SECONDS)
3 changes: 1 addition & 2 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,6 @@
cant_hold = list()
flap = FALSE
var/draw_cooldown = 0
var/draw_cooldown_interval = 1 SECONDS

/obj/item/storage/belt/knifepouch/fill_preset_inventory()
for(var/i = 1 to storage_slots)
Expand All @@ -753,7 +752,7 @@
/obj/item/storage/belt/knifepouch/attack_hand(mob/user, mods)
if(draw_cooldown < world.time)
..()
draw_cooldown = world.time + draw_cooldown_interval
draw_cooldown = world.time + BAYONET_DRAW_DELAY
playsound(src, 'sound/weapons/gun_shotgun_shell_insert.ogg', 15, TRUE)
else
to_chat(user, SPAN_WARNING("You need to wait before drawing another knife!"))
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/storage/pouch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
storage_slots = 5
storage_flags = STORAGE_FLAGS_POUCH|STORAGE_USING_DRAWING_METHOD|STORAGE_ALLOW_QUICKDRAW
var/draw_cooldown = 0
var/draw_cooldown_interval = 1 SECONDS
var/default_knife_type = /obj/item/weapon/throwing_knife

/obj/item/storage/pouch/bayonet/Initialize()
Expand All @@ -151,7 +150,7 @@
/obj/item/storage/pouch/bayonet/attack_hand(mob/user, mods)
if(draw_cooldown < world.time)
..()
draw_cooldown = world.time + draw_cooldown_interval
draw_cooldown = world.time + BAYONET_DRAW_DELAY
playsound(src, 'sound/weapons/gun_shotgun_shell_insert.ogg', 15, TRUE)
else
to_chat(user, SPAN_WARNING("You need to wait before drawing another knife!"))
Expand Down
31 changes: 31 additions & 0 deletions code/modules/clothing/under/ties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,12 @@
icon_state = "vest_knives"
hold = /obj/item/storage/internal/accessory/knifeharness

/obj/item/clothing/accessory/storage/knifeharness/attack_hand(mob/user, mods)
if(!mods || !mods["alt"] || !length(hold.contents))
return ..()

hold.contents[length(contents)].attack_hand(user, mods)

/obj/item/storage/internal/accessory/knifeharness
storage_slots = 5
max_storage_space = 5
Expand All @@ -603,6 +609,31 @@
/obj/item/attachable/bayonet,
/obj/item/weapon/throwing_knife,
)
storage_flags = STORAGE_ALLOW_QUICKDRAW|STORAGE_FLAGS_POUCH
var/draw_cooldown = 0

/obj/item/storage/internal/accessory/knifeharness/fill_preset_inventory()
for(var/i = 1 to storage_slots)
new /obj/item/weapon/throwing_knife(src)

/obj/item/storage/internal/accessory/knifeharness/attack_hand(mob/user, mods)
. = ..()

if(draw_cooldown >= world.time)
to_chat(user, SPAN_WARNING("You need to wait before drawing another knife!"))
return FALSE

if(length(contents))
contents[length(contents)].attack_hand(user, mods)
draw_cooldown = world.time + BAYONET_DRAW_DELAY

/obj/item/storage/internal/accessory/knifeharness/_item_insertion(obj/item/inserted_item, prevent_warning = 0)
..()
playsound(src, 'sound/weapons/gun_shotgun_shell_insert.ogg', 15, TRUE)

/obj/item/storage/internal/accessory/knifeharness/_item_removal(obj/item/removed_item, atom/new_location)
..()
playsound(src, 'sound/weapons/gun_shotgun_shell_insert.ogg', 15, TRUE)

/obj/item/clothing/accessory/storage/knifeharness/duelling
name = "decorated harness"
Expand Down
6 changes: 6 additions & 0 deletions code/modules/projectiles/gun_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w
var/obj/item/storage/internal/accessory/holster/holster = cycled_holster.hold
if(holster.current_gun)
return holster.current_gun

for(var/obj/item/clothing/accessory/storage/cycled_accessory in w_uniform.accessories)
var/obj/item/storage/internal/accessory/accessory_storage = cycled_accessory.hold
if(accessory_storage.storage_flags & STORAGE_ALLOW_QUICKDRAW)
return accessory_storage

return FALSE

if(istype(slot) && (slot.storage_flags & STORAGE_ALLOW_QUICKDRAW))
Expand Down

0 comments on commit d75703f

Please sign in to comment.