Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
+12 -23
View File
@@ -116,32 +116,21 @@
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/crowbar))
user.visible_message("<span class='notice'>[user] struggles to pry up \the [src] with \the [I].</span>", \
"<span class='notice'>You struggle to pry up \the [src] with \the [I].</span>")
if(do_after(user, 40*I.toolspeed, target = src))
if(qdeleted(src))
return //prevent multiple decontructs
if(!(stat & BROKEN))
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
user << "<span class='notice'>You remove the conveyor belt.</span>"
qdel(src)
if(!(stat & BROKEN))
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
user << "<span class='notice'>You remove the conveyor belt.</span>"
qdel(src)
else if(istype(I, /obj/item/weapon/wrench))
if(!(stat & BROKEN))
playsound(loc, I.usesound, 50, 1)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
setDir(turn(dir,-45))
update_move_direction()
user << "<span class='notice'>You rotate [src].</span>"
else if(istype(I, /obj/item/weapon/screwdriver))
if(!(stat & BROKEN))
verted = verted * -1
update_move_direction()
user << "<span class='notice'>You reverse [src]'s direction.</span>"
else if(user.a_intent != INTENT_HARM)
else if(user.a_intent != "harm")
if(user.drop_item())
I.loc = src.loc
else
@@ -297,7 +286,7 @@
icon_state = "conveyor0"
name = "conveyor belt assembly"
desc = "A conveyor belt assembly."
w_class = WEIGHT_CLASS_BULKY
w_class = 4
var/id = "" //inherited by the belt
/obj/item/conveyor_construct/attackby(obj/item/I, mob/user, params)
@@ -308,7 +297,7 @@
id = C.id
/obj/item/conveyor_construct/afterattack(atom/A, mob/user, proximity)
if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle))
if(!proximity || user.stat || !istype(A, /turf/open/floor) || istype(A, /area/shuttle))
return
var/cdir = get_dir(A, user)
if(A == user.loc)
@@ -324,7 +313,7 @@
desc = "A conveyor control switch assembly."
icon = 'icons/obj/recycling.dmi'
icon_state = "switch-off"
w_class = WEIGHT_CLASS_BULKY
w_class = 4
var/id = "" //inherited by the switch
/obj/item/conveyor_switch_construct/New()
@@ -332,7 +321,7 @@
id = rand() //this couldn't possibly go wrong
/obj/item/conveyor_switch_construct/afterattack(atom/A, mob/user, proximity)
if(!proximity || user.stat || !isfloorturf(A) || istype(A, /area/shuttle))
if(!proximity || user.stat || !istype(A, /turf/open/floor) || istype(A, /area/shuttle))
return
var/found = 0
for(var/obj/machinery/conveyor/C in view())
@@ -11,8 +11,6 @@
density = 0
pressure_resistance = 5*ONE_ATMOSPHERE
level = 2
obj_integrity = 200
max_integrity = 200
var/ptype = 0
var/dpdir = 0 // directions as disposalpipe
@@ -184,11 +182,11 @@
nicetype = "pipe"
var/turf/T = loc
if(T.intact && isfloorturf(T))
if(T.intact && istype(T, /turf/open/floor))
user << "<span class='warning'>You can only attach the [nicetype] if the floor plating is removed!</span>"
return
if(!ispipe && iswallturf(T))
if(!ispipe && istype(T, /turf/closed/wall))
user << "<span class='warning'>You can't build [nicetype]s on walls, only disposal pipes!</span>"
return
@@ -224,7 +222,7 @@
level = 1 // We don't want disposal bins to disappear under the floors
density = 0
user << "<span class='notice'>You attach the [nicetype] to the underfloor.</span>"
playsound(loc, I.usesound, 100, 1)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
update_icon()
else if(istype(I, /obj/item/weapon/weldingtool))
@@ -233,7 +231,7 @@
if(W.remove_fuel(0,user))
playsound(loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start welding the [nicetype] in place...</span>"
if(do_after(user, 20*I.toolspeed, target = src))
if(do_after(user, 20/I.toolspeed, target = src))
if(!loc || !W.isOn())
return
user << "<span class='notice'>The [nicetype] has been welded in place.</span>"
+110 -53
View File
@@ -6,7 +6,6 @@
/obj/structure/disposalholder
invisibility = INVISIBILITY_MAXIMUM
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/datum/gas_mixture/gas = null // gas used to flush, will appear at exit point
var/active = 0 // true if the holder is moving, otherwise inactive
dir = 0
@@ -124,9 +123,6 @@
/obj/structure/disposalholder/allow_drop()
return 1
/obj/structure/disposalholder/ex_act(severity, target)
return
// Disposal pipes
/obj/structure/disposalpipe
@@ -139,9 +135,7 @@
level = 1 // underfloor only
var/dpdir = 0 // bitmask of pipe directions
dir = 0// dir will contain dominant direction for junction pipes
obj_integrity = 200
max_integrity = 200
armor = list(melee = 25, bullet = 10, laser = 10, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 90, acid = 30)
var/health = 10 // health points 0-10
layer = DISPOSAL_PIPE_LAYER // slightly lower than wires and other pipes
var/base_icon_state // initial icon state on map
var/obj/structure/disposalconstruct/stored
@@ -184,9 +178,22 @@
/obj/structure/disposalpipe/Destroy()
var/obj/structure/disposalholder/H = locate() in src
if(H)
// holder was present
H.active = 0
var/turf/T = src.loc
expel(H, T, 0)
if(T.density)
// deleting pipe is inside a dense turf (wall)
// this is unlikely, but just dump out everything into the turf in case
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(0)
qdel(H)
return ..()
// otherwise, do normal expel from turf
else
expel(H, T, 0)
return ..()
// returns the direction of the next pipe object, given the entrance dir
@@ -221,7 +228,7 @@
// update the icon_state to reflect hidden status
/obj/structure/disposalpipe/proc/update()
var/turf/T = src.loc
hide(T.intact && !isspaceturf(T)) // space never hides pipes
hide(T.intact && !istype(T,/turf/open/space)) // space never hides pipes
// hide called by levelupdate if turf intact status changes
// change visibility status and force update of icon
@@ -248,47 +255,104 @@
/obj/structure/disposalpipe/proc/expel(obj/structure/disposalholder/H, turf/T, direction)
var/turf/target
var/eject_range = 5
var/turf/open/floor/floorturf
if(isfloorturf(T)) //intact floor, pop the tile
floorturf = T
if(floorturf.floor_tile)
PoolOrNew(floorturf.floor_tile, T)
floorturf.make_plating()
if(istype(T, /turf/open/floor)) //intact floor, pop the tile
var/turf/open/floor/myturf = T
if(myturf.builtin_tile)
myturf.builtin_tile.loc = T
myturf.builtin_tile = null
myturf.make_plating()
if(direction) // direction is specified
if(isspaceturf(T)) // if ended in space, then range is unlimited
if(istype(T, /turf/open/space)) // if ended in space, then range is unlimited
target = get_edge_target_turf(T, direction)
else // otherwise limit to 10 tiles
target = get_ranged_target_turf(T, direction, 10)
eject_range = 10
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
if(H)
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(direction)
AM.throw_at_fast(target, 10, 1)
else if(floorturf)
target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5))
else // no specified direction, so throw in random direction
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(direction)
if(target)
AM.throw_at_fast(target, eject_range, 1)
playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0)
if(H)
for(var/atom/movable/AM in H)
target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5))
AM.forceMove(src.loc)
AM.pipe_eject(0)
AM.throw_at_fast(target, 5, 1)
H.vent_gas(T)
qdel(H)
return
// call to break the pipe
// will expel any holder inside at the time
// then delete the pipe
// remains : set to leave broken pipe pieces in place
/obj/structure/disposalpipe/proc/broken(remains = 0)
if(remains)
for(var/D in cardinal)
if(D & dpdir)
var/obj/structure/disposalpipe/broken/P = new(src.loc)
P.setDir(D)
src.invisibility = INVISIBILITY_MAXIMUM // make invisible (since we won't delete the pipe immediately)
var/obj/structure/disposalholder/H = locate() in src
if(H)
// holder was present
H.active = 0
var/turf/T = src.loc
if(T.density)
// broken pipe is inside a dense turf (wall)
// this is unlikely, but just dump out everything into the turf in case
for(var/atom/movable/AM in H)
AM.forceMove(src.loc)
AM.pipe_eject(0)
qdel(H)
return
// otherwise, do normal expel from turf
if(H)
expel(H, T, 0)
spawn(2) // delete pipe after 2 ticks to ensure expel proc finished
qdel(src)
// pipe affected by explosion
/obj/structure/disposalpipe/contents_explosion(severity, target)
/obj/structure/disposalpipe/ex_act(severity, target)
//pass on ex_act to our contents before calling it on ourself
var/obj/structure/disposalholder/H = locate() in src
if(H)
H.contents_explosion(severity, target)
switch(severity)
if(1)
broken(0)
return
if(2)
health -= rand(5,15)
healthcheck()
return
if(3)
health -= rand(0,15)
healthcheck()
return
/obj/structure/disposalpipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 10)
return 0
. = ..()
// test health for brokenness
/obj/structure/disposalpipe/proc/healthcheck()
if(health < -2)
broken(0)
else if(health<1)
broken(1)
return
//attack by item
//weldingtool: unfasten and convert to obj/disposalconstruct
@@ -307,7 +371,7 @@
// check if anything changed over 2 seconds
if(do_after(user,30, target = src))
if(!src || !W.isOn()) return
deconstruct()
Deconstruct()
user << "<span class='notice'>You slice the disposal pipe.</span>"
else
return ..()
@@ -317,28 +381,20 @@
. = 1
// called when pipe is cut with welder
/obj/structure/disposalpipe/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(disassembled)
if(stored)
var/turf/T = loc
stored.loc = T
transfer_fingerprints_to(stored)
stored.setDir(dir)
stored.density = 0
stored.anchored = 1
stored.update_icon()
else
for(var/D in cardinal)
if(D & dpdir)
var/obj/structure/disposalpipe/broken/P = new(src.loc)
P.setDir(D)
qdel(src)
/obj/structure/disposalpipe/Deconstruct()
if(stored)
var/turf/T = loc
stored.loc = T
transfer_fingerprints_to(stored)
stored.setDir(dir)
stored.density = 0
stored.anchored = 1
stored.update_icon()
..()
/obj/structure/disposalpipe/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
deconstruct()
Deconstruct()
// *** TEST verb
//client/verb/dispstop()
@@ -624,10 +680,11 @@
/obj/structure/disposalpipe/broken/New()
..()
update()
return
// the disposal outlet machine
/obj/structure/disposalpipe/broken/deconstruct()
/obj/structure/disposalpipe/broken/Deconstruct()
qdel(src)
/obj/structure/disposaloutlet
@@ -706,7 +763,7 @@
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start slicing the floorweld off \the [src]...</span>"
if(do_after(user,20*I.toolspeed, target = src))
if(do_after(user,20/I.toolspeed, target = src))
if(!src || !W.isOn()) return
user << "<span class='notice'>You slice the floorweld off \the [src].</span>"
stored.loc = loc
+171 -118
View File
@@ -8,12 +8,8 @@
anchored = 1
density = 1
on_blueprints = TRUE
armor = list(melee = 25, bullet = 10, laser = 10, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 90, acid = 30)
obj_integrity = 200
max_integrity = 200
resistance_flags = FIRE_PROOF
var/datum/gas_mixture/air_contents // internal reservoir
var/mode = PRESSURE_ON
var/mode = 1 // mode -1=screws removed 0=off 1=charging 2=charged
var/flush = 0 // true if flush handle is pulled
var/obj/structure/disposalpipe/trunk/trunk = null // the attached pipe trunk
var/flushing = 0 // true if flushing in progress
@@ -41,14 +37,14 @@
update_icon()
/obj/machinery/disposal/proc/trunk_check()
trunk = locate() in loc
trunk = locate() in src.loc
if(!trunk)
mode = PRESSURE_OFF
mode = 0
flush = 0
else
mode = PRESSURE_ON
mode = initial(mode)
flush = initial(flush)
trunk.linked = src // link the pipe trunk to self
trunk.linked = src // link the pipe trunk to self
/obj/machinery/disposal/Destroy()
eject()
@@ -58,10 +54,10 @@
/obj/machinery/disposal/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
deconstruct()
Deconstruct()
/obj/machinery/disposal/initialize()
//this will get a copy of the air turf and take a SEND PRESSURE amount of air from it
// this will get a copy of the air turf and take a SEND PRESSURE amount of air from it
var/atom/L = loc
var/datum/gas_mixture/env = new
env.copy_from(L.return_air())
@@ -71,28 +67,34 @@
/obj/machinery/disposal/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(mode != PRESSURE_ON && mode != PRESSURE_MAXED && !flush)
if(mode<=0)
if(istype(I, /obj/item/weapon/screwdriver))
if(mode == PRESSURE_OFF)
mode = SCREWS_OUT
if(contents.len > 0)
user << "<span class='notice'>Eject the items first!</span>"
return
if(mode==0)
mode=-1
else
mode = PRESSURE_OFF
playsound(src.loc, I.usesound, 50, 1)
user << "<span class='notice'>You [mode == SCREWS_OUT ? "remove":"attach"] the screws around the power connection.</span>"
mode=0
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You [mode==0?"attach":"remove"] the screws around the power connection.</span>"
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode == SCREWS_OUT)
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
if(contents.len > 0)
user << "<span class='notice'>Eject the items first!</span>"
return
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "<span class='notice'>You start slicing the floorweld off \the [src]...</span>"
if(do_after(user,20*I.toolspeed, target = src) && mode == SCREWS_OUT)
if(do_after(user,20/I.toolspeed, target = src))
if(!W.isOn())
return
user << "<span class='notice'>You slice the floorweld off \the [src].</span>"
deconstruct()
Deconstruct()
return
if(user.a_intent != INTENT_HARM)
if(user.a_intent != "harm")
if(!user.drop_item() || (I.flags & ABSTRACT))
return
place_item_in_disposal(I, user)
@@ -102,10 +104,13 @@
return ..()
/obj/machinery/disposal/proc/place_item_in_disposal(obj/item/I, mob/user)
I.forceMove(src)
user.visible_message("[user.name] places \the [I] into \the [src].", "<span class='notice'>You place \the [I] into \the [src].</span>")
I.loc = src
user.visible_message("[user.name] places \the [I] into \the [src].", \
"<span class='notice'>You place \the [I] into \the [src].</span>")
// mouse drop another mob or self
//mouse drop another mob or self
/obj/machinery/disposal/MouseDrop_T(mob/living/target, mob/living/user)
if(istype(target))
stuff_mob_in(target, user)
@@ -113,7 +118,7 @@
/obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user)
if(!iscarbon(user) && !user.ventcrawler) //only carbon and ventcrawlers can climb into disposal by themselves.
return
if(!isturf(user.loc)) //No magically doing it from inside closets
if(!istype(user.loc, /turf/)) //No magically doing it from inside closets
return
if(target.buckled || target.has_buckled_mobs())
return
@@ -122,37 +127,50 @@
return
add_fingerprint(user)
if(user == target)
user.visible_message("[user] starts climbing into [src].", "<span class='notice'>You start climbing into [src]...</span>")
user.visible_message("[user] starts climbing into [src].", \
"<span class='notice'>You start climbing into [src]...</span>")
else
target.visible_message("<span class='danger'>[user] starts putting [target] into [src].</span>", "<span class='userdanger'>[user] starts putting you into [src]!</span>")
target.visible_message("<span class='danger'>[user] starts putting [target] into [src].</span>", \
"<span class='userdanger'>[user] starts putting you into [src]!</span>")
if(do_mob(user, target, 20))
if (!loc)
return
target.forceMove(src)
if(user == target)
user.visible_message("[user] climbs into [src].", "<span class='notice'>You climb into [src].</span>")
user.visible_message("[user] climbs into [src].", \
"<span class='notice'>You climb into [src].</span>")
else
target.visible_message("<span class='danger'>[user] has placed [target] in [src].</span>", "<span class='userdanger'>[user] has placed [target] in [src].</span>")
target.visible_message("<span class='danger'>[user] has placed [target] in [src].</span>", \
"<span class='userdanger'>[user] has placed [target] in [src].</span>")
add_logs(user, target, "stuffed", addition="into [src]")
target.LAssailant = user
update_icon()
// can breath normally in the disposal
/obj/machinery/disposal/alter_health()
return get_turf(src)
/obj/machinery/disposal/relaymove(mob/user)
attempt_escape(user)
// resist to escape the bin
/obj/machinery/disposal/container_resist(mob/living/user)
attempt_escape(user)
/obj/machinery/disposal/container_resist()
attempt_escape(usr)
/obj/machinery/disposal/proc/attempt_escape(mob/user)
if(flushing)
if(src.flushing)
return
go_out(user)
return
// leave the disposal
/obj/machinery/disposal/proc/go_out(mob/user)
user.forceMove(loc)
user.loc = src.loc
user.reset_perspective(null)
update_icon()
return
// monkeys and xenos can only pull the flush lever
/obj/machinery/disposal/attack_paw(mob/user)
@@ -170,8 +188,21 @@
if(user && user.loc == src)
usr << "<span class='warning'>You cannot reach the controls from inside!</span>"
return
/*
if(mode==-1)
usr << "\red The disposal units power is disabled."
return
*/
interact(user, 0)
// hostile mob escape from disposals
/obj/machinery/disposal/attack_animal(mob/living/simple_animal/M)
if(M.environment_smash)
M.do_attack_animation(src)
visible_message("<span class='danger'>[M.name] smashes \the [src] apart!</span>")
qdel(src)
return
// eject the contents of the disposal unit
/obj/machinery/disposal/proc/eject()
var/turf/T = get_turf(src)
@@ -214,6 +245,8 @@
/obj/machinery/disposal/power_change()
..() // do default setting/reset of stat NOPOWER bit
update_icon() // update icon
return
// called when holder is expelled from a disposal
// should usually only occur if the pipe network is modified
@@ -232,17 +265,14 @@
H.vent_gas(loc)
qdel(H)
/obj/machinery/disposal/deconstruct(disassembled = TRUE)
var/turf/T = loc
if(!(flags & NODECONSTRUCT))
if(stored)
stored.forceMove(T)
src.transfer_fingerprints_to(stored)
stored.anchored = 0
stored.density = 1
stored.update_icon()
for(var/atom/movable/AM in src) //out, out, darned crowbar!
AM.forceMove(T)
/obj/machinery/disposal/Deconstruct()
if(stored)
var/turf/T = loc
stored.loc = T
src.transfer_fingerprints_to(stored)
stored.anchored = 0
stored.density = 1
stored.update_icon()
..()
//How disposal handles getting a storage dump from a storage object
@@ -254,6 +284,7 @@
src_object.remove_from_storage(I, src)
return 1
// Disposal bin
// Holds items for disposal into pipe system
// Draws air from turf, gradually charges internal reservoir
@@ -266,7 +297,7 @@
desc = "A pneumatic waste disposal unit."
icon_state = "disposal"
// attack by item places it in to disposal
// attack by item places it in to disposal
/obj/machinery/disposal/bin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/storage/bag/trash))
var/obj/item/weapon/storage/bag/trash/T = I
@@ -278,55 +309,73 @@
else
return ..()
// user interaction
/obj/machinery/disposal/bin/interact(mob/user, ai=0)
src.add_fingerprint(user)
if(stat & BROKEN)
user.unset_machine()
return
var/dat = "<head><title>Waste Disposal Unit</title></head><body><TT><B>Waste Disposal Unit</B><HR>"
if(!ai) // AI can't pull flush handle
if(flush)
dat += "Disposal handle: <A href='?src=\ref[src];handle=0'>Disengage</A> <B>Engaged</B>"
else
dat += "Disposal handle: <B>Disengaged</B> <A href='?src=\ref[src];handle=1'>Engage</A>"
dat += "<BR><HR><A href='?src=\ref[src];eject=1'>Eject contents</A><HR>"
if(mode <= 0)
dat += "Pump: <B>Off</B> <A href='?src=\ref[src];pump=1'>On</A><BR>"
else if(mode == 1)
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (pressurizing)<BR>"
else
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (idle)<BR>"
var/per = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
dat += "Pressure: [round(per, 1)]%<BR></body>"
user.set_machine(src)
user << browse(dat, "window=disposal;size=360x170")
onclose(user, "disposal")
// handle machine interaction
/obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
if(stat & BROKEN)
return
if(user.loc == src)
user << "<span class='warning'>You cannot reach the controls from inside!</span>"
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "disposal_unit", name, 300, 200, master_ui, state)
ui.open()
/obj/machinery/disposal/bin/ui_data(mob/user)
var/list/data = list()
data["flush"] = flush
data["mode"] = mode
var/per = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100)
data["per"] = round(per, 1)
data["isai"] = isAI(user)
return data
/obj/machinery/disposal/bin/ui_act(action, params)
/obj/machinery/disposal/bin/Topic(href, href_list)
if(..())
return
switch(action)
if("handle-0")
flush = 0
update_icon()
. = TRUE
if("handle-1")
if(mode != SCREWS_OUT)
flush = 1
update_icon()
. = TRUE
if("pump-0")
if(mode == PRESSURE_ON)
mode = PRESSURE_OFF
update_icon()
. = TRUE
if("pump-1")
if(mode == PRESSURE_OFF)
mode = PRESSURE_ON
update_icon()
. = TRUE
if("eject")
eject()
. = TRUE
if(usr.loc == src)
usr << "<span class='warning'>You cannot reach the controls from inside!</span>"
return
if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
usr << "<span class='danger'>\The [src]'s power is disabled.</span>"
return
..()
usr.set_machine(src)
if(href_list["close"])
usr.unset_machine()
usr << browse(null, "window=disposal")
return
if(href_list["pump"])
if(text2num(href_list["pump"]))
mode = 1
else
mode = 0
update_icon()
if(href_list["handle"])
flush = text2num(href_list["handle"])
update_icon()
if(href_list["eject"])
eject()
return
/obj/machinery/disposal/bin/CanPass(atom/movable/mover, turf/target, height=0)
if (istype(mover,/obj/item) && mover.throwing)
@@ -345,67 +394,69 @@
/obj/machinery/disposal/bin/flush()
..()
if(mode == PRESSURE_MAXED)
mode = PRESSURE_ON
if(mode == 2)
mode = 1
update_icon()
/obj/machinery/disposal/bin/update_icon()
cut_overlays()
if(stat & BROKEN)
mode = PRESSURE_OFF
mode = 0
flush = 0
return
//flush handle
// flush handle
if(flush)
add_overlay(image('icons/obj/atmospherics/pipes/disposal.dmi', "dispover-handle"))
//only handle is shown if no power
if(stat & NOPOWER || mode == SCREWS_OUT)
// only handle is shown if no power
if(stat & NOPOWER || mode == -1)
return
//check for items in disposal - occupied light
// check for items in disposal - occupied light
if(contents.len > 0)
add_overlay(image('icons/obj/atmospherics/pipes/disposal.dmi', "dispover-full"))
//charging and ready light
if(mode == PRESSURE_ON)
// charging and ready light
if(mode == 1)
add_overlay(image('icons/obj/atmospherics/pipes/disposal.dmi', "dispover-charge"))
else if(mode == PRESSURE_MAXED)
else if(mode == 2)
add_overlay(image('icons/obj/atmospherics/pipes/disposal.dmi', "dispover-ready"))
//timed process
//charge the gas reservoir and perform flush if ready
// timed process
// charge the gas reservoir and perform flush if ready
/obj/machinery/disposal/bin/process()
if(stat & BROKEN) //nothing can happen if broken
if(stat & BROKEN) // nothing can happen if broken
return
flush_count++
if(flush_count >= flush_every_ticks)
if(contents.len)
if(mode == PRESSURE_MAXED)
if( flush_count >= flush_every_ticks )
if( contents.len )
if(mode == 2)
spawn(0)
feedback_inc("disposal_auto_flush",1)
flush()
flush_count = 0
updateDialog()
src.updateDialog()
if(flush && air_contents.return_pressure() >= SEND_PRESSURE) // flush can happen even without power
addtimer(src, "flush", 0)
if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power
spawn(0)
flush()
if(stat & NOPOWER) // won't charge if no power
if(stat & NOPOWER) // won't charge if no power
return
use_power(100) // base power usage
use_power(100) // base power usage
if(mode != PRESSURE_ON) // if off or ready, no need to charge
if(mode != 1) // if off or ready, no need to charge
return
// otherwise charge
use_power(500) // charging power usage
use_power(500) // charging power usage
var/atom/L = loc //recharging from loc turf
var/atom/L = loc // recharging from loc turf
var/datum/gas_mixture/env = L.return_air()
var/pressure_delta = (SEND_PRESSURE*1.01) - air_contents.return_pressure()
@@ -419,9 +470,9 @@
air_update_turf()
//if full enough, switch to ready mode
// if full enough, switch to ready mode
if(air_contents.return_pressure() >= SEND_PRESSURE)
mode = PRESSURE_MAXED
mode = 2
update_icon()
return
@@ -429,6 +480,7 @@
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
//Delivery Chute
/obj/machinery/disposal/deliveryChute
@@ -436,7 +488,7 @@
desc = "A chute for big and small packages alike!"
density = 1
icon_state = "intake"
mode = PRESSURE_OFF // the chute doesn't need charging and always works
mode = 0 // the chute doesn't need charging and always works
/obj/machinery/disposal/deliveryChute/New(loc,var/obj/structure/disposalconstruct/make_from)
..()
@@ -464,7 +516,7 @@
if(WEST)
if(AM.loc.x != loc.x-1) return
if(isobj(AM))
if(istype(AM, /obj))
var/obj/O = AM
O.loc = src
else if(istype(AM, /mob))
@@ -489,3 +541,4 @@
/obj/machinery/disposal/deliveryChute/newHolderDestination(obj/structure/disposalholder/H)
H.destinationTag = 1
+3 -10
View File
@@ -15,13 +15,9 @@
/obj/structure/bigDelivery/Destroy()
var/turf/T = get_turf(src)
for(var/atom/movable/AM in contents)
AM.forceMove(T)
AM.loc = T
return ..()
/obj/structure/bigDelivery/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act()
/obj/structure/bigDelivery/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
@@ -58,7 +54,7 @@
return
user << "<span class='notice'>You lean on the back of [O] and start pushing to rip the wrapping around it.</span>"
if(do_after(user, 50, target = O))
if(!user || user.stat != CONSCIOUS || user.loc != O || O.loc != src )
if(!user || user.stat != CONSCIOUS || user.loc != src || O.loc != src )
return
user << "<span class='notice'>You successfully removed [O]'s wrapping !</span>"
O.loc = loc
@@ -78,9 +74,6 @@
var/giftwrapped = 0
var/sortTag = 0
/obj/item/smallDelivery/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
AM.ex_act()
/obj/item/smallDelivery/attack_self(mob/user)
user.unEquip(src)
@@ -143,7 +136,7 @@
//If you don't want to fuck up disposals, add to this list, and don't change the order.
//If you insist on changing the order, you'll have to change every sort junction to reflect the new order. --Pete
w_class = WEIGHT_CLASS_TINY
w_class = 1
item_state = "electronic"
flags = CONDUCT
slot_flags = SLOT_BELT