513 Compatability

This commit is contained in:
Unknown
2019-12-12 10:40:27 -05:00
parent 2f8da2582b
commit 985d57f323
7 changed files with 37 additions and 17 deletions

View File

@@ -0,0 +1,31 @@
#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

View File

@@ -2,7 +2,7 @@
#define isdatum(D) istype(D, /datum)
#define isweakref(A) istype(A, /weakref)
#define islist(D) istype(D, /list)
//#define islist(D) istype(D, /list) //Built in
//---------------
#define isatom(D) istype(D, /atom)

View File

@@ -16,7 +16,6 @@
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(world.tick_usage - starting_tickusage))
#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.
//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
#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
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )
// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
// Tangent
#define TAN(x) (sin(x) / cos(x))
// Cotangent
#define COT(x) (1 / TAN(x))
@@ -50,8 +44,6 @@
// Cosecant
#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
/proc/GCD(a, b)
return b ? GCD(b, (a) % (b)) : a

View File

@@ -587,10 +587,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/between(var/low, var/middle, var/high)
return max(min(middle, high), low)
proc/arctan(x)
var/y=arcsin(x/sqrt(1+x*x))
return y
//returns random gauss number
proc/GaussRand(var/sigma)
var/x,y,rsq

View File

@@ -1032,7 +1032,7 @@ Note that amputating the affected organ does in fact remove the infection from t
W.germ_level = 0
return rval
/obj/item/organ/external/proc/clamp()
/obj/item/organ/external/proc/organ_clamp()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
for(var/datum/wound/W in wounds)

View File

@@ -102,7 +102,7 @@
affected.open = 1
affected.createwound(CUT, 1)
affected.clamp()
affected.organ_clamp()
spread_germs_to_organ(affected, user)
/datum/surgery_step/generic/cut_with_laser/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -148,7 +148,7 @@
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
affected.clamp()
affected.organ_clamp()
affected.open = 2
/datum/surgery_step/generic/incision_manager/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -188,7 +188,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<font color='blue'>[user] clamps bleeders in [target]'s [affected.name] with \the [tool].</font>", \
"<font color='blue'>You clamp bleeders in [target]'s [affected.name] with \the [tool].</font>")
affected.clamp()
affected.organ_clamp()
spread_germs_to_organ(affected, user)
/datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)

View File

@@ -23,6 +23,7 @@
#include "code\stylesheet.dm"
#include "code\world.dm"
#include "code\__datastructures\globals.dm"
#include "code\__defines\__513_compatibility.dm"
#include "code\__defines\_compile_options.dm"
#include "code\__defines\_lists.dm"
#include "code\__defines\_planes+layers.dm"