Skip to content

Commit

Permalink
tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Dec 26, 2024
1 parent 253ae4d commit 8b93b0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/modules/mining/tools/kinetic/kinetic_gauntlets-combo.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//

GLOBAL_DATUM_INIT(kinetic_gauntlet_melee_combo, /datum/combo_set/melee, new /datum/combo_set/melee/intent_based/kinetic_gauntlets)

/datum/combo_set/melee/intent_based/kinetic_gauntlets
expected_combo_type = /datum/combo/melee/kinetic_gauntlets
combos = list(
Expand Down
10 changes: 10 additions & 0 deletions code/modules/mining/tools/kinetic/kinetic_gauntlets.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//



/obj/item/kinetic_gauntlets
name = "proto-kinetic gauntlets"
icon = 'icons/modules/mining/tools/kinetic/kinetic_gauntlets.dmi'
Expand All @@ -17,6 +19,11 @@
var/charge_delay = 3 SECONDS
var/charge_timerid

/// our combo tracker
var/datum/combo_tracker/melee/combo_tracker
/// only reapplied on un-equip/re-equip right now!
var/combo_continuation_timeout = 3 SECONDS

/obj/item/kinetic_gauntlets/update_icon()
cut_overlays()
. = ..()
Expand Down Expand Up @@ -56,10 +63,13 @@
. = ..()
if(slot_id_or_index == /datum/inventory_slot/inventory/gloves::id)
start_recharge()
if(!combo_tracker)
combo_tracker = new(combo_continuation_timeout)

/obj/item/kinetic_gauntlets/on_unequipped(mob/wearer, slot_id_or_index, inv_op_flags, datum/event_args/actor/actor)
. = ..()
discharge()
QDEL_NULL(combo_tracker)

/obj/item/kinetic_gauntlets/proc/recharge()
charged = TRUE
Expand Down

0 comments on commit 8b93b0e

Please sign in to comment.