Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HvH automated UPP jobslots WIP EXPERIMENTAL PROP NOT WORKING! #7705

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/jobs/job/marine/squads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
faction = FACTION_UPP
radio_freq = UPP_FREQ
roles_cap = list(
JOB_UPP = null,
JOB_UPP_ENGI = 3,
JOB_UPP_MEDIC = 4,
JOB_UPP_SPECIALIST = 1,
Expand Down
194 changes: 183 additions & 11 deletions code/modules/gear_presets/upp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
scaled = FALSE
faction_menu = FACTION_UPP
minimum_playtime_as_job = 0
total_positions = 8
spawn_positions = 8
allow_additional = 1

gear_preset = /datum/equipment_preset/upp/soldier

Expand Down Expand Up @@ -99,10 +102,15 @@
minimap_icon = "upp_pvt"
paygrades = list(PAY_SHORT_UE1 = JOB_PLAYTIME_TIER_0, PAY_SHORT_UE2 = JOB_PLAYTIME_TIER_1)

/datum/job/antag/upp/rifleman/set_spawn_positions(count)
spawn_positions = max((floor(count * STANDARD_MARINE_TO_TOTAL_SPAWN_RATIO)), 8)

/datum/job/antag/upp/rifleman
title = JOB_UPP
flags_startup_parameters = ROLE_ADD_TO_SQUAD
gear_preset = /datum/equipment_preset/upp/soldier
total_positions = -1
spawn_positions = -1

/datum/equipment_preset/upp/soldier/dressed
name = "UPP Soldier"
Expand Down Expand Up @@ -292,7 +300,27 @@
title = JOB_UPP_MEDIC
gear_preset = /datum/equipment_preset/upp/medic
flags_startup_parameters = ROLE_ADD_TO_SQUAD
total_positions = 16
spawn_positions = 16
allow_additional = 1

/datum/job/antag/upp/cryo/medic/get_total_positions(latejoin=0)
var/slots = medic_slot_formula(get_total_marines())

if(slots <= total_positions_so_far)
slots = total_positions_so_far
else
total_positions_so_far = slots

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

/datum/job/antag/upp/cryo/medic/set_spawn_positions(count)
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[title] = medic_slot_formula(count)

/datum/equipment_preset/upp/medic
name = "UPP Medic (Cryo)"
Expand Down Expand Up @@ -486,10 +514,34 @@
)

//*****************************************************************************************************/

/datum/job/antag/upp/sapper
title = JOB_UPP_ENGI
gear_preset = /datum/equipment_preset/upp/sapper
flags_startup_parameters = ROLE_ADD_TO_SQUAD
total_positions = 12
spawn_positions = 12
allow_additional = 1

/datum/job/antag/upp/sapper/get_total_positions(latejoin=0)
var/slots = engi_slot_formula(get_total_marines())

if(slots <= total_positions_so_far)
slots = total_positions_so_far
else
total_positions_so_far = slots

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

return (slots*4)

/datum/job/antag/upp/sapper/set_spawn_positions(count)
for(var/datum/squad/target_squad in GLOB.RoleAuthority.squads)
if(target_squad)
target_squad.roles_cap[title] = engi_slot_formula(count)

/datum/equipment_preset/upp/sapper
name = "UPP Sapper (Cryo)"
Expand Down Expand Up @@ -802,6 +854,26 @@
title = JOB_UPP_SPECIALIST
gear_preset = /datum/equipment_preset/upp/machinegunner
flags_startup_parameters = ROLE_ADD_TO_SQUAD
total_positions = 4
spawn_positions = 4
allow_additional = 1
scaled = 1

/datum/job/antag/upp/machinegunner/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = spec_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/machinegunner/set_spawn_positions(count)
spawn_positions = spec_slot_formula(count)


/datum/equipment_preset/upp/machinegunner
name = "UPP Machinegunner (Cryo)"
Expand Down Expand Up @@ -947,6 +1019,8 @@
title = JOB_UPP_LEADER
gear_preset = /datum/equipment_preset/upp/leader
flags_startup_parameters = ROLE_ADD_TO_SQUAD
total_positions = 4
spawn_positions = 4

/datum/equipment_preset/upp/leader
name = "UPP Squad Leader (Cryo)"
Expand Down Expand Up @@ -1136,6 +1210,30 @@
// Support Roles //
//=================//

/datum/job/antag/upp/military_police
title = JOB_UPP_POLICE
gear_preset = /datum/equipment_preset/upp/military_police
selection_class = "job_mp"
total_positions = 5
spawn_positions = 5
allow_additional = 1
scaled = 1

/datum/job/antag/upp/military_police/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = mp_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/military_police/set_spawn_positions(count)
return mp_slot_formula(count)

/datum/equipment_preset/upp/military_police
name = "UPP Military Police (Cryo)"

Expand All @@ -1146,11 +1244,6 @@
minimap_icon = "upp_mp"
paygrades = list(PAY_SHORT_UE6 = JOB_PLAYTIME_TIER_0)

/datum/job/antag/upp/military_police
title = JOB_UPP_POLICE
gear_preset = /datum/equipment_preset/upp/military_police
selection_class = "job_mp"

/datum/equipment_preset/upp/military_police/load_gear(mob/living/carbon/human/new_human)
. = ..()
//uniform
Expand Down Expand Up @@ -1318,6 +1411,25 @@
title = JOB_UPP_LT_DOKTOR
selection_class = "job_cmo"
gear_preset = /datum/equipment_preset/upp/doctor
total_positions = 5
spawn_positions = 5
allow_additional = 1
scaled = 1

/datum/job/antag/upp/doctor/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = doc_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/doctor/set_spawn_positions(count)
spawn_positions = doc_slot_formula(count)

/datum/equipment_preset/upp/doctor
name = "UPP Doktor (Cryo)"
Expand Down Expand Up @@ -1488,7 +1600,25 @@
title = JOB_UPP_SUPPLY
selection_class = "job_ct"
gear_preset = /datum/equipment_preset/upp/supply
total_positions = 2
spawn_positions = 2
allow_additional = 1
scaled = 1

/datum/job/antag/upp/supply/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = ct_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/supply/set_spawn_positions(count)
return ct_slot_formula(count)

/datum/equipment_preset/upp/supply
name = "UPP Logistics Technician (Cryo)"
Expand Down Expand Up @@ -1593,6 +1723,31 @@
//====================//
// Field Officers //
//================//

/datum/job/antag/upp/officer //this is placeholder for stuff that is supposed to be the same for all officers
title = JOB_UPP_SRLT_OFFICER
selection_class = "job_command"
gear_preset = /datum/equipment_preset/upp/officer
total_positions = 4
spawn_positions = 4
allow_additional = 1
scaled = FALSE

/datum/job/antag/upp/officer/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = so_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/officer/set_spawn_positions(count)
return so_slot_formula(count)

/datum/equipment_preset/upp/officer
name = "UPP Mladshiy Leytenant (Cryo)"
flags = EQUIPMENT_PRESET_EXTRA
Expand All @@ -1604,11 +1759,6 @@
minimap_icon = "upp_lt"
paygrades = list(PAY_SHORT_UO1 = JOB_PLAYTIME_TIER_0)


/datum/job/antag/upp/officer //this is placeholder for stuff that is supposed to be the same for all officers
title = JOB_UPP_SRLT_OFFICER
selection_class = "job_command"

/datum/equipment_preset/upp/officer/load_gear(mob/living/carbon/human/new_human)
. = ..()
//face
Expand All @@ -1625,7 +1775,6 @@
name = "UPP Lieutenant"
flags = EQUIPMENT_PRESET_EXTRA


/datum/equipment_preset/upp/officer/dressed/load_gear(mob/living/carbon/human/new_human)
//back
new_human.equip_to_slot_or_del(new /obj/item/storage/backpack/lightpack/upp, WEAR_BACK)
Expand Down Expand Up @@ -1785,6 +1934,8 @@
/datum/job/antag/upp/officer/senior
title = JOB_UPP_SRLT_OFFICER
gear_preset = /datum/equipment_preset/upp/officer/senior
total_positions = 1
spawn_positions = 1

/datum/equipment_preset/upp/officer/senior
name = "UPP Starshiy Leytenant (Cryo)"
Expand Down Expand Up @@ -1943,6 +2094,8 @@
/datum/job/antag/upp/officer/kapitan
title = JOB_UPP_KPT_OFFICER
gear_preset = /datum/equipment_preset/upp/officer/kapitan
total_positions = 1
spawn_positions = 1

/datum/equipment_preset/upp/officer/kapitan
name = "UPP Kapitan (Cryo)"
Expand Down Expand Up @@ -2316,6 +2469,8 @@
flags_whitelist = WHITELIST_COMMANDER_COUNCIL
title = JOB_UPP_LTKOL_OFFICER
gear_preset = /datum/equipment_preset/upp/officer/flag/podpolkovnik
total_positions = 1
spawn_positions = 1


/datum/equipment_preset/upp/officer/flag/podpolkovnik
Expand Down Expand Up @@ -2663,6 +2818,21 @@

flags_whitelist = WHITELIST_SYNTHETIC

/datum/job/antag/upp/synth/get_total_positions(latejoin = 0)
var/positions = spawn_positions
if(latejoin)
positions = synth_slot_formula(get_total_marines())
if(positions <= total_positions_so_far)
positions = total_positions_so_far
else
total_positions_so_far = positions
else
total_positions_so_far = positions
return positions

/datum/job/antag/upp/synth/set_spawn_positions(count)
spawn_positions = synth_slot_formula(count)

/datum/equipment_preset/upp/synth
name = "UPP Synthetic (Cryo)"

Expand Down Expand Up @@ -3642,6 +3812,8 @@
title = JOB_UPP_COMMISSAR
selection_class = "job_cl"
gear_preset = /datum/equipment_preset/upp/commissar
total_positions = 1
spawn_positions = 1

/datum/equipment_preset/upp/commissar
name = "UPP Political Commissar (Cryo)"
Expand Down
Loading