Skip to content

Commit

Permalink
Merge pull request #14 from MistakeNot4892/heckinseccin
Browse files Browse the repository at this point in the history
Fixing up Crux level 2 disposals, repathing areas.
  • Loading branch information
MistakeNot4892 authored Jan 23, 2024
2 parents 6bf54fa + a78620d commit 323610d
Show file tree
Hide file tree
Showing 1,093 changed files with 26,008 additions and 20,906 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
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
7 changes: 4 additions & 3 deletions code/__defines/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
#define MAT_SOLVENT_MODERATE 2
#define MAT_SOLVENT_STRONG 3

#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
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"
5 changes: 0 additions & 5 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
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
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)))
20 changes: 13 additions & 7 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
#define FLASH_PROTECTION_MODERATE 2
#define FLASH_PROTECTION_MAJOR 3

#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6)
#define DRONE_SPAWN_DELAY round(config.respawn_delay / 3)
#define ANIMAL_SPAWN_DELAY round(get_config_value(/decl/config/num/respawn_delay) / 6)
#define DRONE_SPAWN_DELAY round(get_config_value(/decl/config/num/respawn_delay) / 3)

// Incapacitation flags, used by the mob/proc/incapacitated() proc
#define INCAPACITATION_NONE 0
Expand Down Expand Up @@ -298,9 +298,6 @@

#define MOB_FLAG_HOLY_BAD BITFLAG(0) // If this mob is allergic to holiness

#define MARKING_TARGET_SKIN 0 // Draw a /decl/sprite_accessory/marking to the mob's body, eg. tattoos
#define MARKING_TARGET_HAIR 1 // Draw a /decl/sprite_accessory/marking to the mob's hair, eg. ears & horns

#define DEXTERITY_NONE 0
#define DEXTERITY_SIMPLE_MACHINES BITFLAG(0)
#define DEXTERITY_HOLD_ITEM BITFLAG(1)
Expand Down Expand Up @@ -330,7 +327,7 @@ var/global/list/dexterity_levels = list(
#define INJECTION_PORT 2
#define INJECTION_PORT_DELAY 3 SECONDS // used by injectors to apply delay due to searching for a port on the injectee's suit

#define ADJUSTED_GLIDE_SIZE(DELAY) (NONUNIT_CEILING((WORLD_ICON_SIZE / max((DELAY), world.tick_lag) * world.tick_lag) - world.tick_lag, 1) + (config.glide_size_delay))
#define ADJUSTED_GLIDE_SIZE(DELAY) (NONUNIT_CEILING((WORLD_ICON_SIZE / max((DELAY), world.tick_lag) * world.tick_lag) - world.tick_lag, 1) + (get_config_value(/decl/config/num/movement_glide_size)))

#define PREF_MEM_RECORD "memory"
#define PREF_SEC_RECORD "sec_record"
Expand Down Expand Up @@ -379,4 +376,13 @@ var/global/list/dexterity_levels = list(

// Underlay defines; vestigal implementation currently.
#define HU_TAIL_LAYER 1
#define TOTAL_UNDER_LAYERS 1
#define TOTAL_UNDER_LAYERS 1

// Enum for result of an attempt to eat/eat from an item.
#define EATEN_INVALID 0
#define EATEN_UNABLE 1
#define EATEN_SUCCESS 2

// Enum for type of consumption, largely just cosmetic currently.
#define EATING_METHOD_EAT 0
#define EATING_METHOD_DRINK 1
6 changes: 3 additions & 3 deletions code/__defines/qdel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#define QDESTROYING(X) (isnull(X) || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)

//Qdel helper macros.
#define QDEL_IN(item, time) if(!isnull(item)) {addtimer(CALLBACK(item, /datum/proc/qdel_self), time, TIMER_STOPPABLE)}
#define QDEL_IN_CLIENT_TIME(item, time) if(!isnull(item)) {addtimer(CALLBACK(item, /datum/proc/qdel_self), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)}
#define QDEL_IN(item, time) if(!isnull(item)) {addtimer(CALLBACK(item, TYPE_PROC_REF(/datum, qdel_self)), time, TIMER_STOPPABLE)}
#define QDEL_IN_CLIENT_TIME(item, time) if(!isnull(item)) {addtimer(CALLBACK(item, TYPE_PROC_REF(/datum, qdel_self)), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)}
#define QDEL_NULL(item) if(item) {qdel(item); item = null}
#define QDEL_NULL_SCREEN(item) if(client) { client.screen -= item; }; QDEL_NULL(item)
#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) }}; if(x) {x.Cut(); x = null } // Second x check to handle items that LAZYREMOVE on qdel.
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(______qdel_list_wrapper), L), time, TIMER_STOPPABLE)
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }

Expand Down
5 changes: 5 additions & 0 deletions code/__defines/reactions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define REACTION_TYPE_PHARMACEUTICAL 1
#define REACTION_TYPE_ALLOYING 2
#define REACTION_TYPE_COMPOUND 3
#define REACTION_TYPE_SYNTHESIS 4
#define REACTION_TYPE_RECIPE 5
8 changes: 0 additions & 8 deletions code/_global_vars/logging.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
var/global/list/combatlog = list()
var/global/list/IClog = list()
var/global/list/OOClog = list()
var/global/list/adminlog = list()

var/global/datum/configuration/config = null
var/global/list/jobMax = list()

var/global/diary = null

GLOBAL_PROTECTED_UNTYPED(log_directory, null)
Expand Down
6 changes: 3 additions & 3 deletions code/_helpers/animations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/proc/fade_out(image/I, list/show_to)
animate(I, alpha = 0, time = 0.5 SECONDS, easing = EASE_IN)
addtimer(CALLBACK(GLOBAL_PROC, .proc/remove_images_from_clients, I, show_to), 0.5 SECONDS)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(remove_images_from_clients), I, show_to), 0.5 SECONDS)

/proc/animate_speech_bubble(image/I, list/show_to, duration)
if(!I)
Expand All @@ -17,7 +17,7 @@
for(var/client/C in show_to)
C.images += I
animate(I, transform = 0, alpha = 255, time = 0.2 SECONDS, easing = EASE_IN)
addtimer(CALLBACK(GLOBAL_PROC, .proc/fade_out, I, show_to), (duration - 0.5 SECONDS))
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(fade_out), I, show_to), (duration - 0.5 SECONDS))

/proc/animate_receive_damage(atom/A)
var/pixel_x_diff = rand(-2,2)
Expand Down Expand Up @@ -53,7 +53,7 @@
/proc/flick_overlay(image/I, list/show_to, duration)
for(var/client/C in show_to)
C.images += I
addtimer(CALLBACK(GLOBAL_PROC, .proc/remove_images_from_clients, I, show_to), duration)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(remove_images_from_clients), I, show_to), duration)

/atom/movable/proc/do_attack_effect(atom/A, effect) //Simple effects for telegraphing or marking attack locations
if (effect)
Expand Down
4 changes: 2 additions & 2 deletions code/_helpers/auxtools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ var/global/auxtools_debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")

/hook/startup/proc/auxtools_init()
if (global.auxtools_debug_server)
call(global.auxtools_debug_server, "auxtools_init")()
LIBCALL(global.auxtools_debug_server, "auxtools_init")()
enable_debugging()
return TRUE

/hook/shutdown/proc/auxtools_shutdown()
if (global.auxtools_debug_server)
call(global.auxtools_debug_server, "auxtools_shutdown")()
LIBCALL(global.auxtools_debug_server, "auxtools_shutdown")()
return TRUE
3 changes: 3 additions & 0 deletions code/_helpers/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,8 @@
/proc/cmp_gripper_asc(datum/inventory_slot/gripper/a, datum/inventory_slot/gripper/b)
return a.hand_sort_priority - b.hand_sort_priority

/proc/cmp_decl_uid_asc(decl/a, decl/b)
return sorttext(b.uid, a.uid)

/proc/cmp_inventory_slot_desc(datum/inventory_slot/a, datum/inventory_slot/b)
return b.quick_equip_priority - a.quick_equip_priority
2 changes: 1 addition & 1 deletion code/_helpers/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
/proc/SecondsToTicks(var/seconds)
return seconds * 10

/proc/round_is_spooky(var/spookiness_threshold = config.cult_ghostwriter_req_cultists)
/proc/round_is_spooky(var/spookiness_threshold = get_config_value(/decl/config/num/cult_ghostwriter_req_cultists))
var/decl/special_role/cult = GET_DECL(/decl/special_role/cultist)
return (cult.current_antagonists.len > spookiness_threshold)

Expand Down
28 changes: 14 additions & 14 deletions code/_helpers/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""

/proc/log_admin(text)
global.admin_log.Add(text)
if (config.log_admin)
if (get_config_value(/decl/config/toggle/log_admin))
game_log("ADMIN", text)

/proc/log_debug(text)
if (config.log_debug)
if (get_config_value(/decl/config/toggle/log_debug))
game_log("DEBUG", text)
to_debug_listeners(text)

Expand All @@ -58,47 +58,47 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
to_chat(C, "[prefix]: [text]")

/proc/log_game(text)
if (config.log_game)
if (get_config_value(/decl/config/toggle/log_game))
game_log("GAME", text)

/proc/log_vote(text)
if (config.log_vote)
if (get_config_value(/decl/config/toggle/log_vote))
game_log("VOTE", text)

/proc/log_access(text)
if (config.log_access)
if (get_config_value(/decl/config/toggle/log_access))
game_log("ACCESS", text)

/proc/log_say(text)
if (config.log_say)
if (get_config_value(/decl/config/toggle/log_say))
game_log("SAY", text)

/proc/log_ooc(text)
if (config.log_ooc)
if (get_config_value(/decl/config/toggle/log_ooc))
game_log("OOC", text)

/proc/log_whisper(text)
if (config.log_whisper)
if (get_config_value(/decl/config/toggle/log_whisper))
game_log("WHISPER", text)

/proc/log_emote(text)
if (config.log_emote)
if (get_config_value(/decl/config/toggle/log_emotes))
game_log("EMOTE", text)

/proc/log_attack(text)
if (config.log_attack)
if (get_config_value(/decl/config/toggle/log_attack))
game_log("ATTACK", text)

/proc/log_adminsay(text)
if (config.log_adminchat)
if (get_config_value(/decl/config/toggle/log_adminchat))
game_log("ADMINSAY", text)

/proc/log_adminwarn(text)
if (config.log_adminwarn)
if (get_config_value(/decl/config/toggle/log_adminwarn))
game_log("ADMINWARN", text)

/proc/log_pda(text)
if (config.log_pda)
if (get_config_value(/decl/config/toggle/log_pda))
game_log("PDA", text)

/proc/log_misc(text)
Expand All @@ -114,7 +114,7 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
//This replaces world.log so it displays both in DD and the file
/proc/log_world(text)
to_world_log(text) //this comes before the config check because it can't possibly runtime
if(config.log_world_output)
if(get_config_value(/decl/config/toggle/log_world_output))
game_log("DD_OUTPUT", text)

//pretty print a direction bitflag, can be useful for debugging.
Expand Down
12 changes: 7 additions & 5 deletions code/_helpers/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var/global/religion_name = null

/proc/station_name()
if(!global.using_map)
return config.server_name
return get_config_value(/decl/config/text/server_name)
if (global.using_map.station_name)
return global.using_map.station_name

Expand Down Expand Up @@ -90,8 +90,9 @@ var/global/religion_name = null
if(5)
global.using_map.station_name += pick(global.numbers_as_words)

if (config && config.server_name)
world.name = "[config.server_name]: [name]"
var/config_server_name = get_config_value(/decl/config/text/server_name)
if (config_server_name)
world.name = "[config_server_name]: [name]"
else
world.name = global.using_map.station_name

Expand All @@ -100,8 +101,9 @@ var/global/religion_name = null
/proc/world_name(var/name)
global.using_map.station_name = name

if (config && config.server_name)
world.name = "[config.server_name]: [name]"
var/config_server_name = get_config_value(/decl/config/text/server_name)
if (config_server_name)
world.name = "[config_server_name]: [name]"
else
world.name = name

Expand Down
Loading

0 comments on commit 323610d

Please sign in to comment.