Allowed random engines to be weighted.

This commit is contained in:
Putnam
2020-01-06 16:25:17 -08:00
parent 201a2056b9
commit f728c4746f
4 changed files with 21 additions and 18 deletions

View File

@@ -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

View File

@@ -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"
name = "Box Tesla"

View File

@@ -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)
templates = CONFIG_GET(keyed_list/box_random_engine)

View File

@@ -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
## 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