Files
Paradise/code/modules/recycling/belt-placer.dm
T
warriorstar-orionandGitHub 525c68d617 Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup.

* migrate curtain to make dreamchecker happy

* update thurible

* don't call attacked_by separately for legacy attack chain

* remove duplicate proc

* condense similar code, put allowances for legacy code in new procs

* update docs, include diagram source

* add comment on how to update diagram

* fix admonition

* mindflayer updates

* remove commented out code

* clarify all steps

* after_attack should be overridable

* whoops

* retrofit recent changes

* duh, can't restrict this yet because of tool_acts

* i hate ore bags with the fire of a thousand suns

* return correct value for object attack logic

* Various cleanups.

We don't want to attempt to pull stuff out of `/obj/item/attackby`,
because those pieces are part of the related objects' migrations, not
`/obj/item` itself. Attempting to do this causes knockon effects where
things expected to call e.g. `/obj/item/storage/attackby` in the call
chain were not ferried over to the new item interaction code, because
the related objects hadn't actually been migrated over yet.

I've used refactoring /obj/vehicle as the example for migrating
`attackby` methods instead.

* simplify some argument names

* fuck it

* make it do the thing

* Rename CI module call

* Prove that CI works

* improve test output

* aaand fix it again

* fix curtain tool interactions

* fix compile error

* fix compile error

* Better docs, introduce migration plan tool.
2024-12-02 23:36:36 +00:00

48 lines
1.8 KiB
Plaintext

/// Stores conveyor belts, click floor to make belt, use a conveyor switch on this to link all belts to that lever.
/obj/item/storage/conveyor
name = "conveyor belt placer"
desc = "This device facilitates the rapid deployment of conveyor belts."
icon_state = "belt_placer"
item_state = "belt_placer"
w_class = WEIGHT_CLASS_BULKY //Because belts are large things, you know?
can_hold = list(/obj/item/conveyor_construct)
flags = CONDUCT
max_w_class = WEIGHT_CLASS_BULKY
max_combined_w_class = 28 //7 belts
allow_quick_gather = TRUE
allow_quick_empty = TRUE
display_contents_with_number = TRUE
use_to_pickup = TRUE
origin_tech = "engineering=1"
/obj/item/storage/conveyor/bluespace
name = "bluespace conveyor belt placer"
desc = "This device facilitates the rapid deployment of conveyor belts. It utilises bluespace in order to hold many more belts than its regular counterpart."
icon_state = "bluespace_belt_placer"
item_state = "bluespace_belt_placer"
w_class = WEIGHT_CLASS_NORMAL
storage_slots = 50
max_combined_w_class = 200 //50 belts
origin_tech = "engineering=2;bluespace=1"
/obj/item/storage/conveyor/attackby__legacy__attackchain(obj/item/I, mob/user, params) //So we can link belts en masse
if(istype(I, /obj/item/conveyor_switch_construct))
var/obj/item/conveyor_switch_construct/S = I
var/linked = FALSE //For nice message
for(var/obj/item/conveyor_construct/C in src)
C.id = S.id
linked = TRUE
if(linked)
to_chat(user, "<span class='notice'>All belts in [src] linked with [S].</span>")
else
return ..()
/obj/item/storage/conveyor/afterattack__legacy__attackchain(atom/A, mob/user, proximity)
if(!proximity)
return
var/obj/item/conveyor_construct/C = locate() in src
if(!C)
to_chat(user, "<span class='notice'>There are no belts in [src].</span>")
else
C.afterattack__legacy__attackchain(A, user, proximity)