mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user