From 13898c006bcacae660655763fd4c97e631170557 Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Thu, 13 Jan 2011 12:43:28 +0000 Subject: [PATCH] REVERTING updates r830, r833, r836, r838, r839 and r841 due to suspected involvement in the huge lag we've been experiencing since them. All the files mentioned below have been reverted to their state in version r829. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@847 316c924e-a436-60f5-8080-3fe189b3f50e --- .../components/binary_devices/pump.dm | 2 +- .../components/portables_connector.dm | 4 +- .../components/unary/vent_pump.dm | 10 +- .../components/unary/vent_scrubber.dm | 4 +- code/ATMOSPHERICS/components/valve.dm | 15 +- code/ATMOSPHERICS/pipes.dm | 106 ++++--- code/WorkInProgress/mining.dm | 258 ++---------------- code/game/machinery/atmoalter/meter.dm | 13 - .../atmoalter/portable_atmospherics.dm | 1 - code/game/machinery/pipe/construction.dm | 98 ++++--- code/game/machinery/pipe/pipe_dispenser.dm | 50 +--- 11 files changed, 143 insertions(+), 418 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 00fcc471504..96e0e970364 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -196,5 +196,5 @@ obj/machinery/atmospherics/binary/pump "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index cda8f1e6be6..7065b256053 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -134,8 +134,6 @@ if (connected_device) user << "\red You cannot unwrench this [src], dettach [connected_device] first." return 1 - if (locate(/obj/machinery/portable_atmospherics, src.loc)) - return 1 var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) user << "\red You must remove the plating first." @@ -153,5 +151,5 @@ "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index a486657a21a..1634a4c075e 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -26,7 +26,7 @@ var/frequency = 1439 var/datum/radio_frequency/radio_connection - + New() var/area/A = get_area(loc) if (A.master) @@ -35,7 +35,7 @@ ..() if (!id) id = "\ref[src]" - + high_volume name = "Large Air Vent" New() @@ -84,7 +84,7 @@ var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION) var/datum/gas_mixture/removed = air_contents.remove(transfer_moles) - + use_power(round(air_contents.volume/12), channel) loc.assume_air(removed) @@ -105,7 +105,7 @@ var/datum/gas_mixture/removed = loc.remove_air(transfer_moles) if (isnull(removed)) //in space return - + use_power(round(air_contents.volume/12), channel) air_contents.merge(removed) @@ -274,5 +274,5 @@ "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index bbe7de4fe7d..43673eb1d0a 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -83,7 +83,7 @@ if(!on) return 0 - + var/datum/gas_mixture/environment = loc.return_air() if(scrubbing) @@ -213,5 +213,5 @@ "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index b43bb59c0d2..2769ef46791 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -131,7 +131,7 @@ obj/machinery/atmospherics/valve initialize() if(node1 && node2) return -/* var/connect_directions + var/connect_directions switch(dir) if(NORTH) @@ -162,16 +162,7 @@ obj/machinery/atmospherics/valve node2 = target break if(node1) - break*/ - for(var/obj/machinery/atmospherics/target in get_step(src,dir)) - if(target.initialize_directions & get_dir(target,src)) - node1 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,turn(dir,180))) - if(target.initialize_directions & get_dir(target,src)) - node2 = target - break + break build_network() if(!network_node1 && node1) @@ -292,5 +283,5 @@ obj/machinery/atmospherics/valve "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index c1f2a56ea12..5c0d3e6dcc0 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -155,9 +155,6 @@ obj/machinery/atmospherics/pipe proc/burst() src.visible_message("\red \bold [src] bursts!"); playsound(src.loc, 'bang.ogg', 25, 1) - var/datum/effects/system/harmless_smoke_spread/smoke = new - smoke.set_up(1,0, src.loc, 0) - smoke.start() del(src) Del() @@ -190,34 +187,36 @@ obj/machinery/atmospherics/pipe //dir = node1_direction|node2_direction else - if(!node1&&!node2) - del(src) //TODO: silent deleting looks weird var/have_node1 = node1?1:0 var/have_node2 = node2?1:0 icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" + if(!node1&&!node2) + del(src) initialize() - var/node1_dir - var/node2_dir - + var/connect_directions = initialize_directions for(var/direction in cardinal) - if(direction&initialize_directions) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_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 - for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir)) - if(target.initialize_directions & get_dir(target,src)) - node2 = target - break + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/target in get_step(src,direction)) + if(target.initialize_directions & get_dir(target,src)) + node1 = target + connect_directions &= ~direction + break + if (node1) + break + for(var/direction in cardinal) + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/target in get_step(src,direction)) + if(target.initialize_directions & get_dir(target,src)) + node2 = target + connect_directions &= ~direction + break + if(node2) + break + var/turf/T = src.loc // hide if turf is not intact hide(T.intact) update_icon() @@ -269,14 +268,16 @@ obj/machinery/atmospherics/pipe del(src) initialize() - for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions)) - if(target.initialize_directions & get_dir(target,src)) - node1 = target - break - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he)) - if(target.initialize_directions_he & get_dir(target,src)) - node2 = target - break + if(!node1) + for(var/obj/machinery/atmospherics/pipe/simple/target in get_step(src,initialize_directions)) + if(target.initialize_directions & get_dir(target,src)) + node1 = target + break + if(!node2) + for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he)) + if(target.initialize_directions_he & get_dir(target,src)) + node2 = target + break update_icon() @@ -290,25 +291,26 @@ obj/machinery/atmospherics/pipe thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT initialize() - var/node1_dir - var/node2_dir - + var/connect_directions = initialize_directions_he for(var/direction in cardinal) - if(direction&initialize_directions_he) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_dir = direction - - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node1_dir)) - if(target.initialize_directions_he & get_dir(target,src)) - node1 = target - break - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node2_dir)) - if(target.initialize_directions_he & get_dir(target,src)) - node2 = target - break + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,direction)) + if(target.initialize_directions_he & get_dir(target,src)) + node1 = target + connect_directions &= ~direction + break + if (node1) + break + for(var/direction in cardinal) + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,direction)) + if(target.initialize_directions_he & get_dir(target,src)) + node2 = target + connect_directions &= ~direction + break + if (node2) + break update_icon() @@ -709,9 +711,9 @@ obj/machinery/atmospherics/pipe update_icon() obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (istype(src, /obj/machinery/atmospherics/pipe/tank)) + if (istype(W, /obj/machinery/atmospherics/pipe/tank)) return ..() - if (istype(src, /obj/machinery/atmospherics/pipe/vent)) + if (istype(W, /obj/machinery/atmospherics/pipe/vent)) return ..() if (!istype(W, /obj/item/weapon/wrench)) return ..() @@ -732,9 +734,5 @@ obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/u "[user] unfastens \the [src].", \ "\blue You have unfastened \the [src].", \ "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) - for (var/obj/machinery/meter/meter in T) - if (meter.target == src) - new /obj/item/pipe_meter(T) - del(meter) + new /obj/item/weapon/pipe(loc, make_from=src) del(src) \ No newline at end of file diff --git a/code/WorkInProgress/mining.dm b/code/WorkInProgress/mining.dm index 5fd6b3c1662..22430756dd8 100644 --- a/code/WorkInProgress/mining.dm +++ b/code/WorkInProgress/mining.dm @@ -12,177 +12,65 @@ /area/mine/lobby name = "Mining station" + requires_power = 0 + luminosity = 1 icon_state = "mine" + sd_lighting = 0 /**********************Mineral deposits**************************/ /turf/simulated/mineral //wall piece - name = "Rock" + name = "Mineral deposit" icon = 'walls.dmi' icon_state = "rock" - oxygen = 0 - nitrogen = 0 opacity = 1 density = 1 blocks_air = 1 - temperature = TCMB var/mineralName = "" var/mineralAmt = 0 - var/spread = 0 //will the seam spread? - var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles -/turf/simulated/mineral/Del() - return - -/turf/simulated/mineral/ex_act(severity) - switch(severity) - if(3.0) - return - if(2.0) - if (prob(70)) - src.mineralAmt -= 1 //some of the stuff gets blown up - src.gets_drilled() - if(1.0) - src.mineralAmt -= 2 //some of the stuff gets blown up - src.gets_drilled() - return - -/turf/simulated/mineral/New() - desc = "0" - if (mineralName && mineralAmt && spread && spreadChance) - var/sp = pickweight(list("1" = spreadChance, "0" = 100-spreadChance)) - if(sp == "1") - if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random)) - //var/turf/simulated/mineral/random/R - //R = get_step(src, SOUTH) - new src.type(get_step(src, SOUTH)) - //R.levelupdate() - sp = pickweight(list("1" = spreadChance, "0" = 100-spreadChance)) - if(sp == "1") - if(istype(get_step(src, NORTH), /turf/simulated/mineral/random)) - //var/turf/simulated/mineral/random/R - //R = get_step(src, NORTH) - new src.type(get_step(src, NORTH)) - //R.levelupdate() - sp = pickweight(list("1" = spreadChance, "0" = 100-spreadChance)) - if(sp == "1") - if(istype(get_step(src, WEST), /turf/simulated/mineral/random)) - //var/turf/simulated/mineral/random/R - //R = get_step(src, WEST) - new src.type(get_step(src, WEST)) - //R.levelupdate() - sp = pickweight(list("1" = spreadChance, "0" = 100-spreadChance)) - if(sp == "1") - if(istype(get_step(src, EAST), /turf/simulated/mineral/random)) - //var/turf/simulated/mineral/random/R - //R = get_step(src, EAST) - new src.type(get_step(src, EAST)) - //R.levelupdate() - - return - -/*if(istype(get_step(src, SOUTH), /turf/simulated/floor/airless/asteroid)) - A = get_step(src, SOUTH) - A.updateMineralOverlays()*/ - -/turf/simulated/mineral/random - name = "Mineral deposit" - var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5) - var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25) - var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit - -/turf/simulated/mineral/random/New() - var/mChance = pickweight(list("1" = mineralChance, "0" = 100-mineralChance)) - if (mChance == "1") - var/mName = pickweight(mineralSpawnChanceList) //temp mineral name - spawn(5) - if (mName) - var/turf/simulated/mineral/M - switch(mName) - if("Uranium") - M = new/turf/simulated/mineral/uranium(src) - if("Iron") - M = new/turf/simulated/mineral/iron(src) - if("Diamond") - M = new/turf/simulated/mineral/diamond(src) - if("Gold") - M = new/turf/simulated/mineral/gold(src) - if("Silver") - M = new/turf/simulated/mineral/silver(src) - if("Plasma") - M = new/turf/simulated/mineral/plasma(src) - if(M) - src = M - M.levelupdate() - return - -/turf/simulated/mineral/random/Del() - return - -/turf/simulated/mineral/uranium +/turf/simulated/mineral/urenium name = "Uranium deposit" icon_state = "rock_Uranium" mineralName = "Uranium" mineralAmt = 5 - spreadChance = 10 - spread = 1 - - /turf/simulated/mineral/iron name = "Iron deposit" icon_state = "rock_Iron" mineralName = "Iron" mineralAmt = 5 - spreadChance = 25 - spread = 1 - /turf/simulated/mineral/diamond name = "Diamond deposit" icon_state = "rock_Diamond" mineralName = "Diamond" mineralAmt = 5 - spreadChance = 10 - spread = 1 - /turf/simulated/mineral/gold name = "Gold deposit" icon_state = "rock_Gold" mineralName = "Gold" mineralAmt = 5 - spreadChance = 10 - spread = 1 - /turf/simulated/mineral/silver name = "Silver deposit" icon_state = "rock_Silver" mineralName = "Silver" mineralAmt = 5 - spreadChance = 10 - spread = 1 - /turf/simulated/mineral/plasma name = "Plasma deposit" icon_state = "rock_Plasma" mineralName = "Plasma" mineralAmt = 5 - spreadChance = 25 - spread = 1 - /turf/simulated/mineral/clown name = "Bananium deposit" icon_state = "rock_Clown" mineralName = "Clown" - mineralAmt = 3 - spreadChance = 0 - spread = 0 - + mineralAmt = 2 /turf/simulated/mineral/ReplaceWithFloor() if(!icon_old) icon_old = icon_state @@ -247,19 +135,6 @@ ReplaceWithFloor() return -/* -/turf/simulated/mineral/proc/setRandomMinerals() - var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1)) - if (s) - mineralName = s - - var/N = text2path("/turf/simulated/mineral/[s]") - if (N) - var/turf/simulated/mineral/M = new N - src = M - if (src.mineralName) - mineralAmt = 5 - return*/ /**********************Asteroid**************************/ @@ -268,9 +143,6 @@ name = "Asteroid" icon = 'floors.dmi' icon_state = "asteroid" - oxygen = 0 - nitrogen = 0 - temperature = TCMB var/seedName = "" //Name of the seed it contains var/seedAmt = 0 //Ammount of the seed it contains var/dug = 0 //0 = has not yet been dug, 1 = has already been dug @@ -283,9 +155,6 @@ spawn(2) updateMineralOverlays() -/turf/simulated/floor/airless/asteroid/ex_act(severity) - return - /turf/simulated/floor/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob) if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") usr << "\red You don't have the dexterity to do this!" @@ -1234,11 +1103,6 @@ var/obj/machinery/mineral/output = null var/amt_silver = 0 //amount of silver var/amt_gold = 0 //amount of gold - var/amt_diamond = 0 - var/amt_iron = 0 - var/amt_plasma = 0 - var/amt_uranium = 0 - var/amt_clown = 0 var/newCoins = 0 //how many coins the machine made in it's last load var/processing = 0 @@ -1252,33 +1116,16 @@ return return - /obj/machinery/mineral/mint/process() if (src.output && src.input) var/obj/item/stack/sheet/O O = locate(/obj/item/stack/sheet, input.loc) - if(O) - if (istype(O,/obj/item/stack/sheet/gold)) - amt_gold += 100 - del(O) - if (istype(O,/obj/item/stack/sheet/silver)) - amt_silver += 100 - del(O) - if (istype(O,/obj/item/stack/sheet/diamond)) - amt_diamond += 100 - del(O) - if (istype(O,/obj/item/stack/sheet/plasma)) - amt_plasma += 100 - del(O) - if (istype(O,/obj/item/weapon/ore/uranium)) - amt_uranium += 100 - del(O) - if (istype(O,/obj/item/stack/sheet/metal)) - amt_iron += 100 - del(O) - if (istype(O,/obj/item/stack/sheet/clown)) - amt_clown += 100 - del(O) + if (istype(O,/obj/item/stack/sheet/gold)) + amt_gold += 100 + del(O) + if (istype(O,/obj/item/stack/sheet/silver)) + amt_silver += 100 + del(O) /obj/machinery/mineral/mint/attack_hand(user as mob) @@ -1297,11 +1144,6 @@ dat += text("

Gold inserterd: [amt_gold]") dat += text("

Silver inserterd: [amt_silver]") - dat += text("

Iron inserterd: [amt_iron]") - dat += text("

Diamond inserterd: [amt_diamond]") - dat += text("

Plasma inserterd: [amt_plasma]") - dat += text("

Uranium inserterd: [amt_uranium]") - dat += text("

Bananium inserterd: [amt_clown]") dat += text("

Make coins") dat += text("

found: [newCoins]") @@ -1329,37 +1171,6 @@ newCoins++ src.updateUsrDialog() sleep(5); - while(amt_diamond > 0) - new /obj/item/weapon/coin/diamond(output.loc) - amt_diamond -= 20 - newCoins++ - src.updateUsrDialog() - sleep(5); - while(amt_iron > 0) - new /obj/item/weapon/coin/iron(output.loc) - amt_iron -= 20 - newCoins++ - src.updateUsrDialog() - sleep(5); - while(amt_plasma > 0) - new /obj/item/weapon/coin/plasma(output.loc) - amt_plasma -= 20 - newCoins++ - src.updateUsrDialog() - sleep(5); - while(amt_uranium > 0) - new /obj/item/weapon/coin/uranium(output.loc) - amt_uranium -= 20 - newCoins++ - src.updateUsrDialog() - sleep(5); - while(amt_clown > 0) - new /obj/item/weapon/coin/clown(output.loc) - amt_clown -= 20 - newCoins++ - src.updateUsrDialog() - sleep(5); - processing = 0; src.updateUsrDialog() return @@ -1389,26 +1200,6 @@ name = "Silver coin" icon_state = "coin_silver" -/obj/item/weapon/coin/diamond - name = "Diamond coin" - icon_state = "coin_diamond" - -/obj/item/weapon/coin/iron - name = "Iron coin" - icon_state = "coin_iron" - -/obj/item/weapon/coin/plasma - name = "Solid plasma coin" - icon_state = "coin_plasma" - -/obj/item/weapon/coin/uranium - name = "Uranium coin" - icon_state = "coin_uranium" - -/obj/item/weapon/coin/clown - name = "Bananaium coin" - icon_state = "coin_clown" - /**********************Gas extractor**************************/ @@ -1516,10 +1307,10 @@ icon = 'items.dmi' icon_state = "pickaxe" flags = FPRINT | TABLEPASS| CONDUCT | ONBELT - force = 15.0 - throwforce = 4.0 + force = 5.0 + throwforce = 7.0 item_state = "wrench" - w_class = 4.0 + w_class = 2.0 m_amt = 50 /*****************************Shovel********************************/ @@ -1529,10 +1320,10 @@ icon = 'items.dmi' icon_state = "shovel" flags = FPRINT | TABLEPASS| CONDUCT | ONBELT - force = 8.0 - throwforce = 4.0 + force = 5.0 + throwforce = 7.0 item_state = "wrench" - w_class = 4.0 + w_class = 2.0 m_amt = 50 @@ -1613,7 +1404,6 @@ icon_state = "rail" dir = 2 var/id = null //this is needed for switches to work Set to the same on the whole length of the track - anchored = 1 /**********************Rail intersection**************************/ @@ -2109,12 +1899,12 @@ for (var/client/C) dat += text("


Scrap current shuttle") else dat += text("Available ships to build:

") - dat += text("Planet hopper - Tiny, Slow, 25000 metal
") - dat += text("Blunder Bus - Small, Decent speed, 60000 metal
") - dat += text("Space dinghy - Medium size, Decent speed, 100000 metal
") - dat += text("Boxvan MMDLVIr - Medium size, Decent speed, 120000 metal
") - dat += text("Boxvan MMDLVI - Security eidition - Large, Rather slow, 125000 metal
") - dat += text("Space station 4 - Huge, Slow, 250000 metal
") + dat += text("Planet hopper - Tiny, Slow
") + dat += text("Blunder Bus - Small, Decent speed
") + dat += text("Space dinghy - Medium size, Decent speed
") + dat += text("Boxvan MMDLVIr - Medium size, Decent speed
") + dat += text("Boxvan MMDLVI - Security eidition - Large, Rather slow
") + dat += text("Space station 4 - Huge, Slow
") user << browse("[dat]", "window=shipbuilder") diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index bea2bcf9ee2..ec3a0cffa4e 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -88,16 +88,3 @@ usr << t return - -/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - playsound(src.loc, 'Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") - new /obj/item/pipe_meter(src.loc) - del(src) \ No newline at end of file diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index a6c5fa95beb..9a1cdaa2dcb 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -54,7 +54,6 @@ var/datum/pipe_network/network = connected_port.return_network(src) if(network && !network.gases.Find(air_contents)) network.gases += air_contents - network.update = 1 return 1 diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 71e63f933ba..add1efd0488 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -16,7 +16,7 @@ Buildable meters #define PIPE_INSULATED_STRAIGHT 11 #define PIPE_INSULATED_BENT 12 -/obj/item/pipe +/obj/item/weapon/pipe name = "pipe" desc = "A pipe" var/pipe_type = 0 @@ -28,8 +28,8 @@ Buildable meters flags = TABLEPASS|FPRINT w_class = 4 level = 2 - -/obj/item/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null) + //TODO: список номер_типа -> тип +/obj/item/weapon/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null) ..() if (make_from) src.dir = make_from.dir @@ -41,10 +41,8 @@ Buildable meters is_bent = 1 if (istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction)) src.pipe_type = PIPE_JUNCTION - else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging)) + else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging)) src.pipe_type = PIPE_HE_STRAIGHT + is_bent - else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated)) - src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple)) src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent else if(istype(make_from, /obj/machinery/atmospherics/portables_connector)) @@ -59,17 +57,19 @@ Buildable meters src.pipe_type = PIPE_PUMP else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber)) src.pipe_type = PIPE_SCRUBBER + else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated)) + src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent + if (is_bent) + src.dir = make_from.initialize_directions //workaround. Bent pipes with one node==null have cardinal direction. - rastaf0 else src.pipe_type = pipe_type src.dir = dir //src.pipe_dir = get_pipe_dir() update() - src.pixel_x = rand(-5, 5) - src.pixel_y = rand(-5, 5) //update the name and icon of the pipe item depending on the type -/obj/item/pipe/proc/update() +/obj/item/weapon/pipe/proc/update() var/list/nlist = list( \ "pipe", \ "bent pipe", \ @@ -102,13 +102,31 @@ Buildable meters "insulated", \ ) icon_state = islist[pipe_type + 1] + updateicon() + +//update the icon of the item + +/obj/item/weapon/pipe/proc/updateicon() + if(invisibility) // true if placed under floor + icon -= rgb(0,0,0,128) // fade the icon + else + icon = initial(icon) // otherwise reset to inital icon + +// called to hide or unhide a pipe +// i=true if hiding + +/obj/item/weapon/pipe/hide(var/i) + + invisibility = i ? 101 : 0 // make hidden pipe items invisible + updateicon() + //called when a turf is attacked with a pipe item // place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact // rotate the pipe item clockwise -/obj/item/pipe/verb/rotate() +/obj/item/weapon/pipe/verb/rotate() set name = "Rotate Pipe" set src in view(1) @@ -116,30 +134,18 @@ Buildable meters return src.dir = turn(src.dir, -90) - - if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 //src.pipe_dir = get_pipe_dir() return -/obj/item/pipe/Move() +/obj/item/weapon/pipe/Move() + var/dir = src.dir ..() - if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \ - && (src.dir in cardinal)) - src.dir = src.dir|turn(src.dir, 90) - else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 + src.dir = dir return // returns all pipe's endpoints -/obj/item/pipe/proc/get_pipe_dir() +/obj/item/weapon/pipe/proc/get_pipe_dir() if (!dir) return 0 var/flip = turn(dir, 180) @@ -163,7 +169,7 @@ Buildable meters return flip|cw|acw return 0 -/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes +/obj/item/weapon/pipe/proc/get_pdir() //endpoints for regular pipes var/flip = turn(dir, 180) // var/cw = turn(dir, -90) @@ -180,7 +186,7 @@ Buildable meters // return the h_dir (heat-exchange pipes) from the type and the dir -/obj/item/pipe/proc/get_hdir() //endpoints for h/e pipes +/obj/item/weapon/pipe/proc/get_hdir() //endpoints for h/e pipes // var/flip = turn(dir, 180) // var/cw = turn(dir, -90) @@ -195,20 +201,15 @@ Buildable meters else return 0 -/obj/item/pipe/attack_self(mob/user as mob) +/obj/item/weapon/pipe/attack_self(mob/user as mob) return rotate() -/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/item/weapon/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) //* if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!isturf(src.loc)) return 1 - if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 var/pipe_dir = get_pipe_dir() for(var/obj/machinery/atmospherics/M in src.loc) @@ -263,8 +264,6 @@ Buildable meters C.initialize_directions = pipe_dir if (pipename) C.name = pipename - var/turf/T = C.loc - C.level = T.intact ? 2 : 1 C.initialize() C.build_network() if (C.node) @@ -312,15 +311,20 @@ Buildable meters if (P.node2) P.node2.initialize() P.node2.build_network() - +/* + if(6) //junctions + var/obj/machinery/junction/J = new( src.loc ) + J.dir = dir + J.p_dir = src.get_pdir() + J.h_dir = src.get_hdir() + J.level = 2 +*/ if(PIPE_UVENT) //unary vent var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc ) V.dir = dir V.initialize_directions = pipe_dir if (pipename) V.name = pipename - var/turf/T = V.loc - V.level = T.intact ? 2 : 1 V.initialize() V.build_network() if (V.node) @@ -334,8 +338,6 @@ Buildable meters V.initialize_directions = pipe_dir if (pipename) V.name = pipename - var/turf/T = V.loc - V.level = T.intact ? 2 : 1 V.initialize() V.build_network() if (V.node1) @@ -353,8 +355,6 @@ Buildable meters 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) @@ -371,8 +371,6 @@ Buildable meters S.initialize_directions = pipe_dir if (pipename) S.name = pipename - var/turf/T = S.loc - S.level = T.intact ? 2 : 1 S.initialize() S.build_network() if (S.node) @@ -399,8 +397,8 @@ Buildable meters playsound(src.loc, 'Ratchet.ogg', 50, 1) user.visible_message( \ - "[user] fastens the [src].", \ - "\blue You have fastened the [src].", \ + "[user] fastens the pipe.", \ + "\blue You have fastened the pipe.", \ "You hear ratchet.") del(src) // remove the pipe item @@ -411,7 +409,7 @@ Buildable meters -/obj/item/pipe_meter +/obj/item/weapon/pipe_meter name = "meter" desc = "A meter that can be laid on pipes" icon = 'pipe-item.dmi' @@ -420,7 +418,7 @@ Buildable meters flags = TABLEPASS|FPRINT w_class = 4 -/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) +/obj/item/weapon/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (!istype(W, /obj/item/weapon/wrench)) return ..() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index 62fa78afcae..4ce7cb87d68 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -3,8 +3,7 @@ icon = 'stationobjs.dmi' icon_state = "autolathe" density = 1 - anchored = 1 - var/unwrenched = 0 + anchored = 1.0 /obj/machinery/pipedispenser/attack_paw(user as mob) return src.attack_hand(user) @@ -16,11 +15,10 @@ Regular pipes:
Pipe
Bent Pipe
-Manifold
-Manual Valve
-Devices:
Connector
+Manifold
Unary Vent
+Manual Valve
Gas Pump
Scrubber
Meter
@@ -41,57 +39,23 @@ /obj/machinery/pipedispenser/Topic(href, href_list) if(..()) return - if(unwrenched) - usr << browse(null, "window=pipedispenser") - return usr.machine = src src.add_fingerprint(usr) if(href_list["make"]) var/p_type = text2num(href_list["make"]) var/p_dir = text2num(href_list["dir"]) - var/obj/item/pipe/P = new (/*usr.loc*/ src.loc, pipe_type=p_type, dir=p_dir) + var/obj/item/weapon/pipe/P = new (usr.loc, pipe_type=p_type, dir=p_dir) P.update() if(href_list["makemeter"]) - new /obj/item/pipe_meter(/*usr.loc*/ src.loc) + new /obj/item/weapon/pipe_meter(usr.loc) /* for(var/mob/M in viewers(1, src)) if ((M.client && M.machine == src)) src.attack_hand(M)*/ return -/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob) - if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) - usr << "\blue You put [W] back to [src]." - del(W) - return - else if (istype(W, /obj/item/weapon/wrench)) - if (unwrenched==0) - playsound(src.loc, 'Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src] from the floor..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src]. Now it can be pulled somewhere else.", \ - "You hear ratchet.") - src.anchored = 0 - src.stat |= MAINT - src.unwrenched = 1 - if (usr.machine==src) - usr << browse(null, "window=pipedispenser") - else /*if (unwrenched==1)*/ - playsound(src.loc, 'Ratchet.ogg', 50, 1) - user << "\blue You begin to fasten \the [src] to the floor..." - if (do_after(user, 20)) - user.visible_message( \ - "[user] fastens \the [src].", \ - "\blue You have fastened \the [src]. Now it can dispense pipes.", \ - "You hear ratchet.") - src.anchored = 1 - src.stat &= ~MAINT - src.unwrenched = 0 - power_change() - else - return ..() +/obj/machinery/pipedispenser/New() + ..() /obj/machinery/pipedispenser/disposal