From f728c4746f8e8599d35278561607154f50e62033 Mon Sep 17 00:00:00 2001 From: Putnam Date: Mon, 6 Jan 2020 16:25:17 -0800 Subject: [PATCH] Allowed random engines to be weighted. --- .../configuration/entries/game_options.dm | 4 ++-- code/datums/ruins/station.dm | 12 ++++++------ code/game/objects/effects/landmarks.dm | 12 ++++++------ config/game_options.txt | 11 +++++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index b95ef43d37..5a0eb0c65f 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -378,9 +378,9 @@ /datum/config_entry/keyed_list/box_random_engine key_mode = KEY_MODE_TEXT - value_mode = VALUE_MODE_FLAG + value_mode = VALUE_MODE_NUM lowercase = FALSE - splitter = "-" + splitter = "," /datum/config_entry/number/auto_transfer_delay config_entry_value = 72000 diff --git a/code/datums/ruins/station.dm b/code/datums/ruins/station.dm index 624081156a..e637b6178f 100644 --- a/code/datums/ruins/station.dm +++ b/code/datums/ruins/station.dm @@ -8,29 +8,29 @@ /datum/map_template/ruin/station/box/engine id = "engine_sm" suffix = "Box/Engine/engine_sm.dmm" - name = "Engine SM" + name = "Box SM" /datum/map_template/ruin/station/box/engine/onebythree id = "engine_sm_1x3" suffix = "Box/Engine/engine_sm_1x3.dmm" - name = "Engine SM 1x3" + name = "Box SM 1x3" /datum/map_template/ruin/station/box/engine/fivebyfive id = "engine_sm_5x5" suffix = "Box/Engine/engine_sm_5x5.dmm" - name = "Engine SM 5x5" + name = "Box SM 5x5" /datum/map_template/ruin/station/box/engine/threesm id = "engine_sm_3x" suffix = "Box/Engine/engine_sm_3x.dmm" - name = "Engine SM 3x" + name = "Box SM 3x" /datum/map_template/ruin/station/box/engine/singulo id = "engine_singulo" suffix = "Box/Engine/engine_singulo.dmm" - name = "Engine Singulo" + name = "Box Singulo" /datum/map_template/ruin/station/box/engine/tesla id = "engine_tesla" suffix = "Box/Engine/engine_tesla.dmm" - name = "Engine Tesla" \ No newline at end of file + name = "Box Tesla" diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index e01010baa5..0d4ca3d311 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -435,7 +435,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player) //------Station Rooms Landmarks------------// /obj/effect/landmark/stationroom - var/list/template_names = list() + var/list/templates = list() layer = BULLET_HOLE_LAYER /obj/effect/landmark/stationroom/New() @@ -452,11 +452,11 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player) if(!T) return FALSE if(!template_name) - for(var/t in template_names) + for(var/t in templates) if(!SSmapping.station_room_templates[t]) log_world("Station room spawner placed at ([T.x], [T.y], [T.z]) has invalid ruin name of \"[t]\" in its list") - template_names -= t - template_name = safepick(template_names) + templates -= t + template_name = pickweight(templates) if(!template_name) GLOB.stationroom_landmarks -= src qdel(src) @@ -474,10 +474,10 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player) // The landmark for the Engine on Box /obj/effect/landmark/stationroom/box/engine - template_names = list("Engine SM", "Engine Singulo", "Engine Tesla") + templates = list("Engine SM" = 3, "Engine Singulo" = 3, "Engine Tesla" = 3) icon = 'icons/rooms/box/engine.dmi' /obj/effect/landmark/stationroom/box/engine/New() . = ..() - template_names = CONFIG_GET(keyed_list/box_random_engine) \ No newline at end of file + templates = CONFIG_GET(keyed_list/box_random_engine) diff --git a/config/game_options.txt b/config/game_options.txt index 34c8ca48fd..d68143a35c 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -575,7 +575,10 @@ MONKEYCAP 64 #Replaces standard extended/secret dichotomy with extended and calm/chaotic votes for dynamic. DYNAMIC_VOTING -## Choose which Engine to start the round with, comment to remove an Engine from the rotation -BOX_RANDOM_ENGINE Engine SM -BOX_RANDOM_ENGINE Engine Tesla -BOX_RANDOM_ENGINE Engine Singulo \ No newline at end of file +## Choose which Engine to start the round with. Weight is after the comma. Setting the weight to 0 removes the engine from rotation. +BOX_RANDOM_ENGINE Box SM,3 +BOX_RANDOM_ENGINE Box Tesla,3 +BOX_RANDOM_ENGINE Box Singulo,3 +BOX_RANDOM_ENGINE Box SM 1x3,1 +BOX_RANDOM_ENGINE Box SM 5x5,1 +BOX_RANDOM_ENGINE Box SM 3x,0