From cd1c5511a4fd986ec526b9a0a0683ea0c4bb7a46 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 30 Jun 2020 16:24:04 +0200 Subject: [PATCH] Fixing two handed items and etcetera. --- code/datums/components/twohanded.dm | 2 +- code/game/objects/items/RCL.dm | 9 +++++---- code/game/objects/items/dualsaber.dm | 5 +++++ code/game/objects/items/stacks/sheets/mineral.dm | 1 + code/game/objects/items/toys.dm | 3 +-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/code/datums/components/twohanded.dm b/code/datums/components/twohanded.dm index e9f99a995e..77a9a79bf4 100644 --- a/code/datums/components/twohanded.dm +++ b/code/datums/components/twohanded.dm @@ -89,7 +89,7 @@ /// Triggered on equip of the item containing the component /datum/component/two_handed/proc/on_equip(datum/source, mob/user, slot) - if(require_twohands && slot == ITEM_SLOT_HANDS) // force equip the item + if(require_twohands && slot == SLOT_HANDS) // force equip the item wield(user) if(!user.is_holding(parent) && wielded && !require_twohands) unwield(user) diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm index 8c840eef2b..6e305c30ee 100644 --- a/code/game/objects/items/RCL.dm +++ b/code/game/objects/items/RCL.dm @@ -29,6 +29,11 @@ RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, .proc/on_unwield) update_icon() +/obj/item/rcl/ComponentInitialize() + . = ..() + AddElement(/datum/element/update_icon_updates_onmob) + AddComponent(/datum/component/two_handed) + /// triggered on wield of two handed item /obj/item/rcl/proc/on_wield(obj/item/source, mob/user) active = TRUE @@ -37,10 +42,6 @@ /obj/item/rcl/proc/on_unwield(obj/item/source, mob/user) active = FALSE -/obj/item/rcl/ComponentInitialize() - . = ..() - AddElement(/datum/element/update_icon_updates_onmob) - /obj/item/rcl/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = W diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index cb07c22504..8c7049c713 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -72,6 +72,11 @@ TEXT_ATTACK_TYPE_PROJECTILE = 4 ) +/obj/item/dualsaber/Initialize() + . = ..() + RegisterSignal(src, COMSIG_TWOHANDED_WIELD, .proc/on_wield) + RegisterSignal(src, COMSIG_TWOHANDED_UNWIELD, .proc/on_unwield) + /obj/item/dualsaber/ComponentInitialize() . = ..() AddComponent(/datum/component/two_handed, force_unwielded=3, force_wielded=34, \ diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index f5843a7df2..7692278ba3 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -430,6 +430,7 @@ GLOBAL_LIST_INIT(snow_recipes, list ( \ singular_name = "alien alloy sheet" sheettype = "abductor" merge_type = /obj/item/stack/sheet/mineral/abductor + walltype = /turf/closed/wall/mineral/abductor GLOBAL_LIST_INIT(abductor_recipes, list ( \ new/datum/stack_recipe("alien bed", /obj/structure/bed/abductor, 2, one_per_turf = 1, on_floor = 1), \ diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8fb656cc11..aa2c6d1c88 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -828,12 +828,11 @@ var/obj/item/toy/cards/singlecard/H = new/obj/item/toy/cards/singlecard(user.loc) if(holo) holo.spawned += H // track them leaving the holodeck - choice = cards[1] + choice = popleft(cards) H.cardname = choice H.parentdeck = src var/O = src H.apply_card_vars(H,O) - src.cards -= choice H.pickup(user) user.put_in_hands(H) user.visible_message("[user] draws a card from the deck.", "You draw a card from the deck.")