From b642244894d2c17792b2666b3cada6deda6512b4 Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 16 Nov 2023 15:51:56 +0000 Subject: [PATCH 01/25] Adds latejoin scaling to vendors --- code/__DEFINES/vendors.dm | 3 + code/game/gamemodes/cm_initialize.dm | 35 +++++-- code/game/jobs/role_authority.dm | 2 + code/game/machinery/cryopod.dm | 7 +- code/game/machinery/vending/cm_vending.dm | 38 +++++++- .../vending/vendor_types/requisitions.dm | 96 +++++++++---------- .../vendor_types/squad_prep/squad_prep.dm | 33 +++---- .../vending/vendor_types/wo_vendors.dm | 2 +- code/game/supplyshuttle.dm | 6 +- .../admin/player_panel/actions/physical.dm | 4 +- code/modules/mob/new_player/new_player.dm | 5 +- 11 files changed, 147 insertions(+), 84 deletions(-) diff --git a/code/__DEFINES/vendors.dm b/code/__DEFINES/vendors.dm index 04ee5ffef2b6..998fba978496 100644 --- a/code/__DEFINES/vendors.dm +++ b/code/__DEFINES/vendors.dm @@ -67,3 +67,6 @@ //Whether or not to load ammo boxes depending on ammo loaded into the vendor //Only relevant in big vendors, like Requisitions or Squad Prep #define VEND_LOAD_AMMO_BOXES (1<<9) +/// Vendors with this flag will fill retroactively based on latejoining players, +/// and expect a scale multiplier instead of amount of items +#define VEND_STOCK_DYNAMIC (1<<10) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index effd3325f887..98edf02d678c 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -75,6 +75,12 @@ Additional game mode variables. var/list/monkey_types = list() //What type of monkeys do we spawn var/latejoin_tally = 0 //How many people latejoined Marines var/latejoin_larva_drop = LATEJOIN_MARINES_PER_LATEJOIN_LARVA //A larva will spawn in once the tally reaches this level. If set to 0, no latejoin larva drop + /// Amount of latejoin_tally already awarded as larvas + var/latejoin_larva_used = 0 + /// Multiplier to the amount of gear awarded so far - increases only + var/gear_scale = 1 + /// Roundstart gear scale to base off current gear_scale, for latejoin calculations + var/gear_scale_init = 1 //Role Authority set up. /// List of role titles to override to different roles when starting game @@ -903,23 +909,38 @@ Additional game mode variables. //We do NOT want to initilialize the gear before everyone is properly spawned in /datum/game_mode/proc/initialize_post_marine_gear_list() - var/scale = get_scaling_value() + init_gear_scale() //Set up attachment vendor contents related to Marine count for(var/i in GLOB.cm_vending_vendors) var/obj/structure/machinery/cm_vending/sorted/CVS = i - CVS.populate_product_list_and_boxes(scale) + CVS.populate_product_list_and_boxes(gear_scale) //Scale the amount of cargo points through a direct multiplier - supply_controller.points = round(supply_controller.points * scale) + supply_controller.points += round(supply_controller.points_scale * gear_scale) -/datum/game_mode/proc/get_scaling_value() +///Returns a multiplier to the amount of gear that is to be distributed roundstart, stored in [/datum/game_mode/var/gear_scale] +/datum/game_mode/proc/init_gear_scale() //We take the number of marine players, deduced from other lists, and then get a scale multiplier from it, to be used in arbitrary manners to distribute equipment - //This might count players who ready up but get kicked back to the lobby - var/marine_pop_size = length(GLOB.alive_human_list) + var/marine_pop_size = 0 + for(var/mob/living/carbon/human/human as anything in GLOB.alive_human_list) + if(human.faction == FACTION_USCM) + var/datum/job/job = GET_MAPPED_ROLE(human.job) + marine_pop_size += RoleAuthority.calculate_role_weight(job) //This gives a decimal value representing a scaling multiplier. Cannot go below 1 - return max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) + gear_scale = max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) + gear_scale_init = gear_scale + return gear_scale + +///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining marines in [/datum/game_mode/var/latejoin_tally] +/datum/game_mode/proc/update_gear_scale() + var/new_gear_scale = round(gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL) + if(new_gear_scale > gear_scale) + for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) + vendor.update_dynamic_stock(new_gear_scale) + supply_controller.points += round((new_gear_scale - gear_scale) * supply_controller.points_scale) + gear_scale = new_gear_scale // for the toolbox /datum/game_mode/proc/end_round_message() diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index dc9865f8d6e6..f33522abba8e 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -367,6 +367,8 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou * survivors and the number of roundstart Squad Rifleman slots. */ /datum/authority/branch/role/proc/calculate_role_weight(datum/job/J) + if(!J) + return 0 if(ROLES_MARINES.Find(J.title)) return 1 if(ROLES_XENO.Find(J.title)) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 86bb5f79a035..4d3444c1480a 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -321,13 +321,13 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li dept_console += A A.moveToNullspace() + var/datum/job/job = GET_MAPPED_ROLE(occupant.job) if(ishuman(occupant)) var/mob/living/carbon/human/H = occupant if(H.assigned_squad) var/datum/squad/S = H.assigned_squad S.forget_marine_in_squad(H) - var/datum/job/J = GET_MAPPED_ROLE(H.job) - if(istype(J, /datum/job/marine/specialist)) + if(istype(job, /datum/job/marine/specialist)) //we make the set this specialist took if any available again if(H.skills) var/set_name @@ -346,7 +346,8 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li if(set_name && !available_specialist_sets.Find(set_name)) available_specialist_sets += set_name - SSticker.mode.latejoin_tally-- //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for + //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for + SSticker.mode.latejoin_tally -= RoleAuthority.calculate_role_weight(job) //Handle job slot/tater cleanup. RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 70ef402ae4e0..e035fbd4358b 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -810,8 +810,11 @@ GLOBAL_LIST_EMPTY(vending_products) vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND show_points = FALSE - //this here is made to provide ability to restock vendors with different subtypes of same object, like handmade and manually filled ammo boxes. + ///this here is made to provide ability to restock vendors with different subtypes of same object, like handmade and manually filled ammo boxes. var/list/corresponding_types_list + ///If using [VEND_STOCK_DYNAMIC], assoc list of product entry to list of (product multiplier, awarded objects) - as seen in [/obj/structure/machinery/cm_vending/sorted/proc/populate_product_list] + ///This allows us to backtrack and refill the stocks when new players latejoin + var/list/list/dynamic_stock_multipliers /obj/structure/machinery/cm_vending/sorted/Initialize() . = ..() @@ -824,14 +827,41 @@ GLOBAL_LIST_EMPTY(vending_products) GLOB.cm_vending_vendors -= src return ..() -//this proc, well, populates product list based on roundstart amount of players +///this proc, well, populates product list based on roundstart amount of players /obj/structure/machinery/cm_vending/sorted/proc/populate_product_list_and_boxes(scale) - populate_product_list(scale) + if(vend_flags & VEND_STOCK_DYNAMIC) + populate_product_list(1.0) + dynamic_stock_multipliers = list() + for(var/list/vendspec in listed_products) + var/multiplier = vendspec[2] + if(multiplier > 0) + var/awarded = round(vendspec[2] * scale) // Starting amount + //Record the multiplier and how many have actually been given out + dynamic_stock_multipliers[vendspec] = list(vendspec[2], awarded) + vendspec[2] = awarded // Override starting amount + else + populate_product_list(scale) + if(vend_flags & VEND_LOAD_AMMO_BOXES) populate_ammo_boxes() return -//this proc, well, populates product list based on roundstart amount of players +///Updates the vendor stock when the [/datum/game_mode/var/marine_tally] has changed and we're using [VEND_STOCK_DYNAMIC] +///Assumes the scale can only increase!!! Don't take their items away! +/obj/structure/machinery/cm_vending/sorted/proc/update_dynamic_stock(new_scale) + if(!(vend_flags & VEND_STOCK_DYNAMIC)) + return + for(var/list/vendspec in dynamic_stock_multipliers) + var/list/metadata = dynamic_stock_multipliers[vendspec] + var/multiplier = metadata[1] // How much do we multiply scales by + var/previous_max_amount = metadata[2] // How many we would have total at old scale + var/projected_max_amount = round(new_scale * multiplier) // How much we would have had total now in total + if(projected_max_amount > previous_max_amount) + vendspec[2] += (projected_max_amount - previous_max_amount) // Add missing ones! + update_derived_ammo_and_boxes_on_add(vendspec) + +///this proc, well, populates product list based on roundstart amount of players +///do not rely on scale here if you use VEND_STOCK_DYNAMIC because it's already taken into account /obj/structure/machinery/cm_vending/sorted/proc/populate_product_list(scale) return diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index 93680fb93d2c..0ac7993ed6a9 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -8,7 +8,7 @@ icon_state = "req_guns" req_access = list(ACCESS_MARINE_CARGO) vendor_theme = VENDOR_THEME_USCM - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES | VEND_STOCK_DYNAMIC /obj/structure/machinery/cm_vending/sorted/cargo_guns/vend_fail() return @@ -35,7 +35,7 @@ list("SU-6 Smart Pistol", round(scale * 3), /obj/item/storage/box/guncase/smartpistol, VENDOR_ITEM_REGULAR), list("MOU-53 Shotgun", round(scale * 2), /obj/item/storage/box/guncase/mou53, VENDOR_ITEM_REGULAR), list("XM88 Heavy Rifle", round(scale * 3), /obj/item/storage/box/guncase/xm88, VENDOR_ITEM_REGULAR), - list("M41AE2 Heavy Pulse Rifle", round(scale * 2.5), /obj/item/storage/box/guncase/lmg, VENDOR_ITEM_REGULAR), + list("M41AE2 Heavy Pulse Rifle", 2.5, /obj/item/storage/box/guncase/lmg, VENDOR_ITEM_REGULAR), list("M41A Pulse Rifle MK1", round(scale * 3), /obj/item/storage/box/guncase/m41aMK1, VENDOR_ITEM_REGULAR), list("M56D Heavy Machine Gun", round(scale * 2), /obj/item/storage/box/guncase/m56d, VENDOR_ITEM_REGULAR), list("M2C Heavy Machine Gun", round(scale * 2), /obj/item/storage/box/guncase/m2c, VENDOR_ITEM_REGULAR), @@ -103,7 +103,7 @@ list("Flare Pouch (Full)", round(scale * 5), /obj/item/storage/pouch/flare/full, VENDOR_ITEM_REGULAR), list("Document Pouch", round(scale * 2), /obj/item/storage/pouch/document/small, VENDOR_ITEM_REGULAR), list("Sling Pouch", round(scale * 2), /obj/item/storage/pouch/sling, VENDOR_ITEM_REGULAR), - list("Machete Pouch (Full)", round(scale * 0.5), /obj/item/storage/pouch/machete/full, VENDOR_ITEM_REGULAR), + list("Machete Pouch (Full)", 0.5, /obj/item/storage/pouch/machete/full, VENDOR_ITEM_REGULAR), list("Bayonet Pouch", round(scale * 2), /obj/item/storage/pouch/bayonet, VENDOR_ITEM_REGULAR), list("Medium General Pouch", round(scale * 2), /obj/item/storage/pouch/general/medium, VENDOR_ITEM_REGULAR), list("Magazine Pouch", round(scale * 5), /obj/item/storage/pouch/magazine, VENDOR_ITEM_REGULAR), @@ -135,7 +135,7 @@ list("Sentry Gun Network Laptop", 4, /obj/item/device/sentry_computer, VENDOR_ITEM_REGULAR), list("JTAC Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/jtac, VENDOR_ITEM_REGULAR), list("Engineering Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/engineer, VENDOR_ITEM_REGULAR), - list("Powerloader Certification", round(scale * 0.1) + 1, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), + list("Powerloader Certification", 0.25, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), list("Spare PDT/L Battle Buddy Kit", round(scale * 4), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR), list("W-Y brand rechargeable mini-battery", round(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR) ) @@ -174,7 +174,7 @@ //Special cargo-specific vendor with vending offsets /obj/structure/machinery/cm_vending/sorted/cargo_guns/cargo - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES //We want to vend to turf not hand, since we are in requisitions + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES | VEND_STOCK_DYNAMIC //We want to vend to turf not hand, since we are in requisitions vend_dir = WEST vend_dir_whitelist = list(NORTH, SOUTH) @@ -194,7 +194,7 @@ icon_state = "req_ammo" req_access = list(ACCESS_MARINE_CARGO) vendor_theme = VENDOR_THEME_USCM - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES | VEND_STOCK_DYNAMIC vend_dir = WEST vend_dir_whitelist = list(SOUTHWEST, NORTHWEST) @@ -218,29 +218,29 @@ list("ARMOR-PIERCING AMMUNITION", -1, null, null), list("88 Mod 4 AP Magazine (9mm)", round(scale * 50), /obj/item/ammo_magazine/pistol/mod88, VENDOR_ITEM_REGULAR), - list("M4RA AP Magazine (10x24mm)", round(scale * 15.7), /obj/item/ammo_magazine/rifle/m4ra/ap, VENDOR_ITEM_REGULAR), - list("M39 AP Magazine (10x20mm)", round(scale * 11.9), /obj/item/ammo_magazine/smg/m39/ap, VENDOR_ITEM_REGULAR), - list("M41A MK2 AP Magazine (10x24mm)", round(scale * 10.5), /obj/item/ammo_magazine/rifle/ap, VENDOR_ITEM_REGULAR), + list("M4RA AP Magazine (10x24mm)", round(scale * 16), /obj/item/ammo_magazine/rifle/m4ra/ap, VENDOR_ITEM_REGULAR), + list("M39 AP Magazine (10x20mm)", round(scale * 12), /obj/item/ammo_magazine/smg/m39/ap, VENDOR_ITEM_REGULAR), + list("M41A MK2 AP Magazine (10x24mm)", round(scale * 10), /obj/item/ammo_magazine/rifle/ap, VENDOR_ITEM_REGULAR), list("M4A3 AP Magazine (9mm)", round(scale * 2), /obj/item/ammo_magazine/pistol/ap, VENDOR_ITEM_REGULAR), list("EXTENDED AMMUNITION", -1, null, null), - list("M39 Extended Magazine (10x20mm)", round(scale * 9.5) + 3, /obj/item/ammo_magazine/smg/m39/extended, VENDOR_ITEM_REGULAR), - list("M41A MK2 Extended Magazine (10x24mm)", round(scale * 8.1), /obj/item/ammo_magazine/rifle/extended, VENDOR_ITEM_REGULAR), + list("M39 Extended Magazine (10x20mm)", round(scale * 10), /obj/item/ammo_magazine/smg/m39/extended, VENDOR_ITEM_REGULAR), + list("M41A MK2 Extended Magazine (10x24mm)", round(scale * 8), /obj/item/ammo_magazine/rifle/extended, VENDOR_ITEM_REGULAR), list("SPECIAL AMMUNITION", -1, null, null), list("M56 Battery", 4, /obj/item/smartgun_battery, VENDOR_ITEM_REGULAR), list("M56 Smartgun Drum", 4, /obj/item/ammo_magazine/smartgun, VENDOR_ITEM_REGULAR), - list("M44 Heavy Speed Loader (.44)", round(scale * 10.5), /obj/item/ammo_magazine/revolver/heavy, VENDOR_ITEM_REGULAR), - list("M44 Marksman Speed Loader (.44)", round(scale * 5.7), /obj/item/ammo_magazine/revolver/marksman, VENDOR_ITEM_REGULAR), + list("M44 Heavy Speed Loader (.44)", 10, /obj/item/ammo_magazine/revolver/heavy, VENDOR_ITEM_REGULAR), + list("M44 Marksman Speed Loader (.44)", 6, /obj/item/ammo_magazine/revolver/marksman, VENDOR_ITEM_REGULAR), list("M4A3 HP Magazine (9mm)", round(scale * 2), /obj/item/ammo_magazine/pistol/hp, VENDOR_ITEM_REGULAR), list("M41AE2 Holo Target Rounds (10x24mm)", round(scale * 2), /obj/item/ammo_magazine/rifle/lmg/holo_target, VENDOR_ITEM_REGULAR), list("RESTRICTED FIREARM AMMUNITION", -1, null, null), - list("VP78 Magazine", round(scale * 11.2), /obj/item/ammo_magazine/pistol/vp78, VENDOR_ITEM_REGULAR), - list("SU-6 Smartpistol Magazine (.45)", round(scale * 12,8), /obj/item/ammo_magazine/pistol/smart, VENDOR_ITEM_REGULAR), + list("VP78 Magazine", 11, /obj/item/ammo_magazine/pistol/vp78, VENDOR_ITEM_REGULAR), + list("SU-6 Smartpistol Magazine (.45)", 13, /obj/item/ammo_magazine/pistol/smart, VENDOR_ITEM_REGULAR), list("M240 Incinerator Tank", round(scale * 3), /obj/item/ammo_magazine/flamer_tank, VENDOR_ITEM_REGULAR), list("M41AE2 Box Magazine (10x24mm)", round(scale * 3), /obj/item/ammo_magazine/rifle/lmg, VENDOR_ITEM_REGULAR), - list("M41A MK1 Magazine (10x24mm)", round(scale * 4.5), /obj/item/ammo_magazine/rifle/m41aMK1, VENDOR_ITEM_REGULAR), + list("M41A MK1 Magazine (10x24mm)", 4.5, /obj/item/ammo_magazine/rifle/m41aMK1, VENDOR_ITEM_REGULAR), list("M41A MK1 AP Magazine (10x24mm)", round(scale * 2), /obj/item/ammo_magazine/rifle/m41aMK1/ap, VENDOR_ITEM_REGULAR), list("M56D Drum Magazine", round(scale * 2), /obj/item/ammo_magazine/m56d, VENDOR_ITEM_REGULAR), list("M2C Box Magazine", round(scale * 2), /obj/item/ammo_magazine/m2c, VENDOR_ITEM_REGULAR), @@ -293,7 +293,7 @@ //Special cargo-specific vendor with vending offsets /obj/structure/machinery/cm_vending/sorted/cargo_ammo/cargo - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES //We want to vend to turf not hand, since we are in requisitions + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_LOAD_AMMO_BOXES | VEND_STOCK_DYNAMIC //We want to vend to turf not hand, since we are in requisitions //------------ATTACHMENTS VENDOR--------------- @@ -305,7 +305,7 @@ icon_state = "req_attach" vend_dir = WEST vend_dir_whitelist = list(SOUTHEAST, NORTHEAST) - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY //We want to vend to turf not hand, since we are in requisitions + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_STOCK_DYNAMIC //We want to vend to turf not hand, since we are in requisitions /obj/structure/machinery/cm_vending/sorted/attachments/vend_fail() return @@ -316,42 +316,42 @@ /obj/structure/machinery/cm_vending/sorted/attachments/populate_product_list(scale) listed_products = list( list("BARREL", -1, null, null), - list("Extended Barrel", round(scale * 6.5), /obj/item/attachable/extended_barrel, VENDOR_ITEM_REGULAR), - list("M5 Bayonet", round(scale * 10.5), /obj/item/attachable/bayonet, VENDOR_ITEM_REGULAR), - list("Recoil Compensator", round(scale * 6.5), /obj/item/attachable/compensator, VENDOR_ITEM_REGULAR), - list("Suppressor", round(scale * 6.5), /obj/item/attachable/suppressor, VENDOR_ITEM_REGULAR), + list("Extended Barrel", 6.5, /obj/item/attachable/extended_barrel, VENDOR_ITEM_REGULAR), + list("M5 Bayonet", 10.5, /obj/item/attachable/bayonet, VENDOR_ITEM_REGULAR), + list("Recoil Compensator", 6.5, /obj/item/attachable/compensator, VENDOR_ITEM_REGULAR), + list("Suppressor", 6.5, /obj/item/attachable/suppressor, VENDOR_ITEM_REGULAR), list("RAIL", -1, null, null), - list("B8 Smart-Scope", round(scale * 3.5), /obj/item/attachable/scope/mini_iff, VENDOR_ITEM_REGULAR), - list("Magnetic Harness", round(scale * 8.5), /obj/item/attachable/magnetic_harness, VENDOR_ITEM_REGULAR), - list("Rail Flashlight", round(scale * 10.5), /obj/item/attachable/flashlight, VENDOR_ITEM_REGULAR), - list("S4 2x Telescopic Mini-Scope", round(scale * 4.5), /obj/item/attachable/scope/mini, VENDOR_ITEM_REGULAR), - list("S5 Red-Dot Sight", round(scale * 9.5), /obj/item/attachable/reddot, VENDOR_ITEM_REGULAR), - list("S6 Reflex Sight", round(scale * 9.5), /obj/item/attachable/reflex, VENDOR_ITEM_REGULAR), - list("S8 4x Telescopic Scope", round(scale * 4.5), /obj/item/attachable/scope, VENDOR_ITEM_REGULAR), + list("B8 Smart-Scope", 3.5, /obj/item/attachable/scope/mini_iff, VENDOR_ITEM_REGULAR), + list("Magnetic Harness", 8.5, /obj/item/attachable/magnetic_harness, VENDOR_ITEM_REGULAR), + list("Rail Flashlight", 10.5, /obj/item/attachable/flashlight, VENDOR_ITEM_REGULAR), + list("S4 2x Telescopic Mini-Scope", 4.5, /obj/item/attachable/scope/mini, VENDOR_ITEM_REGULAR), + list("S5 Red-Dot Sight", 9.5, /obj/item/attachable/reddot, VENDOR_ITEM_REGULAR), + list("S6 Reflex Sight", 9.5, /obj/item/attachable/reflex, VENDOR_ITEM_REGULAR), + list("S8 4x Telescopic Scope", 4.5, /obj/item/attachable/scope, VENDOR_ITEM_REGULAR), list("UNDERBARREL", -1, null, null), - list("Angled Grip", round(scale * 6.5), /obj/item/attachable/angledgrip, VENDOR_ITEM_REGULAR), - list("Bipod", round(scale * 6.5), /obj/item/attachable/bipod, VENDOR_ITEM_REGULAR), - list("Burst Fire Assembly", round(scale * 4.5), /obj/item/attachable/burstfire_assembly, VENDOR_ITEM_REGULAR), - list("Gyroscopic Stabilizer", round(scale * 4.5), /obj/item/attachable/gyro, VENDOR_ITEM_REGULAR), - list("Laser Sight", round(scale * 9.5), /obj/item/attachable/lasersight, VENDOR_ITEM_REGULAR), - list("Mini Flamethrower", round(scale * 4.5), /obj/item/attachable/attached_gun/flamer, VENDOR_ITEM_REGULAR), - list("XM-VESG-1 Flamer Nozzle", round(scale * 4.5), /obj/item/attachable/attached_gun/flamer_nozzle, VENDOR_ITEM_REGULAR), - list("U7 Underbarrel Shotgun", round(scale * 4.5), /obj/item/attachable/attached_gun/shotgun, VENDOR_ITEM_REGULAR), - list("Underbarrel Extinguisher", round(scale * 4.5), /obj/item/attachable/attached_gun/extinguisher, VENDOR_ITEM_REGULAR), - list("Underbarrel Flashlight Grip", round(scale * 9.5), /obj/item/attachable/flashlight/grip, VENDOR_ITEM_REGULAR), - list("Underslung Grenade Launcher", round(scale * 9.5), /obj/item/attachable/attached_gun/grenade, VENDOR_ITEM_REGULAR), - list("Vertical Grip", round(scale * 9.5), /obj/item/attachable/verticalgrip, VENDOR_ITEM_REGULAR), + list("Angled Grip", 6.5, /obj/item/attachable/angledgrip, VENDOR_ITEM_REGULAR), + list("Bipod", 6.5, /obj/item/attachable/bipod, VENDOR_ITEM_REGULAR), + list("Burst Fire Assembly", 4.5, /obj/item/attachable/burstfire_assembly, VENDOR_ITEM_REGULAR), + list("Gyroscopic Stabilizer", 4.5, /obj/item/attachable/gyro, VENDOR_ITEM_REGULAR), + list("Laser Sight", 9.5, /obj/item/attachable/lasersight, VENDOR_ITEM_REGULAR), + list("Mini Flamethrower", 4.5, /obj/item/attachable/attached_gun/flamer, VENDOR_ITEM_REGULAR), + list("XM-VESG-1 Flamer Nozzle", 4.5, /obj/item/attachable/attached_gun/flamer_nozzle, VENDOR_ITEM_REGULAR), + list("U7 Underbarrel Shotgun", 4.5, /obj/item/attachable/attached_gun/shotgun, VENDOR_ITEM_REGULAR), + list("Underbarrel Extinguisher", 4.5, /obj/item/attachable/attached_gun/extinguisher, VENDOR_ITEM_REGULAR), + list("Underbarrel Flashlight Grip", 9.5, /obj/item/attachable/flashlight/grip, VENDOR_ITEM_REGULAR), + list("Underslung Grenade Launcher", 9.5, /obj/item/attachable/attached_gun/grenade, VENDOR_ITEM_REGULAR), + list("Vertical Grip", 9.5, /obj/item/attachable/verticalgrip, VENDOR_ITEM_REGULAR), list("STOCK", -1, null, null), - list("M37 Wooden Stock", round(scale * 4.5), /obj/item/attachable/stock/shotgun, VENDOR_ITEM_REGULAR), - list("M39 Arm Brace", round(scale * 4.5), /obj/item/attachable/stock/smg/collapsible/brace, VENDOR_ITEM_REGULAR), - list("M39 Folding Stock", round(scale * 4.5), /obj/item/attachable/stock/smg/collapsible, VENDOR_ITEM_REGULAR), - list("M39 Stock", round(scale * 4.5), /obj/item/attachable/stock/smg, VENDOR_ITEM_REGULAR), - list("M41A Solid Stock", round(scale * 4.5), /obj/item/attachable/stock/rifle, VENDOR_ITEM_REGULAR), - list("M41A Folding Stock", round(scale * 4.5), /obj/item/attachable/stock/rifle/collapsible, VENDOR_ITEM_REGULAR), - list("M44 Magnum Sharpshooter Stock", round(scale * 4.5), /obj/item/attachable/stock/revolver, VENDOR_ITEM_REGULAR) + list("M37 Wooden Stock", 4.5, /obj/item/attachable/stock/shotgun, VENDOR_ITEM_REGULAR), + list("M39 Arm Brace", 4.5, /obj/item/attachable/stock/smg/collapsible/brace, VENDOR_ITEM_REGULAR), + list("M39 Folding Stock", 4.5, /obj/item/attachable/stock/smg/collapsible, VENDOR_ITEM_REGULAR), + list("M39 Stock", 4.5, /obj/item/attachable/stock/smg, VENDOR_ITEM_REGULAR), + list("M41A Solid Stock", 4.5, /obj/item/attachable/stock/rifle, VENDOR_ITEM_REGULAR), + list("M41A Folding Stock", 4.5, /obj/item/attachable/stock/rifle/collapsible, VENDOR_ITEM_REGULAR), + list("M44 Magnum Sharpshooter Stock", 4.5, /obj/item/attachable/stock/revolver, VENDOR_ITEM_REGULAR) ) /obj/structure/machinery/cm_vending/sorted/attachments/blend diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index 94325b09e9eb..8b41b92f398b 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -63,6 +63,7 @@ req_one_access = list() listed_products = list() hackable = TRUE + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_STOCK_DYNAMIC /obj/structure/machinery/cm_vending/sorted/uniform_supply/squad_prep/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -78,11 +79,11 @@ list("M10 Pattern Marine Helmet", round(scale * 15), /obj/item/clothing/head/helmet/marine, VENDOR_ITEM_REGULAR), list("WEBBINGS", -1, null, null), - list("Brown Webbing Vest", round(scale * 1.25), /obj/item/clothing/accessory/storage/black_vest/brown_vest, VENDOR_ITEM_REGULAR), - list("Black Webbing Vest", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/black_vest, VENDOR_ITEM_REGULAR), + list("Brown Webbing Vest", 1, /obj/item/clothing/accessory/storage/black_vest/brown_vest, VENDOR_ITEM_REGULAR), + list("Black Webbing Vest", 1, /obj/item/clothing/accessory/storage/black_vest, VENDOR_ITEM_REGULAR), list("Webbing", round(scale * 2), /obj/item/clothing/accessory/storage/webbing, VENDOR_ITEM_REGULAR), - list("Drop Pouch", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR), - list("Shoulder Holster", round(max(1,(scale * 0.5))), /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR), + list("Drop Pouch", 0.5, /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR), + list("Shoulder Holster", 0.5, /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR), list("ARMOR", -1, null, null), list("M3 Pattern Carrier Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/carrier, VENDOR_ITEM_REGULAR), @@ -105,9 +106,9 @@ list("Shotgun Scabbard", round(scale * 5), /obj/item/storage/large_holster/m37, VENDOR_ITEM_REGULAR), list("RESTRICTED BACKPACKS", -1, null, null), - list("USCM Technician Welderpack", round(scale * 1.25), /obj/item/storage/backpack/marine/engineerpack, VENDOR_ITEM_REGULAR), + list("USCM Technician Welderpack", 1.25, /obj/item/storage/backpack/marine/engineerpack, VENDOR_ITEM_REGULAR), list("Technician Welder-Satchel", round(scale * 2), /obj/item/storage/backpack/marine/engineerpack/satchel, VENDOR_ITEM_REGULAR), - list("Radio Telephone Backpack", round(max(1,(scale * 0.5))), /obj/item/storage/backpack/marine/satchel/rto, VENDOR_ITEM_REGULAR), + list("Radio Telephone Backpack", 0.6, /obj/item/storage/backpack/marine/satchel/rto, VENDOR_ITEM_REGULAR), list("BELTS", -1, null, null), list("M276 Pattern Ammo Load Rig", round(scale * 15), /obj/item/storage/belt/marine, VENDOR_ITEM_REGULAR), @@ -134,12 +135,12 @@ list("Pistol Pouch", round(scale * 15), /obj/item/storage/pouch/pistol, VENDOR_ITEM_REGULAR), list("RESTRICTED POUCHES", -1, null, null, null), - list("Construction Pouch", round(scale * 1.25), /obj/item/storage/pouch/construction, VENDOR_ITEM_REGULAR), - list("Explosive Pouch", round(scale * 1.25), /obj/item/storage/pouch/explosive, VENDOR_ITEM_REGULAR), - list("First Responder Pouch (Empty)", round(scale * 2.5), /obj/item/storage/pouch/first_responder, VENDOR_ITEM_REGULAR), + list("Construction Pouch", 1.25, /obj/item/storage/pouch/construction, VENDOR_ITEM_REGULAR), + list("Explosive Pouch", 1.25, /obj/item/storage/pouch/explosive, VENDOR_ITEM_REGULAR), + list("First Responder Pouch (Empty)", 2.5, /obj/item/storage/pouch/first_responder, VENDOR_ITEM_REGULAR), list("Large Pistol Magazine Pouch", round(scale * 2), /obj/item/storage/pouch/magazine/pistol/large, VENDOR_ITEM_REGULAR), - list("Tools Pouch", round(scale * 1.25), /obj/item/storage/pouch/tools, VENDOR_ITEM_REGULAR), - list("Sling Pouch", round(scale * 1.25), /obj/item/storage/pouch/sling, VENDOR_ITEM_REGULAR), + list("Tools Pouch", 1.25, /obj/item/storage/pouch/tools, VENDOR_ITEM_REGULAR), + list("Sling Pouch", 1.25, /obj/item/storage/pouch/sling, VENDOR_ITEM_REGULAR), list("MASK", -1, null, null, null), list("Gas Mask", round(scale * 15), /obj/item/clothing/mask/gas, VENDOR_ITEM_REGULAR), @@ -213,7 +214,7 @@ req_access = list(ACCESS_MARINE_ALPHA) req_one_access = list(ACCESS_MARINE_LEADER, ACCESS_MARINE_SPECPREP, ACCESS_MARINE_RO) hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_STOCK_DYNAMIC vend_x_offset = 2 @@ -224,13 +225,13 @@ /obj/structure/machinery/cm_vending/sorted/cargo_ammo/squad/populate_product_list(scale) listed_products = list( list("ARMOR-PIERCING AMMUNITION", -1, null, null), - list("M4RA AP Magazine (10x24mm)", round(scale * 3.5), /obj/item/ammo_magazine/rifle/m4ra/ap, VENDOR_ITEM_REGULAR), + list("M4RA AP Magazine (10x24mm)", 3.5, /obj/item/ammo_magazine/rifle/m4ra/ap, VENDOR_ITEM_REGULAR), list("M39 AP Magazine (10x20mm)", round(scale * 3), /obj/item/ammo_magazine/smg/m39/ap, VENDOR_ITEM_REGULAR), list("M41A AP Magazine (10x24mm)", round(scale * 3), /obj/item/ammo_magazine/rifle/ap, VENDOR_ITEM_REGULAR), list("EXTENDED AMMUNITION", -1, null, null), - list("M39 Extended Magazine (10x20mm)", round(scale * 1.8), /obj/item/ammo_magazine/smg/m39/extended, VENDOR_ITEM_REGULAR), - list("M41A Extended Magazine (10x24mm)", round(scale * 1.9), /obj/item/ammo_magazine/rifle/extended, VENDOR_ITEM_REGULAR), + list("M39 Extended Magazine (10x20mm)", 1.8, /obj/item/ammo_magazine/smg/m39/extended, VENDOR_ITEM_REGULAR), + list("M41A Extended Magazine (10x24mm)", 1.9, /obj/item/ammo_magazine/rifle/extended, VENDOR_ITEM_REGULAR), list("SPECIAL AMMUNITION", -1, null, null), list("M56 Smartgun Drum", 1, /obj/item/ammo_magazine/smartgun, VENDOR_ITEM_REGULAR), @@ -259,7 +260,7 @@ vend_x_offset = 2 vend_y_offset = 1 - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_STOCK_DYNAMIC /obj/structure/machinery/cm_vending/sorted/cargo_guns/squad/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state diff --git a/code/game/machinery/vending/vendor_types/wo_vendors.dm b/code/game/machinery/vending/vendor_types/wo_vendors.dm index 557933754f07..46299ef19f4c 100644 --- a/code/game/machinery/vending/vendor_types/wo_vendors.dm +++ b/code/game/machinery/vending/vendor_types/wo_vendors.dm @@ -66,7 +66,7 @@ /obj/structure/machinery/cm_vending/sorted/cargo_guns/squad_prep/wo req_access = list() req_one_access = list() - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_LOAD_AMMO_BOXES | VEND_STOCK_DYNAMIC /obj/structure/machinery/cm_vending/sorted/cargo_guns/squad_prep/wo/populate_product_list(scale) listed_products = list( diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index cf7f81b2204f..12fb7d0dc5e1 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -369,8 +369,10 @@ var/datum/controller/supply/supply_controller = new() var/processing = 1 var/processing_interval = 300 var/iteration = 0 - //supply points - var/points = 120 + /// Current supply points + var/points = 0 + /// Multiplier to the amount of points awarded based on marine scale + var/points_scale = 120 var/points_per_process = 1.5 var/points_per_slip = 1 var/points_per_crate = 2 diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index a48f39e81a5e..71821d50beb2 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -70,6 +70,7 @@ /datum/player_action/cryo_human/act(client/user, mob/target, list/params) + var/datum/job/job = GET_MAPPED_ROLE(target.job) if(ishuman(target)) var/mob/living/carbon/human/H = target if(H.assigned_squad) @@ -95,7 +96,8 @@ S.forget_marine_in_squad(H) message_admins("[key_name_admin(user)] sent [key_name_admin(target)] ([H.job]) to cryogenics.") - SSticker.mode.latejoin_tally-- //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for + //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for + SSticker.mode.latejoin_tally -= RoleAuthority.calculate_role_weight(job) //Handle job slot/tater cleanup. RoleAuthority.free_role(RoleAuthority.roles_for_mode[target.job], TRUE) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index a6b654ba2da1..9cd3bb9927a6 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -255,14 +255,15 @@ GLOB.data_core.manifest_inject(character) SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn SSticker.mode.latejoin_tally += RoleAuthority.calculate_role_weight(player_rank) + SSticker.mode.update_gear_scale() for(var/datum/squad/sq in RoleAuthority.squads) if(sq) sq.max_engineers = engi_slot_formula(GLOB.clients.len) sq.max_medics = medic_slot_formula(GLOB.clients.len) - if(SSticker.mode.latejoin_larva_drop && SSticker.mode.latejoin_tally >= SSticker.mode.latejoin_larva_drop) - SSticker.mode.latejoin_tally -= SSticker.mode.latejoin_larva_drop + if(SSticker.mode.latejoin_larva_drop && SSticker.mode.latejoin_tally - SSticker.mode.latejoin_larva_used >= SSticker.mode.latejoin_larva_drop) + SSticker.mode.latejoin_larva_used += SSticker.mode.latejoin_larva_drop var/datum/hive_status/hive for(var/hivenumber in GLOB.hive_datum) hive = GLOB.hive_datum[hivenumber] From cd273c23bb57443eccdd46269856c493caa19228 Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 16 Nov 2023 16:26:54 +0000 Subject: [PATCH 02/25] fixes --- code/game/gamemodes/cm_initialize.dm | 2 +- code/game/machinery/vending/cm_vending.dm | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 98edf02d678c..ce868e98083a 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -935,7 +935,7 @@ Additional game mode variables. ///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining marines in [/datum/game_mode/var/latejoin_tally] /datum/game_mode/proc/update_gear_scale() - var/new_gear_scale = round(gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL) + var/new_gear_scale = gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL if(new_gear_scale > gear_scale) for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) vendor.update_dynamic_stock(new_gear_scale) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index e035fbd4358b..0b7090391a8b 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -854,14 +854,17 @@ GLOBAL_LIST_EMPTY(vending_products) for(var/list/vendspec in dynamic_stock_multipliers) var/list/metadata = dynamic_stock_multipliers[vendspec] var/multiplier = metadata[1] // How much do we multiply scales by - var/previous_max_amount = metadata[2] // How many we would have total at old scale + var/previous_max_amount = metadata[2] // How many we already handed out at old scale var/projected_max_amount = round(new_scale * multiplier) // How much we would have had total now in total - if(projected_max_amount > previous_max_amount) - vendspec[2] += (projected_max_amount - previous_max_amount) // Add missing ones! + var/amount_to_add = round(projected_max_amount - previous_max_amount) // Rounding just in case + if(amount_to_add > 0) + metadata[2] += amount_to_add + vendspec[2] += amount_to_add update_derived_ammo_and_boxes_on_add(vendspec) ///this proc, well, populates product list based on roundstart amount of players ///do not rely on scale here if you use VEND_STOCK_DYNAMIC because it's already taken into account +///this is here for historical reasons and should ONLY be called by populate_product_list_and_boxes if you want dynamic stocks and ammoboxes to work /obj/structure/machinery/cm_vending/sorted/proc/populate_product_list(scale) return From 4099d463e45ab9f2c8b994860041c7bbbcb9c964 Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 16 Nov 2023 16:30:47 +0000 Subject: [PATCH 03/25] fix OD linter oopsie --- code/game/gamemodes/cm_initialize.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index ce868e98083a..ee5628492aec 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -926,7 +926,7 @@ Additional game mode variables. for(var/mob/living/carbon/human/human as anything in GLOB.alive_human_list) if(human.faction == FACTION_USCM) var/datum/job/job = GET_MAPPED_ROLE(human.job) - marine_pop_size += RoleAuthority.calculate_role_weight(job) + marine_pop_size += RoleAuthority.calculate_role_weight(job) //This gives a decimal value representing a scaling multiplier. Cannot go below 1 gear_scale = max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) From d2084597ab5a1c8b22372eef3e6d520b9a70f29f Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 16 Nov 2023 23:15:16 +0000 Subject: [PATCH 04/25] reduce ASRS points --- code/game/supplyshuttle.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 12fb7d0dc5e1..8b96138ccd6e 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -372,7 +372,7 @@ var/datum/controller/supply/supply_controller = new() /// Current supply points var/points = 0 /// Multiplier to the amount of points awarded based on marine scale - var/points_scale = 120 + var/points_scale = 100 var/points_per_process = 1.5 var/points_per_slip = 1 var/points_per_crate = 2 From 22780426eb6a2f7dcc3bf2d828af379a23169bf8 Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 17 Nov 2023 00:21:44 +0000 Subject: [PATCH 05/25] further nerf reqs. :((( --- code/__DEFINES/mode.dm | 2 +- code/game/supplyshuttle.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 854da7a52b4c..ebfed5bc0131 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ //Number of marine players against which the Marine's gear scales -#define MARINE_GEAR_SCALING_NORMAL 30 +#define MARINE_GEAR_SCALING_NORMAL 40 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 8b96138ccd6e..3f5db7724744 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -372,7 +372,7 @@ var/datum/controller/supply/supply_controller = new() /// Current supply points var/points = 0 /// Multiplier to the amount of points awarded based on marine scale - var/points_scale = 100 + var/points_scale = 90 var/points_per_process = 1.5 var/points_per_slip = 1 var/points_per_crate = 2 From 05e636dd8ab54084abbc15c788b69adab3542791 Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 17 Nov 2023 00:35:16 +0000 Subject: [PATCH 06/25] unscrews ASRS buget. woops. --- code/game/supplyshuttle.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 3f5db7724744..12fb7d0dc5e1 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -372,7 +372,7 @@ var/datum/controller/supply/supply_controller = new() /// Current supply points var/points = 0 /// Multiplier to the amount of points awarded based on marine scale - var/points_scale = 90 + var/points_scale = 120 var/points_per_process = 1.5 var/points_per_slip = 1 var/points_per_crate = 2 From 922629462e86b3f8a8bd5c294749b90dcc7253dd Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 24 Nov 2023 16:29:48 +0000 Subject: [PATCH 07/25] buff powerloader cert apperance rate so it needs 66 players instead of 120 --- code/game/machinery/vending/vendor_types/requisitions.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index 0ac7993ed6a9..f93504bdc96b 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -135,7 +135,7 @@ list("Sentry Gun Network Laptop", 4, /obj/item/device/sentry_computer, VENDOR_ITEM_REGULAR), list("JTAC Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/jtac, VENDOR_ITEM_REGULAR), list("Engineering Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/engineer, VENDOR_ITEM_REGULAR), - list("Powerloader Certification", 0.25, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), + list("Powerloader Certification", 0.6, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), list("Spare PDT/L Battle Buddy Kit", round(scale * 4), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR), list("W-Y brand rechargeable mini-battery", round(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR) ) From 21c34ae461af354c756edcf208e94ddc4dbf4e06 Mon Sep 17 00:00:00 2001 From: Fira Date: Sun, 26 Nov 2023 21:29:11 +0000 Subject: [PATCH 08/25] nerf latejoin scaling to 60% --- code/__DEFINES/mode.dm | 4 +++- code/game/gamemodes/cm_initialize.dm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index b9dc9526f448..df7e73310bef 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -91,8 +91,10 @@ //================================================= -//Number of marine players against which the Marine's gear scales +/// Number of marine players against which the Marines' gear scales #define MARINE_GEAR_SCALING_NORMAL 40 +/// How much are the latejoins awarding in budget and stocks relative to normal value +#define MARINE_GEAR_SCALING_LATEJOIN 0.6 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 91dbdee91751..71feeed19870 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -946,7 +946,7 @@ Additional game mode variables. ///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining marines in [/datum/game_mode/var/latejoin_tally] /datum/game_mode/proc/update_gear_scale() - var/new_gear_scale = gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL + var/new_gear_scale = gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL * MARINE_GEAR_SCALING_LATEJOIN if(new_gear_scale > gear_scale) for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) vendor.update_dynamic_stock(new_gear_scale) From 3b0b252c5414121bdc85e0e1fe949c33372cd417 Mon Sep 17 00:00:00 2001 From: Fira Date: Mon, 27 Nov 2023 12:55:06 +0000 Subject: [PATCH 09/25] globbification fixes --- code/game/gamemodes/cm_initialize.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 71feeed19870..6f6f3d30156d 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -928,7 +928,7 @@ Additional game mode variables. CVS.populate_product_list_and_boxes(gear_scale) //Scale the amount of cargo points through a direct multiplier - supply_controller.points += round(GLOB.supply_controller.points_scale * gear_scale) + GLOB.supply_controller.points += round(GLOB.supply_controller.points_scale * gear_scale) ///Returns a multiplier to the amount of gear that is to be distributed roundstart, stored in [/datum/game_mode/var/gear_scale] /datum/game_mode/proc/init_gear_scale() @@ -937,7 +937,7 @@ Additional game mode variables. for(var/mob/living/carbon/human/human as anything in GLOB.alive_human_list) if(human.faction == FACTION_USCM) var/datum/job/job = GET_MAPPED_ROLE(human.job) - marine_pop_size += RoleAuthority.calculate_role_weight(job) + marine_pop_size += GLOB.RoleAuthority.calculate_role_weight(job) //This gives a decimal value representing a scaling multiplier. Cannot go below 1 gear_scale = max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) @@ -950,7 +950,7 @@ Additional game mode variables. if(new_gear_scale > gear_scale) for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) vendor.update_dynamic_stock(new_gear_scale) - supply_controller.points += round((new_gear_scale - gear_scale) * supply_controller.points_scale) + GLOB.supply_controller.points += round((new_gear_scale - gear_scale) * GLOB.supply_controller.points_scale) gear_scale = new_gear_scale // for the toolbox From fd7a1a8cf23236e8ac60e10a934e0fad343f5006 Mon Sep 17 00:00:00 2001 From: Fira Date: Mon, 27 Nov 2023 12:56:38 +0000 Subject: [PATCH 10/25] one more --- code/modules/admin/player_panel/actions/physical.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index 6a63063a33ab..63cd6c179ab9 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -97,7 +97,7 @@ message_admins("[key_name_admin(user)] sent [key_name_admin(target)] ([H.job]) to cryogenics.") //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for - SSticker.mode.latejoin_tally -= RoleAuthority.calculate_role_weight(job) + SSticker.mode.latejoin_tally -= GLOB.RoleAuthority.calculate_role_weight(job) //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GLOB.RoleAuthority.roles_for_mode[target.job], TRUE) From 9defeb73751697e42fddc39ee16bf1dc108dc5e4 Mon Sep 17 00:00:00 2001 From: Fira Date: Mon, 27 Nov 2023 16:03:52 +0000 Subject: [PATCH 11/25] missed one again.. --- code/game/machinery/cryopod.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 3d6550f313bc..67af837ff6db 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -347,7 +347,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li GLOB.available_specialist_sets += set_name //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for - SSticker.mode.latejoin_tally -= RoleAuthority.calculate_role_weight(job) + SSticker.mode.latejoin_tally -= GLOB.RoleAuthority.calculate_role_weight(job) //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) From 9e71b28a1d5783d1b5abb5e90b6fa2ed357d7fbb Mon Sep 17 00:00:00 2001 From: Fira Date: Tue, 28 Nov 2023 20:11:17 +0000 Subject: [PATCH 12/25] fixes prep attachies vendor scaling conflicted --- code/_globalvars/bitfields.dm | 2 + .../vendor_types/squad_prep/squad_prep.dm | 50 +++++++++---------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 541d1a05362d..d302191c67eb 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -467,6 +467,8 @@ DEFINE_BITFIELD(vend_flags, list( "VEND_INSTANCED_CATEGORY" = VEND_INSTANCED_CATEGORY, "VEND_FACTION_THEMES" = VEND_FACTION_THEMES, "VEND_USE_VENDOR_FLAGS" = VEND_USE_VENDOR_FLAGS, + "VEND_LOAD_AMMO_BOXES" = VEND_LOAD_AMMO_BOXES, + "VEND_STOCK_DYNAMIC" = VEND_STOCK_DYNAMIC )) DEFINE_BITFIELD(vehicle_flags, list( diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index 6cae07470446..510faa923db4 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -308,7 +308,7 @@ req_access = list(ACCESS_MARINE_ALPHA) req_one_access = list(ACCESS_MARINE_LEADER, ACCESS_MARINE_SPECPREP, ACCESS_MARINE_RO) hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND | VEND_STOCK_DYNAMIC vend_y_offset = 1 @@ -318,36 +318,36 @@ /obj/structure/machinery/cm_vending/sorted/attachments/squad/populate_product_list(scale) listed_products = list( list("BARREL", -1, null, null), - list("Extended Barrel", round(scale * 2.5), /obj/item/attachable/extended_barrel, VENDOR_ITEM_REGULAR), - list("Recoil Compensator", round(scale * 2.5), /obj/item/attachable/compensator, VENDOR_ITEM_REGULAR), - list("Suppressor", round(scale * 2.5), /obj/item/attachable/suppressor, VENDOR_ITEM_REGULAR), + list("Extended Barrel", 2.5, /obj/item/attachable/extended_barrel, VENDOR_ITEM_REGULAR), + list("Recoil Compensator", 2.5, /obj/item/attachable/compensator, VENDOR_ITEM_REGULAR), + list("Suppressor", 2.5, /obj/item/attachable/suppressor, VENDOR_ITEM_REGULAR), list("RAIL", -1, null, null), - list("B8 Smart-Scope", round(scale * 1.5), /obj/item/attachable/scope/mini_iff, VENDOR_ITEM_REGULAR), - list("Magnetic Harness", round(scale * 4), /obj/item/attachable/magnetic_harness, VENDOR_ITEM_REGULAR), - list("S4 2x Telescopic Mini-Scope", round(scale * 2), /obj/item/attachable/scope/mini, VENDOR_ITEM_REGULAR), - list("S5 Red-Dot Sight", round(scale * 3), /obj/item/attachable/reddot, VENDOR_ITEM_REGULAR), - list("S6 Reflex Sight", round(scale * 3), /obj/item/attachable/reflex, VENDOR_ITEM_REGULAR), - list("S8 4x Telescopic Scope", round(scale * 2), /obj/item/attachable/scope, VENDOR_ITEM_REGULAR), + list("B8 Smart-Scope", 1.5, /obj/item/attachable/scope/mini_iff, VENDOR_ITEM_REGULAR), + list("Magnetic Harness", 4, /obj/item/attachable/magnetic_harness, VENDOR_ITEM_REGULAR), + list("S4 2x Telescopic Mini-Scope", 2, /obj/item/attachable/scope/mini, VENDOR_ITEM_REGULAR), + list("S5 Red-Dot Sight", 3, /obj/item/attachable/reddot, VENDOR_ITEM_REGULAR), + list("S6 Reflex Sight", 3, /obj/item/attachable/reflex, VENDOR_ITEM_REGULAR), + list("S8 4x Telescopic Scope", 2, /obj/item/attachable/scope, VENDOR_ITEM_REGULAR), list("UNDERBARREL", -1, null, null), - list("Angled Grip", round(scale * 2.5), /obj/item/attachable/angledgrip, VENDOR_ITEM_REGULAR), - list("Bipod", round(scale * 2.5), /obj/item/attachable/bipod, VENDOR_ITEM_REGULAR), - list("Burst Fire Assembly", round(scale * 1.5), /obj/item/attachable/burstfire_assembly, VENDOR_ITEM_REGULAR), - list("Gyroscopic Stabilizer", round(scale * 1.5), /obj/item/attachable/gyro, VENDOR_ITEM_REGULAR), - list("Laser Sight", round(scale * 3), /obj/item/attachable/lasersight, VENDOR_ITEM_REGULAR), - list("Mini Flamethrower", round(scale * 1.5), /obj/item/attachable/attached_gun/flamer, VENDOR_ITEM_REGULAR), - list("XM-VESG-1 Flamer Nozzle", round(scale * 1.5), /obj/item/attachable/attached_gun/flamer_nozzle, VENDOR_ITEM_REGULAR), - list("U7 Underbarrel Shotgun", round(scale * 1.5), /obj/item/attachable/attached_gun/shotgun, VENDOR_ITEM_REGULAR), - list("Underbarrel Extinguisher", round(scale * 1.5), /obj/item/attachable/attached_gun/extinguisher, VENDOR_ITEM_REGULAR), - list("Vertical Grip", round(scale * 3), /obj/item/attachable/verticalgrip, VENDOR_ITEM_REGULAR), + list("Angled Grip", 2.5, /obj/item/attachable/angledgrip, VENDOR_ITEM_REGULAR), + list("Bipod", 2.5, /obj/item/attachable/bipod, VENDOR_ITEM_REGULAR), + list("Burst Fire Assembly", 1.5, /obj/item/attachable/burstfire_assembly, VENDOR_ITEM_REGULAR), + list("Gyroscopic Stabilizer", 1.5, /obj/item/attachable/gyro, VENDOR_ITEM_REGULAR), + list("Laser Sight", 3, /obj/item/attachable/lasersight, VENDOR_ITEM_REGULAR), + list("Mini Flamethrower", 1.5, /obj/item/attachable/attached_gun/flamer, VENDOR_ITEM_REGULAR), + list("XM-VESG-1 Flamer Nozzle", 1.5, /obj/item/attachable/attached_gun/flamer_nozzle, VENDOR_ITEM_REGULAR), + list("U7 Underbarrel Shotgun", 1.5, /obj/item/attachable/attached_gun/shotgun, VENDOR_ITEM_REGULAR), + list("Underbarrel Extinguisher", 1.5, /obj/item/attachable/attached_gun/extinguisher, VENDOR_ITEM_REGULAR), + list("Vertical Grip", 3, /obj/item/attachable/verticalgrip, VENDOR_ITEM_REGULAR), list("STOCK", -1, null, null), - list("M37 Wooden Stock", round(scale * 1.5), /obj/item/attachable/stock/shotgun, VENDOR_ITEM_REGULAR), - list("M39 Arm Brace", round(scale * 1.5), /obj/item/attachable/stock/smg/collapsible/brace, VENDOR_ITEM_REGULAR), - list("M39 Stock", round(scale * 1.5), /obj/item/attachable/stock/smg, VENDOR_ITEM_REGULAR), - list("M41A Solid Stock", round(scale * 1.5), /obj/item/attachable/stock/rifle, VENDOR_ITEM_REGULAR), - list("M44 Magnum Sharpshooter Stock", round(scale * 1.5), /obj/item/attachable/stock/revolver, VENDOR_ITEM_REGULAR) + list("M37 Wooden Stock", 1.5, /obj/item/attachable/stock/shotgun, VENDOR_ITEM_REGULAR), + list("M39 Arm Brace", 1.5, /obj/item/attachable/stock/smg/collapsible/brace, VENDOR_ITEM_REGULAR), + list("M39 Stock", 1.5, /obj/item/attachable/stock/smg, VENDOR_ITEM_REGULAR), + list("M41A Solid Stock", 1.5, /obj/item/attachable/stock/rifle, VENDOR_ITEM_REGULAR), + list("M44 Magnum Sharpshooter Stock", 1.5, /obj/item/attachable/stock/revolver, VENDOR_ITEM_REGULAR) ) //------------ESSENTIAL SETS--------------- From a62125d7cf2dfe8c2aafc9d9395e6d729e740efd Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 1 Dec 2023 12:18:57 +0000 Subject: [PATCH 13/25] DEBUG --- code/game/gamemodes/cm_initialize.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 6f6f3d30156d..06c143061fea 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -942,6 +942,8 @@ Additional game mode variables. //This gives a decimal value representing a scaling multiplier. Cannot go below 1 gear_scale = max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) gear_scale_init = gear_scale + log_debug("SUPPLY: Game start detected [marine_pop_size] weighted marines, resulting in gear_scale = [gear_scale]") + log_debug("SUPPLY: Previous supply calculation would have been [length(GLOB.alive_human_list)] alive humans, resulting in gear_scale = [length(GLOB.alive_human_list)/30]") // DEBUG REMOVE ME return gear_scale ///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining marines in [/datum/game_mode/var/latejoin_tally] From 1ddb7d6f0e8f98276589560f1c08bc34cc251411 Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 1 Dec 2023 16:16:05 +0000 Subject: [PATCH 14/25] buff roundstart due to bugfix nerfs --- code/__DEFINES/mode.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index df7e73310bef..1c62a49a8913 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,9 +92,9 @@ /// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 40 +#define MARINE_GEAR_SCALING_NORMAL 30 /// How much are the latejoins awarding in budget and stocks relative to normal value -#define MARINE_GEAR_SCALING_LATEJOIN 0.6 +#define MARINE_GEAR_SCALING_LATEJOIN 0.5 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From 71da1cfc6f645d9d2c9f0ee46f3cd45551abc234 Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 1 Dec 2023 22:49:52 +0000 Subject: [PATCH 15/25] iteration - diminishing latejoin returns by time --- code/__DEFINES/mode.dm | 4 +-- code/game/gamemodes/cm_initialize.dm | 36 ++++++++++++------- code/game/machinery/cryopod.dm | 2 +- .../vending/vendor_types/requisitions.dm | 2 +- .../vendor_types/squad_prep/squad_prep.dm | 6 ++-- .../admin/player_panel/actions/physical.dm | 2 +- code/modules/mob/new_player/new_player.dm | 2 +- 7 files changed, 31 insertions(+), 23 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 1c62a49a8913..e131d5bd8f5a 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,9 +92,7 @@ /// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 30 -/// How much are the latejoins awarding in budget and stocks relative to normal value -#define MARINE_GEAR_SCALING_LATEJOIN 0.5 +#define MARINE_GEAR_SCALING_NORMAL 25 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 06c143061fea..285d040a3979 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -77,10 +77,10 @@ Additional game mode variables. var/latejoin_larva_drop = LATEJOIN_MARINES_PER_LATEJOIN_LARVA //A larva will spawn in once the tally reaches this level. If set to 0, no latejoin larva drop /// Amount of latejoin_tally already awarded as larvas var/latejoin_larva_used = 0 - /// Multiplier to the amount of gear awarded so far - increases only + /// Multiplier to the amount of marine gear, current value as calculated with modifiers var/gear_scale = 1 - /// Roundstart gear scale to base off current gear_scale, for latejoin calculations - var/gear_scale_init = 1 + /// Multiplier to the amount of marine gear, maximum reached value for + var/gear_scale_max = 1 //Role Authority set up. /// List of role titles to override to different roles when starting game @@ -934,26 +934,36 @@ Additional game mode variables. /datum/game_mode/proc/init_gear_scale() //We take the number of marine players, deduced from other lists, and then get a scale multiplier from it, to be used in arbitrary manners to distribute equipment var/marine_pop_size = 0 + var/uscm_personnel_count = 0 for(var/mob/living/carbon/human/human as anything in GLOB.alive_human_list) if(human.faction == FACTION_USCM) + uscm_personnel_count++ var/datum/job/job = GET_MAPPED_ROLE(human.job) marine_pop_size += GLOB.RoleAuthority.calculate_role_weight(job) //This gives a decimal value representing a scaling multiplier. Cannot go below 1 gear_scale = max(marine_pop_size / MARINE_GEAR_SCALING_NORMAL, 1) - gear_scale_init = gear_scale - log_debug("SUPPLY: Game start detected [marine_pop_size] weighted marines, resulting in gear_scale = [gear_scale]") - log_debug("SUPPLY: Previous supply calculation would have been [length(GLOB.alive_human_list)] alive humans, resulting in gear_scale = [length(GLOB.alive_human_list)/30]") // DEBUG REMOVE ME + gear_scale_max = gear_scale + log_debug("SUPPLY: Game start detected [marine_pop_size] weighted marines (out of [uscm_personnel_count]/[length(GLOB.alive_human_list)] USCM humans), resulting in gear_scale = [gear_scale]") return gear_scale -///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining marines in [/datum/game_mode/var/latejoin_tally] -/datum/game_mode/proc/update_gear_scale() - var/new_gear_scale = gear_scale_init + latejoin_tally / MARINE_GEAR_SCALING_NORMAL * MARINE_GEAR_SCALING_LATEJOIN - if(new_gear_scale > gear_scale) +///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining and cryoing marines +/datum/game_mode/proc/update_gear_scale(delta) + // Magic inverse function that guarantees marines still get good supplies for latejoins within first ~30 minutes but stalls starting 2 hours or so + gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_NORMAL + var/gear_delta = gear_scale - gear_scale_max + if(gear_delta > 0) + log_debug("SUPPLY DEBUG - gear_scale increasing from [gear_scale_max] to [gear_scale]") // FIXME Remove this + gear_scale_max = gear_scale for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) - vendor.update_dynamic_stock(new_gear_scale) - GLOB.supply_controller.points += round((new_gear_scale - gear_scale) * GLOB.supply_controller.points_scale) - gear_scale = new_gear_scale + vendor.update_dynamic_stock(gear_scale_max) + GLOB.supply_controller.points += round(gear_delta * GLOB.supply_controller.points_scale) + +/// Updates [var/latejoin_tally] and [var/gear_scale] based on role weights of latejoiners/cryoers. Delta is the amount of role positions added/removed +/datum/game_mode/proc/latejoin_update(role, delta = 1) + var/weight = GLOB.RoleAuthority.calculate_role_weight(role) + latejoin_tally += weight * delta + update_gear_scale(weight * delta) // for the toolbox /datum/game_mode/proc/end_round_message() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 67af837ff6db..53bf82c93925 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -347,7 +347,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li GLOB.available_specialist_sets += set_name //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for - SSticker.mode.latejoin_tally -= GLOB.RoleAuthority.calculate_role_weight(job) + SSticker.mode.latejoin_update(job, -1) //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GET_MAPPED_ROLE(occupant.job), TRUE) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index f93504bdc96b..bc4e575f867a 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -135,7 +135,7 @@ list("Sentry Gun Network Laptop", 4, /obj/item/device/sentry_computer, VENDOR_ITEM_REGULAR), list("JTAC Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/jtac, VENDOR_ITEM_REGULAR), list("Engineering Pamphlet", round(scale * 1), /obj/item/pamphlet/skill/engineer, VENDOR_ITEM_REGULAR), - list("Powerloader Certification", 0.6, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), + list("Powerloader Certification", 0.75, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), list("Spare PDT/L Battle Buddy Kit", round(scale * 4), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR), list("W-Y brand rechargeable mini-battery", round(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR) ) diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index 510faa923db4..84dcac1c377f 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -82,8 +82,8 @@ list("Brown Webbing Vest", 1, /obj/item/clothing/accessory/storage/black_vest/brown_vest, VENDOR_ITEM_REGULAR), list("Black Webbing Vest", 1, /obj/item/clothing/accessory/storage/black_vest, VENDOR_ITEM_REGULAR), list("Webbing", round(scale * 2), /obj/item/clothing/accessory/storage/webbing, VENDOR_ITEM_REGULAR), - list("Drop Pouch", 0.5, /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR), - list("Shoulder Holster", 0.5, /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR), + list("Drop Pouch", 0.75, /obj/item/clothing/accessory/storage/droppouch, VENDOR_ITEM_REGULAR), + list("Shoulder Holster", 0.75, /obj/item/clothing/accessory/storage/holster, VENDOR_ITEM_REGULAR), list("ARMOR", -1, null, null), list("M3 Pattern Carrier Marine Armor", round(scale * 15), /obj/item/clothing/suit/storage/marine/carrier, VENDOR_ITEM_REGULAR), @@ -108,7 +108,7 @@ list("RESTRICTED BACKPACKS", -1, null, null), list("USCM Technician Welderpack", 1.25, /obj/item/storage/backpack/marine/engineerpack, VENDOR_ITEM_REGULAR), list("Technician Welder-Satchel", round(scale * 2), /obj/item/storage/backpack/marine/engineerpack/satchel, VENDOR_ITEM_REGULAR), - list("Radio Telephone Backpack", 0.6, /obj/item/storage/backpack/marine/satchel/rto, VENDOR_ITEM_REGULAR), + list("Radio Telephone Backpack", 0.75, /obj/item/storage/backpack/marine/satchel/rto, VENDOR_ITEM_REGULAR), list("BELTS", -1, null, null), list("M276 Pattern Ammo Load Rig", round(scale * 15), /obj/item/storage/belt/marine, VENDOR_ITEM_REGULAR), diff --git a/code/modules/admin/player_panel/actions/physical.dm b/code/modules/admin/player_panel/actions/physical.dm index 63cd6c179ab9..21e6fed4f825 100644 --- a/code/modules/admin/player_panel/actions/physical.dm +++ b/code/modules/admin/player_panel/actions/physical.dm @@ -97,7 +97,7 @@ message_admins("[key_name_admin(user)] sent [key_name_admin(target)] ([H.job]) to cryogenics.") //Cryoing someone out removes someone from the Marines, blocking further larva spawns until accounted for - SSticker.mode.latejoin_tally -= GLOB.RoleAuthority.calculate_role_weight(job) + SSticker.mode.latejoin_update(job, -1) //Handle job slot/tater cleanup. GLOB.RoleAuthority.free_role(GLOB.RoleAuthority.roles_for_mode[target.job], TRUE) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 004bf831808e..2c4eeb68a03a 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -254,7 +254,7 @@ GLOB.data_core.manifest_inject(character) SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn - SSticker.mode.latejoin_tally += GLOB.RoleAuthority.calculate_role_weight(player_rank) + SSticker.mode.latejoin_update(job) SSticker.mode.update_gear_scale() for(var/datum/squad/sq in GLOB.RoleAuthority.squads) From 19f1fb3d1c4ac4ba0d93517d80b4f4c5ae6aefbc Mon Sep 17 00:00:00 2001 From: Fira Date: Fri, 1 Dec 2023 23:19:04 +0000 Subject: [PATCH 16/25] fix --- code/modules/mob/new_player/new_player.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 2c4eeb68a03a..0276cacbfdc0 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -254,7 +254,7 @@ GLOB.data_core.manifest_inject(character) SSticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn - SSticker.mode.latejoin_update(job) + SSticker.mode.latejoin_update(player_rank) SSticker.mode.update_gear_scale() for(var/datum/squad/sq in GLOB.RoleAuthority.squads) From da3cc849c6e428b890874b9546672ea6212aa4a1 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 00:44:54 +0000 Subject: [PATCH 17/25] --debug --- code/game/gamemodes/cm_initialize.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 285d040a3979..55452972cc3f 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -953,7 +953,6 @@ Additional game mode variables. gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_NORMAL var/gear_delta = gear_scale - gear_scale_max if(gear_delta > 0) - log_debug("SUPPLY DEBUG - gear_scale increasing from [gear_scale_max] to [gear_scale]") // FIXME Remove this gear_scale_max = gear_scale for(var/obj/structure/machinery/cm_vending/sorted/vendor as anything in GLOB.cm_vending_vendors) vendor.update_dynamic_stock(gear_scale_max) From e962b235cd928850fe677f5d9a82fac4cde88c90 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 00:54:53 +0000 Subject: [PATCH 18/25] WAY TOO MUCH --- code/__DEFINES/mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index e131d5bd8f5a..7d4a3dd2600f 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ /// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 25 +#define MARINE_GEAR_SCALING_NORMAL 40 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From c6ab8000be6bfe3d59cfaa2b8b97ed1b3ecf0ff4 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 01:14:41 +0000 Subject: [PATCH 19/25] going nuclear --- code/__DEFINES/mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 7d4a3dd2600f..e79d299812a6 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ /// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 40 +#define MARINE_GEAR_SCALING_NORMAL 50 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From b69304311f31723a105b3871baaee89cfec8e08e Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 12:16:39 +0000 Subject: [PATCH 20/25] further nerf vendor scaling i guess. we'll gettem boys... --- code/__DEFINES/mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index e79d299812a6..756d24089f73 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ /// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 50 +#define MARINE_GEAR_SCALING_NORMAL 60 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From 7dca3f9fca72cf3ed52c7d7b83acc3878b76fb7e Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 12:34:53 +0000 Subject: [PATCH 21/25] buff roundstart nerf latejoin :( --- code/__DEFINES/mode.dm | 6 ++++-- code/game/gamemodes/cm_initialize.dm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 756d24089f73..a9f4ab7fac89 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -91,8 +91,10 @@ //================================================= -/// Number of marine players against which the Marines' gear scales -#define MARINE_GEAR_SCALING_NORMAL 60 +/// Number of ROUNDSTART weighter marine player for 1 gear_scale. gear_scale is clamped to 1 minimum +#define MARINE_GEAR_SCALING_NORMAL 30 +/// Number of LATEJOIN weighted marine players for 1 gear_scale +#define MARINE_GEAR_SCALING_LATEJOIN 60 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 55452972cc3f..c0cd54493d98 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -950,7 +950,7 @@ Additional game mode variables. ///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining and cryoing marines /datum/game_mode/proc/update_gear_scale(delta) // Magic inverse function that guarantees marines still get good supplies for latejoins within first ~30 minutes but stalls starting 2 hours or so - gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_NORMAL + gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_LATEJOIN var/gear_delta = gear_scale - gear_scale_max if(gear_delta > 0) gear_scale_max = gear_scale From 6aa416c8668d99f8846f535dad18e5b75febba2c Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 12:53:19 +0000 Subject: [PATCH 22/25] Jsut keep testing like this --- code/__DEFINES/mode.dm | 6 ++---- code/game/gamemodes/cm_initialize.dm | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index a9f4ab7fac89..3e3427689bab 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -91,10 +91,8 @@ //================================================= -/// Number of ROUNDSTART weighter marine player for 1 gear_scale. gear_scale is clamped to 1 minimum -#define MARINE_GEAR_SCALING_NORMAL 30 -/// Number of LATEJOIN weighted marine players for 1 gear_scale -#define MARINE_GEAR_SCALING_LATEJOIN 60 +/// Number of weighted marine players for 1 gear_scale. gear_scale is clamped to 1 minimum +#define MARINE_GEAR_SCALING_NORMAL 60 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index c0cd54493d98..55452972cc3f 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -950,7 +950,7 @@ Additional game mode variables. ///Updates the [/datum/game_mode/var/gear_scale] multiplier based on joining and cryoing marines /datum/game_mode/proc/update_gear_scale(delta) // Magic inverse function that guarantees marines still get good supplies for latejoins within first ~30 minutes but stalls starting 2 hours or so - gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_LATEJOIN + gear_scale += delta * (0.25 + 0.75 / (1 + ROUND_TIME / 20000)) / MARINE_GEAR_SCALING_NORMAL var/gear_delta = gear_scale - gear_scale_max if(gear_delta > 0) gear_scale_max = gear_scale From 8df1d4e8ddf3f2202e8a2309f542554b52a42231 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 20:46:47 +0000 Subject: [PATCH 23/25] buff back up 33.3%... we'll get there eventually i swear --- code/__DEFINES/mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 3e3427689bab..55e0f9058e92 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ /// Number of weighted marine players for 1 gear_scale. gear_scale is clamped to 1 minimum -#define MARINE_GEAR_SCALING_NORMAL 60 +#define MARINE_GEAR_SCALING_NORMAL 45 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From 4b8fd02b72987fed7c5cb39f5378a242eb1220cb Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 21:01:48 +0000 Subject: [PATCH 24/25] eventually............ --- code/__DEFINES/mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index 55e0f9058e92..94428ba7d9b3 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -92,7 +92,7 @@ /// Number of weighted marine players for 1 gear_scale. gear_scale is clamped to 1 minimum -#define MARINE_GEAR_SCALING_NORMAL 45 +#define MARINE_GEAR_SCALING_NORMAL 50 #define RESOURCE_NODE_SCALE 95 //How many players minimum per extra set of resource nodes #define RESOURCE_NODE_QUANTITY_PER_POP 11 //How many resources total per pop From 98a822d2533f16de8163e62b75427b8b5dc5e851 Mon Sep 17 00:00:00 2001 From: Fira Date: Sat, 2 Dec 2023 21:16:12 +0000 Subject: [PATCH 25/25] machete pouch buff --- code/game/machinery/vending/vendor_types/requisitions.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index bc4e575f867a..b5ed2c19fb78 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -103,7 +103,7 @@ list("Flare Pouch (Full)", round(scale * 5), /obj/item/storage/pouch/flare/full, VENDOR_ITEM_REGULAR), list("Document Pouch", round(scale * 2), /obj/item/storage/pouch/document/small, VENDOR_ITEM_REGULAR), list("Sling Pouch", round(scale * 2), /obj/item/storage/pouch/sling, VENDOR_ITEM_REGULAR), - list("Machete Pouch (Full)", 0.5, /obj/item/storage/pouch/machete/full, VENDOR_ITEM_REGULAR), + list("Machete Pouch (Full)", 1, /obj/item/storage/pouch/machete/full, VENDOR_ITEM_REGULAR), list("Bayonet Pouch", round(scale * 2), /obj/item/storage/pouch/bayonet, VENDOR_ITEM_REGULAR), list("Medium General Pouch", round(scale * 2), /obj/item/storage/pouch/general/medium, VENDOR_ITEM_REGULAR), list("Magazine Pouch", round(scale * 5), /obj/item/storage/pouch/magazine, VENDOR_ITEM_REGULAR),