Skip to content

Commit

Permalink
Merge branch 'master' into SquadBriefings(ACTUAL)
Browse files Browse the repository at this point in the history
  • Loading branch information
Warfan1815 committed Sep 30, 2023
2 parents 51bc1a0 + 9d0e0aa commit fd5b748
Show file tree
Hide file tree
Showing 28 changed files with 1,458 additions and 1,455 deletions.
2 changes: 2 additions & 0 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@
if(sorted && length(candidates))
candidates = sort_list(candidates, GLOBAL_PROC_REF(cmp_obs_larvaqueuetime_asc))

GLOB.xeno_queue_candidate_count = length(candidates)

return candidates

/**
Expand Down
3 changes: 3 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ GLOBAL_VAR_INIT(time_offset, setup_offset())
/// Sets the offset 2 lines above.
/proc/setup_offset()
return rand(10 MINUTES, 24 HOURS)

/// The last count of possible candidates in the xeno larva queue (updated via get_alien_candidates)
GLOBAL_VAR(xeno_queue_candidate_count)
28 changes: 16 additions & 12 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,21 @@ Additional game mode variables.
else
available_xenos_non_ssd += cur_xeno

var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)))
if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE))
available_xenos |= "any buried larva"
LAZYADD(available_xenos["any buried larva"], hive)
else
var/larva_option = "buried larva ([hive])"
available_xenos += larva_option
available_xenos[larva_option] = list(hive)
// Only offer buried larva if there is no queue:
// This basically means this block of code will almost never execute, because we are instead relying on the hive cores/larva pops to handle their larva
// Technically this should be after a get_alien_candidates() call to be accurate, but we are intentionally trying to not call that proc as much as possible
if(GLOB.xeno_queue_candidate_count < 1)
var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)))
if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE))
available_xenos |= "any buried larva"
LAZYADD(available_xenos["any buried larva"], hive)
else
var/larva_option = "buried larva ([hive])"
available_xenos += larva_option
available_xenos[larva_option] = list(hive)

if(!available_xenos.len || (instant_join && !available_xenos_non_ssd.len))
if(!xeno_candidate.client || !xeno_candidate.client.prefs || !(xeno_candidate.client.prefs.be_special & BE_ALIEN_AFTER_DEATH))
Expand Down Expand Up @@ -446,7 +450,7 @@ Additional game mode variables.
to_chat(xeno_candidate, SPAN_WARNING("You cannot join if the xenomorph is dead."))
return FALSE

if(new_xeno.stat == UNCONSCIOUS)
if(new_xeno.health <= 0)
to_chat(xeno_candidate, SPAN_WARNING("You cannot join if the xenomorph is in critical condition or unconscious."))
return FALSE

Expand Down
13 changes: 7 additions & 6 deletions code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,25 +263,26 @@
linked_hive.hive_ui.update_burrowed_larva()
qdel(worm)

var/count_spawned = 0
var/spawning_larva = can_spawn_larva() && (last_larva_time + spawn_cooldown) < world.time
if(spawning_larva)
last_larva_time = world.time
if(spawning_larva || (last_larva_queue_time + spawn_cooldown * 4) < world.time)
last_larva_queue_time = world.time
var/list/players_with_xeno_pref = get_alien_candidates(linked_hive)
if(players_with_xeno_pref && players_with_xeno_pref.len)
if(length(players_with_xeno_pref))
if(spawning_larva && spawn_burrowed_larva(players_with_xeno_pref[1]))
// We were in spawning_larva mode and successfully spawned someone
message_alien_candidates(players_with_xeno_pref, dequeued = 1)
else
// Just time to update everyone their queue status (or the spawn failed)
message_alien_candidates(players_with_xeno_pref, dequeued = 0)
count_spawned = 1
// Update everyone's queue status
message_alien_candidates(players_with_xeno_pref, dequeued = count_spawned)

if(linked_hive.hijack_burrowed_surge && (last_surge_time + surge_cooldown) < world.time)
last_surge_time = world.time
linked_hive.stored_larva++
linked_hive.hijack_burrowed_left--
notify_ghosts(header = "Claim Xeno", message = "The Hive has gained another burrowed larva! Click to take it.", source = src, action = NOTIFY_JOIN_XENO, enter_link = "join_xeno")
if(GLOB.xeno_queue_candidate_count < 1 + count_spawned)
notify_ghosts(header = "Claim Xeno", message = "The Hive has gained another burrowed larva! Click to take it.", source = src, action = NOTIFY_JOIN_XENO, enter_link = "join_xeno")
if(surge_cooldown > 30 SECONDS) //mostly for sanity purposes
surge_cooldown = surge_cooldown - surge_incremental_reduction //ramps up over time
if(linked_hive.hijack_burrowed_left < 1)
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@

accepted_ammo = list(
/obj/item/ammo_magazine/rifle,
/obj/item/ammo_magazine/rifle/rubber,
/obj/item/ammo_magazine/rifle/extended,
/obj/item/ammo_magazine/rifle/ap,
/obj/item/ammo_magazine/rifle/incendiary,
Expand Down
Loading

0 comments on commit fd5b748

Please sign in to comment.