Add option to limit squadron sizes and begin full.

Adding temporarily as an option to make sure it's not a terrible idea,
but the old mode will probably go away.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1583.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2808.
This commit is contained in:
Dan Albert
2023-05-05 18:02:23 -07:00
committed by Raffson
parent f719e1cfe7
commit 5c07a2556e
15 changed files with 138 additions and 24 deletions

View File

@@ -238,6 +238,15 @@ def parse_args() -> argparse.Namespace:
"--auto-procurement", action="store_true", help="Automate bluefor procurement."
)
new_game.add_argument(
"--use-new-squadron-rules",
action="store_true",
help=(
"Limit the number of aircraft per squadron and begin the campaign with "
"them at full strength."
),
)
new_game.add_argument(
"--inverted", action="store_true", help="Invert the campaign."
)
@@ -280,6 +289,7 @@ def create_game(
start_date: datetime,
restrict_weapons_by_date: bool,
advanced_iads: bool,
use_new_squadron_rules: bool,
) -> Game:
first_start = liberation_install.init()
if first_start:
@@ -312,6 +322,7 @@ def create_game(
enable_base_capture_cheat=cheats,
enable_transfer_cheat=cheats,
restrict_weapons_by_date=restrict_weapons_by_date,
enable_squadron_aircraft_limits=use_new_squadron_rules,
),
GeneratorSettings(
start_date=start_date,
@@ -346,7 +357,7 @@ def create_game(
),
)
game = generator.generate()
game.begin_turn_0()
game.begin_turn_0(squadrons_start_full=use_new_squadron_rules)
return game
@@ -438,6 +449,7 @@ def main():
args.date,
args.restrict_weapons_by_date,
args.advanced_iads,
args.use_new_squadron_rules,
)
if args.subcommand == "lint-weapons":
lint_weapon_data_for_aircraft(AircraftType.named(args.aircraft))