[MIRROR] Cleaning up some defines (#7726)

Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
Co-authored-by: Selis <selis@xynolabs.com>
This commit is contained in:
CHOMPStation2
2024-02-12 07:55:15 -07:00
committed by GitHub
parent 5a982fbc25
commit c55baec811
27 changed files with 194 additions and 87 deletions

View File

@@ -165,4 +165,8 @@ Class Procs:
return
//to_world("valid.")
//to_world("valid.")
#undef CONNECTION_DIRECT
#undef CONNECTION_SPACE
#undef CONNECTION_INVALID

View File

@@ -6,8 +6,6 @@ The more pressure, the more boom.
If it gains pressure too slowly, it may leak or just rupture instead of exploding.
*/
//#define FIREDBG
/turf/var/obj/fire/fire = null
//Some legacy definitions so fires can be started.

View File

@@ -1,61 +1,61 @@
// See also controllers/globals.dm
// Creates a global initializer with a given InitValue expression, do not use outside this file
/// Creates a global initializer with a given InitValue expression, do not use
#define GLOBAL_MANAGED(X, InitValue)\
/datum/controller/global_vars/proc/InitGlobal##X(){\
##X = ##InitValue;\
gvars_datum_init_order += #X;\
}
// Creates an empty global initializer, do not use outside this file
/// Creates an empty global initializer, do not use
#define GLOBAL_UNMANAGED(X) /datum/controller/global_vars/proc/InitGlobal##X() { return; }
// Prevents a given global from being VV'd
/// Prevents a given global from being VV'd
#ifndef TESTING
#define GLOBAL_PROTECT(X)\
/datum/controller/global_vars/InitGlobal##X(){\
..();\
gvars_datum_protected_varlist += #X;\
gvars_datum_protected_varlist[#X] = TRUE;\
}
#else
#define GLOBAL_PROTECT(X)
#endif
// Standard BYOND global, do not use outside this file
/// Standard BYOND global, seriously do not use without an earthshakingly good reason
#define GLOBAL_REAL_VAR(X) var/global/##X
// Standard typed BYOND global, do not use outside this file
/// Standard typed BYOND global, seriously do not use without an earthshakingly good reason
#define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X
// Defines a global var on the controller, do not use outside this file.
/// Defines a global var on the controller, do not use
#define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X
// Create an untyped global with an initializer expression
/// Create an untyped global with an initializer expression
#define GLOBAL_VAR_INIT(X, InitValue) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, InitValue)
// Create a global const var, do not use
/// Create a global const var, do not use
#define GLOBAL_VAR_CONST(X, InitValue) GLOBAL_RAW(/const/##X) = InitValue; GLOBAL_UNMANAGED(X)
// Create a list global with an initializer expression
/// Create a list global with an initializer expression
#define GLOBAL_LIST_INIT(X, InitValue) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, InitValue)
// Create a list global that is initialized as an empty list
/// Create a list global that is initialized as an empty list
#define GLOBAL_LIST_EMPTY(X) GLOBAL_LIST_INIT(X, list())
// Create a typed list global with an initializer expression
/// Create a typed list global with an initializer expression
#define GLOBAL_LIST_INIT_TYPED(X, Typepath, InitValue) GLOBAL_RAW(/list##Typepath/X); GLOBAL_MANAGED(X, InitValue)
// Create a typed list global that is initialized as an empty list
/// Create a typed list global that is initialized as an empty list
#define GLOBAL_LIST_EMPTY_TYPED(X, Typepath) GLOBAL_LIST_INIT_TYPED(X, Typepath, list())
// Create a typed global with an initializer expression
/// Create a typed global with an initializer expression
#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)
// Create an untyped null global
/// Create an untyped null global
#define GLOBAL_VAR(X) GLOBAL_RAW(/##X); GLOBAL_UNMANAGED(X)
// Create a null global list
/// Create a null global list
#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_UNMANAGED(X)
// Create a typed null global
/// Create a typed null global
#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_UNMANAGED(X)

View File

@@ -8,6 +8,7 @@
*/
// ZAS Compile Options
//#define FIREDBG // Uncomment to turn on ZAS debugging related to fire stuff.
//#define ZASDBG // Uncomment to turn on super detailed ZAS debugging that probably won't even compile.
#define MULTIZAS // Uncomment to turn on Multi-Z ZAS Support!

View File

@@ -0,0 +1,10 @@
//Designed for things that need precision trajectories like projectiles.
//Don't use this for anything that you don't absolutely have to use this with (like projectiles!) because it isn't worth using a datum unless you need accuracy down to decimal places in pixels.
//You might see places where it does - 16 - 1. This is intentionally 17 instead of 16, because of how byond's tiles work and how not doing it will result in rounding errors like things getting put on the wrong turf.
#define RETURN_PRECISE_POSITION(A) new /datum/position(A)
#define RETURN_PRECISE_POINT(A) new /datum/point(A)
#define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED))
#define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT))

15
code/__defines/vore.dm Normal file
View File

@@ -0,0 +1,15 @@
#define VORE_SOUND_FALLOFF 0.1
#define VORE_SOUND_RANGE 3
#define HOLO_ORIGINAL_COLOR null //Original hologram color: "#7db4e1"
#define HOLO_HARDLIGHT_COLOR "#d97de0"
#define HOLO_ORIGINAL_ALPHA 120
#define HOLO_HARDLIGHT_ALPHA 200
#define BELLIES_MAX 40
#define BELLIES_NAME_MIN 2
#define BELLIES_NAME_MAX 40
#define BELLIES_DESC_MAX 4096
#define FLAVOR_MAX 400
#define VORE_VERSION 2 //This is a Define so you don't have to worry about magic numbers.

View File

@@ -8,4 +8,4 @@ GLOBAL_REAL_VAR(sqlpass) = ""
GLOBAL_REAL_VAR(sqlfdbkdb) = "test"
GLOBAL_REAL_VAR(sqlfdbklogin) = "root"
GLOBAL_REAL_VAR(sqlfdbkpass) = ""
GLOBAL_REAL_VAR(sqllogging) = 0 // Should we log deaths, population stats, etc.?
GLOBAL_REAL_VAR(sqllogging) = 0 // Should we log deaths, population stats, etc.?

View File

@@ -327,6 +327,11 @@ var/list/runechat_image_cache = list()
if(5)
return rgb(c,m,x)
#undef CM_COLOR_SAT_MIN
#undef CM_COLOR_SAT_MAX
#undef CM_COLOR_LUM_MIN
#undef CM_COLOR_LUM_MAX
/atom/proc/runechat_message(message, range = world.view, italics, list/classes = list(), audible = TRUE, list/specific_viewers)
var/hearing_mobs
if(islist(specific_viewers))
@@ -369,3 +374,22 @@ var/list/runechat_image_cache = list()
if(istype(loc, /obj/item/weapon/holder))
return loc
return ..()
#undef CHAT_MESSAGE_SPAWN_TIME
#undef CHAT_MESSAGE_LIFESPAN
#undef CHAT_MESSAGE_EOL_FADE
#undef CHAT_MESSAGE_EXP_DECAY
#undef CHAT_MESSAGE_HEIGHT_DECAY
#undef CHAT_MESSAGE_APPROX_LHEIGHT
#undef CHAT_MESSAGE_WIDTH
#undef CHAT_MESSAGE_EXT_WIDTH
#undef CHAT_MESSAGE_LENGTH
#undef CHAT_MESSAGE_EXT_LENGTH
#undef CHAT_MESSAGE_MOB
#undef CHAT_MESSAGE_OBJ
#undef WXH_TO_HEIGHT
#undef CHAT_RUNE_EMOTE
#undef CHAT_RUNE_RADIO

View File

@@ -1,14 +1,3 @@
//Designed for things that need precision trajectories like projectiles.
//Don't use this for anything that you don't absolutely have to use this with (like projectiles!) because it isn't worth using a datum unless you need accuracy down to decimal places in pixels.
//You might see places where it does - 16 - 1. This is intentionally 17 instead of 16, because of how byond's tiles work and how not doing it will result in rounding errors like things getting put on the wrong turf.
#define RETURN_PRECISE_POSITION(A) new /datum/position(A)
#define RETURN_PRECISE_POINT(A) new /datum/point(A)
#define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED))
#define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT))
/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess.
var/x = 0
var/y = 0
@@ -224,4 +213,4 @@
var/needed_time = world.time - last_move
last_process = world.time
last_move = world.time
increment(needed_time / SSprojectiles.wait)
increment(needed_time / SSprojectiles.wait)

View File

@@ -305,3 +305,6 @@
build_eff = man_rating
eat_eff = bin_rating
#undef BIOGEN_ITEM
#undef BIOGEN_REAGENT

View File

@@ -1,4 +1,3 @@
#define FIREDOOR_MAX_PRESSURE_DIFF 25 // kPa
#define FIREDOOR_MAX_TEMP 50 // °C
#define FIREDOOR_MIN_TEMP 0
@@ -523,3 +522,11 @@
icon = 'icons/obj/doors/DoorHazardGlass.dmi'
icon_state = "door_open"
glass = 1
#undef FIREDOOR_MAX_PRESSURE_DIFF
#undef FIREDOOR_MAX_TEMP
#undef FIREDOOR_MIN_TEMP
#undef FIREDOOR_ALERT_HOT
#undef FIREDOOR_ALERT_COLD
// Not used #undef FIREDOOR_ALERT_LOWPRESS

View File

@@ -21,8 +21,8 @@ var/list/dispenser_presets = list()
if(LAZYLEN(req_one_access))
var/accesses = user.GetAccess()
return has_access(null, req_one_access, accesses)
return 1
return 1
/datum/gear_disp/proc/spawn_gear(var/turf/T, var/mob/living/carbon/human/user)
var/list/spawned = list()
@@ -40,7 +40,7 @@ var/list/dispenser_presets = list()
/datum/gear_disp/custom/allowed(var/mob/living/carbon/human/user)
if(ckey_allowed && user.ckey != ckey_allowed)
return 0
if(character_allowed && user.real_name != character_allowed)
return 0
@@ -81,7 +81,7 @@ var/list/dispenser_presets = list()
voidsuit = new voidsuit_type(T)
spawned += voidsuit // We only add the voidsuit so the game doesn't try to put the tank/helmet/boots etc into their hands
// If we're supposed to make a helmet
if(voidhelmet_type)
// The coder may not have realized this type spawns its own helmet
@@ -98,7 +98,7 @@ var/list/dispenser_presets = list()
else
magboots = new magboots_type(voidsuit)
voidsuit.boots = magboots
if(refit)
voidsuit.refit_for_species(user.species?.get_bodytype()) // does helmet and boots if they're attached
@@ -112,7 +112,7 @@ var/list/dispenser_presets = list()
else if(user.species?.breath_type)
if(voidsuit.tank)
error("[src] created a voidsuit [voidsuit] and wants to add a tank but it already has one")
else
else
//Create a tank (if such a thing exists for this species)
var/tanktext = "/obj/item/weapon/tank/" + "[user.species?.breath_type]"
var/obj/item/weapon/tank/tankpath = text2path(tanktext)
@@ -135,7 +135,7 @@ var/list/dispenser_presets = list()
/datum/gear_disp/voidsuit/custom/allowed(var/mob/living/carbon/human/user)
if(ckey_allowed && user.ckey != ckey_allowed)
return 0
if(character_allowed && user.real_name != character_allowed)
return 0
@@ -172,7 +172,7 @@ var/list/dispenser_presets = list()
if(one_setting)
one_setting = new one_setting
dispenses = real_gear_list
/obj/machinery/gear_dispenser/attack_hand(var/mob/living/carbon/human/user)
if(!can_use(user))
@@ -180,18 +180,18 @@ var/list/dispenser_presets = list()
dispenser_flags |= GD_BUSY
if(!(dispenser_flags & GD_ONEITEM))
var/list/gear_list = get_gear_list(user)
if(!LAZYLEN(gear_list))
to_chat(user, "<span class='warning'>\The [src] doesn't have anything to dispense for you!</span>")
dispenser_flags &= ~GD_BUSY
return
var/choice = tgui_input_list(usr, "Select equipment to dispense.", "Equipment Dispenser", gear_list)
if(!choice)
dispenser_flags &= ~GD_BUSY
return
dispense(gear_list[choice],user)
else
dispense(one_setting,user)
@@ -223,7 +223,7 @@ var/list/dispenser_presets = list()
else
audible_message("!'^&YouVE alreaDY pIC&$!Ked UP yOU%r Ge^!ar.")
playsound(src, 'sound/machines/buzz-sigh.ogg', 100, 0)
return 1
return 1
// And finally
if(allowed(user))
return 1
@@ -261,7 +261,7 @@ var/list/dispenser_presets = list()
var/turf/T = get_turf(src)
if(!(S && T)) // in case we got destroyed while we slept
return 1
S.spawn_gear(T, user)
if(emagged)
@@ -323,15 +323,15 @@ var/list/dispenser_presets = list()
/obj/machinery/gear_dispenser/suit_fancy/update_icon()
cut_overlays()
if(special_frame)
add_overlay(special_frame)
if(needs_power && inoperable())
add_overlay("nopower")
else
add_overlay("light1")
if(held_gear_disp)
add_overlay("fullsuit")
if(operable())
@@ -686,7 +686,7 @@ var/list/dispenser_presets = list()
"gearlist": ["/obj/random/trash"]
}
]"}
/**
* Needs to be valid json with keys of:
* "menuoption" = string for the name
@@ -696,12 +696,12 @@ var/list/dispenser_presets = list()
var/input = tgui_input_text(usr, "Paste new gear pack JSON below. See example/code comments.", "Admin-load Dispenser", example, multiline = TRUE)
if(!input)
return
var/list/parsed = json_decode(input)
if(!islist(parsed))
return
var/list/running = list()
for(var/entry in parsed)
if(!islist(entry))
@@ -710,7 +710,7 @@ var/list/dispenser_presets = list()
var/option_name = this_entry["menuoption"]
var/list/types = this_entry["gearlist"]
var/list/access = this_entry["req_one_access"]
if(!option_name || !islist(types))
continue
@@ -721,15 +721,15 @@ var/list/dispenser_presets = list()
var/tnew = text2path(t)
if(ispath(tnew))
types += tnew
var/datum/gear_disp/G = new()
G.name = option_name
G.to_spawn = types
if(LAZYLEN(access))
G.req_one_access = access
running[option_name] = G
to_chat(usr, "[src] added [running.len] entries")
dispenses = running
@@ -946,3 +946,9 @@ var/list/dispenser_presets = list()
/datum/gear_disp/adventure_box/light,
/datum/gear_disp/adventure_box/weapon
)
#undef GD_BUSY
#undef GD_ONEITEM
#undef GD_NOGREED
#undef GD_UNLIMITED
#undef GD_UNIQUE

View File

@@ -201,4 +201,6 @@ var/global/list/image/fluidtrack_cache=list()
going_state = ""
gender = PLURAL
random_icon_states = null
amount = 0
amount = 0
#undef TRACKS_CRUSTIFY_TIME

View File

@@ -477,3 +477,13 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
return
icon_state = initial(icon_state)
#undef HOMETAB
#undef PHONTAB
#undef CONTTAB
#undef MESSTAB
#undef NEWSTAB
#undef NOTETAB
#undef WTHRTAB
#undef MANITAB
#undef SETTTAB

View File

@@ -64,4 +64,4 @@
//other set - for map building
/turf/unsimulated/wall2/planetary/virgo3b_better
icon_state = "riveted2"
icon_state = "riveted2"

View File

@@ -1,8 +1,3 @@
//#define TESTING
#if DM_VERSION < 512
#error This compiler is out of date Please update to at least BYOND 512.
#endif
// Items that ask to be called every cycle.
var/global/datum/datacore/data_core = null
var/global/list/machines = list() // ALL Machines, wether processing or not.

View File

@@ -1123,3 +1123,29 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
/obj/effect/statclick/SDQL2_VV_all/Click()
usr.client.debug_variables(GLOB.sdql2_queries)
#undef SDQL_qdel_datum
#undef SDQL2_STATE_ERROR
#undef SDQL2_STATE_IDLE
#undef SDQL2_STATE_PRESEARCH
#undef SDQL2_STATE_SEARCHING
#undef SDQL2_STATE_EXECUTING
#undef SDQL2_STATE_SWITCHING
#undef SDQL2_STATE_HALTING
// 2 undefs missing here still because of SDQL_2_parser
#undef SDQL2_OPTION_SELECT_OUTPUT_SKIP_NULLS
#undef SDQL2_OPTION_BLOCKING_CALLS
#undef SDQL2_OPTION_HIGH_PRIORITY
#undef SDQL2_OPTION_DO_NOT_AUTOGC
#undef SDQL2_OPTIONS_DEFAULT
#undef SDQL2_IS_RUNNING
#undef SDQL2_HALT_CHECK
#undef SDQL2_TICK_CHECK
#undef SDQL2_STAGE_SWITCH_CHECK

View File

@@ -1,4 +1,3 @@
#define NITROGEN_RETARDATION_FACTOR 0.15 //Higher == N2 slows reaction more
#define THERMAL_RELEASE_MODIFIER 10000 //Higher == more heat released during reaction
#define PHORON_RELEASE_MODIFIER 1500 //Higher == less phoron released by reaction
@@ -662,3 +661,26 @@
critwarn = 0
causalitywarn = 0
// CHOMPEdit End
#undef NITROGEN_RETARDATION_FACTOR
#undef THERMAL_RELEASE_MODIFIER
#undef PHORON_RELEASE_MODIFIER
#undef OXYGEN_RELEASE_MODIFIER
#undef REACTION_POWER_MODIFIER
#undef DETONATION_RADS
#undef DETONATION_MOB_CONCUSSION
#undef DETONATION_APC_OVERLOAD_PROB
#undef DETONATION_SHUTDOWN_APC
#undef DETONATION_SHUTDOWN_CRITAPC
#undef DETONATION_SHUTDOWN_SMES
#undef DETONATION_SHUTDOWN_RNG_FACTOR
#undef DETONATION_SOLAR_BREAK_CHANCE
#undef DETONATION_EXPLODE_MIN_POWER
#undef DETONATION_EXPLODE_MAX_POWER
#undef WARNING_DELAY
#undef SUPERMATTER_ACCENT_SOUND_COOLDOWN

View File

@@ -453,3 +453,6 @@ var/obj/machinery/blackbox_recorder/blackbox
if(!FV) return
FV.add_details(details)
#undef MESSAGE_SERVER_SPAM_REJECT
#undef MESSAGE_SERVER_DEFAULT_SPAM_LIMIT

View File

@@ -638,3 +638,5 @@
PR.icon_state = "paper_words"
PR.forceMove(loc)
busy_msg = null
#undef ENTRIES_PER_RDPAGE

View File

@@ -1,6 +1,3 @@
#define VORE_SOUND_FALLOFF 0.1
#define VORE_SOUND_RANGE 3
//
// Belly system 2.0, now using objects instead of datums because EH at datums.
// How many times have I rewritten bellies and vore now? -Aro

View File

@@ -1,9 +1,3 @@
//Dat AI vore yo
#define HOLO_ORIGINAL_COLOR null //Original hologram color: "#7db4e1"
#define HOLO_HARDLIGHT_COLOR "#d97de0"
#define HOLO_ORIGINAL_ALPHA 120
#define HOLO_HARDLIGHT_ALPHA 200
/obj/effect/overlay/aiholo
var/mob/living/bellied //Only belly one person at a time. No huge vore-organs setup for AIs.
var/mob/living/silicon/ai/master //This will receive the AI controlling the Hologram. For referencing purposes.

View File

@@ -19,8 +19,6 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
-Aro <3 */
#define VORE_VERSION 2 //This is a Define so you don't have to worry about magic numbers.
//
// Overrides/additions to stock defines go here, as well as hooks. Sort them by
// the object they are overriding. So all /mob/living together, etc.

View File

@@ -2,12 +2,6 @@
// Vore management panel for players
//
#define BELLIES_MAX 40
#define BELLIES_NAME_MIN 2
#define BELLIES_NAME_MAX 40
#define BELLIES_DESC_MAX 4096
#define FLAVOR_MAX 400
/* //Chomp REMOVE - Use our solution, not upstream's
//INSERT COLORIZE-ONLY STOMACHS HERE
var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",

View File

@@ -189,6 +189,7 @@
//var/partial_pressure = gas[gasid] * R_IDEAL_GAS_EQUATION * temperature / volume
//return R_IDEAL_GAS_EQUATION * ( log (1 + IDEAL_GAS_ENTROPY_CONSTANT/partial_pressure) + 20 )
#undef SPECIFIC_ENTROPY_VACUUM
//Updates the total_moles count and trims any empty gases.
/datum/gas_mixture/proc/update_values()

View File

@@ -121,3 +121,7 @@
/datum/unit_test/zas_area_test/cargo_bay
name = "ZAS: Cargo Bay"
area_path = /area/quartermaster/storage
#undef UT_NORMAL
#undef UT_VACUUM
#undef UT_NORMAL_COLD

View File

@@ -22,7 +22,7 @@
#include "code\global_vr.dm"
#include "code\names.dm"
#include "code\world.dm"
#include "code\__datastructures\globals.dm"
#include "code\__defines\__globals.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\_lists.dm"
#include "code\__defines\_planes+layers.dm"
@@ -84,6 +84,7 @@
#include "code\__defines\preferences.dm"
#include "code\__defines\process_scheduler.dm"
#include "code\__defines\procpath.dm"
#include "code\__defines\projectiles.dm"
#include "code\__defines\qdel.dm"
#include "code\__defines\research.dm"
#include "code\__defines\roguemining_vr.dm"
@@ -112,6 +113,7 @@
#include "code\__defines\turfs.dm"
#include "code\__defines\typeids.dm"
#include "code\__defines\unit_tests.dm"
#include "code\__defines\vore.dm"
#include "code\__defines\vote.dm"
#include "code\__defines\vv.dm"
#include "code\__defines\webhooks.dm"