Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cmss13-devs/cmss13 into p…
Browse files Browse the repository at this point in the history
…re_burst
  • Loading branch information
Blundir committed Aug 6, 2024
2 parents 325d385 + 91c6833 commit 05f4f31
Show file tree
Hide file tree
Showing 207 changed files with 2,233 additions and 1,414 deletions.
7 changes: 7 additions & 0 deletions code/__DEFINES/autowiki.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifdef AUTOWIKI
#define AUTOWIKI_SKIP(skip) autowiki_skip = skip
#define IS_AUTOWIKI_SKIP(datum) datum.autowiki_skip
#else
#define AUTOWIKI_SKIP(skip)
#define IS_AUTOWIKI_SKIP(datum) UNLINT(FALSE)
#endif
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
22 changes: 22 additions & 0 deletions code/__DEFINES/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@
#define SOUND_CHANNEL_LOBBY 1023
#define SOUND_CHANNEL_Z 1024


//default byond sound echo list index positions.
//ECHO_DIRECT and ECHO_ROOM are the only two that actually appear to do anything, and represent the dry and wet channels of the environment effects, respectively.
#define ECHO_DIRECT 1
#define ECHO_DIRECTHF 2
#define ECHO_ROOM 3
#define ECHO_ROOMHF 4
#define ECHO_OBSTRUCTION 5
#define ECHO_OBSTRUCTIONLFRATIO 6
#define ECHO_OCCLUSION 7
#define ECHO_OCCLUSIONLFRATIO 8
#define ECHO_OCCLUSIONROOMRATIO 9
#define ECHO_OCCLUSIONDIRECTRATIO 10
#define ECHO_EXCLUSION 11
#define ECHO_EXCLUSIONLFRATIO 12
#define ECHO_OUTSIDEVOLUMEHF 13
#define ECHO_DOPPLERFACTOR 14
#define ECHO_ROLLOFFFACTOR 15
#define ECHO_ROOMROLLOFFFACTOR 16
#define ECHO_AIRABSORPTIONFACTOR 17
#define ECHO_FLAGS 18

//default byond sound environments
#define SOUND_ENVIRONMENT_NONE -1
#define SOUND_ENVIRONMENT_GENERIC 0
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: 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
17 changes: 17 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ GLOBAL_LIST_INIT_TYPED(chemical_gen_classes_list, /list, list("C" = list(),"C1"
//properties generated in chemicals, helps to make sure the same property doesn't show up 10 times
GLOBAL_LIST_INIT_TYPED(generated_properties, /list, list("positive" = list(), "negative" = list(), "neutral" = list()))

GLOBAL_LIST_INIT_TYPED(space_weapons, /datum/space_weapon, setup_ship_weapon())
GLOBAL_LIST_INIT_TYPED(space_weapons_ammo, /datum/space_weapon_ammo, setup_ship_ammo())

GLOBAL_LIST_INIT_TYPED(ammo_list, /datum/ammo, setup_ammo()) //List of all ammo types. Used by guns to tell the projectile how to act.
GLOBAL_REFERENCE_LIST_INDEXED(joblist, /datum/job, title) //List of all jobstypes, minus borg and AI

Expand Down Expand Up @@ -348,6 +351,20 @@ GLOBAL_LIST_INIT(hj_emotes, setup_hazard_joe_emotes())
all_species[S.name] = S
return all_species

/proc/setup_ship_weapon()
var/list/ammo_list = list()
for(var/weapon_type in subtypesof(/datum/space_weapon))
var/datum/space_weapon/new_weapon = new weapon_type
ammo_list[new_weapon.type] = new_weapon
return ammo_list

/proc/setup_ship_ammo()
var/list/ammo_list = list()
for(var/ammo_type in subtypesof(/datum/space_weapon_ammo))
var/datum/space_weapon_ammo/new_ammo = new ammo_type
ammo_list[new_ammo.type] = new_ammo
return ammo_list

/proc/setup_ammo()
var/list/blacklist = list(/datum/ammo/energy, /datum/ammo/energy/yautja, /datum/ammo/energy/yautja/rifle, /datum/ammo/bullet/shotgun, /datum/ammo/xeno)
var/list/ammo_list = list()
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: 2 additions & 0 deletions code/datums/agents/tools/decoy.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/obj/item/explosive/grenade/decoy
AUTOWIKI_SKIP(TRUE)

name = "decoy grenade"
desc = "A grenade typically used to distract the enemy. Emits a loud bang. Detonates in 5 seconds. Has 3 uses"

Expand Down
4 changes: 4 additions & 0 deletions code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@
living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET)

/datum/ammo/proc/slowdown(mob/living/living_mob, obj/projectile/fired_projectile)
if(isxeno(living_mob))
var/mob/living/carbon/xenomorph/xeno = living_mob
if(xeno.caste.tier > 2 || (xeno.caste.tier == 0 && xeno.mob_size >= MOB_SIZE_BIG))
return //tier 3 and big tier 0 (like queen) are not affected
if(iscarbonsizexeno(living_mob))
var/mob/living/carbon/xenomorph/target = living_mob
target.apply_effect(1, SUPERSLOW)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/ammo/bullet/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@
headshot_state = HEADSHOT_OVERLAY_MEDIUM
debilitate = list(0,0,0,0,0,0,0,2)

effective_range_max = 3
effective_range_max = 6
accuracy = HIT_ACCURACY_TIER_4
damage = 45
penetration= ARMOR_PENETRATION_TIER_6
shrapnel_chance = SHRAPNEL_CHANCE_TIER_2
damage_falloff = DAMAGE_FALLOFF_TIER_6 //"VP78 - the only pistol viable as a primary."-Vampmare, probably.
damage_falloff = DAMAGE_FALLOFF_TIER_6

/datum/ammo/bullet/pistol/squash/toxin
name = "toxic squash-head pistol bullet"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
record_general.fields["age"] = target.age
record_general.fields["p_stat"] = "Active"
record_general.fields["m_stat"] = "Stable"
record_general.fields["sex"] = target.gender
record_general.fields["sex"] = capitalize(target.gender)
record_general.fields["species"] = target.get_species()
record_general.fields["origin"] = target.origin
record_general.fields["faction"] = target.personal_faction
Expand Down
4 changes: 4 additions & 0 deletions code/datums/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
var/list/cached_vars
#endif

#ifdef AUTOWIKI
var/autowiki_skip = FALSE
#endif

/**
* Default implementation of clean-up code.
*
Expand Down
10 changes: 10 additions & 0 deletions code/datums/emergency_calls/cryo_spec.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
shuttle_id = ""
spawn_max_amount = TRUE

/datum/emergency_call/cryo_spec/remove_nonqualifiers(list/datum/mind/candidates_list)
var/list/datum/mind/candidates_clean = list()
for(var/datum/mind/single_candidate in candidates_list)
if(check_timelock(single_candidate.current?.client, JOB_SQUAD_ROLES_LIST, time_required_for_job))
candidates_clean.Add(single_candidate)
continue
if(single_candidate.current)
to_chat(single_candidate.current, SPAN_WARNING("You didn't qualify for the ERT beacon because you don't have the specialist job unlocked!"))
return candidates_clean

/datum/emergency_call/cryo_spec/create_member(datum/mind/mind, turf/override_spawn_loc)
set waitfor = FALSE
if(SSmapping.configs[GROUND_MAP].map_name == MAP_WHISKEY_OUTPOST)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,15 @@

addtimer(CALLBACK(src, TYPE_PROC_REF(/datum/emergency_call, spawn_candidates), quiet_launch, announce_incoming, override_spawn_loc), 30 SECONDS)

/datum/emergency_call/proc/remove_nonqualifiers(list/datum/mind/candidates_list)
return candidates_list //everyone gets selected on 99% of distress beacons.

/datum/emergency_call/proc/spawn_candidates(quiet_launch = FALSE, announce_incoming = TRUE, override_spawn_loc)
if(SSticker.mode)
SSticker.mode.picked_calls -= src

SEND_SIGNAL(src, COMSIG_ERT_SETUP)
candidates = remove_nonqualifiers(candidates)

if(length(candidates) < mob_min && !spawn_max_amount)
message_admins("Aborting distress beacon, not enough candidates: found [length(candidates)].")
Expand Down
11 changes: 10 additions & 1 deletion code/datums/emergency_calls/inspection.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//USCM Provost
/datum/emergency_call/inspection_provost
name = "Inspection - USCM Provost - ML knowledge required."
name = "Inspection - USCM Provost - ML knowledge and MP playtime required."
mob_max = 2
mob_min = 1
probability = 0
Expand All @@ -9,6 +9,15 @@
..()
objectives = "Investigate any issues with ML enforcement on the [MAIN_SHIP_NAME]."

/datum/emergency_call/inspection_provost/remove_nonqualifiers(list/datum/mind/candidates_list)
var/list/datum/mind/candidates_clean = list()
for(var/datum/mind/single_candidate in candidates_list)
if(check_timelock(single_candidate.current?.client, JOB_POLICE, time_required_for_job))
candidates_clean.Add(single_candidate)
continue
if(single_candidate.current)
to_chat(single_candidate.current, SPAN_WARNING("You didn't qualify for the ERT beacon because you don't have enough playtime (5 Hours) as military police!"))
return candidates_clean

/datum/emergency_call/inspection_provost/create_member(datum/mind/M, turf/override_spawn_loc)
var/turf/T = override_spawn_loc ? override_spawn_loc : get_spawn_point()
Expand Down
21 changes: 21 additions & 0 deletions code/datums/looping_sounds/misc_sounds.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/datum/looping_sound/looping_launch_announcement_alarm
mid_sounds = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)
start_sound = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)

/datum/looping_sound/telephone/ring
start_sound = 'sound/machines/telephone/dial.ogg'
start_length = 3.2 SECONDS
mid_sounds = 'sound/machines/telephone/ring_outgoing.ogg'
mid_length = 2.1 SECONDS
volume = 10

/datum/looping_sound/telephone/busy
start_sound = 'sound/voice/callstation_unavailable.ogg'
start_length = 5.7 SECONDS
mid_sounds = 'sound/machines/telephone/phone_busy.ogg'
mid_length = 5 SECONDS
volume = 15

/datum/looping_sound/telephone/hangup
start_sound = 'sound/machines/telephone/remote_hangup.ogg'
start_length = 0.6 SECONDS
mid_sounds = 'sound/machines/telephone/phone_busy.ogg'
mid_length = 5 SECONDS
volume = 15
5 changes: 2 additions & 3 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
var/revive_enabled = stat == DEAD && check_tod() && is_revivable()
if(stat == DEAD)
revive_enabled = check_tod() && is_revivable()
var/datum/internal_organ/heart/heart = islist(internal_organs_by_name) ? internal_organs_by_name["heart"] : null

var/holder2_set = 0
if(hivenumber)
Expand Down Expand Up @@ -475,7 +474,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
holder3.icon_state = "huddead"
holder2_set = 1
else
if(heart && (heart.organ_status >= ORGAN_BROKEN && check_tod())) // broken heart icon
if(is_heart_broken()) // broken heart icon
holder.icon_state = "huddeadheart"
if(!holder2_set)
holder2.icon_state = "huddeadheart"
Expand Down Expand Up @@ -784,7 +783,7 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image)
// Vampire Execute HUD
/mob/living/carbon/human/proc/update_execute_hud()
var/image/execute_holder = hud_list[XENO_EXECUTE]

execute_holder.icon_state = "hudblank"
execute_holder.overlays.Cut()

Expand Down
Loading

0 comments on commit 05f4f31

Please sign in to comment.