Skip to content

Commit

Permalink
Merge pull request #46 from out-of-phaze/lighthouse-sync/dev-2024-02-12
Browse files Browse the repository at this point in the history
Upstream dev sync, February 12 2024
  • Loading branch information
out-of-phaze authored Feb 25, 2024
2 parents a28eef5 + 8c35b05 commit 92d6964
Show file tree
Hide file tree
Showing 1,637 changed files with 54,255 additions and 50,671 deletions.
8 changes: 6 additions & 2 deletions code/__defines/MC.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (Datum.is_processing) {\
PRINT_STACK_TRACE("Failed to start processing. [log_info_line(Datum)] is already being processed by [Datum.is_processing] but queue attempt occured on [#Processor]."); \
}\
} else {\
Datum.is_processing = #Processor;\
Datum.is_processing = Processor._internal_name;\
Processor.processing += Datum;\
}

Expand Down Expand Up @@ -125,6 +125,9 @@ if(Datum.is_processing) {\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/##X{\
_internal_name = "SS" + #X;\
}\
/datum/controller/subsystem/##X

#define PROCESSING_SUBSYSTEM_DEF(X) var/global/datum/controller/subsystem/processing/##X/SS##X;\
Expand All @@ -137,4 +140,5 @@ if(Datum.is_processing) {\
processing = SS##X.processing; \
}\
}\
/datum/controller/subsystem/processing/##X
/datum/controller/subsystem/processing/##X/_internal_name = "SS" + #X;\
/datum/controller/subsystem/processing/##X
54 changes: 20 additions & 34 deletions code/__defines/ZAS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,28 @@
#define TURF_HAS_VALID_ZONE(T) (isturf(T) && T:zone && !T:zone:invalid)
#define SHOULD_PARTICIPATE_IN_ZONES(T) (isturf(T) && T:zone_membership_candidate && (!T:external_atmosphere_participation || !T:is_outside()))

#define ATMOS_CANPASS_MOVABLE(ret, AM, TARG_TURF) \
switch (AM.atmos_canpass) { \
if (CANPASS_ALWAYS) { } \
if (CANPASS_DENSITY) { \
if (AM.density) { \
ret |= AIR_BLOCKED; \
} \
} \
if (CANPASS_PROC) { \
ret |= (AIR_BLOCKED * !AM.CanPass(null, TARG_TURF, 0, 0)) | (ZONE_BLOCKED * !AM.CanPass(null, TARG_TURF, 1.5, 1)); \
} \
if (CANPASS_NEVER) { \
ret = BLOCKED; \
} \
}

#ifdef MULTIZAS

var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTHUP, EASTUP, WESTUP, SOUTHUP, NORTHDOWN, EASTDOWN, WESTDOWN, SOUTHDOWN)
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)

#define ATMOS_CANPASS_TURF(ret,A,B) \
#define ATMOS_CANPASS_TURF(ret, A, B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
ret = BLOCKED; \
} \
Expand All @@ -64,22 +80,7 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
switch (AM.atmos_canpass) { \
if (CANPASS_ALWAYS) { \
continue; \
} \
if (CANPASS_DENSITY) { \
if (AM.density) { \
ret |= AIR_BLOCKED; \
} \
} \
if (CANPASS_PROC) { \
ret |= (AIR_BLOCKED * !AM.CanPass(null, B, 0, 0)) | (ZONE_BLOCKED * !AM.CanPass(null, B, 1.5, 1)); \
} \
if (CANPASS_NEVER) { \
ret = BLOCKED; \
} \
} \
ATMOS_CANPASS_MOVABLE(ret, AM, B); \
if (ret == BLOCKED) { \
break;\
}\
Expand All @@ -90,7 +91,7 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)

#define ATMOS_CANPASS_TURF(ret,A,B) \
#define ATMOS_CANPASS_TURF(ret, A, B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
ret = BLOCKED; \
} \
Expand All @@ -101,22 +102,7 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
switch (AM.atmos_canpass) { \
if (CANPASS_ALWAYS) { \
continue; \
} \
if (CANPASS_DENSITY) { \
if (AM.density) { \
ret |= AIR_BLOCKED; \
} \
} \
if (CANPASS_PROC) { \
ret |= (AIR_BLOCKED * !AM.CanPass(null, B, 0, 0)) | (ZONE_BLOCKED * !AM.CanPass(null, B, 1.5, 1)); \
} \
if (CANPASS_NEVER) { \
ret = BLOCKED; \
} \
} \
ATMOS_CANPASS_MOVABLE(ret, AM, B); \
if (ret == BLOCKED) { \
break;\
}\
Expand Down
47 changes: 47 additions & 0 deletions code/__defines/_byond_version_compat.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#define REQUIRED_DM_VERSION 514

#if DM_VERSION < REQUIRED_DM_VERSION
#warn Nebula is not tested on BYOND versions older than 514. The code may not compile, and if it does compile it may have severe problems.
#endif

// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
#else
#define LIBCALL call_ext
#endif

// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.

#if DM_VERSION < 515

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#else

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (nameof(.verb/##X))

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X))

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif
6 changes: 0 additions & 6 deletions code/__defines/_compile_options.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// The default value for all uses of set background. Set background can cause gradual lag and is recommended you only turn this on if necessary.
// 1 will enable set background. 0 will disable set background.
#define BACKGROUND_ENABLED 0

#define REQUIRED_DM_VERSION 514

#if DM_VERSION < REQUIRED_DM_VERSION
#warn Nebula is not tested on BYOND versions older than 514. The code may not compile, and if it does compile it may have severe problems.
#endif
8 changes: 5 additions & 3 deletions code/__defines/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@
#define MAT_SOLVENT_MILD 1
#define MAT_SOLVENT_MODERATE 2
#define MAT_SOLVENT_STRONG 3
#define MAT_SOLVENT_IMMUNE INFINITY

#define DIRTINESS_STERILE -2
#define DIRTINESS_CLEAN -1
#define DIRTINESS_NEUTRAL 0
#define DIRTINESS_DECONTAMINATE -3
#define DIRTINESS_STERILE -2
#define DIRTINESS_CLEAN -1
#define DIRTINESS_NEUTRAL 0

#define DEFAULT_GAS_ACCELERANT /decl/material/gas/hydrogen
#define DEFAULT_GAS_OXIDIZER /decl/material/gas/oxygen
Expand Down
7 changes: 7 additions & 0 deletions code/__defines/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define COLOR_GREEN_GRAY "#8daf6a"
#define COLOR_DARK_GREEN_GRAY "#54654c"
#define COLOR_BLUE_GRAY "#6a97b0"
#define COLOR_MID_BLUE_GRAY "#666699"
#define COLOR_DARK_BLUE_GRAY "#3e4855"
#define COLOR_SURGERY_BLUE "#e0f2f6"
#define COLOR_SUN "#ec8b2f"
Expand Down Expand Up @@ -92,6 +93,12 @@
#define COLOR_CRYSTAL "#00c8a5"
#define COLOR_ASTEROID_ROCK "#735555"
#define COLOR_DIAMOND "#d8d4ea"
#define COLOR_BLOOD_RED "#990000"
#define COLOR_PALE_GOLD "#cc9900"
#define COLOR_ROYAL_BLUE "#0033ff"
#define COLOR_VERDANT_GREEN "#287d00"
#define COLOR_SCIENCE_PURPLE "#6633cc"


#define PIPE_COLOR_GREY "#808080"
#define PIPE_COLOR_RED "#ff0000"
Expand Down
56 changes: 35 additions & 21 deletions code/__defines/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,45 @@
#define FLUID_DEEP 800 // Depth deep icon is used
#define FLUID_MAX_DEPTH FLUID_DEEP*4 // Arbitrary max value for flooding.
#define FLUID_PUSH_THRESHOLD 20 // Amount of flow needed to push items.
/turf
var/_fluid_source_is_active = FALSE
var/_fluid_turf_is_active = FALSE

// Expects /turf for T.
#define ADD_ACTIVE_FLUID_SOURCE(T) if(!T.changing_turf) { SSfluids.water_sources[T] = TRUE; }
#define REMOVE_ACTIVE_FLUID_SOURCE(T) SSfluids.water_sources -= T
// Expects /turf for TURF.
#define ADD_ACTIVE_FLUID_SOURCE(TURF) \
if(!QDELETED(TURF) && !TURF.changing_turf && !TURF._fluid_source_is_active) { \
TURF._fluid_source_is_active = TRUE; \
SSfluids.water_sources += TURF; \
}

// Expects /obj/effect/fluid for F.
#define ADD_ACTIVE_FLUID(F) if(!QDELETED(F)) { SSfluids.active_fluids[F] = TRUE; }
#define REMOVE_ACTIVE_FLUID(F) SSfluids.active_fluids -= F
#define REMOVE_ACTIVE_FLUID_SOURCE(TURF) \
if(!QDELETED(TURF) && TURF._fluid_source_is_active) { \
TURF._fluid_source_is_active = FALSE; \
SSfluids.water_sources -= TURF; \
}

// Expects turf for T,
#define UPDATE_FLUID_BLOCKED_DIRS(T) \
if(isnull(T.fluid_blocked_dirs)) {\
T.fluid_blocked_dirs = 0; \
for(var/obj/structure/window/W in T) { \
if(W.density) T.fluid_blocked_dirs |= W.dir; \
} \
for(var/obj/machinery/door/window/D in T) {\
if(D.density) T.fluid_blocked_dirs |= D.dir; \
} \
}
#define ADD_ACTIVE_FLUID(TURF) \
if(!QDELETED(TURF) && !TURF._fluid_turf_is_active) { \
TURF._fluid_turf_is_active = TRUE; \
SSfluids.active_fluids += TURF; \
}

// We share overlays for all fluid turfs to sync icon animation.
#define APPLY_FLUID_OVERLAY(img_state) \
if(!SSfluids.fluid_images[img_state]) SSfluids.fluid_images[img_state] = image('icons/effects/liquids.dmi',img_state); \
add_overlay(SSfluids.fluid_images[img_state]);
#define REMOVE_ACTIVE_FLUID(TURF) \
if(!QDELETED(TURF) && TURF._fluid_turf_is_active) { \
TURF._fluid_turf_is_active = FALSE; \
SSfluids.active_fluids -= TURF; \
}

#define UPDATE_FLUID_BLOCKED_DIRS(TURF) \
if(isnull(TURF.fluid_blocked_dirs)) { \
TURF.fluid_blocked_dirs = 0; \
for(var/obj/structure/window/W in TURF) { \
if(W.density) TURF.fluid_blocked_dirs |= W.dir; \
} \
for(var/obj/machinery/door/window/D in TURF) { \
if(D.density) TURF.fluid_blocked_dirs |= D.dir; \
} \
}

#define FLUID_MAX_ALPHA 200
#define FLUID_MIN_ALPHA 96
Expand Down
8 changes: 4 additions & 4 deletions code/__defines/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
#define MCS_BLOCK 2 // Failed to change, but action was performed

#define FABRICATOR_EXTRA_COST_FACTOR 1.25
#define FAB_HACKED 1
#define FAB_DISABLED 2
#define FAB_SHOCKED 4
#define FAB_BUSY 8
#define FAB_HACKED BITFLAG(0)
#define FAB_DISABLED BITFLAG(1)
#define FAB_SHOCKED BITFLAG(2)
#define FAB_BUSY BITFLAG(3)

#define PART_CPU /obj/item/stock_parts/computer/processor_unit // CPU. Without it the computer won't run. Better CPUs can run more programs at once.
#define PART_NETWORK /obj/item/stock_parts/computer/network_card // Network Card component of this computer. Allows connection to network
Expand Down
13 changes: 7 additions & 6 deletions code/__defines/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ if(other_init) { \
#define ADJUST_TAG_VAR(variable, map_hash) (istext(variable) && (variable += map_hash))

/// Map template categories for mass retrieval.
#define MAP_TEMPLATE_CATEGORY_EXOPLANET "exoplanet_template"
#define MAP_TEMPLATE_CATEGORY_EXOPLANET_SITE "exoplanet_site_template"
#define MAP_TEMPLATE_CATEGORY_PLANET "planet_template"
#define MAP_TEMPLATE_CATEGORY_PLANET_SITE "planet_site_template"
#define MAP_TEMPLATE_CATEGORY_SPACE "space_template"
#define MAP_TEMPLATE_CATEGORY_AWAYSITE "awaysite_template"
#define MAP_TEMPLATE_CATEGORY_EXOPLANET "exoplanet_template"
#define MAP_TEMPLATE_CATEGORY_EXOPLANET_SITE "exoplanet_site_template"
#define MAP_TEMPLATE_CATEGORY_PLANET "planet_template"
#define MAP_TEMPLATE_CATEGORY_PLANET_SITE "planet_site_template"
#define MAP_TEMPLATE_CATEGORY_SPACE "space_template"
#define MAP_TEMPLATE_CATEGORY_AWAYSITE "awaysite_template"
#define MAP_TEMPLATE_CATEGORY_LANDMARK_LOADED "landmark_template"
25 changes: 12 additions & 13 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#define DEBUG
// Turf-only flags.
#define TURF_FLAG_NOJAUNT BITFLAG(0) // This is used in literally one place, turf.dm, to block ethereal jaunt.
#define TURF_FLAG_NORUINS BITFLAG(1) // Used by the ruin generator to skip placing loaded ruins on this turf.
#define TURF_FLAG_BACKGROUND BITFLAG(2) // Used by shuttle movement to determine if it should be ignored by turf translation.
#define TURF_IS_HOLOMAP_OBSTACLE BITFLAG(3)
#define TURF_IS_HOLOMAP_PATH BITFLAG(4)
#define TURF_IS_HOLOMAP_ROCK BITFLAG(5)
#define TURF_FLAG_NOJAUNT BITFLAG(0) // This is used in literally one place, turf.dm, to block ethereal jaunt.
#define TURF_FLAG_NO_POINTS_OF_INTEREST BITFLAG(1) // Used by the level subtemplate generator to skip placing loaded templates on this turf.
#define TURF_FLAG_BACKGROUND BITFLAG(2) // Used by shuttle movement to determine if it should be ignored by turf translation.
#define TURF_IS_HOLOMAP_OBSTACLE BITFLAG(3)
#define TURF_IS_HOLOMAP_PATH BITFLAG(4)
#define TURF_IS_HOLOMAP_ROCK BITFLAG(5)

///Width or height of a transition edge area along the map's borders where transition edge turfs are placed to connect levels together.
#define TRANSITIONEDGE 7
///Extra spacing needed between any random ruins and the transition edge of a level.
#define RUIN_MAP_EDGE_PAD 15
///Extra spacing needed between any random level templates and the transition edge of a level.
#define TEMPLATE_TAG_MAP_EDGE_PAD 15

///Enum value for a level edge that's to be untouched
#define LEVEL_EDGE_NONE 0
Expand Down Expand Up @@ -195,11 +195,6 @@
#define WRINKLES_WRINKLY 1
#define WRINKLES_NONE 2

//detergent states for clothes
#define SMELL_DEFAULT 0
#define SMELL_CLEAN 1
#define SMELL_STINKY 2

//Shuttle mission stages
#define SHUTTLE_MISSION_PLANNED 1
#define SHUTTLE_MISSION_STARTED 2
Expand Down Expand Up @@ -267,6 +262,10 @@
#define ICON_STATE_INV "inventory"

#define hex2num(X) text2num(X, 16)
/// Returns the hex value of a number given a value assumed to be a base-ten value, padded to a minimum length of 2.
#define num2hex(num) num2text(num, 2, 16)
/// Returns the hex value of a number given a value assumed to be a base-ten value, padded to a supplied minimum length.
#define num2hex_padded(num, len) num2text(num, len, 16)

#define Z_ALL_TURFS(Z) block(locate(1, 1, Z), locate(world.maxx, world.maxy, Z))

Expand Down
2 changes: 1 addition & 1 deletion code/__defines/mob_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define GET_STATUS(MOB, COND) (LAZYACCESS(MOB.status_counters, COND))
#define HAS_STATUS(MOB, COND) (GET_STATUS(MOB, COND) > 0)
#define ADJ_STATUS(MOB, COND, AMT) (MOB.set_status(COND, PENDING_STATUS(MOB, COND) + AMT))
#define SET_STATUS_MAX(MOB, COND, AMT) (MOB.set_status(COND, max(PENDING_STATUS(MOB, COND), AMT)))
#define SET_STATUS_MAX(MOB, COND, AMT) (MOB.set_status(COND, max(PENDING_STATUS(MOB, COND), AMT)))
Loading

0 comments on commit 92d6964

Please sign in to comment.