From 4fe2b585a75d731c451f18ac294decd741713213 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Tue, 24 Jul 2012 22:12:25 -0700 Subject: [PATCH] Adds further checking and variable presets to ZAS, and made the contamination overlay actually work. --- code/ZAS/Airflow.dm | 42 +------ code/ZAS/Connection.dm | 39 ++---- code/ZAS/Creation.dm | 51 +++++++- code/ZAS/Definition.dm | 1 + code/ZAS/FEA_system.dm | 3 +- code/ZAS/FEA_turf_tile.dm | 66 +++++----- code/ZAS/Fire.dm | 2 - code/ZAS/Functions.dm | 22 ++-- code/ZAS/Plasma.dm | 7 +- code/ZAS/Processing.dm | 26 ++-- code/ZAS/Variable Settings.dm | 121 ++++++++++++++++++- code/modules/mob/living/carbon/human/life.dm | 7 ++ icons/effects/contamination.dmi | Bin 380 -> 678 bytes 13 files changed, 249 insertions(+), 138 deletions(-) diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index a00900fd35a..86838f34682 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -48,44 +48,6 @@ atom/movable/RepelAirflowDest(n) */ -vs_control/var - airflow_lightest_pressure = 30 - airflow_lightest_pressure_NAME = "Airflow - Small Movement Threshold %" - airflow_lightest_pressure_DESC = "Percent of 1 Atm. at which items with the small weight classes will move." - airflow_light_pressure = 45 - airflow_light_pressure_NAME = "Airflow - Medium Movement Threshold %" - airflow_light_pressure_DESC = "Percent of 1 Atm. at which items with the medium weight classes will move." - airflow_medium_pressure = 90 - airflow_medium_pressure_NAME = "Airflow - Heavy Movement Threshold %" - airflow_medium_pressure_DESC = "Percent of 1 Atm. at which items with the largest weight classes will move." - airflow_heavy_pressure = 95 - airflow_heavy_pressure_NAME = "Airflow - Mob Movement Threshold %" - airflow_heavy_pressure_DESC = "Percent of 1 Atm. at which mobs will move." - airflow_dense_pressure = 120 - airflow_dense_pressure_NAME = "Airflow - Dense Movement Threshold %" - airflow_dense_pressure_DESC = "Percent of 1 Atm. at which items with canisters and closets will move." - airflow_stun_pressure = 100 - airflow_stun_pressure_NAME = "Airflow - Mob Stunning Threshold %" - airflow_stun_pressure_DESC = "Percent of 1 Atm. at which mobs will be stunned by airflow." - airflow_stun_cooldown = 60 - airflow_stun_cooldown_NAME = "Aiflow Stunning - Cooldown" - airflow_stun_cooldown_DESC = "How long, in tenths of a second, to wait before stunning them again." - airflow_stun = 0.15 - airflow_stun_NAME = "Airflow Impact - Stunning" - airflow_stun_DESC = "How much a mob is stunned when hit by an object." - airflow_damage = 0.3 - airflow_damage_NAME = "Airflow Impact - Damage" - airflow_damage_DESC = "Damage from airflow impacts." - airflow_speed_decay = 1.5 - airflow_speed_decay_NAME = "Airflow Speed Decay" - airflow_speed_decay_DESC = "How rapidly the speed gained from airflow decays." - airflow_delay = 30 - airflow_delay_NAME = "Airflow Retrigger Delay" - airflow_delay_DESC = "Time in deciseconds before things can be moved by airflow again." - airflow_mob_slowdown = 1 - airflow_mob_slowdown_NAME = "Airflow Slowdown" - airflow_mob_slowdown_DESC = "Time in tenths of a second to add as a delay to each movement by a mob if they are fighting the pull of the airflow." - mob/var/tmp/last_airflow_stun = 0 mob/proc/airflow_stun() if(stat == 2) @@ -309,6 +271,8 @@ atom/movable src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z) if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy)) return + if(!istype(loc, /turf)) + return step_towards(src, src.airflow_dest) if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown airflow_dest = null @@ -363,6 +327,8 @@ atom/movable src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z) if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy)) return + if(!istype(loc, /turf)) + return step_towards(src, src.airflow_dest) if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown airflow_dest = null diff --git a/code/ZAS/Connection.dm b/code/ZAS/Connection.dm index aa4c566d65c..b95fd160bdc 100644 --- a/code/ZAS/Connection.dm +++ b/code/ZAS/Connection.dm @@ -5,7 +5,7 @@ Indirect connections will not merge the two zones after they reach equilibrium. connection var - turf //The turfs involved in the connection. + turf/simulated //The turfs involved in the connection. A B zone @@ -30,22 +30,15 @@ connection zone_B = B.zone ref_B = "\ref[B]" - if(!air_master.tiles_with_connections) - air_master.tiles_with_connections = list() - - if(air_master.tiles_with_connections[ref_A]) - var/list/A_connections = air_master.tiles_with_connections[ref_A] - A_connections |= src + if(!A.connections) + A.connections = list(src) else - var/list/A_connections = list(src) - air_master.tiles_with_connections[ref_A] = A_connections + A.connections += src - if(air_master.tiles_with_connections[ref_B]) - var/list/B_connections = air_master.tiles_with_connections[ref_B] - B_connections |= src + if(!B.connections) + B.connections = list(src) else - var/list/B_connections = list(src) - air_master.tiles_with_connections[ref_B] = B_connections + B.connections += src if(!A.zone.connected_zones) A.zone.connected_zones = list() @@ -74,23 +67,15 @@ connection A.zone.connections.Remove(src) if(!A.zone.connections.len) del A.zone.connections - if(ref_A in air_master.tiles_with_connections) - var/list/A_connections = air_master.tiles_with_connections[ref_A] - A_connections -= src - if(A_connections && !A_connections.len) - del A_connections - air_master.tiles_with_connections.Remove(ref_A) + if(istype(A)) + A.connections -= src if(B) if(B.zone && B.zone.connections) B.zone.connections.Remove(src) if(!B.zone.connections.len) del B.zone.connections - if(ref_B in air_master.tiles_with_connections) - var/list/B_connections = air_master.tiles_with_connections[ref_B] - B_connections -= src - if(B_connections && !B_connections.len) - del B_connections - air_master.tiles_with_connections.Remove(ref_B) + if(istype(B)) + B.connections -= src if(zone_A) if(zone_A && zone_A.connections) zone_A.connections.Remove(src) @@ -193,7 +178,7 @@ connection proc/CheckPassSanity() Cleanup() - if(!A.CanPass(null, B, 0, 0) || !B.CanPass(null, A, 0, 0)) + if(!A.CanPass(null, B, 0, 0)) del src if(A.HasDoor(B) || B.HasDoor(A)) indirect = 1 diff --git a/code/ZAS/Creation.dm b/code/ZAS/Creation.dm index 08419346ae9..ff20eed6f2a 100644 --- a/code/ZAS/Creation.dm +++ b/code/ZAS/Creation.dm @@ -61,7 +61,7 @@ proc/FloodFill(turf/start) for(var/d in cardinal) var/turf/O = get_step(T,d) //Simple pass check. - if(O.ZCanPass(T) && !(O in open) && !(O in closed)) + if(istype(O) && O.ZCanPass(T) && !(O in open) && !(O in closed)) open += O else doors += T @@ -72,19 +72,38 @@ proc/FloodFill(turf/start) closed += T for(var/turf/T in doors) + var/force_connection = 1 var/turf/O = get_step(T,NORTH) if(O in closed) closed += T + continue + else if(T.ZCanPass(O)) + force_connection = 0 + O = get_step(T,WEST) if(O in closed) closed += T + continue + else if(force_connection && T.ZCanPass(O)) + force_connection = 0 + + if(force_connection) + O = get_step(T,SOUTH) + if(O in closed) + closed += T + else if(!T.ZCanPass(O) && get_step(T,EAST) in closed) + closed += T + return closed turf/proc/ZCanPass(turf/T, var/include_space = 0) //Fairly standard pass checks for turfs, objects and directional windows. Also stops at the edge of space. + if(!istype(T)) + return 0 - if(istype(T,/turf/space) && !include_space) return 0 + if(istype(T,/turf/space) && !include_space) + return 0 else if(T.blocks_air||blocks_air) return 0 @@ -92,13 +111,35 @@ turf/proc/ZCanPass(turf/T, var/include_space = 0) for(var/obj/obstacle in src) if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window)) continue - if(!obstacle.CanPass(0, T, 1.5, 1)) + if(!obstacle.CanPass(null, T, 1.5, 1)) return 0 for(var/obj/obstacle in T) if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window)) continue - if(!obstacle.CanPass(0, src, 1.5, 1)) + if(!obstacle.CanPass(null, src, 1.5, 1)) return 0 - return 1 \ No newline at end of file + return 1 + +turf/proc/ZAirPass(turf/T) + //Fairly standard pass checks for turfs, objects and directional windows. Also stops at the edge of space. + if(!istype(T)) + return 0 + + if(T.blocks_air||blocks_air) + return 0 + + for(var/obj/obstacle in src) + if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window)) + continue + if(!obstacle.CanPass(null, T, 0, 0)) + return 0 + + for(var/obj/obstacle in T) + if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window)) + continue + if(!obstacle.CanPass(null, src, 0, 0)) + return 0 + + return 1 \ No newline at end of file diff --git a/code/ZAS/Definition.dm b/code/ZAS/Definition.dm index caa03e4daba..82c8b757996 100644 --- a/code/ZAS/Definition.dm +++ b/code/ZAS/Definition.dm @@ -2,6 +2,7 @@ turf/var/zone/zone var/list/zones = list() var/list/DoorDirections = list(NORTH,WEST) //Which directions doors turfs can connect to zones +var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs can connect to zones zone var diff --git a/code/ZAS/FEA_system.dm b/code/ZAS/FEA_system.dm index 1a1c49a2a34..4f9bc2aa11f 100644 --- a/code/ZAS/FEA_system.dm +++ b/code/ZAS/FEA_system.dm @@ -100,7 +100,6 @@ datum //Geometry updates lists var/list/turf/simulated/tiles_to_update = list() - var/list/turf/simulated/tiles_with_connections = list() var/list/connection/connections_checked = list() // var/list/turf/simulated/groups_to_rebuild = list() @@ -145,7 +144,7 @@ datum for(var/turf/simulated/S in world) if(S.z < 5) S.update_air_properties() - S.check_connections() + // S.check_connections() world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!" spawn start() diff --git a/code/ZAS/FEA_turf_tile.dm b/code/ZAS/FEA_turf_tile.dm index e618844411d..9fc9fa3334e 100644 --- a/code/ZAS/FEA_turf_tile.dm +++ b/code/ZAS/FEA_turf_tile.dm @@ -51,6 +51,7 @@ turf // current_cycle = 0 obj/fire/active_hotspot + tmp/list/connections // temperature_archived //USED ONLY FOR SOLIDS // being_superconductive = 0 @@ -171,31 +172,34 @@ turf air_check_directions = 0 for(var/direction in cardinal) - if(CanPass(null, get_step(src,direction), 0, 0)) + if(ZAirPass(get_step(src,direction))) air_check_directions |= direction - var/has_door = HasDoor(src) - if(!zone && CanPass(null, src, 1.5, 1)) //No zone and not a wall, lets add ourself to a zone. - for(var/direction in cardinal) - if(has_door && !(direction in DoorDirections)) - continue + if(!zone && !blocks_air) //No zone, but not a wall. + for(var/direction in DoorDirections) //Check door directions first. if(air_check_directions&direction) var/turf/simulated/T = get_step(src,direction) - if(T.zone && T.CanPass(null, src, 1.5, 1)) - T.zone.AddTurf(src) - break - else if(T.zone && get_dir(T,src) in DoorDirections) + if(T.zone) T.zone.AddTurf(src) break + if(!zone) //Still no zone + for(var/direction in CounterDoorDirections) //Check the others second. + if(air_check_directions&direction) + var/turf/simulated/T = get_step(src,direction) + if(T.zone) + T.zone.AddTurf(src) + break if(!zone) //No zone found, new zone! new/zone(src) + if(!zone) //Still no zone, the floodfill determined it is not part of a larger zone. Force a zone on it. + new/zone(list(src)) - if(air_master.tiles_with_connections["\ref[src]"]) //Check pass sanity of the connections. - var/list/connections = air_master.tiles_with_connections["\ref[src]"] + if(connections) //Check pass sanity of the connections. for(var/connection/C in connections) - air_master.connections_checked += C + if(!(C in air_master.connections_checked)) + air_master.connections_checked += C - update_zone_properties(has_door) //Update self zone and adjacent zones. + update_zone_properties() //Update self zone and adjacent zones. if(air_check_directions) processing = 1 @@ -203,34 +207,22 @@ turf processing = 0 - proc/update_zone_properties(var/has_door = 0) + proc/update_zone_properties() for(var/direction in cardinal) - var/turf/simulated/T = get_step(src,direction) + var/turf/T = get_step(src,direction) if(air_check_directions&direction) //I can connect air in this direction - if(!istype(T)) //Space - if(!CanPass(null, T, 1.5, 1) && CanPass(src, T, 0, 0)) //Normally would block it, instead lets make a connection to it. - if(zone) - zone.AddSpace(T) - else if(!CanPass(src, T, 0, 0) || !CanPass(T, src, 0, 0)) //I block the air or it blocks air, disconnect from it if connected. - if(zone && T in zone.space_tiles) - zone.RemoveSpace(T) - else if(zone) - zone.rebuild = 1 - continue - - else if(!T.CanPass(null, src, 1.5, 1) && !T.CanPass(null, src, 0, 0)) //If I block air, we must look to see if the adjacent turfs need rebuilt. + if(!CanPass(null, T, 0, 0)) //If I block air, we must look to see if the adjacent turfs need rebuilt. if(T.zone && !T.zone.rebuild) for(var/direction2 in cardinal - direction) //Check all other directions for air that might be connected. var/turf/simulated/NT = get_step(src, direction2) - if(NT && NT.zone && NT.zone == T.zone) + if(NT && NT.zone && NT.zone == T.zone && !NT.HasDoor()) T.zone.rebuild = 1 - else if(T.CanPass(null, src, 0, 0) && (!has_door || direction in DoorDirections)) - if(T.zone != zone) - ZConnect(src,T) + else + ZConnect(src,T) - else if(zone && !zone.rebuild) - for(var/direction2 in cardinal - reverse_direction(direction)) //Check all other directions for air that might be connected. - var/turf/simulated/NT = get_step(T, direction2) - if(NT && NT.zone && NT.zone == zone) - zone.rebuild = 1 \ No newline at end of file +// else if(zone && !zone.rebuild) +// for(var/direction2 in cardinal - reverse_direction(direction)) //Check all other directions for air that might be connected. +// var/turf/simulated/NT = get_step(T, direction2) +// if(NT && NT.zone && NT.zone == zone) +// zone.rebuild = 1 \ No newline at end of file diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 801f6ee6c33..c7adbf2a7f7 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -12,8 +12,6 @@ Attach to transfer valve and open. BOOM. -vs_control/var/IgnitionLevel = 0.5 -vs_control/var/IgnitionLevel_DESC = "Moles of oxygen+plasma - co2 needed to burn." //Some legacy definitions so fires can be started. atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) diff --git a/code/ZAS/Functions.dm b/code/ZAS/Functions.dm index 191a1a8c8e7..639eb8ef79e 100644 --- a/code/ZAS/Functions.dm +++ b/code/ZAS/Functions.dm @@ -20,9 +20,13 @@ proc/AddSpace(turf/space/S) //Adds a space tile to the list, and creates the list if null. - if(istype(S,/turf/space)) - if(!space_tiles) space_tiles = list() + if(istype(S)) + if(!space_tiles) + space_tiles = list() + else if(S in space_tiles) + return space_tiles += S + contents -= S proc/RemoveSpace(turf/space/S) //Removes a space tile from the list, and deletes the list if length is 0. @@ -102,7 +106,7 @@ proc/ZMerge(zone/A,zone/B) del B -proc/ZConnect(turf/A,turf/B) +proc/ZConnect(turf/simulated/A,turf/simulated/B) //Connects two zones by forming a connection object representing turfs A and B. //Make sure that if it's space, it gets added to space_tiles instead. @@ -115,15 +119,19 @@ proc/ZConnect(turf/A,turf/B) B.zone.AddSpace(A) return + if(!istype(A) || !istype(B)) + return + //Make some preliminary checks to see if the connection is valid. if(!A.zone || !B.zone) return if(A.zone == B.zone) return - if(!A.CanPass(0,B,0,0) || !B.CanPass(0,A,0,0)) return + if(!A.CanPass(null,B,0,0)) return + if(A.CanPass(null,B,1.5,1)) + return ZMerge(A.zone,B.zone) //Ensure the connection isn't already made. - if(air_master.tiles_with_connections["\ref[A]"]) - var/list/connections = air_master.tiles_with_connections["\ref[A]"] - for(var/connection/C in connections) + if(A.connections) + for(var/connection/C in A.connections) C.Cleanup() if(C && (C.B == B || C.A == B)) return diff --git a/code/ZAS/Plasma.dm b/code/ZAS/Plasma.dm index 03149f660f3..e7400b785c8 100644 --- a/code/ZAS/Plasma.dm +++ b/code/ZAS/Plasma.dm @@ -1,3 +1,5 @@ +var/image/contamination_overlay = image('icons/effects/contamination.dmi') + pl_control/var PLASMA_DMG = 3 PLASMA_DMG_NAME = "Plasma Damage Amount" @@ -50,11 +52,11 @@ obj/item/proc //Do a contamination overlay? Temporary measure to keep contamination less deadly than it was. if(!contaminated) contaminated = 1 - overlays += 'icons/effects/contamination.dmi' + overlays += contamination_overlay decontaminate() contaminated = 0 - overlays -= 'icons/effects/contamination.dmi' + overlays -= contamination_overlay /mob/proc/contaminate() @@ -112,6 +114,7 @@ obj/item/proc src << "\red High levels of toxins cause you to spontaneously mutate." domutcheck(src,null) + /mob/living/carbon/human/proc/burn_eyes() //The proc that handles eye burning. if(prob(20)) src << "\red Your eyes burn!" diff --git a/code/ZAS/Processing.dm b/code/ZAS/Processing.dm index 9d5370f9eb7..d159d57369b 100644 --- a/code/ZAS/Processing.dm +++ b/code/ZAS/Processing.dm @@ -1,7 +1,4 @@ #define QUANTIZE(variable) (round(variable,0.0001)) -vs_control/var/zone_share_percent = 10 -vs_control/var/zone_share_percent_NAME = "Zone Share Percent" -vs_control/var/zone_share_percent_DESC = "Percentage of air difference to move per tick" zone/proc/process() //Deletes zone if empty. if(!contents.len) @@ -24,11 +21,8 @@ zone/proc/process() if(space_tiles) for(var/T in space_tiles) if(!istype(T,/turf/space)) - space_tiles -= T - continue - total_space++ - if(space_tiles && !space_tiles.len) - del space_tiles + RemoveSpace(T) + total_space = space_tiles.len //Add checks to ensure that we're not sucking air out of an empty room. if(total_space && air.total_moles > 0.1 && air.temperature > TCMB+0.5) @@ -221,9 +215,6 @@ zone/proc/Rebuild() list/new_contents problem = 0 - if(space_tiles) - del(space_tiles) - contents.Remove(null) //I can't believe this is needed. if(!contents.len) @@ -232,7 +223,7 @@ zone/proc/Rebuild() var/list/turfs_to_consider = contents.Copy() do if(sample) - turfs_to_consider -= sample + turfs_to_consider.Remove(sample) if(!turfs_to_consider.len) break sample = pick(turfs_to_consider) //Nor this. @@ -283,4 +274,13 @@ zone/proc/Rebuild() T.zone = src else if(!T.zone) T.zone = src - air.group_multiplier = contents.len \ No newline at end of file + air.group_multiplier = contents.len + + if(space_tiles) + var/list/new_space_tiles = space_tiles.Copy() + space_tiles = null + for(var/turf/space/S in new_space_tiles) + for(var/direction in cardinal) + var/turf/simulated/T = get_step(S,direction) + if(istype(T) && T.zone) + T.zone.AddSpace(S) \ No newline at end of file diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 2c68e31b13f..68eca110b43 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -1,4 +1,49 @@ var/global/vs_control/vsc = new + +vs_control/var + zone_share_percent = 12 + zone_share_percent_NAME = "Zone Share Percent" + zone_share_percent_DESC = "Percentage of air difference to move per tick" + IgnitionLevel = 0.5 + IgnitionLevel_DESC = "Moles of oxygen+plasma - co2 needed to burn." + airflow_lightest_pressure = 30 + airflow_lightest_pressure_NAME = "Airflow - Small Movement Threshold %" + airflow_lightest_pressure_DESC = "Percent of 1 Atm. at which items with the small weight classes will move." + airflow_light_pressure = 45 + airflow_light_pressure_NAME = "Airflow - Medium Movement Threshold %" + airflow_light_pressure_DESC = "Percent of 1 Atm. at which items with the medium weight classes will move." + airflow_medium_pressure = 90 + airflow_medium_pressure_NAME = "Airflow - Heavy Movement Threshold %" + airflow_medium_pressure_DESC = "Percent of 1 Atm. at which items with the largest weight classes will move." + airflow_heavy_pressure = 95 + airflow_heavy_pressure_NAME = "Airflow - Mob Movement Threshold %" + airflow_heavy_pressure_DESC = "Percent of 1 Atm. at which mobs will move." + airflow_dense_pressure = 120 + airflow_dense_pressure_NAME = "Airflow - Dense Movement Threshold %" + airflow_dense_pressure_DESC = "Percent of 1 Atm. at which items with canisters and closets will move." + airflow_stun_pressure = 100 + airflow_stun_pressure_NAME = "Airflow - Mob Stunning Threshold %" + airflow_stun_pressure_DESC = "Percent of 1 Atm. at which mobs will be stunned by airflow." + airflow_stun_cooldown = 60 + airflow_stun_cooldown_NAME = "Aiflow Stunning - Cooldown" + airflow_stun_cooldown_DESC = "How long, in tenths of a second, to wait before stunning them again." + airflow_stun = 0.15 + airflow_stun_NAME = "Airflow Impact - Stunning" + airflow_stun_DESC = "How much a mob is stunned when hit by an object." + airflow_damage = 0.3 + airflow_damage_NAME = "Airflow Impact - Damage" + airflow_damage_DESC = "Damage from airflow impacts." + airflow_speed_decay = 1.5 + airflow_speed_decay_NAME = "Airflow Speed Decay" + airflow_speed_decay_DESC = "How rapidly the speed gained from airflow decays." + airflow_delay = 30 + airflow_delay_NAME = "Airflow Retrigger Delay" + airflow_delay_DESC = "Time in deciseconds before things can be moved by airflow again." + airflow_mob_slowdown = 1 + airflow_mob_slowdown_NAME = "Airflow Slowdown" + airflow_mob_slowdown_DESC = "Time in tenths of a second to add as a delay to each movement by a mob if they are fighting the pull of the airflow." + + vs_control var list/settings = list() @@ -120,12 +165,13 @@ vs_control ////world << "Plasma randomized." proc/SetDefault(var/mob/user) - var/list/setting_choices = list("Original", "Hazard - Low", "Hazard - High", "Oh Shit!") + var/list/setting_choices = list("Plasma - Standard", "Plasma - Low Hazard", "Plasma - High Hazard", "Plasma - Oh Shit!",\ + "ZAS - Normal", "ZAS - Forgiving", "ZAS - Dangerous", "ZAS - Hellish") var/def = input(user, "Which of these presets should be used?") as null|anything in setting_choices if(!def) return switch(def) - if("Original") + if("Plasma - Standard") plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth. plc.PLASMAGUARD_ONLY = 0 @@ -150,7 +196,7 @@ vs_control //plc.PLASMA_DMG_QUOTIENT = 10 plc.CONTAMINATION_LOSS = 0 - if("Hazard - Low") + if("Plasma - Low Hazard") plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth. plc.PLASMAGUARD_ONLY = 0 @@ -177,7 +223,7 @@ vs_control plc.CONTAMINATION_LOSS = 0 - if("Hazard - High") + if("Plasma - High Hazard") plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. plc.PLASMAGUARD_ONLY = 0 @@ -199,7 +245,7 @@ vs_control //plc.PLASMA_DMG_OFFSET = 3 //plc.PLASMA_DMG_QUOTIENT = 5 - if("Oh Shit!") + if("Plasma - Oh Shit!") plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth. plc.PLASMAGUARD_ONLY = 1 @@ -221,6 +267,71 @@ vs_control //plc.PLASMA_DMG_OFFSET = 3 //plc.PLASMA_DMG_QUOTIENT = 5 + if("ZAS - Normal") + zone_share_percent = 10 + IgnitionLevel = 0.5 + airflow_lightest_pressure = 30 + airflow_light_pressure = 45 + airflow_medium_pressure = 90 + airflow_heavy_pressure = 95 + airflow_dense_pressure = 120 + airflow_stun_pressure = 100 + airflow_stun_cooldown = 60 + airflow_stun = 0.15 + airflow_damage = 0.3 + airflow_speed_decay = 1.5 + airflow_delay = 30 + airflow_mob_slowdown = 1 + + if("ZAS - Forgiving") + zone_share_percent = 6 + IgnitionLevel = 1 + airflow_lightest_pressure = 45 + airflow_light_pressure = 60 + airflow_medium_pressure = 120 + airflow_heavy_pressure = 110 + airflow_dense_pressure = 200 + airflow_stun_pressure = 150 + airflow_stun_cooldown = 90 + airflow_stun = 0.15 + airflow_damage = 0.15 + airflow_speed_decay = 1.5 + airflow_delay = 50 + airflow_mob_slowdown = 0 + + if("ZAS - Dangerous") + zone_share_percent = 15 + IgnitionLevel = 0.4 + airflow_lightest_pressure = 25 + airflow_light_pressure = 35 + airflow_medium_pressure = 75 + airflow_heavy_pressure = 80 + airflow_dense_pressure = 100 + airflow_stun_pressure = 90 + airflow_stun_cooldown = 50 + airflow_stun = 2 + airflow_damage = 1 + airflow_speed_decay = 1.2 + airflow_delay = 25 + airflow_mob_slowdown = 2 + + if("ZAS - Hellish") + zone_share_percent = 20 + IgnitionLevel = 0.3 + airflow_lightest_pressure = 20 + airflow_light_pressure = 30 + airflow_medium_pressure = 70 + airflow_heavy_pressure = 75 + airflow_dense_pressure = 80 + airflow_stun_pressure = 70 + airflow_stun_cooldown = 40 + airflow_stun = 3 + airflow_damage = 2 + airflow_speed_decay = 1 + airflow_delay = 20 + airflow_mob_slowdown = 3 + + world << "\blue [key_name(user)] changed the global plasma/ZAS settings to \"[def]\"" pl_control diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index d32ec96d73e..119591fa5ed 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -562,6 +562,8 @@ var/ratio = breath.toxins/safe_toxins_max adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second toxins_alert = max(toxins_alert, 1) + if(vsc.plc.PLASMA_HALLUCINATION && prob(20)) + hallucination += 20 else toxins_alert = 0 @@ -575,6 +577,8 @@ else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20) && isbreathing) spawn(0) emote(pick("giggle", "laugh")) + if(vsc.plc.N2O_HALLUCINATION && prob(10) && isbreathing) + hallucination += 30 SA.moles = 0 //Hack to stop the damned surgeon from giggling. @@ -814,6 +818,9 @@ handle_chemicals_in_body() if(reagents && stat != 2) reagents.metabolize(src) if(vessel && stat != 2) vessel.metabolize(src) + for(var/obj/item/I in src) + if(I.contaminated) + toxloss += vsc.plc.CONTAMINATION_LOSS if(mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing diff --git a/icons/effects/contamination.dmi b/icons/effects/contamination.dmi index e0f34e26469b6984f5bef6322eccdc843d4df04a..c2fa348084aa9fd296c0550a0859e4e8a066eadd 100644 GIT binary patch delta 666 zcmV;L0%iUD0;UC!7=H)`0001UdV2H#003!vR9JLGWpiV4X>fFDZ*Bkpc$_82y$XOJ z6b8`Q`xGC#M}MnJDB+;*AZY1Ofl9r8gWEX*o8FCsvWDJRYJP4=tiwp`%b_JmEHkkb z^O;&tZN5cFa84}bQXw%BJBq(zw}5sE${P9snztAWmU2cy0Dk}h_(?=TR9J=WRxxVB zKoFdSlqp;p1bKkKg+E~89~c>f8a+UTj0-oeqC)9i2wdm^ZVrNsUSJ13Agb&(5D>UZ zp$DXJR-EKJ>CPm$@mA7lwKKQ3Gt%95yTvu*{;KFV0yhEx9&}%b94j6T9svMJS^xm} zdw0DV>(tZg0Dpn^R|gn&P_7$xfd1-$(clr0W5qf(?^Jz&2hTjSvfHL-ZK2fx!w!T1 z?s_v$(gK-hRyy-%1Zaodq1~F>9okw)p*)23oiza%b^xSvrMlWGpyF=0tP+~dwcCFY zf$q?T8v;4=E9-8!R63%1w5lL-tXNh&^GpChe|0!}c7NP4M6-FT8XAX?z&pp1=*4t-~lKz=Q9nJtS#?ocR?JNm`U{NZ>j1k)#Fo)1DHE#t!h{ zz-a(;=9gZ;6UjUiIrGawju*`~6K!;&(QP1Vt0Ls1}7(hSV}q!N{@Vm+Y&u_S%1v=E~{- zEk_`lV7>##9V=DQmMe=!CnVS73zI34m4|$z_0^hUfWPAS+PiF zq92l`oQnw%Kz*%VSS9CT0{5T{oh*6j4at)9^9@p-X? z&j0`b0d!JMQvg8b*k%9#0AzYpSad{Xb7OL8aCB*JZU6vyoKseCa&`CgQ*iP1V_YCISGOw-^h3tARrR005{-L_t(2k-d=J5yBu0fSV1Hhyx_h0c=9?wH?uT!{5dWKra@zw_h2700000 LNkvXXu0mjfP!^xL