Replace hardcoded z-level numbers with a trait system

This commit is contained in:
Tad Hardesty
2018-01-11 14:06:17 -06:00
committed by CitadelStationBot
parent b2021912d7
commit 72319a9794
23 changed files with 518 additions and 125 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
var/mach = 0
/datum/station_state/proc/count()
for(var/Z in GLOB.station_z_levels)
for(var/Z in SSmapping.levels_by_trait(ZTRAIT_STATION))
for(var/turf/T in block(locate(1,1,Z), locate(world.maxx,world.maxy,Z)))
// don't count shuttles since they may have just left
if(istype(T.loc, /area/shuttle))
+3 -3
View File
@@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
var/max_i = 10//number of tries to spawn meteor.
while(!isspaceturf(pickedstart))
var/startSide = pick(GLOB.cardinals)
var/startZ = pick(GLOB.station_z_levels)
var/startZ = pick(SSmapping.levels_by_trait(ZTRAIT_STATION))
pickedstart = spaceDebrisStartLoc(startSide, startZ)
pickedgoal = spaceDebrisFinishLoc(startSide, startZ)
max_i--
@@ -40,7 +40,6 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
var/Me = pickweight(meteortypes)
var/obj/effect/meteor/M = new Me(pickedstart, pickedgoal)
M.dest = pickedgoal
M.z_original = M.z
/proc/spaceDebrisStartLoc(startSide, Z)
var/starty
@@ -95,7 +94,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
pass_flags = PASSTABLE
var/heavy = 0
var/meteorsound = 'sound/effects/meteorimpact.ogg'
var/z_original = ZLEVEL_STATION_PRIMARY
var/z_original
var/threat = 0 // used for determining which meteors are most interesting
var/lifetime = DEFAULT_METEOR_LIFETIME
var/timerid = null
@@ -126,6 +125,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
/obj/effect/meteor/Initialize(mapload, target)
. = ..()
z_original = z
GLOB.meteor_list += src
SSaugury.register_doom(src, threat)
SpinAnimation()