Merge pull request #5268 from Crazylemon64/space_allocation

Removes most hard-coded z level checks
This commit is contained in:
Fox McCloud
2016-08-10 17:07:36 -04:00
committed by GitHub
123 changed files with 344 additions and 426 deletions
+31 -1
View File
@@ -1,6 +1,32 @@
// Linkage flags
#define CROSSLINKED 2
#define SELFLOOPING 1
#define UNAFFECTED 0
// Attributes (In text for the convenience of those using VV)
#define BLOCK_TELEPORT "Blocks Teleport"
// Impedes with the casting of some spells
#define IMPEDES_MAGIC "Impedes Magic"
// A level the station exists on
#define STATION_LEVEL "Station Level"
// A level affected by Code Red announcements, cargo telepads, or similar
#define STATION_CONTACT "Station Contact"
// A level dedicated to admin use
#define ADMIN_LEVEL "Admin Level"
// A level that can be navigated to through space
#define REACHABLE "Reachable"
// For away missions - used by some consoles
#define AWAY_LEVEL "Away"
// Allows weather
#define HAS_WEATHER "Weather"
// Enhances telecomms signals
#define BOOSTS_SIGNAL "Boosts signals"
// Currently used for determining mining score
#define ORE_LEVEL "Mining"
// Levels the AI can control bots on
#define AI_OK "AI Allowed"
// Level names
#define MAIN_STATION "Main Station"
#define CENTCOMM "CentComm"
#define TELECOMMS "Telecomms Satellite"
@@ -10,4 +36,8 @@
#define EMPTY_AREA "Empty Area"
#define EMPTY_AREA_2 "Empty Area 2"
#define AWAY_MISSION "Away Mission"
#define AWAY_MISSION_LIST list(AWAY_MISSION = UNAFFECTED)
// Convenience define
#define DECLARE_LEVEL(NAME,LINKS,TRAITS) list("name" = NAME, "linkage" = LINKS, "attributes" = TRAITS)
#define AWAY_MISSION_LIST list(DECLARE_LEVEL(AWAY_MISSION,UNAFFECTED,list(BLOCK_TELEPORT, AWAY_LEVEL)))
+8 -1
View File
@@ -24,7 +24,14 @@ z7 = empty
#define MAP_FILE "cyberiad.dmm"
#define MAP_NAME "NSS Cyberiad"
#define MAP_TRANSITION_CONFIG list(MAIN_STATION = CROSSLINKED, CENTCOMM = SELFLOOPING, TELECOMMS = CROSSLINKED, CONSTRUCTION = CROSSLINKED, MINING = CROSSLINKED, DERELICT = CROSSLINKED, EMPTY_AREA = CROSSLINKED)
#define MAP_TRANSITION_CONFIG list(\
DECLARE_LEVEL(MAIN_STATION, CROSSLINKED, list(STATION_LEVEL,STATION_CONTACT,REACHABLE,AI_OK)),\
DECLARE_LEVEL(CENTCOMM, SELFLOOPING, list(ADMIN_LEVEL, BLOCK_TELEPORT, IMPEDES_MAGIC)),\
DECLARE_LEVEL(TELECOMMS, CROSSLINKED, list(REACHABLE, BOOSTS_SIGNAL, AI_OK)),\
DECLARE_LEVEL(CONSTRUCTION, CROSSLINKED, list(REACHABLE)),\
DECLARE_LEVEL(MINING, CROSSLINKED, list(REACHABLE, STATION_CONTACT, HAS_WEATHER, ORE_LEVEL, AI_OK)),\
DECLARE_LEVEL(DERELICT, CROSSLINKED, list(REACHABLE)),\
DECLARE_LEVEL(EMPTY_AREA, CROSSLINKED, list(REACHABLE)))
#elif !defined(MAP_OVERRIDE)
+8 -1
View File
@@ -25,7 +25,14 @@ z7 = empty space
#define MAP_FILE "MetaStation.v41A.II.dmm"
#define MAP_NAME "MetaStation"
#define MAP_TRANSITION_CONFIG list(MAIN_STATION = CROSSLINKED, CENTCOMM = SELFLOOPING, TELECOMMS = CROSSLINKED, DERELICT = CROSSLINKED, MINING = CROSSLINKED, EMPTY_AREA = CROSSLINKED, EMPTY_AREA_2 = CROSSLINKED)
#define MAP_TRANSITION_CONFIG list(\
DECLARE_LEVEL(MAIN_STATION, CROSSLINKED, list(STATION_LEVEL, STATION_CONTACT, REACHABLE, AI_OK)),\
DECLARE_LEVEL(CENTCOMM, SELFLOOPING, list(ADMIN_LEVEL, BLOCK_TELEPORT, IMPEDES_MAGIC)),\
DECLARE_LEVEL(TELECOMMS, CROSSLINKED, list(REACHABLE, BOOSTS_SIGNAL, AI_OK)),\
DECLARE_LEVEL(DERELICT, CROSSLINKED, list(REACHABLE)),\
DECLARE_LEVEL(MINING, CROSSLINKED, list(REACHABLE, STATION_CONTACT, AI_OK, ORE_LEVEL, HAS_WEATHER)),\
DECLARE_LEVEL(EMPTY_AREA, CROSSLINKED, list(REACHABLE)),\
DECLARE_LEVEL(EMPTY_AREA_2, CROSSLINKED, list(REACHABLE)))
#elif !defined(MAP_OVERRIDE)
-15
View File
@@ -1,20 +1,5 @@
//zlevel defines, can be overriden for different maps in the appropriate _maps file.
#define ZLEVEL_STATION 1
#define ZLEVEL_CENTCOMM 2
#define ZLEVEL_TELECOMMS 3
#define ZLEVEL_ENGI 4
#define ZLEVEL_ASTEROID 5
#define ZLEVEL_DERELICT 6
#define ZLEVEL_EMPTY 7
#define MAX_Z 7 // Used in space.dm to defince which Z-levels cannot be exited via space.
#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level
///
#define ENGINE_EJECT_Z 3
//Object specific defines
#define CANDLE_LUM 3 //For how bright candles are
-11
View File
@@ -7,14 +7,6 @@ var/list/cardinal = list( NORTH, SOUTH, EAST, WEST )
var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/list/diagonals = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
//(Exceptions: extended, sandbox and nuke) -Errorage
//Was list("3" = 30, "4" = 70).
//Spacing should be a reliable method of getting rid of a body -- Urist.
//Go away Urist, I'm restoring this to the longer list. ~Errorage
// TODO: Tie into space manager
var/list/accessable_z_levels = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ENGI,ZLEVEL_ASTEROID,ZLEVEL_DERELICT,ZLEVEL_EMPTY) //Keep this to six maps, repeating z-levels is okay if needed
var/global/list/global_map = null
//list/global_map = list(list(1,5),list(4,3))//an array of map Z levels.
//Resulting sector map looks like
@@ -26,9 +18,6 @@ var/global/list/global_map = null
//3 - AI satellite
//5 - empty space
// TODO: Tie into space manager
var/shuttle_z = ZLEVEL_CENTCOMM //default
var/list/monkeystart = list()
var/list/wizardstart = list()
var/list/newplayer_start = list()
+2 -4
View File
@@ -164,8 +164,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
continue
var/turf/T = get_turf(thing)
// TODO: Tie into space manager
if(T && T.z == ZLEVEL_STATION)
if(T && is_station_level(T.z))
callShuttle = 0
break
@@ -210,8 +209,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12
if(!M.roundstart_move)
continue
for(var/obj/docking_port/stationary/S in stationary)
// TODO: Tie into space manager
if(S.z != ZLEVEL_STATION && findtext(S.id, M.id))
if(!is_station_level(S.z) && findtext(S.id, M.id))
S.width = M.width
S.height = M.height
S.dwidth = M.dwidth
+2 -2
View File
@@ -1,5 +1,5 @@
// TODO: Tie into space manager
//Used for all kinds of weather, ex. lavaland ash storms.
// TODO: This could probably be better-integrated with the space manager
var/global/datum/controller/process/weather/weather_master
/datum/controller/process/weather
@@ -33,7 +33,7 @@ var/global/datum/controller/process/weather/weather_master
var/list/possible_weather_for_this_z = list()
for(var/V in existing_weather)
var/datum/weather/WE = V
if(WE.target_z == Z && WE.probability) //Another check so that it doesn't run extra weather
if(WE.target_level == Z && WE.probability) //Another check so that it doesn't run extra weather
possible_weather_for_this_z[WE] = WE.probability
var/datum/weather/W = pickweight(possible_weather_for_this_z)
run_weather(W.name)
-12
View File
@@ -496,18 +496,6 @@
if("max_maint_drones")
config.max_maint_drones = text2num(value)
if("station_levels")
config.station_levels = text2numlist(value, ";")
if("admin_levels")
config.admin_levels = text2numlist(value, ";")
if("contact_levels")
config.contact_levels = text2numlist(value, ";")
if("player_levels")
config.player_levels = text2numlist(value, ";")
if("expected_round_length")
config.expected_round_length = MinutesToTicks(text2num(value))
+1 -1
View File
@@ -52,7 +52,7 @@ var/global/pipe_processing_killed = 0
if(!config.disable_space_ruins)
var/timer = start_watch()
log_startup_progress("Creating random space levels...")
seedRuins(ZLEVEL_EMPTY, rand(0, 3), /area/space, space_ruins_templates)
seedRuins(level_name_to_num(EMPTY_AREA), rand(0, 3), /area/space, space_ruins_templates)
log_startup_progress("Loaded random space levels in [stop_watch(timer)]s.")
// We'll keep this around for the time when we finally expunge all
+1 -2
View File
@@ -15,8 +15,7 @@ var/global/datum/repository/air_alarm/air_alarm_repository = new()
alarms[++alarms.len] = passed_alarm.get_nano_data_console()
else
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : air_alarms))
// TODO: Tie into space manager
if(!monitored_alarms && alarm.z != ZLEVEL_STATION && alarm.z != ZLEVEL_ASTEROID)
if(!monitored_alarms && !is_station_contact(alarm.z))
continue
alarms[++alarms.len] = alarm.get_nano_data_console()
+1 -2
View File
@@ -406,8 +406,7 @@ var/list/advance_cures = list(
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
// TODO: Tie into space manager
if(H.z != ZLEVEL_STATION)
if(!is_station_level(H.z))
continue
if(!H.HasDisease(D))
H.ForceContractDisease(D)
+2 -8
View File
@@ -67,10 +67,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
caster.reset_view(0)
return 0
// TODO: Tie into space manager
if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
return 0
if(user.z == ZLEVEL_CENTCOMM && ticker.mode.name == "ragin' mages")
if(is_admin_level(user.z) && (!centcom_cancast || ticker.mode.name == "ragin' mages")) //Certain spells are not allowed on the centcom zlevel
return 0
if(!skipcharge)
@@ -364,10 +361,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
return 0
// TODO: Tie into space manager
if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
return 0
if(user.z == ZLEVEL_CENTCOMM && ticker.mode.name == "ragin' mages")
if(is_admin_level(user.z) && (!centcom_cancast || ticker.mode.name == "ragin' mages")) //Certain spells are not allowed on the centcom zlevel
return 0
switch(charge_type)
+6 -6
View File
@@ -28,7 +28,7 @@
var/area_type = /area/space //Types of area to affect
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
var/target_z = ZLEVEL_STATION //The z-level to affect
var/target_level = MAIN_STATION //The z-level to affect
var/overlay_layer = 10 //Since it's above everything else, this is the layer used by default. 2 is below mobs and walls if you need to use that.
var/aesthetic = FALSE //If the weather has no purpose other than looks
@@ -52,13 +52,13 @@
stage = STARTUP_STAGE
for(var/V in get_areas(area_type))
var/area/A = V
if(A.z == target_z)
if(is_on_level_name(A,target_level))
impacted_areas |= A
weather_duration = rand(weather_duration_lower, weather_duration_upper)
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(is_on_level_name(M,target_level))
if(telegraph_message)
to_chat(M, telegraph_message)
if(telegraph_sound)
@@ -72,7 +72,7 @@
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(is_on_level_name(M,target_level))
if(weather_message)
to_chat(M, weather_message)
if(weather_sound)
@@ -87,7 +87,7 @@
update_areas()
for(var/V in player_list)
var/mob/M = V
if(M.z == target_z)
if(is_on_level_name(M,target_level))
if(end_message)
to_chat(M, end_message)
if(end_sound)
@@ -102,7 +102,7 @@
update_areas()
/datum/weather/proc/can_impact(mob/living/L) //Can this weather impact a mob?
if(L.z != target_z)
if(!is_on_level_name(L,target_level))
return
if(immunity_type in L.weather_immunities)
return
+3 -4
View File
@@ -1,5 +1,4 @@
//Different types of weather.
// TODO: Tie into space manager
/datum/weather/floor_is_lava //The Floor is Lava: Makes all turfs damage anyone on them unless they're standing on a solid object.
name = "the floor is lava"
@@ -17,7 +16,7 @@
end_duration = 0
area_type = /area
target_z = ZLEVEL_STATION
target_level = MAIN_STATION
overlay_layer = 2 //Covers floors only
immunity_type = "lava"
@@ -51,7 +50,7 @@
end_duration = 0
area_type = /area
target_z = ZLEVEL_STATION
target_level = MAIN_STATION
/datum/weather/advanced_darkness/update_areas()
for(var/V in impacted_areas)
@@ -88,7 +87,7 @@
end_overlay = "light_ash"
area_type = /area/mine
target_z = ZLEVEL_ASTEROID
target_level = MINING
immunity_type = "ash"
+1 -2
View File
@@ -67,8 +67,7 @@ var/list/teleportlocs = list()
if(AR.no_teleportlocs) continue
if(teleportlocs.Find(AR.name)) continue
var/turf/picked = safepick(get_area_turfs(AR.type))
// TODO: Tie into space manager
if(picked && (picked.z == ZLEVEL_STATION))
if(picked && is_station_level(picked.z))
teleportlocs += AR.name
teleportlocs[AR.name] = AR
+2 -4
View File
@@ -42,8 +42,7 @@
if(!T)
return 0
// TODO: Tie into space manager
if(T.z != ZLEVEL_CENTCOMM)//if not, don't bother
if(!is_admin_level(T.z))//if not, don't bother
return 0
//check for centcomm shuttles
@@ -60,8 +59,7 @@
if(!T)
return 0
// TODO: Tie into space manager
if(T.z != ZLEVEL_CENTCOMM)//if not, don't bother
if(!is_admin_level(T.z))//if not, don't bother
return 0
if(istype(T.loc, /area/shuttle/syndicate_elite) || istype(T.loc, /area/syndicate_mothership))
+1 -2
View File
@@ -80,8 +80,7 @@
var/mob/living/demon_type = /mob/living/simple_animal/slaughter
/obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user as mob)
// TODO: Tie into space manager
if(user.z == ZLEVEL_CENTCOMM)//this is to make sure the wizard does NOT summon a demon from the Den..
if(level_blocks_magic(user.z))//this is to make sure the wizard does NOT summon a demon from the Den..
to_chat(user, "<span class='notice'>You should probably wait until you reach the station.</span>")
return
+1 -2
View File
@@ -118,8 +118,7 @@ var/list/blob_nodes = list()
if(directory[ckey(blob.key)])
blob_client = directory[ckey(blob.key)]
location = get_turf(C)
// TODO: Tie into space manager
if(location.z != ZLEVEL_STATION || istype(location, /turf/space))
if(!is_station_level(location.z) || istype(location, /turf/space))
if(!warned)
to_chat(C, "<span class='userdanger'>You feel ready to burst, but this isn't an appropriate place! You must return to the station!</span>")
message_admins("[key_name_admin(C)] was in space when the blobs burst, and will die if he doesn't return to the station.")
+1 -2
View File
@@ -23,8 +23,7 @@
var/nukecode = rand(10000, 99999)
for(var/obj/machinery/nuclearbomb/bomb in world)
if(bomb && bomb.r_code)
// TODO: Tie into space manager
if(bomb.z == ZLEVEL_STATION)
if(is_station_level(bomb.z))
bomb.r_code = nukecode
intercepttext += "<FONT size = 3><B>Nanotrasen Update</B>: Biohazard Alert.</FONT><HR>"
+2 -2
View File
@@ -35,7 +35,7 @@
return 0 // not enough candidates for borer
for(var/obj/machinery/atmospherics/unary/vent_pump/v in world)
if(!v.welded && (v.z in config.station_levels))
if(!v.welded && is_station_level(v.z))
found_vents.Add(v)
// for each 2 possible borers, add one borer and one host
@@ -156,4 +156,4 @@
greet_borer(borer)
return
return
+1 -2
View File
@@ -14,8 +14,7 @@ var/list/sacrificed = list()
for(var/obj/effect/rune/R in world)
if(R == src)
continue
// TODO: Tie into space manager
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && R.z != ZLEVEL_CENTCOMM)
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && is_teleport_allowed(R.z))
index++
allrunesloc.len = index
allrunesloc[index] = R.loc
+1 -2
View File
@@ -2,8 +2,7 @@
//command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
+2 -4
View File
@@ -427,8 +427,7 @@ proc/get_nt_opposed()
/proc/get_nuke_code()
var/nukecode = "ERROR"
for(var/obj/machinery/nuclearbomb/bomb in world)
// TODO: Tie into space manager
if(bomb && bomb.r_code && bomb.z == ZLEVEL_STATION)
if(bomb && bomb.r_code && is_station_level(bomb.z))
nukecode = bomb.r_code
return nukecode
@@ -452,8 +451,7 @@ proc/get_nt_opposed()
text += " <span class='boldannounce'>died</span>"
else
text += " <span class='greenannounce'>survived</span>"
if(fleecheck && ply.current.z > ZLEVEL_STATION)
// TODO: Tie into space manager
if(fleecheck && !is_station_level(ply.current.z))
text += " while <span class='boldannounce'>fleeing the station</span>"
if(ply.current.real_name != ply.name)
text += " as <b>[ply.current.real_name]</b>"
+1 -2
View File
@@ -266,8 +266,7 @@ var/round_start_time = 0
M.client.screen += cinematic
if(M.stat != DEAD)
var/turf/T = get_turf(M)
// TODO: Tie into space manager
if(T && T.z == ZLEVEL_STATION)
if(T && is_station_level(T.z))
M.death(0) //no mercy
//Now animate the cinematic
@@ -35,8 +35,7 @@
src.verbs -= /mob/living/silicon/ai/proc/upgrade_turrets
for(var/obj/machinery/porta_turret/turret in machines)
var/turf/T = get_turf(turret)
// TODO: Tie into space manager
if(T.z in config.station_levels)
if(is_station_level(T.z))
turret.health += 30
turret.eprojectile = /obj/item/projectile/beam/laser/heavylaser //Once you see it, you will know what it means to FEAR.
turret.eshot_sound = 'sound/weapons/lasercannonfire.ogg'
@@ -60,7 +59,7 @@
return
for(var/obj/machinery/door/D in airlocks)
if(D.z != ZLEVEL_STATION)
if(!is_station_level(D.z))
continue
spawn(0)
D.hostile_lockdown(src)
@@ -146,7 +145,7 @@
return
for(var/obj/machinery/firealarm/F in machines)
if(F.z != ZLEVEL_STATION)
if(!is_station_level(F.z))
continue
F.emagged = 1
to_chat(src, "<span class='notice'>All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.</span>")
@@ -171,7 +170,7 @@
return
for(var/obj/machinery/alarm/AA in machines)
if(AA.z != ZLEVEL_STATION)
if(!is_station_level(AA.z))
continue
AA.emagged = 1
to_chat(src, "<span class='notice'>All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.")
@@ -525,4 +524,4 @@
if(href_list["showdesc"])
if(AM.mod_pick_name == href_list["showdesc"])
temp = AM.description
use(usr)
use(usr)
@@ -141,8 +141,7 @@
/datum/game_mode/proc/check_ai_loc()
for(var/datum/mind/AI_mind in malf_ai)
var/turf/ai_location = get_turf(AI_mind.current)
// TODO: Tie into space manager
if(ai_location && (ai_location.z == ZLEVEL_STATION))
if(ai_location && is_station_level(ai_location.z))
return 1
return 0
+1 -3
View File
@@ -36,8 +36,7 @@
var/Me = pickweight(meteortypes)
var/obj/effect/meteor/M = new Me(pickedstart)
M.dest = pickedgoal
// TODO: Tie into space manager
M.z_original = ZLEVEL_STATION
M.z_original = level_name_to_num(MAIN_STATION)
spawn(0)
walk_towards(M, M.dest, 1)
return
@@ -103,7 +102,6 @@
var/dropamt = 2
/obj/effect/meteor/Move()
// TODO: Tie into space manager
if(z != z_original || loc == dest)
qdel(src)
return
@@ -17,8 +17,7 @@
/datum/event/borer_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
//Stops cortical borers getting stuck in small networks. See: Security, Virology
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
@@ -290,14 +290,13 @@
/mob/living/simple_animal/hostile/swarmer/proc/DisperseTarget(var/mob/living/target)
if(target != src)
to_chat(src, "<span class='info'>Attempting to remove this being from our presence.</span>")
// TODO: Tie into space manager
if(src.z != ZLEVEL_STATION)
if(!is_station_level(src.z))
to_chat(src, "<span class='warning'>Our bluespace transceiver cannot locate a viable bluespace link, our teleportation abilities are useless in this area.</span>")
return
if(do_mob(src, target, 30))
var/cycle
for(cycle=0,cycle<100,cycle++)
var/random_location = locate(rand(37,202),rand(75,192),ZLEVEL_STATION)//Drunk dial a turf in the general ballpark of the station
var/random_location = locate(rand(37,202),rand(75,192),level_name_to_num(MAIN_STATION))//Drunk dial a turf in the general ballpark of the station
if(istype(random_location, /turf/simulated/floor))
var/turf/simulated/floor/F = random_location
if(F.air)
+1 -2
View File
@@ -142,8 +142,7 @@ datum/game_mode/nations
/datum/game_mode/nations/proc/remove_access()
for(var/obj/machinery/door/airlock/W in airlocks)
// TODO: Tie into space manager
if(W.z in config.station_levels)
if(is_station_level(W.z))
W.req_access = list()
+1 -2
View File
@@ -1358,8 +1358,7 @@ datum
var/turf/T = get_turf(target.current)
if(target.current.stat == 2)
return 1
// TODO: Tie into space manager
else if((T) && !(T.z in config.station_levels))//If they leave the station they count as dead for this
else if((T) && !is_station_level(T.z))//If they leave the station they count as dead for this
return 2
else
return 0
@@ -19,8 +19,7 @@
if(player_list.len < MIN_CHALLENGE_PLAYERS)
to_chat(user, "The enemy crew is too small to be worth declaring war on.")
return
// TODO: Tie into space manager
if(user.z != ZLEVEL_CENTCOMM)
if(!is_admin_level(user.z))
to_chat(user, "You have to be at your base to use this.")
return
+3 -6
View File
@@ -353,8 +353,7 @@ var/bomb_set
var/off_station = 0
var/turf/bomb_location = get_turf(src)
// TODO: Tie into space manager
if( bomb_location && (bomb_location.z in config.station_levels) )
if( bomb_location && is_station_level(bomb_location.z) )
if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) )
off_station = 1
else
@@ -364,8 +363,7 @@ var/bomb_set
if(ticker.mode && ticker.mode.name == "nuclear emergency")
var/obj/docking_port/mobile/syndie_shuttle = shuttle_master.getShuttle("syndicate")
if(syndie_shuttle)
// TODO: Tie into space manager
ticker.mode:syndies_didnt_escape = (syndie_shuttle.z > ZLEVEL_STATION ? 0 : 1) //muskets will make me change this, but it will do for now
ticker.mode:syndies_didnt_escape = is_station_level(syndie_shuttle.z)
ticker.mode:nuke_off_station = off_station
ticker.station_explosion_cinematic(off_station,null)
if(ticker.mode)
@@ -403,8 +401,7 @@ var/bomb_set
/obj/item/weapon/disk/nuclear/process()
var/turf/disk_loc = get_turf(src)
// TODO: Tie into space manager
if(disk_loc.z != ZLEVEL_STATION && disk_loc.z != ZLEVEL_CENTCOMM)
if(!is_secure_level(disk_loc.z))
var/holder = get(src, /mob)
if(holder)
to_chat(holder, "<span class='danger'>You can't help but feel that you just lost something back there...</span>")
+4 -11
View File
@@ -77,7 +77,6 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
check_completion()
if(target && target.current)
// TODO: Tie into space manager
if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
return 1
return 0
@@ -110,8 +109,7 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
if(target.current.stat == DEAD || !ishuman(target.current) || !target.current.ckey || !target.current.client)
return 1
var/turf/T = get_turf(target.current)
// TODO: Tie into space manager
if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
if(T && !is_station_level(T.z)) //If they leave the station they count as dead for this
return 2
return 0
return 1
@@ -146,8 +144,7 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
if(target in ticker.mode:head_revolutionaries)
return 1
var/turf/T = get_turf(target.current)
// TODO: Tie into space manager
if(T && !(T.z in config.station_levels)) //If they leave the station they count as dead for this
if(T && !is_station_level(T.z)) //If they leave the station they count as dead for this
rval = 2
return 0
return rval
@@ -173,12 +170,9 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
check_completion()
if(target && target.current)
// TODO: Tie into space manager
if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
return 1
// TODO: Tie into space manager
var/turf/target_location = get_turf(target.current)
if(target_location.z in config.admin_levels) //No hiding in lockers and cheezing greentext.
if(is_admin_level(target.current.z))
return 0
return 1
@@ -568,8 +562,7 @@ var/list/potential_theft_objectives=subtypesof(/datum/theft_objective) \
check_completion()
if(target && target.current)
// TODO: Tie into space manager
if(target.current.stat == DEAD || target.current.z > ZLEVEL_DERELICT || !target.current.ckey)
if(target.current.stat == DEAD || is_away_level(target.current.z) || !target.current.ckey)
return 1
return 0
return 1
+1 -2
View File
@@ -314,8 +314,7 @@
/datum/game_mode/revolution/proc/check_heads_victory()
for(var/datum/mind/rev_mind in head_revolutionaries)
var/turf/T = get_turf(rev_mind.current)
// TODO: Tie into space manager
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != 2) && rev_mind.current.client && T && (T.z == ZLEVEL_STATION))
if((rev_mind) && (rev_mind.current) && (rev_mind.current.stat != DEAD) && rev_mind.current.client && T && is_station_level(T.z))
if(ishuman(rev_mind.current))
return 0
return 1
+4 -9
View File
@@ -21,14 +21,12 @@
// Who is alive/dead, who escaped
for(var/mob/living/silicon/ai/I in mob_list)
// TODO: Tie into space manager
if(I.stat == DEAD && (I.z in config.station_levels))
if(I.stat == DEAD && is_station_level(I.z))
score_deadaipenalty++
score_deadcrew++
for(var/mob/living/carbon/human/I in mob_list)
// TODO: Tie into space manager
if(I.stat == DEAD && (I.z in config.station_levels))
if(I.stat == DEAD && is_station_level(I.z))
score_deadcrew++
if(I && I.mind)
@@ -81,9 +79,7 @@
// Check station's power levels
for(var/obj/machinery/power/apc/A in apcs)
// TODO: Tie into space manager
if(!(A.z in config.station_levels)) continue
if(!is_station_level(A.z)) continue
for(var/obj/item/weapon/stock_parts/cell/C in A.contents)
if(C.charge < 2300)
score_powerloss++ //200 charge leeway
@@ -91,8 +87,7 @@
// Check how much uncleaned mess is on the station
for(var/obj/effect/decal/cleanable/M in world)
// TODO: Tie into space manager
if(!(M.z in config.station_levels)) continue
if(!is_station_level(M.z)) continue
if(istype(M, /obj/effect/decal/cleanable/blood/gibs))
score_mess += 3
+2 -4
View File
@@ -122,8 +122,7 @@
command_announcement.Announce("The aliens have nearly succeeded in capturing the station and exterminating the crew. Activate the nuclear failsafe to stop the alien threat once and for all. The Nuclear Authentication Code is [get_nuke_code()] ", "Alien Lifeform Alert")
set_security_level("gamma")
var/obj/machinery/door/airlock/vault/V = locate(/obj/machinery/door/airlock/vault) in world
// TODO: Tie into space manager
if(V && (V.z in config.station_levels))
if(V && is_station_level(V.z))
V.locked = 0
V.update_icon()
return ..()
@@ -143,8 +142,7 @@
var/list/livingplayers = list()
for(var/mob/M in player_list)
var/turf/T = get_turf(M)
// TODO: Tie into space manager
if((M) && (M.stat != 2) && M.client && T && ((T.z in config.station_levels) || shuttle_master.emergency.mode >= SHUTTLE_ESCAPE && ((T.z in config.station_levels) || (T.z in config.admin_levels))))
if((M) && (M.stat != DEAD) && M.client && T && (is_station_level(T.z) || shuttle_master.emergency.mode >= SHUTTLE_ESCAPE && is_secure_level(T.z)))
if(ishuman(M))
livingplayers += 1
return livingplayers.len
-1
View File
@@ -769,7 +769,6 @@
var/turf/pos = get_turf(src)
data["x"] = pos.x
data["y"] = pos.y
// TODO: Tie into space manager
data["z"] = pos.z
return data
@@ -113,7 +113,6 @@
scrubber.update_icon()
proc/validscrubber( var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
// TODO: Tie into space manager
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
return 0
+1 -1
View File
@@ -43,7 +43,7 @@
/obj/machinery/camera/initialize()
..()
if(z == ZLEVEL_STATION && prob(3) && !start_active)
if(is_station_level(z) && prob(3) && !start_active)
toggle_cam()
/obj/machinery/camera/Destroy()
+1 -4
View File
@@ -1,10 +1,7 @@
/mob/living/silicon/ai/proc/InvalidTurf(turf/T as turf)
if(!T)
return 1
// TODO: Tie into space manager
if((T.z in config.admin_levels))
return 1
if(T.z > MAX_Z)
if(!is_level_reachable(T.z))
return 1
return 0
+1 -2
View File
@@ -75,8 +75,7 @@
var/list/cameras = list()
for(var/obj/machinery/camera/C in cameranet.cameras)
// TODO: Tie into space manager
if((z > MAX_Z || C.z > MAX_Z) && (C.z != z)) //can only recieve away mission cameras on away missions
if((is_away_level(src.z) || is_away_level(C.z)) && !atoms_share_level(C, src)) //can only recieve away mission cameras on away missions
continue
if(!can_access_camera(C))
continue
@@ -54,8 +54,7 @@
if(..(href, href_list))
return 1
// TODO: Tie into space manager
if((!(src.z in config.station_levels) && !(src.z in config.admin_levels)))
if(!is_secure_level(src.z))
to_chat(usr, "<span class='warning'>Unable to establish a connection: You're too far away from the station!</span>")
return 1
@@ -304,8 +303,7 @@
if(stat & (NOPOWER|BROKEN))
return
// TODO: Tie into space manager
if(!(src.z in list(ZLEVEL_STATION, ZLEVEL_CENTCOMM)))
if(!is_secure_level(src.z))
to_chat(user, "<span class='warning'>Unable to establish a connection: You're too far away from the station!</span>")
return
+2 -4
View File
@@ -20,8 +20,7 @@
/obj/machinery/computer/HONKputer/Topic(href, href_list)
if(..())
return 1
// TODO: Tie into space manager
if(!(src.z in config.station_levels))
if(is_away_level(src.z))
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
usr.set_machine(src)
@@ -69,8 +68,7 @@
/obj/machinery/computer/HONKputer/attack_hand(var/mob/user as mob)
if(..())
return
// TODO: Tie into space manager
if(src.z > ZLEVEL_DERELICT)
if(is_away_level(src.z))
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
+1 -2
View File
@@ -29,8 +29,7 @@
attackby(obj/item/weapon/O as obj, mob/user as mob, params)
// TODO: Tie into space manager
if(user.z > ZLEVEL_DERELICT)
if(is_away_level(user.z))
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
if(istype(O, /obj/item/weapon/aiModule))
+4 -2
View File
@@ -208,7 +208,9 @@
id_tags -= ident_tag
if(href_list["dstele"])
var/choices = list(0)
choices += accessable_z_levels
var/list/reachable_levels = levels_by_trait(REACHABLE)
for(var/datum/space_level/S in reachable_levels)
choices += S.zpos
var/obj/machinery/computer/pod/deathsquad/D = src
var/input = input("Enter the destination Z-Level. The mechs will arrive from the East. Leave 0 if you don't want to set a specific ZLevel", "Mass Driver Controls", 0) in choices
D.teleporter_dest = input
@@ -362,4 +364,4 @@
AM.dir = 8
var/atom/target = get_edge_target_turf(AM, AM.dir)
AM.throw_at(target, 50, 1)
return
return
+1 -2
View File
@@ -65,8 +65,7 @@
health_display = "DEAD"
else if(total_loss)
health_display = "HURT ([total_loss])"
// TODO: Tie into space manager
if((M.z in config.station_levels) && !istype(M.loc, /turf/space))
if(is_station_level(M.z) && !istype(M.loc, /turf/space))
loc_display = "[get_area(M)]"
dat += "ID: [T.id] <BR>Subject: [M] <BR>Location: [loc_display] <BR>Health: [health_display] <BR>"
dat += "<A href='?src=\ref[src];warn=\ref[T]'>(<font color=red><i>Message Holder</i></font>)</A> |<BR>"
+1 -2
View File
@@ -41,8 +41,7 @@
/obj/machinery/computer/secure_data/attack_hand(mob/user as mob)
if(..())
return
// TODO: Tie into space manager
if(src.z > ZLEVEL_DERELICT)
if(is_away_level(src.z))
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
var/dat
+1 -2
View File
@@ -41,8 +41,7 @@
if(..())
return
// TODO: Tie into space manager
if(src.z > ZLEVEL_DERELICT)
if(is_away_level(src.z))
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
var/dat
+1 -3
View File
@@ -295,9 +295,7 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
// TODO: Tie into space manager
// also hwat
if(z == ZLEVEL_STATION || ZLEVEL_ASTEROID == 5)
if(is_station_contact(src.z))
if(security_level)
src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
else
+1 -2
View File
@@ -5,8 +5,7 @@
/obj/machinery/status_display/supply_display/update()
if(!..() && mode == STATUS_DISPLAY_CUSTOM)
if(shuttle_master.supply.mode == SHUTTLE_IDLE)
// TODO: Tie into space manager
if(shuttle_master.supply.z == ZLEVEL_STATION)
if(is_station_level(shuttle_master.supply.z))
message1 = "CARGO"
message2 = "Docked"
else
+6 -6
View File
@@ -440,7 +440,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(data == 1)
for(var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq, level)
@@ -453,7 +453,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
if(istype(R, /obj/item/device/radio/headset))
continue
var/turf/position = get_turf(R)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -465,7 +465,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/datum/radio_frequency/antag_connection = radio_controller.return_frequency(freq)
for(var/obj/item/device/radio/R in antag_connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(freq)
@@ -475,7 +475,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
else
for(var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
var/turf/position = get_turf(R)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(position && position.z == level)
receive |= R.send_hear(display_freq)
@@ -605,7 +605,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/atom/proc/test_telecomms()
var/datum/signal/signal = src.telecomms_process()
var/turf/position = get_turf(src)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
return (position.z in signal.data["level"]) && signal.data["done"]
/atom/proc/telecomms_process(var/do_sleep = 1)
@@ -624,7 +624,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
"type" = 4, // determines what type of radio input it is: test broadcast
"reject" = 0,
"done" = 0,
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
"level" = pos.z // The level it is being broadcasted at.
)
signal.frequency = PUB_FREQ// Common channel
@@ -180,12 +180,12 @@
var/turf/position = get_turf(src)
// Toggle on/off getting signals from the station or the current Z level
// TODO: Tie into space manager
if(src.listening_level == ZLEVEL_STATION) // equals the station
// TODO: Could work with the space manager better
if(is_station_level(src.listening_level)) // equals the station
src.listening_level = position.z
return 1
else if(position.z == ZLEVEL_TELECOMMS)
src.listening_level = ZLEVEL_STATION
else if(level_boosts_signal(position.z))
src.listening_level = level_name_to_num(MAIN_STATION)
return 1
return 0
@@ -234,8 +234,8 @@
/obj/machinery/telecomms/relay/Options_Menu()
var/dat = ""
if(src.z == ZLEVEL_TELECOMMS)
dat += "<br>Signal Locked to Station: <A href='?src=\ref[src];change_listening=1'>[listening_level == ZLEVEL_STATION ? "TRUE" : "FALSE"]</a>"
if(level_boosts_signal(src.z))
dat += "<br>Signal Locked to Station: <A href='?src=\ref[src];change_listening=1'>[is_station_level(listening_level) ? "TRUE" : "FALSE"]</a>"
dat += "<br>Broadcasting: <A href='?src=\ref[src];broadcast=1'>[broadcasting ? "YES" : "NO"]</a>"
dat += "<br>Receiving: <A href='?src=\ref[src];receive=1'>[receiving ? "YES" : "NO"]</a>"
return dat
@@ -56,7 +56,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
continue
if(amount && send_count >= amount)
break
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(machine.loc.z != listening_level)
if(long_range_link == 0 && machine.long_range_link == 0)
continue
@@ -115,7 +115,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(!listening_level)
//Defaults to our Z level!
var/turf/position = get_turf(src)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
listening_level = position.z
/obj/machinery/telecomms/initialize()
@@ -141,7 +141,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/proc/add_link(var/obj/machinery/telecomms/T)
var/turf/position = get_turf(src)
var/turf/T_position = get_turf(T)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if((position.z == T_position.z) || (src.long_range_link && T.long_range_link))
for(var/x in autolinkers)
if(T.autolinkers.Find(x))
+6 -9
View File
@@ -182,8 +182,7 @@
var/turf/T = get_turf(R)
if(!T)
continue
// TODO: Tie into space manager
if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
if(!is_teleport_allowed(T.z))
continue
if(R.syndicate == 1 && emagged == 0)
continue
@@ -199,13 +198,12 @@
continue
else
var/mob/M = I.loc
if(M.stat == 2)
if(M.stat == DEAD)
if(M.timeofdeath + 6000 < world.time)
continue
var/turf/T = get_turf(M)
if(!T) continue
// TODO: Tie into space manager
if((T.z in config.admin_levels)) continue
if(!is_teleport_allowed(T.z)) continue
var/tmpname = M.real_name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
@@ -227,8 +225,7 @@
var/turf/T = get_turf(R)
if(!T || !R.teleporter_hub || !R.teleporter_console)
continue
// TODO: Tie into space manager
if((T.z in config.admin_levels) || T.z > ZLEVEL_EMPTY)
if(!is_teleport_allowed(T.z))
continue
var/tmpname = T.loc.name
if(areaindex[tmpname])
@@ -323,7 +320,7 @@
return power_station
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
if(z == ZLEVEL_CENTCOMM && !admin_usage)
if(!is_teleport_allowed(z) && !admin_usage)
to_chat(M, "You can't use this here.")
return
if(power_station && power_station.engaged && !panel_open)
@@ -401,7 +398,7 @@
/obj/machinery/teleport/perma/Bumped(M as mob|obj)
if(stat & (BROKEN|NOPOWER))
return
if(z == ZLEVEL_CENTCOMM)
if(!is_teleport_allowed(z))
to_chat(M, "You can't use this here.")
return
if(target && !recalibrating && !panel_open)
+2 -4
View File
@@ -382,8 +382,7 @@
range = RANGED
action(atom/target)
// TODO: Tie into space manager
if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
if(!action_checks(target) || !is_teleport_allowed(src.loc.z)) return
var/turf/T = get_turf(target)
if(T)
set_ready_state(0)
@@ -404,8 +403,7 @@
action(atom/target)
// TODO: Tie into space manager
if(!action_checks(target) || (src.loc.z in config.admin_levels)) return
if(!action_checks(target) || !is_teleport_allowed(src.loc.z)) return
var/list/theareas = list()
for(var/area/AR in orange(100, chassis))
if(AR in theareas) continue
+1 -1
View File
@@ -13,7 +13,7 @@
switch(name) //some of these are probably obsolete
if("shuttle")
shuttle_z = z
log_debug("Obsolete landmark '[name]' at ([x],[y],[z])")
qdel(src)
if("airtunnel_stop")
@@ -61,7 +61,6 @@
return null
var/turf/T = get_turf(user.loc)
// TODO: Tie into space manager
if(T.z != current.z || !current.can_use())
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
current = null
@@ -226,7 +225,6 @@
to_chat(usr, "<span class='danger'>Something's wrong with that camera. You can't get a feed.</span>")
return
var/turf/T = get_turf(loc)
// TODO: Tie into space manager
if(!T || C.z != T.z)
to_chat(usr, "<span class='danger'>You can't get a signal.</span>")
return
@@ -124,7 +124,7 @@
return -1
if(!(0 in level))
var/turf/position = get_turf(src)
// TODO: Tie into space manager
// TODO: Integrate radio with the space manager
if(isnull(position) || !(position.z in level))
return -1
if(!src.listening)
@@ -64,8 +64,7 @@
//Play sound through the station intercomms, so everyone knows the doom you have wrought.
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
// TODO: Tie into space manager
if(I.z != ZLEVEL_STATION) //Only broadcast to the station intercoms
if(!is_station_level(I.z)) //Only broadcast to the station intercoms
continue
if(!I.on) //Only broadcast to active intercoms (powered, switched on)
continue
@@ -48,8 +48,7 @@ Frequency:
return 1
var/turf/current_location = get_turf(usr)//What turf is the user on?
// TODO: Tie into space manager
if(!current_location ||( current_location.z in config.admin_levels))//If turf was not found or they're on z level 2.
if(!current_location || is_admin_level(current_location.z))//If turf was not found or they're in the admin zone
to_chat(usr, "<span class='warning'>\The [src] is malfunctioning.</span>")
return 1
@@ -62,7 +61,6 @@ Frequency:
for(var/obj/item/device/radio/beacon/W in beacons)
if(W.frequency == frequency && !W.syndicate)
// TODO: Tie into space manager
if(W && W.z == z)
var/turf/TB = get_turf(W)
temp += "[W.code]: [TB.x], [TB.y], [TB.z]<BR>"
@@ -109,8 +107,7 @@ Frequency:
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
var/turf/current_location = get_turf(user)//What turf is the user on?
// TODO: Tie into space manager
if(!current_location||(current_location.z in config.admin_levels)||current_location.z>=ZLEVEL_EMPTY)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
if(!current_location||!is_teleport_allowed(current_location.z))//If turf was not found or they're somewhere teleproof
to_chat(user, "<span class='notice'>\The [src] is malfunctioning.</span>")
return
var/list/L = list( )
@@ -192,8 +192,7 @@
return
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
// TODO: Tie into space manager
if(!(src.z in config.contact_levels))
if(!is_level_reachable(src.z))
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
return
if(E.mode == 0)
@@ -84,8 +84,7 @@
if(istype(W, /obj/item/weapon/rcs) && !src.opened)
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
// TODO: Tie into space manager
if(!(src.z in config.player_levels))
if(!is_level_reachable(src.z)) // This is inconsistent with the closet sending code
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
return
if(E.mode == 0)
+2 -1
View File
@@ -93,7 +93,8 @@
var/max = world.maxx-TRANSITIONEDGE
var/min = 1+TRANSITIONEDGE
var/_z = rand(ZLEVEL_CENTCOMM+1,MAX_Z) //select a random space zlevel
var/datum/space_level/dest = pick(levels_by_trait(REACHABLE))
var/_z = dest.zpos //select a random space zlevel
//now select coordinates for a border turf
var/_x
+3 -6
View File
@@ -1980,8 +1980,7 @@
return
else
for(var/obj/machinery/photocopier/faxmachine/F in allfaxes)
// TODO: Tie into space manager
if((F.z in config.station_levels))
if(is_station_level(F.z))
spawn(0)
if(!F.receivefax(P))
to_chat(src.owner, "\red Message transmission to [F.department] failed.")
@@ -2328,8 +2327,7 @@
for(var/mob/living/carbon/human/H in mob_list)
var/turf/loc = find_loc(H)
var/security = 0
// TODO: Tie into space manager
if(!(loc.z in config.station_levels) || prisonwarped.Find(H))
if(!is_station_level(loc.z) || prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
continue
@@ -2566,8 +2564,7 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","EgL")
for(var/obj/machinery/door/airlock/W in airlocks)
// TODO: Tie into space manager
if((W.z in config.station_levels) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
W.req_access = list()
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
command_announcement.Announce("Centcomm airlock control override activated. Please take this time to get acquainted with your coworkers.", new_sound = 'sound/AI/commandreport.ogg')
+1 -2
View File
@@ -373,8 +373,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for(var/I in singularities)
var/obj/singularity/S = I
// TODO: Tie into space manager
if(S.z == ZLEVEL_CENTCOMM || S.z >= MAX_Z)
if(!is_level_reachable(S.z))
continue
qdel(S)
log_admin("[key_name(src)] has deleted all Singularities and Tesla orbs.")
+1 -2
View File
@@ -81,8 +81,7 @@ var/list/sounds_cache = list()
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
// TODO: Tie into space manager
if(I.z != ZLEVEL_STATION && !ignore_z)
if(!is_station_level(I.z) && !ignore_z)
continue
if(!I.on && !ignore_power)
continue
+1 -1
View File
@@ -59,7 +59,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED)
var/zlev = space_manager.add_new_zlevel(AWAY_MISSION, linkage = UNAFFECTED, traits = list(AWAY_LEVEL,BLOCK_TELEPORT))
space_manager.add_dirt(zlev)
maploader.load_map(file, z_offset = zlev)
late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
@@ -115,8 +115,7 @@
to_chat(H, "<span class='warning'>You cannot teleport into solid walls.</span>")
return 0*///Who the fuck cares? Ninjas in walls are cool.
// TODO: Tie into space manager
if(T.z in config.admin_levels)
if(!is_teleport_allowed(T.z))
to_chat(H, "<span class='warning'>You cannot use your teleporter on this Z-level.</span>")
return 0
+1 -2
View File
@@ -181,8 +181,7 @@
//proc/camera_list(var/datum/file/camnet_key/key)
get_machines(var/datum/file/camnet_key/key)
// TODO: Tie into space manager
if(!computer || computer.z > ZLEVEL_DERELICT)
if(!computer || !is_away_level(computer.z))
return null
var/list/L = list()
@@ -59,8 +59,7 @@
Topic(var/href, var/list/href_list)
if(!interactable() || !computer.radio || ..(href,href_list) )
return
// TODO: Tie into space manager
if(!(computer.z in config.station_levels))
if(!is_station_level(computer.z))
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
+1 -2
View File
@@ -24,8 +24,7 @@
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
// TODO: Tie into space manager
if(user.z > ZLEVEL_DERELICT)
if(is_away_level(user.z))
to_chat(user, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
if(istype(module, /obj/item/weapon/aiModule))
+1 -2
View File
@@ -49,8 +49,7 @@
scan = computer.cardslot.reader
if(!interactable())
return
// TODO: Tie into space manager
if(computer.z > ZLEVEL_DERELICT)
if(is_away_level(computer.z))
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
var/dat
+1 -2
View File
@@ -43,8 +43,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
// TODO: Tie into space manager
if(M.z == ZLEVEL_STATION && !istype(M.loc, /turf/space))
if(is_station_level(M.z) && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
dat += "ID: [T.id] | Location: [loc_display]<BR>"
+1 -2
View File
@@ -31,8 +31,7 @@
interact()
// TODO: Tie into space manager
if(!interactable() || computer.z > ZLEVEL_DERELICT)
if(!interactable() || is_away_level(computer.z))
return
var/dat
if(src.temp)
+1 -2
View File
@@ -57,8 +57,7 @@
if(!interactable())
return
// TODO: Tie into space manager
if(computer.z > ZLEVEL_DERELICT)
if(is_away_level(computer.z))
to_chat(usr, "<span class='danger'>Unable to establish a connection</span>: You're too far away from the station!")
return
var/dat
+1 -1
View File
@@ -105,7 +105,7 @@
for(var/obj/O in radio_connection.devices)
if(istype(O,typekey))
T = get_turf(O)
// TODO: Tie into space manager
// TODO: Make the radio system cooperate with the space manager
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
result |= O
return result
+1 -2
View File
@@ -17,8 +17,7 @@
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
+1 -2
View File
@@ -19,8 +19,7 @@
var/obj/item/device/radio/beacon/chosen
var/list/possible = list()
for(var/obj/item/device/radio/beacon/W in world)
// TODO: Tie into space manager
if(!(W.z in config.station_levels))
if(!is_station_level(W.z))
continue
possible += W
+1 -2
View File
@@ -18,8 +18,7 @@
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
// TODO: Tie into space manager
if(V.z != ZLEVEL_STATION) continue
if(!is_station_level(V.z)) continue
vendingMachines.Add(V)
if(!vendingMachines.len)
+1 -2
View File
@@ -21,8 +21,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
// TODO: Tie into space manager
if(T.z != ZLEVEL_STATION)
if(!is_station_level(T.z))
continue
var/foundAlready = 0 // don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses)
+1 -1
View File
@@ -62,7 +62,7 @@
goal = locate(endx, endy, 1)
src.x = startx
src.y = starty
src.z = ZLEVEL_STATION
src.z = level_name_to_num(MAIN_STATION)
spawn(0)
walk_towards(src, goal, 1)
return
+5 -10
View File
@@ -22,8 +22,7 @@
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
// TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.last_charge = S.charge
S.last_output_attempt = S.output_attempt
@@ -36,8 +35,7 @@
for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
// TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = 0
@@ -50,15 +48,13 @@
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in apcs)
var/area/current_area = get_area(C)
// TODO: Tie into space manager
if(current_area.type in skipped_areas_apc || !(C.z in config.station_levels))
if(current_area.type in skipped_areas_apc || !is_station_level(C.z))
continue
if(C.cell)
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
// TODO: Tie into space manager
if(current_area.type in skipped_areas || !(S.z in config.station_levels))
if(current_area.type in skipped_areas || !is_station_level(S.z))
continue
S.charge = S.last_charge
S.output_attempt = S.last_output_attempt
@@ -70,8 +66,7 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in machines)
// TODO: Tie into space manager
if(S.z != ZLEVEL_STATION)
if(!is_station_level(S.z))
continue
S.charge = S.capacity
S.output_level = S.output_level_max
+1 -2
View File
@@ -1,7 +1,6 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
// TODO: Tie into space manager
if(!(xmas.z in config.station_levels)) continue
if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
+1 -1
View File
@@ -171,7 +171,7 @@ var/global/Holiday = null
*/
/* var/list/obj/containers = list()
for(var/obj/item/weapon/storage/S in world)
if(!(S.z in config.station_levels)) continue
if(!is_station_level(S.z)) continue
containers += S
message_admins("\blue DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])")*/
+3 -6
View File
@@ -24,8 +24,7 @@
command_announcement.Announce("High levels of radiation detected near the station. Please evacuate into one of the shielded maintenance tunnels.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
for(var/area/A in world)
// TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.radiation_alert()
@@ -43,8 +42,7 @@
var/turf/T = get_turf(H)
if(!T)
continue
// TODO: Tie into space manager
if(!(T.z in config.station_levels) || is_safe_zone(T.loc))
if(!is_station_level(T.z) || is_safe_zone(T.loc))
continue
if(istype(H,/mob/living/carbon/human))
@@ -63,8 +61,7 @@
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
for(var/area/A in world)
// TODO: Tie into space manager
if(!(A.z in config.station_levels) || is_safe_zone(A))
if(!is_station_level(A.z) || is_safe_zone(A))
continue
A.reset_radiation_alert()
+1 -1
View File
@@ -41,7 +41,7 @@
var/datum/effect/system/spark_spread/sparks = new /datum/effect/system/spark_spread()
sparks.set_up(3, 0, D.loc)
sparks.start()
D.z = ZLEVEL_CENTCOMM
D.z = level_name_to_num(CENTCOMM)
D.has_loot = 0
qdel(D)
+1 -2
View File
@@ -16,8 +16,7 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
+1 -2
View File
@@ -9,8 +9,7 @@
RS.start()
RS.kill()
for(var/area/A)
// TODO: Tie into space manager
if(!(A.z in config.station_levels)) continue //Spook on main station only.
if(!is_station_level(A.z)) continue //Spook on main station only.
if(A.luminosity) continue
// if(A.lighting_space) continue
if(A.type == /area) continue
+1 -2
View File
@@ -11,8 +11,7 @@
/datum/event/vent_clog/setup()
endWhen = rand(25, 100)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
// TODO: Tie into space manager
if((temp_vent.loc.z in config.station_levels))
if(is_station_level(temp_vent.loc.z))
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
+1 -2
View File
@@ -13,8 +13,7 @@
/datum/event/wormholes/start()
for(var/turf/simulated/floor/T in world)
// TODO: Tie into space manager
if((T.z in config.station_levels))
if(is_station_level(T.z))
pick_turfs += T
for(var/i in 1 to number_of_wormholes)
+1 -2
View File
@@ -1,7 +1,6 @@
/datum/holiday/xmas/celebrate()
for(var/obj/structure/flora/tree/pine/xmas in world)
// TODO: Tie into space manager
if(!(xmas.z in config.station_levels)) continue
if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/weapon/a_gift(T)
+1 -2
View File
@@ -376,8 +376,7 @@
// Bluespace tomato code copied over from grown.dm.
if(get_trait(TRAIT_TELEPORTING))
// TODO: Tie into space manager
if(target.z in config.admin_levels)
if(!is_teleport_allowed(target.z))
return 1
//Plant potency determines radius of teleport.
+2 -4
View File
@@ -528,8 +528,7 @@
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
var/turf/device_turf = get_turf(user)
// TODO: Tie into space manager
if(!device_turf||device_turf.z==ZLEVEL_CENTCOMM||device_turf.z>=ZLEVEL_EMPTY)
if(!device_turf||is_teleport_allowed(device_turf.z))
to_chat(user, "<span class='notice'>You're having difficulties getting the [src.name] to work.</span>")
return
else
@@ -537,8 +536,7 @@
var/list/L = list()
for(var/obj/item/device/radio/beacon/B in world)
var/turf/T = get_turf(B)
// TODO: Tie into space manager
if(T.z == ZLEVEL_STATION)
if(is_station_level(T.z))
L += B
if(!L.len)
to_chat(user, "<span class='notice'>The [src.name] failed to create a wormhole.</span>")
+1 -2
View File
@@ -240,8 +240,7 @@
/obj/item/weapon/ore/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
// TODO: Tie into space manager
if(src.z == ZLEVEL_ASTEROID)
if(is_mining_level(src.z))
score_oremined++ //When ore spawns, increment score. Only include ore spawned on mining asteroid (No Clown Planet)
/obj/item/weapon/ore/ex_act()
+1 -4
View File
@@ -18,10 +18,7 @@
var/turf/T = get_turf(src)
if(!T)
return 0
// TODO: Tie into space manager
if(T.z == ZLEVEL_CENTCOMM) //dont detect mobs on centcomm
return 0
if(T.z >= MAX_Z)
if(!is_level_reachable(T.z))
return 0
if(user != null && src == user)
return 0
+1 -3
View File
@@ -639,15 +639,13 @@ var/list/ai_verbs_default = list(
if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO))
return
var/ai_allowed_Zlevel = list(ZLEVEL_STATION,ZLEVEL_TELECOMMS,ZLEVEL_ASTEROID)
var/d
var/area/bot_area
d += "<A HREF=?src=\ref[src];botrefresh=\ref[Bot]>Query network status</A><br>"
d += "<table width='100%'><tr><td width='40%'><h3>Name</h3></td><td width='20%'><h3>Status</h3></td><td width='30%'><h3>Location</h3></td><td width='10%'><h3>Control</h3></td></tr>"
for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
// TODO: Tie into space manager
if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
if(is_ai_allowed(Bot.z) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
bot_area = get_area(Bot)
d += "<tr><td width='30%'>[Bot.hacked ? "<span class='bad'>(!) </span>[Bot.name]" : Bot.name] ([Bot.model])</td>"
//If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
@@ -500,8 +500,7 @@
/mob/living/silicon/pai/proc/hackloop()
var/turf/T = get_turf_or_move(src.loc)
for(var/mob/living/silicon/ai/AI in player_list)
// TODO: Tie into space manager
if(!T || !(T.z in config.contact_levels))
if(!T || !is_station_contact(T.z))
break
if(T.loc)
to_chat(AI, "<font color = red><b>Network Alert: Brute-force encryption crack in progress in [T.loc].</b></font>")
+1 -2
View File
@@ -41,8 +41,7 @@
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
// unless it's on the same level as the object it's interacting with.
var/turf/T = get_turf(src_object)
// TODO: Tie into space manager
if(!T || !(z == T.z || (T.z in config.player_levels)))
if(!T || !(atoms_share_level(src,T) || is_level_reachable(T.z)))
return STATUS_CLOSE
// If an object is in view then we can interact with it
+1 -2
View File
@@ -5,8 +5,7 @@
if(..())
return 1
var/turf/T = get_turf(nano_host())
// TODO: Tie into space manager
if(!T || !(T.z in config.player_levels))
if(!T || !is_level_reachable(T.z))
to_chat(usr, "<span class='warning'>Unable to establish a connection<span>: You're too far away from the station!")
return 0
if(href_list["track"])

Some files were not shown because too many files have changed in this diff Show More