diff --git a/code/__defines/_ast.dm b/code/__defines/_ast.dm new file mode 100644 index 0000000000..e4c60d59ce --- /dev/null +++ b/code/__defines/_ast.dm @@ -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 // () diff --git a/code/__defines/_drinks.dm b/code/__defines/_drinks.dm new file mode 100644 index 0000000000..97ccb03d7c --- /dev/null +++ b/code/__defines/_drinks.dm @@ -0,0 +1,4 @@ +#define DRINK_FIZZ "fizz" +#define DRINK_ICE "ice" +#define DRINK_ICON_DEFAULT "" +#define DRINK_ICON_NOISY "_noise" diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 42393143e1..939ff6f513 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -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 diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 2bb730fc36..6324c59519 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -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 diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 6dfb95b709..fff00535cd 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -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" diff --git a/code/modules/detectivework/forensics.dm b/code/modules/detectivework/forensics.dm index 6a2dedee55..7f79017fd3 100644 --- a/code/modules/detectivework/forensics.dm +++ b/code/modules/detectivework/forensics.dm @@ -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 diff --git a/code/modules/food/drinkingglass/drinkingglass.dm b/code/modules/food/drinkingglass/drinkingglass.dm index 1b51e48846..530e7e7ebe 100644 --- a/code/modules/food/drinkingglass/drinkingglass.dm +++ b/code/modules/food/drinkingglass/drinkingglass.dm @@ -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]" diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 26c0e74c55..debfaa8c06 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -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) diff --git a/code/modules/reagents/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index b75108f220..7af8ac4417 100644 --- a/code/modules/reagents/reagents/_reagents.dm +++ b/code/modules/reagents/reagents/_reagents.dm @@ -1,6 +1,3 @@ - - - /datum/reagent var/name = REAGENT_DEVELOPER_WARNING var/id = REAGENT_ID_DEVELOPER_WARNING diff --git a/code/modules/scripting/AST/AST Nodes.dm b/code/modules/scripting/AST/AST Nodes.dm index 0ab6a90118..8a7a9db780 100644 --- a/code/modules/scripting/AST/AST Nodes.dm +++ b/code/modules/scripting/AST/AST Nodes.dm @@ -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 diff --git a/code/modules/scripting/Parser/Keywords.dm b/code/modules/scripting/Parser/Keywords.dm index 90b0428c19..19d14484d5 100644 --- a/code/modules/scripting/Parser/Keywords.dm +++ b/code/modules/scripting/Parser/Keywords.dm @@ -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 diff --git a/vorestation.dme b/vorestation.dme index 5f54e00760..a4aea84647 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -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"