mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
513 Compatability
This commit is contained in:
31
code/__defines/__513_compatibility.dm
Normal file
31
code/__defines/__513_compatibility.dm
Normal 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
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user