everything but mob stuff
This commit is contained in:
@@ -5,12 +5,12 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
|
||||
/obj/machinery/conveyor
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "conveyor0"
|
||||
icon_state = "conveyor_map"
|
||||
name = "conveyor belt"
|
||||
desc = "A conveyor belt."
|
||||
anchored = TRUE
|
||||
layer = BELOW_OPEN_DOOR_LAYER
|
||||
var/operating = FALSE // 1 if running forward, -1 if backwards, 0 if off
|
||||
var/operating = 0 // 1 if running forward, -1 if backwards, 0 if off
|
||||
var/operable = 1 // true if can operate (no broken segments in this belt run)
|
||||
var/forwards // this is the default (forward) direction, set by the map dir
|
||||
var/backwards // hopefully self-explanatory
|
||||
@@ -18,13 +18,22 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
|
||||
var/list/affecting // the list of all items that will be moved this ptick
|
||||
var/id = "" // the control ID - must match controller ID
|
||||
var/verted = 1 // set to -1 to have the conveyour belt be inverted, so you can use the other corner icons
|
||||
var/verted = 1 // Inverts the direction the conveyor belt moves.
|
||||
speed_process = TRUE
|
||||
|
||||
/obj/machinery/conveyor/centcom_auto
|
||||
id = "round_end_belt"
|
||||
|
||||
|
||||
/obj/machinery/conveyor/inverted //Directions inverted so you can use different corner peices.
|
||||
icon_state = "conveyor_map_inverted"
|
||||
verted = -1
|
||||
|
||||
/obj/machinery/conveyor/inverted/Initialize(mapload)
|
||||
. = ..()
|
||||
if(mapload && !(dir in GLOB.diagonals))
|
||||
log_game("### MAPPING ERROR: [src] at [COORD(src)] spawned without using a diagonal dir. Please replace with a normal version.")
|
||||
|
||||
// Auto conveyour is always on unless unpowered
|
||||
|
||||
/obj/machinery/conveyor/auto/Initialize(mapload, newdir)
|
||||
@@ -214,7 +223,8 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
var/position = 0 // 0 off, -1 reverse, 1 forward
|
||||
var/last_pos = -1 // last direction setting
|
||||
var/operated = 1 // true if just operated
|
||||
var/convdir = 0 // 0 is two way switch, 1 and -1 means one way
|
||||
var/oneway = FALSE // if the switch only operates the conveyor belts in a single direction.
|
||||
var/invert_icon = FALSE // If the level points the opposite direction when it's turned on.
|
||||
|
||||
var/id = "" // must match conveyor IDs to control them
|
||||
|
||||
@@ -247,9 +257,15 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
|
||||
/obj/machinery/conveyor_switch/update_icon()
|
||||
if(position<0)
|
||||
icon_state = "switch-rev"
|
||||
if(invert_icon)
|
||||
icon_state = "switch-fwd"
|
||||
else
|
||||
icon_state = "switch-rev"
|
||||
else if(position>0)
|
||||
icon_state = "switch-fwd"
|
||||
if(invert_icon)
|
||||
icon_state = "switch-rev"
|
||||
else
|
||||
icon_state = "switch-fwd"
|
||||
else
|
||||
icon_state = "switch-off"
|
||||
|
||||
@@ -271,8 +287,8 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
/obj/machinery/conveyor_switch/interact(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(position == 0)
|
||||
if(convdir) //is it a oneway switch
|
||||
position = convdir
|
||||
if(oneway) //is it a oneway switch
|
||||
position = oneway
|
||||
else
|
||||
if(last_pos < 0)
|
||||
position = 1
|
||||
@@ -289,6 +305,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
|
||||
// find any switches with same id as this one, and set their positions to match us
|
||||
for(var/obj/machinery/conveyor_switch/S in GLOB.conveyors_by_id[id])
|
||||
S.invert_icon = invert_icon
|
||||
S.position = position
|
||||
S.update_icon()
|
||||
CHECK_TICK
|
||||
@@ -302,8 +319,14 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/conveyor_switch/oneway
|
||||
convdir = 1 //Set to 1 or -1 depending on which way you want the convayor to go. (In other words keep at 1 and set the proper dir on the belts.)
|
||||
icon_state = "conveyor_switch_oneway"
|
||||
desc = "A conveyor control switch. It appears to only go in one direction."
|
||||
oneway = TRUE
|
||||
|
||||
/obj/machinery/conveyor_switch/oneway/Initialize()
|
||||
. = ..()
|
||||
if((dir == NORTH) || (dir == WEST))
|
||||
invert_icon = TRUE
|
||||
|
||||
//
|
||||
// CONVEYOR CONSTRUCTION STARTS HERE
|
||||
|
||||
@@ -246,13 +246,16 @@
|
||||
return src
|
||||
|
||||
//How disposal handles getting a storage dump from a storage object
|
||||
/obj/machinery/disposal/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
/obj/machinery/disposal/storage_contents_dump_act(datum/component/storage/src_object, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
for(var/obj/item/I in src_object)
|
||||
if(user.s_active != src_object)
|
||||
if(user.active_storage != src_object)
|
||||
if(I.on_found(user))
|
||||
return
|
||||
src_object.remove_from_storage(I, src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
// Disposal bin
|
||||
// Holds items for disposal into pipe system
|
||||
@@ -268,11 +271,12 @@
|
||||
|
||||
// attack by item places it in to disposal
|
||||
/obj/machinery/disposal/bin/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/storage/bag/trash))
|
||||
if(istype(I, /obj/item/storage/bag/trash)) //Not doing component overrides because this is a specific type.
|
||||
var/obj/item/storage/bag/trash/T = I
|
||||
GET_COMPONENT_FROM(STR, /datum/component/storage, T)
|
||||
to_chat(user, "<span class='warning'>You empty the bag.</span>")
|
||||
for(var/obj/item/O in T.contents)
|
||||
T.remove_from_storage(O,src)
|
||||
STR.remove_from_storage(O,src)
|
||||
T.update_icon()
|
||||
update_icon()
|
||||
else
|
||||
@@ -281,7 +285,7 @@
|
||||
// handle machine interaction
|
||||
|
||||
/obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
Reference in New Issue
Block a user