From f8a14425e5127410a158bddf41d6caaeae9fafa5 Mon Sep 17 00:00:00 2001 From: rye-rice <58402542+rye-rice@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:09:44 -0700 Subject: [PATCH] Revert "Cabinet Refactor (#3378)" This reverts commit c1706207847e8ff94ac2aaafe225f083aeb5c814. --- .../JungleRuins/jungle_paradise.dmm | 2 +- .../SpaceRuins/singularity_lab.dmm | 6 +- .../independent/independent_lagoon.dmm | 2 +- _maps/shuttles/inteq/inteq_talos.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_heron.dmm | 2 +- .../shuttles/nanotrasen/nanotrasen_osprey.dmm | 2 +- .../nanotrasen/nanotrasen_skipper.dmm | 2 +- _maps/shuttles/pirate/pirate_libertatia.dmm | 2 +- .../syndicate/syndicate_gorlex_komodo.dmm | 2 +- .../syndicate/syndicate_twinkleshine.dmm | 2 +- code/__DEFINES/dcs/signals/signals.dm | 1 - code/__DEFINES/traits.dm | 1 - code/__HELPERS/unsorted.dm | 2 +- code/datums/components/twohanded.dm | 5 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/objects/items/defib.dm | 13 ++ code/game/objects/items/melee/chainsaw.dm | 20 +- code/game/objects/items/melee/dualsaber.dm | 22 +- .../game/objects/items/melee/energyhalberd.dm | 23 +- code/game/objects/items/melee/fireaxe.dm | 22 +- code/game/objects/items/melee/spear.dm | 17 +- code/game/objects/items/melee/sword.dm | 22 +- code/game/objects/items/storage/secure.dm | 2 +- code/game/objects/structures/cabinet.dm | 214 ------------------ code/game/objects/structures/cabinet_types.dm | 10 - code/game/objects/structures/fireaxe.dm | 179 +++++++++++++++ .../mining/equipment/kinetic_crusher.dm | 53 +++-- code/modules/projectiles/gun.dm | 6 +- shiptest.dme | 3 +- 29 files changed, 345 insertions(+), 296 deletions(-) delete mode 100644 code/game/objects/structures/cabinet.dm delete mode 100644 code/game/objects/structures/cabinet_types.dm create mode 100644 code/game/objects/structures/fireaxe.dm diff --git a/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm b/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm index 47455933ec16..0e19890e63c7 100644 --- a/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm +++ b/_maps/RandomRuins/JungleRuins/jungle_paradise.dmm @@ -5181,7 +5181,7 @@ pixel_x = 7; pixel_y = 6 }, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = 28 }, /turf/open/floor/mineral/titanium, diff --git a/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm b/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm index 7dd57c637f35..99ccda138d00 100644 --- a/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm +++ b/_maps/RandomRuins/SpaceRuins/singularity_lab.dmm @@ -8625,13 +8625,13 @@ /turf/open/floor/plasteel/grimy, /area/ruin/space/has_grav/singularitylab/lab) "HU" = ( +/obj/structure/fireaxecabinet{ + pixel_y = 32 + }, /obj/structure/sign/warning/incident{ pixel_x = -32 }, /obj/effect/decal/cleanable/cobweb, -/obj/structure/cabinet/fireaxe{ - pixel_y = 28 - }, /turf/open/floor/plasteel/dark, /area/ruin/space/has_grav/singularitylab/engineering) "HW" = ( diff --git a/_maps/shuttles/independent/independent_lagoon.dmm b/_maps/shuttles/independent/independent_lagoon.dmm index 1c8c2307a7e8..3615828fa9d2 100644 --- a/_maps/shuttles/independent/independent_lagoon.dmm +++ b/_maps/shuttles/independent/independent_lagoon.dmm @@ -2347,7 +2347,7 @@ }, /obj/item/clothing/suit/hooded/wintercoat/engineering/atmos, /obj/item/clothing/gloves/color/black, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ dir = 8; pixel_x = 28 }, diff --git a/_maps/shuttles/inteq/inteq_talos.dmm b/_maps/shuttles/inteq/inteq_talos.dmm index 6b05aa78caaa..195852c9fd5c 100644 --- a/_maps/shuttles/inteq/inteq_talos.dmm +++ b/_maps/shuttles/inteq/inteq_talos.dmm @@ -2090,7 +2090,7 @@ dir = 1 }, /obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden/layer4, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ dir = 1; pixel_y = -32 }, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm index 7d8db3ebb68b..3dda0b36dd63 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_heron.dmm @@ -13621,7 +13621,7 @@ /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4{ dir = 6 }, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = 27 }, /obj/structure/closet/secure_closet/engineering_electrical, diff --git a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm index e99a4cd360a8..fb1d6e3c1f12 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_osprey.dmm @@ -5632,7 +5632,7 @@ /obj/machinery/atmospherics/pipe/manifold/supply/hidden/layer2{ dir = 1 }, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = 32 }, /obj/structure/cable{ diff --git a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm index a8f5bc22c7f4..d875a024d07f 100644 --- a/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm +++ b/_maps/shuttles/nanotrasen/nanotrasen_skipper.dmm @@ -472,7 +472,7 @@ /turf/open/floor/plasteel/white, /area/ship/medical) "dZ" = ( -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = -29 }, /obj/structure/catwalk/over/plated_catwalk/dark, diff --git a/_maps/shuttles/pirate/pirate_libertatia.dmm b/_maps/shuttles/pirate/pirate_libertatia.dmm index 46d00806edd7..b1bf098571c0 100644 --- a/_maps/shuttles/pirate/pirate_libertatia.dmm +++ b/_maps/shuttles/pirate/pirate_libertatia.dmm @@ -299,7 +299,7 @@ /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4{ dir = 4 }, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = 32 }, /turf/open/floor/pod/light, diff --git a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm index c466f5351f9c..2b4cfd484e98 100644 --- a/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm +++ b/_maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm @@ -2048,7 +2048,7 @@ dir = 4 }, /obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layer4, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ dir = 8; pixel_x = 27 }, diff --git a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm index 29f4bc28922b..6c690286b2ac 100644 --- a/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm +++ b/_maps/shuttles/syndicate/syndicate_twinkleshine.dmm @@ -3500,7 +3500,7 @@ pixel_y = 4 }, /obj/item/storage/toolbox/electrical, -/obj/structure/cabinet/fireaxe{ +/obj/structure/fireaxecabinet{ pixel_y = -32; dir = 1 }, diff --git a/code/__DEFINES/dcs/signals/signals.dm b/code/__DEFINES/dcs/signals/signals.dm index fd56e61f003b..f3295b737904 100644 --- a/code/__DEFINES/dcs/signals/signals.dm +++ b/code/__DEFINES/dcs/signals/signals.dm @@ -671,7 +671,6 @@ #define COMPONENT_TWOHANDED_BLOCK_WIELD 1 #define COMSIG_TWOHANDED_UNWIELD "twohanded_unwield" //from base of datum/component/two_handed/proc/unwield(mob/living/carbon/user): (/mob/user) - // /datum/action signals #define COMSIG_ACTION_TRIGGER "action_trigger" //from base of datum/action/proc/Trigger(): (datum/action) #define COMPONENT_ACTION_BLOCK_TRIGGER 1 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 4925981b2a91..c97fa62ffc5d 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -301,7 +301,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NO_STORAGE_INSERT "no_storage_insert" //cannot be inserted in a storage. #define TRAIT_T_RAY_VISIBLE "t-ray-visible" // Visible on t-ray scanners if the atom/var/level == 1 #define TRAIT_NO_TELEPORT "no-teleport" //you just can't -#define TRAIT_WIELDED "wielded" //The item is currently being wielded //quirk traits #define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 7bd6f72771cc..d831296dbb62 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -680,7 +680,7 @@ GLOBAL_LIST_INIT(WALLITEMS, typecacheof(list( /obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard, /obj/machinery/button, /obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/simple_vent_controller, /obj/item/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth, - /obj/structure/mirror, /obj/structure/cabinet, /obj/machinery/computer/security/telescreen/entertainment, + /obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment, /obj/structure/sign/picture_frame, /obj/machinery/bounty_board ))) diff --git a/code/datums/components/twohanded.dm b/code/datums/components/twohanded.dm index 5ba0a368c637..51c9268d13ab 100644 --- a/code/datums/components/twohanded.dm +++ b/code/datums/components/twohanded.dm @@ -4,7 +4,6 @@ * When applied to an item it will make it two handed * */ - /datum/component/two_handed dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS // Only one of the component can exist on an item var/wielded = FALSE /// Are we holding the two handed item properly @@ -146,7 +145,6 @@ if(SEND_SIGNAL(parent, COMSIG_TWOHANDED_WIELD, user) & COMPONENT_TWOHANDED_BLOCK_WIELD) return // blocked wield from item wielded = TRUE - ADD_TRAIT(parent, TRAIT_WIELDED, REF(src)) RegisterSignal(user, COMSIG_MOB_SWAP_HANDS, PROC_REF(on_swap_hands)) // update item stats and name @@ -190,7 +188,6 @@ // wield update status wielded = FALSE - REMOVE_TRAIT(parent, TRAIT_WIELDED, REF(src)) UnregisterSignal(user, COMSIG_MOB_SWAP_HANDS) SEND_SIGNAL(parent, COMSIG_TWOHANDED_UNWIELD, user) @@ -306,7 +303,7 @@ sharpened_increase = min(amount, (max_amount - wielded_val)) return COMPONENT_BLOCK_SHARPEN_APPLIED -/* +/** * The offhand dummy item for two handed items * */ diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 4c27a08e64a7..e70edb721788 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1238,7 +1238,7 @@ if(!operating) if(istype(I, /obj/item/melee/axe/fire)) //being fireaxe'd var/obj/item/melee/axe/fire/axe = I - if(axe && !HAS_TRAIT(axe, TRAIT_WIELDED)) + if(axe && !axe.wielded) to_chat(user, "You need to be wielding \the [axe] to do that!") return INVOKE_ASYNC(src, (density ? PROC_REF(open) : PROC_REF(close)), 2) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 517bc9922786..32a62880d69c 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -309,6 +309,17 @@ AddElement(/datum/element/update_icon_updates_onmob) AddComponent(/datum/component/two_handed, force_unwielded=8, force_wielded=12) +/// triggered on wield of two handed item +/obj/item/shockpaddles/proc/on_wield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/shockpaddles/proc/on_unwield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = FALSE /obj/item/shockpaddles/Destroy() defib = null @@ -358,6 +369,8 @@ /obj/item/shockpaddles/Initialize() . = ..() ADD_TRAIT(src, TRAIT_NO_STORAGE_INSERT, GENERIC_ITEM_TRAIT) //stops shockpaddles from being inserted in BoH + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) if(!req_defib) return //If it doesn't need a defib, just say it exists if (!loc || !istype(loc, /obj/item/defibrillator)) //To avoid weird issues from admin spawns diff --git a/code/game/objects/items/melee/chainsaw.dm b/code/game/objects/items/melee/chainsaw.dm index d179237f8559..494ec65cdb5a 100644 --- a/code/game/objects/items/melee/chainsaw.dm +++ b/code/game/objects/items/melee/chainsaw.dm @@ -22,12 +22,30 @@ tool_behaviour = TOOL_SAW toolspeed = 0.5 var/on = FALSE + var/wielded = FALSE // track wielded status on item + +/obj/item/chainsaw/Initialize() + . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) /obj/item/chainsaw/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 30, 100, 0, 'sound/weapons/chainsawhit.ogg', TRUE) AddComponent(/datum/component/two_handed, require_twohands=TRUE) +/// triggered on wield of two handed item +/obj/item/chainsaw/proc/on_wield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/chainsaw/proc/on_unwield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = FALSE + /obj/item/chainsaw/attack_self(mob/user) on = !on to_chat(user, "As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]") @@ -49,7 +67,7 @@ A.UpdateButtonIcon() /obj/item/chainsaw/get_dismemberment_chance() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) . = ..() /obj/item/chainsaw/doomslayer diff --git a/code/game/objects/items/melee/dualsaber.dm b/code/game/objects/items/melee/dualsaber.dm index 28242c1006a1..965979db215a 100644 --- a/code/game/objects/items/melee/dualsaber.dm +++ b/code/game/objects/items/melee/dualsaber.dm @@ -28,6 +28,7 @@ var/two_hand_force = 34 var/hacked = FALSE var/list/possible_colors = list("red", "blue", "green", "purple", "yellow") + var/wielded = FALSE // track wielded status on item /obj/item/dualsaber/ComponentInitialize() . = ..() @@ -42,6 +43,7 @@ if(user.dna.check_mutation(HULK)) to_chat(user, "You lack the grace to wield this!") return COMPONENT_TWOHANDED_BLOCK_WIELD + wielded = TRUE sharpness = IS_SHARP w_class = w_class_on hitsound = 'sound/weapons/blade1.ogg' @@ -54,14 +56,16 @@ /obj/item/dualsaber/proc/on_unwield(obj/item/source, mob/living/carbon/user) SIGNAL_HANDLER + wielded = FALSE sharpness = initial(sharpness) w_class = initial(w_class) hitsound = "swing_hit" STOP_PROCESSING(SSobj, src) set_light_on(FALSE) + /obj/item/dualsaber/update_icon_state() - icon_state = HAS_TRAIT(src, TRAIT_WIELDED) ? "dualsaber[saber_color]" : "dualsaber" + icon_state = wielded ? "dualsaber[saber_color]" : "dualsaber" return ..() /obj/item/dualsaber/Initialize() @@ -90,14 +94,14 @@ if(user.has_dna()) if(user.dna.check_mutation(HULK)) to_chat(user, "You grip the blade too hard and accidentally drop it!") - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) user.dropItemToGround(src, force=TRUE) return ..() - if(HAS_TRAIT(src, TRAIT_WIELDED) && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(40)) + if(wielded && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(40)) impale(user) return - if(HAS_TRAIT(src, TRAIT_WIELDED) && prob(50)) + if(wielded && prob(50)) INVOKE_ASYNC(src, PROC_REF(jedi_spin), user) /obj/item/dualsaber/proc/jedi_spin(mob/living/user) @@ -105,18 +109,18 @@ /obj/item/dualsaber/proc/impale(mob/living/user) to_chat(user, "You twirl around a bit before losing your balance and impaling yourself on [src].") - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) user.take_bodypart_damage(20,25,check_armor = TRUE) else user.adjustStaminaLoss(25) /obj/item/dualsaber/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) return ..() return 0 /obj/item/dualsaber/process() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) if(hacked) set_light_color(pick(COLOR_SOFT_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER)) open_flame() @@ -124,12 +128,12 @@ STOP_PROCESSING(SSobj, src) /obj/item/dualsaber/IsReflect() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) return 1 /obj/item/dualsaber/ignition_effect(atom/A, mob/user) // same as /obj/item/melee/transforming/energy, mostly - if(!HAS_TRAIT(src, TRAIT_WIELDED)) + if(!wielded) return "" var/in_mouth = "" if(iscarbon(user)) diff --git a/code/game/objects/items/melee/energyhalberd.dm b/code/game/objects/items/melee/energyhalberd.dm index 8ae5cdd96f36..62c6f5de6020 100644 --- a/code/game/objects/items/melee/energyhalberd.dm +++ b/code/game/objects/items/melee/energyhalberd.dm @@ -31,12 +31,13 @@ var/two_hand_force = 34 var/hacked = FALSE var/list/possible_colors = list("red", "blue", "green", "purple", "yellow") + var/wielded = FALSE // track wielded status on item /obj/item/energyhalberd/ComponentInitialize() . = ..() AddComponent(/datum/component/two_handed, force_unwielded=force, force_wielded=two_hand_force, wieldsound='sound/weapons/saberon.ogg', unwieldsound='sound/weapons/saberoff.ogg') - +/// Triggered on wield of two handed item /// Specific hulk checks due to reflection chance for balance issues and switches hitsounds. /obj/item/energyhalberd/proc/on_halberdwield(obj/item/source, mob/living/carbon/user) SIGNAL_HANDLER @@ -45,6 +46,7 @@ if(user.dna.check_mutation(HULK)) to_chat(user, "You lack the grace to wield this!") return COMPONENT_TWOHANDED_BLOCK_WIELD + wielded = TRUE sharpness = IS_SHARP w_class = w_class_on hitsound = 'sound/weapons/blade1.ogg' @@ -52,9 +54,12 @@ set_light_on(TRUE) +/// Triggered on unwield of two handed item /// switch hitsounds /obj/item/energyhalberd/proc/on_halberdunwield(obj/item/source, mob/living/carbon/user) SIGNAL_HANDLER + + wielded = FALSE sharpness = initial(sharpness) w_class = initial(w_class) hitsound = "swing_hit" @@ -63,7 +68,7 @@ /obj/item/energyhalberd/update_icon_state() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) icon_state = "halberd[halberd_color]" return ..() else @@ -96,28 +101,28 @@ if(user.has_dna()) if(user.dna.check_mutation(HULK)) to_chat(user, "You grip the blade too hard and accidentally drop it!") - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) user.dropItemToGround(src, force=TRUE) return ..() - if(HAS_TRAIT(src, TRAIT_WIELDED) && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(40)) + if(wielded && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(40)) impale(user) return /obj/item/energyhalberd/proc/impale(mob/living/user) to_chat(user, "You swing around a bit before losing your balance and impaling yourself on [src].") - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) user.take_bodypart_damage(20,25,check_armor = TRUE) else user.adjustStaminaLoss(25) /obj/item/energyhalberd/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) return ..() return 0 /obj/item/energyhalberd/process() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) if(hacked) set_light_color(pick(COLOR_SOFT_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER)) open_flame() @@ -125,12 +130,12 @@ STOP_PROCESSING(SSobj, src) /obj/item/energyhalberd/IsReflect() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) return 1 /obj/item/energyhalberd/ignition_effect(atom/A, mob/user) // same as /obj/item/melee/transforming/energy, mostly - if(!HAS_TRAIT(src, TRAIT_WIELDED)) + if(!wielded) return "" var/in_mouth = "" if(iscarbon(user)) diff --git a/code/game/objects/items/melee/fireaxe.dm b/code/game/objects/items/melee/fireaxe.dm index b3e04ac1bc3c..bfbed0fe361b 100644 --- a/code/game/objects/items/melee/fireaxe.dm +++ b/code/game/objects/items/melee/fireaxe.dm @@ -13,13 +13,31 @@ armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30) resistance_flags = FIRE_PROOF species_exception = list(/datum/species/kepori) + var/wielded = FALSE // track wielded status on item + +/obj/item/melee/axe/Initialize() + . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) /obj/item/melee/axe/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 100, 80, 0 , hitsound) //axes are not known for being precision butchering tools AddComponent(/datum/component/two_handed, force_unwielded=5, force_wielded=24, icon_wielded="[base_icon_state]1") -/obj/item/fireaxe/update_icon_state() +/// triggered on wield of two handed item +/obj/item/melee/axe/proc/on_wield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/melee/axe/proc/on_unwield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = FALSE + +/obj/item/melee/axe/update_icon_state() icon_state = "[base_icon_state]0" return ..() @@ -27,7 +45,7 @@ . = ..() if(!proximity) return - if(HAS_TRAIT(src, TRAIT_WIELDED)) //destroys windows and grilles in one hit + if(wielded) //destroys windows and grilles in one hit if(istype(A, /obj/structure/window) || istype(A, /obj/structure/grille)) var/obj/structure/W = A W.obj_destruction("axe") diff --git a/code/game/objects/items/melee/spear.dm b/code/game/objects/items/melee/spear.dm index 218638882bfb..42717117fd8e 100644 --- a/code/game/objects/items/melee/spear.dm +++ b/code/game/objects/items/melee/spear.dm @@ -66,15 +66,30 @@ icon_prefix = "spearbomb" var/obj/item/grenade/explosive = null var/war_cry = "AAAAARGH!!!" + var/wielded = FALSE // track wielded status on item /obj/item/melee/spear/explosive/Initialize(mapload) . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) set_explosive(new /obj/item/grenade/iedcasing/spawned()) //For admin-spawned explosive lances /obj/item/melee/spear/explosive/ComponentInitialize() . = ..() AddComponent(/datum/component/two_handed, force_unwielded=10, force_wielded=18, icon_wielded="[icon_prefix]1") +/// triggered on wield of two handed item +/obj/item/melee/spear/explosive/proc/on_wield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/melee/spear/explosive/proc/on_unwield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = FALSE + /obj/item/melee/spear/explosive/proc/set_explosive(obj/item/grenade/G) if(explosive) QDEL_NULL(explosive) @@ -115,7 +130,7 @@ . = ..() if(!proximity) return - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) user.say("[war_cry]", forced="spear warcry") explosive.forceMove(AM) explosive.prime() diff --git a/code/game/objects/items/melee/sword.dm b/code/game/objects/items/melee/sword.dm index ff384770a318..21bde05c0dd3 100644 --- a/code/game/objects/items/melee/sword.dm +++ b/code/game/objects/items/melee/sword.dm @@ -332,20 +332,38 @@ attack_verb = list("cut", "sliced", "diced") slot_flags = ITEM_SLOT_BACK hitsound = 'sound/weapons/bladeslice.ogg' + var/wielded = FALSE // track wielded status on item + +/obj/item/melee/sword/vibro/Initialize() + . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) /obj/item/melee/sword/vibro/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 20, 105) AddComponent(/datum/component/two_handed, force_multiplier=2, icon_wielded="[base_icon_state]1") +/// triggered on wield of two handed item +/obj/item/melee/sword/vibro/proc/on_wield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/melee/sword/vibro/proc/on_unwield(obj/item/source, mob/user) + SIGNAL_HANDLER + + wielded = FALSE + /obj/item/melee/sword/vibro/update_icon_state() icon_state = "[base_icon_state]0" return ..() /obj/item/melee/sword/vibro/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) final_block_chance *= 2 - if(HAS_TRAIT(src, TRAIT_WIELDED) || attack_type != PROJECTILE_ATTACK) + if(wielded || attack_type != PROJECTILE_ATTACK) if(prob(final_block_chance)) if(attack_type == PROJECTILE_ATTACK) owner.visible_message("[owner] deflects [attack_text] with [src]!") diff --git a/code/game/objects/items/storage/secure.dm b/code/game/objects/items/storage/secure.dm index f918a3b883fb..422ff52b15b0 100644 --- a/code/game/objects/items/storage/secure.dm +++ b/code/game/objects/items/storage/secure.dm @@ -173,7 +173,7 @@ . = ..() var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.set_holdable(null, list(/obj/item/storage/secure/briefcase)) - STR.max_w_class = 8 + STR.max_w_class = 8 //?? /obj/item/storage/secure/safe/PopulateContents() new /obj/item/paper(src) diff --git a/code/game/objects/structures/cabinet.dm b/code/game/objects/structures/cabinet.dm deleted file mode 100644 index bc89cf1d0bbe..000000000000 --- a/code/game/objects/structures/cabinet.dm +++ /dev/null @@ -1,214 +0,0 @@ -/obj/structure/cabinet - name = "\improper cabinet" - desc = "There is a small label that reads \"For Emergency use only\". Yeah right." - icon = 'icons/obj/wallmounts.dmi' - icon_state = "fireaxe" - anchored = TRUE - density = FALSE - armor = list("melee" = 50, "bullet" = 20, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50) - max_integrity = 150 - integrity_failure = 0.33 - req_one_access_txt = "0" - var/locked = TRUE - var/open = FALSE - var/start_empty = FALSE - var/obj/item/stored - var/allowed_type - var/stored_sprite = "axe" - -/obj/structure/cabinet/Initialize() - . = ..() - if(allowed_type && !start_empty) - stored = new allowed_type(src) - update_appearance() - -/obj/structure/cabinet/Destroy() - if(istype(stored)) - qdel(stored) - stored = null - return ..() - -/obj/structure/cabinet/examine(mob/user) - . = ..() - if(!open) - . += span_notice("Alt-click to [locked ? "unlock" : "lock"] [src]") - if(stored) - . += span_notice("[stored] is sitting inside, ripe for the taking.") - -/obj/structure/cabinet/attackby(obj/item/I, mob/user, params) - if(iscyborg(user) || I.tool_behaviour == TOOL_MULTITOOL) - hack_lock(user) - else if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken) - if(obj_integrity < max_integrity) - if(!I.tool_start_check(user, amount=2)) - return - to_chat(user, span_notice("You begin repairing [src]")) - if(I.use_tool(src, user, 40, volume=50, amount=2)) - obj_integrity = max_integrity - update_appearance() - to_chat(user, span_notice("You repair [src]")) - else - to_chat(user, span_warning("[src] is already in good condition!")) - return - else if(istype(I, /obj/item/stack/sheet/glass) && broken) - var/obj/item/stack/sheet/glass/G = I - if(G.get_amount() < 2) - to_chat(user, span_warning("You need two [G.singular_name] to fix [src]!")) - return - to_chat(user, span_notice("You start fixing [src]...")) - if(do_after(user, 20, target = src) && G.use(2)) - broken = 0 - obj_integrity = max_integrity - update_appearance() - else if(open || broken) - if(istype(I, allowed_type) && !stored) - var/obj/item/storee = I - SIGNAL_HANDLER - if(storee && HAS_TRAIT(storee, TRAIT_WIELDED)) - to_chat(user, span_warning("Unwield the [storee.name] first.")) - return - if(!user.transferItemToLoc(I, src)) - return - stored = storee - to_chat(user, span_notice("You place the [storee.name] back in the [name].")) - update_appearance() - return - else if(!broken) - toggle_open() - else - return ..() - -/obj/structure/cabinet/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) - switch(damage_type) - if(BRUTE) - if(broken) - playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, TRUE) - else - playsound(loc, 'sound/effects/glasshit.ogg', 90, TRUE) - if(BURN) - playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE) - -/obj/structure/cabinet/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) - if(open) - return - . = ..() - if(.) - update_appearance() - -/obj/structure/cabinet/obj_break(damage_flag) - if(!broken && !(flags_1 & NODECONSTRUCT_1)) - update_appearance() - broken = TRUE - playsound(src, 'sound/effects/glassbr3.ogg', 100, TRUE) - new /obj/item/shard(loc) - new /obj/item/shard(loc) - -/obj/structure/cabinet/deconstruct(disassembled = TRUE) - if(!(flags_1 & NODECONSTRUCT_1)) - if(stored && loc) - stored.forceMove(loc) - stored = null - new /obj/item/stack/sheet/metal(loc, 2) - qdel(src) - -/obj/structure/cabinet/attack_hand(mob/user) - . = ..() - if(.) - return - if(open || broken) - if(stored) - to_chat(user, span_notice("You take [stored] from [name].")) - user.put_in_hands(stored) - stored = null - src.add_fingerprint(user) - update_appearance() - return - if(locked) - to_chat(user, span_warning("[name] won't budge!")) - return - else - open = !open - update_appearance() - return - -/obj/structure/cabinet/attack_paw(mob/living/user) - return attack_hand(user) - -/obj/structure/cabinet/attack_ai(mob/user) - toggle_lock(user) - return - -/obj/structure/cabinet/attack_tk(mob/user) - if(locked) - to_chat(user, span_warning("[name] won't budge!")) - return - else - open = !open - update_appearance() - return - -/obj/structure/cabinet/update_overlays() - . = ..() - if(stored) - . += "[stored_sprite]" - if(open) - . += "glass_raised" - return - var/hp_percent = obj_integrity/max_integrity * 100 - if(broken) - . += "glass4" - else - switch(hp_percent) - if(-INFINITY to 40) - . += "glass3" - if(40 to 60) - . += "glass2" - if(60 to 80) - . += "glass1" - if(80 to INFINITY) - . += "glass" - - . += locked ? "locked" : "unlocked" - -/obj/structure/cabinet/proc/toggle_lock(mob/user) - if(!broken) - if(allowed(user)) - if(iscarbon(user)) - add_fingerprint(user) - locked = !locked - user.visible_message( - span_notice("[user] [locked ? "locks" : "unlocks"][src]."), - span_notice("You [locked ? "lock" : "unlock"] [src].")) - update_appearance() - else - to_chat(user, span_warning("Access denied!")) - else if(broken) - to_chat(user, span_warning("\The [src] is broken!")) - -/obj/structure/cabinet/AltClick(mob/user) - ..() - if(!user.canUseTopic(src, BE_CLOSE) || !isturf(loc) || open) - return - else - toggle_lock(user) - -/obj/structure/cabinet/proc/hack_lock(mob/user) - to_chat(user, span_notice("Resetting circuitry...")) - playsound(src, 'sound/machines/locktoggle.ogg', 50, TRUE) - if(do_after(user, 20, target = src)) - to_chat(user, span_notice("You [locked ? "disable" : "re-enable"] the locking modules.")) - locked = !locked - update_appearance() - -/obj/structure/cabinet/verb/toggle_open() - set name = "Open/Close" - set category = "Object" - set src in oview(1) - - if(locked) - visible_message(span_warning("[name] won't budge!")) - return - else - open = !open - update_appearance() - return diff --git a/code/game/objects/structures/cabinet_types.dm b/code/game/objects/structures/cabinet_types.dm deleted file mode 100644 index 347e1954ded4..000000000000 --- a/code/game/objects/structures/cabinet_types.dm +++ /dev/null @@ -1,10 +0,0 @@ -/obj/structure/cabinet/fireaxe - name = "\improper fire axe cabinet" - desc = "There is a small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if." - icon = 'icons/obj/wallmounts.dmi' - icon_state = "fireaxe" - anchored = TRUE - density = FALSE - stored_sprite = "axe" - allowed_type = /obj/item/melee/axe/fire - req_one_access_txt = "24" diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm new file mode 100644 index 000000000000..a164248a2bdd --- /dev/null +++ b/code/game/objects/structures/fireaxe.dm @@ -0,0 +1,179 @@ +/obj/structure/fireaxecabinet + name = "fire axe cabinet" + desc = "There is a small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if." + icon = 'icons/obj/wallmounts.dmi' + icon_state = "fireaxe" + anchored = TRUE + density = FALSE + armor = list("melee" = 50, "bullet" = 20, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 50) + max_integrity = 150 + integrity_failure = 0.33 + var/locked = TRUE + var/open = FALSE + var/obj/item/melee/axe/fire/fireaxe + +/obj/structure/fireaxecabinet/Initialize() + . = ..() + fireaxe = new + update_appearance() + +/obj/structure/fireaxecabinet/Destroy() + if(fireaxe) + QDEL_NULL(fireaxe) + return ..() + +/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params) + if(iscyborg(user) || I.tool_behaviour == TOOL_MULTITOOL) + toggle_lock(user) + else if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken) + if(obj_integrity < max_integrity) + if(!I.tool_start_check(user, amount=2)) + return + + to_chat(user, "You begin repairing [src].") + if(I.use_tool(src, user, 40, volume=50, amount=2)) + obj_integrity = max_integrity + update_appearance() + to_chat(user, "You repair [src].") + else + to_chat(user, "[src] is already in good condition!") + return + else if(istype(I, /obj/item/stack/sheet/glass) && broken) + var/obj/item/stack/sheet/glass/G = I + if(G.get_amount() < 2) + to_chat(user, "You need two glass sheets to fix [src]!") + return + to_chat(user, "You start fixing [src]...") + if(do_after(user, 20, target = src) && G.use(2)) + broken = 0 + obj_integrity = max_integrity + update_appearance() + else if(open || broken) + if(istype(I, /obj/item/melee/axe/fire) && !fireaxe) + var/obj/item/melee/axe/fire/F = I + if(F && F.wielded) + to_chat(user, "Unwield the [F.name] first.") + return + if(!user.transferItemToLoc(F, src)) + return + fireaxe = F + to_chat(user, "You place the [F.name] back in the [name].") + update_appearance() + return + else if(!broken) + toggle_open() + else + return ..() + +/obj/structure/fireaxecabinet/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) + switch(damage_type) + if(BRUTE) + if(broken) + playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, TRUE) + else + playsound(loc, 'sound/effects/glasshit.ogg', 90, TRUE) + if(BURN) + playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE) + +/obj/structure/fireaxecabinet/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) + if(open) + return + . = ..() + if(.) + update_appearance() + +/obj/structure/fireaxecabinet/obj_break(damage_flag) + if(!broken && !(flags_1 & NODECONSTRUCT_1)) + update_appearance() + broken = TRUE + playsound(src, 'sound/effects/glassbr3.ogg', 100, TRUE) + new /obj/item/shard(loc) + new /obj/item/shard(loc) + +/obj/structure/fireaxecabinet/deconstruct(disassembled = TRUE) + if(!(flags_1 & NODECONSTRUCT_1)) + if(fireaxe && loc) + fireaxe.forceMove(loc) + fireaxe = null + new /obj/item/stack/sheet/metal(loc, 2) + qdel(src) + +/obj/structure/fireaxecabinet/attack_hand(mob/user) + . = ..() + if(.) + return + if(open || broken) + if(fireaxe) + user.put_in_hands(fireaxe) + fireaxe = null + to_chat(user, "You take the fire axe from the [name].") + src.add_fingerprint(user) + update_appearance() + return + if(locked) + to_chat(user, "The [name] won't budge!") + return + else + open = !open + update_appearance() + return + +/obj/structure/fireaxecabinet/attack_paw(mob/living/user) + return attack_hand(user) + +/obj/structure/fireaxecabinet/attack_ai(mob/user) + toggle_lock(user) + return + +/obj/structure/fireaxecabinet/attack_tk(mob/user) + if(locked) + to_chat(user, "The [name] won't budge!") + return + else + open = !open + update_appearance() + return + +/obj/structure/fireaxecabinet/update_overlays() + . = ..() + if(fireaxe) + . += "axe" + if(open) + . += "glass_raised" + return + var/hp_percent = obj_integrity/max_integrity * 100 + if(broken) + . += "glass4" + else + switch(hp_percent) + if(-INFINITY to 40) + . += "glass3" + if(40 to 60) + . += "glass2" + if(60 to 80) + . += "glass1" + if(80 to INFINITY) + . += "glass" + + . += locked ? "locked" : "unlocked" + +/obj/structure/fireaxecabinet/proc/toggle_lock(mob/user) + to_chat(user, "Resetting circuitry...") + playsound(src, 'sound/machines/locktoggle.ogg', 50, TRUE) + if(do_after(user, 20, target = src)) + to_chat(user, "You [locked ? "disable" : "re-enable"] the locking modules.") + locked = !locked + update_appearance() + +/obj/structure/fireaxecabinet/verb/toggle_open() + set name = "Open/Close" + set category = "Object" + set src in oview(1) + + if(locked) + to_chat(usr, "The [name] won't budge!") + return + else + open = !open + update_appearance() + return diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index 05e81421ac4f..3e0bed238bec 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -8,7 +8,7 @@ name = "proto-magnetic crusher" desc = "A multipurpose disembarkation and self-defense tool designed by EXOCOM using an incomplete Nanotrasen prototype. \ Found in the grime-stained hands of wannabee explorers across the frontier, it cuts rock and hews flora using magnetic osscilation and a heavy cleaving edge." - force = 0 //You can't hit stuff unless it's wielded + force = 0 //You can't hit stuff unless wielded w_class = WEIGHT_CLASS_BULKY slot_flags = ITEM_SLOT_BACK throwforce = 5 @@ -28,19 +28,33 @@ var/charge_time = 15 var/detonation_damage = 20 var/backstab_bonus = 10 + var/wielded = FALSE // track wielded status on item + +/obj/item/kinetic_crusher/Initialize() + . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) /obj/item/kinetic_crusher/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 60, 110) //technically it's huge and bulky, but this provides an incentive to use it AddComponent(/datum/component/two_handed, force_unwielded=0, force_wielded=15) +/// triggered on wield of two handed item +/obj/item/kinetic_crusher/proc/on_wield(obj/item/source, mob/user) + wielded = TRUE + +/// triggered on unwield of two handed item +/obj/item/kinetic_crusher/proc/on_unwield(obj/item/source, mob/user) + wielded = FALSE + /obj/item/kinetic_crusher/examine(mob/living/user) . = ..() . += "Induce magnetism in an enemy by striking them with a magnetospheric wave, then hit them in melee to force a waveform collapse for [force + detonation_damage] damage." . += "Does [force + detonation_damage + backstab_bonus] damage if the target is backstabbed, instead of [force + detonation_damage]." /obj/item/kinetic_crusher/attack(mob/living/target, mob/living/carbon/user) - if(!HAS_TRAIT(src, TRAIT_WIELDED)) + if(!wielded) to_chat(user, "[src] is too heavy to use with one hand! You fumble and drop everything.") user.drop_all_held_items() return @@ -52,7 +66,7 @@ /obj/item/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams) . = ..() - if(!HAS_TRAIT(src, TRAIT_WIELDED)) + if(!wielded) return if(!proximity_flag && charged)//Mark a target, or mine a tile. var/turf/proj_turf = user.loc @@ -104,7 +118,7 @@ /obj/item/kinetic_crusher/update_icon_state() - item_state = "crusher[HAS_TRAIT(src, TRAIT_WIELDED)]" // this is not icon_state and not supported by 2hcomponent + item_state = "crusher[wielded]" // this is not icon_state and not supported by 2hcomponent return ..() /obj/item/kinetic_crusher/update_overlays() @@ -168,7 +182,7 @@ user.changeNext_move(CLICK_CD_MELEE * 2.0)//...slow swinga. /obj/item/kinetic_crusher/old/update_icon_state() - item_state = "crusherold[HAS_TRAIT(src, TRAIT_WIELDED)]" // still not supported by 2hcomponent + item_state = "crusherold[wielded]" // still not supported by 2hcomponent return ..() //100% original syndicate oc, plz do not steal. More effective against human targets then the typical crusher, with a bit of block chance. @@ -181,7 +195,7 @@ name = "magnetic cleaver" desc = "Designed by Syndicate Research and Development for their resource-gathering operations on hostile worlds. Syndicate Legal Ops would like to stress that you've never seen anything like this before. Ever." armour_penetration = 69//nice cut - force = 0 //You can't hit stuff unless HAS_TRAIT(src, TRAIT_WIELDED) + force = 0 //You can't hit stuff unless wielded w_class = WEIGHT_CLASS_BULKY slot_flags = ITEM_SLOT_BACK throwforce = 5 @@ -202,40 +216,35 @@ charge_time = 15 detonation_damage = 35 backstab_bonus = 15 + wielded = FALSE // track wielded status on item actions_types = list() - -/obj/item/kinetic_crusher/syndie_crusher/Initialize() - . = ..() - RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield)) - RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, PROC_REF(on_unwield)) - /obj/item/kinetic_crusher/syndie_crusher/ComponentInitialize() . = ..() AddComponent(/datum/component/butchering, 60, 150) AddComponent(/datum/component/two_handed, force_unwielded=0, force_wielded=10) /// triggered on wield of two handed item -/obj/item/kinetic_crusher/syndie_crusher/proc/on_wield(obj/item/source, mob/user) - SIGNAL_HANDLER - +/obj/item/kinetic_crusher/syndie_crusher/on_wield(obj/item/source, mob/user) + . = ..() + wielded = TRUE icon_state = "crushersyndie1" playsound(user, 'sound/weapons/saberon.ogg', 35, TRUE) - set_light_on(HAS_TRAIT(src, TRAIT_WIELDED)) + set_light_on(wielded) /// triggered on unwield of two handed item -/obj/item/kinetic_crusher/syndie_crusher/proc/on_unwield(obj/item/source, mob/user) - SIGNAL_HANDLER - +/obj/item/kinetic_crusher/syndie_crusher/on_unwield(obj/item/source, mob/user) + . = ..() + wielded = FALSE icon_state = "crushersyndie" playsound(user, 'sound/weapons/saberoff.ogg', 35, TRUE) - set_light_on(HAS_TRAIT(src, TRAIT_WIELDED)) + set_light_on(wielded) /obj/item/kinetic_crusher/syndie_crusher/update_icon_state() - item_state = "crushersyndie[HAS_TRAIT(src, TRAIT_WIELDED)]" // this is not icon_state and not supported by 2hcomponent + item_state = "crushersyndie[wielded]" // this is not icon_state and not supported by 2hcomponent return ..() /obj/item/kinetic_crusher/syndie_crusher/update_overlays() . = ..() - if(HAS_TRAIT(src, TRAIT_WIELDED)) + if(wielded) . += "[icon_state]_lit" diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index f848018a6115..7e99ea9b28bb 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -367,6 +367,9 @@ wielded_fully = TRUE return TRUE +/obj/item/gun/proc/is_wielded() + return wielded + /// triggered on unwield of two handed item /obj/item/gun/proc/on_unwield(obj/item/source, mob/user) wielded = FALSE @@ -374,9 +377,6 @@ zoom(user, forced_zoom = FALSE) user.remove_movespeed_modifier(/datum/movespeed_modifier/gun) -/obj/item/gun/proc/is_wielded() - return wielded - /obj/item/gun/Destroy() if(chambered) //Not all guns are chambered (EMP'ed energy guns etc) QDEL_NULL(chambered) diff --git a/shiptest.dme b/shiptest.dme index 53b8c061b5fa..0bff452a9161 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1387,8 +1387,6 @@ #include "code\game\objects\structures\artstuff.dm" #include "code\game\objects\structures\barsigns.dm" #include "code\game\objects\structures\bedsheet_bin.dm" -#include "code\game\objects\structures\cabinet.dm" -#include "code\game\objects\structures\cabinet_types.dm" #include "code\game\objects\structures\catwalk.dm" #include "code\game\objects\structures\crateshelf.dm" #include "code\game\objects\structures\curtains.dm" @@ -1402,6 +1400,7 @@ #include "code\game\objects\structures\extinguisher.dm" #include "code\game\objects\structures\false_walls.dm" #include "code\game\objects\structures\fence.dm" +#include "code\game\objects\structures\fireaxe.dm" #include "code\game\objects\structures\fireplace.dm" #include "code\game\objects\structures\flora.dm" #include "code\game\objects\structures\fluff.dm"