Add: Setting for the timeout time of goals.
This commit is contained in:
@@ -38,7 +38,14 @@ class CompanyGoal {
|
||||
this.cargo = cargo;
|
||||
this.accept = accept;
|
||||
this.wanted_amount = wanted_amount;
|
||||
this.timeout = 5 * 365 * 74; // About 5 years.
|
||||
|
||||
local years = GSController.GetSetting("wait_years");
|
||||
this.timeout = years * 365 * 74;
|
||||
while (years >= 4) {
|
||||
this.timeout += 74; // Add one day for every 4 years.
|
||||
years -= 4;
|
||||
}
|
||||
if (years >= 2) this.timeout += 74 / 2; // And 1/2 a day for 2 years.
|
||||
|
||||
// Construct goal if a company id was provided.
|
||||
if (comp_id != null) {
|
||||
|
||||
9
info.nut
9
info.nut
@@ -42,6 +42,15 @@ function BusyBeeInfo::GetSettings()
|
||||
hard_value=5,
|
||||
custom_value=5,
|
||||
flags=GSInfo.CONFIG_NONE});
|
||||
GSInfo.AddSetting({name="wait_years",
|
||||
description="Number of years to wait to fulfill a new goal",
|
||||
min_value=4,
|
||||
max_value=20,
|
||||
easy_value=10,
|
||||
medium_value=5,
|
||||
hard_value=3,
|
||||
custom_value=7,
|
||||
flags=GSInfo.CONFIG_INGAME});
|
||||
}
|
||||
|
||||
RegisterGS(BusyBeeInfo());
|
||||
|
||||
Reference in New Issue
Block a user