Files @ r28566:ec28e66fe6ee
Branch filter:

Location: cpp/openttd-patchpack/source/src/table/settings/difficulty_settings.ini

dependabot[bot] 49699333+dependabot[bot]@users.noreply.github.com
Upgrade: [CI] bump the actions group with 9 updates (#11881)

Bumps the actions group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `3` | `4` |
| [actions/cache](https://github.com/actions/cache) | `3` | `4` |
| [actions/github-script](https://github.com/actions/github-script) | `6` | `7` |
| [OpenTTD/actions](https://github.com/openttd/actions) | `2` | `5` |
| [github/codeql-action](https://github.com/github/codeql-action) | `2` | `3` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `3` | `4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3` | `4` |
| [tibdex/github-app-token](https://github.com/tibdex/github-app-token) | `1` | `2` |
| [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) | `2` | `3` |

Updates `actions/checkout` from 3 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

Updates `actions/cache` from 3 to 4
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

Updates `actions/github-script` from 6 to 7
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

Updates `OpenTTD/actions` from 2 to 5
- [Release notes](https://github.com/openttd/actions/releases)
- [Commits](https://github.com/openttd/actions/compare/v2...v5)

Updates `github/codeql-action` from 2 to 3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

Updates `actions/download-artifact` from 3 to 4
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4)

Updates `actions/upload-artifact` from 3 to 4
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

Updates `tibdex/github-app-token` from 1 to 2
- [Release notes](https://github.com/tibdex/github-app-token/releases)
- [Commits](https://github.com/tibdex/github-app-token/compare/v1...v2)

Updates `peter-evans/repository-dispatch` from 2 to 3
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: actions/github-script
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: OpenTTD/actions
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: actions/download-artifact
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: tibdex/github-app-token
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
- dependency-name: peter-evans/repository-dispatch
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
; This file is part of OpenTTD.
; OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
; OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
;

; Difficulty settings as stored in the main configuration file ("openttd.cfg")
; and in the savegame PATS chunk.

[pre-amble]
const std::array<std::string, GAME_DIFFICULTY_NUM> _old_diff_settings{"max_no_competitors", "competitor_start_time", "number_towns", "industry_density", "max_loan", "initial_interest", "vehicle_costs", "competitor_speed", "competitor_intelligence", "vehicle_breakdowns", "subsidy_multiplier", "construction_cost", "terrain_type", "quantity_sea_lakes", "economy", "line_reverse_mode", "disasters", "town_council_tolerance"};

uint16_t _old_diff_custom[GAME_DIFFICULTY_NUM];
uint8_t _old_diff_level;                                 ///< Old difficulty level from old savegames

static void DifficultyNoiseChange(int32_t new_value);
static void MaxNoAIsChange(int32_t new_value);

static const SettingVariant _difficulty_settings_table[] = {
[post-amble]
};
[templates]
SDTG_VAR   =   SDTG_VAR($name,              $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
SDT_BOOL   =   SDT_BOOL(GameSettings, $var,        $flags, $def,                              $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),
SDT_VAR    =    SDT_VAR(GameSettings, $var, $type, $flags, $def,       $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $from, $to,        $cat, $extra, $startup),

[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");

[defaults]
flags    = SF_NONE
interval = 0
str      = STR_NULL
strhelp  = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT
strval   = STR_NULL
pre_cb   = nullptr
post_cb  = nullptr
load     = nullptr
from     = SL_MIN_VERSION
to       = SL_MAX_VERSION
cat      = SC_ADVANCED
extra    = 0
startup  = false


; Saved settings variables.
; The next 18 entries are important for savegame compatibility. Do NOT remove those. See HandleOldDiffCustom() for more details.
[SDT_VAR]
var      = difficulty.max_no_competitors
type     = SLE_UINT8
from     = SLV_97
def      = 0
min      = 0
max      = MAX_COMPANIES - 1
interval = 1
post_cb  = MaxNoAIsChange
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.competitors_interval
type     = SLE_UINT16
from     = SLV_AI_START_DATE
def      = 10
min      = MIN_COMPETITORS_INTERVAL
max      = MAX_COMPETITORS_INTERVAL
interval = 1

[SDT_VAR]
var      = difficulty.competitor_start_time
type     = SLE_UINT8
from     = SLV_97
to       = SLV_110
def      = 2
min      = 0
max      = 3

[SDT_VAR]
var      = difficulty.number_towns
type     = SLE_UINT8
from     = SLV_97
flags    = SF_NEWGAME_ONLY
def      = 2
min      = 0
max      = 4
interval = 1
strval   = STR_NUM_VERY_LOW
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.industry_density
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN
def      = ID_NORMAL
min      = 0
max      = ID_END - 1
interval = 1
str      = STR_CONFIG_SETTING_INDUSTRY_DENSITY
strhelp  = STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT
strval   = STR_FUNDING_ONLY
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.max_loan
type     = SLE_UINT32
from     = SLV_97
flags    = SF_NEWGAME_ONLY | SF_SCENEDIT_TOO | SF_GUI_CURRENCY | SF_GUI_0_IS_SPECIAL
def      = 300000
min      = LOAN_INTERVAL
max      = 2000000000
pre_cb   = [](auto &new_value) { new_value = (new_value + LOAN_INTERVAL / 2) / LOAN_INTERVAL * LOAN_INTERVAL; return true; }
interval = LOAN_INTERVAL
str      = STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN
strhelp  = STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT
strval   = STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_VALUE
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.initial_interest
type     = SLE_UINT8
from     = SLV_97
flags    = SF_NEWGAME_ONLY | SF_SCENEDIT_TOO
def      = 2
min      = 2
max      = 4
interval = 1
str      = STR_CONFIG_SETTING_INTEREST_RATE
strhelp  = STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT
strval   = STR_CONFIG_SETTING_PERCENTAGE

[SDT_VAR]
var      = difficulty.vehicle_costs
type     = SLE_UINT8
from     = SLV_97
flags    = SF_NEWGAME_ONLY | SF_SCENEDIT_TOO | SF_GUI_DROPDOWN
def      = 0
min      = 0
max      = 2
interval = 1
str      = STR_CONFIG_SETTING_RUNNING_COSTS
strhelp  = STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT
strval   = STR_SEA_LEVEL_LOW
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.competitor_speed
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN
def      = 2
min      = 0
max      = 4
interval = 1
str      = STR_CONFIG_SETTING_CONSTRUCTION_SPEED
strhelp  = STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT
strval   = STR_AI_SPEED_VERY_SLOW
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.competitor_intelligence
type     = SLE_UINT8
from     = SLV_97
to       = SLV_110
def      = 0
min      = 0
max      = 2

[SDT_VAR]
var      = difficulty.vehicle_breakdowns
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN
def      = 1
min      = 0
max      = 2
interval = 1
str      = STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS
strhelp  = STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT
strval   = STR_DISASTER_NONE
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.subsidy_multiplier
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN
def      = 2
min      = 0
max      = 3
interval = 1
str      = STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER
strhelp  = STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT
strval   = STR_SUBSIDY_X1_5

[SDT_VAR]
var      = difficulty.subsidy_duration
type     = SLE_UINT16
from     = SLV_CUSTOM_SUBSIDY_DURATION
flags    = SF_GUI_0_IS_SPECIAL
def      = 1
min      = 0
max      = 5000
interval = 1
str      = STR_CONFIG_SETTING_SUBSIDY_DURATION
strhelp  = STR_CONFIG_SETTING_SUBSIDY_DURATION_HELPTEXT
strval   = STR_CONFIG_SETTING_SUBSIDY_DURATION_VALUE

[SDT_VAR]
var      = difficulty.construction_cost
type     = SLE_UINT8
from     = SLV_97
flags    = SF_NEWGAME_ONLY | SF_SCENEDIT_TOO | SF_GUI_DROPDOWN
def      = 0
min      = 0
max      = 2
interval = 1
str      = STR_CONFIG_SETTING_CONSTRUCTION_COSTS
strhelp  = STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT
strval   = STR_SEA_LEVEL_LOW
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.terrain_type
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN | SF_NEWGAME_ONLY
def      = 1
min      = 0
max      = 5
interval = 1
str      = STR_CONFIG_SETTING_TERRAIN_TYPE
strhelp  = STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT
strval   = STR_TERRAIN_TYPE_VERY_FLAT
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.quantity_sea_lakes
type     = SLE_UINT8
from     = SLV_97
flags    = SF_NEWGAME_ONLY
def      = 0
min      = 0
max      = 4
interval = 1
strval   = STR_SEA_LEVEL_VERY_LOW
cat      = SC_BASIC

[SDT_BOOL]
var      = difficulty.economy
from     = SLV_97
def      = false
str      = STR_CONFIG_SETTING_RECESSIONS
strhelp  = STR_CONFIG_SETTING_RECESSIONS_HELPTEXT

[SDT_BOOL]
var      = difficulty.line_reverse_mode
from     = SLV_97
def      = false
str      = STR_CONFIG_SETTING_TRAIN_REVERSING
strhelp  = STR_CONFIG_SETTING_TRAIN_REVERSING_HELPTEXT

[SDT_BOOL]
var      = difficulty.disasters
from     = SLV_97
def      = false
str      = STR_CONFIG_SETTING_DISASTERS
strhelp  = STR_CONFIG_SETTING_DISASTERS_HELPTEXT
cat      = SC_BASIC

[SDT_VAR]
var      = difficulty.town_council_tolerance
type     = SLE_UINT8
from     = SLV_97
flags    = SF_GUI_DROPDOWN
def      = 0
min      = 0
max      = 3
interval = 1
str      = STR_CONFIG_SETTING_CITY_APPROVAL
strhelp  = STR_CONFIG_SETTING_CITY_APPROVAL_HELPTEXT
strval   = STR_CITY_APPROVAL_LENIENT
post_cb  = DifficultyNoiseChange

[SDTG_VAR]
name     = ""diff_level""
var      = _old_diff_level
type     = SLE_UINT8
flags    = SF_NOT_IN_CONFIG
from     = SLV_97
to       = SLV_178
def      = 3
min      = 0
max      = 3
cat      = SC_BASIC