Skip to content

Commit

Permalink
Merge branch 'master' into night-vision-removal-from-sg-goggles
Browse files Browse the repository at this point in the history
  • Loading branch information
KoishiVibe committed Apr 5, 2024
2 parents b697c83 + d647f3b commit 9f7eb91
Show file tree
Hide file tree
Showing 56 changed files with 75,966 additions and 194 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ block( \
#define MAP_RUNTIME "USS Runtime"
#define MAP_LV522_CHANCES_CLAIM "LV-522 Chance's Claim" // Highpop Only
#define MAP_NEW_VARADERO "New Varadero"//ice colony underground but as its own map
#define MAP_NEW_VARADERO_REPAIRED "New Varadero Repaired"
#define MAP_CHINOOK "Chinook 91 GSO" //admin level
#define MAP_DERELICT_ALMAYER "Derelict Almayer"

Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/dropships.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
#define DROPSHIP_MIN_AUTO_DELAY 10 SECONDS
#define DROPSHIP_AUTO_RETRY_COOLDOWN 20 SECONDS
#define DROPSHIP_MEDEVAC_COOLDOWN 20 SECONDS

//Hatches states
#define SHUTTLE_DOOR_BROKEN -1
#define SHUTTLE_DOOR_UNLOCKED 0
#define SHUTTLE_DOOR_LOCKED 1
2 changes: 1 addition & 1 deletion code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define VEHICLE_PENALTY 25
#define WINDOW_FRAME_PENALTY 25
#define BARRICADE_PENALTY 50
#define WALL_PENALTY 50
#define WALL_PENALTY 100

/*
PROBABILITY CALCULATIONS ARE HERE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,19 @@
qdel(src)
return FALSE

if(locate(/obj/structure/mineral_door/resin) in location)
qdel(src)
return FALSE

var/area/current_area = get_area(location)
if(!current_area.is_resin_allowed)
for(var/client/game_master in GLOB.game_masters)
to_chat(game_master, SPAN_XENOBOLDNOTICE("This area doesn't allow xenos to build here"))
to_chat(game_master, SPAN_XENOBOLDNOTICE("[current_area] doesn't allow xenos to build here"))

qdel(src)
return FALSE

if(distance > 10)
if(locate(/obj/structure/mineral_door/resin) in location)
qdel(src)
return FALSE

if(checked_xeno.current_target)
if(distance > 10)
return FALSE

if(!locate(/datum/action/xeno_action/activable/secrete_resin) in checked_xeno.actions)
Expand All @@ -55,7 +52,7 @@
if(checked_xeno.get_plasma_percentage() < PLASMA_RETREAT_PERCENTAGE)
var/turf/xeno_loc = get_turf(checked_xeno)
if(xeno_loc.weeds)
checked_xeno.set_resting(TRUE, FALSE, TRUE)
checked_xeno.set_resting(TRUE, FALSE)

return FALSE

Expand All @@ -75,19 +72,21 @@
var/turf/parent_turf = get_turf(parent)
var/distance = get_dist(processing_xeno, parent)

var/list/turfs_around = xeno_loc.AdjacentTurfs()
if(turfs_around && distance < 1) // We are gonna be stuck after building at our loc, let's step away
return processing_xeno.move_to_next_turf(pick(turfs_around))

var/is_diagonal = (get_dir(processing_xeno, parent_turf) in diagonals)
if(is_diagonal || distance > 1)
/// Is xeno adjacent to parent_turf?
if(distance > 1)
return processing_xeno.move_to_next_turf(parent_turf)

/// Xeno will be stuck after building at its loc, if so - we command droney to step away
if(distance < 1)
return processing_xeno.move_to_next_turf(pick(GLOB.cardinals))

/// If there is something that might block our resin - slash it
for(var/obj/structure/blocker in parent_turf.contents)
if(!blocker.unslashable && blocker.density || istype(blocker, /obj/structure/bed))
if(!blocker.unslashable && (blocker.density || istype(blocker, /obj/structure/bed)))
INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, do_click), blocker, "", list())
return TRUE

/// If no ground weeds present - command our xeno to plant one
if(!parent_turf.weeds)
var/datum/action/xeno_action/onclick/plant_weeds/weeds_action = locate() in processing_xeno.actions
INVOKE_ASYNC(weeds_action, TYPE_PROC_REF(/datum/action/xeno_action/onclick/plant_weeds, use_ability_wrapper))
Expand All @@ -96,24 +95,30 @@
var/list/resin_types = processing_xeno.resin_build_order
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_turf/wall) in resin_types

var/wall_nearby = FALSE
var/blocked_turfs = 0
for(var/turf/blocked_turf in orange(1, parent_turf) - parent_turf.AdjacentTurfs())
blocked_turfs++
/// Let's decide whenever we are building a door or naw
var/build_door = FALSE
for(var/turf/blocked_turf in RANGE_TURFS(1, parent_turf) - parent_turf)
var/direction = get_dir(parent_turf, blocked_turf)
if(direction in diagonals)
continue

if(get_dir(blocked_turf, parent_turf) in diagonals)
if(!blocked_turf.density)
continue

if(blocked_turf.density)
wall_nearby = TRUE
/// Checking for any opposite walls on angles 135, 180, 225 respectfully
for(var/opposite_dir in reverse_nearby_direction(direction))
var/turf/opposite_turf = get_step(parent_turf, opposite_dir)
if(opposite_turf.density)
build_door = TRUE
break

var/obj/effect/alien/weeds/turf_weeds = blocked_turf.weeds
if(turf_weeds && turf_weeds.secreting)
wall_nearby = TRUE // Something is being constructed nearby, let's bet this is a new resin wall
var/obj/effect/alien/weeds/opposite_weeds = opposite_turf.weeds
if(opposite_weeds && opposite_weeds.secreting)
/// Something is being constructed nearby, let's bet this is a new resin wall
build_door = TRUE

if(wall_nearby)
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs > 1))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types
if(build_door || prob(XENO_DOOR_BUILDING_CHANCE))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types

var/datum/action/xeno_action/activable/secrete_resin/build_action = locate() in processing_xeno.actions
INVOKE_ASYNC(build_action, TYPE_PROC_REF(/datum/action/xeno_action/activable/secrete_resin, use_ability_wrapper), parent_turf)
Expand Down
20 changes: 20 additions & 0 deletions code/datums/entities/player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player)
set waitfor=0
WAIT_DB_READY
load_player_data_info(get_player_from_key(ckey))
check_discord_link()

/client/proc/load_player_data_info(datum/entity/player/player)
if(ckey != player.ckey)
Expand All @@ -482,6 +483,25 @@ BSQL_PROTECT_DATUM(/datum/entity/player)
record_login_triplet(player.ckey, address, computer_id)
player_data.sync()

/client/proc/check_discord_link()
var/datum/view_record/discord_link/current_link = locate() in DB_VIEW(/datum/view_record/discord_link, DB_COMP("player_id", DB_EQUALS, player_data.id))

if(!current_link)

if(player_data.discord_link_id != null)
player_data.discord_link_id = null
player_data.save()
player_data.sync()

return

if(player_data.discord_link_id == current_link.id)
return

player_data.discord_link_id = current_link.id
player_data.save()
player_data.sync()

/datum/entity/player/proc/check_ban(computer_id, address, is_telemetry)
. = list()

Expand Down
14 changes: 0 additions & 14 deletions code/datums/skills/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ United States Colonial Marines
name = "Private"
//same as default

/datum/skills/pfc/crafty
name = "Crafty Private"
skills = list(
SKILL_CONSTRUCTION = SKILL_CONSTRUCTION_TRAINED,
SKILL_ENGINEER = SKILL_ENGINEER_TRAINED,
)

/datum/skills/combat_medic
name = "Combat Medic"
skills = list(
Expand All @@ -23,13 +16,6 @@ United States Colonial Marines
SKILL_JTAC = SKILL_JTAC_BEGINNER,
)

/datum/skills/combat_medic/crafty
name = "Crafty Combat Medic"
skills = list(
SKILL_CONSTRUCTION = SKILL_CONSTRUCTION_TRAINED,
SKILL_ENGINEER = SKILL_ENGINEER_TRAINED,
)

/datum/skills/combat_engineer
name = "Combat Engineer"
skills = list(
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/command/cic/staffofficer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ AddTimelock(/datum/job/command/bridge, list(
/datum/job/command/bridge/ai
total_positions = 1
spawn_positions = 1
prime_priority = TRUE

/datum/job/command/bridge/ai/set_spawn_positions(count)
return spawn_positions
Expand Down
3 changes: 3 additions & 0 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
/// If TRUE, this job will spawn w/ a cryo emergency kit during evac/red alert
var/gets_emergency_kit = TRUE

/// Whether or not linking your discord account can let you get prime priority for this role
var/prime_priority = FALSE

/datum/job/New()
. = ..()

Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/marine/squad/leader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ AddTimelock(/datum/job/marine/leader, list(
/datum/job/marine/leader/ai
total_positions = 1
spawn_positions = 1
prime_priority = TRUE

/datum/job/marine/leader/ai/upp
title = JOB_SQUAD_LEADER_UPP
Expand Down
68 changes: 40 additions & 28 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ var/global/datum/authority/branch/role/RoleAuthority
#define RETURN_TO_LOBBY 2

#define NEVER_PRIORITY 0
#define HIGH_PRIORITY 1
#define MED_PRIORITY 2
#define LOW_PRIORITY 3
#define PRIME_PRIORITY 1
#define HIGH_PRIORITY 2
#define MED_PRIORITY 3
#define LOW_PRIORITY 4

#define SHIPSIDE_ROLE_WEIGHT 0.25

Expand Down Expand Up @@ -245,37 +246,19 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
if(!length(roles_to_assign) || !length(unassigned_players))
return

log_debug("ASSIGNMENT: Starting prime priority assignments.")
for(var/mob/new_player/cycled_unassigned in shuffle(unassigned_players))
assign_role_to_player_by_priority(cycled_unassigned, roles_to_assign, unassigned_players, PRIME_PRIORITY)

log_debug("ASSIGNMENT: Starting regular priority assignments.")
for(var/mob/new_player/cycled_unassigned in shuffle(unassigned_players))
var/player_assigned_job = FALSE
log_debug("ASSIGNMENT: We have started assigning for [cycled_unassigned].")

for(var/priority in HIGH_PRIORITY to LOW_PRIORITY)
var/wanted_jobs_by_name = shuffle(cycled_unassigned.client?.prefs?.get_jobs_by_priority(priority))
log_debug("ASSIGNMENT: We have started cycled through priority [priority] for [cycled_unassigned].")

for(var/job_name in wanted_jobs_by_name)
log_debug("ASSIGNMENT: We are cycling through wanted jobs and are at [job_name] for [cycled_unassigned].")
if(job_name in roles_to_assign)
log_debug("ASSIGNMENT: We have found [job_name] in roles to assign for [cycled_unassigned].")
var/datum/job/actual_job = roles_to_assign[job_name]

if(assign_role(cycled_unassigned, actual_job))
log_debug("ASSIGNMENT: We have assigned [job_name] to [cycled_unassigned].")
unassigned_players -= cycled_unassigned

if(actual_job.spawn_positions != -1 && actual_job.current_positions >= actual_job.spawn_positions)
roles_to_assign -= job_name
log_debug("ASSIGNMENT: We have ran out of slots for [job_name] and it has been removed from roles to assign.")

player_assigned_job = TRUE
break

player_assigned_job = assign_role_to_player_by_priority(cycled_unassigned, roles_to_assign, unassigned_players, priority)
if(player_assigned_job)
log_debug("ASSIGNMENT: [cycled_unassigned] has been assigned a job and we are breaking.")
break

log_debug("ASSIGNMENT: [cycled_unassigned] did not get a job at priority [priority], moving to next priority level.")

if(!length(roles_to_assign))
log_debug("ASSIGNMENT: No more roles to assign, breaking.")
break
Expand Down Expand Up @@ -321,10 +304,39 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
log_debug("ASSIGNMENT: [cycled_unassigned] has opted for return to lobby alternate option.")
cycled_unassigned.ready = 0

log_debug("ASSIGNMENT: Assigning complete. Players unassigned: [length(unassigned_players)] Jobs unassigned: [length(roles_to_assign)]")
log_debug("ASSIGNMENT: Assignment complete. Players unassigned: [length(unassigned_players)] Jobs unassigned: [length(roles_to_assign)]")

return roles_to_assign

/datum/authority/branch/role/proc/assign_role_to_player_by_priority(mob/new_player/cycled_unassigned, list/roles_to_assign, list/unassigned_players, priority)
log_debug("ASSIGNMENT: We have started cycled through priority [priority] for [cycled_unassigned].")
var/wanted_jobs_by_name = shuffle(cycled_unassigned.client?.prefs?.get_jobs_by_priority(priority))
var/player_assigned_job = FALSE

for(var/job_name in wanted_jobs_by_name)
log_debug("ASSIGNMENT: We are cycling through wanted jobs and are at [job_name] for [cycled_unassigned].")
if(job_name in roles_to_assign)
log_debug("ASSIGNMENT: We have found [job_name] in roles to assign for [cycled_unassigned].")
var/datum/job/actual_job = roles_to_assign[job_name]

if(assign_role(cycled_unassigned, actual_job))
log_debug("ASSIGNMENT: We have assigned [job_name] to [cycled_unassigned].")
unassigned_players -= cycled_unassigned

if(actual_job.spawn_positions != -1 && actual_job.current_positions >= actual_job.spawn_positions)
roles_to_assign -= job_name
log_debug("ASSIGNMENT: We have ran out of slots for [job_name] and it has been removed from roles to assign.")

player_assigned_job = TRUE
break

if(player_assigned_job)
log_debug("ASSIGNMENT: [cycled_unassigned] has been assigned a job.")
return player_assigned_job

log_debug("ASSIGNMENT: [cycled_unassigned] did not get a job at priority [priority].")
return player_assigned_job

/**
* Calculate role balance weight for one person joining as that role. This weight is used
* when calculating the number of xenos both roundstart and burrowed larva they get for
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/door_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
if(is_mainship_level(z)) // on the almayer
return

shuttle.control_doors("lock", "all", force=FALSE)
shuttle.control_doors("force-lock", "all", force=FALSE)

/obj/structure/machinery/door_control/proc/handle_door()
for(var/obj/structure/machinery/door/airlock/D in range(range))
Expand Down
12 changes: 6 additions & 6 deletions code/game/machinery/doors/airlock_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)


/obj/structure/machinery/door/airlock/open(surpress_send)
/obj/structure/machinery/door/airlock/open(forced)
. = ..()
if(!surpress_send) send_status()
if(!forced)
send_status()


/obj/structure/machinery/door/airlock/close(surpress_send)
/obj/structure/machinery/door/airlock/close(forced)
. = ..()
if(!surpress_send) send_status()

if(!forced)
send_status()

/obj/structure/machinery/door/airlock/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
flick("door_deny", src)
return

/obj/structure/machinery/door/proc/open(forced=0)
/obj/structure/machinery/door/proc/open(forced)
if(!density)
return TRUE
if(operating || !loc)
Expand Down
Loading

0 comments on commit 9f7eb91

Please sign in to comment.