From ad026a34c5c43e2a3ebf98963fb13e98a6b41ca6 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:19:48 +0100 Subject: [PATCH] Revert "Increases pred round chance whenever it isn't a pred round (#7201)" This reverts commit 0bd1f47d614c5657c1ec93301cc5bd2cf8994b69. --- code/datums/entities/predround_chance.dm | 22 ---------------------- code/game/jobs/role_authority.dm | 23 ++--------------------- colonialmarines.dme | 1 - maps/Nightmare/scenario.json | 1 + 4 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 code/datums/entities/predround_chance.dm diff --git a/code/datums/entities/predround_chance.dm b/code/datums/entities/predround_chance.dm deleted file mode 100644 index dbec67daf83e..000000000000 --- a/code/datums/entities/predround_chance.dm +++ /dev/null @@ -1,22 +0,0 @@ -/datum/entity/predround_chance - var/chance - - -/datum/entity_meta/predround_chance - entity_type = /datum/entity/predround_chance - table_name = "predround_chance" - field_types = list( - "chance" = DB_FIELDTYPE_BIGINT, - ) - -/datum/view_record/predround_chance - var/id - var/chance - -/datum/entity_view_meta/stickyban - root_record_type = /datum/entity/predround_chance - destination_entity = /datum/view_record/predround_chance - fields = list( - "id", - "chance", - ) diff --git a/code/game/jobs/role_authority.dm b/code/game/jobs/role_authority.dm index 3fb9fd146cf9..b4894eda4d24 100644 --- a/code/game/jobs/role_authority.dm +++ b/code/game/jobs/role_authority.dm @@ -209,27 +209,13 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou if(istype(CO_surv_job)) CO_surv_job.set_spawn_positions(GLOB.players_preassigned) - var/chance - var/pred_round = FALSE - var/datum/view_record/predround_chance/meta = locate() in DB_VIEW(/datum/view_record/predround_chance, DB_COMP("id", DB_EQUALS, 1)) - if(!meta) - var/datum/entity/predround_chance/entity = DB_ENTITY(/datum/entity/predround_chance, 1) - entity.chance = 0 // This is 0 instead of 20 because it is going to get increased in modify_pred_round_chance - chance = 20 - entity.save() - else - chance = meta.chance - - if(prob(chance) && !Check_WO()) - pred_round = TRUE + if(SSnightmare.get_scenario_value("predator_round") && !Check_WO()) SSticker.mode.flags_round_type |= MODE_PREDATOR // Set predators starting amount based on marines assigned var/datum/job/PJ = temp_roles_for_mode[JOB_PREDATOR] if(istype(PJ)) PJ.set_spawn_positions(GLOB.players_preassigned) - REDIS_PUBLISH("byond.round", "type" = "predator-round", "map" = SSmapping.configs[GROUND_MAP].map_name) - - DB_FILTER(/datum/entity/predround_chance, DB_COMP("id", DB_EQUALS, 1), CALLBACK(src, PROC_REF(modify_pred_round_chance), pred_round)) + REDIS_PUBLISH("byond.round", "type" = "predator-round", "map" = SSmapping.configs[GROUND_MAP].map_name) // Assign the roles, this time for real, respecting limits we have established. var/list/roles_left = assign_roles(temp_roles_for_mode, unassigned_players) @@ -837,8 +823,3 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou if(new_squad.num_tl >= new_squad.max_tl) return TRUE return FALSE - -/datum/authority/branch/role/proc/modify_pred_round_chance(pred_round, list/datum/entity/predround_chance/entities) - var/datum/entity/predround_chance/entity = locate() in entities - entity.chance = pred_round ? 20 : entity.chance + 20 - entity.save() diff --git a/colonialmarines.dme b/colonialmarines.dme index 7af974d6c715..9fff0d7db91b 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -563,7 +563,6 @@ #include "code\datums\entities\player_stat.dm" #include "code\datums\entities\player_sticky_ban.dm" #include "code\datums\entities\player_times.dm" -#include "code\datums\entities\predround_chance.dm" #include "code\datums\entities\ticket.dm" #include "code\datums\entities\logs\player_times_log.dm" #include "code\datums\factions\clf.dm" diff --git a/maps/Nightmare/scenario.json b/maps/Nightmare/scenario.json index 0d4f101c7a37..4cfa6462d4b7 100644 --- a/maps/Nightmare/scenario.json +++ b/maps/Nightmare/scenario.json @@ -1,2 +1,3 @@ [ + { "type": "def", "values": { "predator_round": true }, "chance": 0.2 } ]