DEV: company and town factors for reward
This commit is contained in:
@@ -27,6 +27,8 @@ class CompanyGoal {
|
|||||||
timeout = null; // Timeout in ticks before the goal becomes obsolete.
|
timeout = null; // Timeout in ticks before the goal becomes obsolete.
|
||||||
reward = 0; // reward for reached goal (makes this come closer to subsidies)
|
reward = 0; // reward for reached goal (makes this come closer to subsidies)
|
||||||
subsidyfactor = GSController.GetSetting("subsidy_factor") * 20;
|
subsidyfactor = GSController.GetSetting("subsidy_factor") * 20;
|
||||||
|
rewardfactor_town = GSController.GetSetting("rewardfactor_town");
|
||||||
|
rewardfactor_ind = GSController.GetSetting("rewardfactor_ind");
|
||||||
|
|
||||||
displayed_string = null;
|
displayed_string = null;
|
||||||
displayed_count = null;
|
displayed_count = null;
|
||||||
@@ -51,11 +53,13 @@ class CompanyGoal {
|
|||||||
destination_string = GSText(GSText.STR_TOWN_NAME, destination);
|
destination_string = GSText(GSText.STR_TOWN_NAME, destination);
|
||||||
destination_string_news = GSText(GSText.STR_TOWN_NAME_NEWS, destination);
|
destination_string_news = GSText(GSText.STR_TOWN_NAME_NEWS, destination);
|
||||||
goal_type = GSGoal.GT_TOWN;
|
goal_type = GSGoal.GT_TOWN;
|
||||||
|
this.reward = this.reward * rewardfactor_town;
|
||||||
} else {
|
} else {
|
||||||
destination = accept.ind;
|
destination = accept.ind;
|
||||||
destination_string = GSText(GSText.STR_INDUSTRY_NAME, destination);
|
destination_string = GSText(GSText.STR_INDUSTRY_NAME, destination);
|
||||||
destination_string_news = GSText(GSText.STR_INDUSTRY_NAME_NEWS, destination);
|
destination_string_news = GSText(GSText.STR_INDUSTRY_NAME_NEWS, destination);
|
||||||
goal_type = GSGoal.GT_INDUSTRY;
|
goal_type = GSGoal.GT_INDUSTRY;
|
||||||
|
this.reward = this.reward * rewardfactor_ind;
|
||||||
}
|
}
|
||||||
local goal_text, goal_news_text;
|
local goal_text, goal_news_text;
|
||||||
if (this.reward > 0) {
|
if (this.reward > 0) {
|
||||||
@@ -524,6 +528,7 @@ function CompanyData::CheckAndFinishGoals()
|
|||||||
if (goal == null) continue;
|
if (goal == null) continue;
|
||||||
if (goal.CheckFinished()) {
|
if (goal.CheckFinished()) {
|
||||||
goal.FinalizeGoal();
|
goal.FinalizeGoal();
|
||||||
|
GSCompany.ChangeBankBalance(this.comp_id, goal.reward, 0);
|
||||||
this.active_goals[num] = null;
|
this.active_goals[num] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
info.nut
20
info.nut
@@ -105,6 +105,26 @@ function BusyBeeInfo::GetSettings()
|
|||||||
custom_value=0,
|
custom_value=0,
|
||||||
step_size=0.5,
|
step_size=0.5,
|
||||||
flags=GSInfo.CONFIG_INGAME});
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
|
GSInfo.AddSetting({name="rewardfactor_town",
|
||||||
|
description="Extra factor to be multiplied with reward for towns",
|
||||||
|
min_value=0,
|
||||||
|
max_value=2,
|
||||||
|
easy_value=2,
|
||||||
|
medium_value=1,
|
||||||
|
hard_value=0,
|
||||||
|
custom_value=0,
|
||||||
|
step_size=0.1,
|
||||||
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
|
GSInfo.AddSetting({name="rewardfactor_ind",
|
||||||
|
description="Extra factor to be multiplied with reward for industries",
|
||||||
|
min_value=0,
|
||||||
|
max_value=2,
|
||||||
|
easy_value=2,
|
||||||
|
medium_value=1,
|
||||||
|
hard_value=0,
|
||||||
|
custom_value=0,
|
||||||
|
step_size=0.1,
|
||||||
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterGS(BusyBeeInfo());
|
RegisterGS(BusyBeeInfo());
|
||||||
|
|||||||
Reference in New Issue
Block a user