Merge pull request #9582 from Putnam3145/dynamic-config
Adding dynamic rules to the game config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#define VALUE_MODE_NUM 0
|
||||
#define VALUE_MODE_TEXT 1
|
||||
#define VALUE_MODE_FLAG 2
|
||||
#define VALUE_MODE_NUM_LIST 3
|
||||
|
||||
#define KEY_MODE_TEXT 0
|
||||
#define KEY_MODE_TYPE 1
|
||||
@@ -191,6 +192,18 @@
|
||||
if(VALUE_MODE_TEXT)
|
||||
new_value = key_value
|
||||
continue_check_value = new_value
|
||||
if(VALUE_MODE_NUM_LIST)
|
||||
// this is all copy+pasted from number list up there, but it's super basic so I don't see it being changed soon
|
||||
var/list/new_list = list()
|
||||
var/list/values = splittext(key_value," ")
|
||||
for(var/I in values)
|
||||
var/temp = text2num(I)
|
||||
if(isnull(temp))
|
||||
log_admin("invalid number list entry in [key_name]: [I]")
|
||||
continue_check_value = FALSE
|
||||
new_list += temp
|
||||
new_value = new_list
|
||||
continue_check_value = new_list.len
|
||||
if(continue_check_value && continue_check_key && ValidateListEntry(new_key, new_value))
|
||||
config_entry_value[new_key] = new_value
|
||||
return TRUE
|
||||
|
||||
@@ -367,3 +367,27 @@
|
||||
/datum/config_entry/number/auto_transfer_delay
|
||||
config_entry_value = 72000
|
||||
min_val = 0
|
||||
|
||||
/datum/config_entry/number/dynamic_high_pop_limit
|
||||
config_entry_value = 55
|
||||
min_val = 1
|
||||
|
||||
/datum/config_entry/number/dynamic_pop_per_requirement
|
||||
config_entry_value = 6
|
||||
min_val = 1
|
||||
|
||||
/datum/config_entry/keyed_list/dynamic_cost
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/dynamic_weight
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
/datum/config_entry/keyed_list/dynamic_requirements
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM_LIST
|
||||
|
||||
/datum/config_entry/keyed_list/dynamic_high_population_requirement
|
||||
key_mode = KEY_MODE_TEXT
|
||||
value_mode = VALUE_MODE_NUM
|
||||
|
||||
Reference in New Issue
Block a user