Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tgstation/-tg-station int…
Browse files Browse the repository at this point in the history
…o lizardmov

Resolved Conflicts:
	code/game/objects/items/weapons/AI_modules.dm
  • Loading branch information
Ikarrus committed Jul 17, 2015
2 parents d117565 + ed1d1c1 commit bcbd4da
Show file tree
Hide file tree
Showing 875 changed files with 6,539 additions and 6,679 deletions.
1,430 changes: 719 additions & 711 deletions _maps/map_files/AsteroidStation/Asteroidstation.dmm

Large diffs are not rendered by default.

1,106 changes: 553 additions & 553 deletions _maps/map_files/MetaStation/MetaStation.v41A.II.dmm

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions _maps/map_files/MetaStation/z4.dmm

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions _maps/map_files/MetaStation/z5.dmm

Large diffs are not rendered by default.

260 changes: 130 additions & 130 deletions _maps/map_files/MiniStation/MiniStation.dmm

Large diffs are not rendered by default.

1,021 changes: 504 additions & 517 deletions _maps/map_files/TgStation/tgstation.2.1.3.dmm

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions _maps/map_files/generic/z4.dmm

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions _maps/map_files/generic/z5.dmm

Large diffs are not rendered by default.

43 changes: 10 additions & 33 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ Pipelines + Other Objects -> Pipe network
var/initialize_directions = 0
var/pipe_color
var/obj/item/pipe/stored
var/welded = 0 //Used on pumps and scrubbers
var/global/list/iconsetids = list()
var/global/list/pipeimages = list()
var/datum/pipeline/parent = null

var/image/pipe_vision_img = null


/obj/machinery/atmospherics/New()
..()
SSair.atmos_machinery += src
Expand Down Expand Up @@ -61,14 +58,8 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/SetInitDirections()
return

/obj/machinery/atmospherics/proc/safe_input(var/title, var/text, var/default_set)
var/new_value = input(usr,text,title,default_set) as num
if(usr.canUseTopic(src))
return new_value
return default_set

/obj/machinery/atmospherics/proc/returnPipenet()
return parent
return

/obj/machinery/atmospherics/proc/returnPipenetAir()
return
Expand All @@ -86,22 +77,10 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
return

/obj/machinery/atmospherics/proc/icon_addintact(var/obj/machinery/atmospherics/node, var/connected)
var/image/img = getpipeimage('icons/obj/atmospherics/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color)
underlays += img

return connected | img.dir

/obj/machinery/atmospherics/proc/icon_addbroken(var/connected)
var/unconnected = (~connected) & initialize_directions
for(var/direction in cardinal)
if(unconnected & direction)
underlays += getpipeimage('icons/obj/atmospherics/binary_devices.dmi', "pipe_exposed", direction)

/obj/machinery/atmospherics/update_icon()
return null
return

/obj/machinery/atmospherics/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
/obj/machinery/atmospherics/attackby(obj/item/weapon/W, mob/user, params)
if(can_unwrench && istype(W, /obj/item/weapon/wrench))
var/turf/T = get_turf(src)
if (level==1 && isturf(T) && T.intact)
Expand Down Expand Up @@ -138,7 +117,7 @@ Pipelines + Other Objects -> Pipe network

//Called when an atmospherics object is unwrenched while having a large pressure difference
//with it's locs air contents.
/obj/machinery/atmospherics/proc/unsafe_pressure_release(var/mob/user,var/pressures)
/obj/machinery/atmospherics/proc/unsafe_pressure_release(mob/user,pressures)
if(!user)
return

Expand All @@ -165,7 +144,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/nullifyPipenet(datum/pipeline/P)
P.other_atmosmch -= src

/obj/machinery/atmospherics/proc/getpipeimage(var/iconset, var/iconstate, var/direction, var/col=rgb(255,255,255))
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255))

//Add identifiers for the iconset
if(iconsetids[iconset] == null)
Expand All @@ -186,7 +165,7 @@ Pipelines + Other Objects -> Pipe network

return img

/obj/machinery/atmospherics/construction(D, P, var/pipe_type, var/obj_color)
/obj/machinery/atmospherics/construction(D, P, pipe_type, obj_color)
dir = D
initialize_directions = P
if(can_unwrench)
Expand All @@ -212,15 +191,15 @@ Pipelines + Other Objects -> Pipe network


//Find a connecting /obj/machinery/atmospherics in specified direction
/obj/machinery/atmospherics/proc/findConnecting(var/direction)
/obj/machinery/atmospherics/proc/findConnecting(direction)
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
if(target.initialize_directions & get_dir(target,src))
return target


#define VENT_SOUND_DELAY 30

/obj/machinery/atmospherics/relaymove(var/mob/living/user, var/direction)
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
if(!(direction & initialize_directions)) //cant go this way.
return

Expand Down Expand Up @@ -248,14 +227,12 @@ Pipelines + Other Objects -> Pipe network
user.canmove = 1


/obj/machinery/atmospherics/AltClick(var/mob/living/L)
/obj/machinery/atmospherics/AltClick(mob/living/L)
if(is_type_in_list(src, ventcrawl_machinery))
L.handle_ventcrawl(src)
return
..()


/obj/machinery/atmospherics/proc/can_crawl_through()
return 1


return 1
173 changes: 15 additions & 158 deletions code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
/obj/machinery/atmospherics/binary
icon = 'icons/obj/atmospherics/binary_devices.dmi'
/obj/machinery/atmospherics/components/binary
icon = 'icons/obj/atmospherics/components/binary_devices.dmi'
dir = SOUTH
initialize_directions = SOUTH|NORTH
use_power = 1
device_type = BINARY

var/datum/gas_mixture/air1
var/datum/gas_mixture/air2

var/obj/machinery/atmospherics/node1
var/obj/machinery/atmospherics/node2

var/datum/pipeline/parent1
var/datum/pipeline/parent2

var/showpipe = 0

/obj/machinery/atmospherics/binary/New()
..()

air1 = new
air2 = new

air1.volume = 200
air2.volume = 200

/obj/machinery/atmospherics/binary/SetInitDirections()
/obj/machinery/atmospherics/components/binary/SetInitDirections()
switch(dir)
if(NORTH)
initialize_directions = NORTH|SOUTH
Expand All @@ -34,147 +15,23 @@
initialize_directions = EAST|WEST
if(WEST)
initialize_directions = EAST|WEST

//Separate this because we don't need to update pipe icons if we just are going to change the state
/obj/machinery/atmospherics/binary/proc/update_icon_nopipes()
return

/obj/machinery/atmospherics/binary/update_icon()
update_icon_nopipes()

underlays.Cut()
if(showpipe)
var/connected = 0

//Add intact pieces
if(node1)
connected = icon_addintact(node1, connected)

if(node2)
connected = icon_addintact(node2, connected)

//Add broken pieces
icon_addbroken(connected)

/obj/machinery/atmospherics/binary/hide(var/intact)
/*
Iconnery
*/
/obj/machinery/atmospherics/components/binary/hide(intact)
showpipe = !intact
update_icon()

..(intact)
/*
Housekeeping and pipe network stuff
*/

// Housekeeping and pipe network stuff below
/obj/machinery/atmospherics/binary/Destroy()
if(node1)
node1.disconnect(src)
node1 = null
nullifyPipenet(parent1)
if(node2)
node2.disconnect(src)
node2 = null
nullifyPipenet(parent2)
..()

/obj/machinery/atmospherics/binary/atmosinit()
/obj/machinery/atmospherics/components/binary/atmosinit()

var/node2_connect = dir
var/node1_connect = turn(dir, 180)

for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
if(target.initialize_directions & get_dir(target,src))
node1 = target
break

for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
if(target.initialize_directions & get_dir(target,src))
node2 = target
break

if(level == 2)
showpipe = 1

update_icon()
..()

/obj/machinery/atmospherics/binary/construction()
..()
parent1.update = 1
parent2.update = 1

/obj/machinery/atmospherics/binary/build_network()
if(!parent1)
parent1 = new /datum/pipeline()
parent1.build_pipeline(src)

if(!parent2)
parent2 = new /datum/pipeline()
parent2.build_pipeline(src)

/obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
qdel(parent1)
node1 = null
else if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
qdel(parent2)
node2 = null
update_icon()

/obj/machinery/atmospherics/binary/nullifyPipenet(datum/pipeline/P)
..()
if(P == parent1)
parent1.other_airs -= air1
parent1 = null
else if(P == parent2)
parent2.other_airs -= air2
parent2 = null

/obj/machinery/atmospherics/binary/returnPipenetAir(datum/pipeline/P)
if(P == parent1)
return air1
else if(P == parent2)
return air2

/obj/machinery/atmospherics/binary/pipeline_expansion(datum/pipeline/P)
if(P)
if(parent1 == P)
return list(node1)
else if(parent2 == P)
return list(node2)
else
return list(node1, node2)

/obj/machinery/atmospherics/binary/setPipenet(datum/pipeline/P, obj/machinery/atmospherics/A)
if(A == node1)
parent1 = P
else if(A == node2)
parent2 = P

/obj/machinery/atmospherics/binary/returnPipenet(obj/machinery/atmospherics/A)
if(A == node1)
return parent1
else if(A == node2)
return parent2

/obj/machinery/atmospherics/binary/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
if(Old == parent1)
parent1 = New
else if(Old == parent2)
parent2 = New


/obj/machinery/atmospherics/binary/unsafe_pressure_release(var/mob/user,var/pressures)
..()

var/turf/T = get_turf(src)
if(T)
//Remove the gas from air1+air2 and assume it
var/datum/gas_mixture/environment = T.return_air()
var/lost = pressures*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
lost += pressures*environment.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
var/shared_loss = lost/2

var/datum/gas_mixture/to_release = air1.remove(shared_loss)
to_release.merge(air2.remove(shared_loss))
T.assume_air(to_release)
air_update_turf(1)
var/list/node_connects = new/list()
node_connects.Add(node1_connect, node2_connect)
..(node_connects)
15 changes: 7 additions & 8 deletions code/ATMOSPHERICS/components/binary_devices/circulator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
//node1, air1, network1 correspond to output


/obj/machinery/atmospherics/binary/circulator
/obj/machinery/atmospherics/components/binary/circulator
name = "circulator/heat exchanger"
desc = "A gas circulator pump and heat exchanger."
icon = 'icons/obj/atmospherics/pipes/simple.dmi'
icon_state = "circ1-off"

var/side = 1 // 1=left 2=right
Expand All @@ -17,8 +16,10 @@
density = 1


/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
/obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air()

var/datum/gas_mixture/air1 = airs[AIR1]
var/datum/gas_mixture/air2 = airs[AIR2]

var/output_starting_pressure = air1.return_pressure()
var/input_starting_pressure = air2.return_pressure()
Expand All @@ -41,20 +42,18 @@
//Actually transfer the gas
var/datum/gas_mixture/removed = air2.remove(transfer_moles)

parent1.update = 1

parent2.update = 1
update_parents()

return removed

else
last_pressure_delta = 0

/obj/machinery/atmospherics/binary/circulator/process_atmos()
/obj/machinery/atmospherics/components/binary/circulator/process_atmos()
..()
update_icon()

/obj/machinery/atmospherics/binary/circulator/update_icon()
/obj/machinery/atmospherics/components/binary/circulator/update_icon()
if(stat & (BROKEN|NOPOWER))
icon_state = "circ[side]-p"
else if(last_pressure_delta > 0)
Expand Down
Loading

0 comments on commit bcbd4da

Please sign in to comment.