Skip to content

Commit

Permalink
Merge branch 'master' into facehugger-funny
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx authored Nov 4, 2023
2 parents 500ad3b + a6cc6f6 commit 1f52824
Show file tree
Hide file tree
Showing 46 changed files with 1,212 additions and 313 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/camera.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Networks
#define CAMERA_NET_ALMAYER "Almayer"
#define CAMERA_NET_GOLDEN_ARROW "Golden Arrow"
#define CAMERA_NET_CONTAINMENT "Containment"
#define CAMERA_NET_CONTAINMENT_HIDDEN "Containment Hidden"
#define CAMERA_NET_RESEARCH "Research"
#define CAMERA_NET_ALAMO "Alamo"
#define CAMERA_NET_NORMANDY "Normandy"
#define CAMERA_NET_MIDWAY "Midway"
#define CAMERA_NET_COLONY "Colony"
#define CAMERA_NET_ARES "ARES"

Expand Down
11 changes: 5 additions & 6 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,11 @@ var/global/list/job_command_roles = JOB_COMMAND_ROLES_LIST
#define JOB_PLAYTIME_TIER_4 (175 HOURS)

#define XENO_NO_AGE -1
#define XENO_YOUNG 0
#define XENO_NORMAL 1
#define XENO_MATURE 2
#define XENO_ELDER 3
#define XENO_ANCIENT 4
#define XENO_PRIME 5
#define XENO_NORMAL 0
#define XENO_MATURE 1
#define XENO_ELDER 2
#define XENO_ANCIENT 3
#define XENO_PRIME 4

/// For monthly time tracking
#define JOB_OBSERVER "Observer"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@
#define MOBILE_SHUTTLE_LIFEBOAT_STARBOARD "lifeboat-starboard"
#define MOBILE_SHUTTLE_VEHICLE_ELEVATOR "vehicle_elevator"

#define DROPSHIP_MIDWAY "dropship_midway"
#define DROPSHIP_ALAMO "dropship_alamo"
#define DROPSHIP_NORMANDY "dropship_normandy"

#define ALMAYER_DROPSHIP_LZ1 "almayer-hangar-lz1"
#define ALMAYER_DROPSHIP_LZ2 "almayer-hangar-lz2"

#define GOLDEN_ARROW_LZ "golden arrow lz"

#define DROPSHIP_FLYBY_ID "special_flight"
#define DROPSHIP_LZ1 "dropship-lz1"
#define DROPSHIP_LZ2 "dropship-lz2"
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@
#define SKILL_DOMESTIC_MAX 2

//multitile vehicle skills
//Can't drive
#define SKILL_VEHICLE_DEFAULT 0

#define SKILL_VEHICLE_DEFAULT 2
//Can drive small vehicles (truck)
#define SKILL_VEHICLE_SMALL 1
//Can drive large vehicles (apc, tank)
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define XENO_HITS_TO_DESTROY_WINDOW_FRAME 3
#define XENO_HITS_TO_DESTROY_R_WINDOW_FRAME 5
#define XENO_HITS_TO_DESTROY_BOLTED_DOOR 10
#define XENO_HITS_TO_DESTROY_DOOR 10
#define XENO_HITS_TO_DESTROY_WELDED_DOOR 15
#define XENO_HITS_TO_EXPOSE_WIRES_MIN 3
#define XENO_HITS_TO_EXPOSE_WIRES_MAX 4
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define DISTANCE_PENALTY 1
#define ASTAR_COST_FUNCTION(n) (abs(n.x - target.x)+abs(n.y - target.y))

#define OPEN_TURF_PENALTY 1
#define DOOR_PENALTY 3
#define OBJECT_PENALTY 20
#define HUMAN_PENALTY 4
Expand Down
15 changes: 0 additions & 15 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,6 @@ Administrative related.
/datum/config_entry/string/ooc_color_normal
config_entry_value = "#1c52f5"

/datum/config_entry/string/ooc_color_other
config_entry_value = "#2e78d9"

/datum/config_entry/string/ooc_color_mods
config_entry_value = "#ffbf00"

/datum/config_entry/string/ooc_color_debug
config_entry_value = "#6bd1b4"

/datum/config_entry/string/ooc_color_admin
config_entry_value = "#ff8000"

/datum/config_entry/string/ooc_color_default
config_entry_value = "#b82e00"

/datum/config_entry/flag/usewhitelist

/datum/config_entry/flag/usealienwhitelist
Expand Down
20 changes: 20 additions & 0 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,19 @@ SUBSYSTEM_DEF(minimaps)
blip.overlays += overlay

images_by_source[target] = blip

for(var/flag in bitfield2list(hud_flags))
minimaps_by_z["[zlevel]"].images_assoc["[flag]"][target] = blip
minimaps_by_z["[zlevel]"].images_raw["[flag]"] += blip

if(ismovableatom(target))
RegisterSignal(target, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_z_change))
blip.RegisterSignal(target, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/image, minimap_on_move))

if(isitem(target))
blip.RegisterSignal(target, COMSIG_ITEM_PICKUP, TYPE_PROC_REF(/image, minimap_on_pickup))
blip.RegisterSignal(target, COMSIG_ITEM_DROPPED, TYPE_PROC_REF(/image, minimap_on_drop))

removal_cbs[target] = CALLBACK(src, PROC_REF(removeimage), blip, target)
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(remove_marker))

Expand Down Expand Up @@ -299,6 +306,19 @@ SUBSYSTEM_DEF(minimaps)
pixel_x = MINIMAP_PIXEL_FROM_WORLD(source.x) + SSminimaps.minimaps_by_z["[source_z]"].x_offset
pixel_y = MINIMAP_PIXEL_FROM_WORLD(source.y) + SSminimaps.minimaps_by_z["[source_z]"].y_offset

/image/proc/minimap_on_pickup(obj/item/source, mob/user)
SIGNAL_HANDLER

RegisterSignal(user, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/image, minimap_on_move), override = TRUE)
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)

/image/proc/minimap_on_drop(obj/item/source, mob/user)
SIGNAL_HANDLER

if(recursive_holder_check(source, recursion_limit = 5) != user)
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
RegisterSignal(source, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/image, minimap_on_move))

/**
* Removes an atom and it's blip from the subsystem.
* Force has no effect on this proc, but is here because we are a COMSIG_PARENT_QDELETING handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
/datum/component/ai_behavior_override/attack
behavior_icon_state = "attack_order"

/datum/component/ai_behavior_override/attack/Destroy(force, silent, ...)
for(var/mob/living/carbon/xenomorph/assigned_xeno in currently_assigned)
assigned_xeno.current_target = null

. = ..()

/datum/component/ai_behavior_override/attack/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance)
. = ..()
if(!.)
Expand Down
1 change: 0 additions & 1 deletion code/datums/skills/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ United States Colonial Marines
SKILL_LEADERSHIP = SKILL_LEAD_EXPERT,
SKILL_MEDICAL = SKILL_MEDICAL_TRAINED,
SKILL_ENDURANCE = SKILL_ENDURANCE_TRAINED,
SKILL_VEHICLE = SKILL_VEHICLE_SMALL,
SKILL_JTAC = SKILL_JTAC_TRAINED,
SKILL_INTEL = SKILL_INTEL_TRAINED,
)
Expand Down
1 change: 1 addition & 0 deletions code/datums/supply_packs/black_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ black market prices are NOT based on real or in-universe costs. they are based o
crate_heat = 5

/obj/structure/largecrate/black_market
fill_from_loc = FALSE
/// Wipes points from objects inside to avoid infinite farming.
var/points_wipe = TRUE
//no special name so it can be hidden
Expand Down
12 changes: 11 additions & 1 deletion code/game/area/Sulaco.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,18 @@
name = "\improper Normandy Landing Zone"
icon_state = "away2"

/area/shuttle/midway
name = "\improper Dropship Midway"
icon_state = "shuttlered"
base_muffle = MUFFLE_HIGH
soundscape_interval = 30
is_landing_zone = TRUE
ceiling = CEILING_REINFORCED_METAL


/area/shuttle/midway/Enter(atom/movable/O, atom/oldloc)
if(istype(O, /obj/structure/barricade))
return FALSE
return TRUE


//DISTRESS SHUTTLES
Expand Down
141 changes: 43 additions & 98 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,55 +234,16 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
if(length(overwritten_roles_for_mode))
temp_roles_for_mode = overwritten_roles_for_mode

// Get balancing weight for the readied players.
// Squad marine roles have a weight of 1, and shipside roles have a lower weight of SHIPSIDE_ROLE_WEIGHT.
players_preassigned = assign_roles(temp_roles_for_mode.Copy(), unassigned_players.Copy(), TRUE)

// Even though we pass a copy of temp_roles_for_mode, job counters still change, so we reset them here.
for(var/title in temp_roles_for_mode)
var/datum/job/J = temp_roles_for_mode[title]
J.current_positions = 0

// Set up limits for other roles based on our balancing weight number.
// Set the xeno starting amount based on marines assigned
var/datum/job/antag/xenos/XJ = temp_roles_for_mode[JOB_XENOMORPH]
if(istype(XJ))
XJ.set_spawn_positions(players_preassigned)

// Limit the number of SQUAD MARINE roles players can roll initially
var/datum/job/SMJ = GET_MAPPED_ROLE(JOB_SQUAD_MARINE)
if(istype(SMJ))
SMJ.set_spawn_positions(players_preassigned)

// Set survivor starting amount based on marines assigned
var/datum/job/SJ = temp_roles_for_mode[JOB_SURVIVOR]
if(istype(SJ))
SJ.set_spawn_positions(players_preassigned)

var/datum/job/CO_surv_job = temp_roles_for_mode[JOB_CO_SURVIVOR]
if(istype(CO_surv_job))
CO_surv_job.set_spawn_positions(players_preassigned)

if(SSnightmare.get_scenario_value("predator_round"))
SSticker.mode.flags_round_type |= MODE_PREDATOR
// Set predators starting amount based on marines assigned
var/datum/job/PJ = temp_roles_for_mode[JOB_PREDATOR]
if(istype(PJ))
PJ.set_spawn_positions(players_preassigned)

// Assign the roles, this time for real, respecting limits we have established.
var/list/roles_left = assign_roles(temp_roles_for_mode, unassigned_players)

var/alternate_option_assigned = 0;
for(var/mob/new_player/M in unassigned_players)
switch(M.client.prefs.alternate_option)
if(GET_RANDOM_JOB)
roles_left = assign_random_role(M, roles_left) //We want to keep the list between assignments.
alternate_option_assigned++
if(BE_MARINE)
var/datum/job/marine_job = GET_MAPPED_ROLE(JOB_SQUAD_MARINE)
assign_role(M, marine_job) //Should always be available, in all game modes, as a candidate. Even if it may not be a marine.
alternate_option_assigned++
if(BE_XENOMORPH)
assign_role(M, temp_roles_for_mode[JOB_XENOMORPH])
if(RETURN_TO_LOBBY)
Expand All @@ -295,70 +256,54 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou

unassigned_players = null

// Now we take spare unfilled xeno slots and make them larva NEW
var/datum/hive_status/hive = GLOB.hive_datum[XENO_HIVE_NORMAL]
if(istype(hive) && istype(XJ))
hive.stored_larva += max(0, (XJ.total_positions - XJ.current_positions) \
+ (XJ.calculate_extra_spawn_positions(alternate_option_assigned)))

/*===============================================================*/

/**
* Assign roles to the players. Return roles that are still avialable.
* If count is true, return role balancing weight instead.
*/
/datum/authority/branch/role/proc/assign_roles(list/roles_for_mode, list/unassigned_players, count = FALSE)
var/list/roles_left = list()
var/assigned = 0
for(var/priority in HIGH_PRIORITY to LOW_PRIORITY)
// Assigning xenos first.
assigned += assign_initial_roles(priority, roles_for_mode & ROLES_XENO, unassigned_players)
// Assigning special roles second. (survivor, predator)
assigned += assign_initial_roles(priority, roles_for_mode & (ROLES_WHITELISTED|ROLES_SPECIAL), unassigned_players)
// Assigning command third.
assigned += assign_initial_roles(priority, roles_for_mode & ROLES_COMMAND, unassigned_players)
// Assigning the rest
var/rest_roles_for_mode = roles_for_mode - (roles_for_mode & ROLES_XENO) - (roles_for_mode & ROLES_COMMAND) - (roles_for_mode & (ROLES_WHITELISTED|ROLES_SPECIAL))
if(count)
assigned += assign_initial_roles(priority, rest_roles_for_mode, unassigned_players)
else
roles_left= assign_initial_roles(priority, rest_roles_for_mode, unassigned_players, FALSE)
if(count)
return assigned
return roles_left

/datum/authority/branch/role/proc/assign_initial_roles(priority, list/roles_to_iterate, list/unassigned_players, count = TRUE)
var/assigned = 0
if(!length(roles_to_iterate) || !length(unassigned_players))
/// Assign roles to the players. Return roles that are still available.
/datum/authority/branch/role/proc/assign_roles(list/roles_to_assign, list/unassigned_players)
if(!length(roles_to_assign) || !length(unassigned_players))
return

for(var/job in roles_to_iterate)
var/datum/job/J = roles_to_iterate[job]
if(!istype(J)) //Shouldn't happen, but who knows.
to_world(SPAN_DEBUG("Error setting up jobs, no job datum set for: [job]."))
log_debug("Error setting up jobs, no job datum set for: [job].")
continue
for(var/mob/new_player/cycled_unassigned in shuffle(unassigned_players))
var/player_assigned_job = FALSE
log_debug("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("We have started cycled through priority [priority] for [cycled_unassigned]")

for(var/job_name in wanted_jobs_by_name)
log_debug("We are cycling through wanted jobs and are at [job_name] for [cycled_unassigned]")
if(job_name in roles_to_assign)
log_debug("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("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("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("[cycled_unassigned] has been assigned a job and we are breaking")
break

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

if(!length(roles_to_assign))
log_debug("No more roles to assign, breaking")
break

if(!player_assigned_job)
log_debug("[cycled_unassigned] was unable to be assigned a job based on preferences and roles to assign. We still have roles to assign, continuing to next player")

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

var/role_weight = calculate_role_weight(J)
for(var/M in unassigned_players)
var/mob/new_player/NP = M
if(!(NP.client.prefs.get_job_priority(J.title) == priority))
continue //If they don't want the job. //TODO Change the name of the prefs proc?

if(assign_role(NP, J))
assigned += role_weight
unassigned_players -= NP
// -1 check is not strictly needed here, since standard marines are
// supposed to have an actual spawn_positions number at this point
if(J.spawn_positions != -1 && J.current_positions >= J.spawn_positions)
roles_to_iterate -= job //Remove the position, since we no longer need it.
break //Maximum position is reached?

if(!length(unassigned_players))
break //No players left to assign? Break.
if(count)
return assigned
return roles_to_iterate
return roles_to_assign

/**
* Calculate role balance weight for one person joining as that role. This weight is used
Expand Down
7 changes: 7 additions & 0 deletions code/game/machinery/camera/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
name = "ares core camera"
network = list(CAMERA_NET_ALMAYER, CAMERA_NET_ARES)

/obj/structure/machinery/camera/autoname/golden_arrow
name = "military-grade camera"
network = list(CAMERA_NET_GOLDEN_ARROW)

/obj/structure/machinery/camera/autoname/golden_arrow/midway
network = list(CAMERA_NET_GOLDEN_ARROW, CAMERA_NET_MIDWAY)

//used by the landing camera dropship equipment. Do not place them right under where the dropship lands.
//Should place them near each corner of your LZs.
/obj/structure/machinery/camera/autoname/lz_camera
Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/computer/camera_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,8 @@
name = "\improper 'Normandy' camera controls"
network = list(CAMERA_NET_NORMANDY, CAMERA_NET_LASER_TARGETS)

/obj/structure/machinery/computer/cameras/dropship/midway
name = "\improper 'Midway' camera controls"
network = list(CAMERA_NET_MIDWAY, CAMERA_NET_LASER_TARGETS)

#undef DEFAULT_MAP_SIZE
Loading

0 comments on commit 1f52824

Please sign in to comment.