mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Storage / table interactions at the bottom of the interaction chain (#85512)
Because the wings were in fact made of wax ## About The Pull Request Storage goes to the very bottom of the interaction chain, hardcoded in on `/atom`. This is not preferred, obviously, but it ends up being a lot less snowflaking overall. Tables also go at the very bottom by extending `base_item_interaction`. Fixes #83742 Fixes #84434 Fixes #83982 Fixes #85516 Fixes #84990 Fixes #84890 Closes #85036 Closes #84025 (RMB places it on the table.) Closes #86616 Other changes: Refactored pod storage to be less jank. Patches some exploits around it. ## Why It's Good For The Game Should make a lot more interactions a lot more reliable... hopefully ## Changelog 🆑 Melbert refactor: Storage and Tables are now a lower priority action, meaning some uses of items on storage should work... better, now. Here's hoping at least, report any oddities. refactor: Note: For an overwhelming majority of items, **combat mode** will attempt to attack/insert into the target, while **non-combat-mode** will attempt to use on a target. This means screwdrivering or emagging a MODsuit must be done on non-combat-mode, as combat mode will simply put the screwdriver or emag into its storage. Same applies to tables, though when in doubt, RMB may help (for things which are also weapons, like mops). refactor: Refactored escape pod storage, now they actually properly show as unlocked on red alert and above. /🆑
This commit is contained in:
@@ -888,7 +888,7 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
|
||||
user.log_message("[welded ? "welded":"unwelded"] closet [src] with [weapon]", LOG_GAME)
|
||||
update_appearance()
|
||||
|
||||
else if(!user.combat_mode)
|
||||
else if(!user.combat_mode || (weapon.item_flags & NOBLUDGEON))
|
||||
var/item_is_id = weapon.GetID()
|
||||
if(!item_is_id)
|
||||
return FALSE
|
||||
|
||||
@@ -259,11 +259,11 @@
|
||||
M.attacked_by(src, user)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/gun_control/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
||||
/obj/item/gun_control/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
||||
var/obj/machinery/deployable_turret/E = user.buckled
|
||||
E.calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(user, interacting_with, modifiers)
|
||||
E.direction_track(user, interacting_with)
|
||||
E.checkfire(interacting_with, user)
|
||||
|
||||
/obj/item/gun_control/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
||||
return interact_with_atom(interacting_with, user, modifiers)
|
||||
/obj/item/gun_control/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
|
||||
return ranged_interact_with_atom(interacting_with, user, modifiers)
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
AddElement(/datum/element/give_turf_traits, give_turf_traits)
|
||||
register_context()
|
||||
|
||||
ADD_TRAIT(src, TRAIT_COMBAT_MODE_SKIP_INTERACTION, INNATE_TRAIT)
|
||||
|
||||
///Adds the element used to make the object climbable, and also the one that shift the mob buckled to it up.
|
||||
/obj/structure/table/proc/make_climbable()
|
||||
AddElement(/datum/element/climbable)
|
||||
@@ -224,36 +226,24 @@
|
||||
deconstruct(TRUE)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/structure/table/item_interaction_secondary(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(istype(tool, /obj/item/construction/rcd))
|
||||
return NONE
|
||||
// This extends base item interaction because tables default to blocking 99% of interactions
|
||||
/obj/structure/table/base_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
. = ..()
|
||||
if(.)
|
||||
return .
|
||||
|
||||
var/deck_act_value = NONE
|
||||
if(istype(tool, /obj/item/toy/cards/deck))
|
||||
deck_act_value = deck_act(user, tool, modifiers, TRUE)
|
||||
// Continue to placing if we don't do anything else
|
||||
if(deck_act_value != NONE)
|
||||
return deck_act_value
|
||||
|
||||
if(!user.combat_mode)
|
||||
return table_place_act(user, tool, modifiers)
|
||||
|
||||
return NONE
|
||||
|
||||
/obj/structure/table/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
. = NONE
|
||||
. = deck_act(user, tool, modifiers, !!LAZYACCESS(modifiers, RIGHT_CLICK))
|
||||
if(istype(tool, /obj/item/storage/bag/tray))
|
||||
. = tray_act(user, tool)
|
||||
else if(istype(tool, /obj/item/toy/cards/deck))
|
||||
. = deck_act(user, tool, modifiers, FALSE)
|
||||
else if(istype(tool, /obj/item/riding_offhand))
|
||||
. = riding_offhand_act(user, tool)
|
||||
|
||||
// Continue to placing if we don't do anything else
|
||||
if(. != NONE)
|
||||
if(.)
|
||||
return .
|
||||
|
||||
if(!user.combat_mode)
|
||||
if(!user.combat_mode || (tool.item_flags & NOBLUDGEON))
|
||||
return table_place_act(user, tool, modifiers)
|
||||
|
||||
return NONE
|
||||
@@ -865,6 +855,7 @@
|
||||
AddElement(/datum/element/climbable)
|
||||
AddElement(/datum/element/elevation, pixel_shift = 12)
|
||||
register_context()
|
||||
ADD_TRAIT(src, TRAIT_COMBAT_MODE_SKIP_INTERACTION, INNATE_TRAIT)
|
||||
|
||||
/obj/structure/rack/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
|
||||
if(isnull(held_item))
|
||||
@@ -892,8 +883,11 @@
|
||||
deconstruct(TRUE)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/structure/rack/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if((tool.item_flags & ABSTRACT) || user.combat_mode)
|
||||
/obj/structure/rack/base_item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
. = ..()
|
||||
if(.)
|
||||
return .
|
||||
if((tool.item_flags & ABSTRACT) || (user.combat_mode && !(tool.item_flags & NOBLUDGEON)))
|
||||
return NONE
|
||||
if(user.transferItemToLoc(tool, drop_location(), silent = FALSE))
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(!user.combat_mode)
|
||||
else if(!user.combat_mode || (I.item_flags & NOBLUDGEON))
|
||||
balloon_alert(user, "can't insert!")
|
||||
return
|
||||
else
|
||||
|
||||
@@ -204,7 +204,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sink, (-14))
|
||||
if(O.item_flags & ABSTRACT) //Abstract items like grabs won't wash. No-drop items will though because it's still technically an item in your hand.
|
||||
return
|
||||
|
||||
if(!user.combat_mode)
|
||||
if(!user.combat_mode || (O.item_flags & NOBLUDGEON))
|
||||
to_chat(user, span_notice("You start washing [O]..."))
|
||||
busy = TRUE
|
||||
if(!do_after(user, 4 SECONDS, target = src))
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
attacking_item.use(1)
|
||||
return
|
||||
|
||||
if(!user.combat_mode)
|
||||
if(!user.combat_mode || (attacking_item.item_flags & NOBLUDGEON))
|
||||
to_chat(user, span_notice("You start washing [attacking_item]..."))
|
||||
busy = TRUE
|
||||
if(!do_after(user, 4 SECONDS, target = src))
|
||||
|
||||
Reference in New Issue
Block a user