diff --git a/code/__defines/damage_organs.dm b/code/__defines/damage_organs.dm
index 2e14fb96eb..c3eef1099e 100644
--- a/code/__defines/damage_organs.dm
+++ b/code/__defines/damage_organs.dm
@@ -7,6 +7,7 @@
#define CLONE "clone"
#define HALLOSS "halloss"
#define ELECTROCUTE "electrocute"
+#define BIOACID "bioacid"
#define CUT "cut"
#define BRUISE "bruise"
diff --git a/code/__defines/math.dm b/code/__defines/math.dm
index 3d64ba6c81..88c459ba78 100644
--- a/code/__defines/math.dm
+++ b/code/__defines/math.dm
@@ -1,18 +1,228 @@
+// Credits to Nickr5 for the useful procs I've taken from his library resource.
+// This file is quadruple wrapped for your pleasure
+// (
+
+#define NUM_E 2.71828183
+
+#define M_PI (3.14159265)
+#define INFINITY (1.#INF) //closer then enough
+
+#define SHORT_REAL_LIMIT 16777216
+
//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks
//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio)
//collapsed to percent_of_tick_used * tick_lag
#define TICK_DELTA_TO_MS(percent_of_tick_used) ((percent_of_tick_used) * world.tick_lag)
-#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE-starting_tickusage))
+#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.
#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK))
#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers )
-#define SHORT_REAL_LIMIT 16777216 // 2^24 - Maximum integer that can be exactly represented in a float (BYOND num var)
+#define SIGN(x) ( (x)!=0 ? (x) / abs(x) : 0 )
#define CEILING(x, y) ( -round(-(x) / (y)) * (y) )
+
// round() acts like floor(x, 1) by default but can't handle other values
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
-// Check if a BYOND dir var is a cardinal direction (power of two)
+
+#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))
+
+// Secant
+#define SEC(x) (1 / cos(x))
+
+// 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
+
+// Least Common Multiple
+#define LCM(a, b) (abs(a) / GCD(a, b) * abs(b))
+
#define IS_CARDINAL(x) ((x & (x - 1)) == 0)
+
+#define INVERSE(x) ( 1/(x) )
+
+// Used for calculating the radioactive strength falloff
+#define INVERSE_SQUARE(initial_strength,cur_distance,initial_distance) ( (initial_strength)*((initial_distance)**2/(cur_distance)**2) )
+
+#define ISABOUTEQUAL(a, b, deviation) (deviation ? abs((a) - (b)) <= deviation : abs((a) - (b)) <= 0.1)
+
+#define ISEVEN(x) (x % 2 == 0)
+
+#define ISODD(x) (x % 2 != 0)
+
+// Returns true if val is from min to max, inclusive.
+#define ISINRANGE(val, min, max) (min <= val && val <= max)
+
+// Same as above, exclusive.
+#define ISINRANGE_EX(val, min, max) (min < val && val > max)
+
+#define ISINTEGER(x) (round(x) == x)
+
+#define ISMULTIPLE(x, y) ((x) % (y) == 0)
+
+// Performs a linear interpolation between a and b.
+// Note that amount=0 returns a, amount=1 returns b, and
+// amount=0.5 returns the mean of a and b.
+#define LERP(a, b, amount) ( amount ? ((a) + ((b) - (a)) * (amount)) : a )
+
+// Returns the nth root of x.
+#define ROOT(n, x) ((x) ** (1 / (n)))
+
+/proc/Mean(...)
+ var/sum = 0
+ for(var/val in args)
+ sum += val
+ return sum / args.len
+
+// The quadratic formula. Returns a list with the solutions, or an empty list
+// if they are imaginary.
+/proc/SolveQuadratic(a, b, c)
+ ASSERT(a)
+ . = list()
+ var/d = b*b - 4 * a * c
+ var/bottom = 2 * a
+ // Return if the roots are imaginary.
+ if(d < 0)
+ return
+ var/root = sqrt(d)
+ . += (-b + root) / bottom
+ // If discriminant == 0, there would be two roots at the same position.
+ if(!d)
+ return
+ . += (-b - root) / bottom
+
+ // 180 / Pi ~ 57.2957795
+#define TODEGREES(radians) ((radians) * 57.2957795)
+
+ // Pi / 180 ~ 0.0174532925
+#define TORADIANS(degrees) ((degrees) * 0.0174532925)
+
+// Will filter out extra rotations and negative rotations
+// E.g: 540 becomes 180. -180 becomes 180.
+#define SIMPLIFY_DEGREES(degrees) (MODULUS((degrees), 360))
+
+#define GET_ANGLE_OF_INCIDENCE(face, input) (MODULUS((face) - (input), 360))
+
+//Finds the shortest angle that angle A has to change to get to angle B. Aka, whether to move clock or counterclockwise.
+/proc/closer_angle_difference(a, b)
+ if(!isnum(a) || !isnum(b))
+ return
+ a = SIMPLIFY_DEGREES(a)
+ b = SIMPLIFY_DEGREES(b)
+ var/inc = b - a
+ if(inc < 0)
+ inc += 360
+ var/dec = a - b
+ if(dec < 0)
+ dec += 360
+ . = inc > dec? -dec : inc
+
+//A logarithm that converts an integer to a number scaled between 0 and 1.
+//Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions.
+#define TRANSFORM_USING_VARIABLE(input, max) ( sin((90*(input))/(max))**2 )
+
+//converts a uniform distributed random number into a normal distributed one
+//since this method produces two random numbers, one is saved for subsequent calls
+//(making the cost negligble for every second call)
+//This will return +/- decimals, situated about mean with standard deviation stddev
+//68% chance that the number is within 1stddev
+//95% chance that the number is within 2stddev
+//98% chance that the number is within 3stddev...etc
+#define ACCURACY 10000
+/proc/gaussian(mean, stddev)
+ var/static/gaussian_next
+ var/R1;var/R2;var/working
+ if(gaussian_next != null)
+ R1 = gaussian_next
+ gaussian_next = null
+ else
+ do
+ R1 = rand(-ACCURACY,ACCURACY)/ACCURACY
+ R2 = rand(-ACCURACY,ACCURACY)/ACCURACY
+ working = R1*R1 + R2*R2
+ while(working >= 1 || working==0)
+ working = sqrt(-2 * log(working) / working)
+ R1 *= working
+ gaussian_next = R2 * working
+ return (mean + stddev * R1)
+#undef ACCURACY
+
+/proc/get_turf_in_angle(angle, turf/starting, increments)
+ var/pixel_x = 0
+ var/pixel_y = 0
+ for(var/i in 1 to increments)
+ pixel_x += sin(angle)+16*sin(angle)*2
+ pixel_y += cos(angle)+16*cos(angle)*2
+ var/new_x = starting.x
+ var/new_y = starting.y
+ while(pixel_x > 16)
+ pixel_x -= 32
+ new_x++
+ while(pixel_x < -16)
+ pixel_x += 32
+ new_x--
+ while(pixel_y > 16)
+ pixel_y -= 32
+ new_y++
+ while(pixel_y < -16)
+ pixel_y += 32
+ new_y--
+ new_x = CLAMP(new_x, 0, world.maxx)
+ new_y = CLAMP(new_y, 0, world.maxy)
+ return locate(new_x, new_y, starting.z)
+
+// Returns a list where [1] is all x values and [2] is all y values that overlap between the given pair of rectangles
+/proc/get_overlap(x1, y1, x2, y2, x3, y3, x4, y4)
+ var/list/region_x1 = list()
+ var/list/region_y1 = list()
+ var/list/region_x2 = list()
+ var/list/region_y2 = list()
+
+ // These loops create loops filled with x/y values that the boundaries inhabit
+ // ex: list(5, 6, 7, 8, 9)
+ for(var/i in min(x1, x2) to max(x1, x2))
+ region_x1["[i]"] = TRUE
+ for(var/i in min(y1, y2) to max(y1, y2))
+ region_y1["[i]"] = TRUE
+ for(var/i in min(x3, x4) to max(x3, x4))
+ region_x2["[i]"] = TRUE
+ for(var/i in min(y3, y4) to max(y3, y4))
+ region_y2["[i]"] = TRUE
+
+ return list(region_x1 & region_x2, region_y1 & region_y2)
+
+// )
+
+#define RAND_F(LOW, HIGH) (rand()*(HIGH-LOW) + LOW)
+
+#define SQUARE(x) (x*x)
+
+//Vector Algebra
+#define SQUAREDNORM(x, y) (x*x+y*y)
+#define NORM(x, y) (sqrt(SQUAREDNORM(x,y)))
+#define ISPOWEROFTWO(x) ((x & (x - 1)) == 0)
+#define ROUNDUPTOPOWEROFTWO(x) (2 ** -round(-log(2,x)))
+
+#define DEFAULT(a, b) (a? a : b)
diff --git a/code/__defines/math_physics.dm b/code/__defines/math_physics.dm
index da1c2aebd1..b4952f4e11 100644
--- a/code/__defines/math_physics.dm
+++ b/code/__defines/math_physics.dm
@@ -1,10 +1,13 @@
// Math constants.
-#define M_PI 3.14159265
-
#define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol).
#define ONE_ATMOSPHERE 101.325 // kPa.
#define IDEAL_GAS_ENTROPY_CONSTANT 1164 // (mol^3 * s^3) / (kg^3 * L).
+#define T0C 273.15 // 0.0 degrees celcius
+#define T20C 293.15 // 20.0 degrees celcius
+#define TCMB 2.7 // -270.3 degrees celcius
+#define TN60C 213.15 // -60 degrees celcius
+
// Radiation constants.
#define STEFAN_BOLTZMANN_CONSTANT 5.6704e-8 // W/(m^2*K^4).
#define COSMIC_RADIATION_TEMPERATURE 3.15 // K.
@@ -15,18 +18,7 @@
#define RADIATOR_EXPOSED_SURFACE_AREA_RATIO 0.04 // (3 cm + 100 cm * sin(3deg))/(2*(3+100 cm)). Unitless ratio.
#define HUMAN_EXPOSED_SURFACE_AREA 5.2 //m^2, surface area of 1.7m (H) x 0.46m (D) cylinder
-#define T0C 273.15 // 0.0 degrees celcius
-#define T20C 293.15 // 20.0 degrees celcius
-#define TCMB 2.7 // -270.3 degrees celcius
-#define TN60C 213.15 // -60 degrees celcius
-
-#define CLAMP01(x) max(0, min(1, x))
#define QUANTIZE(variable) (round(variable,0.0001))
-#define INFINITY 1.#INF
-
-#define TICKS_IN_DAY 24*60*60*10
-#define TICKS_IN_SECOND 10
-
-#define SIMPLE_SIGN(X) ((X) < 0 ? -1 : 1)
-#define SIGN(X) ((X) ? SIMPLE_SIGN(X) : 0)
+#define TICKS_IN_DAY (TICKS_IN_SECOND * 60 * 60 * 24)
+#define TICKS_IN_SECOND (world.fps)
\ No newline at end of file
diff --git a/code/_helpers/maths.dm b/code/_helpers/maths.dm
deleted file mode 100644
index 4cbe75bffc..0000000000
--- a/code/_helpers/maths.dm
+++ /dev/null
@@ -1,131 +0,0 @@
-// Macro functions.
-#define RAND_F(LOW, HIGH) (rand()*(HIGH-LOW) + LOW)
-#define ceil(x) (-round(-(x)))
-
-// min is inclusive, max is exclusive
-/proc/Wrap(val, min, max)
- var/d = max - min
- var/t = Floor((val - min) / d)
- return val - (t * d)
-
-/proc/Default(a, b)
- return a ? a : b
-
-// Trigonometric functions.
-/proc/Tan(x)
- return sin(x) / cos(x)
-
-/proc/Csc(x)
- return 1 / sin(x)
-
-/proc/Sec(x)
- return 1 / cos(x)
-
-/proc/Cot(x)
- return 1 / Tan(x)
-
-/proc/Atan2(x, y)
- if(!x && !y) return 0
- var/a = arccos(x / sqrt(x*x + y*y))
- return y >= 0 ? a : -a
-
-/proc/Floor(x)
- return round(x)
-
-/proc/Ceiling(x)
- return -round(-x)
-
-// Greatest Common Divisor: Euclid's algorithm.
-/proc/Gcd(a, b)
- while (1)
- if (!b) return a
- a %= b
- if (!a) return b
- b %= a
-
-// Least Common Multiple. The formula is a consequence of: a*b = LCM*GCD.
-/proc/Lcm(a, b)
- return abs(a) * abs(b) / Gcd(a, b)
-
-// Useful in the cases when x is a large expression, e.g. x = 3a/2 + b^2 + Function(c)
-/proc/Square(x)
- return x*x
-
-/proc/Inverse(x)
- return 1 / x
-
-// Condition checks.
-/proc/IsAboutEqual(a, b, delta = 0.1)
- return abs(a - b) <= delta
-
-// Returns true if val is from min to max, inclusive.
-/proc/IsInRange(val, min, max)
- return (val >= min) && (val <= max)
-
-/proc/IsInteger(x)
- return Floor(x) == x
-
-/proc/IsMultiple(x, y)
- return x % y == 0
-
-/proc/IsEven(x)
- return !(x & 0x1)
-
-/proc/IsOdd(x)
- return (x & 0x1)
-
-// Performs a linear interpolation between a and b.
-// Note: weight=0 returns a, weight=1 returns b, and weight=0.5 returns the mean of a and b.
-/proc/Interpolate(a, b, weight = 0.5)
- return a + (b - a) * weight // Equivalent to: a*(1 - weight) + b*weight
-
-/proc/Mean(...)
- var/sum = 0
- for(var/val in args)
- sum += val
- return sum / args.len
-
-// Returns the nth root of x.
-/proc/Root(n, x)
- return x ** (1 / n)
-
-// The quadratic formula. Returns a list with the solutions, or an empty list
-// if they are imaginary.
-/proc/SolveQuadratic(a, b, c)
- ASSERT(a)
-
- . = list()
- var/discriminant = b*b - 4*a*c
- var/bottom = 2*a
-
- // Return if the roots are imaginary.
- if(discriminant < 0)
- return
-
- var/root = sqrt(discriminant)
- . += (-b + root) / bottom
-
- // If discriminant == 0, there would be two roots at the same position.
- if(discriminant != 0)
- . += (-b - root) / bottom
-
-/proc/ToDegrees(radians)
- // 180 / Pi ~ 57.2957795
- return radians * 57.2957795
-
-/proc/ToRadians(degrees)
- // Pi / 180 ~ 0.0174532925
- return degrees * 0.0174532925
-
-// Vector algebra.
-/proc/squaredNorm(x, y)
- return x*x + y*y
-
-/proc/norm(x, y)
- return sqrt(squaredNorm(x, y))
-
-/proc/IsPowerOfTwo(var/val)
- return (val & (val-1)) == 0
-
-/proc/RoundUpToPowerOfTwo(var/val)
- return 2 ** -round(-log(2,val))
diff --git a/code/_helpers/vector.dm b/code/_helpers/vector.dm
index 44d293734c..875f0e4bfd 100644
--- a/code/_helpers/vector.dm
+++ b/code/_helpers/vector.dm
@@ -78,13 +78,13 @@ return_location()
return
// calculate the angle
- angle = Atan2(dx, dy) + angle_offset
+ angle = ATAN2(dx, dy) + angle_offset
// and some rounding to stop the increments jumping whole turfs - because byond favours certain angles
if(angle > -135 && angle < 45)
- angle = Ceiling(angle)
+ angle = CEILING(angle, 1)
else
- angle = Floor(angle)
+ angle = FLOOR(angle, 1)
// calculate the offset per increment step
if(abs(angle) in list(0, 45, 90, 135, 180)) // check if the angle is a cardinal
@@ -93,11 +93,11 @@ return_location()
if(abs(angle) in list(45, 90, 135))
offset_y = sign(dy)
else if(abs(dy) > abs(dx))
- offset_x = Cot(abs(angle)) // otherwise set the offsets
+ offset_x = COT(abs(angle)) // otherwise set the offsets
offset_y = sign(dy)
else
offset_x = sign(dx)
- offset_y = Tan(angle)
+ offset_y = TAN(angle)
if(dx < 0)
offset_y = -offset_y
diff --git a/code/controllers/subsystems/overlays.dm b/code/controllers/subsystems/overlays.dm
index 5c8b3531c9..60b08c71d2 100644
--- a/code/controllers/subsystems/overlays.dm
+++ b/code/controllers/subsystems/overlays.dm
@@ -168,7 +168,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B
* Adds specific overlay(s) to the atom.
* It is designed so any of the types allowed to be added to /atom/overlays can be added here too. More details below.
*
- * @param overlays The overlay(s) to add. These may be
+ * @param overlays The overlay(s) to add. These may be
* - A string: In which case it is treated as an icon_state of the atom's icon.
* - An icon: It is treated as an icon.
* - An atom: Its own overlays are compiled and then it's appearance is added. (Meaning its current apperance is frozen).
@@ -205,7 +205,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B
/**
* Copy the overlays from another atom, either replacing all of ours or appending to our existing overlays.
* Note: This copies only the normal overlays, not the "priority" overlays.
- *
+ *
* @param other The atom to copy overlays from.
* @param cut_old If true, all of our overlays will be *replaced* by the other's. If other is null, that means cutting all ours.
*/
diff --git a/code/datums/beam.dm b/code/datums/beam.dm
index 12c22430db..51b58f462e 100644
--- a/code/datums/beam.dm
+++ b/code/datums/beam.dm
@@ -102,11 +102,11 @@
//Position the effect so the beam is one continous line
var/a
if(abs(Pixel_x)>32)
- a = Pixel_x > 0 ? round(Pixel_x/32) : Ceiling(Pixel_x/32)
+ a = Pixel_x > 0 ? round(Pixel_x/32) : CEILING(Pixel_x/32, 1)
X.x += a
Pixel_x %= 32
if(abs(Pixel_y)>32)
- a = Pixel_y > 0 ? round(Pixel_y/32) : Ceiling(Pixel_y/32)
+ a = Pixel_y > 0 ? round(Pixel_y/32) : CEILING(Pixel_y/32, 1)
X.y += a
Pixel_y %= 32
diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm
index f66b580c52..cc982ce207 100644
--- a/code/game/machinery/bioprinter.dm
+++ b/code/game/machinery/bioprinter.dm
@@ -287,7 +287,7 @@
/obj/machinery/organ_printer/robot/dismantle()
if(stored_matter >= matter_amount_per_sheet)
- new /obj/item/stack/material/steel(get_turf(src), Floor(stored_matter/matter_amount_per_sheet))
+ new /obj/item/stack/material/steel(get_turf(src), FLOOR(stored_matter/matter_amount_per_sheet, 1))
return ..()
/obj/machinery/organ_printer/robot/print_organ(var/choice)
@@ -305,7 +305,7 @@
return
var/obj/item/stack/S = W
var/space_left = max_stored_matter - stored_matter
- var/sheets_to_take = min(S.amount, Floor(space_left/matter_amount_per_sheet))
+ var/sheets_to_take = min(S.amount, FLOOR(space_left/matter_amount_per_sheet, 1))
if(sheets_to_take <= 0)
to_chat(user, "\The [src] is too full.")
return
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 69681d1775..2dbe4e6176 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -194,7 +194,7 @@
occupant.adjustCloneLoss(-2 * heal_rate)
//Premature clones may have brain damage.
- occupant.adjustBrainLoss(-(ceil(0.5*heal_rate)))
+ occupant.adjustBrainLoss(-(CEILING(0.5*heal_rate, 1)))
//So clones don't die of oxyloss in a running pod.
if(occupant.reagents.get_reagent_amount("inaprovaline") < 30)
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index f4926c2aa8..693f213d2e 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -151,7 +151,7 @@
return
else if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel") // Repairing.
- var/amt = Ceiling((maxhealth - health)/150)
+ var/amt = CEILING((maxhealth - health)/150, 1)
if(!amt)
to_chat(user, "\The [src] is already fully repaired.")
return
diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm
index 436ebabcc9..43b42cbac9 100644
--- a/code/game/objects/effects/chem/chemsmoke.dm
+++ b/code/game/objects/effects/chem/chemsmoke.dm
@@ -130,9 +130,9 @@
var/offset = 0
var/points = round((radius * 2 * M_PI) / arcLength)
- var/angle = round(ToDegrees(arcLength / radius), 1)
+ var/angle = round(TODEGREES(arcLength / radius), 1)
- if(!IsInteger(radius))
+ if(!ISINTEGER(radius))
offset = 45 //degrees
for(var/j = 0, j < points, j++)
diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm
index 6a92cf21a4..7f0b8b6dac 100644
--- a/code/game/objects/items/devices/defib.dm
+++ b/code/game/objects/items/devices/defib.dm
@@ -53,7 +53,7 @@
else
new_overlays += "[initial(icon_state)]-powered"
- var/ratio = Ceiling(bcell.percent()/25) * 25
+ var/ratio = CEILING(bcell.percent()/25, 1) * 25
new_overlays += "[initial(icon_state)]-charge[ratio]"
else
new_overlays += "[initial(icon_state)]-nocell"
diff --git a/code/game/objects/items/weapons/id cards/cards.dm b/code/game/objects/items/weapons/id cards/cards.dm
index d0b2534463..c284cec896 100644
--- a/code/game/objects/items/weapons/id cards/cards.dm
+++ b/code/game/objects/items/weapons/id cards/cards.dm
@@ -95,6 +95,6 @@
usr << "You are not adding enough telecrystals to fuel \the [src]."
return
uses += T.amount/2 //Gives 5 uses per 10 TC
- uses = ceil(uses) //Ensures no decimal uses nonsense, rounds up to be nice
+ uses = CEILING(uses, 1) //Ensures no decimal uses nonsense, rounds up to be nice
usr << "You add \the [O] to \the [src]. Increasing the uses of \the [src] to [uses]."
qdel(O)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm
index ead57c0649..99192780b2 100644
--- a/code/game/objects/items/weapons/tools/weldingtool.dm
+++ b/code/game/objects/items/weapons/tools/weldingtool.dm
@@ -120,10 +120,8 @@
++burned_fuel_for
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
remove_fuel(1)
-
if(get_fuel() < 1)
setWelding(0)
-
//I'm not sure what this does. I assume it has to do with starting fires...
//...but it doesnt check to see if the welder is on or not.
var/turf/location = src.loc
@@ -160,12 +158,8 @@
L.IgniteMob()
if (istype(location, /turf))
location.hotspot_expose(700, 50, 1)
- return
-
-
-/obj/item/weapon/weldingtool/attack_self(mob/user as mob)
- setWelding(!welding, usr)
- return
+/obj/item/weapon/weldingtool/attack_self(mob/user)
+ setWelding(!welding, user)
//Returns the amount of fuel in the welder
/obj/item/weapon/weldingtool/proc/get_fuel()
@@ -194,7 +188,7 @@
//Returns whether or not the welding tool is currently on.
/obj/item/weapon/weldingtool/proc/isOn()
- return src.welding
+ return welding
/obj/item/weapon/weldingtool/update_icon()
..()
@@ -210,7 +204,7 @@
// Fuel counter overlay.
if(change_icons && get_max_fuel())
var/ratio = get_fuel() / get_max_fuel()
- ratio = Ceiling(ratio*4) * 25
+ ratio = CEILING(ratio * 4, 1) * 25
var/image/I = image(icon, src, "[icon_state][ratio]")
overlays.Add(I)
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 3840b4e3bc..1316adb636 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -46,7 +46,7 @@
// adjust locker size to hold all items with 5 units of free store room
var/content_size = 0
for(I in src.contents)
- content_size += Ceiling(I.w_class/2)
+ content_size += CEILING(I.w_class/2, 1)
if(content_size > storage_capacity-5)
storage_capacity = content_size + 5
update_icon()
@@ -56,7 +56,7 @@
var/content_size = 0
for(var/obj/item/I in src.contents)
if(!I.anchored)
- content_size += Ceiling(I.w_class/2)
+ content_size += CEILING(I.w_class/2, 1)
if(!content_size)
to_chat(user, "It is empty.")
else if(storage_capacity > content_size*4)
@@ -153,7 +153,7 @@
/obj/structure/closet/proc/store_items(var/stored_units)
var/added_units = 0
for(var/obj/item/I in src.loc)
- var/item_size = Ceiling(I.w_class / 2)
+ var/item_size = CEILING(I.w_class / 2, 1)
if(stored_units + added_units + item_size > storage_capacity)
continue
if(!I.anchored)
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 9baba18d35..d075d4174b 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -449,7 +449,7 @@
// Damage overlays.
var/ratio = health / maxhealth
- ratio = Ceiling(ratio * 4) * 25
+ ratio = CEILING(ratio * 4, 1) * 25
if(ratio > 75)
return
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 1ee7dc9686..a4982a397d 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -239,7 +239,7 @@ proc/admin_notice(var/message, var/rights)
// Display the notes on the current page
var/number_pages = note_keys.len / PLAYER_NOTES_ENTRIES_PER_PAGE
- // Emulate ceil(why does BYOND not have ceil)
+ // Emulate CEILING(why does BYOND not have ceil, 1)
if(number_pages != round(number_pages))
number_pages = round(number_pages) + 1
var/page_index = page - 1
diff --git a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm
index f2d1f05e13..2a16a3e091 100644
--- a/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm
+++ b/code/modules/ai/aI_holder_subtypes/simple_mob_ai.dm
@@ -16,9 +16,9 @@
can_flee = TRUE
violent_breakthrough = FALSE
-// Won't wander away, ideal for event-spawned mobs like carp or drones.
+// Won't wander away as quickly, ideal for event-spawned mobs like carp or drones.
/datum/ai_holder/simple_mob/event
- wander = FALSE
+ base_wander_delay = 8
// Doesn't really act until told to by something on the outside.
/datum/ai_holder/simple_mob/inert
@@ -60,7 +60,7 @@
// For event-spawned malf drones.
/datum/ai_holder/simple_mob/ranged/kiting/threatening/event
- wander = FALSE
+ base_wander_delay = 8
/datum/ai_holder/simple_mob/ranged/kiting/no_moonwalk
moonwalk = FALSE
@@ -96,6 +96,11 @@
/datum/ai_holder/simple_mob/restrained
violent_breakthrough = FALSE
conserve_ammo = TRUE
+ destructive = FALSE
+
+// This does the opposite of the above subtype.
+/datum/ai_holder/simple_mob/destructive
+ destructive = TRUE
// Melee mobs.
diff --git a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
index c859a523cc..059adfb849 100644
--- a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
+++ b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm
@@ -12,13 +12,16 @@
var/always_stun = FALSE // If true, the slime will elect to attempt to permastun the target.
+ var/last_discipline_decay = null // Last world.time discipline was reduced from decay.
+ var/discipline_decay_time = 5 SECONDS // Earliest that one discipline can decay.
+
/datum/ai_holder/simple_mob/xenobio_slime/sapphire
always_stun = TRUE // They know that stuns are godly.
intelligence_level = AI_SMART // Also knows not to walk while confused if it risks death.
/datum/ai_holder/simple_mob/xenobio_slime/light_pink
- discipline = 5
- obedience = 5
+ discipline = 10
+ obedience = 10
/datum/ai_holder/simple_mob/xenobio_slime/passive/New() // For Kendrick.
..()
@@ -89,9 +92,10 @@
// Handles decay of discipline.
/datum/ai_holder/simple_mob/xenobio_slime/proc/discipline_decay()
- if(discipline > 0)
+ if(discipline > 0 && last_discipline_decay + discipline_decay_time < world.time)
if(!prob(75 + (obedience * 5)))
adjust_discipline(-1)
+ last_discipline_decay = world.time
/datum/ai_holder/simple_mob/xenobio_slime/handle_special_tactic()
evolve_and_reproduce()
diff --git a/code/modules/ai/ai_holder_targeting.dm b/code/modules/ai/ai_holder_targeting.dm
index acb3da2309..37f064f8c0 100644
--- a/code/modules/ai/ai_holder_targeting.dm
+++ b/code/modules/ai/ai_holder_targeting.dm
@@ -15,8 +15,9 @@
var/lose_target_time = 0 // world.time when a target was lost.
var/lose_target_timeout = 5 SECONDS // How long until a mob 'times out' and stops trying to find the mob that disappeared.
- var/list/attackers = list() // List of strings of names of people who attacked us before in our life.
- // This uses strings and not refs to allow for disguises, and to avoid needing to use weakrefs.
+ var/list/attackers = list() // List of strings of names of people who attacked us before in our life.
+ // This uses strings and not refs to allow for disguises, and to avoid needing to use weakrefs.
+ var/destructive = FALSE // Will target 'neutral' structures/objects and not just 'hostile' ones.
// A lot of this is based off of /TG/'s AI code.
@@ -111,6 +112,7 @@
var/obj/mecha/M = the_target
if(M.occupant)
return can_attack(M.occupant)
+ return destructive // Empty mechs are 'neutral'.
if(istype(the_target, /obj/machinery/porta_turret))
var/obj/machinery/porta_turret/P = the_target
diff --git a/code/modules/client/preference_setup/loadout/loadout_accessories.dm b/code/modules/client/preference_setup/loadout/loadout_accessories.dm
index 5364fee6b8..186e799a3d 100644
--- a/code/modules/client/preference_setup/loadout/loadout_accessories.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_accessories.dm
@@ -240,4 +240,21 @@
/datum/gear/accessory/locket
display_name = "locket"
- path = /obj/item/clothing/accessory/locket
\ No newline at end of file
+ path = /obj/item/clothing/accessory/locket
+
+/datum/gear/accessory/asym
+ display_name = "asymmetric jacket selection"
+ path = /obj/item/clothing/accessory/asymmetric
+ cost = 1
+
+/datum/gear/accessory/asym/New()
+ ..()
+ var/list/asyms = list()
+ for(var/asym in typesof(/obj/item/clothing/accessory/asymmetric))
+ var/obj/item/clothing/accessory/asymmetric_type = asym
+ asyms[initial(asymmetric_type.name)] = asymmetric_type
+ gear_tweaks += new/datum/gear_tweak/path(sortAssoc(asyms))
+
+/datum/gear/accessory/cowledvest
+ display_name = "cowled vest"
+ path = /obj/item/clothing/accessory/cowledvest
\ No newline at end of file
diff --git a/code/modules/client/preference_setup/loadout/loadout_eyes.dm b/code/modules/client/preference_setup/loadout/loadout_eyes.dm
index 5981424753..1bf8d639d0 100644
--- a/code/modules/client/preference_setup/loadout/loadout_eyes.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_eyes.dm
@@ -124,4 +124,20 @@
/datum/gear/eyes/circuitry
display_name = "goggles, circuitry (empty)"
- path = /obj/item/clothing/glasses/circuitry
\ No newline at end of file
+ path = /obj/item/clothing/glasses/circuitry
+
+/datum/gear/eyes/glasses/rimless
+ display_name = "Glasses, rimless"
+ path = /obj/item/clothing/glasses/rimless
+
+/datum/gear/eyes/glasses/prescriptionrimless
+ display_name = "Glasses, prescription rimless"
+ path = /obj/item/clothing/glasses/regular/rimless
+
+/datum/gear/eyes/glasses/thin
+ display_name = "Glasses, thin frame"
+ path = /obj/item/clothing/glasses/thin
+
+/datum/gear/eyes/glasses/prescriptionrimless
+ display_name = "Glasses, prescription thin frame"
+ path = /obj/item/clothing/glasses/regular/thin
\ No newline at end of file
diff --git a/code/modules/client/preference_setup/loadout/loadout_head.dm b/code/modules/client/preference_setup/loadout/loadout_head.dm
index ecd47229e1..735a26201e 100644
--- a/code/modules/client/preference_setup/loadout/loadout_head.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_head.dm
@@ -371,3 +371,12 @@
/datum/gear/head/circuitry
display_name = "headwear, circuitry (empty)"
path = /obj/item/clothing/head/circuitry
+
+/datum/gear/head/maangtikka
+ display_name = "maang tikka"
+ path = /obj/item/clothing/head/maangtikka
+
+/datum/gear/head/jingasa
+ display_name = "jingasa"
+ path = /obj/item/clothing/head/jingasa
+
diff --git a/code/modules/client/preference_setup/loadout/loadout_suit.dm b/code/modules/client/preference_setup/loadout/loadout_suit.dm
index 41d37b8a67..e0bef9fd29 100644
--- a/code/modules/client/preference_setup/loadout/loadout_suit.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_suit.dm
@@ -463,6 +463,10 @@ datum/gear/suit/duster
..()
gear_tweaks = list(gear_tweak_free_color_choice)
+/datum/gear/suit/miscellaneous/kamishimo
+ display_name = "kamishimo"
+ path = /obj/item/clothing/suit/kamishimo
+
/datum/gear/suit/snowsuit
display_name = "snowsuit"
path = /obj/item/clothing/suit/storage/snowsuit
diff --git a/code/modules/client/preference_setup/loadout/loadout_uniform.dm b/code/modules/client/preference_setup/loadout/loadout_uniform.dm
index 427993f5c4..1a13b75906 100644
--- a/code/modules/client/preference_setup/loadout/loadout_uniform.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_uniform.dm
@@ -462,4 +462,25 @@
/datum/gear/uniform/circuitry
display_name = "jumpsuit, circuitry (empty)"
- path = /obj/item/clothing/under/circuitry
\ No newline at end of file
+ path = /obj/item/clothing/under/circuitry
+
+/datum/gear/uniform/sleekoverall
+ display_name = "sleek overalls"
+ path = /obj/item/clothing/under/overalls/sleek
+
+/datum/gear/uniform/sarired
+ display_name = "sari, red"
+ path = /obj/item/clothing/under/dress/sari
+
+/datum/gear/uniform/sarigreen
+ display_name = "sari, green"
+ path = /obj/item/clothing/under/dress/sari/green
+
+/datum/gear/uniform/wrappedcoat
+ display_name = "modern wrapped coat"
+ path = /obj/item/clothing/under/moderncoat
+
+/datum/gear/uniform/ascetic
+ display_name = "plain ascetic garb"
+ path = /obj/item/clothing/under/ascetic
+
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index fed3119830..4877b431f4 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -232,6 +232,31 @@ BLIND // can't see anything
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
body_parts_covered = 0
+/obj/item/clothing/glasses/regular/rimless
+ name = "prescription rimless glasses"
+ desc = "Sleek modern glasses with a single sculpted lens."
+ icon_state = "glasses_rimless"
+ prescription = 1
+
+/obj/item/clothing/glasses/rimless
+ name = "rimless glasses"
+ desc = "Sleek modern glasses with a single sculpted lens."
+ icon_state = "glasses_rimless"
+ prescription = 0
+
+/obj/item/clothing/glasses/regular/thin
+ name = "prescription thin-rimmed glasses"
+ desc = "Glasses with frames are so last century."
+ icon_state = "glasses_thin"
+ prescription = 1
+
+/obj/item/clothing/glasses/thin
+ name = "thin-rimmed glasses"
+ desc = "Glasses with frames are so last century."
+ icon_state = "glasses_thin"
+ prescription = 0
+
+
/obj/item/clothing/glasses/sunglasses
name = "sunglasses"
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes."
diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm
index a6d1e9e48a..d044c53406 100644
--- a/code/modules/clothing/head/misc.dm
+++ b/code/modules/clothing/head/misc.dm
@@ -413,4 +413,17 @@
name = "maid headband"
desc = "Keeps hair out of the way for important... jobs."
icon_state = "maid"
- body_parts_covered = 0
\ No newline at end of file
+ body_parts_covered = 0
+
+/obj/item/clothing/head/maangtikka
+ name = "maang tikka"
+ desc = "A jeweled headpiece originating in India."
+ icon_state = "maangtikka"
+ body_parts_covered = 0
+
+/obj/item/clothing/head/jingasa
+ name = "jingasa"
+ desc = "A wide, flat rain hat originally from Japan."
+ icon_state = "jingasa"
+ body_parts_covered = 0
+ item_state_slots = list(slot_r_hand_str = "taq", slot_l_hand_str = "taq")
\ No newline at end of file
diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm
index 07751bde9d..90cd8b5a14 100644
--- a/code/modules/clothing/spacesuits/rig/rig.dm
+++ b/code/modules/clothing/spacesuits/rig/rig.dm
@@ -545,7 +545,7 @@
data["charge"] = cell ? round(cell.charge,1) : 0
data["maxcharge"] = cell ? cell.maxcharge : 0
- data["chargestatus"] = cell ? Floor((cell.charge/cell.maxcharge)*50) : 0
+ data["chargestatus"] = cell ? FLOOR((cell.charge/cell.maxcharge)*50, 1) : 0
data["emagged"] = subverted
data["coverlock"] = locked
diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm
index eeca9d220b..988be655cb 100644
--- a/code/modules/clothing/suits/miscellaneous.dm
+++ b/code/modules/clothing/suits/miscellaneous.dm
@@ -255,6 +255,11 @@ obj/item/clothing/suit/kimono
icon_state = "kimono"
addblends = "kimono_a"
+obj/item/clothing/suit/kamishimo
+ name = "kamishimo"
+ desc = "Traditional Japanese menswear."
+ icon_state = "kamishimo"
+
/*
* coats
*/
diff --git a/code/modules/clothing/under/accessories/clothing.dm b/code/modules/clothing/under/accessories/clothing.dm
index 065aedb6ac..29057e8469 100644
--- a/code/modules/clothing/under/accessories/clothing.dm
+++ b/code/modules/clothing/under/accessories/clothing.dm
@@ -30,7 +30,6 @@
desc = "Lucky suit jacket."
icon_state = "checkered_jacket"
-
/obj/item/clothing/accessory/chaps
name = "brown chaps"
desc = "A pair of loose, brown leather chaps."
@@ -342,3 +341,23 @@
name = "Christmas turtleneck"
desc = "A really cheesy holiday sweater, it actually kinda itches."
icon_state = "turtleneck_winterred"
+
+/obj/item/clothing/accessory/cowledvest
+ name = "cowled vest"
+ desc = "A body warmer for the 26th century."
+ icon_state = "cowled_vest"
+
+/obj/item/clothing/accessory/asymmetric
+ name = "blue asymmetrical jacket"
+ desc = "Insultingly avant-garde in prussian blue."
+ icon_state = "asym_blue"
+
+/obj/item/clothing/accessory/asymmetric/purple
+ name = "purple asymmetrical jacket"
+ desc = "Insultingly avant-garde in mauve."
+ icon_state = "asym_purple"
+
+/obj/item/clothing/accessory/asymmetric/green
+ name = "green asymmetrical jacket"
+ desc = "Insultingly avant-garde in aqua."
+ icon_state = "asym_green"
\ No newline at end of file
diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm
index 07b0f12609..c61a707073 100644
--- a/code/modules/clothing/under/miscellaneous.dm
+++ b/code/modules/clothing/under/miscellaneous.dm
@@ -242,6 +242,11 @@
icon_state = "overalls"
item_state_slots = list(slot_r_hand_str = "cargo", slot_l_hand_str = "cargo")
+/obj/item/clothing/under/overalls/sleek
+ name = "sleek overalls"
+ desc = "A set of modern pleather reinforced overalls."
+ icon_state = "overalls_sleek"
+
/obj/item/clothing/under/pirate
name = "pirate outfit"
desc = "Yarr."
@@ -283,6 +288,19 @@
item_state_slots = list(slot_r_hand_str = "yellow", slot_l_hand_str = "yellow")
body_parts_covered = LOWER_TORSO
+/obj/item/clothing/under/moderncoat
+ name = "modern wrapped coat"
+ desc = "The cutting edge of fashion."
+ icon_state = "moderncoat"
+ item_state_slots = list(slot_r_hand_str = "red", slot_l_hand_str = "red")
+ body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS
+
+/obj/item/clothing/under/ascetic
+ name = "plain ascetic garb"
+ desc = "Popular with freshly grown vatborn and new age cultists alike."
+ icon_state = "ascetic"
+ item_state_slots = list(slot_r_hand_str = "white", slot_l_hand_str = "white")
+
/*
* dress
*/
@@ -404,6 +422,18 @@
desc = "A western bustle dress from Earth's late 1800's."
icon_state = "westernbustle"
+/obj/item/clothing/under/dress/sari
+ name = "red sari"
+ desc = "A colorful traditional dress originating from India."
+ icon_state = "sari_red"
+ item_state_slots = list(slot_r_hand_str = "darkreddress", slot_l_hand_str = "darkreddress")
+
+/obj/item/clothing/under/dress/sari/green
+ name = "green sari"
+ icon_state = "sari_green"
+ item_state_slots = list(slot_r_hand_str = "dress_green", slot_l_hand_str = "dress_green")
+
+
/*
* wedding stuff
*/
diff --git a/code/modules/clothing/under/pants.dm b/code/modules/clothing/under/pants.dm
index c306d842d0..035aac4cf8 100644
--- a/code/modules/clothing/under/pants.dm
+++ b/code/modules/clothing/under/pants.dm
@@ -189,4 +189,29 @@
/obj/item/clothing/under/pants/baggy/camo
name = "baggy camo pants"
desc = "A pair of woodland camouflage pants. Probably not the best choice for a space station."
- icon_state = "baggy_camopants"
\ No newline at end of file
+ icon_state = "baggy_camopants"
+
+/obj/item/clothing/under/pants/utility
+ name = "green utility pants"
+ desc = "A pair of pleather reinforced green work pants."
+ icon_state = "workpants_green"
+
+/obj/item/clothing/under/pants/utility/orange
+ name = "orange utility pants"
+ desc = "A pair of pleather reinforced orange work pants."
+ icon_state = "workpants_orange"
+
+/obj/item/clothing/under/pants/utility/blue
+ name = "blue utility pants"
+ desc = "A pair of pleather reinforced blue work pants."
+ icon_state = "workpants_blue"
+
+/obj/item/clothing/under/pants/utility/white
+ name = "white utility pants"
+ desc = "A pair of pleather reinforced white work pants."
+ icon_state = "workpants_white"
+
+/obj/item/clothing/under/pants/utility/red
+ name = "red utility pants"
+ desc = "A pair of pleather reinforced red work pants."
+ icon_state = "workpants_red"
\ No newline at end of file
diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm
index 5c6f486d9c..fb48611c38 100644
--- a/code/modules/events/brand_intelligence.dm
+++ b/code/modules/events/brand_intelligence.dm
@@ -33,7 +33,7 @@
kill()
return
- if(IsMultiple(activeFor, 5))
+ if(ISMULTIPLE(activeFor, 5))
if(prob(15))
var/obj/machinery/vending/infectedMachine = pick(vendingMachines)
vendingMachines.Remove(infectedMachine)
@@ -41,7 +41,7 @@
infectedMachine.shut_up = 0
infectedMachine.shoot_inventory = 1
- if(IsMultiple(activeFor, 12))
+ if(ISMULTIPLE(activeFor, 12))
originMachine.speak(pick("Try our aggressive new marketing strategies!", \
"You should buy products to feed your lifestyle obsession!", \
"Consume!", \
diff --git a/code/modules/food/kitchen/cooking_machines/_cooker.dm b/code/modules/food/kitchen/cooking_machines/_cooker.dm
index a361bf3007..0ff53f4db7 100644
--- a/code/modules/food/kitchen/cooking_machines/_cooker.dm
+++ b/code/modules/food/kitchen/cooking_machines/_cooker.dm
@@ -171,7 +171,7 @@
cooking_obj = null
else
var/failed
- var/overcook_period = max(Floor(cook_time/5),1)
+ var/overcook_period = max(FLOOR(cook_time/5, 1),1)
cooking_obj = result
var/count = overcook_period
while(1)
diff --git a/code/modules/gamemaster/actions/carp_migration.dm b/code/modules/gamemaster/actions/carp_migration.dm
index 7bf7d80ee3..b635ca6d5e 100644
--- a/code/modules/gamemaster/actions/carp_migration.dm
+++ b/code/modules/gamemaster/actions/carp_migration.dm
@@ -32,7 +32,7 @@
var/activeness = ((metric.assess_department(ROLE_SECURITY) + metric.assess_department(ROLE_ENGINEERING) + metric.assess_department(ROLE_MEDICAL)) / 3)
activeness = max(activeness, 20)
- carp_amount = Ceiling(station_strength * (activeness / 100) + 1)
+ carp_amount = CEILING(station_strength * (activeness / 100) + 1, 1)
/datum/gm_action/carp_migration/start()
..()
diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm
index f5b6b28e11..e9b3ae537e 100644
--- a/code/modules/games/cards.dm
+++ b/code/modules/games/cards.dm
@@ -413,7 +413,7 @@
overlays += I
return
- var/offset = Floor(20/cards.len)
+ var/offset = FLOOR(20/cards.len, 1)
var/matrix/M = matrix()
if(direction)
diff --git a/code/modules/integrated_electronics/subtypes/converters.dm b/code/modules/integrated_electronics/subtypes/converters.dm
index 0ec00be317..316742e488 100644
--- a/code/modules/integrated_electronics/subtypes/converters.dm
+++ b/code/modules/integrated_electronics/subtypes/converters.dm
@@ -265,7 +265,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
- result = ToDegrees(incoming)
+ result = TODEGREES(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -283,7 +283,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
- result = ToRadians(incoming)
+ result = TORADIANS(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
diff --git a/code/modules/integrated_electronics/subtypes/trig.dm b/code/modules/integrated_electronics/subtypes/trig.dm
index daadf52d42..303053639f 100644
--- a/code/modules/integrated_electronics/subtypes/trig.dm
+++ b/code/modules/integrated_electronics/subtypes/trig.dm
@@ -71,7 +71,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Tan(A)
+ result = TAN(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -91,7 +91,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Csc(A)
+ result = CSC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -112,7 +112,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Sec(A)
+ result = SEC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -133,7 +133,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
- result = Cot(A)
+ result = COT(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 5911582057..f0ea269775 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -202,7 +202,7 @@ var/list/mining_overlay_cache = list()
if(severity <= 2) // Now to expose the ore lying under the sand.
spawn(1) // Otherwise most of the ore is lost to the explosion, which makes this rather moot.
for(var/ore in resources)
- var/amount_to_give = rand(Ceiling(resources[ore]/2), resources[ore]) // Should result in at least one piece of ore.
+ var/amount_to_give = rand(CEILING(resources[ore]/2, 1), resources[ore]) // Should result in at least one piece of ore.
for(var/i=1, i <= amount_to_give, i++)
var/oretype = ore_types[ore]
new oretype(src)
diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm
index 66e0e5e0f0..e84b569ff6 100644
--- a/code/modules/mob/language/language.dm
+++ b/code/modules/mob/language/language.dm
@@ -32,7 +32,7 @@
for(var/i = 0;i0;x--)
+ for(var/x = rand(FLOOR(syllable_count/syllable_divisor, 1),syllable_count);x>0;x--)
new_name += pick(syllables)
full_name += " [capitalize(lowertext(new_name))]"
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index aff4b81e1f..969da63807 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -363,7 +363,7 @@
stop_pulling()
src << "You slipped on [slipped_on]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- Weaken(Floor(stun_duration/2))
+ Weaken(FLOOR(stun_duration/2, 1))
return 1
/mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1)
diff --git a/code/modules/mob/living/carbon/human/descriptors/_descriptors.dm b/code/modules/mob/living/carbon/human/descriptors/_descriptors.dm
index d2944cc0cb..79e876a985 100644
--- a/code/modules/mob/living/carbon/human/descriptors/_descriptors.dm
+++ b/code/modules/mob/living/carbon/human/descriptors/_descriptors.dm
@@ -34,7 +34,7 @@
chargen_value_descriptors = list()
for(var/i = 1 to LAZYLEN(standalone_value_descriptors))
chargen_value_descriptors[standalone_value_descriptors[i]] = i
- default_value = ceil(LAZYLEN(standalone_value_descriptors) * 0.5)
+ default_value = CEILING(LAZYLEN(standalone_value_descriptors) * 0.5, 1)
..()
/datum/mob_descriptor/proc/get_third_person_message_start(var/datum/gender/my_gender)
@@ -99,10 +99,10 @@
/datum/mob_descriptor/proc/get_comparative_value_string_smaller(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
var/maxval = LAZYLEN(comparative_value_descriptors_smaller)
- value = Clamp(ceil(value * maxval), 1, maxval)
+ value = Clamp(CEILING(value * maxval, 1), 1, maxval)
return comparative_value_descriptors_smaller[value]
/datum/mob_descriptor/proc/get_comparative_value_string_larger(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
var/maxval = LAZYLEN(comparative_value_descriptors_larger)
- value = Clamp(ceil(value * maxval), 1, maxval)
+ value = Clamp(CEILING(value * maxval, 1), 1, maxval)
return comparative_value_descriptors_larger[value]
diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm
index 9e20d49a44..0c0915aa47 100644
--- a/code/modules/mob/living/carbon/metroid/powers.dm
+++ b/code/modules/mob/living/carbon/metroid/powers.dm
@@ -165,4 +165,4 @@
else
src << "I am not ready to reproduce yet..."
else
- src << "I am not old enough to reproduce yet..."
\ No newline at end of file
+ src << "I am not old enough to reproduce yet..."
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 07997851ef..37d9e43b37 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -36,6 +36,11 @@
adjustHalLoss(damage * blocked)
if(ELECTROCUTE)
electrocute_act(damage, used_weapon, 1.0, def_zone)
+ if(BIOACID)
+ if(isSynthetic())
+ adjustFireLoss(damage * blocked)
+ else
+ adjustToxLoss(damage * blocked)
flash_weak_pain()
updatehealth()
return 1
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 1845ab5a4a..a3bca632ac 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -674,7 +674,7 @@
//Robots take half damage from basic attacks.
/mob/living/silicon/robot/attack_generic(var/mob/user, var/damage, var/attack_message)
- return ..(user,Floor(damage/2),attack_message)
+ return ..(user,FLOOR(damage/2, 1),attack_message)
/mob/living/silicon/robot/proc/allowed(mob/M)
//check if it doesn't require any access at all
diff --git a/code/modules/mob/living/simple_animal/animals/giant_spider.dm b/code/modules/mob/living/simple_animal/animals/giant_spider.dm
index b01fcac159..587edeb0f8 100644
--- a/code/modules/mob/living/simple_animal/animals/giant_spider.dm
+++ b/code/modules/mob/living/simple_animal/animals/giant_spider.dm
@@ -188,9 +188,9 @@ Nurse Family
for(var/I = 1 to spiderling_count)
if(prob(10) && src)
var/mob/living/simple_animal/hostile/giant_spider/swarmling = new swarmling_type(src.loc)
- var/swarm_health = Floor(swarmling.maxHealth * 0.4)
- var/swarm_dam_lower = Floor(melee_damage_lower * 0.4)
- var/swarm_dam_upper = Floor(melee_damage_upper * 0.4)
+ var/swarm_health = FLOOR(swarmling.maxHealth * 0.4, 1)
+ var/swarm_dam_lower = FLOOR(melee_damage_lower * 0.4, 1)
+ var/swarm_dam_upper = FLOOR(melee_damage_upper * 0.4, 1)
swarmling.name = "spiderling"
swarmling.maxHealth = swarm_health
swarmling.health = swarm_health
diff --git a/code/modules/mob/living/simple_mob/combat.dm b/code/modules/mob/living/simple_mob/combat.dm
index e0cf980cc3..ae1fa4ad3b 100644
--- a/code/modules/mob/living/simple_mob/combat.dm
+++ b/code/modules/mob/living/simple_mob/combat.dm
@@ -102,7 +102,7 @@
return FALSE
visible_message("\The [src] fires at \the [A]!")
- shoot(A, src.loc, src)
+ shoot(A)
if(casingtype)
new casingtype(loc)
@@ -112,21 +112,22 @@
return TRUE
-//Shoot a bullet at someone (idk why user is an argument when src would fit???)
-/mob/living/simple_mob/proc/shoot(atom/A, turf/start, mob/living/user, bullet = 0)
- if(A == start)
+// Shoot a bullet at something.
+/mob/living/simple_mob/proc/shoot(atom/A)
+ if(A == get_turf(src))
return
face_atom(A)
- var/obj/item/projectile/P = new projectiletype(user.loc)
+ var/obj/item/projectile/P = new projectiletype(src.loc)
if(!P)
return
// If the projectile has its own sound, use it.
// Otherwise default to the mob's firing sound.
- playsound(user, P.fire_sound ? P.fire_sound : projectilesound, 80, 1)
+ playsound(src, P.fire_sound ? P.fire_sound : projectilesound, 80, 1)
+ P.firer = src // So we can't shoot ourselves.
P.launch(A)
if(needs_reload)
reload_count++
diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/carrier.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/carrier.dm
index 575e3ad204..0d5218030d 100644
--- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/carrier.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/carrier.dm
@@ -38,9 +38,9 @@
for(var/i = 1 to spiderling_count)
if(prob(swarmling_prob) && src)
var/mob/living/simple_mob/animal/giant_spider/swarmling = new swarmling_type(src.loc)
- var/swarm_health = Floor(swarmling.maxHealth * 0.4)
- var/swarm_dam_lower = Floor(melee_damage_lower * 0.4)
- var/swarm_dam_upper = Floor(melee_damage_upper * 0.4)
+ var/swarm_health = FLOOR(swarmling.maxHealth * 0.4, 1)
+ var/swarm_dam_lower = FLOOR(melee_damage_lower * 0.4, 1)
+ var/swarm_dam_upper = FLOOR(melee_damage_upper * 0.4, 1)
swarmling.name = "spiderling"
swarmling.maxHealth = swarm_health
swarmling.health = swarm_health
diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm
index f7f594f139..6cae7dd6e7 100644
--- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm
@@ -20,17 +20,40 @@
var/number = 0 // This is used to make the slime semi-unique for indentification.
var/harmless = FALSE // Set to true when pacified. Makes the slime harmless, not get hungry, and not be able to grow/reproduce.
-/mob/living/simple_mob/slime/xenobio/initialize()
+/mob/living/simple_mob/slime/xenobio/initialize(mapload, var/mob/living/simple_mob/slime/xenobio/my_predecessor)
ASSERT(ispath(ai_holder_type, /datum/ai_holder/simple_mob/xenobio_slime))
number = rand(1, 1000)
update_name()
- return ..()
+
+ . = ..() // This will make the AI and do the other mob constructor things. It will also return the default hint at the end.
+
+ if(my_predecessor)
+ inherit_information(my_predecessor)
+
/mob/living/simple_mob/slime/xenobio/Destroy()
if(victim)
stop_consumption() // Unbuckle us from our victim.
return ..()
+// Called when a slime makes another slime by splitting. The predecessor slime will be deleted shortly afterwards.
+/mob/living/simple_mob/slime/xenobio/proc/inherit_information(var/mob/living/simple_mob/slime/xenobio/predecessor)
+ if(!predecessor)
+ return
+
+ var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
+ var/datum/ai_holder/simple_mob/xenobio_slime/previous_AI = predecessor.ai_holder
+ ASSERT(istype(AI))
+ ASSERT(istype(previous_AI))
+
+ // Now to transfer the information.
+ // Newly made slimes are bit more rebellious than their predecessors, but they also somewhat forget the atrocities the xenobiologist may have done.
+ AI.discipline = max(previous_AI.discipline - 1, 0)
+ AI.obedience = max(previous_AI.obedience - 1, 0)
+ AI.resentment = max(previous_AI.resentment - 1, 0)
+ AI.rabid = previous_AI.rabid
+
+
/mob/living/simple_mob/slime/xenobio/update_icon()
icon_living = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_adult ? "adult" : "baby"][victim ? " eating" : ""]"
icon_dead = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_adult ? "adult" : "baby"] dead"
@@ -212,14 +235,12 @@
t = /mob/living/simple_mob/slime/xenobio/rainbow
else if(prob(mutation_chance) && slime_mutation.len)
t = slime_mutation[rand(1, slime_mutation.len)]
- var/mob/living/simple_mob/slime/xenobio/baby = new t(loc)
+ var/mob/living/simple_mob/slime/xenobio/baby = new t(loc, src)
// Handle 'inheriting' from parent slime.
baby.mutation_chance = mutation_chance
baby.power_charge = round(power_charge / 4)
- pass_on_data(baby) // Transfer the AI stuff slowly, sadly.
-
if(!istype(baby, /mob/living/simple_mob/slime/xenobio/rainbow))
baby.unity = unity
baby.faction = faction
@@ -228,33 +249,6 @@
step_away(baby, src)
return baby
-/mob/living/simple_mob/slime/xenobio/proc/pass_on_data(mob/living/simple_mob/slime/xenobio/baby)
- // This is superdumb but the AI datum won't exist until the new slime's initialize() finishes.
- var/new_discipline = 0
- var/new_obedience = 0
- var/new_resentment = 0
- var/new_rabid = FALSE
-
- // First, get this slime's AI values since they are likely to be deleted in a moment.
- if(src && src.has_AI())
- var/datum/ai_holder/simple_mob/xenobio_slime/our_AI = ai_holder
- new_discipline = max(our_AI.discipline - 1, 0)
- new_obedience = max(our_AI.obedience - 1, 0)
- new_resentment = max(our_AI.resentment - 1, 0)
- new_rabid = our_AI.rabid
-
- spawn(2) // Race conditions are fun, but with the first two letters capitalized.
- if(istype(baby) && baby.has_AI())
- var/datum/ai_holder/simple_mob/xenobio_slime/their_AI = baby.ai_holder
-
- if(!istype(baby, /mob/living/simple_mob/slime/xenobio/light_pink))
- their_AI.discipline = new_discipline
- their_AI.obedience = new_obedience
-
- their_AI.resentment = new_resentment
-
- their_AI.rabid = new_rabid
-
/mob/living/simple_mob/slime/xenobio/get_description_interaction()
var/list/results = list()
@@ -281,4 +275,4 @@
lines.Add(null)
lines.Add(description_info)
- return lines.Join("\n")
\ No newline at end of file
+ return lines.Join("\n")
diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm
index 0adb547284..65cf1d3a1a 100644
--- a/code/modules/organs/organ_icon.dm
+++ b/code/modules/organs/organ_icon.dm
@@ -275,5 +275,5 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F
dam_state = min_dam_state
// Apply colour and return product.
var/list/hud_colours = (robotic < ORGAN_ROBOT) ? flesh_hud_colours : robot_hud_colours
- hud_damage_image.color = hud_colours[max(1,min(ceil(dam_state*hud_colours.len),hud_colours.len))]
+ hud_damage_image.color = hud_colours[max(1,min(CEILING(dam_state*hud_colours.len, 1),hud_colours.len))]
return hud_damage_image
diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm
index b1f58b0965..d626e6f04b 100644
--- a/code/modules/paperwork/papershredder.dm
+++ b/code/modules/paperwork/papershredder.dm
@@ -137,7 +137,7 @@
else
icon_state = "shredder-off"
// Fullness overlay
- overlays += "shredder-[max(0,min(5,Floor(paperamount/max_paper*5)))]"
+ overlays += "shredder-[max(0,min(5,FLOOR(paperamount/max_paper*5, 1)))]"
if (panel_open)
overlays += "panel_open"
diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm
index 371130511a..7ec3f7029a 100644
--- a/code/modules/planet/sif.dm
+++ b/code/modules/planet/sif.dm
@@ -70,12 +70,12 @@ var/datum/planet/sif/planet_sif = null
high_color = "#FFFFFF"
min = 0.70
- var/lerp_weight = (abs(min - sun_position)) * 4
+ var/interpolate_weight = (abs(min - sun_position)) * 4
var/weather_light_modifier = 1
if(weather_holder && weather_holder.current_weather)
weather_light_modifier = weather_holder.current_weather.light_modifier
- var/new_brightness = (Interpolate(low_brightness, high_brightness, weight = lerp_weight) ) * weather_light_modifier
+ var/new_brightness = (LERP(low_brightness, high_brightness, interpolate_weight) ) * weather_light_modifier
var/new_color = null
if(weather_holder && weather_holder.current_weather && weather_holder.current_weather.light_color)
@@ -91,9 +91,9 @@ var/datum/planet/sif/planet_sif = null
var/high_g = high_color_list[2]
var/high_b = high_color_list[3]
- var/new_r = Interpolate(low_r, high_r, weight = lerp_weight)
- var/new_g = Interpolate(low_g, high_g, weight = lerp_weight)
- var/new_b = Interpolate(low_b, high_b, weight = lerp_weight)
+ var/new_r = LERP(low_r, high_r, interpolate_weight)
+ var/new_g = LERP(low_g, high_g, interpolate_weight)
+ var/new_b = LERP(low_b, high_b, interpolate_weight)
new_color = rgb(new_r, new_g, new_b)
diff --git a/code/modules/planet/time.dm b/code/modules/planet/time.dm
index 0b3008b668..d9c6642e6a 100644
--- a/code/modules/planet/time.dm
+++ b/code/modules/planet/time.dm
@@ -54,15 +54,15 @@
var/seconds = remaining_hour % seconds_in_minute / 10
- var/hour_text = num2text(Floor(hours))
+ var/hour_text = num2text(FLOOR(hours, 1))
if(length(hour_text) < 2)
hour_text = "0[hour_text]" // Add padding if needed, to look more like time2text().
- var/minute_text = num2text(Floor(minutes))
+ var/minute_text = num2text(FLOOR(minutes, 1))
if(length(minute_text) < 2)
minute_text = "0[minute_text]"
- var/second_text = num2text(Floor(seconds))
+ var/second_text = num2text(FLOOR(seconds, 1))
if(length(second_text) < 2)
second_text = "0[second_text]"
diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm
index 1cdbd47bd8..e81cea6e85 100644
--- a/code/modules/planet/weather.dm
+++ b/code/modules/planet/weather.dm
@@ -98,7 +98,7 @@
visuals.icon_state = current_weather.icon_state
/datum/weather_holder/proc/update_temperature()
- temperature = Interpolate(current_weather.temp_low, current_weather.temp_high, weight = our_planet.sun_position)
+ temperature = LERP(current_weather.temp_low, current_weather.temp_high, our_planet.sun_position)
our_planet.needs_work |= PLANET_PROCESS_TEMP
/datum/weather_holder/proc/get_weather_datum(desired_type)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 6717edf95d..0ec17ef303 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -532,7 +532,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
if(!S || S.robotic < ORGAN_ROBOT || S.open == 3)
return ..()
- var/use_amt = min(src.amount, ceil(S.burn_dam/5), 5)
+ var/use_amt = min(src.amount, CEILING(S.burn_dam/5, 1), 5)
if(can_use(use_amt))
if(S.robo_repair(5*use_amt, BURN, "some damaged wiring", src, user))
src.use(use_amt)
diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm
index 7103e8cb55..f0eca3add6 100644
--- a/code/modules/power/fusion/core/core_field.dm
+++ b/code/modules/power/fusion/core/core_field.dm
@@ -171,8 +171,8 @@
use_power = light_max_power
else
var/temp_mod = ((plasma_temperature-5000)/20000)
- use_range = light_min_range + ceil((light_max_range-light_min_range)*temp_mod)
- use_power = light_min_power + ceil((light_max_power-light_min_power)*temp_mod)
+ use_range = light_min_range + CEILING((light_max_range-light_min_range)*temp_mod, 1)
+ use_power = light_min_power + CEILING((light_max_power-light_min_power)*temp_mod, 1)
if(last_range != use_range || last_power != use_power)
set_light(use_range,use_power)
@@ -318,8 +318,8 @@
/obj/effect/fusion_em_field/proc/Radiate()
if(istype(loc, /turf))
- var/empsev = max(1, min(3, ceil(size/2)))
- for(var/atom/movable/AM in range(max(1,Floor(size/2)), loc))
+ var/empsev = max(1, min(3, CEILING(size/2, 1)))
+ for(var/atom/movable/AM in range(max(1,FLOOR(size/2, 1)), loc))
if(AM == src || AM == owned_core || !AM.simulated)
continue
@@ -386,7 +386,7 @@
//determine a random amount to actually react this cycle, and remove it from the standard pool
//this is a hack, and quite nonrealistic :(
for(var/reactant in react_pool)
- react_pool[reactant] = rand(Floor(react_pool[reactant]/2),react_pool[reactant])
+ react_pool[reactant] = rand(FLOOR(react_pool[reactant]/2, 1),react_pool[reactant])
dormant_reactant_quantities[reactant] -= react_pool[reactant]
if(!react_pool[reactant])
react_pool -= reactant
@@ -574,7 +574,7 @@
/obj/effect/fusion_em_field/proc/Rupture()
visible_message("\The [src] shudders like a dying animal before flaring to eye-searing brightness and rupturing!")
set_light(15, 15, "#CCCCFF")
- empulse(get_turf(src), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
+ empulse(get_turf(src), CEILING(plasma_temperature/1000, 1), CEILING(plasma_temperature/300, 1))
global_announcer.autosay("WARNING: FIELD RUPTURE IMMINENT!", "Containment Monitor")
RadiateAll()
var/list/things_in_range = range(10, owned_core)
@@ -584,7 +584,7 @@
turfs_in_range.Add(T)
explosion(pick(things_in_range), -1, 5, 5, 5)
- empulse(pick(things_in_range), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
+ empulse(pick(things_in_range), CEILING(plasma_temperature/1000, 1), CEILING(plasma_temperature/300, 1))
spawn(25)
explosion(pick(things_in_range), -1, 5, 5, 5)
spawn(25)
@@ -655,7 +655,7 @@
/obj/effect/fusion_em_field/proc/BluespaceQuenchEvent() //!!FUN!! causes a number of explosions in an area around the core. Will likely destory or heavily damage the reactor.
visible_message("\The [src] shudders like a dying animal before flaring to eye-searing brightness and rupturing!")
set_light(15, 15, "#CCCCFF")
- empulse(get_turf(src), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
+ empulse(get_turf(src), CEILING(plasma_temperature/1000, 1), CEILING(plasma_temperature/300, 1))
global_announcer.autosay("WARNING: FIELD RUPTURE IMMINENT!", "Containment Monitor")
RadiateAll()
var/list/things_in_range = range(10, owned_core)
@@ -665,7 +665,7 @@
turfs_in_range.Add(T)
for(var/loopcount = 1 to 10)
explosion(pick(things_in_range), -1, 5, 5, 5)
- empulse(pick(things_in_range), ceil(plasma_temperature/1000), ceil(plasma_temperature/300))
+ empulse(pick(things_in_range), CEILING(plasma_temperature/1000, 1), CEILING(plasma_temperature/300, 1))
Destroy()
owned_core.Shutdown()
return
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
index bfd02d5c52..a97c467028 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
@@ -46,7 +46,7 @@
return PROCESS_KILL
if(istype(loc, /turf))
- radiation_repository.radiate(src, max(1,ceil(radioactivity/30)))
+ radiation_repository.radiate(src, max(1,CEILING(radioactivity/30, 1)))
/obj/item/weapon/fuel_assembly/Destroy()
STOP_PROCESSING(SSobj, src)
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index ac4401387a..ee9e7057da 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -207,7 +207,7 @@
return
if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/amt = Ceiling(( initial(integrity) - integrity)/10)
+ var/amt = CEILING(( initial(integrity) - integrity)/10, 1)
if(!amt)
to_chat(user, "\The [src] is already fully repaired.")
return
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index bd65dedddb..06855f134e 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -584,7 +584,7 @@
if(one_handed_penalty)
if(!held_twohanded)
- acc_mod += -ceil(one_handed_penalty/2)
+ acc_mod += -CEILING(one_handed_penalty/2, 1)
disp_mod += one_handed_penalty*0.5 //dispersion per point of two-handedness
//Accuracy modifiers
diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm
index 3448c2a9e9..cc7a4cdf8b 100644
--- a/code/modules/projectiles/projectile/energy.dm
+++ b/code/modules/projectiles/projectile/energy.dm
@@ -123,6 +123,7 @@
damage_type = BURN
agony = 10
check_armour = "bio"
+ armor_penetration = 25 // It's acid
combustion = FALSE
@@ -130,9 +131,10 @@
name = "neurotoxic spit"
icon_state = "neurotoxin"
damage = 5
- damage_type = TOX
+ damage_type = BIOACID
agony = 80
check_armour = "bio"
+ armor_penetration = 25 // It's acid-based
combustion = FALSE
@@ -140,9 +142,10 @@
name = "neurotoxic spit"
icon_state = "neurotoxin"
damage = 20
- damage_type = TOX
+ damage_type = BIOACID
agony = 20
check_armour = "bio"
+ armor_penetration = 25 // It's acid-based
/obj/item/projectile/energy/phoron
name = "phoron bolt"
diff --git a/code/modules/random_map/noise/noise.dm b/code/modules/random_map/noise/noise.dm
index 7e4323158e..8e45a21c3f 100644
--- a/code/modules/random_map/noise/noise.dm
+++ b/code/modules/random_map/noise/noise.dm
@@ -19,10 +19,10 @@
/datum/random_map/noise/set_map_size()
// Make sure the grid is a square with limits that are
// (n^2)+1, otherwise diamond-square won't work.
- if(!IsPowerOfTwo((limit_x-1)))
- limit_x = RoundUpToPowerOfTwo(limit_x) + 1
- if(!IsPowerOfTwo((limit_y-1)))
- limit_y = RoundUpToPowerOfTwo(limit_y) + 1
+ if(!ISPOWEROFTWO((limit_x-1)))
+ limit_x = ROUNDUPTOPOWEROFTWO(limit_x) + 1
+ if(!ISPOWEROFTWO((limit_y-1)))
+ limit_y = ROUNDUPTOPOWEROFTWO(limit_y) + 1
// Sides must be identical lengths.
if(limit_x > limit_y)
limit_y = limit_x
diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm
index e3c087b5fa..3f655d83de 100644
--- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm
+++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm
@@ -70,7 +70,7 @@
/datum/reagent/toxin/hydrophoron/touch_turf(var/turf/simulated/T)
if(!istype(T))
return
- T.assume_gas("phoron", ceil(volume/2), T20C)
+ T.assume_gas("phoron", CEILING(volume/2, 1), T20C)
for(var/turf/simulated/floor/target_tile in range(0,T))
target_tile.assume_gas("phoron", volume/2, 400+T0C)
spawn (0) target_tile.hotspot_expose(700, 400)
diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm
index b870a55902..e6bb3260b9 100644
--- a/code/modules/reagents/reagent_containers.dm
+++ b/code/modules/reagents/reagent_containers.dm
@@ -100,7 +100,7 @@
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
self_feed_message(user)
- reagents.trans_to_mob(user, issmall(user) ? ceil(amount_per_transfer_from_this/2) : amount_per_transfer_from_this, CHEM_INGEST)
+ reagents.trans_to_mob(user, issmall(user) ? CEILING(amount_per_transfer_from_this/2, 1) : amount_per_transfer_from_this, CHEM_INGEST)
feed_sound(user)
return 1
else
diff --git a/code/modules/shieldgen/directional_shield.dm b/code/modules/shieldgen/directional_shield.dm
index 5f5e5af55e..279580ce89 100644
--- a/code/modules/shieldgen/directional_shield.dm
+++ b/code/modules/shieldgen/directional_shield.dm
@@ -154,7 +154,7 @@
// Makes shields become gradually more red as the projector's health decreases.
/obj/item/shield_projector/proc/update_shield_colors()
// This is done at the projector instead of the shields themselves to avoid needing to calculate this more than once every update.
- var/lerp_weight = shield_health / max_shield_health
+ var/interpolate_weight = shield_health / max_shield_health
var/list/low_color_list = hex2rgb(low_color)
var/low_r = low_color_list[1]
@@ -166,9 +166,9 @@
var/high_g = high_color_list[2]
var/high_b = high_color_list[3]
- var/new_r = Interpolate(low_r, high_r, weight = lerp_weight)
- var/new_g = Interpolate(low_g, high_g, weight = lerp_weight)
- var/new_b = Interpolate(low_b, high_b, weight = lerp_weight)
+ var/new_r = LERP(low_r, high_r, interpolate_weight)
+ var/new_g = LERP(low_g, high_g, interpolate_weight)
+ var/new_b = LERP(low_b, high_b, interpolate_weight)
var/new_color = rgb(new_r, new_g, new_b)
diff --git a/code/modules/shuttles/shuttles_web.dm b/code/modules/shuttles/shuttles_web.dm
index c6233d48a0..0beac59051 100644
--- a/code/modules/shuttles/shuttles_web.dm
+++ b/code/modules/shuttles/shuttles_web.dm
@@ -88,7 +88,7 @@
if(autopilot_delay % 10 == 0) // Every ten ticks.
var/seconds_left = autopilot_delay * 2
if(seconds_left >= 60) // A minute
- var/minutes_left = Floor(seconds_left / 60)
+ var/minutes_left = FLOOR(seconds_left / 60, 1)
seconds_left = seconds_left % 60
autopilot_say("Departing in [minutes_left] minute\s[seconds_left ? ", [seconds_left] seconds":""].")
else
diff --git a/code/modules/turbolift/turbolift_map.dm b/code/modules/turbolift/turbolift_map.dm
index effd03e8a6..fd9b54f126 100644
--- a/code/modules/turbolift/turbolift_map.dm
+++ b/code/modules/turbolift/turbolift_map.dm
@@ -58,7 +58,7 @@
if(NORTH)
- int_panel_x = ux + Floor(lift_size_x/2)
+ int_panel_x = ux + FLOOR(lift_size_x/2, 1)
int_panel_y = uy + 1
ext_panel_x = ux
ext_panel_y = ey + 2
@@ -75,7 +75,7 @@
if(SOUTH)
- int_panel_x = ux + Floor(lift_size_x/2)
+ int_panel_x = ux + FLOOR(lift_size_x/2, 1)
int_panel_y = ey - 1
ext_panel_x = ex
ext_panel_y = uy - 2
@@ -93,7 +93,7 @@
if(EAST)
int_panel_x = ux+1
- int_panel_y = uy + Floor(lift_size_y/2)
+ int_panel_y = uy + FLOOR(lift_size_y/2, 1)
ext_panel_x = ex+2
ext_panel_y = ey
@@ -110,7 +110,7 @@
if(WEST)
int_panel_x = ex-1
- int_panel_y = uy + Floor(lift_size_y/2)
+ int_panel_y = uy + FLOOR(lift_size_y/2, 1)
ext_panel_x = ux-2
ext_panel_y = uy
diff --git a/html/changelogs/Cerebulon - Clothes.yml b/html/changelogs/Cerebulon - Clothes.yml
new file mode 100644
index 0000000000..b05070efd1
--- /dev/null
+++ b/html/changelogs/Cerebulon - Clothes.yml
@@ -0,0 +1,8 @@
+
+
+author: Cerebulon
+
+delete-after: True
+
+changes:
+ - rscadd: "Added 12 new loadout items plus colour variants: Utility pants, sleek overalls, sari, modern wrap jacket, ascetic garb, asymmetrical jackets, cowled vest, kamishimo, jingasa, maang tikka, thin-frame glasses, rimless glasses."
diff --git a/icons/mob/eyes.dmi b/icons/mob/eyes.dmi
index 763ce78990..4759a8a2d6 100644
Binary files a/icons/mob/eyes.dmi and b/icons/mob/eyes.dmi differ
diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi
index b9c1414f19..f602b64c05 100644
Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ
diff --git a/icons/mob/species/seromi/eyes.dmi b/icons/mob/species/seromi/eyes.dmi
index 8a916ca621..01e2475c3d 100644
Binary files a/icons/mob/species/seromi/eyes.dmi and b/icons/mob/species/seromi/eyes.dmi differ
diff --git a/icons/mob/species/seromi/head.dmi b/icons/mob/species/seromi/head.dmi
index 1c3f150a8e..0a917236ff 100644
Binary files a/icons/mob/species/seromi/head.dmi and b/icons/mob/species/seromi/head.dmi differ
diff --git a/icons/mob/species/seromi/suit.dmi b/icons/mob/species/seromi/suit.dmi
index 09dde09b2f..1337435e86 100644
Binary files a/icons/mob/species/seromi/suit.dmi and b/icons/mob/species/seromi/suit.dmi differ
diff --git a/icons/mob/species/seromi/uniform.dmi b/icons/mob/species/seromi/uniform.dmi
index c354d0bd12..a49299a4a1 100644
Binary files a/icons/mob/species/seromi/uniform.dmi and b/icons/mob/species/seromi/uniform.dmi differ
diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi
index 5b2bfe8e4f..c1908fe16b 100644
Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ
diff --git a/icons/mob/ties.dmi b/icons/mob/ties.dmi
index 59e77909e9..2262610211 100644
Binary files a/icons/mob/ties.dmi and b/icons/mob/ties.dmi differ
diff --git a/icons/mob/uniform.dmi b/icons/mob/uniform.dmi
index aa6e8bfb81..9e4860eca3 100644
Binary files a/icons/mob/uniform.dmi and b/icons/mob/uniform.dmi differ
diff --git a/icons/obj/clothing/glasses.dmi b/icons/obj/clothing/glasses.dmi
index 8342982785..d8418a50a5 100644
Binary files a/icons/obj/clothing/glasses.dmi and b/icons/obj/clothing/glasses.dmi differ
diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi
index c585c40625..230fdc1248 100644
Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ
diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi
index 38154ec14a..dc131fb6fe 100644
Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ
diff --git a/icons/obj/clothing/ties.dmi b/icons/obj/clothing/ties.dmi
index 52433ab5e3..478bd6a40b 100644
Binary files a/icons/obj/clothing/ties.dmi and b/icons/obj/clothing/ties.dmi differ
diff --git a/icons/obj/clothing/uniforms.dmi b/icons/obj/clothing/uniforms.dmi
index d0bb4a6b39..91230723f1 100644
Binary files a/icons/obj/clothing/uniforms.dmi and b/icons/obj/clothing/uniforms.dmi differ
diff --git a/polaris.dme b/polaris.dme
index 4614a7bb9b..57158da7eb 100644
--- a/polaris.dme
+++ b/polaris.dme
@@ -81,7 +81,6 @@
#include "code\_helpers\icons.dm"
#include "code\_helpers\lists.dm"
#include "code\_helpers\logging.dm"
-#include "code\_helpers\maths.dm"
#include "code\_helpers\matrices.dm"
#include "code\_helpers\mobs.dm"
#include "code\_helpers\names.dm"