Skip to content

Commit

Permalink
Merge branch 'master' into helmet-accessories
Browse files Browse the repository at this point in the history
  • Loading branch information
Staykeu committed Feb 12, 2024
2 parents f3dd89c + 65aec78 commit e375127
Show file tree
Hide file tree
Showing 194 changed files with 1,937 additions and 1,667 deletions.
2 changes: 1 addition & 1 deletion .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Example:
# 500.1337: runtimestation

515.1610: lv624
515.1630: lv624
4 changes: 2 additions & 2 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ block( \

// Helpers
/// Only use the CEILING_PROTECTION_TIER_X defines for `protection_level`
#define CEILING_IS_PROTECTED(ceiling, protection_level) (ceiling >= protection_level)
#define CEILING_IS_PROTECTED(ceiling, protection_level) ((ceiling) >= (protection_level))

// Default font settings
#define FONT_SIZE "5pt"
Expand Down Expand Up @@ -536,7 +536,7 @@ block( \
/// `amount` - The number to get per time
/// `time` - The time period in which to gain this amount
/// To be used with delta_time. Multiplied by 10 to convert from deciseconds to seconds
#define AMOUNT_PER_TIME(amount, time) ((amount / (time))*10)
#define AMOUNT_PER_TIME(amount, time) (((amount) / (time))*10)

// Local message mode. Used to decide wheter message should be dispatched on the radio.
#define MESSAGE_MODE_LOCAL 1
Expand Down
6 changes: 3 additions & 3 deletions code/__DEFINES/_math.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )

// Returns true if val is from min to max, inclusive.
#define ISINRANGE(val, min, max) (min <= val && val <= max)
#define ISINRANGE(val, min, max) ((min) <= (val) && (val) <= (max))

// Same as above, exclusive.
#define ISINRANGE_EX(val, min, max) (min < val && val < max)
#define ISINRANGE_EX(val, min, max) ((min) < (val) && (val) < (max))

// Will filter out extra rotations and negative rotations
// E.g: 540 becomes 180. -180 becomes 180.
Expand All @@ -34,4 +34,4 @@
#define SIGN(x) ( ((x) > 0) - ((x) < 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 )
#define LERP(a, b, amount) ( (amount) ? ((a) + ((b) - (a)) * (amount)) : (a) )
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/mob/living/signals_xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@

/// From /obj/effect/alien/resin/special/eggmorph/attack_alien: (mob/living/carbon/xenomorph/M)
#define COMSIG_XENO_TAKE_HUGGER_FROM_MORPHER "xeno_take_hugger_from_morpher"

/// From /mob/living/carbon/xenomorph/proc/handle_crit()
#define COMSIG_XENO_ENTER_CRIT "xeno_entering_critical"
2 changes: 1 addition & 1 deletion code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
// PARAMETERS:
// source_hive integer the hive to check the alliance of
// target_hive integer the target hive to see if the source_hive is allied to it.
#define HIVE_ALLIED_TO_HIVE(source_hive, target_hive) (source_hive == target_hive || GLOB.hive_datum[source_hive]?.faction_is_ally(GLOB.hive_datum[target_hive]?.internal_faction))
#define HIVE_ALLIED_TO_HIVE(source_hive, target_hive) ((source_hive) == (target_hive) || GLOB.hive_datum[source_hive]?.faction_is_ally(GLOB.hive_datum[target_hive]?.internal_faction))

#define QUEEN_SPAWN_TIMEOUT (2 MINUTES)

Expand Down
26 changes: 13 additions & 13 deletions code/__HELPERS/#maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,45 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,

// MATH DEFINES

#define Ceiling(x) (-round(-x))
#define CLAMP01(x) (clamp(x, 0, 1))
#define Ceiling(x) (-round(-(x)))
#define CLAMP01(x) (clamp((x), 0, 1))

// cotangent
#define Cot(x) (1 / tan(x))

// cosecant
#define Csc(x) (1 / sin(x))

#define Default(a, b) (a ? a : b)
#define Default(a, b) ((a) ? (a) : (b))
#define Floor(x) (round(x))

// Greatest Common Divisor - Euclid's algorithm
#define Gcd(a, b) (b ? Gcd(b, a % b) : a)
#define Gcd(a, b) ((b) ? Gcd((b), (a) % (b)) : (a))

#define Inverse(x) (1 / x)
#define IsEven(x) (x % 2 == 0)
#define Inverse(x) (1 / (x))
#define IsEven(x) ((x) % 2 == 0)

#define IsInteger(x) (Floor(x) == x)
#define IsInteger(x) (Floor(x) == (x))
#define IsOdd(x) (!IsEven(x))
#define IsMultiple(x, y) (x % y == 0)
#define IsMultiple(x, y) ((x) % (y) == 0)

// Least Common Multiple
#define Lcm(a, b) (abs(a) / Gcd(a, b) * abs(b))
#define Lcm(a, b) (abs(a) / Gcd((a), (b)) * abs(b))

// Returns the nth root of x.
#define NRoot(n, x) (x ** (1 / n))
#define NRoot(n, x) ((x) ** (1 / (n)))

// secant
#define Sec(x) (1 / cos(x))

// 57.2957795 = 180 / Pi
#define ToDegrees(radians) (radians * 57.2957795)
#define ToDegrees(radians) ((radians) * 57.2957795)

// 0.0174532925 = Pi / 180
#define ToRadians(degrees) (degrees * 0.0174532925)
#define ToRadians(degrees) ((degrees) * 0.0174532925)

// min is inclusive, max is exclusive
#define WRAP(val, min, max) clamp(( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),min,max)
#define WRAP(val, min, max) clamp(( (min) == (max) ? (min) : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),(min),(max))


// MATH PROCS
Expand Down
8 changes: 4 additions & 4 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ icon/MinColors(icon)
icon/MaxColors(icon)
The icon is blended with a second icon where the maximum of each RGB pixel is the result.
Opacity may increase, as if the icons were blended with ICON_OR. You may supply a color in place of an icon.
icon/Opaque(background = COLOR_BLACK)
icon/Opaque(background = "#000000")
All alpha values are set to 255 throughout the icon. Transparent pixels become black, or whatever background color you specify.
icon/BecomeAlphaMask()
You can convert a simple grayscale icon into an alpha mask to use with other icons very easily with this proc.
Expand Down Expand Up @@ -246,7 +246,7 @@ world

/icon/proc/AddAlphaMask(mask)
var/icon/M = new(mask)
M.Blend(COLOR_WHITE, ICON_SUBTRACT)
M.Blend("#ffffff", ICON_SUBTRACT)
// apply mask
Blend(M, ICON_ADD)

Expand Down Expand Up @@ -544,7 +544,7 @@ world
return flat_icon

/proc/adjust_brightness(color, value)
if (!color) return COLOR_WHITE
if (!color) return "#FFFFFF"
if (!value) return color

var/list/RGB = ReadRGB(color)
Expand Down Expand Up @@ -581,7 +581,7 @@ world
if(A)
A.overlays.Remove(src)

/mob/proc/flick_heal_overlay(time, color = COLOR_GREEN) //used for warden and queen healing
/mob/proc/flick_heal_overlay(time, color = "#00FF00") //used for warden and queen healing
var/image/I = image('icons/mob/mob.dmi', src, "heal_overlay")
switch(icon_size)
if(48)
Expand Down
14 changes: 7 additions & 7 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
#define between(low, middle, high) (max(min(middle, high), low))

//Offuscate x for coord system
#define obfuscate_x(x) (x + GLOB.obfs_x)
#define obfuscate_x(x) ((x) + GLOB.obfs_x)

//Offuscate y for coord system
#define obfuscate_y(y) (y + GLOB.obfs_y)
#define obfuscate_y(y) ((y) + GLOB.obfs_y)

//Deoffuscate x for coord system
#define deobfuscate_x(x) (x - GLOB.obfs_x)
#define deobfuscate_x(x) ((x) - GLOB.obfs_x)

//Deoffuscate y for coord system
#define deobfuscate_y(y) (y - GLOB.obfs_y)
#define deobfuscate_y(y) ((y) - GLOB.obfs_y)

#define can_xeno_build(T) (!T.density && !(locate(/obj/structure/fence) in T) && !(locate(/obj/structure/tunnel) in T) && (locate(/obj/effect/alien/weeds) in T))

// For the purpose of a skillcheck, not having a skillset counts as being skilled in everything (!user.skills check)
// Note that is_skilled() checks if the skillset contains the skill internally, so a has_skill check is unnecessary
#define skillcheck(user, skill, req_level) ((!user.skills || user.skills.is_skilled(skill, req_level)))
#define skillcheckexplicit(user, skill, req_level) ((!user.skills || user.skills.is_skilled(skill, req_level, TRUE)))
#define skillcheck(user, skill, req_level) ((!user.skills || user.skills.is_skilled((skill), (req_level))))
#define skillcheckexplicit(user, skill, req_level) ((!user.skills || user.skills.is_skilled((skill), (req_level), TRUE)))

// Ensure the frequency is within bounds of what it should be sending/receiving at
// Sets f within bounds via `clamp(round(f), 1441, 1489)`
Expand All @@ -48,7 +48,7 @@
)

//Turns 1479 into 147.9
#define format_frequency(f) "[round(f / 10)].[f % 10]"
#define format_frequency(f) "[round((f) / 10)].[(f) % 10]"

#define reverse_direction(direction) ( \
( dir & (NORTH|SOUTH) ? ~dir & (NORTH|SOUTH) : 0 ) | \
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ GLOBAL_LIST_EMPTY(WYFaxes) //Departmental faxes
GLOBAL_LIST_EMPTY(USCMFaxes)
GLOBAL_LIST_EMPTY(ProvostFaxes)
GLOBAL_LIST_EMPTY(CMBFaxes)
GLOBAL_LIST_EMPTY(UPPFaxes)
GLOBAL_LIST_EMPTY(TWEFaxes)
GLOBAL_LIST_EMPTY(CLFFaxes)
GLOBAL_LIST_EMPTY(GeneralFaxes) //Inter-machine faxes
GLOBAL_LIST_EMPTY(fax_contents) //List of fax contents to maintain it even if source paper is deleted

Expand Down
6 changes: 3 additions & 3 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@
// Spawns multiple objects of the same type
#define cast_new(type, num, args...) if((num) == 1) { new type(args) } else { for(var/i=0;i<(num),i++) { new type(args) } }

#define FLAGS_EQUALS(flag, flags) ((flag & (flags)) == (flags))
#define FLAGS_EQUALS(flag, flags) (((flag) & (flags)) == (flags))

#define IS_DIAGONAL_DIR(dir) (dir & ~(NORTH|SOUTH))

// Inverse direction, taking into account UP|DOWN if necessary.
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
#define REVERSE_DIR(dir) ( (((dir) & 85) << 1) | (((dir) & 170) >> 1) )

#define POSITIVE(val) max(val, 0)
#define POSITIVE(val) max((val), 0)

#define GENERATE_DEBUG_ID "[rand(0, 9)][rand(0, 9)][rand(0, 9)][rand(0, 9)][pick(alphabet_lowercase)][pick(alphabet_lowercase)][pick(alphabet_lowercase)][pick(alphabet_lowercase)]"

Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@
/atom/movable/screen/fullscreen/lighting_backdrop/lit_secondary
invisibility = INVISIBILITY_LIGHTING
layer = BACKGROUND_LAYER + LIGHTING_PRIMARY_DIMMER_LAYER
color = COLOR_BLACK
color = "#000"
alpha = 60

/atom/movable/screen/fullscreen/lighting_backdrop/backplane
invisibility = INVISIBILITY_LIGHTING
layer = LIGHTING_BACKPLANE_LAYER
color = COLOR_BLACK
color = "#000"
blend_mode = BLEND_ADD

/atom/movable/screen/fullscreen/see_through_darkness
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/hud/human
var/list/gear = list()

/datum/hud/human/New(mob/living/carbon/human/owner, datum/custom_hud/hud_type, ui_color = COLOR_WHITE, ui_alpha = 255)
/datum/hud/human/New(mob/living/carbon/human/owner, datum/custom_hud/hud_type, ui_color = "#ffffff", ui_alpha = 255)
..()
ui_datum = hud_type
if(!istype(ui_datum))
Expand Down
6 changes: 5 additions & 1 deletion code/controllers/mc/globals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
GLOB = src

var/datum/controller/exclude_these = new
gvars_datum_in_built_vars = exclude_these.vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))
// I know this is dumb but the nested vars list hangs a ref to the datum. This fixes that
var/list/controller_vars = exclude_these.vars.Copy()
controller_vars["vars"] = null
gvars_datum_in_built_vars = controller_vars + list(NAMEOF(src, gvars_datum_protected_varlist), NAMEOF(src, gvars_datum_in_built_vars), NAMEOF(src, gvars_datum_init_order))

QDEL_IN(exclude_these, 0) //signal logging isn't ready

log_world("[vars.len - gvars_datum_in_built_vars.len] global variables")
Expand Down
10 changes: 5 additions & 5 deletions code/datums/_atmos_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// atmospherics devices.
//--------------------------------------------

#define PIPE_COLOR_GREY COLOR_WHITE //yes white is grey
#define PIPE_COLOR_RED COLOR_RED
#define PIPE_COLOR_BLUE COLOR_BLUE
#define PIPE_COLOR_CYAN COLOR_CYAN
#define PIPE_COLOR_GREEN COLOR_GREEN
#define PIPE_COLOR_GREY "#ffffff" //yes white is grey
#define PIPE_COLOR_RED "#ff0000"
#define PIPE_COLOR_BLUE "#0000ff"
#define PIPE_COLOR_CYAN "#00ffff"
#define PIPE_COLOR_GREEN "#00ff00"
#define PIPE_COLOR_YELLOW "#ffcc00"
#define PIPE_COLOR_PURPLE "#5c1ec0"

Expand Down
3 changes: 1 addition & 2 deletions code/datums/ammo/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
icon_state = "stun"
damage_type = OXY
flags_ammo_behavior = AMMO_ENERGY|AMMO_IGNORE_RESIST|AMMO_ALWAYS_FF //Not that ignoring will do much right now.
damage = 15 //excessive use COULD be lethal
stamina_damage = 40
stamina_damage = 45
accuracy = HIT_ACCURACY_TIER_8
shell_speed = AMMO_SPEED_TIER_1 // Slightly faster
hit_effect_color = "#FFFF00"
Expand Down
6 changes: 4 additions & 2 deletions code/datums/ammo/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
/datum/ammo/flare/set_bullet_traits()
. = ..()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary)
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary, stacks = 2.5)
))

/datum/ammo/flare/on_hit_mob(mob/M,obj/projectile/P)
Expand Down Expand Up @@ -156,11 +156,13 @@
name = "starshell ash"
icon_state = "starshell_bullet"
max_range = 5
damage = 2.5
flare_type = /obj/item/device/flashlight/flare/on/starshell_ash

/datum/ammo/flare/starshell/set_bullet_traits()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff, /datum/element/bullet_trait_incendiary)
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_iff),
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary, stacks = 1)
))

/datum/ammo/souto
Expand Down
4 changes: 2 additions & 2 deletions code/datums/custom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
var/coords_x = splittext(coords[1], ":")
return "[coords_x[1]]:[text2num(coords_x[2])+A.hud_offset],[coords[2]]"

/datum/custom_hud/proc/special_behaviour(datum/hud/element, ui_alpha = 255, ui_color = COLOR_WHITE)
/datum/custom_hud/proc/special_behaviour(datum/hud/element, ui_alpha = 255, ui_color = "#ffffff")
return

/datum/custom_hud/old
Expand Down Expand Up @@ -131,7 +131,7 @@
var/coord_row_offset = -8
return "EAST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]"

/datum/custom_hud/dark/special_behaviour(datum/hud/element, ui_alpha = 255, ui_color = COLOR_WHITE)
/datum/custom_hud/dark/special_behaviour(datum/hud/element, ui_alpha = 255, ui_color = "#ffffff")
element.frame_hud = new /atom/movable/screen()
element.frame_hud.icon = ui_frame_icon
element.frame_hud.icon_state = "dark"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/pizza.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
objectives = "Make sure you get a tip!"
shuttle_id = "Distress_Small"
name_of_spawn = /obj/effect/landmark/ert_spawns/distress_pizza
probability = 0
probability = 1

/datum/emergency_call/pizza/create_member(datum/mind/M, turf/override_spawn_loc)
var/turf/spawn_loc = override_spawn_loc ? override_spawn_loc : get_spawn_point()
Expand Down
6 changes: 4 additions & 2 deletions code/datums/emergency_calls/upp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,20 @@
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), H, SPAN_BOLD("Objectives: [objectives]")), 1 SECONDS)


/datum/emergency_call/upp/hostile
/datum/emergency_call/upp/hostile //if admins want to specifically call in friendly ones
name = "UPP Naval Infantry (Squad) (Hostile)"
hostility = TRUE
probability = 0

/datum/emergency_call/upp/hostile/New()
..()
arrival_message = "[MAIN_SHIP_NAME] t*is i* UP* d^sp^*ch`. STr*&e teaM, #*u are cLe*% for a*pr*%^h. Pr*mE a*l wE*p^ns and pR*epr# t% r@nd$r a(tD."
objectives = "Eliminate the UA Forces to ensure the UPP presence in this sector is continued. Listen to your superior officers and take over the [MAIN_SHIP_NAME] at all costs."

/datum/emergency_call/upp/friendly
/datum/emergency_call/upp/friendly //ditto
name = "UPP Naval Infantry (Squad) (Friendly)"
hostility = FALSE
probability = 0

/datum/emergency_call/upp/friendly/New()
..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/entities/clans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BSQL_PROTECT_DATUM(/datum/entity/clan)
)

/datum/entity_meta/clan/on_insert(datum/entity/clan/player_clan)
player_clan.color = COLOR_WHITE
player_clan.color = "#FFFFFF"

player_clan.save()

Expand Down
Loading

0 comments on commit e375127

Please sign in to comment.