mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-31 12:41:46 +00:00
* 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.
57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
#define FABRIC_PER_SHEET 4
|
|
|
|
|
|
///This is a loom. It's usually made out of wood and used to weave fabric like durathread or cotton into their respective cloth types.
|
|
/obj/structure/loom
|
|
name = "loom"
|
|
desc = "A simple device used to weave cloth and other thread-based fabrics together into usable material."
|
|
icon = 'icons/obj/hydroponics/equipment.dmi'
|
|
icon_state = "loom"
|
|
density = TRUE
|
|
anchored = TRUE
|
|
|
|
/obj/structure/loom/attackby__legacy__attackchain(obj/item/I, mob/user)
|
|
if(weave(I, user))
|
|
return
|
|
return ..()
|
|
|
|
/obj/structure/loom/crowbar_act(mob/user, obj/item/I)
|
|
. = TRUE
|
|
if(!I.use_tool(src, user, 0))
|
|
return
|
|
TOOL_ATTEMPT_DISMANTLE_MESSAGE
|
|
if(I.use_tool(src, user, 50, volume = I.tool_volume))
|
|
TOOL_DISMANTLE_SUCCESS_MESSAGE
|
|
deconstruct(disassembled = TRUE)
|
|
|
|
/obj/structure/loom/wrench_act(mob/user, obj/item/I)
|
|
. = TRUE
|
|
default_unfasten_wrench(user, I, time = 20)
|
|
|
|
/obj/structure/loom/deconstruct(disassembled = FALSE)
|
|
var/mat_drop = 5
|
|
if(disassembled)
|
|
mat_drop = 10
|
|
new /obj/item/stack/sheet/wood(drop_location(), mat_drop)
|
|
..()
|
|
|
|
///Handles the weaving.
|
|
/obj/structure/loom/proc/weave(obj/item/stack/sheet/cotton/W, mob/user)
|
|
if(!istype(W))
|
|
return FALSE
|
|
if(!anchored)
|
|
user.show_message("<span class='notice'>The loom needs to be wrenched down.</span>", 1)
|
|
return FALSE
|
|
if(W.amount < FABRIC_PER_SHEET)
|
|
user.show_message("<span class='notice'>You need at least [FABRIC_PER_SHEET] units of fabric before using this.</span>", 1)
|
|
return FALSE
|
|
user.show_message("<span class='notice'>You start weaving [W] through the loom...</span>", 1)
|
|
if(do_after(user, W.pull_effort, target = src))
|
|
if(W.amount >= FABRIC_PER_SHEET)
|
|
new W.loom_result(drop_location())
|
|
W.use(FABRIC_PER_SHEET)
|
|
user.show_message("<span class='notice'>You weave [W] into a workable fabric.</span>", 1)
|
|
return TRUE
|
|
|
|
#undef FABRIC_PER_SHEET
|