Migrates /obj/item/stack to the new attack chain (#31709)

* e

* stuff not in the stack folder

* A

* Update gift_wrappaper.dm

* golg

* dancing around SHOULD_NOT_SLEEP and storage still being legacy

* Update asteroid_floors.dm

* Update medical_packs.dm

* Update medical_packs.dm
This commit is contained in:
CRUNCH
2026-04-02 03:32:15 +01:00
committed by GitHub
parent 07b4ab0b4c
commit d030b8afb8
20 changed files with 559 additions and 434 deletions
+3 -2
View File
@@ -83,8 +83,9 @@
w_class = WEIGHT_CLASS_TINY
max_amount = 9999 //Dang that's a lot of tickets
/obj/item/stack/tickets/attack_self__legacy__attackchain(mob/user as mob)
return
/obj/item/stack/tickets/activate_self(mob/user)
. = ..()
return ITEM_INTERACT_COMPLETE
/obj/item/stack/tickets/update_icon_state()
switch(get_amount())
+1 -1
View File
@@ -39,7 +39,7 @@
var/old_cotton_amount = cotton.amount
for(var/obj/item/stack/ST in user.loc)
if(ST != cotton && istype(ST, cotton_type) && ST.amount < ST.max_amount)
ST.attackby__legacy__attackchain(cotton, user)
ST.item_interaction(cotton, user)
if(cotton.amount > old_cotton_amount)
to_chat(user, SPAN_NOTICE("You add the newly-formed [cotton_name] to the stack. It now contains [cotton.amount] [cotton_name]."))
qdel(src)
@@ -47,18 +47,24 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/update_icon_state()
icon_state = "[base_icon_state][lowertext(picked_color)]"
/obj/item/stack/marker_beacon/attack_self__legacy__attackchain(mob/user)
/obj/item/stack/marker_beacon/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(!isturf(user.loc))
to_chat(user, SPAN_WARNING("You need more space to place a [singular_name] here."))
return
return ITEM_INTERACT_COMPLETE
if(locate(/obj/structure/marker_beacon) in user.loc)
to_chat(user, SPAN_WARNING("There is already a [singular_name] here."))
return
return ITEM_INTERACT_COMPLETE
if(use(1))
to_chat(user, SPAN_NOTICE("You activate and anchor [amount ? "a":"the"] [singular_name] in place."))
playsound(user, 'sound/machines/click.ogg', 50, 1)
var/obj/structure/marker_beacon/M = new(user.loc, picked_color)
transfer_fingerprints_to(M)
return ITEM_INTERACT_COMPLETE
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
if(!istype(user) || ui_status(user, GLOB.physical_state) != UI_INTERACTIVE)
+36 -25
View File
@@ -86,27 +86,32 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
return . && ..()
//you can use wires to heal robotics
/obj/item/stack/cable_coil/attack__legacy__attackchain(mob/M, mob/user)
if(!ishuman(M))
/obj/item/stack/cable_coil/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!ishuman(target))
return ..()
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/S = H.bodyparts_by_name[user.zone_selected]
if(!S && ismachineperson(M) && user.a_intent == INTENT_HELP)
to_chat(user, SPAN_NOTICE("[M.p_they(TRUE)] [M.p_are()] missing that limb!"))
return
if(!S && ismachineperson(target) && user.a_intent == INTENT_HELP)
to_chat(user, SPAN_NOTICE("[H.p_they(TRUE)] [H.p_are()] missing that limb!"))
return ITEM_INTERACT_COMPLETE
if(!S?.is_robotic() || user.a_intent != INTENT_HELP || S.open == ORGAN_SYNTHETIC_OPEN)
return ..()
if(S.burn_dam > ROBOLIMB_SELF_REPAIR_CAP)
to_chat(user, SPAN_DANGER("The damage is far too severe to patch over externally."))
return
return ITEM_INTERACT_COMPLETE
if(!S.burn_dam)
to_chat(user, SPAN_NOTICE("Nothing to fix!"))
return
return ITEM_INTERACT_COMPLETE
if(H == user)
if(!do_mob(user, H, 10))
return FALSE
return ITEM_INTERACT_COMPLETE
var/cable_used = 0
var/childlist
if(!isnull(S.children))
@@ -132,8 +137,8 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
cable_used += 1
E.heal_damage(0, HEALPERCABLE, 0, TRUE)
H.UpdateDamageIcon()
user.visible_message(SPAN_ALERT("[user] repairs some burn damage on [M]'s [E.name] with [src]."))
return TRUE
user.visible_message(SPAN_ALERT("[user] repairs some burn damage on [H]'s [E.name] with [src]."))
return ITEM_INTERACT_COMPLETE
/obj/item/stack/cable_coil/split()
var/obj/item/stack/cable_coil/C = ..()
@@ -143,27 +148,31 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
// Items usable on a cable coil :
// - Wirecutters : cut them duh !
// - Cable coil : merge cables
/obj/item/stack/cable_coil/attackby__legacy__attackchain(obj/item/W, mob/user)
. = ..()
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
/obj/item/stack/cable_coil/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = used
// Cable merging is handled by parent proc
if(C.cable_merge_id != cable_merge_id)
to_chat(user, "These coils are of different types.")
return
return ITEM_INTERACT_COMPLETE
if(C.get_amount() >= MAXCOIL)
to_chat(user, "The coil is as long as it will get.")
return
return ITEM_INTERACT_COMPLETE
if((C.get_amount() + get_amount() <= MAXCOIL))
to_chat(user, "You join the cable coils together.")
return
else
to_chat(user, "You transfer [get_amount_transferred()] length\s of cable from one coil to the other.")
return
return ITEM_INTERACT_COMPLETE
if(istype(W, /obj/item/toy/crayon))
var/obj/item/toy/crayon/C = W
to_chat(user, "You transfer [get_amount_transferred()] length\s of cable from one coil to the other.")
return ITEM_INTERACT_COMPLETE
if(istype(used, /obj/item/toy/crayon))
var/obj/item/toy/crayon/C = used
cable_color(C.dye_color)
return ITEM_INTERACT_COMPLETE
return ..()
///////////////////////////////////////////////
// Cable laying procedures
@@ -417,9 +426,11 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
cable_type = /obj/structure/cable/extra_insulated/pre_connect
icon = 'icons/obj/cable_coils/heavy_duty_connected.dmi'
/obj/item/stack/cable_coil/extra_insulated/attackby__legacy__attackchain(obj/item/I, mob/living/user)
if(I.GetID())
/obj/item/stack/cable_coil/extra_insulated/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(used.GetID())
toggle_connection(user)
return ITEM_INTERACT_COMPLETE
return ..()
/obj/item/stack/cable_coil/cut
+4 -1
View File
@@ -31,10 +31,13 @@
. = ..()
scatter_atom()
/obj/item/stack/ore/bluespace_crystal/attack_self__legacy__attackchain(mob/user)
/obj/item/stack/ore/bluespace_crystal/activate_self(mob/user)
if(use(1))
blink_mob(user)
user.visible_message(SPAN_NOTICE("[user] crushes a [singular_name]!"))
return ITEM_INTERACT_COMPLETE
return ..()
/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
if(!is_teleport_allowed(L.z))