mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Adds further checking and variable presets to ZAS, and made the contamination overlay actually work.
This commit is contained in:
@@ -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/var/tmp/last_airflow_stun = 0
|
||||||
mob/proc/airflow_stun()
|
mob/proc/airflow_stun()
|
||||||
if(stat == 2)
|
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)
|
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))
|
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||||
return
|
return
|
||||||
|
if(!istype(loc, /turf))
|
||||||
|
return
|
||||||
step_towards(src, src.airflow_dest)
|
step_towards(src, src.airflow_dest)
|
||||||
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
||||||
airflow_dest = null
|
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)
|
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))
|
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||||
return
|
return
|
||||||
|
if(!istype(loc, /turf))
|
||||||
|
return
|
||||||
step_towards(src, src.airflow_dest)
|
step_towards(src, src.airflow_dest)
|
||||||
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
||||||
airflow_dest = null
|
airflow_dest = null
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Indirect connections will not merge the two zones after they reach equilibrium.
|
|||||||
|
|
||||||
connection
|
connection
|
||||||
var
|
var
|
||||||
turf //The turfs involved in the connection.
|
turf/simulated //The turfs involved in the connection.
|
||||||
A
|
A
|
||||||
B
|
B
|
||||||
zone
|
zone
|
||||||
@@ -30,22 +30,15 @@ connection
|
|||||||
zone_B = B.zone
|
zone_B = B.zone
|
||||||
ref_B = "\ref[B]"
|
ref_B = "\ref[B]"
|
||||||
|
|
||||||
if(!air_master.tiles_with_connections)
|
if(!A.connections)
|
||||||
air_master.tiles_with_connections = list()
|
A.connections = list(src)
|
||||||
|
|
||||||
if(air_master.tiles_with_connections[ref_A])
|
|
||||||
var/list/A_connections = air_master.tiles_with_connections[ref_A]
|
|
||||||
A_connections |= src
|
|
||||||
else
|
else
|
||||||
var/list/A_connections = list(src)
|
A.connections += src
|
||||||
air_master.tiles_with_connections[ref_A] = A_connections
|
|
||||||
|
|
||||||
if(air_master.tiles_with_connections[ref_B])
|
if(!B.connections)
|
||||||
var/list/B_connections = air_master.tiles_with_connections[ref_B]
|
B.connections = list(src)
|
||||||
B_connections |= src
|
|
||||||
else
|
else
|
||||||
var/list/B_connections = list(src)
|
B.connections += src
|
||||||
air_master.tiles_with_connections[ref_B] = B_connections
|
|
||||||
|
|
||||||
if(!A.zone.connected_zones)
|
if(!A.zone.connected_zones)
|
||||||
A.zone.connected_zones = list()
|
A.zone.connected_zones = list()
|
||||||
@@ -74,23 +67,15 @@ connection
|
|||||||
A.zone.connections.Remove(src)
|
A.zone.connections.Remove(src)
|
||||||
if(!A.zone.connections.len)
|
if(!A.zone.connections.len)
|
||||||
del A.zone.connections
|
del A.zone.connections
|
||||||
if(ref_A in air_master.tiles_with_connections)
|
if(istype(A))
|
||||||
var/list/A_connections = air_master.tiles_with_connections[ref_A]
|
A.connections -= src
|
||||||
A_connections -= src
|
|
||||||
if(A_connections && !A_connections.len)
|
|
||||||
del A_connections
|
|
||||||
air_master.tiles_with_connections.Remove(ref_A)
|
|
||||||
if(B)
|
if(B)
|
||||||
if(B.zone && B.zone.connections)
|
if(B.zone && B.zone.connections)
|
||||||
B.zone.connections.Remove(src)
|
B.zone.connections.Remove(src)
|
||||||
if(!B.zone.connections.len)
|
if(!B.zone.connections.len)
|
||||||
del B.zone.connections
|
del B.zone.connections
|
||||||
if(ref_B in air_master.tiles_with_connections)
|
if(istype(B))
|
||||||
var/list/B_connections = air_master.tiles_with_connections[ref_B]
|
B.connections -= src
|
||||||
B_connections -= src
|
|
||||||
if(B_connections && !B_connections.len)
|
|
||||||
del B_connections
|
|
||||||
air_master.tiles_with_connections.Remove(ref_B)
|
|
||||||
if(zone_A)
|
if(zone_A)
|
||||||
if(zone_A && zone_A.connections)
|
if(zone_A && zone_A.connections)
|
||||||
zone_A.connections.Remove(src)
|
zone_A.connections.Remove(src)
|
||||||
@@ -193,7 +178,7 @@ connection
|
|||||||
|
|
||||||
proc/CheckPassSanity()
|
proc/CheckPassSanity()
|
||||||
Cleanup()
|
Cleanup()
|
||||||
if(!A.CanPass(null, B, 0, 0) || !B.CanPass(null, A, 0, 0))
|
if(!A.CanPass(null, B, 0, 0))
|
||||||
del src
|
del src
|
||||||
if(A.HasDoor(B) || B.HasDoor(A))
|
if(A.HasDoor(B) || B.HasDoor(A))
|
||||||
indirect = 1
|
indirect = 1
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ proc/FloodFill(turf/start)
|
|||||||
for(var/d in cardinal)
|
for(var/d in cardinal)
|
||||||
var/turf/O = get_step(T,d)
|
var/turf/O = get_step(T,d)
|
||||||
//Simple pass check.
|
//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
|
open += O
|
||||||
else
|
else
|
||||||
doors += T
|
doors += T
|
||||||
@@ -72,19 +72,38 @@ proc/FloodFill(turf/start)
|
|||||||
closed += T
|
closed += T
|
||||||
|
|
||||||
for(var/turf/T in doors)
|
for(var/turf/T in doors)
|
||||||
|
var/force_connection = 1
|
||||||
var/turf/O = get_step(T,NORTH)
|
var/turf/O = get_step(T,NORTH)
|
||||||
if(O in closed)
|
if(O in closed)
|
||||||
closed += T
|
closed += T
|
||||||
|
continue
|
||||||
|
else if(T.ZCanPass(O))
|
||||||
|
force_connection = 0
|
||||||
|
|
||||||
O = get_step(T,WEST)
|
O = get_step(T,WEST)
|
||||||
if(O in closed)
|
if(O in closed)
|
||||||
closed += T
|
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
|
return closed
|
||||||
|
|
||||||
turf/proc/ZCanPass(turf/T, var/include_space = 0)
|
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.
|
//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
|
else
|
||||||
if(T.blocks_air||blocks_air)
|
if(T.blocks_air||blocks_air)
|
||||||
return 0
|
return 0
|
||||||
@@ -92,13 +111,35 @@ turf/proc/ZCanPass(turf/T, var/include_space = 0)
|
|||||||
for(var/obj/obstacle in src)
|
for(var/obj/obstacle in src)
|
||||||
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
|
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
|
||||||
continue
|
continue
|
||||||
if(!obstacle.CanPass(0, T, 1.5, 1))
|
if(!obstacle.CanPass(null, T, 1.5, 1))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
for(var/obj/obstacle in T)
|
for(var/obj/obstacle in T)
|
||||||
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
|
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
|
||||||
continue
|
continue
|
||||||
if(!obstacle.CanPass(0, src, 1.5, 1))
|
if(!obstacle.CanPass(null, src, 1.5, 1))
|
||||||
|
return 0
|
||||||
|
|
||||||
|
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 0
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
@@ -2,6 +2,7 @@ turf/var/zone/zone
|
|||||||
|
|
||||||
var/list/zones = list()
|
var/list/zones = list()
|
||||||
var/list/DoorDirections = list(NORTH,WEST) //Which directions doors turfs can connect to zones
|
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
|
zone
|
||||||
var
|
var
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ datum
|
|||||||
|
|
||||||
//Geometry updates lists
|
//Geometry updates lists
|
||||||
var/list/turf/simulated/tiles_to_update = list()
|
var/list/turf/simulated/tiles_to_update = list()
|
||||||
var/list/turf/simulated/tiles_with_connections = list()
|
|
||||||
var/list/connection/connections_checked = list()
|
var/list/connection/connections_checked = list()
|
||||||
// var/list/turf/simulated/groups_to_rebuild = list()
|
// var/list/turf/simulated/groups_to_rebuild = list()
|
||||||
|
|
||||||
@@ -145,7 +144,7 @@ datum
|
|||||||
for(var/turf/simulated/S in world)
|
for(var/turf/simulated/S in world)
|
||||||
if(S.z < 5)
|
if(S.z < 5)
|
||||||
S.update_air_properties()
|
S.update_air_properties()
|
||||||
S.check_connections()
|
// S.check_connections()
|
||||||
|
|
||||||
world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!"
|
world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!"
|
||||||
spawn start()
|
spawn start()
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ turf
|
|||||||
// current_cycle = 0
|
// current_cycle = 0
|
||||||
|
|
||||||
obj/fire/active_hotspot
|
obj/fire/active_hotspot
|
||||||
|
tmp/list/connections
|
||||||
|
|
||||||
// temperature_archived //USED ONLY FOR SOLIDS
|
// temperature_archived //USED ONLY FOR SOLIDS
|
||||||
// being_superconductive = 0
|
// being_superconductive = 0
|
||||||
@@ -171,31 +172,34 @@ turf
|
|||||||
air_check_directions = 0
|
air_check_directions = 0
|
||||||
|
|
||||||
for(var/direction in cardinal)
|
for(var/direction in cardinal)
|
||||||
if(CanPass(null, get_step(src,direction), 0, 0))
|
if(ZAirPass(get_step(src,direction)))
|
||||||
air_check_directions |= 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.
|
if(!zone && !blocks_air) //No zone, but not a wall.
|
||||||
for(var/direction in cardinal)
|
for(var/direction in DoorDirections) //Check door directions first.
|
||||||
if(has_door && !(direction in DoorDirections))
|
|
||||||
continue
|
|
||||||
if(air_check_directions&direction)
|
if(air_check_directions&direction)
|
||||||
var/turf/simulated/T = get_step(src,direction)
|
var/turf/simulated/T = get_step(src,direction)
|
||||||
if(T.zone && T.CanPass(null, src, 1.5, 1))
|
if(T.zone)
|
||||||
T.zone.AddTurf(src)
|
T.zone.AddTurf(src)
|
||||||
break
|
break
|
||||||
else if(T.zone && get_dir(T,src) in DoorDirections)
|
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)
|
T.zone.AddTurf(src)
|
||||||
break
|
break
|
||||||
if(!zone) //No zone found, new zone!
|
if(!zone) //No zone found, new zone!
|
||||||
new/zone(src)
|
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.
|
if(connections) //Check pass sanity of the connections.
|
||||||
var/list/connections = air_master.tiles_with_connections["\ref[src]"]
|
|
||||||
for(var/connection/C in connections)
|
for(var/connection/C in connections)
|
||||||
|
if(!(C in air_master.connections_checked))
|
||||||
air_master.connections_checked += C
|
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)
|
if(air_check_directions)
|
||||||
processing = 1
|
processing = 1
|
||||||
@@ -203,34 +207,22 @@ turf
|
|||||||
processing = 0
|
processing = 0
|
||||||
|
|
||||||
|
|
||||||
proc/update_zone_properties(var/has_door = 0)
|
proc/update_zone_properties()
|
||||||
for(var/direction in cardinal)
|
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(air_check_directions&direction) //I can connect air in this direction
|
||||||
if(!istype(T)) //Space
|
if(!CanPass(null, T, 0, 0)) //If I block air, we must look to see if the adjacent turfs need rebuilt.
|
||||||
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(T.zone && !T.zone.rebuild)
|
if(T.zone && !T.zone.rebuild)
|
||||||
for(var/direction2 in cardinal - direction) //Check all other directions for air that might be connected.
|
for(var/direction2 in cardinal - direction) //Check all other directions for air that might be connected.
|
||||||
var/turf/simulated/NT = get_step(src, direction2)
|
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
|
T.zone.rebuild = 1
|
||||||
|
|
||||||
else if(T.CanPass(null, src, 0, 0) && (!has_door || direction in DoorDirections))
|
else
|
||||||
if(T.zone != zone)
|
|
||||||
ZConnect(src,T)
|
ZConnect(src,T)
|
||||||
|
|
||||||
else if(zone && !zone.rebuild)
|
// else if(zone && !zone.rebuild)
|
||||||
for(var/direction2 in cardinal - reverse_direction(direction)) //Check all other directions for air that might be connected.
|
// 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)
|
// var/turf/simulated/NT = get_step(T, direction2)
|
||||||
if(NT && NT.zone && NT.zone == zone)
|
// if(NT && NT.zone && NT.zone == zone)
|
||||||
zone.rebuild = 1
|
// zone.rebuild = 1
|
||||||
@@ -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.
|
//Some legacy definitions so fires can be started.
|
||||||
atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||||
|
|||||||
@@ -20,9 +20,13 @@
|
|||||||
|
|
||||||
proc/AddSpace(turf/space/S)
|
proc/AddSpace(turf/space/S)
|
||||||
//Adds a space tile to the list, and creates the list if null.
|
//Adds a space tile to the list, and creates the list if null.
|
||||||
if(istype(S,/turf/space))
|
if(istype(S))
|
||||||
if(!space_tiles) space_tiles = list()
|
if(!space_tiles)
|
||||||
|
space_tiles = list()
|
||||||
|
else if(S in space_tiles)
|
||||||
|
return
|
||||||
space_tiles += S
|
space_tiles += S
|
||||||
|
contents -= S
|
||||||
|
|
||||||
proc/RemoveSpace(turf/space/S)
|
proc/RemoveSpace(turf/space/S)
|
||||||
//Removes a space tile from the list, and deletes the list if length is 0.
|
//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
|
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.
|
//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.
|
//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)
|
B.zone.AddSpace(A)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if(!istype(A) || !istype(B))
|
||||||
|
return
|
||||||
|
|
||||||
//Make some preliminary checks to see if the connection is valid.
|
//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.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.
|
//Ensure the connection isn't already made.
|
||||||
if(air_master.tiles_with_connections["\ref[A]"])
|
if(A.connections)
|
||||||
var/list/connections = air_master.tiles_with_connections["\ref[A]"]
|
for(var/connection/C in A.connections)
|
||||||
for(var/connection/C in connections)
|
|
||||||
C.Cleanup()
|
C.Cleanup()
|
||||||
if(C && (C.B == B || C.A == B))
|
if(C && (C.B == B || C.A == B))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
var/image/contamination_overlay = image('icons/effects/contamination.dmi')
|
||||||
|
|
||||||
pl_control/var
|
pl_control/var
|
||||||
PLASMA_DMG = 3
|
PLASMA_DMG = 3
|
||||||
PLASMA_DMG_NAME = "Plasma Damage Amount"
|
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.
|
//Do a contamination overlay? Temporary measure to keep contamination less deadly than it was.
|
||||||
if(!contaminated)
|
if(!contaminated)
|
||||||
contaminated = 1
|
contaminated = 1
|
||||||
overlays += 'icons/effects/contamination.dmi'
|
overlays += contamination_overlay
|
||||||
|
|
||||||
decontaminate()
|
decontaminate()
|
||||||
contaminated = 0
|
contaminated = 0
|
||||||
overlays -= 'icons/effects/contamination.dmi'
|
overlays -= contamination_overlay
|
||||||
|
|
||||||
/mob/proc/contaminate()
|
/mob/proc/contaminate()
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ obj/item/proc
|
|||||||
src << "\red High levels of toxins cause you to spontaneously mutate."
|
src << "\red High levels of toxins cause you to spontaneously mutate."
|
||||||
domutcheck(src,null)
|
domutcheck(src,null)
|
||||||
|
|
||||||
|
|
||||||
/mob/living/carbon/human/proc/burn_eyes()
|
/mob/living/carbon/human/proc/burn_eyes()
|
||||||
//The proc that handles eye burning.
|
//The proc that handles eye burning.
|
||||||
if(prob(20)) src << "\red Your eyes burn!"
|
if(prob(20)) src << "\red Your eyes burn!"
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
#define QUANTIZE(variable) (round(variable,0.0001))
|
#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()
|
zone/proc/process()
|
||||||
//Deletes zone if empty.
|
//Deletes zone if empty.
|
||||||
if(!contents.len)
|
if(!contents.len)
|
||||||
@@ -24,11 +21,8 @@ zone/proc/process()
|
|||||||
if(space_tiles)
|
if(space_tiles)
|
||||||
for(var/T in space_tiles)
|
for(var/T in space_tiles)
|
||||||
if(!istype(T,/turf/space))
|
if(!istype(T,/turf/space))
|
||||||
space_tiles -= T
|
RemoveSpace(T)
|
||||||
continue
|
total_space = space_tiles.len
|
||||||
total_space++
|
|
||||||
if(space_tiles && !space_tiles.len)
|
|
||||||
del space_tiles
|
|
||||||
|
|
||||||
//Add checks to ensure that we're not sucking air out of an empty room.
|
//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)
|
if(total_space && air.total_moles > 0.1 && air.temperature > TCMB+0.5)
|
||||||
@@ -221,9 +215,6 @@ zone/proc/Rebuild()
|
|||||||
list/new_contents
|
list/new_contents
|
||||||
problem = 0
|
problem = 0
|
||||||
|
|
||||||
if(space_tiles)
|
|
||||||
del(space_tiles)
|
|
||||||
|
|
||||||
contents.Remove(null) //I can't believe this is needed.
|
contents.Remove(null) //I can't believe this is needed.
|
||||||
|
|
||||||
if(!contents.len)
|
if(!contents.len)
|
||||||
@@ -232,7 +223,7 @@ zone/proc/Rebuild()
|
|||||||
var/list/turfs_to_consider = contents.Copy()
|
var/list/turfs_to_consider = contents.Copy()
|
||||||
do
|
do
|
||||||
if(sample)
|
if(sample)
|
||||||
turfs_to_consider -= sample
|
turfs_to_consider.Remove(sample)
|
||||||
if(!turfs_to_consider.len)
|
if(!turfs_to_consider.len)
|
||||||
break
|
break
|
||||||
sample = pick(turfs_to_consider) //Nor this.
|
sample = pick(turfs_to_consider) //Nor this.
|
||||||
@@ -284,3 +275,12 @@ zone/proc/Rebuild()
|
|||||||
else if(!T.zone)
|
else if(!T.zone)
|
||||||
T.zone = src
|
T.zone = src
|
||||||
air.group_multiplier = contents.len
|
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)
|
||||||
@@ -1,4 +1,49 @@
|
|||||||
var/global/vs_control/vsc = new
|
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
|
vs_control
|
||||||
var
|
var
|
||||||
list/settings = list()
|
list/settings = list()
|
||||||
@@ -120,12 +165,13 @@ vs_control
|
|||||||
////world << "Plasma randomized."
|
////world << "Plasma randomized."
|
||||||
|
|
||||||
proc/SetDefault(var/mob/user)
|
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
|
var/def = input(user, "Which of these presets should be used?") as null|anything in setting_choices
|
||||||
if(!def)
|
if(!def)
|
||||||
return
|
return
|
||||||
switch(def)
|
switch(def)
|
||||||
if("Original")
|
if("Plasma - Standard")
|
||||||
plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
|
plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
|
||||||
|
|
||||||
plc.PLASMAGUARD_ONLY = 0
|
plc.PLASMAGUARD_ONLY = 0
|
||||||
@@ -150,7 +196,7 @@ vs_control
|
|||||||
//plc.PLASMA_DMG_QUOTIENT = 10
|
//plc.PLASMA_DMG_QUOTIENT = 10
|
||||||
|
|
||||||
plc.CONTAMINATION_LOSS = 0
|
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.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
|
||||||
|
|
||||||
plc.PLASMAGUARD_ONLY = 0
|
plc.PLASMAGUARD_ONLY = 0
|
||||||
@@ -177,7 +223,7 @@ vs_control
|
|||||||
|
|
||||||
plc.CONTAMINATION_LOSS = 0
|
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.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
|
||||||
|
|
||||||
plc.PLASMAGUARD_ONLY = 0
|
plc.PLASMAGUARD_ONLY = 0
|
||||||
@@ -199,7 +245,7 @@ vs_control
|
|||||||
//plc.PLASMA_DMG_OFFSET = 3
|
//plc.PLASMA_DMG_OFFSET = 3
|
||||||
//plc.PLASMA_DMG_QUOTIENT = 5
|
//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.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
|
||||||
|
|
||||||
plc.PLASMAGUARD_ONLY = 1
|
plc.PLASMAGUARD_ONLY = 1
|
||||||
@@ -221,6 +267,71 @@ vs_control
|
|||||||
//plc.PLASMA_DMG_OFFSET = 3
|
//plc.PLASMA_DMG_OFFSET = 3
|
||||||
//plc.PLASMA_DMG_QUOTIENT = 5
|
//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 <b>[key_name(user)] changed the global plasma/ZAS settings to \"[def]\"</b>"
|
world << "\blue <b>[key_name(user)] changed the global plasma/ZAS settings to \"[def]\"</b>"
|
||||||
|
|
||||||
pl_control
|
pl_control
|
||||||
|
|||||||
@@ -562,6 +562,8 @@
|
|||||||
var/ratio = breath.toxins/safe_toxins_max
|
var/ratio = breath.toxins/safe_toxins_max
|
||||||
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
adjustToxLoss(min(ratio, 10)) //Limit amount of damage toxin exposure can do per second
|
||||||
toxins_alert = max(toxins_alert, 1)
|
toxins_alert = max(toxins_alert, 1)
|
||||||
|
if(vsc.plc.PLASMA_HALLUCINATION && prob(20))
|
||||||
|
hallucination += 20
|
||||||
else
|
else
|
||||||
toxins_alert = 0
|
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
|
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)
|
if(prob(20) && isbreathing)
|
||||||
spawn(0) emote(pick("giggle", "laugh"))
|
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.
|
SA.moles = 0 //Hack to stop the damned surgeon from giggling.
|
||||||
|
|
||||||
|
|
||||||
@@ -814,6 +818,9 @@
|
|||||||
handle_chemicals_in_body()
|
handle_chemicals_in_body()
|
||||||
if(reagents && stat != 2) reagents.metabolize(src)
|
if(reagents && stat != 2) reagents.metabolize(src)
|
||||||
if(vessel && stat != 2) vessel.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
|
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
|
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 678 B |
Reference in New Issue
Block a user