Skip to content

Commit

Permalink
roles in list
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcrystall committed Jun 28, 2024
1 parent 31e1ffb commit a4a9c82
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 415 deletions.
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/cryo_marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

sleep(5)
var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
if(leaders < cryo_squad.max_leaders && (!mind || (HAS_FLAG(human.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(human.client, JOB_SQUAD_LEADER, time_required_for_job))))
if(leaders < cryo_squad.roles_cap[JOB_SQUAD_LEADER] && (!mind || (HAS_FLAG(human.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(human.client, JOB_SQUAD_LEADER, time_required_for_job))))
leader = human
leaders++
human.client?.prefs.copy_all_to(human, JOB_SQUAD_LEADER, TRUE, TRUE)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emergency_calls/cryo_marines_heavy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

sleep(5)
var/datum/squad/marine/cryo/cryo_squad = GLOB.RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
if(leaders < cryo_squad.max_leaders && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job))
if(leaders < cryo_squad.roles_cap[JOB_SQUAD_LEADER] && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job))
leader = H
leaders++
arm_equipment(H, /datum/equipment_preset/uscm/leader_equipped/cryo, TRUE, TRUE)
Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ Additional game mode variables.
xeno_starting_num = clamp((GLOB.readied_players/CONFIG_GET(number/xeno_number_divider)), xeno_required_num, INFINITY) //(n, minimum, maximum)
surv_starting_num = clamp((GLOB.readied_players/CONFIG_GET(number/surv_number_divider)), 2, 8) //this doesnt run
marine_starting_num = GLOB.player_list.len - xeno_starting_num - surv_starting_num
for(var/datum/squad/sq in GLOB.RoleAuthority.squads)
if(sq)
sq.max_engineers = engi_slot_formula(marine_starting_num)
sq.max_medics = medic_slot_formula(marine_starting_num)
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[JOB_SQUAD_ENGI] = engi_slot_formula(marine_starting_num)
target_squad.roles_cap[JOB_SQUAD_MEDIC] = medic_slot_formula(marine_starting_num)

for(var/i in GLOB.RoleAuthority.roles_by_name)
var/datum/job/J = GLOB.RoleAuthority.roles_by_name[i]
Expand Down
12 changes: 6 additions & 6 deletions code/game/jobs/job/marine/squad/engineer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
entry_message_body = "You have the <a href='"+WIKI_PLACEHOLDER+"'>equipment and skill</a> to build fortifications, reroute power lines, and bunker down. Your squaddies will look to you when it comes to construction in the field of battle."

/datum/job/marine/engineer/set_spawn_positions(count)
for(var/datum/squad/sq in GLOB.RoleAuthority.squads)
if(sq)
sq.max_engineers = engi_slot_formula(count)
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[JOB_SQUAD_ENGI] = engi_slot_formula(count)

/datum/job/marine/engineer/get_total_positions(latejoin=0)
var/slots = engi_slot_formula(get_total_marines())
Expand All @@ -21,9 +21,9 @@
total_positions_so_far = slots

if(latejoin)
for(var/datum/squad/sq in GLOB.RoleAuthority.squads)
if(sq)
sq.max_engineers = slots
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[JOB_SQUAD_ENGI] = slots

return (slots*4)

Expand Down
12 changes: 6 additions & 6 deletions code/game/jobs/job/marine/squad/medic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>You tend the wounds of your squad mates</a> and make sure they are healthy and active. You may not be a fully-fledged doctor, but you stand between life and death when it matters."

/datum/job/marine/medic/set_spawn_positions(count)
for(var/datum/squad/sq in GLOB.RoleAuthority.squads)
if(sq)
sq.max_medics = medic_slot_formula(count)
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[JOB_SQUAD_MEDIC] = medic_slot_formula(count)

/datum/job/marine/medic/get_total_positions(latejoin=0)
var/slots = medic_slot_formula(get_total_marines())
Expand All @@ -21,9 +21,9 @@
total_positions_so_far = slots

if(latejoin)
for(var/datum/squad/sq in GLOB.RoleAuthority.squads)
if(sq)
sq.max_medics = slots
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[JOB_SQUAD_MEDIC] = slots

return (slots*4)

Expand Down
Loading

0 comments on commit a4a9c82

Please sign in to comment.