Merge pull request #9993 from Ghommie/Ghommie-cit412

Ports tgstation loom changes, and durathred golems.
This commit is contained in:
kevinz000
2019-12-05 21:44:25 -07:00
committed by Archie
parent 0db5aed986
commit 5d80346f8f
13 changed files with 2177 additions and 2126 deletions
@@ -154,6 +154,9 @@
log_admin("[key_name(new_spawn)] possessed a golem shell enslaved to [key_name(owner)].")
if(ishuman(new_spawn))
var/mob/living/carbon/human/H = new_spawn
if(has_owner)
var/datum/species/golem/G = H.dna.species
G.owner = owner
H.set_cloned_appearance()
if(!name)
if(has_owner)
+13 -50
View File
@@ -1,5 +1,7 @@
//Loom, turns raw cotton and durathread into their respective fabrics.
#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."
@@ -9,73 +11,34 @@
anchored = TRUE
/obj/structure/loom/attackby(obj/item/I, mob/user)
if (user.a_intent != INTENT_HELP)
return ..()
if (istype(I, /obj/item/stack/sheet))
if (!anchored)
return to_chat(user, "<span class='notice'>You have to anchor [src] first!</span>")
var/obj/item/stack/sheet/W = I
if(W.is_fabric && W.amount > 1)
user.visible_message("<span class='notice'[user] starts weaving [W.name] through the loom.</span>",
"<span class='notice'>You start weaving the [W.name] through the loom.</span>")
if(W.use_tool(src, user, W.pull_effort))
new W.loom_result(drop_location())
to_chat(user, "<span class='notice'>You weave the [W.name] into a workable fabric.</span>")
W.amount = (W.amount - 2)
if(W.amount < 1)
qdel(W)
else if(W.is_fabric)
to_chat("<span class='notice'>You need at least 2 [W.name] to loom into fabric!</span>")
if(weave(I, user))
return
else
switch (I.tool_behaviour)
if (TOOL_SCREWDRIVER)
user.visible_message("<span class='info'>[user] starts disassembling [src]...</span>",
"<span class='info'>You start disassembling [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
deconstruct(TRUE)
return
if (TOOL_WRENCH)
if (anchored)
to_chat(user, "<span class='notice'>You unsecure the [src].</span>")
I.play_tool_sound(src)
anchored = FALSE
else
to_chat(user, "<span class='notice'>You secure the [src].</span>")
I.play_tool_sound(src)
anchored = TRUE
return
return ..()
/obj/structure/loom/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood (get_turf(src), 10)
qdel(src)
/obj/structure/loom/wrench_act(mob/living/user, obj/item/I)
..()
default_unfasten_wrench(user, I, 5)
return TRUE
/*///Handles the weaving.
///Handles the weaving.
/obj/structure/loom/proc/weave(obj/item/stack/sheet/S, mob/user)
if(!istype(S) || !S.is_fabric)
return FALSE
if(!anchored)
user.show_message("<span class='notice'>The loom needs to be wrenched down.</span>", MSG_VISUAL)
user.show_message("<span class='notice'>The loom needs to be wrenched down.</span>", 1)
return FALSE
if(S.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 \the [S.name] through the loom..</span>", MSG_VISUAL)
user.show_message("<span class='notice'>You start weaving \the [S.name] through the loom..</span>", 1)
if(S.use_tool(src, user, S.pull_effort))
if(S.amount >= FABRIC_PER_SHEET)
new S.loom_result(drop_location())
S.use(FABRIC_PER_SHEET)
user.show_message("<span class='notice'>You weave \the [S.name] into a workable fabric.</span>", MSG_VISUAL)
user.show_message("<span class='notice'>You weave \the [S.name] into a workable fabric.</span>", 1)
return TRUE
/obj/structure/loom/unanchored
anchored = FALSE
#undef FABRIC_PER_SHEET */
#undef FABRIC_PER_SHEET