Skip to content

Commit

Permalink
Merge branch 'cmss13-devs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Waseemq1235 committed Aug 3, 2024
2 parents b21b147 + c76e42b commit 0701653
Show file tree
Hide file tree
Showing 333 changed files with 2,673 additions and 2,985 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define CAMERA_NET_CONTAINMENT "Containment"
#define CAMERA_NET_CONTAINMENT_HIDDEN "Containment Hidden"
#define CAMERA_NET_RESEARCH "Research"
#define CAMERA_NET_BRIG "Brig"
#define CAMERA_NET_ALAMO "Alamo"
#define CAMERA_NET_NORMANDY "Normandy"
#define CAMERA_NET_COLONY "Colony"
Expand Down
27 changes: 14 additions & 13 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,25 @@
#define GUN_TRIGGER_SAFETY (1<<1)
#define GUN_UNUSUAL_DESIGN (1<<2)
#define GUN_SILENCED (1<<3)
#define GUN_CANT_EXECUTE (1<<4)
///If checking for ammo with current.mag you have to check it against numerical values, as booleans will not trigger.
#define GUN_INTERNAL_MAG (1<<4)
#define GUN_AUTO_EJECTOR (1<<5)
#define GUN_AMMO_COUNTER (1<<6)
#define GUN_BURST_FIRING (1<<7)
#define GUN_FLASHLIGHT_ON (1<<8)
#define GUN_WY_RESTRICTED (1<<9)
#define GUN_SPECIALIST (1<<10)
#define GUN_WIELDED_FIRING_ONLY (1<<11)
#define GUN_INTERNAL_MAG (1<<5)
#define GUN_AUTO_EJECTOR (1<<6)
#define GUN_AMMO_COUNTER (1<<7)
#define GUN_BURST_FIRING (1<<8)
#define GUN_FLASHLIGHT_ON (1<<9)
#define GUN_WY_RESTRICTED (1<<10)
#define GUN_SPECIALIST (1<<11)
#define GUN_WIELDED_FIRING_ONLY (1<<12)
/// removes unwielded accuracy and scatter penalties (not recoil)
#define GUN_ONE_HAND_WIELDED (1<<12)
#define GUN_ANTIQUE (1<<13)
#define GUN_ONE_HAND_WIELDED (1<<13)
#define GUN_ANTIQUE (1<<14)
/// Whether the gun has been fired by its current user (reset upon `dropped()`)
#define GUN_RECOIL_BUILDUP (1<<14)
#define GUN_RECOIL_BUILDUP (1<<15)
/// support weapon, bipod will grant autofire
#define GUN_SUPPORT_PLATFORM (1<<15)
#define GUN_SUPPORT_PLATFORM (1<<16)
/// No gun description, only base desc
#define GUN_NO_DESCRIPTION (1<<16)
#define GUN_NO_DESCRIPTION (1<<17)
// NOTE: Don't add flags past 1<<23, it'll break things due to BYOND limitations. You can usually use a Component instead.

#define USES_STREAKS (1<<0)
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ GLOBAL_LIST_INIT(job_command_roles, JOB_COMMAND_ROLES_LIST)
#define JOB_XENOMORPH_QUEEN "Queen"

// For coloring the ranks in the statistics menu
#define JOB_PLAYTIME_TIER_0 (0 HOURS)
#define JOB_PLAYTIME_TIER_1 (10 HOURS)
#define JOB_PLAYTIME_TIER_2 (25 HOURS)
#define JOB_PLAYTIME_TIER_3 (70 HOURS)
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
#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
//#define DISFIGURED (1<<14) //unused
#define XENO_HOST (1<<15) //Tracks whether we're gonna be a baby alien's mummy.
#define IMMOBILE_ACTION (1<<16) // If you are performing an action that prevents you from being pushed by your own people.
#define PERMANENTLY_DEAD (1<<17)
Expand Down
9 changes: 5 additions & 4 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@

// engineer skill
#define SKILL_ENGINEER_DEFAULT 0
#define SKILL_ENGINEER_TRAINED 1 //barricade repair && c4 use (mini-engis, specs)
#define SKILL_ENGINEER_ENGI 2 //plasteel barricade deconstruction, hacking&&planet engine fixing&&apc building, Telecomms fixing (Combat Engi, OT, etc.)
#define SKILL_ENGINEER_MASTER 3 //Synths
#define SKILL_ENGINEER_MAX 3
#define SKILL_ENGINEER_NOVICE 1 //barricade repair && c4 use (mini-engis, specs)
#define SKILL_ENGINEER_TRAINED 2 //plasteel barricade deconstruction, hacking&&planet engine fixing&&apc building, Telecomms fixing (OT, etc.)
#define SKILL_ENGINEER_ENGI 3 // Slightly faster at everything (Combat Technicians)
#define SKILL_ENGINEER_MASTER 4 //Synths
#define SKILL_ENGINEER_MAX 4

//medical skill
#define SKILL_MEDICAL_DEFAULT 0
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
#define SS_INIT_NIGHTMARE 21.5
#define SS_INIT_TIMETRACK 21.1
#define SS_INIT_HUMANS 21
#define SS_INIT_WHO 20
#define SS_INIT_POWER 19
#define SS_INIT_INFLUXMCSTATS 12
#define SS_INIT_INFLUXSTATS 11
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "7.1.2"
#define TGS_DMAPI_VERSION "7.1.3"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down
18 changes: 12 additions & 6 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,23 @@
* You should only pass integers in.
*/
/proc/pick_weight(list/list_to_pick)
if(length(list_to_pick) == 0)
return null

var/total = 0
var/item
for(item in list_to_pick)
for(var/item in list_to_pick)
if(!list_to_pick[item])
list_to_pick[item] = 0
total += list_to_pick[item]

total = rand(0, total)
for(item in list_to_pick)
total -= list_to_pick[item]
if(total <= 0 && list_to_pick[item])
total = rand(1, total)
for(var/item in list_to_pick)
var/item_weight = list_to_pick[item]
if(item_weight == 0)
continue

total -= item_weight
if(total <= 0)
return item

return null
Expand Down
3 changes: 3 additions & 0 deletions code/__HELPERS/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ GLOBAL_LIST_INIT(cmp_field, "name")
/proc/cmp_typepaths_asc(A, B)
return sorttext("[B]","[A]")

/proc/cmp_typepaths_name_asc(atom/A, atom/B)
return sorttext(initial(A.name), initial(B.name))

/// Compares mobs based on their timeofdeath value in ascending order
/proc/cmp_mob_deathtime_asc(mob/A, mob/B)
return A.timeofdeath - B.timeofdeath
Expand Down
16 changes: 0 additions & 16 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,6 @@
result = first ^ second
return result

//Pretends to pick an element based on its weight but really just seems to pick a random element.
/proc/pickweight(list/L)
var/total = 0
var/item
for (item in L)
if (!L[item])
L[item] = 1
total += L[item]

total = rand(1, total)
for (item in L)
total -=L [item]
if (total <= 0)
return item
return null

/// Pick a random element from the list and remove it from the list.
/proc/pick_n_take(list/L)
RETURN_TYPE(L[_].type)
Expand Down
16 changes: 11 additions & 5 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1100,11 +1100,17 @@ GLOBAL_DATUM(action_purple_power_up, /image)
else
air_master.tiles_to_update += T2*/

/proc/get_cardinal_dir(atom/A, atom/B)
var/dx = abs(B.x - A.x)
var/dy = abs(B.y - A.y)
return get_dir(A, B) & (rand() * (dx+dy) < dy ? 3 : 12)

/// Returns the nearest cardinal dir between two atoms. Favors NORTH/SOUTH on perfect diagonals. Consistent and reversible.
/proc/get_cardinal_dir(atom/start, atom/end) as num
var/dx = end.x - start.x
var/dy = end.y - start.y
if(!(dx || dy))
return 0 //returns 0 when on same x/y, consistent with get_dir()

if(abs(dx) > abs(dy))
return dx < 0 ? WEST : EAST
else
return dy < 0 ? SOUTH : NORTH

//Returns the 2 dirs perpendicular to the arg
/proc/get_perpen_dir(dir)
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ DEFINE_BITFIELD(flags_gun_features, list(
"GUN_TRIGGER_SAFETY" = GUN_TRIGGER_SAFETY,
"GUN_UNUSUAL_DESIGN" = GUN_UNUSUAL_DESIGN,
"GUN_SILENCED" = GUN_SILENCED,
"GUN_CANT_EXECUTE" = GUN_CANT_EXECUTE,
"GUN_INTERNAL_MAG" = GUN_INTERNAL_MAG,
"GUN_AUTO_EJECTOR" = GUN_AUTO_EJECTOR,
"GUN_AMMO_COUNTER" = GUN_AMMO_COUNTER,
Expand Down Expand Up @@ -356,7 +357,6 @@ DEFINE_BITFIELD(status_flags, list(
"PASSEMOTES" = PASSEMOTES,
"GODMODE" = GODMODE,
"FAKEDEATH" = FAKEDEATH,
"DISFIGURED" = DISFIGURED,
"XENO_HOST" = XENO_HOST,
"IMMOBILE_ACTION" = IMMOBILE_ACTION,
"PERMANENTLY_DEAD" = PERMANENTLY_DEAD,
Expand Down
16 changes: 11 additions & 5 deletions code/controllers/subsystem/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ SUBSYSTEM_DEF(radio)
"[VAI_FREQ]" = "vairadio",
"[RMC_FREQ]" = "rmcradio",
"[CMB_FREQ]" = "cmbradio",
"[CLF_FREQ]" = "clfradio",
"[ALPHA_FREQ]" = "alpharadio",
"[BRAVO_FREQ]" = "bravoradio",
"[CHARLIE_FREQ]" = "charlieradio",
Expand All @@ -287,6 +286,17 @@ SUBSYSTEM_DEF(radio)
"[COLONY_FREQ]" = "deptradio",
"[BUG_A_FREQ]" = "airadio",
"[BUG_B_FREQ]" = "aiprivradio",
"[UPP_FREQ]" = "syndradio",
"[UPP_CMD_FREQ]" = "opforcmd",
"[UPP_ENGI_FREQ]" = "opforeng",
"[UPP_MED_FREQ]" = "opformed",
"[UPP_CCT_FREQ]" = "opforcct",
"[UPP_KDO_FREQ]" = "opforspe",
"[CLF_FREQ]" = "clfradio",
"[CLF_CMD_FREQ]" = "opforcmd",
"[CLF_ENGI_FREQ]" = "opforeng",
"[CLF_MED_FREQ]" = "opformed",
"[CLF_CCT_FREQ]" = "opforcct",
)

/datum/controller/subsystem/radio/proc/add_object(obj/device as obj, new_frequency as num, filter = null as text|null)
Expand Down Expand Up @@ -359,10 +369,6 @@ SUBSYSTEM_DEF(radio)
return freq_span
if(frequency in PMC_FREQS)
return "pmcradio"
if(frequency in UPP_FREQS)
return "syndradio"
if(frequency in CLF_FREQS)
return "clfradio"
if(frequency in ERT_FREQS)
return "centradio"
if(frequency in DEPT_FREQS)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/init/lobby_art.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ SUBSYSTEM_DEF(lobby_art)
/datum/controller/subsystem/lobby_art/Initialize()
var/list/lobby_arts = CONFIG_GET(str_list/lobby_art_images)
if(length(lobby_arts))
force_lobby_art(rand(1,length(lobby_arts)))
force_lobby_art(rand(1, length(lobby_arts)))
return SS_INIT_SUCCESS
2 changes: 1 addition & 1 deletion code/controllers/subsystem/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SUBSYSTEM_DEF(sound)
if(!run_hearers) // Initialize for handling next template
run_hearers = run_queue[run_template] // get base hearers
if(run_template.range) // ranging
run_hearers |= SSquadtree.players_in_range(SQUARE(run_template.x, run_template.y, run_template.range), run_template.z)
run_hearers |= SSquadtree.players_in_range(SQUARE(run_template.x, run_template.y, run_template.range * 2), run_template.z)
if(MC_TICK_CHECK)
return
while(length(run_hearers)) // Output sound to hearers
Expand Down
Loading

0 comments on commit 0701653

Please sign in to comment.