mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-20 23:21:20 +00:00
Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into color
Conflicts: code/modules/power/cable.dm icons/obj/power_cond_red.dmi
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
if(!on || !network)
|
||||
return 0
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
|
||||
@@ -1130,7 +1130,7 @@ obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/u
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
user << "<span class='warning'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>"
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
@@ -1,49 +1,52 @@
|
||||
var/maxZ = 6
|
||||
var/minZ = 2
|
||||
|
||||
// Maybe it's best to have this hardcoded for whatever we'd add to the map, in order to avoid exploits
|
||||
// (such as mining base => admin station)
|
||||
// Note that this assumes the ship's top is at z=1 and bottom at z=4
|
||||
/obj/item/weapon/tank/jetpack/proc/move_z(cardinal, mob/user as mob)
|
||||
if (user.z > 1)
|
||||
user << "\red There is nothing of interest in that direction."
|
||||
return
|
||||
if(allow_thrust(0.01, user))
|
||||
switch(cardinal)
|
||||
if (UP) // Going up!
|
||||
if(user.z > maxZ) // If we aren't at the very top of the ship
|
||||
var/turf/T = locate(user.x, user.y, user.z - 1)
|
||||
// You can only jetpack up if there's space above, and you're sitting on either hull (on the exterior), or space
|
||||
//if(T && istype(T, /turf/space) && (istype(user.loc, /turf/space) || istype(user.loc, /turf/space/*/hull*/)))
|
||||
//check through turf contents to make sure there's nothing blocking the way
|
||||
if(T && istype(T, /turf/space))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(T.density)
|
||||
blocked = 1
|
||||
user << "\red You bump into [T.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
user.Move(T)
|
||||
else
|
||||
user << "\red You bump into the ship's plating."
|
||||
/obj/item/weapon/tank/jetpack/verb/moveup()
|
||||
set name = "Move Upwards"
|
||||
set category = "Object"
|
||||
if(allow_thrust(0.01, usr))
|
||||
var/turf/controllerlocation = locate(1, 1, usr.z)
|
||||
var/legal = 0
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
legal = controller.up
|
||||
if (controller.up)
|
||||
var/turf/T = locate(usr.x, usr.y, controller.up_target)
|
||||
if(T && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
usr << "\red You bump into [A.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
usr.Move(T)
|
||||
usr << "You move upwards."
|
||||
else
|
||||
user << "\red The ship's gravity well keeps you in orbit!" // Assuming the ship starts on z level 1, you don't want to go past it
|
||||
usr << "\red There is something in your way."
|
||||
if (legal == 0)
|
||||
usr << "There is nothing of interest in this direction."
|
||||
return 1
|
||||
|
||||
if (DOWN) // Going down!
|
||||
if (user.z < 1) // If we aren't at the very bottom of the ship, or out in space
|
||||
var/turf/T = locate(user.x, user.y, user.z + 1)
|
||||
// You can only jetpack down if you're sitting on space and there's space down below, or hull
|
||||
if(T && (istype(T, /turf/space) || istype(T, /turf/space/*/hull*/)) && istype(user.loc, /turf/space))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(T.density)
|
||||
blocked = 1
|
||||
user << "\red You bump into [T.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
user.Move(T)
|
||||
else
|
||||
user << "\red You bump into the ship's plating."
|
||||
/obj/item/weapon/tank/jetpack/verb/movedown()
|
||||
set name = "Move Downwards"
|
||||
set category = "Object"
|
||||
if(allow_thrust(0.01, usr))
|
||||
var/turf/controllerlocation = locate(1, 1, usr.z)
|
||||
var/legal = 0
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
legal = controller.down
|
||||
if (controller.down == 1)
|
||||
var/turf/T = locate(usr.x, usr.y, controller.down_target)
|
||||
var/turf/S = locate(usr.x, usr.y, usr.z)
|
||||
if(T && (istype(S, /turf/space) || istype(S, /turf/simulated/floor/open)))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
usr << "\red You bump into [A.name]."
|
||||
break
|
||||
if(!blocked)
|
||||
usr.Move(T)
|
||||
usr << "You move downwards."
|
||||
else
|
||||
user << "\red The ship's gravity well keeps you in orbit!"
|
||||
usr << "\red You cant move through the floor."
|
||||
if (legal == 0)
|
||||
usr << "There is nothing of interest in this direction."
|
||||
return 1
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
////////////////////////////
|
||||
// parent class for pipes //
|
||||
////////////////////////////
|
||||
obj/machinery/atmospherics/pipe/zpipe
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "up"
|
||||
|
||||
name = "upwards pipe"
|
||||
desc = "A pipe segment to connect upwards."
|
||||
|
||||
volume = 70
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
|
||||
var/obj/machinery/atmospherics/node1 //connection on the same Z
|
||||
var/obj/machinery/atmospherics/node2 //connection on the other Z
|
||||
|
||||
var/minimum_temperature_difference = 300
|
||||
var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No
|
||||
|
||||
var/maximum_pressure = 70*ONE_ATMOSPHERE
|
||||
var/fatigue_pressure = 55*ONE_ATMOSPHERE
|
||||
alert_pressure = 55*ONE_ATMOSPHERE
|
||||
|
||||
|
||||
level = 1
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/New()
|
||||
..()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions = SOUTH
|
||||
if(NORTH)
|
||||
initialize_directions = NORTH
|
||||
if(WEST)
|
||||
initialize_directions = WEST
|
||||
if(EAST)
|
||||
initialize_directions = EAST
|
||||
if(NORTHEAST)
|
||||
initialize_directions = NORTH
|
||||
if(NORTHWEST)
|
||||
initialize_directions = WEST
|
||||
if(SOUTHEAST)
|
||||
initialize_directions = EAST
|
||||
if(SOUTHWEST)
|
||||
initialize_directions = SOUTH
|
||||
initialize()
|
||||
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/hide(var/i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
obj/machinery/atmospherics/pipe/up/process()
|
||||
if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle
|
||||
..()
|
||||
else
|
||||
. = PROCESS_KILL
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/check_pressure(pressure)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
var/pressure_difference = pressure - environment.return_pressure()
|
||||
|
||||
if(pressure_difference > maximum_pressure)
|
||||
burst()
|
||||
|
||||
else if(pressure_difference > fatigue_pressure)
|
||||
//TODO: leak to turf, doing pfshhhhh
|
||||
if(prob(5))
|
||||
burst()
|
||||
|
||||
else return 1
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/proc/burst()
|
||||
src.visible_message("\red \bold [src] bursts!");
|
||||
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new
|
||||
smoke.set_up(1,0, src.loc, 0)
|
||||
smoke.start()
|
||||
del(src)
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir()
|
||||
if(dir==3)
|
||||
dir = 1
|
||||
else if(dir==12)
|
||||
dir = 4
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/Del()
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
..()
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/pipeline_expansion()
|
||||
return list(node1, node2)
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/update_icon()
|
||||
return
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference == node1)
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
del(parent)
|
||||
node1 = null
|
||||
|
||||
if(reference == node2)
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
del(parent)
|
||||
node2 = null
|
||||
|
||||
return null
|
||||
/////////////////////////
|
||||
// the elusive up pipe //
|
||||
/////////////////////////
|
||||
obj/machinery/atmospherics/pipe/zpipe/up
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "up"
|
||||
|
||||
name = "upwards pipe"
|
||||
desc = "A pipe segment to connect upwards."
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/up/initialize()
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
var/turf/above = locate(src.x, src.y, controller.up_target)
|
||||
if(above)
|
||||
for(var/obj/machinery/atmospherics/target in above)
|
||||
if(target.initialize_directions && istype(target, /obj/machinery/atmospherics/pipe/zpipe/down))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
|
||||
///////////////////////
|
||||
// and the down pipe //
|
||||
///////////////////////
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/down
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "down"
|
||||
|
||||
name = "downwards pipe"
|
||||
desc = "A pipe segment to connect downwards."
|
||||
|
||||
obj/machinery/atmospherics/pipe/zpipe/down/initialize()
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
if(below)
|
||||
for(var/obj/machinery/atmospherics/target in below)
|
||||
if(target.initialize_directions && istype(target, /obj/machinery/atmospherics/pipe/zpipe/up))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
@@ -3,11 +3,10 @@
|
||||
///////////////////////////////////////
|
||||
|
||||
/obj/multiz
|
||||
icon = 'code/TriDimension/multiz.dmi'
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
density = 0
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
var/obj/multiz/target
|
||||
|
||||
CanPass(obj/mover, turf/source, height, airflow)
|
||||
return airflow || !density
|
||||
@@ -15,64 +14,140 @@
|
||||
/obj/multiz/ladder
|
||||
icon_state = "ladderdown"
|
||||
name = "ladder"
|
||||
desc = "A Ladder. You climb up and down it."
|
||||
desc = "A ladder. You climb up and down it."
|
||||
|
||||
var/top_icon_state = "ladderdown"
|
||||
var/bottom_icon_state = "ladderup"
|
||||
var/d_state = 1
|
||||
var/obj/multiz/target
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
spawn(1) //Allow map to load
|
||||
if(z in levels_3d)
|
||||
if(!target)
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if("up" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["up"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = top_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
if(target)
|
||||
target.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
target.target = src
|
||||
else
|
||||
del src
|
||||
|
||||
proc/connect()
|
||||
if(icon_state == "ladderdown") // the upper will connect to the lower
|
||||
d_state = 1
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/multiz/ladder/L in below)
|
||||
if(L.icon_state == "ladderup")
|
||||
target = L
|
||||
L.target = src
|
||||
d_state = 0
|
||||
break
|
||||
return
|
||||
|
||||
/* ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if(icon_state == "ladderup" && prob(10))
|
||||
Del()
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
Del()
|
||||
if(3.0)
|
||||
Del()
|
||||
return*/
|
||||
|
||||
Del()
|
||||
spawn(1)
|
||||
if(target)
|
||||
if(target && icon_state == "ladderdown")
|
||||
del target
|
||||
return ..()
|
||||
|
||||
attack_paw(var/mob/M)
|
||||
return attack_hand(M)
|
||||
|
||||
attackby(var/W, var/mob/M)
|
||||
return attack_hand(M)
|
||||
attackby(obj/item/C as obj, mob/user as mob)
|
||||
(..)
|
||||
|
||||
// construction commented out for balance concerns
|
||||
/* if (!target && istype(C, /obj/item/stack/rods))
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
var/found = 0
|
||||
var/obj/item/stack/rods/S = C
|
||||
if(S.amount < 2)
|
||||
user << "You dont have enough rods to finish the ladder."
|
||||
return
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
found = 1
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
var/blocked = 0
|
||||
for(var/atom/A in below.contents)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
break
|
||||
if(!blocked && !istype(below, /turf/simulated/wall))
|
||||
var/obj/multiz/ladder/X = new /obj/multiz/ladder(below)
|
||||
S.amount = S.amount - 2
|
||||
if(S.amount == 0) S.Del()
|
||||
X.icon_state = "ladderup"
|
||||
connect()
|
||||
user << "You finish the ladder."
|
||||
else
|
||||
user << "The area below is blocked."
|
||||
if(!found)
|
||||
user << "You cant build a ladder down there."
|
||||
return
|
||||
|
||||
else if (icon_state == "ladderdown" && d_state == 0 && istype(C, /obj/item/weapon/wrench))
|
||||
user << "<span class='notice'>You start loosening the anchoring bolts which secure the ladder to the frame.</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
|
||||
sleep(30)
|
||||
if(!user || !C) return
|
||||
|
||||
src.d_state = 1
|
||||
if(target)
|
||||
var/obj/item/stack/rods/R = new /obj/item/stack/rods(target.loc)
|
||||
R.amount = 2
|
||||
target.Del()
|
||||
|
||||
user << "<span class='notice'>You remove the bolts anchoring the ladder.</span>"
|
||||
return
|
||||
|
||||
else if (icon_state == "ladderdown" && d_state == 1 && istype(C, /obj/item/weapon/weldingtool) )
|
||||
var/obj/item/weapon/weldingtool/WT = C
|
||||
if( WT.remove_fuel(0,user) )
|
||||
|
||||
user << "<span class='notice'>You begin to remove the ladder.</span>"
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
|
||||
sleep(60)
|
||||
if(!user || !WT || !WT.isOn()) return
|
||||
|
||||
var/obj/item/stack/sheet/metal/S = new /obj/item/stack/sheet/metal( src )
|
||||
S.amount = 2
|
||||
user << "<span class='notice'>You remove the ladder and close the hole.</span>"
|
||||
Del()
|
||||
else
|
||||
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
|
||||
return
|
||||
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return*/
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
attack_hand(var/mob/M)
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
M.visible_message("\blue \The [M] climbs [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You climb [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.")
|
||||
M.Move(target.loc)
|
||||
M << "The ladder is incomplete and can't be climbed."
|
||||
else
|
||||
var/turf/T = target.loc
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
break
|
||||
if(blocked || istype(T, /turf/simulated/wall))
|
||||
M << "Something is blocking the ladder."
|
||||
else
|
||||
M.visible_message("\blue \The [M] climbs [src.icon_state == "ladderup" ? "up" : "down"] \the [src]!", "You climb [src.icon_state == "ladderup" ? "up" : "down"] \the [src]!", "You hear some grunting, and clanging of a metal ladder being used.")
|
||||
M.Move(target.loc)
|
||||
|
||||
|
||||
hatch
|
||||
/* hatch
|
||||
icon_state = "hatchdown"
|
||||
name = "hatch"
|
||||
desc = "A hatch. You climb down it, and it will automatically seal against pressure loss behind you."
|
||||
@@ -125,81 +200,48 @@
|
||||
spawn(7)
|
||||
top_hatch.icon_state = top_icon_state
|
||||
bottom_hatch.overlays -= red_overlay
|
||||
active = 0
|
||||
active = 0*/
|
||||
|
||||
/obj/multiz/stairs
|
||||
name = "Stairs"
|
||||
desc = "Stairs. You walk up and down them."
|
||||
icon_state = "ramptop"
|
||||
var/top_icon_state = "ramptop"
|
||||
var/bottom_icon_state = "rampbottom"
|
||||
icon_state = "rampbottom"
|
||||
var/obj/multiz/stairs/connected
|
||||
var/turf/target
|
||||
|
||||
active
|
||||
density = 1
|
||||
New()
|
||||
..()
|
||||
var/turf/cl= locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in cl)
|
||||
if(c.up)
|
||||
var/turf/O = locate(src.x, src.y, c.up_target)
|
||||
if(istype(O, /turf/space))
|
||||
O.ChangeTurf(/turf/simulated/floor/open)
|
||||
|
||||
|
||||
New()
|
||||
. = ..()
|
||||
spawn(1)
|
||||
if(z in levels_3d)
|
||||
if(!target)
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if("up" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["up"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = top_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
else if("down" in adjacent_to_me)
|
||||
target = locate() in locate(x,y,adjacent_to_me["down"])
|
||||
if(istype(target))
|
||||
icon_state = bottom_icon_state
|
||||
else
|
||||
del src
|
||||
else
|
||||
del src
|
||||
if(target)
|
||||
target.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
target.target = src
|
||||
var/obj/multiz/stairs/lead_in = locate() in get_step(src, reverse_direction(dir))
|
||||
if(lead_in)
|
||||
lead_in.icon_state = ( icon_state == top_icon_state ? bottom_icon_state : top_icon_state)
|
||||
else
|
||||
del src
|
||||
|
||||
|
||||
Del()
|
||||
spawn(1)
|
||||
spawn(1)
|
||||
for(var/dir in cardinal)
|
||||
var/turf/T = get_step(src.loc,dir)
|
||||
for(var/obj/multiz/stairs/S in T)
|
||||
if(S && S.icon_state == "rampbottom" && !S.connected)
|
||||
S.dir = dir
|
||||
src.dir = dir
|
||||
S.connected = src
|
||||
src.connected = S
|
||||
src.icon_state = "ramptop"
|
||||
src.density = 1
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
var/turf/above = locate(src.x, src.y, controller.up_target)
|
||||
if(istype(above,/turf/space) || istype(above,/turf/simulated/floor/open))
|
||||
src.target = above
|
||||
break
|
||||
if(target)
|
||||
del target
|
||||
return ..()
|
||||
|
||||
break
|
||||
|
||||
Bumped(var/atom/movable/M)
|
||||
if(target.z > z && istype(src, /obj/multiz/stairs/active) && !locate(/obj/multiz/stairs) in M.loc)
|
||||
return //If on bottom, only let them go up stairs if they've moved to the entry tile first.
|
||||
//If it's the top, they can fall down just fine.
|
||||
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
|
||||
if(ismob(M) && M:client)
|
||||
M:client.moving = 1
|
||||
M.Move(target.loc)
|
||||
if (ismob(M) && M:client)
|
||||
M:client.moving = 0
|
||||
|
||||
Click()
|
||||
if(!istype(usr,/mob/dead/observer))
|
||||
return ..()
|
||||
if(!target || !istype(target.loc, /turf))
|
||||
del src
|
||||
usr.client.moving = 1
|
||||
usr.Move(target.loc)
|
||||
usr.client.moving = 0
|
||||
if(connected && target && istype(src, /obj/multiz/stairs) && locate(/obj/multiz/stairs) in M.loc)
|
||||
var/obj/multiz/stairs/Con = locate(/obj/multiz/stairs) in M.loc
|
||||
if(Con == src.connected) //make sure the atom enters from the approriate lower stairs tile
|
||||
M.Move(target)
|
||||
return
|
||||
|
||||
@@ -1,27 +1,3 @@
|
||||
atom/movable/var/list/adjacent_z_levels
|
||||
atom/movable/var/archived_z_level
|
||||
|
||||
atom/movable/Move() //Hackish
|
||||
|
||||
if(adjacent_z_levels && adjacent_z_levels["up"])
|
||||
var/turf/above_me = locate(x,y,adjacent_z_levels["up"])
|
||||
if(istype(above_me, /turf/simulated/floor/open))
|
||||
above_me:RemoveImage(src)
|
||||
|
||||
. = ..()
|
||||
|
||||
if(archived_z_level != z)
|
||||
archived_z_level = z
|
||||
if(z in levels_3d)
|
||||
adjacent_z_levels = global_adjacent_z_levels["[z]"]
|
||||
else
|
||||
adjacent_z_levels = null
|
||||
|
||||
if(adjacent_z_levels && adjacent_z_levels["up"])
|
||||
var/turf/above_me = locate(x,y,adjacent_z_levels["up"])
|
||||
if(istype(above_me, /turf/simulated/floor/open))
|
||||
above_me:AddImage(src)
|
||||
|
||||
/turf/simulated/floor/open
|
||||
name = "open space"
|
||||
intact = 0
|
||||
@@ -31,66 +7,109 @@ atom/movable/Move() //Hackish
|
||||
var/icon/darkoverlays = null
|
||||
var/turf/floorbelow
|
||||
var/list/overlay_references
|
||||
mouse_opacity = 2
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn(1)
|
||||
if(!(z in levels_3d))
|
||||
ReplaceWithSpace()
|
||||
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
|
||||
if(!("down" in adjacent_to_me))
|
||||
ReplaceWithSpace()
|
||||
|
||||
floorbelow = locate(x, y, adjacent_to_me["down"])
|
||||
if(floorbelow)
|
||||
if(!istype(floorbelow,/turf))
|
||||
del src
|
||||
else if(floorbelow.density)
|
||||
ReplaceWithPlating()
|
||||
else
|
||||
set_up()
|
||||
else
|
||||
ReplaceWithSpace()
|
||||
|
||||
getbelow()
|
||||
return
|
||||
|
||||
Enter(var/atom/movable/AM)
|
||||
if (..()) //TODO make this check if gravity is active (future use) - Sukasa
|
||||
spawn(1)
|
||||
// only fall down in defined areas (read: areas with artificial gravitiy)
|
||||
if(!floorbelow) //make sure that there is actually something below
|
||||
if(!getbelow())
|
||||
return
|
||||
if(AM)
|
||||
AM.Move(floorbelow)
|
||||
if (istype(AM, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
var/damage = rand(5,15)
|
||||
H.apply_damage(2*damage, BRUTE, "head")
|
||||
H.apply_damage(2*damage, BRUTE, "chest")
|
||||
H.apply_damage(0.5*damage, BRUTE, "l_leg")
|
||||
H.apply_damage(0.5*damage, BRUTE, "r_leg")
|
||||
H.apply_damage(0.5*damage, BRUTE, "l_arm")
|
||||
H.apply_damage(0.5*damage, BRUTE, "r_arm")
|
||||
H:weakened = max(H:weakened,2)
|
||||
H:updatehealth()
|
||||
var/area/areacheck = get_area(src)
|
||||
var/blocked = 0
|
||||
var/soft = 0
|
||||
for(var/atom/A in floorbelow.contents)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
break
|
||||
if(istype(A, /obj/machinery/atmospherics/pipe/zpipe/up) && istype(AM,/obj/item/pipe))
|
||||
blocked = 1
|
||||
break
|
||||
if(istype(A, /obj/structure/disposalpipe/up) && istype(AM,/obj/item/pipe))
|
||||
blocked = 1
|
||||
break
|
||||
if(istype(A, /obj/multiz/stairs))
|
||||
soft = 1
|
||||
//dont break here, since we still need to be sure that it isnt blocked
|
||||
|
||||
if (soft || (!blocked && !(areacheck.name == "Space")))
|
||||
AM.Move(floorbelow)
|
||||
if (!soft && istype(AM, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
var/damage = 5
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "head")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "chest")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_leg")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_leg")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_arm")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_arm")
|
||||
H:weakened = max(H:weakened,2)
|
||||
H:updatehealth()
|
||||
return ..()
|
||||
|
||||
attackby()
|
||||
return //nothing
|
||||
/turf/simulated/floor/open/proc/getbelow()
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
// check if there is something to draw below
|
||||
if(!controller.down)
|
||||
src.ChangeTurf(/turf/space)
|
||||
return 0
|
||||
else
|
||||
floorbelow = locate(src.x, src.y, controller.down_target)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
proc/set_up() //Update the overlays to make the openspace turf show what's down a level
|
||||
if(!overlay_references)
|
||||
overlay_references = list()
|
||||
if(!floorbelow) return
|
||||
overlays += floorbelow
|
||||
for(var/obj/o in floorbelow)
|
||||
var/image/o_img = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
overlays += o_img
|
||||
overlay_references[o] = o_img
|
||||
// override to make sure nothing is hidden
|
||||
/turf/simulated/floor/open/levelupdate()
|
||||
for(var/obj/O in src)
|
||||
if(O.level == 1)
|
||||
O.hide(0)
|
||||
|
||||
proc/AddImage(var/atom/movable/o)
|
||||
var/o_img = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
overlays += o_img
|
||||
overlay_references[o] = o_img
|
||||
//overwrite the attackby of space to transform it to openspace if necessary
|
||||
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/weapon/cable_coil))
|
||||
var/turf/simulated/floor/open/W = src.ChangeTurf(/turf/simulated/floor/open)
|
||||
W.attackby(C, user)
|
||||
return
|
||||
..()
|
||||
|
||||
proc/RemoveImage(var/atom/movable/o)
|
||||
var/o_img = overlay_references[o]
|
||||
overlays -= o_img
|
||||
overlay_references -= o
|
||||
/turf/simulated/floor/open/ex_act(severity)
|
||||
// cant destroy empty space with an ordinary bomb
|
||||
return
|
||||
|
||||
/turf/simulated/floor/open/attackby(obj/item/C as obj, mob/user as mob)
|
||||
(..)
|
||||
if (istype(C, /obj/item/weapon/cable_coil))
|
||||
var/obj/item/weapon/cable_coil/cable = C
|
||||
cable.turf_place(src, user)
|
||||
return
|
||||
|
||||
if (istype(C, /obj/item/stack/rods))
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
return
|
||||
var/obj/item/stack/rods/R = C
|
||||
user << "\blue Constructing support lattice ..."
|
||||
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
ReplaceWithLattice()
|
||||
R.use(1)
|
||||
return
|
||||
|
||||
if (istype(C, /obj/item/stack/tile/plasteel))
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
var/obj/item/stack/tile/plasteel/S = C
|
||||
del(L)
|
||||
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
S.build(src)
|
||||
S.use(1)
|
||||
return
|
||||
else
|
||||
user << "\red The plating is going to need some support."
|
||||
return
|
||||
|
||||
263
code/TriDimension/controller.dm
Normal file
263
code/TriDimension/controller.dm
Normal file
@@ -0,0 +1,263 @@
|
||||
/obj/effect/landmark/zcontroller
|
||||
name = "Z-Level Controller"
|
||||
var/initialized = 0 // when set to 1, turfs will report to the controller
|
||||
var/up = 0 // 1 allows up movement
|
||||
var/up_target = 0 // the Z-level that is above the current one
|
||||
var/down = 0 // 1 allows down movement
|
||||
var/down_target = 0 // the Z-level that is below the current one
|
||||
|
||||
var/list/slow = list()
|
||||
var/list/normal = list()
|
||||
var/list/fast = list()
|
||||
|
||||
var/slow_time
|
||||
var/normal_time
|
||||
var/fast_time
|
||||
|
||||
/obj/effect/landmark/zcontroller/New()
|
||||
..()
|
||||
for (var/turf/T in world)
|
||||
if (T.z == z)
|
||||
fast += T
|
||||
slow_time = world.time + 3000
|
||||
normal_time = world.time + 600
|
||||
fast_time = world.time + 10
|
||||
|
||||
processing_objects.Add(src)
|
||||
|
||||
initialized = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/landmark/zcontroller/Del()
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
|
||||
/obj/effect/landmark/zcontroller/process()
|
||||
if (world.time > fast_time)
|
||||
calc(fast)
|
||||
fast_time = world.time + 10
|
||||
|
||||
if (world.time > normal_time)
|
||||
calc(normal)
|
||||
normal_time = world.time + 600
|
||||
|
||||
/* if (world.time > slow_time)
|
||||
calc(slow)
|
||||
slow_time = world.time + 3000 */
|
||||
return
|
||||
|
||||
/obj/effect/landmark/zcontroller/proc/add(var/list/L, var/I, var/transfer)
|
||||
while (L.len)
|
||||
var/turf/T = pick(L)
|
||||
|
||||
L -= T
|
||||
slow -= T
|
||||
normal -= T
|
||||
fast -= T
|
||||
|
||||
if(!T || !istype(T, /turf))
|
||||
continue
|
||||
|
||||
switch (I)
|
||||
if(1) slow += T
|
||||
if(2) normal += T
|
||||
if(3) fast += T
|
||||
|
||||
if(transfer > 0)
|
||||
if(up)
|
||||
var/turf/controller_up = locate(1, 1, up_target)
|
||||
for(var/obj/effect/landmark/zcontroller/c_up in controller_up)
|
||||
var/list/temp = list()
|
||||
temp += locate(T.x, T.y, up_target)
|
||||
c_up.add(temp, I, transfer-1)
|
||||
|
||||
if(down)
|
||||
var/turf/controller_down = locate(1, 1, down_target)
|
||||
for(var/obj/effect/landmark/zcontroller/c_down in controller_down)
|
||||
var/list/temp = list()
|
||||
temp += locate(T.x, T.y, down_target)
|
||||
c_down.add(temp, I, transfer-1)
|
||||
return
|
||||
|
||||
/turf
|
||||
var/list/z_overlays = list()
|
||||
|
||||
/turf/New()
|
||||
..()
|
||||
|
||||
var/turf/controller = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in controller)
|
||||
if(c.initialized)
|
||||
var/list/turf = list()
|
||||
turf += src
|
||||
c.add(turf,3,1)
|
||||
|
||||
/turf/space/New()
|
||||
..()
|
||||
|
||||
var/turf/controller = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in controller)
|
||||
if(c.initialized)
|
||||
var/list/turf = list()
|
||||
turf += src
|
||||
c.add(turf,3,1)
|
||||
|
||||
atom/movable/Move() //Hackish
|
||||
. = ..()
|
||||
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up || controller.down)
|
||||
var/list/temp = list()
|
||||
temp += locate(src.x, src.y, src.z)
|
||||
controller.add(temp,3,1)
|
||||
|
||||
/obj/effect/landmark/zcontroller/proc/calc(var/list/L)
|
||||
var/list/slowholder = list()
|
||||
var/list/normalholder = list()
|
||||
var/list/fastholder = list()
|
||||
var/new_list
|
||||
|
||||
while(L.len)
|
||||
var/turf/T = pick(L)
|
||||
new_list = 0
|
||||
|
||||
if(!T || !istype(T, /turf))
|
||||
L -= T
|
||||
continue
|
||||
|
||||
T.overlays -= T.z_overlays
|
||||
T.z_overlays -= T.z_overlays
|
||||
|
||||
if(down && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
|
||||
var/turf/below = locate(T.x, T.y, down_target)
|
||||
if(below)
|
||||
if(!(istype(below, /turf/space) || istype(below, /turf/simulated/floor/open)))
|
||||
var/image/t_img = list()
|
||||
new_list = 1
|
||||
|
||||
var/image/temp = image(below, dir=below.dir, layer = TURF_LAYER + 0.04)
|
||||
|
||||
temp.color = rgb(127,127,127)
|
||||
temp.overlays += below.overlays
|
||||
t_img += temp
|
||||
T.overlays += t_img
|
||||
T.z_overlays += t_img
|
||||
|
||||
// get objects
|
||||
var/image/o_img = list()
|
||||
for(var/obj/o in below)
|
||||
// ingore objects that have any form of invisibility
|
||||
if(o.invisibility) continue
|
||||
new_list = 2
|
||||
var/image/temp2 = image(o, dir=o.dir, layer = TURF_LAYER+0.05*o.layer)
|
||||
temp2.color = rgb(127,127,127)
|
||||
temp2.overlays += o.overlays
|
||||
o_img += temp2
|
||||
// you need to add a list to .overlays or it will not display any because space
|
||||
T.overlays += o_img
|
||||
T.z_overlays += o_img
|
||||
|
||||
// get mobs
|
||||
var/image/m_img = list()
|
||||
for(var/mob/m in below)
|
||||
// ingore mobs that have any form of invisibility
|
||||
if(m.invisibility) continue
|
||||
// only add this tile to fastprocessing if there is a living mob, not a dead one
|
||||
if(istype(m, /mob/living)) new_list = 3
|
||||
var/image/temp2 = image(m, dir=m.dir, layer = TURF_LAYER+0.05*m.layer)
|
||||
temp2.color = rgb(127,127,127)
|
||||
temp2.overlays += m.overlays
|
||||
m_img += temp2
|
||||
// you need to add a list to .overlays or it will not display any because space
|
||||
T.overlays += m_img
|
||||
T.z_overlays += m_img
|
||||
|
||||
T.overlays -= below.z_overlays
|
||||
T.z_overlays -= below.z_overlays
|
||||
|
||||
// this is sadly impossible to use right now
|
||||
// the overlay is always opaque to mouseclicks and thus prevents interactions with everything except the turf
|
||||
/*if(up)
|
||||
var/turf/above = locate(T.x, T.y, up_target)
|
||||
if(above)
|
||||
var/eligeable = 0
|
||||
for(var/d in cardinal)
|
||||
var/turf/mT = get_step(above,d)
|
||||
if(istype(mT, /turf/space) || istype(mT, /turf/simulated/floor/open))
|
||||
eligeable = 1
|
||||
/*if(mT.opacity == 0)
|
||||
for(var/f in cardinal)
|
||||
var/turf/nT = get_step(mT,f)
|
||||
if(istype(nT, /turf/space) || istype(nT, /turf/simulated/floor/open))
|
||||
eligeable = 1*/
|
||||
if(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)) eligeable = 1
|
||||
if(eligeable == 1)
|
||||
if(!(istype(above, /turf/space) || istype(above, /turf/simulated/floor/open)))
|
||||
var/image/t_img = list()
|
||||
if(new_list < 1) new_list = 1
|
||||
|
||||
above.overlays -= above.z_overlays
|
||||
var/image/temp = image(above, dir=above.dir, layer = 5 + 0.04)
|
||||
above.overlays += above.z_overlays
|
||||
|
||||
temp.alpha = 100
|
||||
temp.overlays += above.overlays
|
||||
temp.overlays -= above.z_overlays
|
||||
t_img += temp
|
||||
T.overlays += t_img
|
||||
T.z_overlays += t_img
|
||||
|
||||
// get objects
|
||||
var/image/o_img = list()
|
||||
for(var/obj/o in above)
|
||||
// ingore objects that have any form of invisibility
|
||||
if(o.invisibility) continue
|
||||
if(new_list < 2) new_list = 2
|
||||
var/image/temp2 = image(o, dir=o.dir, layer = 5+0.05*o.layer)
|
||||
temp2.alpha = 100
|
||||
temp2.overlays += o.overlays
|
||||
o_img += temp2
|
||||
// you need to add a list to .overlays or it will not display any because space
|
||||
T.overlays += o_img
|
||||
T.z_overlays += o_img
|
||||
|
||||
// get mobs
|
||||
var/image/m_img = list()
|
||||
for(var/mob/m in above)
|
||||
// ingore mobs that have any form of invisibility
|
||||
if(m.invisibility) continue
|
||||
// only add this tile to fastprocessing if there is a living mob, not a dead one
|
||||
if(istype(m, /mob/living) && new_list < 3) new_list = 3
|
||||
var/image/temp2 = image(m, dir=m.dir, layer = 5+0.05*m.layer)
|
||||
temp2.alpha = 100
|
||||
temp2.overlays += m.overlays
|
||||
m_img += temp2
|
||||
// you need to add a list to .overlays or it will not display any because space
|
||||
T.overlays += m_img
|
||||
T.z_overlays += m_img
|
||||
|
||||
T.overlays -= above.z_overlays
|
||||
T.z_overlays -= above.z_overlays*/
|
||||
|
||||
L -= T
|
||||
|
||||
if(new_list == 1)
|
||||
slowholder += T
|
||||
if(new_list == 2)
|
||||
normalholder += T
|
||||
if(new_list == 3)
|
||||
fastholder += T
|
||||
for(var/d in cardinal)
|
||||
var/turf/mT = get_step(T,d)
|
||||
if(!(mT in fastholder))
|
||||
fastholder += mT
|
||||
for(var/f in cardinal)
|
||||
var/turf/nT = get_step(mT,f)
|
||||
if(!(nT in fastholder))
|
||||
fastholder += nT
|
||||
|
||||
add(slowholder,1, 0)
|
||||
add(normalholder, 2, 0)
|
||||
add(fastholder, 3, 0)
|
||||
return
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -21,10 +21,6 @@
|
||||
electrical_storage
|
||||
name = "\improper Electrical storage"
|
||||
|
||||
engine_monitoring
|
||||
name = "\improper Electrical storage"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
reactor_core
|
||||
name = "\improper Reactor Core"
|
||||
//icon_state = "engine_core"
|
||||
|
||||
@@ -11,6 +11,12 @@ proc/FloodFill(turf/simulated/start)
|
||||
var/list/open = list(start)
|
||||
//The list of tiles which have been evaulated.
|
||||
var/list/closed = list()
|
||||
/////// Z-Level stuff
|
||||
//List of all space tiles bordering the zone
|
||||
var/list/list_space = list()
|
||||
//List of all Z-Levels of the zone where it borders space
|
||||
var/list/z_space = list()
|
||||
/////// Z-Level stuff
|
||||
|
||||
//Loop through the turfs in the open list in order to find which adjacent turfs should be added to the zone.
|
||||
while(open.len)
|
||||
@@ -67,10 +73,75 @@ proc/FloodFill(turf/simulated/start)
|
||||
//If it cannot connect either to the north or west, connect it!
|
||||
closed += O
|
||||
|
||||
/////// Z-Level stuff
|
||||
if(istype(O,/turf/space))
|
||||
if(!(O in list_space))
|
||||
list_space += O
|
||||
if(!(O.z in z_space))
|
||||
z_space += O.z
|
||||
|
||||
// handle Z-level connections
|
||||
var/turf/controllerlocation = locate(1, 1, T.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
// connect upwards
|
||||
if(controller.up)
|
||||
var/turf/above_me = locate(T.x, T.y, controller.up_target)
|
||||
// add the turf above this
|
||||
if(istype(above_me, /turf/simulated/floor/open) && !(above_me in open) && !(above_me in closed))
|
||||
open += above_me
|
||||
|
||||
if(istype(above_me,/turf/space))
|
||||
if(!(above_me in list_space))
|
||||
list_space += above_me
|
||||
if(!(above_me.z in z_space))
|
||||
z_space += above_me.z
|
||||
// connect downwards
|
||||
if(controller.down && istype(T, /turf/simulated/floor/open))
|
||||
var/turf/below_me = locate(T.x, T.y, controller.down_target)
|
||||
// add the turf below this
|
||||
if(!(below_me in open) && !(below_me in closed))
|
||||
open += below_me
|
||||
/////// Z-Level stuff
|
||||
|
||||
//This tile is now evaluated, and can be moved to the list of evaluated tiles.
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
/////// Z-Level stuff
|
||||
// once the zone is done, check if there is space that needs to be changed to open space
|
||||
if(!open.len)
|
||||
var/list/temp = list()
|
||||
while(list_space.len)
|
||||
var/turf/S = pick(list_space)
|
||||
//check if the zone has any space borders below the evaluated space tile
|
||||
//if there is some, we dont need to make open_space since the zone can vent and the zone above can vent
|
||||
//through the evaluated tile
|
||||
//if there is none, the zone can connect upwards to either vent from there or connect with the zone there
|
||||
//also check if the turf below the space is actually part of this zone to prevent the edge tiles from transforming
|
||||
var/turf/controllerloc = locate(1, 1, S.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerloc)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(S.x, S.y, controller.down_target)
|
||||
if(!((S.z - 1) in z_space) && below in closed)
|
||||
open += S.ChangeTurf(/turf/simulated/floor/open)
|
||||
list_space -= S
|
||||
else
|
||||
list_space -= S
|
||||
temp += S
|
||||
else
|
||||
list_space -= S
|
||||
temp += S
|
||||
// make sure the turf is removed from the list
|
||||
list_space -= S
|
||||
z_space -= z_space
|
||||
while(temp.len)
|
||||
var/turf/S = pick(temp)
|
||||
if(!(S.z in z_space))
|
||||
z_space += S.z
|
||||
list_space += S
|
||||
temp -= S
|
||||
/////// Z-Level stuff
|
||||
|
||||
return closed
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
var/interactions_with_unsim = 0
|
||||
var/progress = "nothing"
|
||||
|
||||
|
||||
/datum/gas_mixture/zone
|
||||
Del()
|
||||
CRASH("Something tried to delete a zone's air!")
|
||||
. = ..()
|
||||
|
||||
//CREATION AND DELETION
|
||||
/zone/New(turf/start)
|
||||
. = ..()
|
||||
@@ -53,7 +47,7 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
//Generate the gas_mixture for use in txhis zone by using the average of the gases
|
||||
//defined at startup.
|
||||
//Changed to try and find the source of the error.
|
||||
air = new /datum/gas_mixture/zone()
|
||||
air = new
|
||||
air.group_multiplier = contents.len
|
||||
for(var/turf/simulated/T in contents)
|
||||
if(!T.air)
|
||||
@@ -152,6 +146,13 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
|
||||
|
||||
T.zone = src
|
||||
|
||||
///// Z-Level Stuff
|
||||
// also add the tile below it if its open space
|
||||
if(istype(T, /turf/simulated/floor/open))
|
||||
var/turf/simulated/floor/open/T2 = T
|
||||
src.AddTurf(T2.floorbelow)
|
||||
///// Z-Level Stuff
|
||||
|
||||
else
|
||||
if(!unsimulated_tiles)
|
||||
unsimulated_tiles = list()
|
||||
@@ -773,6 +774,32 @@ zone/proc/Rebuild()
|
||||
if(adjacent_id && (!lowest_id || adjacent_id < lowest_id))
|
||||
lowest_id = adjacent_id
|
||||
|
||||
/////// Z-Level stuff
|
||||
var/turf/controllerlocation = locate(1, 1, current.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
// upwards
|
||||
if(controller.up)
|
||||
var/turf/simulated/adjacent = locate(current.x, current.y, controller.up_target)
|
||||
|
||||
if(adjacent in turfs && istype(adjacent, /turf/simulated/floor/open))
|
||||
current_adjacents += adjacent
|
||||
adjacent_id = turfs[adjacent]
|
||||
|
||||
if(adjacent_id && (!lowest_id || adjacent_id < lowest_id))
|
||||
lowest_id = adjacent_id
|
||||
|
||||
// downwards
|
||||
if(controller.down && istype(current, /turf/simulated/floor/open))
|
||||
var/turf/simulated/adjacent = locate(current.x, current.y, controller.down_target)
|
||||
|
||||
if(adjacent in turfs)
|
||||
current_adjacents += adjacent
|
||||
adjacent_id = turfs[adjacent]
|
||||
|
||||
if(adjacent_id && (!lowest_id || adjacent_id < lowest_id))
|
||||
lowest_id = adjacent_id
|
||||
/////// Z-Level stuff
|
||||
|
||||
if(!lowest_id)
|
||||
lowest_id = current_identifier++
|
||||
identical_ids += lowest_id
|
||||
|
||||
@@ -188,14 +188,15 @@ datum/hud/New(mob/owner)
|
||||
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
/mob/verb/button_pressed_F12()
|
||||
/mob/verb/button_pressed_F12(var/full = 0 as null)
|
||||
set name = "F12"
|
||||
set hidden = 1
|
||||
|
||||
if(hud_used)
|
||||
if(ishuman(src))
|
||||
if(!src.client) return
|
||||
|
||||
if(!client) return
|
||||
if(client.view != world.view)
|
||||
return
|
||||
if(hud_used.hud_shown)
|
||||
hud_used.hud_shown = 0
|
||||
if(src.hud_used.adding)
|
||||
@@ -209,10 +210,15 @@ datum/hud/New(mob/owner)
|
||||
|
||||
//Due to some poor coding some things need special treatment:
|
||||
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
if(!full)
|
||||
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
|
||||
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
|
||||
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
else
|
||||
src.client.screen -= src.healths
|
||||
src.client.screen -= src.internals
|
||||
src.client.screen -= src.gun_setting_icon
|
||||
|
||||
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
|
||||
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
|
||||
@@ -225,7 +231,12 @@ datum/hud/New(mob/owner)
|
||||
src.client.screen += src.hud_used.other
|
||||
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
|
||||
src.client.screen += src.hud_used.hotkeybuttons
|
||||
|
||||
if(src.healths)
|
||||
src.client.screen |= src.healths
|
||||
if(src.internals)
|
||||
src.client.screen |= src.internals
|
||||
if(src.gun_setting_icon)
|
||||
src.client.screen |= src.gun_setting_icon
|
||||
|
||||
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
|
||||
src.client.screen += src.zone_sel //This one is a special snowflake
|
||||
|
||||
@@ -891,8 +891,9 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/obj/item/clothing/suit/hastur,
|
||||
/obj/item/clothing/suit/imperium_monk,
|
||||
/obj/item/clothing/suit/ianshirt,
|
||||
/obj/item/clothing/suit/leathercoat,
|
||||
/obj/item/clothing/suit/browncoat,
|
||||
/obj/item/clothing/under/gimmick/rank/captain/suit,
|
||||
/obj/item/clothing/under/gimmick/rank/head_of_personnel/suit,
|
||||
/obj/item/clothing/under/lawyer/purpsuit,
|
||||
/obj/item/clothing/suit/suspenders,
|
||||
/obj/item/clothing/suit/storage/labcoat/mad,
|
||||
/obj/item/clothing/suit/bio_suit/plaguedoctorsuit)
|
||||
|
||||
@@ -922,16 +922,28 @@ var/list/ghostteleportlocs = list()
|
||||
|
||||
/area/engine
|
||||
engine_smes
|
||||
name = "\improper Engineering SMES"
|
||||
name = "Engineering SMES"
|
||||
icon_state = "engine_smes"
|
||||
requires_power = 0//This area only covers the batteries and they deal with their own power
|
||||
// requires_power = 0//This area only covers the batteries and they deal with their own power
|
||||
|
||||
engine_room
|
||||
name = "\improper Engine Room"
|
||||
icon_state = "engine"
|
||||
|
||||
engine_airlock
|
||||
name = "\improper Engine Room Airlock"
|
||||
icon_state = "engine"
|
||||
|
||||
engine_monitoring
|
||||
name = "\improper Engine Monitoring Room"
|
||||
icon_state = "engine_monitoring"
|
||||
|
||||
engineering
|
||||
name = "Engineering"
|
||||
icon_state = "engine_smes"
|
||||
|
||||
break_room
|
||||
name = "\improper Engineering Foyer"
|
||||
name = "Engineering Foyer"
|
||||
icon_state = "engine"
|
||||
|
||||
chiefs_office
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
return
|
||||
if( !fire )
|
||||
fire = 1
|
||||
master.fire = 1 //used for firedoor checks
|
||||
updateicon()
|
||||
mouse_opacity = 0
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
@@ -122,6 +123,7 @@
|
||||
/area/proc/firereset()
|
||||
if (fire)
|
||||
fire = 0
|
||||
master.fire = 0 //used for firedoor checks
|
||||
mouse_opacity = 0
|
||||
updateicon()
|
||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
||||
|
||||
@@ -382,6 +382,11 @@ var/list/sacrificed = list()
|
||||
D.real_name = "[pick(first_names_male)] [pick(last_names)]"
|
||||
D.universal_speak = 1
|
||||
D.status_flags &= ~GODMODE
|
||||
D.s_tone = 35
|
||||
D.b_eyes = 200
|
||||
D.r_eyes = 200
|
||||
D.g_eyes = 200
|
||||
D.underwear = 0
|
||||
|
||||
D.key = ghost.key
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
master_controller.process() //Start master_controller.process()
|
||||
lighting_controller.process() //Start processing DynamicAreaLighting updates
|
||||
|
||||
for(var/obj/multiz/ladder/L in world) L.connect() //Lazy hackfix for ladders. TODO: move this to an actual controller. ~ Z
|
||||
|
||||
if(config.sql_enabled)
|
||||
spawn(3000)
|
||||
|
||||
@@ -51,9 +51,9 @@
|
||||
B.name = "Toolbox Manifesto"
|
||||
if("homosexuality")
|
||||
B.name = "Guys Gone Wild"
|
||||
if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks")
|
||||
B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition")
|
||||
H.setBrainLoss(100) // starts off retarded as fuck
|
||||
//if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks")
|
||||
// B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition")
|
||||
// H.setBrainLoss(100) // starts off retarded as fuck
|
||||
if("science")
|
||||
B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition")
|
||||
else
|
||||
@@ -152,4 +152,4 @@
|
||||
ticker.Bible_deity_name = B.deity_name
|
||||
feedback_set_details("religion_deity","[new_deity]")
|
||||
feedback_set_details("religion_book","[new_book_style]")
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -67,7 +67,7 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
proc/FreeRole(var/rank) //making additional slot on the fly
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(job && job.current_positions >= job.total_positions)
|
||||
if(job && job.current_positions >= job.total_positions && job.total_positions != -1)
|
||||
job.total_positions++
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
name = "Freezer"
|
||||
name = "gas cooling system"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
@@ -8,84 +8,91 @@
|
||||
|
||||
current_heat_capacity = 1000
|
||||
|
||||
New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
return
|
||||
icon_state = "freezer"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/temp_text = ""
|
||||
if(air_contents.temperature > (T0C - 20))
|
||||
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
|
||||
else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
temp_text = "<FONT color=black>[air_contents.temperature]</FONT>"
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["on"] = on ? 1 : 0
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T0C - 200)
|
||||
data["maxGasTemperature"] = round(T20C)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
var/temp_class = "good"
|
||||
if (air_contents.temperature > (T0C - 20))
|
||||
temp_class = "bad"
|
||||
else if (air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100))
|
||||
temp_class = "average"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 440, 300)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(T20C, src.current_temperature+amount)
|
||||
else
|
||||
temp_text = "<FONT color=blue>[air_contents.temperature]</FONT>"
|
||||
|
||||
var/dat = {"<B>Cryo gas cooling system</B><BR>
|
||||
Current status: [ on ? "<A href='?src=\ref[src];start=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];start=1'>On</A>"]<BR>
|
||||
Current gas temperature: [temp_text]<BR>
|
||||
Current air pressure: [air_contents.return_pressure()]<BR>
|
||||
Target gas temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=freezer;size=400x500")
|
||||
onclose(user, "freezer")
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.set_machine(src)
|
||||
if (href_list["start"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(T20C, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max((T0C - 200), src.current_temperature+amount)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
|
||||
src.current_temperature = max((T0C - 200), src.current_temperature+amount)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/process()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "Heater"
|
||||
name = "gas heating system"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
@@ -94,73 +101,83 @@
|
||||
|
||||
current_heat_capacity = 1000
|
||||
|
||||
New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater_0"
|
||||
return
|
||||
icon_state = "heater"
|
||||
else
|
||||
icon_state = "heater_0"
|
||||
return
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
var/temp_text = ""
|
||||
if(air_contents.temperature > (T20C+40))
|
||||
temp_text = "<FONT color=red>[air_contents.temperature]</FONT>"
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["on"] = on ? 1 : 0
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T20C)
|
||||
data["maxGasTemperature"] = round(T20C+280)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
var/temp_class = "normal"
|
||||
if (air_contents.temperature > (T20C+40))
|
||||
temp_class = "bad"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 440, 300)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min((T20C+280), src.current_temperature+amount)
|
||||
else
|
||||
temp_text = "<FONT color=black>[air_contents.temperature]</FONT>"
|
||||
src.current_temperature = max(T20C, src.current_temperature+amount)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
var/dat = {"<B>Heating system</B><BR>
|
||||
Current status: [ on ? "<A href='?src=\ref[src];start=1'>Off</A> <B>On</B>" : "<B>Off</B> <A href='?src=\ref[src];start=1'>On</A>"]<BR>
|
||||
Current gas temperature: [temp_text]<BR>
|
||||
Current air pressure: [air_contents.return_pressure()]<BR>
|
||||
Target gas temperature: <A href='?src=\ref[src];temp=-100'>-</A> <A href='?src=\ref[src];temp=-10'>-</A> <A href='?src=\ref[src];temp=-1'>-</A> [current_temperature] <A href='?src=\ref[src];temp=1'>+</A> <A href='?src=\ref[src];temp=10'>+</A> <A href='?src=\ref[src];temp=100'>+</A><BR>
|
||||
"}
|
||||
|
||||
user << browse(dat, "window=heater;size=400x500")
|
||||
onclose(user, "heater")
|
||||
|
||||
Topic(href, href_list)
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.set_machine(src)
|
||||
if (href_list["start"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min((T20C+280), src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(T20C, src.current_temperature+amount)
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/process()
|
||||
..()
|
||||
@@ -31,7 +31,8 @@
|
||||
/obj/item/toy/prize/seraph = 1,
|
||||
/obj/item/toy/prize/mauler = 1,
|
||||
/obj/item/toy/prize/odysseus = 1,
|
||||
/obj/item/toy/prize/phazon = 1
|
||||
/obj/item/toy/prize/phazon = 1,
|
||||
/obj/item/toy/waterflower = 1
|
||||
)
|
||||
|
||||
/obj/machinery/computer/arcade
|
||||
|
||||
@@ -88,11 +88,11 @@
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
|
||||
var/area/A = get_area(src)
|
||||
ASSERT(istype(A))
|
||||
if(A.master)
|
||||
A = A.master
|
||||
var/alarmed = A.air_doors_activated || A.fire
|
||||
var/alarmed = 0
|
||||
|
||||
for(var/area/A in areas_added) //Checks if there are fire alarms in any areas associated with that firedoor
|
||||
if(A.fire || A.air_doors_activated)
|
||||
alarmed = 1
|
||||
|
||||
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\
|
||||
"\The [src]", "Yes, [density ? "open" : "close"]", "No")
|
||||
@@ -114,9 +114,13 @@
|
||||
|
||||
if(needs_to_close)
|
||||
spawn(50)
|
||||
alarmed = 0
|
||||
for(var/area/A in areas_added) //Just in case a fire alarm is turned off while the firedoor is going through an autoclose cycle
|
||||
if(A.fire || A.air_doors_activated)
|
||||
alarmed = 1
|
||||
if(alarmed)
|
||||
nextstate = CLOSED
|
||||
|
||||
close()
|
||||
|
||||
/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob)
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
icon = 'icons/obj/doors/rapid_pdoor.dmi'
|
||||
icon_state = "pdoor1"
|
||||
var/id = 1.0
|
||||
dir = 1
|
||||
explosion_resistance = 25
|
||||
|
||||
/obj/machinery/door/poddoor/Bumped(atom/AM)
|
||||
@@ -39,6 +40,7 @@
|
||||
src.icon_state = "pdoor0"
|
||||
src.SetOpacity(0)
|
||||
sleep(10)
|
||||
layer = initial(layer)
|
||||
src.density = 0
|
||||
update_nearby_tiles()
|
||||
|
||||
@@ -53,6 +55,7 @@
|
||||
if (src.operating)
|
||||
return
|
||||
src.operating = 1
|
||||
layer = 3.3
|
||||
flick("pdoorc1", src)
|
||||
src.icon_state = "pdoor1"
|
||||
src.density = 1
|
||||
|
||||
@@ -23,6 +23,10 @@ Buildable meters
|
||||
#define PIPE_MTVALVE 18
|
||||
#define PIPE_MANIFOLD4W 19
|
||||
#define PIPE_CAP 20
|
||||
///// Z-Level stuff
|
||||
#define PIPE_UP 21
|
||||
#define PIPE_DOWN 22
|
||||
///// Z-Level stuff
|
||||
|
||||
/obj/item/pipe
|
||||
name = "pipe"
|
||||
@@ -84,6 +88,12 @@ Buildable meters
|
||||
src.pipe_type = PIPE_MANIFOLD4W
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/cap))
|
||||
src.pipe_type = PIPE_CAP
|
||||
///// Z-Level stuff
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/zpipe/up))
|
||||
src.pipe_type = PIPE_UP
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/zpipe/down))
|
||||
src.pipe_type = PIPE_DOWN
|
||||
///// Z-Level stuff
|
||||
else
|
||||
src.pipe_type = pipe_type
|
||||
src.dir = dir
|
||||
@@ -117,6 +127,10 @@ Buildable meters
|
||||
"t-valve", \
|
||||
"4-way manifold", \
|
||||
"pipe cap", \
|
||||
///// Z-Level stuff
|
||||
"pipe up", \
|
||||
"pipe down", \
|
||||
///// Z-Level stuff
|
||||
)
|
||||
name = nlist[pipe_type+1] + " fitting"
|
||||
var/list/islist = list( \
|
||||
@@ -141,6 +155,10 @@ Buildable meters
|
||||
"mtvalve", \
|
||||
"manifold4w", \
|
||||
"cap", \
|
||||
///// Z-Level stuff
|
||||
"cap", \
|
||||
"cap", \
|
||||
///// Z-Level stuff
|
||||
)
|
||||
icon_state = islist[pipe_type + 1]
|
||||
|
||||
@@ -213,6 +231,10 @@ Buildable meters
|
||||
return dir|flip|cw
|
||||
if(PIPE_CAP)
|
||||
return flip
|
||||
///// Z-Level stuff
|
||||
if(PIPE_UP,PIPE_DOWN)
|
||||
return dir
|
||||
///// Z-Level stuff
|
||||
return 0
|
||||
|
||||
/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes
|
||||
@@ -348,7 +370,7 @@ Buildable meters
|
||||
if (M.node3)
|
||||
M.node3.initialize()
|
||||
M.node3.build_network()
|
||||
|
||||
|
||||
if(PIPE_MANIFOLD4W) //4-way manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
|
||||
M.dir = dir
|
||||
@@ -515,7 +537,7 @@ Buildable meters
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
|
||||
|
||||
if(PIPE_MTVALVE) //manual t-valve
|
||||
var/obj/machinery/atmospherics/tvalve/V = new(src.loc)
|
||||
V.dir = dir
|
||||
@@ -535,7 +557,7 @@ Buildable meters
|
||||
if (V.node3)
|
||||
V.node3.initialize()
|
||||
V.node3.build_network()
|
||||
|
||||
|
||||
if(PIPE_CAP)
|
||||
var/obj/machinery/atmospherics/pipe/cap/C = new(src.loc)
|
||||
C.dir = dir
|
||||
@@ -593,6 +615,40 @@ Buildable meters
|
||||
if (C.node)
|
||||
C.node.initialize()
|
||||
C.node.build_network()
|
||||
///// Z-Level stuff
|
||||
if(PIPE_UP) //volume pump
|
||||
var/obj/machinery/atmospherics/pipe/zpipe/up/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
if(PIPE_DOWN) //volume pump
|
||||
var/obj/machinery/atmospherics/pipe/zpipe/down/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
///// Z-Level stuff
|
||||
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user.visible_message( \
|
||||
@@ -649,4 +705,4 @@ Buildable meters
|
||||
#undef PIPE_VOLUME_PUMP
|
||||
#undef PIPE_OUTLET_INJECT
|
||||
#undef PIPE_MTVALVE
|
||||
//#undef PIPE_MANIFOLD4W
|
||||
//#undef PIPE_MANIFOLD4W
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
/obj/machinery/pipedispenser/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
///// Z-Level stuff
|
||||
var/dat = {"
|
||||
<b>Regular pipes:</b><BR>
|
||||
<A href='?src=\ref[src];make=0;dir=1'>Pipe</A><BR>
|
||||
@@ -22,6 +23,8 @@
|
||||
<A href='?src=\ref[src];make=20;dir=1'>Pipe Cap</A><BR>
|
||||
<A href='?src=\ref[src];make=19;dir=1'>4-Way Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=18;dir=1'>Manual T-Valve</A><BR>
|
||||
<A href='?src=\ref[src];make=21;dir=1'>upward Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=22;dir=1'>downward Pipe</A><BR>
|
||||
<b>Devices:</b><BR>
|
||||
<A href='?src=\ref[src];make=4;dir=1'>Connector</A><BR>
|
||||
<A href='?src=\ref[src];make=7;dir=1'>Unary Vent</A><BR>
|
||||
@@ -42,6 +45,7 @@
|
||||
<A href='?src=\ref[src];make=12;dir=5'>Bent Pipe</A><BR>
|
||||
|
||||
"}
|
||||
///// Z-Level stuff
|
||||
//What number the make points to is in the define # at the top of construction.dm in same folder
|
||||
|
||||
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
|
||||
@@ -143,6 +147,7 @@ Nah
|
||||
if(..())
|
||||
return
|
||||
|
||||
///// Z-Level stuff
|
||||
var/dat = {"<b>Disposal Pipes</b><br><br>
|
||||
<A href='?src=\ref[src];dmake=0'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];dmake=1'>Bent Pipe</A><BR>
|
||||
@@ -152,7 +157,10 @@ Nah
|
||||
<A href='?src=\ref[src];dmake=5'>Bin</A><BR>
|
||||
<A href='?src=\ref[src];dmake=6'>Outlet</A><BR>
|
||||
<A href='?src=\ref[src];dmake=7'>Chute</A><BR>
|
||||
<A href='?src=\ref[src];dmake=21'>Upwards</A><BR>
|
||||
<A href='?src=\ref[src];dmake=22'>Downwards</A><BR>
|
||||
"}
|
||||
///// Z-Level stuff
|
||||
|
||||
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
|
||||
return
|
||||
@@ -192,6 +200,12 @@ Nah
|
||||
if(7)
|
||||
C.ptype = 8
|
||||
C.density = 1
|
||||
///// Z-Level stuff
|
||||
if(21)
|
||||
C.ptype = 11
|
||||
if(22)
|
||||
C.ptype = 12
|
||||
///// Z-Level stuff
|
||||
C.add_fingerprint(usr)
|
||||
C.update()
|
||||
wait = 1
|
||||
@@ -203,7 +217,7 @@ Nah
|
||||
/obj/machinery/pipedispenser/orderable
|
||||
anchored = 0
|
||||
unwrenched = 1
|
||||
|
||||
|
||||
/obj/machinery/pipedispenser/disposal/orderable
|
||||
anchored = 0
|
||||
unwrenched = 1
|
||||
unwrenched = 1
|
||||
|
||||
@@ -6,21 +6,9 @@
|
||||
if(dx>=dy) return dx + (0.5*dy) //The longest side add half the shortest side approximates the hypotenuse
|
||||
else return dy + (0.5*dx)
|
||||
|
||||
|
||||
proc/trange(var/Dist=0,var/turf/Center=null)//alternative to range (ONLY processes turfs and thus less intensive)
|
||||
if(Center==null) return
|
||||
|
||||
//var/x1=((Center.x-Dist)<1 ? 1 : Center.x-Dist)
|
||||
//var/y1=((Center.y-Dist)<1 ? 1 : Center.y-Dist)
|
||||
//var/x2=((Center.x+Dist)>world.maxx ? world.maxx : Center.x+Dist)
|
||||
//var/y2=((Center.y+Dist)>world.maxy ? world.maxy : Center.y+Dist)
|
||||
|
||||
var/turf/x1y1 = locate(((Center.x-Dist)<1 ? 1 : Center.x-Dist),((Center.y-Dist)<1 ? 1 : Center.y-Dist),Center.z)
|
||||
var/turf/x2y2 = locate(((Center.x+Dist)>world.maxx ? world.maxx : Center.x+Dist),((Center.y+Dist)>world.maxy ? world.maxy : Center.y+Dist),Center.z)
|
||||
return block(x1y1,x2y2)
|
||||
|
||||
|
||||
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
|
||||
///// Z-Level Stuff
|
||||
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = 1)
|
||||
///// Z-Level Stuff
|
||||
src = null //so we don't abort once src is deleted
|
||||
spawn(0)
|
||||
if(config.use_recursive_explosions)
|
||||
@@ -28,6 +16,12 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
explosion_rec(epicenter, power)
|
||||
return
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(z_transfer && (devastation_range > 0 || heavy_impact_range > 0))
|
||||
//transfer the explosion in both directions
|
||||
explosion_z_transfer(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
///// Z-Level Stuff
|
||||
|
||||
var/start = world.timeofday
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter) return
|
||||
@@ -61,7 +55,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
var/y0 = epicenter.y
|
||||
var/z0 = epicenter.z
|
||||
|
||||
for(var/turf/T in trange(max(devastation_range, heavy_impact_range, light_impact_range), epicenter))
|
||||
for(var/turf/T in range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range)))
|
||||
var/dist = cheap_pythag(T.x - x0,T.y - y0)
|
||||
|
||||
if(dist < devastation_range) dist = 1
|
||||
@@ -98,4 +92,21 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
|
||||
proc/secondaryexplosion(turf/epicenter, range)
|
||||
for(var/turf/tile in range(range, epicenter))
|
||||
tile.ex_act(2)
|
||||
tile.ex_act(2)
|
||||
|
||||
///// Z-Level Stuff
|
||||
proc/explosion_z_transfer(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, up = 1, down = 1)
|
||||
var/turf/controllerlocation = locate(1, 1, epicenter.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
//start the child explosion, no admin log and no additional transfers
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.down_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 0)
|
||||
if(devastation_range - 2 > 0 || heavy_impact_range - 2 > 0) //only transfer further if the explosion is still big enough
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.down_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 1)
|
||||
|
||||
if(controller.up)
|
||||
//start the child explosion, no admin log and no additional transfers
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.up_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 0)
|
||||
if(devastation_range - 2 > 0 || heavy_impact_range - 2 > 0) //only transfer further if the explosion is still big enough
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.up_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 1, 0)
|
||||
///// Z-Level Stuff
|
||||
|
||||
@@ -312,22 +312,22 @@
|
||||
if(slot_l_ear)
|
||||
if(H.l_ear)
|
||||
return 0
|
||||
if( w_class < 2 )
|
||||
return 1
|
||||
if( !(slot_flags & SLOT_EARS) )
|
||||
return 0
|
||||
if( (slot_flags & SLOT_TWOEARS) && H.r_ear )
|
||||
return 0
|
||||
if( w_class < 2 )
|
||||
return 1
|
||||
return 1
|
||||
if(slot_r_ear)
|
||||
if(H.r_ear)
|
||||
return 0
|
||||
if( w_class < 2 )
|
||||
return 1
|
||||
if( !(slot_flags & SLOT_EARS) )
|
||||
return 0
|
||||
if( (slot_flags & SLOT_TWOEARS) && H.l_ear )
|
||||
return 0
|
||||
if( w_class < 2 )
|
||||
return 1
|
||||
return 1
|
||||
if(slot_w_uniform)
|
||||
if(H.w_uniform)
|
||||
@@ -488,7 +488,7 @@
|
||||
(H.glasses && H.glasses.flags & GLASSESCOVERSEYES) \
|
||||
))
|
||||
// you can't stab someone in the eyes wearing a mask!
|
||||
user << "\red You're going to need to remove that mask/helmet/glasses first."
|
||||
user << "\red You're going to need to remove the eye covering first."
|
||||
return
|
||||
|
||||
var/mob/living/carbon/monkey/Mo = M
|
||||
@@ -496,7 +496,7 @@
|
||||
(Mo.wear_mask && Mo.wear_mask.flags & MASKCOVERSEYES) \
|
||||
))
|
||||
// you can't stab someone in the eyes wearing a mask!
|
||||
user << "\red You're going to need to remove that mask/helmet/glasses first."
|
||||
user << "\red You're going to need to remove the eye covering first."
|
||||
return
|
||||
|
||||
if(istype(M, /mob/living/carbon/alien) || istype(M, /mob/living/carbon/slime))//Aliens don't have eyes./N slimes also don't have eyes!
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
|
||||
light("\red [user] casually lights the [name] with [W], what a badass.")
|
||||
light("\red [user] casually lights the [name] with [W].")
|
||||
else if(istype(W, /obj/item/weapon/lighter))
|
||||
var/obj/item/weapon/lighter/L = W
|
||||
if(L.lit)
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
|
||||
/obj/item/toy/crayon/attack(mob/M as mob, mob/user as mob)
|
||||
if(M == user)
|
||||
user << "You take a bite of the crayon. Delicious!"
|
||||
user.nutrition += 5
|
||||
user << "You take a bite of the crayon and swallow it."
|
||||
// user.nutrition += 5
|
||||
if(uses)
|
||||
uses -= 5
|
||||
if(uses <= 0)
|
||||
|
||||
@@ -27,6 +27,12 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
||||
ItemList = text2list(src.items, ";") // Parsing the items text string
|
||||
uses = ticker.mode.uplink_uses
|
||||
nanoui_items = generate_nanoui_items()
|
||||
for(var/D in ItemList)
|
||||
var/list/O = text2list(D, ":")
|
||||
if(O.len>0)
|
||||
valid_items += O[1]
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Built the Items List for use with NanoUI
|
||||
@@ -56,16 +62,6 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
||||
|
||||
return items_nano
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Halfassed fix for href exploit ~Z
|
||||
for(var/D in ItemList)
|
||||
var/list/O = text2list(D, ":")
|
||||
if(O.len>0)
|
||||
valid_items += O[1]
|
||||
|
||||
//Let's build a menu!
|
||||
/obj/item/device/uplink/proc/generate_menu()
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@
|
||||
|
||||
syndicate
|
||||
icon_state = "target_s"
|
||||
desc = "A shooting target that looks like a syndicate scum."
|
||||
desc = "A shooting target that looks like a hostile agent."
|
||||
hp = 2600 // i guess syndie targets are sturdier?
|
||||
alien
|
||||
icon_state = "target_q"
|
||||
desc = "A shooting target that looks like a xenomorphic alien."
|
||||
desc = "A shooting target with a threatening silhouette."
|
||||
hp = 2350 // alium onest too kinda
|
||||
|
||||
/obj/item/target/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
|
||||
/obj/item/toy/ammo/crossbow
|
||||
name = "foam dart"
|
||||
desc = "Its nerf or nothing! Ages 8 and up."
|
||||
desc = "It's nerf or nothing! Ages 8 and up."
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
icon_state = "foamdart"
|
||||
flags = FPRINT | TABLEPASS
|
||||
@@ -365,7 +365,7 @@
|
||||
|
||||
/obj/item/toy/crayon
|
||||
name = "crayon"
|
||||
desc = "A colourful crayon. Looks tasty. Mmmm..."
|
||||
desc = "A colourful crayon. Please refrain from eating it or putting it in your nose."
|
||||
icon = 'icons/obj/crayons.dmi'
|
||||
icon_state = "crayonred"
|
||||
w_class = 1.0
|
||||
|
||||
@@ -82,17 +82,17 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.isOn())//Badasses dont get blinded while lighting their cig with a welding tool
|
||||
light("<span class='notice'>[user] casually lights the [name] with [W], what a badass.</span>")
|
||||
light("<span class='notice'>[user] casually lights the [name] with [W].</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/lighter/zippo))
|
||||
var/obj/item/weapon/lighter/zippo/Z = W
|
||||
if(Z.lit)
|
||||
light("<span class='rose'>With a single flick of their wrist, [user] smoothly lights their [name] with their [W]. Damn they're cool.</span>")
|
||||
light("<span class='rose'>With a flick of their wrist, [user] lights their [name] with their [W].</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/lighter))
|
||||
var/obj/item/weapon/lighter/L = W
|
||||
if(L.lit)
|
||||
light("<span class='notice'>After some fiddling, [user] manages to light their [name] with [W].</span>")
|
||||
light("<span class='notice'>[user] manages to light their [name] with [W].</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/match))
|
||||
var/obj/item/weapon/match/M = W
|
||||
@@ -309,7 +309,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
|
||||
/obj/item/clothing/mask/cigarette/pipe/cobpipe
|
||||
name = "corn cob pipe"
|
||||
desc = "A nicotine delivery system popularized by folksy backwoodsmen and kept popular in the modern age and beyond by space hipsters."
|
||||
desc = "A nicotine delivery system popularized by folksy backwoodsmen, kept popular in the modern age and beyond by space hipsters."
|
||||
icon_state = "cobpipeoff"
|
||||
item_state = "cobpipeoff"
|
||||
icon_on = "cobpipeon" //Note - these are in masks.dmi
|
||||
@@ -360,7 +360,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
if(istype(src, /obj/item/weapon/lighter/zippo) )
|
||||
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
|
||||
else
|
||||
if(prob(75))
|
||||
if(prob(95))
|
||||
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src].</span>")
|
||||
else
|
||||
user << "<span class='warning'>You burn yourself while lighting the lighter.</span>"
|
||||
@@ -374,7 +374,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
icon_state = icon_off
|
||||
item_state = icon_off
|
||||
if(istype(src, /obj/item/weapon/lighter/zippo) )
|
||||
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing. Wow.")
|
||||
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] quietly shuts off the [src].")
|
||||
|
||||
@@ -395,7 +395,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
cig.attackby(src, user)
|
||||
else
|
||||
if(istype(src, /obj/item/weapon/lighter/zippo))
|
||||
cig.light("<span class='rose'>[user] whips the [name] out and holds it for [M]. Their arm is as steady as the unflickering flame they light \the [cig] with.</span>")
|
||||
cig.light("<span class='rose'>[user] whips the [name] out and holds it for [M].</span>")
|
||||
else
|
||||
cig.light("<span class='notice'>[user] holds the [name] out for [M], and lights the [cig.name].</span>")
|
||||
else
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
/obj/item/weapon/book/manual/supermatter_engine
|
||||
name = "Supermatter Engine User's Guide"
|
||||
icon_state = "bookParticleAccelerator" //TEMP FIXME
|
||||
icon_state = "bookSupermatter"
|
||||
author = "Waleed Asad"
|
||||
title = "Supermatter Engine User's Guide"
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
/obj/structure/lattice/New()
|
||||
..()
|
||||
if(!(istype(src.loc, /turf/space)))
|
||||
///// Z-Level Stuff
|
||||
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/floor/open)))
|
||||
///// Z-Level Stuff
|
||||
del(src)
|
||||
for(var/obj/structure/lattice/LAT in src.loc)
|
||||
if(LAT != src)
|
||||
@@ -80,4 +82,4 @@
|
||||
dir_sum += direction
|
||||
|
||||
icon_state = "lattice[dir_sum]"
|
||||
return
|
||||
return
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
if(I.type == /obj/item/device/analyzer)
|
||||
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
user << "<span class='notice'>You begin to adjust the temperature valve with the [I].</span>"
|
||||
user << "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>"
|
||||
if(do_after(user, 50))
|
||||
switch(watertemp)
|
||||
if("normal")
|
||||
@@ -162,7 +162,7 @@
|
||||
watertemp = "boiling"
|
||||
if("boiling")
|
||||
watertemp = "normal"
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with the [I].</span>", "<span class='notice'>You adjust the shower with the [I].</span>")
|
||||
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
|
||||
@@ -354,7 +354,7 @@
|
||||
if (istype(O, /obj/item/weapon/reagent_containers))
|
||||
var/obj/item/weapon/reagent_containers/RG = O
|
||||
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
|
||||
user.visible_message("\blue [user] fills the [RG] using \the [src].","\blue You fill the [RG] using \the [src].")
|
||||
user.visible_message("\blue [user] fills \the [RG] using \the [src].","\blue You fill \the [RG] using \the [src].")
|
||||
return
|
||||
|
||||
else if (istype(O, /obj/item/weapon/melee/baton))
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
..()
|
||||
name = "floor"
|
||||
|
||||
/turf/simulated/floor/airless/ceiling
|
||||
icon_state = "rockvault"
|
||||
|
||||
/turf/simulated/floor/light
|
||||
name = "Light floor"
|
||||
luminosity = 5
|
||||
|
||||
@@ -200,6 +200,20 @@
|
||||
if (!N)
|
||||
return
|
||||
|
||||
///// Z-Level Stuff ///// This makes sure that turfs are not changed to space when one side is part of a zone
|
||||
if(N == /turf/space)
|
||||
var/turf/controller = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in controller)
|
||||
if(c.down)
|
||||
var/turf/below = locate(src.x, src.y, c.down_target)
|
||||
if((below.zone || zone) && !istype(below, /turf/space)) // dont make open space into space, its pointless and makes people drop out of the station
|
||||
var/turf/W = src.ChangeTurf(/turf/simulated/floor/open)
|
||||
var/list/temp = list()
|
||||
temp += W
|
||||
c.add(temp,3,1) // report the new open space to the zcontroller
|
||||
return W
|
||||
///// Z-Level Stuff
|
||||
|
||||
var/old_lumcount = lighting_lumcount - initial(lighting_lumcount)
|
||||
|
||||
if(ispath(N, /turf/simulated/floor))
|
||||
@@ -337,4 +351,4 @@
|
||||
if(!t.density)
|
||||
if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t))
|
||||
L.Add(t)
|
||||
return L
|
||||
return L
|
||||
|
||||
@@ -90,6 +90,7 @@ var/datum/engine_eject/engine_eject_control = null
|
||||
var/host = null
|
||||
var/aliens_allowed = 0
|
||||
var/ooc_allowed = 1
|
||||
var/dsay_allowed = 1
|
||||
var/dooc_allowed = 1
|
||||
var/traitor_scaling = 1
|
||||
//var/goonsay_allowed = 0
|
||||
|
||||
@@ -696,7 +696,7 @@ var/global/floorIsLava = 0
|
||||
|
||||
/datum/admins/proc/toggleooc()
|
||||
set category = "Server"
|
||||
set desc="Toggle dis bitch"
|
||||
set desc="Globally Toggles OOC"
|
||||
set name="Toggle OOC"
|
||||
ooc_allowed = !( ooc_allowed )
|
||||
if (ooc_allowed)
|
||||
@@ -707,6 +707,20 @@ var/global/floorIsLava = 0
|
||||
message_admins("[key_name_admin(usr)] toggled OOC.", 1)
|
||||
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/datum/admins/proc/toggledsay()
|
||||
set category = "Server"
|
||||
set desc="Globally Toggles DSAY"
|
||||
set name="Toggle DSAY"
|
||||
dsay_allowed = !( dsay_allowed )
|
||||
if (dsay_allowed)
|
||||
world << "<B>Deadchat has been globally enabled!</B>"
|
||||
else
|
||||
world << "<B>Deadchat has been globally disabled!</B>"
|
||||
log_admin("[key_name(usr)] toggled deadchat.")
|
||||
message_admins("[key_name_admin(usr)] toggled deadchat.", 1)
|
||||
feedback_add_details("admin_verb","TDSAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc
|
||||
|
||||
/datum/admins/proc/toggleoocdead()
|
||||
set category = "Server"
|
||||
set desc="Toggle dis bitch"
|
||||
|
||||
@@ -55,6 +55,7 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/secrets,
|
||||
/datum/admins/proc/toggleooc, /*toggles ooc on/off for everyone*/
|
||||
/datum/admins/proc/toggleoocdead, /*toggles ooc on/off for everyone who is dead*/
|
||||
/datum/admins/proc/toggledsay, /*toggles dsay on/off for everyone*/
|
||||
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
|
||||
/client/proc/cmd_admin_say, /*admin-only ooc chat*/
|
||||
/datum/admins/proc/PlayerNotes,
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
//Atmospherics Rig (BS12)
|
||||
/obj/item/clothing/head/helmet/space/rig/atmos
|
||||
desc = "A special helmet designed for work in a hazardou, low pressure environments. Has reduced radiation shielding and protective plating to allow for greater mobility."
|
||||
desc = "A special helmet designed for work in a hazardous, low pressure environments. Has reduced radiation shielding and protective plating to allow for greater mobility."
|
||||
name = "atmospherics hardsuit helmet"
|
||||
icon_state = "rig0-atmos"
|
||||
item_state = "atmos_helm"
|
||||
|
||||
@@ -513,6 +513,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>Spawning as a mouse is currently disabled.</span>"
|
||||
return
|
||||
|
||||
var/mob/dead/observer/M = usr
|
||||
if(config.antag_hud_restricted && M.has_enabled_antagHUD == 1)
|
||||
src << "<span class='warning'>antagHUD restrictions prevent you from spawning in as a mouse.</span>"
|
||||
return
|
||||
|
||||
var/timedifference = world.time - client.time_died_as_mouse
|
||||
if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600)
|
||||
var/timedifference_text
|
||||
|
||||
@@ -57,6 +57,12 @@
|
||||
src << "\red You have deadchat muted."
|
||||
return
|
||||
|
||||
if(!src.client.holder)
|
||||
if(!dsay_allowed)
|
||||
src << "\red Deadchat is globally muted"
|
||||
return
|
||||
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = copytext(sanitize(input(src, "Choose an emote to display.") as text|null), 1, MAX_MESSAGE_LEN)
|
||||
|
||||
@@ -1192,6 +1192,13 @@
|
||||
see_in_dark = 8
|
||||
if(!druggy) see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
if(healths) healths.icon_state = "health7" //DEAD healthmeter
|
||||
if(client)
|
||||
if(client.view != world.view)
|
||||
if(locate(/obj/item/weapon/gun/energy/sniperrifle, contents))
|
||||
var/obj/item/weapon/gun/energy/sniperrifle/s = locate() in src
|
||||
if(s.zoom)
|
||||
s.zoom()
|
||||
|
||||
else
|
||||
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
||||
see_in_dark = species.darksight
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
set desc = "Grow to a more complex form."
|
||||
|
||||
if(!is_alien_whitelisted(src, "Diona") && config.usealienwhitelist)
|
||||
src << alert("You are currently not whitelisted to play an adult Diona.")
|
||||
src << alert("You are currently not whitelisted to play as a full diona.")
|
||||
return 0
|
||||
|
||||
if(donors.len < 5)
|
||||
@@ -190,4 +190,4 @@
|
||||
universal_speak = 1
|
||||
src << "\green You feel your awareness expand, and realize you know how to speak with the creatures around you."
|
||||
else
|
||||
src << "\green The blood seeps into your small form, and you draw out the echoes of memories and personality from it, working them into your budding mind."
|
||||
src << "\green The blood seeps into your small form, and you draw out the echoes of memories and personality from it, working them into your budding mind."
|
||||
|
||||
@@ -124,11 +124,11 @@
|
||||
|
||||
/obj/item/broken_device
|
||||
name = "broken component"
|
||||
icon = 'icons/robot_component.dmi'
|
||||
icon = 'icons/obj/robot_component.dmi'
|
||||
icon_state = "broken"
|
||||
|
||||
/obj/item/robot_parts/robot_component
|
||||
icon = 'icons/robot_component.dmi'
|
||||
icon = 'icons/obj/robot_component.dmi'
|
||||
icon_state = "working"
|
||||
construction_time = 200
|
||||
construction_cost = list("metal"=5000)
|
||||
@@ -214,4 +214,4 @@
|
||||
if(H.emagged && prob(5))
|
||||
user.show_message("\red \t ERROR: INTERNAL SYSTEMS COMPROMISED",1)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -707,8 +707,7 @@
|
||||
locked = 0
|
||||
else
|
||||
user << "You fail to emag the cover lock."
|
||||
if(prob(25))
|
||||
src << "Hack attempt detected."
|
||||
src << "Hack attempt detected."
|
||||
else
|
||||
user << "The cover is already unlocked."
|
||||
return
|
||||
@@ -725,7 +724,7 @@
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
user << "You emag [src]'s interface."
|
||||
// message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
|
||||
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
|
||||
clear_supplied_laws()
|
||||
clear_inherent_laws()
|
||||
@@ -737,7 +736,7 @@
|
||||
sleep(5)
|
||||
src << "\red Initiating diagnostics..."
|
||||
sleep(20)
|
||||
src << "\red SynBorg v1.7 loaded."
|
||||
src << "\red SynBorg v1.7.1 loaded."
|
||||
sleep(5)
|
||||
src << "\red LAW SYNCHRONISATION ERROR"
|
||||
sleep(5)
|
||||
@@ -756,9 +755,8 @@
|
||||
src.module.rebuild()
|
||||
updateicon()
|
||||
else
|
||||
user << "You fail to [ locked ? "unlock" : "lock"] [src]'s interface."
|
||||
if(prob(25))
|
||||
src << "Hack attempt detected."
|
||||
user << "You fail to hack [src]'s interface."
|
||||
src << "Hack attempt detected."
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/borg/upgrade/))
|
||||
@@ -797,7 +795,7 @@
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src]'s plating with its scythe like arm."), 1)
|
||||
O.show_message(text("\blue [M] caresses [src]'s plating with its scythe-like arm."), 1)
|
||||
|
||||
if ("grab")
|
||||
if (M == src)
|
||||
@@ -816,13 +814,6 @@
|
||||
if ("hurt")
|
||||
var/damage = rand(10, 20)
|
||||
if (prob(90))
|
||||
/*
|
||||
if (M.class == "combat")
|
||||
damage += 15
|
||||
if(prob(20))
|
||||
weakened = max(weakened,4)
|
||||
stunned = max(stunned,4)
|
||||
What is this?*/
|
||||
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
|
||||
@@ -186,6 +186,12 @@
|
||||
if(L.incorporeal_move)//Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return
|
||||
if(mob.client)
|
||||
if(mob.client.view != world.view)
|
||||
if(locate(/obj/item/weapon/gun/energy/sniperrifle, mob.contents)) // If mob moves while zoomed in with sniper rifle, unzoom them.
|
||||
var/obj/item/weapon/gun/energy/sniperrifle/s = locate() in mob
|
||||
if(s.zoom)
|
||||
s.zoom()
|
||||
|
||||
if(Process_Grab()) return
|
||||
|
||||
@@ -447,4 +453,4 @@
|
||||
prob_slip = 0 // Changing this to zero to make it line up with the comment.
|
||||
|
||||
prob_slip = round(prob_slip)
|
||||
return(prob_slip)
|
||||
return(prob_slip)
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
usr << "\red Speech is currently admin-disabled."
|
||||
return
|
||||
|
||||
if(!src.client.holder)
|
||||
if(!dsay_allowed)
|
||||
src << "\red Deadchat is globally muted"
|
||||
return
|
||||
|
||||
if(client && !(client.prefs.toggles & CHAT_DEAD))
|
||||
usr << "\red You have deadchat muted."
|
||||
return
|
||||
|
||||
@@ -110,6 +110,12 @@
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 12 || src.d2 == 12)
|
||||
user << "<span class='warning'>You must cut this cable from above.</span>"
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
|
||||
// if(power_switch)
|
||||
// user << "\red This piece of cable is tied to a power switch. Flip the switch to remove it."
|
||||
// return
|
||||
@@ -125,6 +131,17 @@
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'>[user] cuts the cable.</span>", 1)
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 11 || src.d2 == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/structure/cable/c in below)
|
||||
if(c.d1 == 12 || c.d2 == 12)
|
||||
c.Del()
|
||||
///// Z-Level Stuff
|
||||
|
||||
del(src)
|
||||
|
||||
return // not needed, but for clarity
|
||||
@@ -324,29 +341,75 @@
|
||||
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
|
||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
// check if the target is open space
|
||||
if(istype(F, /turf/simulated/floor/open))
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
|
||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||
return
|
||||
|
||||
var/obj/structure/cable/C = new(F)
|
||||
var/turf/simulated/floor/open/temp = F
|
||||
var/obj/structure/cable/C = new(F)
|
||||
var/obj/structure/cable/D = new(temp.floorbelow)
|
||||
|
||||
C.cableColor(item_color)
|
||||
C.cableColor(item_color)
|
||||
|
||||
C.d1 = 0
|
||||
C.d2 = dirn
|
||||
C.add_fingerprint(user)
|
||||
C.updateicon()
|
||||
C.d1 = 11
|
||||
C.d2 = dirn
|
||||
C.add_fingerprint(user)
|
||||
C.updateicon()
|
||||
|
||||
C.powernet = new()
|
||||
powernets += C.powernet
|
||||
C.powernet.cables += C
|
||||
C.powernet = new()
|
||||
powernets += C.powernet
|
||||
C.powernet.cables += C
|
||||
|
||||
C.mergeConnectedNetworks(C.d2)
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
C.mergeConnectedNetworks(C.d2)
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
|
||||
D.cableColor(item_color)
|
||||
|
||||
D.d1 = 12
|
||||
D.d2 = 0
|
||||
D.add_fingerprint(user)
|
||||
D.updateicon()
|
||||
|
||||
D.powernet = C.powernet
|
||||
D.powernet.cables += D
|
||||
|
||||
D.mergeConnectedNetworksOnTurf()
|
||||
|
||||
// do the normal stuff
|
||||
else
|
||||
///// Z-Level Stuff
|
||||
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
|
||||
user << "There's already a cable at that position."
|
||||
return
|
||||
|
||||
var/obj/structure/cable/C = new(F)
|
||||
|
||||
C.cableColor(item_color)
|
||||
|
||||
C.d1 = 0
|
||||
C.d2 = dirn
|
||||
C.add_fingerprint(user)
|
||||
C.updateicon()
|
||||
|
||||
C.powernet = new()
|
||||
powernets += C.powernet
|
||||
C.powernet.cables += C
|
||||
|
||||
C.mergeConnectedNetworks(C.d2)
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
|
||||
|
||||
use(1)
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/weapon/cable_coil(C.loc, 1, C.cable_color)
|
||||
del(C)
|
||||
use(1)
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/weapon/cable_coil(C.loc, 1, C.cable_color)
|
||||
del(C)
|
||||
//src.laying = 1
|
||||
//last = C
|
||||
|
||||
|
||||
@@ -112,7 +112,17 @@
|
||||
// if unmarked==1, only return those with no powernet
|
||||
/proc/power_list(var/turf/T, var/source, var/d, var/unmarked=0)
|
||||
. = list()
|
||||
var/fdir = (!d)? 0 : turn(d, 180) // the opposite direction to d (or 0 if d==0)
|
||||
var/fdir = (!d)? 0 : turn(d, 180)
|
||||
// the opposite direction to d (or 0 if d==0)
|
||||
///// Z-Level Stuff
|
||||
var/Zdir
|
||||
if(d==11)
|
||||
Zdir = 11
|
||||
else if (d==12)
|
||||
Zdir = 12
|
||||
else
|
||||
Zdir = 999
|
||||
///// Z-Level Stuff
|
||||
// world.log << "d=[d] fdir=[fdir]"
|
||||
for(var/AM in T)
|
||||
if(AM == source) continue //we don't want to return source
|
||||
@@ -129,7 +139,9 @@
|
||||
var/obj/structure/cable/C = AM
|
||||
|
||||
if(!unmarked || !C.powernet)
|
||||
if(C.d1 == fdir || C.d2 == fdir)
|
||||
///// Z-Level Stuff
|
||||
if(C.d1 == fdir || C.d2 == fdir || C.d1 == Zdir || C.d2 == Zdir)
|
||||
///// Z-Level Stuff
|
||||
. += C
|
||||
else if(C.d1 == turn(C.d2, 180))
|
||||
. += C
|
||||
@@ -140,11 +152,43 @@
|
||||
. = list() // this will be a list of all connected power objects
|
||||
var/turf/T = loc
|
||||
|
||||
if(d1) T = get_step(src, d1)
|
||||
if(T) . += power_list(T, src, d1, 1)
|
||||
///// Z-Level Stuff
|
||||
if(d1)
|
||||
if(d1 <= 10)
|
||||
T = get_step(src, d1)
|
||||
if(T)
|
||||
. += power_list(T, src, d1, 1)
|
||||
else if (d1 == 11 || d1 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d1 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d1 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
else if(!d1)
|
||||
if(T)
|
||||
. += power_list(T, src, d1, 1)
|
||||
|
||||
T = get_step(src, d2)
|
||||
if(T) . += power_list(T, src, d2, 1)
|
||||
if(d2 == 11 || d2 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d2 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d2 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
else
|
||||
T = get_step(src, d2)
|
||||
if(T)
|
||||
. += power_list(T, src, d2, 1)
|
||||
///// Z-Level Stuff
|
||||
|
||||
return .
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ var/global/list/rad_collectors = list()
|
||||
P.air_contents.toxins = 0
|
||||
eject()
|
||||
else
|
||||
P.air_contents.toxins -= 0.001*drainratio
|
||||
P.air_contents.adjust(tx = -0.001*drainratio)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
//world << "[href] ; [href_list[href]]"
|
||||
|
||||
if (!istype(src.loc, /turf) || istype(usr, /mob/living/silicon/ai))
|
||||
if (!istype(src.loc, /turf) && !istype(usr, /mob/living/silicon/))
|
||||
return 0 // Do not update ui
|
||||
|
||||
if( href_list["cmode"] )
|
||||
|
||||
@@ -205,37 +205,54 @@ obj/item/weapon/gun/energy/staff/focus
|
||||
projectile_type = "/obj/item/projectile/energy/plasma"
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle
|
||||
name = "L.W.A.P. Sniper Rifle"
|
||||
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "sniper"
|
||||
fire_sound = 'sound/weapons/marauder.ogg'
|
||||
origin_tech = "combat=6;materials=5;powerstorage=4"
|
||||
projectile_type = "/obj/item/projectile/beam/sniper"
|
||||
slot_flags = SLOT_BACK
|
||||
charge_cost = 250
|
||||
fire_delay = 35
|
||||
w_class = 4.0
|
||||
|
||||
var/zoom = 0
|
||||
name = "L.W.A.P. Sniper Rifle"
|
||||
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "sniper"
|
||||
fire_sound = 'sound/weapons/marauder.ogg'
|
||||
origin_tech = "combat=6;materials=5;powerstorage=4"
|
||||
projectile_type = "/obj/item/projectile/beam/sniper"
|
||||
slot_flags = SLOT_BACK
|
||||
charge_cost = 250
|
||||
fire_delay = 35
|
||||
w_class = 4.0
|
||||
var/zoom = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/dropped(mob/user)
|
||||
user.client.view = world.view
|
||||
zoom = 0
|
||||
|
||||
|
||||
|
||||
/*
|
||||
This is called from
|
||||
modules/mob/mob_movement.dm if you move you will be zoomed out
|
||||
modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
*/
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/verb/zoom()
|
||||
set category = "Special Verbs"
|
||||
set name = "Zoom"
|
||||
set popup_menu = 0
|
||||
if(usr.stat || !(istype(usr,/mob/living/carbon/human)))
|
||||
usr << "No."
|
||||
return
|
||||
set category = "Object"
|
||||
set name = "Use Sniper Scope"
|
||||
set popup_menu = 0
|
||||
if(usr.stat || !(istype(usr,/mob/living/carbon/human)))
|
||||
usr << "You are unable to focus down the scope of the rifle."
|
||||
return
|
||||
if(!zoom && global_hud.darkMask[1] in usr.client.screen)
|
||||
usr << "Your welding equipment gets in the way of you looking down the scope"
|
||||
return
|
||||
if(!zoom && usr.get_active_hand() != src)
|
||||
usr << "You are too distracted to look down the scope, perhaps if it was in your active hand this might work better"
|
||||
return
|
||||
|
||||
src.zoom = !src.zoom
|
||||
usr << ("<font color='[src.zoom?"blue":"red"]'>Zoom mode [zoom?"en":"dis"]abled.</font>")
|
||||
if(zoom)
|
||||
usr.client.view = 12
|
||||
usr << sound('sound/mecha/imag_enh.ogg',volume=50)
|
||||
else
|
||||
usr.client.view = world.view//world.view - default mob view size
|
||||
return
|
||||
if(usr.client.view == world.view)
|
||||
if(!usr.hud_used.hud_shown)
|
||||
usr.button_pressed_F12(1) // If the user has already limited their HUD this avoids them having a HUD when they zoom in
|
||||
usr.button_pressed_F12(1)
|
||||
usr.client.view = 12
|
||||
zoom = 1
|
||||
else
|
||||
usr.client.view = world.view
|
||||
if(!usr.hud_used.hud_shown)
|
||||
usr.button_pressed_F12(1)
|
||||
zoom = 0
|
||||
usr << "<font color='[zoom?"blue":"red"]'>Zoom mode [zoom?"en":"dis"]abled.</font>"
|
||||
return
|
||||
|
||||
@@ -177,7 +177,7 @@ mob/living/proc/Targeted(var/obj/item/weapon/gun/I) //Self explanitory.
|
||||
target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locked")
|
||||
update_targeted()
|
||||
|
||||
//Adding the buttons to the controler person
|
||||
//Adding the buttons to the controller person
|
||||
var/mob/living/T = I.loc
|
||||
if(T)
|
||||
if(T.client)
|
||||
|
||||
@@ -1,39 +1,67 @@
|
||||
/proc/GetColors(hex) //Actually converts hex to rgb
|
||||
hex = uppertext(hex)
|
||||
var/hi1 = text2ascii(hex, 2)
|
||||
var/lo1 = text2ascii(hex, 3)
|
||||
var/hi2 = text2ascii(hex, 4)
|
||||
var/lo2 = text2ascii(hex, 5)
|
||||
var/hi3 = text2ascii(hex, 6)
|
||||
var/lo3 = text2ascii(hex, 7)
|
||||
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
|
||||
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
|
||||
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))
|
||||
|
||||
/proc/mix_color_from_reagents(var/list/reagent_list)
|
||||
if(!reagent_list || !reagent_list.len) return 0
|
||||
if(!reagent_list || !length(reagent_list))
|
||||
return 0
|
||||
|
||||
var/list/rgbcolor = list(0,0,0)
|
||||
var/finalcolor = 0
|
||||
for(var/datum/reagent/re in reagent_list) //TODO: weigh final colour by amount of reagents; make this algorithm use hex
|
||||
if(!finalcolor)
|
||||
rgbcolor = GetColors(re.color)
|
||||
finalcolor = re.color
|
||||
else
|
||||
var/newcolor[3]
|
||||
var/prergbcolor[3]
|
||||
prergbcolor = rgbcolor
|
||||
newcolor = GetColors(re.color)
|
||||
var/contents = length(reagent_list)
|
||||
var/list/weight = new /list(contents)
|
||||
var/list/redcolor = new /list(contents)
|
||||
var/list/greencolor = new /list(contents)
|
||||
var/list/bluecolor = new /list(contents)
|
||||
var/i
|
||||
|
||||
rgbcolor[1] = (prergbcolor[1]+newcolor[1])/2
|
||||
rgbcolor[2] = (prergbcolor[2]+newcolor[2])/2
|
||||
rgbcolor[3] = (prergbcolor[3]+newcolor[3])/2
|
||||
//fill the list of weights
|
||||
for(i=1; i<=contents; i++)
|
||||
var/datum/reagent/re = reagent_list[i]
|
||||
var/reagentweight = re.volume
|
||||
if(istype(re, /datum/reagent/paint))
|
||||
reagentweight *= 20 //Paint colours a mixture twenty times as much
|
||||
weight[i] = reagentweight
|
||||
|
||||
finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3])
|
||||
|
||||
//fill the lists of colours
|
||||
for(i=1; i<=contents; i++)
|
||||
var/datum/reagent/re = reagent_list[i]
|
||||
var/hue = re.color
|
||||
if(length(hue) != 7)
|
||||
return 0
|
||||
redcolor[i]=hex2num(copytext(hue,2,4))
|
||||
greencolor[i]=hex2num(copytext(hue,4,6))
|
||||
bluecolor[i]=hex2num(copytext(hue,6,8))
|
||||
|
||||
//mix all the colors
|
||||
var/red = mixOneColor(weight,redcolor)
|
||||
var/green = mixOneColor(weight,greencolor)
|
||||
var/blue = mixOneColor(weight,bluecolor)
|
||||
|
||||
//assemble all the pieces
|
||||
var/finalcolor = "#[red][green][blue]"
|
||||
return finalcolor
|
||||
|
||||
// This isn't a perfect color mixing system, the more reagents that are inside,
|
||||
// the darker it gets until it becomes absolutely pitch black! I dunno, maybe
|
||||
// that's pretty realistic? I don't do a whole lot of color-mixing anyway.
|
||||
// If you add brighter colors to it it'll eventually get lighter, though.
|
||||
/proc/mixOneColor(var/list/weight, var/list/color)
|
||||
if (!weight || !color || length(weight)!=length(color))
|
||||
return 0
|
||||
|
||||
var/contents = length(weight)
|
||||
var/i
|
||||
|
||||
//normalize weights
|
||||
var/listsum = 0
|
||||
for(i=1; i<=contents; i++)
|
||||
listsum += weight[i]
|
||||
for(i=1; i<=contents; i++)
|
||||
weight[i] /= listsum
|
||||
|
||||
//mix them
|
||||
var/mixedcolor = 0
|
||||
for(i=1; i<=contents; i++)
|
||||
mixedcolor += weight[i]*color[i]
|
||||
mixedcolor = round(mixedcolor)
|
||||
|
||||
//until someone writes a formal proof for this algorithm, let's keep this in
|
||||
if(mixedcolor<0x00 || mixedcolor>0xFF)
|
||||
return 0
|
||||
|
||||
var/finalcolor = num2hex(mixedcolor)
|
||||
while(length(finalcolor)<2)
|
||||
finalcolor = text("0[]",finalcolor) //Takes care of leading zeroes
|
||||
return finalcolor
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/obj/machinery/chem_dispenser/process()
|
||||
|
||||
if(recharged < 0)
|
||||
if(recharged <= 0)
|
||||
recharge()
|
||||
recharged = 15
|
||||
else
|
||||
@@ -68,7 +68,7 @@
|
||||
options[/obj/item/stack/sheet/mineral/gold] = "Wire a golden filament to fix it."
|
||||
options[/obj/item/stack/sheet/plasteel] = "Surround the outside with a plasteel cover to fix it."
|
||||
options[/obj/item/stack/sheet/rglass] = "Insert a pane of reinforced glass to fix it."
|
||||
|
||||
stat |= BROKEN
|
||||
while(amount > 0)
|
||||
amount -= 1
|
||||
|
||||
@@ -104,13 +104,12 @@
|
||||
*
|
||||
* @return nothing
|
||||
*/
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(user.stat || user.restrained()) return
|
||||
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null)
|
||||
if(broken_requirements.len)
|
||||
user << "<span class='warning'>[src] is broken. [broken_requirements[broken_requirements[1]]]</span>"
|
||||
return
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(user.stat || user.restrained()) return
|
||||
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
@@ -140,15 +139,15 @@
|
||||
if(temp)
|
||||
chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("dispense" = temp.id)))) // list in a list because Byond merges the first list...
|
||||
data["chemicals"] = chemicals
|
||||
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "chem_dispenser.tmpl", ui_title, 380, 650)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
|
||||
@@ -194,6 +193,8 @@
|
||||
else
|
||||
user.drop_item()
|
||||
del(B)
|
||||
if(broken_requirements.len==0)
|
||||
stat ^= BROKEN
|
||||
return
|
||||
if(src.beaker)
|
||||
user << "Something is already loaded into the machine."
|
||||
@@ -1258,4 +1259,4 @@
|
||||
var/amount = O.reagents.total_volume
|
||||
O.reagents.trans_to(beaker, amount)
|
||||
if(!O.reagents.total_volume)
|
||||
remove_object(O)
|
||||
remove_object(O)
|
||||
|
||||
@@ -1393,13 +1393,6 @@ datum
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
holywater
|
||||
name = "Holy Water"
|
||||
id = "holywater"
|
||||
description = "This was once water, but has been altered by higher powers."
|
||||
reagent_state = LIQUID
|
||||
color = "#535E66" // rgb: 83, 94, 102
|
||||
|
||||
nanites
|
||||
name = "Nanomachines"
|
||||
id = "nanites"
|
||||
|
||||
@@ -485,7 +485,7 @@ datum
|
||||
name = "Potassium Chlorophoride"
|
||||
id = "potassium_chlorophoride"
|
||||
result = "potassium_chlorophoride"
|
||||
required_reagents = list("potassium_chloride" = 1, "plasma" = 1, "chloral_hydrate" = 1)
|
||||
required_reagents = list("potassium_chloride" = 1, "plasma" = 1, "chloralhydrate" = 1)
|
||||
result_amount = 4
|
||||
|
||||
stoxin
|
||||
|
||||
@@ -47,11 +47,10 @@
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
usr << "\blue It contains "
|
||||
if(reagents && reagents.reagent_list.len)
|
||||
usr << "\blue [src.reagents.total_volume] units of liquid."
|
||||
usr << "\blue It contains [src.reagents.total_volume] units of liquid."
|
||||
else
|
||||
usr << "\blue nothing."
|
||||
usr << "\blue It is empty."
|
||||
if (!is_open_container())
|
||||
usr << "\blue Airtight lid seals it completely."
|
||||
|
||||
|
||||
@@ -65,9 +65,19 @@
|
||||
if(10)
|
||||
base_state = "pipe-j2s"
|
||||
dpdir = dir | left | flip
|
||||
///// Z-Level stuff
|
||||
if(11)
|
||||
base_state = "pipe-u"
|
||||
dpdir = dir
|
||||
if(12)
|
||||
base_state = "pipe-d"
|
||||
dpdir = dir
|
||||
///// Z-Level stuff
|
||||
|
||||
|
||||
if(ptype<6 || ptype>8)
|
||||
///// Z-Level stuff
|
||||
if(ptype<6 || ptype>8 && !(ptype==11 || ptype==12))
|
||||
///// Z-Level stuff
|
||||
icon_state = "con[base_state]"
|
||||
else
|
||||
icon_state = base_state
|
||||
@@ -139,6 +149,12 @@
|
||||
return /obj/machinery/disposal/deliveryChute
|
||||
if(9,10)
|
||||
return /obj/structure/disposalpipe/sortjunction
|
||||
///// Z-Level stuff
|
||||
if(11)
|
||||
return /obj/structure/disposalpipe/up
|
||||
if(12)
|
||||
return /obj/structure/disposalpipe/down
|
||||
///// Z-Level stuff
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -873,6 +873,12 @@
|
||||
C.ptype = 9
|
||||
if("pipe-j2s")
|
||||
C.ptype = 10
|
||||
///// Z-Level stuff
|
||||
if("pipe-u")
|
||||
C.ptype = 11
|
||||
if("pipe-d")
|
||||
C.ptype = 12
|
||||
///// Z-Level stuff
|
||||
src.transfer_fingerprints_to(C)
|
||||
C.dir = dir
|
||||
C.density = 0
|
||||
@@ -900,8 +906,113 @@
|
||||
update()
|
||||
return
|
||||
|
||||
///// Z-Level stuff
|
||||
/obj/structure/disposalpipe/up
|
||||
icon_state = "pipe-u"
|
||||
|
||||
New()
|
||||
..()
|
||||
dpdir = dir
|
||||
update()
|
||||
return
|
||||
|
||||
nextdir(var/fromdir)
|
||||
var/nextdir
|
||||
if(fromdir == 11)
|
||||
nextdir = dir
|
||||
else
|
||||
nextdir = 12
|
||||
return nextdir
|
||||
|
||||
transfer(var/obj/structure/disposalholder/H)
|
||||
var/nextdir = nextdir(H.dir)
|
||||
H.dir = nextdir
|
||||
|
||||
var/turf/T
|
||||
var/obj/structure/disposalpipe/P
|
||||
|
||||
if(nextdir == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(!T)
|
||||
H.loc = src.loc
|
||||
return
|
||||
else
|
||||
for(var/obj/structure/disposalpipe/down/F in T)
|
||||
P = F
|
||||
|
||||
else
|
||||
T = get_step(src.loc, H.dir)
|
||||
P = H.findpipe(T)
|
||||
|
||||
if(P)
|
||||
// find other holder in next loc, if inactive merge it with current
|
||||
var/obj/structure/disposalholder/H2 = locate() in P
|
||||
if(H2 && !H2.active)
|
||||
H.merge(H2)
|
||||
|
||||
H.loc = P
|
||||
else // if wasn't a pipe, then set loc to turf
|
||||
H.loc = T
|
||||
return null
|
||||
|
||||
return P
|
||||
|
||||
/obj/structure/disposalpipe/down
|
||||
icon_state = "pipe-d"
|
||||
|
||||
New()
|
||||
..()
|
||||
dpdir = dir
|
||||
update()
|
||||
return
|
||||
|
||||
nextdir(var/fromdir)
|
||||
var/nextdir
|
||||
if(fromdir == 12)
|
||||
nextdir = dir
|
||||
else
|
||||
nextdir = 11
|
||||
return nextdir
|
||||
|
||||
transfer(var/obj/structure/disposalholder/H)
|
||||
var/nextdir = nextdir(H.dir)
|
||||
H.dir = nextdir
|
||||
|
||||
var/turf/T
|
||||
var/obj/structure/disposalpipe/P
|
||||
|
||||
if(nextdir == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(!T)
|
||||
H.loc = src.loc
|
||||
return
|
||||
else
|
||||
for(var/obj/structure/disposalpipe/up/F in T)
|
||||
P = F
|
||||
|
||||
else
|
||||
T = get_step(src.loc, H.dir)
|
||||
P = H.findpipe(T)
|
||||
|
||||
if(P)
|
||||
// find other holder in next loc, if inactive merge it with current
|
||||
var/obj/structure/disposalholder/H2 = locate() in P
|
||||
if(H2 && !H2.active)
|
||||
H.merge(H2)
|
||||
|
||||
H.loc = P
|
||||
else // if wasn't a pipe, then set loc to turf
|
||||
H.loc = T
|
||||
return null
|
||||
|
||||
return P
|
||||
///// Z-Level stuff
|
||||
|
||||
//a three-way junction with dir being the dominant direction
|
||||
/obj/structure/disposalpipe/junction
|
||||
|
||||
Reference in New Issue
Block a user