Replace z_is_planet with a Z trait (#39581)

This commit is contained in:
Tad Hardesty
2018-08-08 09:44:00 -07:00
committed by vuonojenmustaturska
parent 3a32240a9e
commit d66b8dc8c4
3 changed files with 7 additions and 7 deletions

View File

@@ -37,6 +37,8 @@ require only minor tweaks.
#define ZTRAIT_AWAY "Away Mission" #define ZTRAIT_AWAY "Away Mission"
#define ZTRAIT_SPACE_RUINS "Space Ruins" #define ZTRAIT_SPACE_RUINS "Space Ruins"
#define ZTRAIT_LAVA_RUINS "Lava Ruins" #define ZTRAIT_LAVA_RUINS "Lava Ruins"
// prevents certain turfs from being stripped by a singularity
#define ZTRAIT_PLANET "Planet"
// number - bombcap is multiplied by this before being applied to bombs // number - bombcap is multiplied by this before being applied to bombs
#define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier" #define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier"

View File

@@ -14,4 +14,4 @@
#define is_away_level(z) SSmapping.level_trait(z, ZTRAIT_AWAY) #define is_away_level(z) SSmapping.level_trait(z, ZTRAIT_AWAY)
// If true, the singularity cannot strip away asteroid turf on this Z // If true, the singularity cannot strip away asteroid turf on this Z
#define is_planet_level(z) (GLOB.z_is_planet["z"]) #define is_planet_level(z) SSmapping.level_trait(z, ZTRAIT_PLANET)

View File

@@ -145,17 +145,15 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava)
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
T.flags_1 |= NO_LAVA_GEN_1 T.flags_1 |= NO_LAVA_GEN_1
//Contains the list of planetary z-levels defined by the planet_z helper. /// Adds the map it is on to the z_is_planet list
GLOBAL_LIST_EMPTY(z_is_planet) /obj/effect/mapping_helpers/planet_z
/obj/effect/mapping_helpers/planet_z //adds the map it is on to the z_is_planet list
name = "planet z helper" name = "planet z helper"
layer = POINT_LAYER layer = POINT_LAYER
/obj/effect/mapping_helpers/planet_z/Initialize() /obj/effect/mapping_helpers/planet_z/Initialize()
. = ..() . = ..()
var/turf/T = get_turf(src) var/datum/space_level/S = SSmapping.get_level(z)
GLOB.z_is_planet["[T.z]"] = TRUE S.traits[ZTRAIT_PLANET] = TRUE
//This helper applies components to things on the map directly. //This helper applies components to things on the map directly.