[MIRROR] Consts (#11652)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-09-14 15:23:02 -07:00
committed by GitHub
parent 5826f765e7
commit 9ffd5403b9
12 changed files with 55 additions and 41 deletions

24
code/__defines/_ast.dm Normal file
View File

@@ -0,0 +1,24 @@
/*
Constants: Operator Precedence
OOP_OR - Logical or
OOP_AND - Logical and
OOP_BIT - Bitwise operations
OOP_EQUAL - Equality checks
OOP_COMPARE - Greater than, less then, etc
OOP_ADD - Addition and subtraction
OOP_MULTIPLY - Multiplication and division
OOP_POW - Exponents
OOP_UNARY - Unary Operators
OOP_GROUP - Parentheses
*/
#define OOP_OR 1 // ||
#define OOP_AND 2 // &&
#define OOP_BIT 3 // &, |
#define OOP_EQUAL 4 // ==, !=
#define OOP_COMPARE 5 // >, <, >=, <=
#define OOP_ADD 6 // +, -
#define OOP_MULTIPLY 7 // *, /, %
#define OOP_POW 8 // ^
#define OOP_UNARY 9 // !
#define OOP_GROUP 10 // ()

View File

@@ -0,0 +1,4 @@
#define DRINK_FIZZ "fizz"
#define DRINK_ICE "ice"
#define DRINK_ICON_DEFAULT ""
#define DRINK_ICON_NOISY "_noise"

View File

@@ -603,3 +603,5 @@ GLOBAL_LIST_INIT(all_volume_channels, list(
#define LADDER_CONSTRUCTION_UNANCHORED 0
#define LADDER_CONSTRUCTION_WRENCHED 1
#define LADDER_CONSTRUCTION_WELDED 2
#define FINGERPRINT_COMPLETE 6

View File

@@ -27,7 +27,7 @@ Possible to do for anyone motivated enough:
#define RANGE_BASED 4
#define AREA_BASED 6
var/const/HOLOPAD_MODE = RANGE_BASED
#define IS_RANGE_BASED
/obj/machinery/hologram/holopad
name = "\improper AI holopad"
@@ -175,15 +175,16 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(get_dist(H, user.eyeobj) > world.view)
clear_holo(user)
//VOREStation Add End
if((HOLOPAD_MODE == RANGE_BASED && (get_dist(H, src) > holo_range)))
#ifdef IS_RANGE_BASED
if((get_dist(H, src) > holo_range))
clear_holo(user)
#else
var/area/holopad_area = get_area(src)
var/area/hologram_area = get_area(H)
if(HOLOPAD_MODE == AREA_BASED)
var/area/holopad_area = get_area(src)
var/area/hologram_area = get_area(H)
if(!(hologram_area in holopad_area))
clear_holo(user)
if(!(hologram_area in holopad_area))
clear_holo(user)
#endif
return 1
@@ -251,3 +252,4 @@ Holographic project of everything else.
#undef AREA_BASED
#undef HOLOPAD_PASSIVE_POWER_USAGE
#undef HOLOGRAM_POWER_USAGE
#undef IS_RANGE_BASED

View File

@@ -1,6 +1,4 @@
//STRIKE TEAMS
var/const/commandos_possible = 6 //if more Commandos are needed in the future
/client/proc/strike_team()
set category = "Fun.Event Kit"
set name = "Spawn Strike Team"

View File

@@ -4,7 +4,6 @@
//This is the output of the stringpercent(print) proc, and means about 80% of
//the print must be there for it to be complete. (Prints are 32 digits)
var/const/FINGERPRINT_COMPLETE = 6
/proc/is_complete_print(var/print)
return stringpercent(print) <= FINGERPRINT_COMPLETE

View File

@@ -1,8 +1,3 @@
/var/const/DRINK_FIZZ = "fizz"
/var/const/DRINK_ICE = "ice"
/var/const/DRINK_ICON_DEFAULT = ""
/var/const/DRINK_ICON_NOISY = "_noise"
/obj/item/reagent_containers/food/drinks/glass2
name = "glass" // Name when empty
var/base_name = "glass" // Name to put in front of drinks, i.e. "[base_name] of [contents]"

View File

@@ -5,12 +5,11 @@
//Blood levels. These are percentages based on the species blood_volume var.
//Retained for archival/reference purposes - KK
/*
var/const/BLOOD_VOLUME_SAFE = 85
var/const/BLOOD_VOLUME_OKAY = 75
var/const/BLOOD_VOLUME_BAD = 60
var/const/BLOOD_VOLUME_SURVIVE = 40
BLOOD_VOLUME_SAFE = 85
BLOOD_VOLUME_OKAY = 75
BLOOD_VOLUME_BAD = 60
BLOOD_VOLUME_SURVIVE = 40
*/
var/const/CE_STABLE_THRESHOLD = 0.5
/mob/living/carbon/human/var/datum/reagents/vessel // Container for blood and BLOOD ONLY. Do not transfer other chems here.
/mob/living/carbon/human/var/var/pale = 0 // Should affect how mob sprite is drawn, but currently doesn't.
@@ -111,9 +110,6 @@ var/const/CE_STABLE_THRESHOLD = 0.5
if(CE_STABLE in chem_effects)
dmg_coef = 0.5
threshold_coef = 0.75
// These are Bay bits, do some sort of calculation.
// dmg_coef = min(1, 10/chem_effects[CE_STABLE]) //TODO: add effect for increased damage
// threshold_coef = min(dmg_coef / CE_STABLE_THRESHOLD, 1)
if(blood_volume_raw >= species.blood_volume*species.blood_level_safe)
if(pale)

View File

@@ -1,6 +1,3 @@
/datum/reagent
var/name = REAGENT_DEVELOPER_WARNING
var/id = REAGENT_ID_DEVELOPER_WARNING

View File

@@ -26,16 +26,6 @@
OOP_UNARY - Unary Operators
OOP_GROUP - Parentheses
*/
var/const/OOP_OR = 1 // ||
var/const/OOP_AND = OOP_OR + 1 // &&
var/const/OOP_BIT = OOP_AND + 1 // &, |
var/const/OOP_EQUAL = OOP_BIT + 1 // ==, !=
var/const/OOP_COMPARE = OOP_EQUAL + 1 // >, <, >=, <=
var/const/OOP_ADD = OOP_COMPARE + 1 // +, -
var/const/OOP_MULTIPLY= OOP_ADD + 1 // *, /, %
var/const/OOP_POW = OOP_MULTIPLY + 1 // ^
var/const/OOP_UNARY = OOP_POW + 1 // !
var/const/OOP_GROUP = OOP_UNARY + 1 // ()
/*
Class: node

View File

@@ -3,10 +3,10 @@
/*
File: Keywords
*/
var/const/KW_FAIL = 0 //Fatal error; stop parsing entire script.
var/const/KW_PASS = 1 //OK
var/const/KW_ERR = 2 //Non-fatal error, keyword couldn't be handled properly. Ignore keyword but continue on.
var/const/KW_WARN = 3 //Warning
#define KW_FAIL 0 //Fatal error; stop parsing entire script.
#define KW_PASS 1 //OK
#define KW_ERR 2 //Non-fatal error, keyword couldn't be handled properly. Ignore keyword but continue on.
#define KW_WARN 3 //Warning
/*
var/const/Class: n_Keyword
@@ -156,3 +156,8 @@ var/const/Represents a special statement in the code triggered by a keyword.
else
parser.errors+=new/scriptError/BadToken(parser.curToken)
return KW_FAIL
#undef KW_FAIL
#undef KW_PASS
#undef KW_ERR
#undef KW_WARN

View File

@@ -27,10 +27,12 @@
#include "code\global_init.dm"
#include "code\world.dm"
#include "code\__defines\__globals.dm"
#include "code\__defines\_ast.dm"
#include "code\__defines\_atoms.dm"
#include "code\__defines\_bitfields.dm"
#include "code\__defines\_click.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\_drinks.dm"
#include "code\__defines\_flags.dm"
#include "code\__defines\_fruits.dm"
#include "code\__defines\_helpers.dm"