Attack chain migration: structures. (#30365)

* Attack chain migration: structures.

* whoops

* wth
This commit is contained in:
warriorstar-orion
2025-09-14 19:21:36 +00:00
committed by GitHub
parent cd7b4e7292
commit 3208049a8a
87 changed files with 1396 additions and 404 deletions
@@ -284,11 +284,11 @@
if(!broken && !(flags & NODECONSTRUCT))
bust_open()
/obj/structure/closet/attackby__legacy__attackchain(obj/item/W, mob/user, params)
/obj/structure/closet/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(istype(W, /obj/item/rcs) && !opened)
var/obj/item/rcs/E = W
E.try_send_container(user, src)
return
return ITEM_INTERACT_COMPLETE
if(opened)
if(istype(W, /obj/item/grab))
@@ -298,26 +298,28 @@
else
to_chat(user, "<span class='notice'>[src] is too small to stuff [G.affecting] into!</span>")
if(istype(W, /obj/item/tk_grab))
return FALSE
return // passthrough
if(user.a_intent != INTENT_HELP) // Stops you from putting your baton in the closet on accident
return
return ITEM_INTERACT_COMPLETE
if(isrobot(user) && !istype(W.loc, /obj/item/gripper))
return
return ITEM_INTERACT_COMPLETE
if(!user.drop_item()) //couldn't drop the item
to_chat(user, "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>")
return
return ITEM_INTERACT_COMPLETE
if(W.loc != user.loc)
// It went somewhere else, don't teleport it back.
return
return ITEM_INTERACT_COMPLETE
if(W)
W.forceMove(loc)
return TRUE // It's resolved. No afterattack needed. Stops you from emagging lockers when putting in an emag
return ITEM_INTERACT_COMPLETE
else if(can_be_emaged && (istype(W, /obj/item/card/emag) || istype(W, /obj/item/melee/energy/blade) && !broken))
emag_act(user)
return ITEM_INTERACT_COMPLETE
else if(istype(W, /obj/item/stack/package_wrap))
return
return ITEM_INTERACT_COMPLETE
else if(user.a_intent != INTENT_HARM)
closed_item_click(user)
return ITEM_INTERACT_COMPLETE
else
return ..()
@@ -68,7 +68,7 @@
/obj/structure/closet/cardboard/welder_act()
return
/obj/structure/closet/cardboard/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
/obj/structure/closet/cardboard/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(src.opened)
if(istype(W, /obj/item/wirecutters))
var/obj/item/wirecutters/WC = W
@@ -76,26 +76,26 @@
for(var/mob/M in viewers(src))
M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WC].</span>", 3, "You hear cutting.", 2)
qdel(src)
return
return ITEM_INTERACT_COMPLETE
if(is_pen(W))
var/decalselection = tgui_input_list(user, "Please select a decal", "Paint Box", list("Atmospherics", "Bartender", "Barber", "Blueshield", "Captain",
"Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Assistant", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP",
"HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Medical", "Mime", "Mining", "NT Representative", "Paramedic",
"Prisoner", "Research Director", "Security", "Syndicate", "Therapist", "Virology", "Warden", "Xenobiology"))
if(!decalselection)
return
return ITEM_INTERACT_COMPLETE
if(user.incapacitated())
to_chat(user, "You're in no condition to perform this action.")
return
return ITEM_INTERACT_COMPLETE
if(W != user.get_active_hand())
to_chat(user, "You must be holding the pen to perform this action.")
return
return ITEM_INTERACT_COMPLETE
if(!Adjacent(user))
to_chat(user, "You have moved too far away from the cardboard box.")
return
return ITEM_INTERACT_COMPLETE
decalselection = replacetext(decalselection, " ", "_")
decalselection = lowertext(decalselection)
custom_skin = "_[decalselection]"
update_icon() // a proc declared in the closets parent file used to update opened/closed sprites on normal closets
return
return ..()
return ITEM_INTERACT_COMPLETE
@@ -29,7 +29,7 @@
else
. += "<span class='notice'>It is damaged beyond repair.</span>"
/obj/structure/closet/fireaxecabinet/attackby__legacy__attackchain(obj/item/O as obj, mob/living/user as mob) //Marker -Agouri
/obj/structure/closet/fireaxecabinet/item_interaction(mob/living/user, obj/item/O, list/modifiers)
if(isrobot(user) || locked)
if(istype(O, /obj/item/multitool))
to_chat(user, "<span class='warning'>Resetting circuitry...</span>")
@@ -38,14 +38,14 @@
locked = FALSE
to_chat(user, "<span class = 'caution'> You disable the locking modules.</span>")
update_icon(UPDATE_ICON_STATE)
return
return ITEM_INTERACT_COMPLETE
else if(isitem(O))
user.changeNext_move(CLICK_CD_MELEE)
var/obj/item/W = O
if(smashed || localopened)
if(localopened)
operate_panel()
return
return ITEM_INTERACT_COMPLETE
else
user.do_attack_animation(src)
playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time
@@ -59,16 +59,16 @@
locked = FALSE
localopened = TRUE
update_icon(UPDATE_ICON_STATE)
return
return ITEM_INTERACT_COMPLETE
if(istype(O, /obj/item/fireaxe) && localopened)
if(!fireaxe)
var/obj/item/fireaxe/F = O
if(HAS_TRAIT(F, TRAIT_WIELDED))
to_chat(user, "<span class='warning'>Unwield \the [F] first.</span>")
return
return ITEM_INTERACT_COMPLETE
if(!user.unequip(F, FALSE))
to_chat(user, "<span class='warning'>\The [F] stays stuck to your hands!</span>")
return
return ITEM_INTERACT_COMPLETE
fireaxe = F
has_axe = "full"
contents += F
@@ -76,25 +76,27 @@
update_icon(UPDATE_ICON_STATE)
else
if(smashed)
return
return ITEM_INTERACT_COMPLETE
else
operate_panel()
return ITEM_INTERACT_COMPLETE
else
if(smashed)
return
return ITEM_INTERACT_COMPLETE
if(istype(O, /obj/item/multitool))
if(localopened)
operate_panel()
return
return ITEM_INTERACT_COMPLETE
else
to_chat(user, "<span class='warning'>Resetting circuitry...</span>")
playsound(user, 'sound/machines/lockenable.ogg', 50, 1)
if(do_after(user, 20 * O.toolspeed, target = src))
locked = TRUE
to_chat(user, "<span class = 'caution'> You re-enable the locking modules.</span>")
return
return ITEM_INTERACT_COMPLETE
else
operate_panel()
return ITEM_INTERACT_COMPLETE
/obj/structure/closet/fireaxecabinet/attack_hand(mob/user as mob)
if(locked)
@@ -36,10 +36,10 @@
return
return ..()
/obj/structure/closet/secure_closet/depot/attackby__legacy__attackchain(obj/item/W, mob/user, params)
/obj/structure/closet/secure_closet/depot/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(istype(W, /obj/item/rcs))
to_chat(user, "<span class='warning'>Bluespace interference prevents [W] from locking onto [src]!</span>")
return
return ITEM_INTERACT_COMPLETE
return ..()
/obj/structure/closet/secure_closet/depot/emp_act(severity)
@@ -34,25 +34,25 @@
new /obj/item/storage/backpack/satchel/withwallet( src )
new /obj/item/radio/headset( src )
/obj/structure/closet/secure_closet/personal/attackby__legacy__attackchain(obj/item/W, mob/user, params)
/obj/structure/closet/secure_closet/personal/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(opened || !istype(W, /obj/item/card/id))
return ..()
if(broken)
to_chat(user, "<span class='warning'>The locker appears to be broken.</span>")
return
return ITEM_INTERACT_COMPLETE
if(user.loc == src)
to_chat(user, "<span class='notice'>You can't reach the lock from inside.</span>")
return
return ITEM_INTERACT_COMPLETE
if(istype(W, /obj/item/card/id/guest))
to_chat(user, "<span class='warning'>Invalid identification card.</span>")
return
return ITEM_INTERACT_COMPLETE
var/obj/item/card/id/I = W
if(!I || !I.registered_name)
return
return ITEM_INTERACT_COMPLETE
if(allowed(user) || !registered_name || (istype(I) && (registered_name == I.registered_name)))
//they can open all lockers, or nobody owns this, or they own this locker
@@ -68,3 +68,5 @@
else
to_chat(user, "<span class='warning'>Access denied.</span>")
return ITEM_INTERACT_COMPLETE
@@ -85,9 +85,9 @@
opened = FALSE
return TRUE
/obj/structure/closet/crate/attackby__legacy__attackchain(obj/item/W, mob/user, params)
/obj/structure/closet/crate/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(!opened && try_rig(W, user))
return
return ITEM_INTERACT_COMPLETE
return ..()
/obj/structure/closet/crate/toggle(mob/user, by_hand = FALSE)
@@ -311,18 +311,18 @@
return FALSE
return TRUE
/obj/structure/closet/crate/secure/personal/attackby__legacy__attackchain(obj/item/I, mob/user, params)
/obj/structure/closet/crate/secure/personal/item_interaction(mob/living/user, obj/item/I, list/modifiers)
if(opened || !istype(I, /obj/item/card/id))
return ..()
if(broken)
to_chat(user, "<span class='warning'>It appears to be broken.</span>")
return FALSE
return ITEM_INTERACT_COMPLETE
var/obj/item/card/id/id = I
if(!is_usable_id(id))
to_chat(user, "<span class='warning'>Invalid identification card.</span>")
return FALSE
return ITEM_INTERACT_COMPLETE
if(registered_name && allowed(user))
return ..()
@@ -330,12 +330,12 @@
if(!registered_name)
registered_name = id.registered_name
to_chat(user, "<span class='notice'>Crate reserved</span>")
return TRUE
return ITEM_INTERACT_COMPLETE
if(registered_name == id.registered_name)
return ..()
return FALSE
return ITEM_INTERACT_COMPLETE
/obj/structure/closet/crate/plastic
name = "plastic crate"
@@ -29,11 +29,10 @@
to_chat(user, "<span class='notice'>You need a crowbar to pry this open!</span>")
return
/obj/structure/largecrate/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
/obj/structure/largecrate/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(user.a_intent != INTENT_HARM)
attack_hand(user)
else
return ..()
return ITEM_INTERACT_COMPLETE
/obj/structure/largecrate/crowbar_act(mob/living/user, obj/item/I)
. = TRUE