Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM]Revert "Cabinet Refactor" to see if defibs get fixed #3470

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/RandomRuins/JungleRuins/jungle_paradise.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions _maps/RandomRuins/SpaceRuins/singularity_lab.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/independent/independent_lagoon.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/inteq/inteq_talos.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/nanotrasen/nanotrasen_heron.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/nanotrasen/nanotrasen_osprey.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/nanotrasen/nanotrasen_skipper.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/pirate/pirate_libertatia.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/syndicate/syndicate_gorlex_komodo.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/syndicate/syndicate_twinkleshine.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3500,7 +3500,7 @@
pixel_y = 4
},
/obj/item/storage/toolbox/electrical,
/obj/structure/cabinet/fireaxe{
/obj/structure/fireaxecabinet{
pixel_y = -32;
dir = 1
},
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/dcs/signals/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@
/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
)))

Expand Down Expand Up @@ -1065,7 +1065,7 @@

//gives us the stack trace from CRASH() without ending the current proc.
/proc/stack_trace(msg)
CRASH(msg)

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

Check failure on line 1068 in code/__HELPERS/unsorted.dm

View workflow job for this annotation

GitHub Actions / Integration Tests (SHIP_PLACEMENT_TEST) / run_integration_tests

/datum/unit_test/ship_outpost_placement

[2024-10-02 22:18:22] Runtime in code/__HELPERS/unsorted.dm,1068: Value is not a reference ByondValue("Null", "NULL")

/datum/proc/stack_trace(msg)
CRASH(msg)
Expand Down
5 changes: 1 addition & 4 deletions code/datums/components/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
*
*/
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='warning'>You need to be wielding \the [axe] to do that!</span>")
return
INVOKE_ASYNC(src, (density ? PROC_REF(open) : PROC_REF(close)), 2)
Expand Down
13 changes: 13 additions & 0 deletions code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 19 additions & 1 deletion code/game/objects/items/melee/chainsaw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."]")
Expand All @@ -49,7 +67,7 @@
A.UpdateButtonIcon()

/obj/item/chainsaw/get_dismemberment_chance()
if(HAS_TRAIT(src, TRAIT_WIELDED))
if(wielded)
. = ..()

/obj/item/chainsaw/doomslayer
Expand Down
22 changes: 13 additions & 9 deletions code/game/objects/items/melee/dualsaber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
. = ..()
Expand All @@ -42,6 +43,7 @@
if(user.dna.check_mutation(HULK))
to_chat(user, "<span class='warning'>You lack the grace to wield this!</span>")
return COMPONENT_TWOHANDED_BLOCK_WIELD
wielded = TRUE
sharpness = IS_SHARP
w_class = w_class_on
hitsound = 'sound/weapons/blade1.ogg'
Expand All @@ -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()
Expand Down Expand Up @@ -90,46 +94,46 @@
if(user.has_dna())
if(user.dna.check_mutation(HULK))
to_chat(user, "<span class='warning'>You grip the blade too hard and accidentally drop it!</span>")
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)
dance_rotate(user, CALLBACK(user, TYPE_PROC_REF(/mob, dance_flip)))

/obj/item/dualsaber/proc/impale(mob/living/user)
to_chat(user, "<span class='warning'>You twirl around a bit before losing your balance and impaling yourself on [src].</span>")
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()
else
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))
Expand Down
Loading
Loading