mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix #1966 : Naming; replaced female_pilot_ratio by female_pilot_percentage
This commit is contained in:
@@ -20,7 +20,7 @@ class SquadronConfig:
|
||||
|
||||
name: Optional[str]
|
||||
nickname: Optional[str]
|
||||
female_pilot_ratio: Optional[int]
|
||||
female_pilot_percentage: Optional[int]
|
||||
|
||||
@property
|
||||
def auto_assignable(self) -> set[FlightType]:
|
||||
@@ -42,7 +42,7 @@ class SquadronConfig:
|
||||
data.get("aircraft", []),
|
||||
data.get("name", None),
|
||||
data.get("nickname", None),
|
||||
data.get("female_pilot_ratio", None),
|
||||
data.get("female_pilot_percentage", None),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -77,8 +77,8 @@ class DefaultSquadronAssigner:
|
||||
overrides["name"] = config.name
|
||||
if config.nickname is not None:
|
||||
overrides["nickname"] = config.nickname
|
||||
if config.female_pilot_ratio is not None:
|
||||
overrides["female_pilot_ratio"] = config.female_pilot_ratio
|
||||
if config.female_pilot_percentage is not None:
|
||||
overrides["female_pilot_percentage"] = config.female_pilot_percentage
|
||||
|
||||
squadron_copy = dataclasses.replace(squadron_def, **overrides)
|
||||
return squadron_copy
|
||||
|
||||
@@ -50,7 +50,7 @@ class SquadronDefGenerator:
|
||||
livery=None,
|
||||
mission_types=tuple(tasks_for_aircraft(aircraft)),
|
||||
operating_bases=OperatingBases.default_for_aircraft(aircraft),
|
||||
female_pilot_ratio=6,
|
||||
female_pilot_percentage=6,
|
||||
pilot_pool=[],
|
||||
)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class Squadron:
|
||||
livery: Optional[str]
|
||||
mission_types: tuple[FlightType, ...]
|
||||
operating_bases: OperatingBases
|
||||
female_pilot_ratio: int
|
||||
female_pilot_percentage: int
|
||||
|
||||
#: The pool of pilots that have not yet been assigned to the squadron. This only
|
||||
#: happens when a preset squadron defines more preset pilots than the squadron limit
|
||||
@@ -162,7 +162,7 @@ class Squadron:
|
||||
self.pilot_pool = self.pilot_pool[count:]
|
||||
count -= len(new_pilots)
|
||||
for _ in range(count):
|
||||
if random.randint(1, 100) > self.female_pilot_ratio:
|
||||
if random.randint(1, 100) > self.female_pilot_percentage:
|
||||
new_pilots.append(Pilot(self.faker.name_male()))
|
||||
else:
|
||||
new_pilots.append(Pilot(self.faker.name_female()))
|
||||
@@ -434,7 +434,7 @@ class Squadron:
|
||||
squadron_def.livery,
|
||||
squadron_def.mission_types,
|
||||
squadron_def.operating_bases,
|
||||
squadron_def.female_pilot_ratio,
|
||||
squadron_def.female_pilot_percentage,
|
||||
squadron_def.pilot_pool,
|
||||
coalition,
|
||||
game.settings,
|
||||
|
||||
@@ -27,7 +27,7 @@ class SquadronDef:
|
||||
livery: Optional[str]
|
||||
mission_types: tuple[FlightType, ...]
|
||||
operating_bases: OperatingBases
|
||||
female_pilot_ratio: int
|
||||
female_pilot_percentage: int
|
||||
pilot_pool: list[Pilot]
|
||||
claimed: bool = False
|
||||
|
||||
@@ -76,7 +76,7 @@ class SquadronDef:
|
||||
|
||||
pilots = [Pilot(n, player=False) for n in data.get("pilots", [])]
|
||||
pilots.extend([Pilot(n, player=True) for n in data.get("players", [])])
|
||||
female_pilot_ratio = data.get("female_pilot_ratio", 6)
|
||||
female_pilot_percentage = data.get("female_pilot_percentage", 6)
|
||||
|
||||
mission_types = [FlightType.from_name(n) for n in data["mission_types"]]
|
||||
tasks = tasks_for_aircraft(unit_type)
|
||||
@@ -97,6 +97,6 @@ class SquadronDef:
|
||||
livery=data.get("livery"),
|
||||
mission_types=tuple(mission_types),
|
||||
operating_bases=OperatingBases.from_yaml(unit_type, data.get("bases", {})),
|
||||
female_pilot_ratio=female_pilot_ratio,
|
||||
female_pilot_percentage=female_pilot_percentage,
|
||||
pilot_pool=pilots,
|
||||
)
|
||||
|
||||
@@ -126,6 +126,6 @@ VERSION = _build_version_string()
|
||||
#:
|
||||
#: Version 9.2
|
||||
#: * Squadrons defined in campaign files can optionally setup squadrons' name,
|
||||
#: nickname and/or generated female pilot name ratio
|
||||
#: nickname and/or generated female pilot name percentage
|
||||
#:
|
||||
CAMPAIGN_FORMAT_VERSION = (9, 2)
|
||||
|
||||
Reference in New Issue
Block a user