From e9dc3f80b71283bebe036bb3764625146b09c5d1 Mon Sep 17 00:00:00 2001 From: dageavtobusnick <71216640+dageavtobusnick@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:28:23 +0500 Subject: [PATCH] redefine fix --- code/__DEFINES/flags.dm | 13 ++----------- code/__DEFINES/misc.dm | 43 ----------------------------------------- code/__DEFINES/turfs.dm | 9 +++++++++ 3 files changed, 11 insertions(+), 54 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index cc792674c8c..4ddca05d5c2 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -149,6 +149,8 @@ #define MOB_SPAWN_ALLOWED (1<<3) /// If megafauna can be spawned by natural random generation #define MEGAFAUNA_SPAWN_ALLOWED (1<<4) +/// If blobs can spawn there and if it counts towards their score. +#define BLOBS_ALLOWED (1<<5) //ORGAN TYPE FLAGS #define AFFECT_ROBOTIC_ORGAN 1 @@ -208,17 +210,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define MOBILITY_FLAGS_CARBON_DEFAULT (MOBILITY_MOVE|MOBILITY_STAND|MOBILITY_PICKUP|MOBILITY_USE|MOBILITY_UI|MOBILITY_STORAGE|MOBILITY_PULL|MOBILITY_REST|MOBILITY_LIEDOWN) #define MOBILITY_FLAGS_REST_CAPABLE_DEFAULT (MOBILITY_MOVE|MOBILITY_STAND|MOBILITY_PICKUP|MOBILITY_USE|MOBILITY_UI|MOBILITY_STORAGE|MOBILITY_PULL|MOBILITY_REST|MOBILITY_LIEDOWN) -//AREA FLAGS -/// If mining tunnel generation is allowed in this area -#define CAVES_ALLOWED (1<<1) -/// If flora are allowed to spawn in this area randomly through tunnel generation -#define FLORA_ALLOWED (1<<2) -/// If mobs can be spawned by natural random generation -#define MOB_SPAWN_ALLOWED (1<<3) -/// If megafauna can be spawned by natural random generation -#define MEGAFAUNA_SPAWN_ALLOWED (1<<4) -/// If blobs can spawn there and if it counts towards their score. -#define BLOBS_ALLOWED (1<<5) // timed_action_flags parameter for [/proc/do_after()] /// Can do the action even if mob moves location. diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index ee720ba176d..7ced20b795e 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -100,49 +100,6 @@ #define in_range(source, user) (get_dist(source, user) <= 1) -#define RANGE_TURFS(RADIUS, CENTER) \ - RECT_TURFS(RADIUS, RADIUS, CENTER) - -#define RECT_TURFS(H_RADIUS, V_RADIUS, CENTER) \ - block( \ - max(CENTER.x - (H_RADIUS), 1), max(CENTER.y - (V_RADIUS), 1), CENTER.z, \ - min(CENTER.x + (H_RADIUS), world.maxx), min(CENTER.y + (V_RADIUS), world.maxy), CENTER.z \ - ) - -#define RANGE_TURFS_MULTIZ(RADIUS, CENTER, Z_MIN, Z_MAX) \ - RECT_TURFS_MULTIZ(RADIUS, RADIUS, Z_MIN, Z_MAX, CENTER) - -#define RECT_TURFS_MULTIZ(H_RADIUS, V_RADIUS, Z_MIN, Z_MAX, CENTER) \ - block( \ - max(CENTER.x - (H_RADIUS), 1), max(CENTER.y - (V_RADIUS), 1), Z_MIN, \ - min(CENTER.x + (H_RADIUS), world.maxx), min(CENTER.y + (V_RADIUS), world.maxy), Z_MAX \ - ) - -/// Returns the turfs on the edge of a square with CENTER in the middle and with the given RADIUS. If used near the edge of the map, will still work fine. -// order of the additions: top edge + bottom edge + left edge + right edge -#define RANGE_EDGE_TURFS(RADIUS, CENTER)\ - (CENTER.y + RADIUS < world.maxy ? block(max(CENTER.x - RADIUS, 1), min(CENTER.y + RADIUS, world.maxy), CENTER.z, min(CENTER.x + RADIUS, world.maxx), min(CENTER.y + RADIUS, world.maxy), CENTER.z) : list()) +\ - (CENTER.y - RADIUS > 1 ? block(max(CENTER.x - RADIUS, 1), max(CENTER.y - RADIUS, 1), CENTER.z, min(CENTER.x + RADIUS, world.maxx), max(CENTER.y - RADIUS, 1), CENTER.z) : list()) +\ - (CENTER.x - RADIUS > 1 ? block(max(CENTER.x - RADIUS, 1), min(CENTER.y + RADIUS - 1, world.maxy), CENTER.z, max(CENTER.x - RADIUS, 1), max(CENTER.y - RADIUS + 1, 1), CENTER.z) : list()) +\ - (CENTER.x + RADIUS < world.maxx ? block(min(CENTER.x + RADIUS, world.maxx), min(CENTER.y + RADIUS - 1, world.maxy), CENTER.z, min(CENTER.x + RADIUS, world.maxx), max(CENTER.y - RADIUS + 1, 1), CENTER.z) : list()) - -/// Returns a list of turfs in the rectangle specified by BOTTOM LEFT corner and height/width, checks for being outside the world border for you -#define CORNER_BLOCK(corner, width, height) CORNER_BLOCK_OFFSET(corner, width, height, 0, 0) - -/// Returns a list of turfs similar to CORNER_BLOCK but with offsets -#define CORNER_BLOCK_OFFSET(corner, width, height, offset_x, offset_y) ((block(locate(corner.x + offset_x, corner.y + offset_y, corner.z), locate(min(corner.x + (width - 1) + offset_x, world.maxx), min(corner.y + (height - 1) + offset_y, world.maxy), corner.z)))) - -/// Returns an outline (neighboring turfs) of the given block -#define CORNER_OUTLINE(corner, width, height) ( \ - CORNER_BLOCK_OFFSET(corner, width + 2, 1, -1, -1) + \ - CORNER_BLOCK_OFFSET(corner, width + 2, 1, -1, height) + \ - CORNER_BLOCK_OFFSET(corner, 1, height, -1, 0) + \ - CORNER_BLOCK_OFFSET(corner, 1, height, width, 0)) - -/// Returns a list of around us -#define TURF_NEIGHBORS(turf) (CORNER_BLOCK_OFFSET(turf, 3, 3, -1, -1) - turf) - - #define FOR_DVIEW(type, range, center, invis_flags) \ GLOB.dview_mob.loc = center; \ GLOB.dview_mob.set_invis_see(invis_flags); \ diff --git a/code/__DEFINES/turfs.dm b/code/__DEFINES/turfs.dm index 82f12afc7f6..e66a50ceb84 100644 --- a/code/__DEFINES/turfs.dm +++ b/code/__DEFINES/turfs.dm @@ -32,6 +32,15 @@ min(CENTER.x + (H_RADIUS), world.maxx), min(CENTER.y + (V_RADIUS), world.maxy), CENTER.z \ ) +#define RANGE_TURFS_MULTIZ(RADIUS, CENTER, Z_MIN, Z_MAX) \ + RECT_TURFS_MULTIZ(RADIUS, RADIUS, Z_MIN, Z_MAX, CENTER) + +#define RECT_TURFS_MULTIZ(H_RADIUS, V_RADIUS, Z_MIN, Z_MAX, CENTER) \ + block( \ + max(CENTER.x - (H_RADIUS), 1), max(CENTER.y - (V_RADIUS), 1), Z_MIN, \ + min(CENTER.x + (H_RADIUS), world.maxx), min(CENTER.y + (V_RADIUS), world.maxy), Z_MAX \ + ) + /// Returns the turfs on the edge of a square with CENTER in the middle and with the given RADIUS. If used near the edge of the map, will still work fine. // order of the additions: top edge + bottom edge + left edge + right edge #define RANGE_EDGE_TURFS(RADIUS, CENTER)\