Skip to content

Instantly share code, notes, and snippets.

@andythenorth
Created August 22, 2023 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andythenorth/fd3f3ed6e02607291854c69fda4380ef to your computer and use it in GitHub Desktop.
Save andythenorth/fd3f3ed6e02607291854c69fda4380ef to your computer and use it in GitHub Desktop.
function IndustryProductionIncreaseHistory(vulcan_town, extra_params) {
local industry = extra_params[0];
if (industry in ::persistent_storage.industry_production_increase_timeseries) {
local date_substrs = [];
for (local counter = 0; counter < 10; counter++) {
if (counter < ::persistent_storage.industry_production_increase_timeseries[industry].len()) {
Log.Info(::persistent_storage.industry_production_increase_timeseries[industry][counter]);
date_substrs.append(
GSText(
GSText.STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_DATE_SUBSTR,
::persistent_storage.industry_production_increase_timeseries[industry][counter]
)
);
}
else {
date_substrs.append(GSText(GSText.STR_CABBAGE));
}
}
return GSText(
GSText.STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_10_DATES,
date_substrs[0],
date_substrs[1],
date_substrs[2],
date_substrs[3],
date_substrs[4],
date_substrs[5],
date_substrs[6],
date_substrs[7],
date_substrs[8],
date_substrs[9]
)
}
else {
return GSText(GSText.STR_CABBAGE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment