From af281720e6370373abae5e7d8c65313f5764eafd Mon Sep 17 00:00:00 2001 From: Alberth Date: Tue, 6 Jan 2015 19:12:46 +0100 Subject: [PATCH] Add: Setting for the timeout time of goals. --- company.nut | 9 ++++++++- info.nut | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/company.nut b/company.nut index 4e70271..5b3a29e 100644 --- a/company.nut +++ b/company.nut @@ -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) { diff --git a/info.nut b/info.nut index 8b75fd5..4a21468 100644 --- a/info.nut +++ b/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());