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

[MIRROR] You don't hit the chem master with your beaker #1240

Merged
merged 1 commit into from
Dec 22, 2023
Merged
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
34 changes: 15 additions & 19 deletions code/modules/reagents/chemistry/machinery/chem_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -448,40 +448,36 @@
return null

/obj/machinery/chem_dispenser/wrench_act(mob/living/user, obj/item/tool)
. = ..()
if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_dispenser/screwdriver_act(mob/living/user, obj/item/tool)
. = ..()
if(default_deconstruction_screwdriver(user, icon_state, icon_state, tool))
update_appearance()
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_dispenser/crowbar_act(mob/living/user, obj/item/tool)
. = ..()
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_dispenser/attackby(obj/item/I, mob/living/user, params)
if(is_reagent_container(I) && !(I.item_flags & ABSTRACT) && I.is_open_container())
var/obj/item/reagent_containers/B = I
//SKYRAT EDIT BEGIN - CHEMISTRY QOL
/obj/machinery/chem_dispenser/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
if(is_reagent_container(tool) && !(tool.item_flags & ABSTRACT) && tool.is_open_container())
//SKYRAT EDIT ADDITION START - CHEMISTRY QOL
var/obj/item/reagent_containers/container = tool
if(customTransferAmount)
transferAmounts -= customTransferAmount
transferAmounts = B.possible_transfer_amounts
//SKYRAT EDIT END
. = TRUE //no afterattack
if(!user.transferItemToLoc(B, src))
return
replace_beaker(user, B)
to_chat(user, span_notice("You add [B] to [src]."))
transferAmounts = container.possible_transfer_amounts
//SKYRAT EDIT ADDITION END
if(!user.transferItemToLoc(tool, src))
return ..()
replace_beaker(user, tool)
ui_interact(user)
else if(!user.combat_mode && !istype(I, /obj/item/card/emag))
to_chat(user, span_warning("You can't load [I] into [src]!"))
return ..()
else
return ..()
return ITEM_INTERACT_SUCCESS

return ..()

/obj/machinery/chem_dispenser/get_cell()
return cell
Expand Down
34 changes: 20 additions & 14 deletions code/modules/reagents/chemistry/machinery/chem_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,36 @@


/obj/machinery/chem_master/wrench_act(mob/living/user, obj/item/tool)
. = ..()
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
if(default_unfasten_wrench(user, tool) == SUCCESSFUL_UNFASTEN)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_master/attackby(obj/item/item, mob/user, params)
if(default_deconstruction_screwdriver(user, icon_state, icon_state, item))
/obj/machinery/chem_master/screwdriver_act(mob/living/user, obj/item/tool)
if(default_deconstruction_screwdriver(user, icon_state, icon_state, tool))
update_appearance(UPDATE_ICON)
return
if(default_deconstruction_crowbar(item))
return
if(is_reagent_container(item) && !(item.item_flags & ABSTRACT) && item.is_open_container())
. = TRUE // No afterattack
var/obj/item/reagent_containers/beaker = item
replace_beaker(user, beaker)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_master/crowbar_act(mob/living/user, obj/item/tool)
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING

/obj/machinery/chem_master/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
if(is_reagent_container(tool) && !(tool.item_flags & ABSTRACT) && tool.is_open_container())
replace_beaker(user, tool)
if(!panel_open)
ui_interact(user)
return ITEM_INTERACT_SUCCESS

return ..()

/obj/machinery/chem_master/attack_hand_secondary(mob/user, list/modifiers)
. = ..()
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
return
return .
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
return
return .
replace_beaker(user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

Expand Down
Loading