From c0caa87164bbd53c00837259656380b5f48ca231 Mon Sep 17 00:00:00 2001 From: morrowwolf Date: Tue, 21 Nov 2023 15:59:04 -0500 Subject: [PATCH] Mess tech scaling (#4983) # About the pull request This PR adds scaling to allow for an extra mess tech slot once there are 70 marines playing. This is a paid code request from a player. # Explain why it's good for the game Mess tech can be a lonely job and it can spice things up to have a partner in the culinary arts. # Testing Photographs and Procedure I spawned in as a mess tech. I then created 50 marines and checked if I could spawn in as a mess tech. As expected the answer was no. I then creates 20 more marines and checked if I could spawn in as a mess tech and could. # Changelog :cl: Morrow add: Mess tech positions now scale from 1 to 2 after 70 marines are in the game /:cl: --------- Co-authored-by: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> --- .../jobs/job/civilians/other/mess_seargent.dm | 20 ++++++++++++++++++- code/game/jobs/slot_scaling.dm | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/code/game/jobs/job/civilians/other/mess_seargent.dm b/code/game/jobs/job/civilians/other/mess_seargent.dm index 97578eb1159d..fb4f5ee14d7c 100644 --- a/code/game/jobs/job/civilians/other/mess_seargent.dm +++ b/code/game/jobs/job/civilians/other/mess_seargent.dm @@ -1,13 +1,31 @@ /datum/job/civilian/chef title = JOB_MESS_SERGEANT - total_positions = 1 + total_positions = 2 spawn_positions = 1 + allow_additional = TRUE + scaled = TRUE selection_class = "job_ot" flags_startup_parameters = ROLE_ADD_TO_DEFAULT supervisors = "the auxiliary support officer" gear_preset = /datum/equipment_preset/uscm_ship/chef entry_message_body = "Your job is to service the marines with excellent food, drinks and entertaining the shipside crew when needed. You have a lot of freedom and it is up to you, to decide what to do with it. Good luck!" +/datum/job/civilian/chef/set_spawn_positions(count) + spawn_positions = mess_sergeant_slot_formula(count) + +/datum/job/civilian/chef/get_total_positions(latejoin = FALSE) + var/positions = spawn_positions + if(latejoin) + positions = mess_sergeant_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 + /obj/effect/landmark/start/chef name = JOB_MESS_SERGEANT icon_state = "chef_spawn" diff --git a/code/game/jobs/slot_scaling.dm b/code/game/jobs/slot_scaling.dm index 7230f57eb745..2d444d06e5ab 100644 --- a/code/game/jobs/slot_scaling.dm +++ b/code/game/jobs/slot_scaling.dm @@ -50,3 +50,6 @@ /proc/working_joe_slot_formula(playercount) return job_slot_formula(playercount,30,1,3,6) + +/proc/mess_sergeant_slot_formula(playercount) + return job_slot_formula(playercount, 70, 1, 1, 2)