Merge pull request #10619 from Seris02/conveyor

conveyor updates
This commit is contained in:
Ghom
2020-01-21 03:37:42 +01:00
committed by GitHub
3 changed files with 54 additions and 43 deletions
+2 -8
View File
@@ -20,15 +20,9 @@
/datum/supply_pack/engineering/conveyor
name = "Conveyor Assembly Crate"
desc = "Keep production moving along with six conveyor belts. Conveyor switch included. If you have any questions, check out the enclosed instruction book."
desc = "Keep production moving along with fifteen conveyor belts. Conveyor switch included. If you have any questions, check out the enclosed instruction book."
cost = 750
contains = list(/obj/item/conveyor_construct,
/obj/item/conveyor_construct,
/obj/item/conveyor_construct,
/obj/item/conveyor_construct,
/obj/item/conveyor_construct,
/obj/item/conveyor_construct,
/obj/item/conveyor_switch_construct,
contains = list(/obj/item/stack/conveyor/fifteen,
/obj/item/paper/guides/conveyor)
crate_name = "conveyor assembly crate"
+49 -33
View File
@@ -149,8 +149,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
"<span class='notice'>You struggle to pry up \the [src] with \the [I].</span>")
if(I.use_tool(src, user, 40, volume=40))
if(!(stat & BROKEN))
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
var/obj/item/stack/conveyor/C = new /obj/item/stack/conveyor(loc, 1, TRUE, id)
transfer_fingerprints_to(C)
to_chat(user, "<span class='notice'>You remove the conveyor belt.</span>")
qdel(src)
@@ -326,37 +325,6 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
if((dir == NORTH) || (dir == WEST))
invert_icon = TRUE
//
// CONVEYOR CONSTRUCTION STARTS HERE
//
/obj/item/conveyor_construct
icon = 'icons/obj/recycling.dmi'
icon_state = "conveyor_construct"
name = "conveyor belt assembly"
desc = "A conveyor belt assembly."
w_class = WEIGHT_CLASS_BULKY
var/id = "" //inherited by the belt
/obj/item/conveyor_construct/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/conveyor_switch_construct))
to_chat(user, "<span class='notice'>You link the switch to the conveyor belt assembly.</span>")
var/obj/item/conveyor_switch_construct/C = I
id = C.id
/obj/item/conveyor_construct/afterattack(atom/A, mob/user, proximity)
. = ..()
if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle))
return
var/cdir = get_dir(A, user)
if(A == user.loc)
to_chat(user, "<span class='notice'>You cannot place a conveyor belt under yourself.</span>")
return
var/obj/machinery/conveyor/C = new/obj/machinery/conveyor(A, cdir, id)
transfer_fingerprints_to(C)
qdel(src)
/obj/item/conveyor_switch_construct
name = "conveyor switch assembly"
desc = "A conveyor control switch assembly."
@@ -369,6 +337,11 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
. = ..()
id = "[rand()]" //this couldn't possibly go wrong
/obj/item/conveyor_switch_construct/attack_self(mob/user)
for(var/obj/item/stack/conveyor/C in view())
C.id = id
to_chat(user, "<span class='notice'>You have linked all nearby conveyor belt assemblies to this switch.</span>")
/obj/item/conveyor_switch_construct/afterattack(atom/A, mob/user, proximity)
. = ..()
if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle))
@@ -385,6 +358,49 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
transfer_fingerprints_to(NC)
qdel(src)
/obj/item/stack/conveyor
name = "conveyor belt assembly"
desc = "A conveyor belt assembly."
icon = 'icons/obj/recycling.dmi'
icon_state = "conveyor_construct"
max_amount = 30
singular_name = "conveyor belt"
w_class = WEIGHT_CLASS_BULKY
///id for linking
var/id = ""
/obj/item/stack/conveyor/Initialize(mapload, new_amount, merge = TRUE, _id)
. = ..()
id = _id
/obj/item/stack/conveyor/afterattack(atom/A, mob/user, proximity)
. = ..()
if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle))
return
var/cdir = get_dir(A, user)
if(A == user.loc)
to_chat(user, "<span class='warning'>You cannot place a conveyor belt under yourself!</span>")
return
var/obj/machinery/conveyor/C = new/obj/machinery/conveyor(A, cdir, id)
transfer_fingerprints_to(C)
use(1)
/obj/item/stack/conveyor/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/conveyor_switch_construct))
to_chat(user, "<span class='notice'>You link the switch to the conveyor belt assembly.</span>")
var/obj/item/conveyor_switch_construct/C = I
id = C.id
/obj/item/stack/conveyor/update_weight()
return FALSE
/obj/item/stack/conveyor/thirty
amount = 30
/obj/item/stack/conveyor/fifteen
amount = 15
/obj/item/paper/guides/conveyor
name = "paper- 'Nano-it-up U-build series, #9: Build your very own conveyor belt, in SPACE'"
info = "<h1>Congratulations!</h1><p>You are now the proud owner of the best conveyor set available for space mail order! We at Nano-it-up know you love to prepare your own structures without wasting time, so we have devised a special streamlined assembly procedure that puts all other mail-order products to shame!</p><p>Firstly, you need to link the conveyor switch assembly to each of the conveyor belt assemblies. After doing so, you simply need to install the belt assemblies onto the floor, et voila, belt built. Our special Nano-it-up smart switch will detected any linked assemblies as far as the eye can see! This convenience, you can only have it when you Nano-it-up. Stay nano!</p>"
@@ -87,9 +87,10 @@
name = "Conveyor Belt"
id = "conveyor_belt"
build_type = AUTOLATHE
materials = list(MAT_METAL = 5000)
build_path = /obj/item/conveyor_construct
materials = list(MAT_METAL = 3000)
build_path = /obj/item/stack/conveyor
category = list("initial", "Construction")
maxstack = 30
/datum/design/conveyor_switch
name = "Conveyor Belt Switch"