Skip to content

Commit

Permalink
Merge remote-tracking branch 'cmss13-devs/master' into project/ares/w…
Browse files Browse the repository at this point in the history
…jnotifs
  • Loading branch information
realforest2001 committed Jan 30, 2024
2 parents e21bdaf + 192b809 commit 48276f2
Show file tree
Hide file tree
Showing 248 changed files with 17,582 additions and 16,701 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
#define WIELD_DELAY_VERY_SLOW 10
#define WIELD_DELAY_HORRIBLE 12

///This is how long you must wait after throwing something to throw again
#define THROW_DELAY (0.4 SECONDS)
///This is how long you must wait to throw again after throwing two things
#define THROW_DELAY (1.5 SECONDS)

//Explosion level thresholds. Upper bounds
#define EXPLOSION_THRESHOLD_VLOW 50
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ GLOBAL_LIST_INIT(emissive_color, EMISSIVE_COLOR)
GLOBAL_LIST_INIT(em_block_color, EM_BLOCK_COLOR)
/// A set of appearance flags applied to all emissive and emissive blocker overlays.
#define EMISSIVE_APPEARANCE_FLAGS (KEEP_APART|KEEP_TOGETHER|RESET_COLOR|RESET_TRANSFORM)
/// The color matrix used to mask out emissive blockers on the emissive plane. Alpha should default to zero, be solely dependent on the RGB value of [EMISSIVE_COLOR], and be independant of the RGB value of [EM_BLOCK_COLOR].
/// The color matrix used to mask out emissive blockers on the emissive plane. Alpha should default to zero, be solely dependent on the RGB value of [EMISSIVE_COLOR], and be independent of the RGB value of [EM_BLOCK_COLOR].
#define EM_MASK_MATRIX list(0,0,0,1/3, 0,0,0,1/3, 0,0,0,1/3, 0,0,0,0, 1,1,1,0)
/// A globaly cached version of [EM_MASK_MATRIX] for quick access.
GLOBAL_LIST_INIT(em_mask_matrix, EM_MASK_MATRIX)
Expand Down
5 changes: 4 additions & 1 deletion code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
#define DAZE "daze"
#define SLOW "slow"
#define SUPERSLOW "superslow"
#define ROOT "root"

//=================================================

//I hate adding defines like this but I'd much rather deal with bitflags than lists and string searches
Expand All @@ -100,14 +102,15 @@

//Bitflags defining which status effects could be or are inflicted on a mob

#define STATUS_FLAGS_DEBILITATE (CANSTUN|CANKNOCKOUT|CANDAZE|CANSLOW)
#define STATUS_FLAGS_DEBILITATE (CANSTUN|CANKNOCKOUT|CANDAZE|CANSLOW|CANROOT)

#define CANSTUN (1<<0)
#define CANKNOCKDOWN (1<<1)
#define CANKNOCKOUT (1<<2)
#define CANPUSH (1<<3)
#define LEAPING (1<<4)
#define PASSEMOTES (1<<5) //holders inside of mob that need to see emotes.
#define CANROOT (1<<6)
#define GODMODE (1<<12)
#define FAKEDEATH (1<<13) //Replaces stuff like changeling.changeling_fakedeath
#define DISFIGURED (1<<14) //I'll probably move this elsewhere if I ever get wround to writing a bitflag mob-damage system
Expand Down
5 changes: 4 additions & 1 deletion code/__DEFINES/paygrade_defs/civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
/// SYN, Synthetic
#define PAY_SHORT_SYN "SYN"

/// OPR, Operative
/// OPR, Operator
#define PAY_SHORT_OPR "OPR"

/// CDNM, Operative (intended for codenamed people IE Operative Theta)
#define PAY_SHORT_CDNM "CDNM"

/// CPO, Officer
#define PAY_SHORT_CPO "CPO"

Expand Down
45 changes: 45 additions & 0 deletions code/__DEFINES/paygrade_defs/mercs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Paygrade shorthand defines, to allow clearer designation.

// MERCENARIES
/// FL-S, Standard
#define PAY_SHORT_FL_S "FL-S"

/// FL-M, Medic
#define PAY_SHORT_FL_M "FL-M"

/// FL-WL, Warlord
#define PAY_SHORT_FL_WL "FL-WL"

/// EFL-S, Elite Standard
#define PAY_SHORT_EFL_S "EFL-S"

/// EFL-M, Elite Medic
#define PAY_SHORT_EFL_M "EFL-M"

/// EFL-E, Elite Engineer
#define PAY_SHORT_EFL_E "EFL-E"

/// EFL-H, Elite Heavy
#define PAY_SHORT_EFL_H "EFL-H"

/// EFL-WL, Elite Warlord
#define PAY_SHORT_EFL_TL "EFL-TL"

// VANGUARD'S ARROW INC
/// VAI-S, Standard
#define PAY_SHORT_VAI_S "VAI-S"

/// VAI-M, Medic
#define PAY_SHORT_VAI_M "VAI-M"

/// VAI-E, Engineer
#define PAY_SHORT_VAI_E "VAI-E"

/// VAI-G, Machinegunner
#define PAY_SHORT_VAI_G "VAI-G"

/// VAI-SN, Synthetic
#define PAY_SHORT_VAI_SN "VAI-SN"

/// VAI-L, Team Leader
#define PAY_SHORT_VAI_L "VAI-L"
6 changes: 6 additions & 0 deletions code/__DEFINES/paygrade_defs/paygrade.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// Paygrade is equivalent to or is an enlisted position.
#define GRADE_ENLISTED 0
/// Paygrade is equivalent to or is an officer.
#define GRADE_OFFICER 1
/// Paygrade is for high command or senior leadership. Military flag officers.
#define GRADE_FLAG 2
38 changes: 38 additions & 0 deletions code/__DEFINES/paygrade_defs/twe.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Paygrade shorthand defines, to allow clearer designation.

// THREE WORLD EMPIRE
/// RMC1, Heitai-Marine
#define PAY_SHORT_RMC1 "RMC1"

/// RMC2, Santo-Lance Corporal
#define PAY_SHORT_RMC2 "RMC2"

/// RMC3, Nito-Corporal
#define PAY_SHORT_RMC3 "RMC3"

/// RMC4, Itto-Sergeant
#define PAY_SHORT_RMC4 "RMC4"

/// RNOW, Warrant Officer
#define PAY_SHORT_RNOW "RNOW"

/// RNO1, Second Lieutenant
#define PAY_SHORT_RNO1 "RNO1"

/// RNO2, First Lieutenant
#define PAY_SHORT_RNO2 "RNO2"

/// RNO3, Standing Officer
#define PAY_SHORT_RNO3 "RNO3"

/// RNO4, Captain
#define PAY_SHORT_RNO4 "RNO4"

/// RNO5, Admiral
#define PAY_SHORT_RNO5 "RNO5"

/// RNO6, Grand Admiral
#define PAY_SHORT_RNO6 "RNO6"

/// EMP, Emperor
#define PAY_SHORT_EMP "EMP"
48 changes: 47 additions & 1 deletion code/__DEFINES/paygrade_defs/weyland.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Paygrade shorthand defines, to allow clearer designation.

// Weyland Yutani
// Weyland Yutani Corporate
/// WYC1, Trainee
#define PAY_SHORT_WYC1 "WYC1"

Expand Down Expand Up @@ -30,3 +30,49 @@

/// WYC10, Director
#define PAY_SHORT_WYC10 "WYC10"

// Weyland Yutani Private Military
/// PMC-OP, Operator, standard PMC.
#define PAY_SHORT_PMC_OP "PMC-OP"

/// PMC-EN, Enforcer
#define PAY_SHORT_PMC_EN "PMC-EN"

/// PMC-SS, Support Specialist
#define PAY_SHORT_PMC_SS "PMC-SS"

/// PMC-MS, Medical Specialist
#define PAY_SHORT_PMC_MS "PMC-MS"

/// PMC-WS, Weapons Specialist
#define PAY_SHORT_PMC_WS "PMC-WS"

/// PMC-VS, Vehicle Specialist
#define PAY_SHORT_PMC_VS "PMC-VS"

/// PMC-XS, Xeno Specialist (Handler)
#define PAY_SHORT_PMC_XS "PMC-XS"

/// PMC-TL, Team Leader
#define PAY_SHORT_PMC_TL "PMC-TL"

/// PMC-DOC, Trauma Surgeon
#define PAY_SHORT_PMC_DOC "PMC-DOC"

/// PMC-ENG, Technician
#define PAY_SHORT_PMC_TEC "PMC-TEC"

/// PMC-ELR, Elite Responder
#define PAY_SHORT_PMC_ELR "PMC-ELR"

/// PMC-ELM, Elite Medic
#define PAY_SHORT_PMC_ELM "PMC-ELM"

/// PMC-ELG, Elite Gunner
#define PAY_SHORT_PMC_ELG "PMC-ELG"

/// PMC-ETL, Elite Team Leader
#define PAY_SHORT_PMC_ETL "PMC-ETL"

/// PMC-DIR, PMC Director
#define PAY_SHORT_PMC_DIR "PMC-DIR"
4 changes: 2 additions & 2 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@
//! ### SS initialization hints
/**
* Negative values incidate a failure or warning of some kind, positive are good.
* 0 and 1 are unused so that TRUE and FALSE are guarenteed to be invalid values.
* 0 and 1 are unused so that TRUE and FALSE are guaranteed to be invalid values.
*/

/// Subsystem failed to initialize entirely. Print a warning, log, and disable firing.
#define SS_INIT_FAILURE -2

/// The default return value which must be overriden. Will succeed with a warning.
/// The default return value which must be overridden. Will succeed with a warning.
#define SS_INIT_NONE -1

/// Subsystem initialized sucessfully.
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@
#define TRAIT_FOREIGN_BIO "t_foreign_bio"
/// Eye color changes on intent. (G1 Synths and WJs)
#define TRAIT_INTENT_EYES "t_intent_eyes"
/// Masked synthetic biology. Basic medHUDs will percieve the mob as human. (Infiltrator Synths)
/// Masked synthetic biology. Basic medHUDs will perceive the mob as human. (Infiltrator Synths)
#define TRAIT_INFILTRATOR_SYNTH "t_infiltrator_synth"
/// Makes it impossible to strip the inventory of this mob.
#define TRAIT_UNSTRIPPABLE "t_unstrippable"

// HIVE TRAITS
/// If the Hive is a Xenonid Hive
#define TRAIT_XENONID "t_xenonid"
/// If the Hive delays round end (this is overriden for some hives). Does not occur naturally. Must be applied in events.
/// If the Hive delays round end (this is overridden for some hives). Does not occur naturally. Must be applied in events.
#define TRAIT_NO_HIVE_DELAY "t_no_hive_delay"
/// If the Hive uses it's colors on the mobs. Does not occur naturally, excepting the Mutated hive.
#define TRAIT_NO_COLOR "t_no_color"
Expand Down
49 changes: 1 addition & 48 deletions code/__HELPERS/#maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
#define Lcm(a, b) (abs(a) / Gcd(a, b) * abs(b))

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

// secant
#define Sec(x) (1 / cos(x))
Expand Down Expand Up @@ -84,53 +84,6 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
return "[round((powerused * 0.000001),0.001)] MW"
return "[round((powerused * 0.000000001),0.0001)] GW"

/**
* Get a list of turfs in a line from `starting_atom` to `ending_atom`.
*
* Uses the ultra-fast [Bresenham Line-Drawing Algorithm](https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm).
*/
/proc/get_line(atom/starting_atom, atom/ending_atom)
var/current_x_step = starting_atom.x//start at x and y, then add 1 or -1 to these to get every turf from starting_atom to ending_atom
var/current_y_step = starting_atom.y
var/starting_z = starting_atom.z

var/list/line = list(get_turf(starting_atom))//get_turf(atom) is faster than locate(x, y, z)

var/x_distance = ending_atom.x - current_x_step //x distance
var/y_distance = ending_atom.y - current_y_step

var/abs_x_distance = abs(x_distance)//Absolute value of x distance
var/abs_y_distance = abs(y_distance)

var/x_distance_sign = SIGN(x_distance) //Sign of x distance (+ or -)
var/y_distance_sign = SIGN(y_distance)

var/x = abs_x_distance >> 1 //Counters for steps taken, setting to distance/2
var/y = abs_y_distance >> 1 //Bit-shifting makes me l33t. It also makes get_line() unnessecarrily fast.

if(abs_x_distance >= abs_y_distance) //x distance is greater than y
for(var/distance_counter in 0 to (abs_x_distance - 1))//It'll take abs_x_distance steps to get there
y += abs_y_distance

if(y >= abs_x_distance) //Every abs_y_distance steps, step once in y direction
y -= abs_x_distance
current_y_step += y_distance_sign

current_x_step += x_distance_sign //Step on in x direction
line += locate(current_x_step, current_y_step, starting_z)//Add the turf to the list
else
for(var/distance_counter in 0 to (abs_y_distance - 1))
x += abs_x_distance

if(x >= abs_y_distance)
x -= abs_y_distance
current_x_step += x_distance_sign

current_y_step += y_distance_sign
line += locate(current_x_step, current_y_step, starting_z)
return line


///chances are 1:value. anyprob(1) will always return true
/proc/anyprob(value)
return (rand(1,value)==value)
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 = "#000000")
icon/Opaque(background = COLOR_BLACK)
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("#ffffff", ICON_SUBTRACT)
M.Blend(COLOR_WHITE, 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 "#FFFFFF"
if (!color) return COLOR_WHITE
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 = "#00FF00") //used for warden and queen healing
/mob/proc/flick_heal_overlay(time, color = COLOR_GREEN) //used for warden and queen healing
var/image/I = image('icons/mob/mob.dmi', src, "heal_overlay")
switch(icon_size)
if(48)
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/sorts/_Main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new())
var/count1 = 0 //# of times in a row that first run won
var/count2 = 0 // " " " " " " second run won

//do the straightfoward thin until one run starts winning consistently
//do the straightforward thin until one run starts winning consistently

do
//ASSERT(len1 > 1 && len2 > 0)
Expand Down Expand Up @@ -493,7 +493,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new())
var/count1 = 0 //# of times in a row that first run won
var/count2 = 0 // " " " " " " second run won

//do the straightfoward thing until one run starts winning consistently
//do the straightforward thing until one run starts winning consistently
do
//ASSERT(len1 > 0 && len2 > 1)
if(call(cmp)(fetchElement(L,cursor2), fetchElement(L,cursor1)) < 0)
Expand Down
Loading

0 comments on commit 48276f2

Please sign in to comment.