Merge pull request #9637 from Citadel-Station-13/byond_513
BYOND 513 preliminary support
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
#if DM_VERSION < 513
|
||||||
|
|
||||||
|
#define ismovableatom(A) (istype(A, /atom/movable))
|
||||||
|
|
||||||
|
#define islist(L) (istype(L, /list))
|
||||||
|
|
||||||
|
#define CLAMP01(x) (CLAMP(x, 0, 1))
|
||||||
|
|
||||||
|
#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
|
||||||
|
|
||||||
|
#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) )
|
||||||
|
|
||||||
|
#define TAN(x) (sin(x) / cos(x))
|
||||||
|
|
||||||
|
#define arctan(x) (arcsin(x/sqrt(1+x*x)))
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define ismovableatom(A) ismovable(A)
|
||||||
|
|
||||||
|
#define CLAMP01(x) clamp(x, 0, 1)
|
||||||
|
|
||||||
|
#define CLAMP(CLVALUE, CLMIN, CLMAX) clamp(CLVALUE, CLMIN, CLMAX)
|
||||||
|
|
||||||
|
#define TAN(x) tan(x)
|
||||||
|
|
||||||
|
#define ATAN2(x, y) arctan(x, y)
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
// simple is_type and similar inline helpers
|
// simple is_type and similar inline helpers
|
||||||
|
|
||||||
#define islist(L) (istype(L, /list))
|
|
||||||
|
|
||||||
#define in_range(source, user) (get_dist(source, user) <= 1 && (get_step(source, 0)?:z) == (get_step(user, 0)?:z))
|
#define in_range(source, user) (get_dist(source, user) <= 1 && (get_step(source, 0)?:z) == (get_step(user, 0)?:z))
|
||||||
|
|
||||||
#define ismovableatom(A) (istype(A, /atom/movable))
|
|
||||||
|
|
||||||
#define isatom(A) (isloc(A))
|
#define isatom(A) (isloc(A))
|
||||||
|
|
||||||
#define isweakref(D) (istype(D, /datum/weakref))
|
#define isweakref(D) (istype(D, /datum/weakref))
|
||||||
@@ -246,4 +242,4 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(
|
|||||||
|
|
||||||
#define isblobmonster(O) (istype(O, /mob/living/simple_animal/hostile/blob))
|
#define isblobmonster(O) (istype(O, /mob/living/simple_animal/hostile/blob))
|
||||||
|
|
||||||
#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs))
|
#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs))
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage))
|
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage))
|
||||||
|
|
||||||
#define PERCENT(val) (round((val)*100, 0.1))
|
#define PERCENT(val) (round((val)*100, 0.1))
|
||||||
#define CLAMP01(x) (CLAMP(x, 0, 1))
|
|
||||||
|
|
||||||
//time of day but automatically adjusts to the server going into the next day within the same round.
|
//time of day but automatically adjusts to the server going into the next day within the same round.
|
||||||
//for when you need a reliable time number that doesn't depend on byond time.
|
//for when you need a reliable time number that doesn't depend on byond time.
|
||||||
@@ -30,17 +29,12 @@
|
|||||||
// round() acts like floor(x, 1) by default but can't handle other values
|
// round() acts like floor(x, 1) by default but can't handle other values
|
||||||
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
|
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
|
||||||
|
|
||||||
#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
|
|
||||||
|
|
||||||
// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
|
// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
|
||||||
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )
|
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )
|
||||||
|
|
||||||
// Real modulus that handles decimals
|
// Real modulus that handles decimals
|
||||||
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
|
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
|
||||||
|
|
||||||
// Tangent
|
|
||||||
#define TAN(x) (sin(x) / cos(x))
|
|
||||||
|
|
||||||
// Cotangent
|
// Cotangent
|
||||||
#define COT(x) (1 / TAN(x))
|
#define COT(x) (1 / TAN(x))
|
||||||
|
|
||||||
@@ -50,8 +44,6 @@
|
|||||||
// Cosecant
|
// Cosecant
|
||||||
#define CSC(x) (1 / sin(x))
|
#define CSC(x) (1 / sin(x))
|
||||||
|
|
||||||
#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) )
|
|
||||||
|
|
||||||
// Greatest Common Divisor - Euclid's algorithm
|
// Greatest Common Divisor - Euclid's algorithm
|
||||||
/proc/Gcd(a, b)
|
/proc/Gcd(a, b)
|
||||||
return b ? Gcd(b, (a) % (b)) : a
|
return b ? Gcd(b, (a) % (b)) : a
|
||||||
@@ -207,4 +199,4 @@
|
|||||||
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
|
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
|
||||||
|
|
||||||
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
|
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
|
||||||
// )
|
// )
|
||||||
@@ -514,7 +514,7 @@
|
|||||||
used_key_list[input_key] = 1
|
used_key_list[input_key] = 1
|
||||||
return input_key
|
return input_key
|
||||||
|
|
||||||
#if DM_VERSION > 512
|
#if DM_VERSION > 513
|
||||||
#error Remie said that lummox was adding a way to get a lists
|
#error Remie said that lummox was adding a way to get a lists
|
||||||
#error contents via list.values, if that is true remove this
|
#error contents via list.values, if that is true remove this
|
||||||
#error otherwise, update the version and bug lummox
|
#error otherwise, update the version and bug lummox
|
||||||
@@ -564,4 +564,4 @@
|
|||||||
if(key in L1)
|
if(key in L1)
|
||||||
L1[key] += other_value
|
L1[key] += other_value
|
||||||
else
|
else
|
||||||
L1[key] = other_value
|
L1[key] = other_value
|
||||||
@@ -451,10 +451,6 @@ Turf and target are separate in case you want to teleport some distance from a t
|
|||||||
var/y = min(world.maxy, max(1, A.y + dy))
|
var/y = min(world.maxy, max(1, A.y + dy))
|
||||||
return locate(x,y,A.z)
|
return locate(x,y,A.z)
|
||||||
|
|
||||||
/proc/arctan(x)
|
|
||||||
var/y=arcsin(x/sqrt(1+x*x))
|
|
||||||
return y
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Gets all contents of contents and returns them all in a list.
|
Gets all contents of contents and returns them all in a list.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "_maps\_basemap.dm"
|
#include "_maps\_basemap.dm"
|
||||||
#include "code\_compile_options.dm"
|
#include "code\_compile_options.dm"
|
||||||
#include "code\world.dm"
|
#include "code\world.dm"
|
||||||
|
#include "code\__DEFINES\__513_compatibility.dm"
|
||||||
#include "code\__DEFINES\_globals.dm"
|
#include "code\__DEFINES\_globals.dm"
|
||||||
#include "code\__DEFINES\_protect.dm"
|
#include "code\__DEFINES\_protect.dm"
|
||||||
#include "code\__DEFINES\_tick.dm"
|
#include "code\__DEFINES\_tick.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user