mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
Tool act superpack 2 (#64428)
About The Pull Request Continuation of #64375, extracting tool behavior from attackby() and moving it into discrete _act procs. This is about as many files as I had in the last version, as I still want this to be reviewable. As before, I've tested everything in game and it works as it previously did. Why It's Good For The Game The more code moved out of attackby, the more modular things become. Changelog cl refactor: Moves more tool behavior out of attackby(). /cl
This commit is contained in:
@@ -60,10 +60,7 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/ai_slot/attackby(obj/item/I, mob/living/user)
|
||||
if(..())
|
||||
return
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
|
||||
try_eject(user, TRUE)
|
||||
return
|
||||
/obj/item/computer_hardware/ai_slot/screwdriver_act(mob/living/user, obj/item/tool)
|
||||
to_chat(user, span_notice("You press down on the manual eject button with [tool]."))
|
||||
try_eject(user, TRUE)
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
@@ -102,16 +102,14 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
|
||||
if(..())
|
||||
return
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
if(stored_card)
|
||||
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
|
||||
try_eject(user)
|
||||
return
|
||||
swap_slot()
|
||||
to_chat(user, span_notice("You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"]."))
|
||||
/obj/item/computer_hardware/card_slot/screwdriver_act(mob/living/user, obj/item/tool)
|
||||
if(stored_card)
|
||||
to_chat(user, span_notice("You press down on the manual eject button with [tool]."))
|
||||
try_eject(user)
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
swap_slot()
|
||||
to_chat(user, span_notice("You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"]."))
|
||||
return TOOL_ACT_TOOLTYPE_SUCCESS
|
||||
|
||||
/**
|
||||
*Swaps the card_slot hardware between using the dedicated card slot bay on a computer, and using an expansion bay.
|
||||
|
||||
Reference in New Issue
Block a user