Add channel naming for the warthogs.

The manual for the legacy warthog usually calls these VHF 1/2 and UHF,
or VHF AM/FM and UHF. The AM/FM nomenclature is what I usually hear
people call them and it's clearer, so go with that.

For the A-10C II, that manual hasn't been updated for the AN/ARC-210
yet, so I'm not really sure what that ought to be called. The UFC calls
it COM 1 though, so I went with that. The alternative would be something
like VHF/UHF for the 210 and UHF for the 164, but I don't know if that's
actually better. Could be completely explicit and call them by their
full names, but that's probably less clear to people that aren't
fiddling with the radio implementation constantly (and even I confuse
the 164 and the 186 all the damn time).
This commit is contained in:
Dan Albert 2023-03-13 18:35:56 -07:00 committed by Raffson
parent 9e42f7f255
commit aaaa9847b1
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
4 changed files with 41 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from game.radio.channels import (
CommonRadioChannelAllocator,
FarmerRadioChannelAllocator,
HueyChannelNamer,
LegacyWarthogChannelNamer,
MirageChannelNamer,
MirageF1CEChannelNamer,
NoOpChannelAllocator,
@ -32,6 +33,7 @@ from game.radio.channels import (
ViggenChannelNamer,
ViggenRadioChannelAllocator,
ViperChannelNamer,
WarthogChannelNamer,
)
from game.utils import (
Distance,
@ -106,6 +108,8 @@ class RadioConfig:
"viggen": ViggenChannelNamer,
"viper": ViperChannelNamer,
"apache": ApacheChannelNamer,
"a10c-legacy": LegacyWarthogChannelNamer,
"a10c-ii": WarthogChannelNamer,
}[config.get("namer", "default")]

View File

@ -1,7 +1,7 @@
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from game.missiongenerator.aircraft.flightdata import FlightData
@ -358,3 +358,37 @@ class SCR522ChannelNamer(ChannelNamer):
@classmethod
def name(cls) -> str:
return "SCR-522"
class LegacyWarthogChannelNamer(ChannelNamer):
"""Channel namer for the legacy A-10C."""
@staticmethod
def channel_name(radio_id: int, channel_id: int) -> str:
radio_name = {
1: "VHF AM",
2: "UHF",
3: "VHF FM",
}[radio_id]
return f"{radio_name} Ch {channel_id}"
@classmethod
def name(cls) -> str:
return "a10c-legacy"
class WarthogChannelNamer(ChannelNamer):
"""Channel namer for the legacy A-10C II"""
@staticmethod
def channel_name(radio_id: int, channel_id: int) -> str:
radio_name = {
1: "COM 1",
2: "UHF",
3: "VHF FM",
}[radio_id]
return f"{radio_name} Ch {channel_id}"
@classmethod
def name(cls) -> str:
return "a10c-ii"

View File

@ -19,6 +19,7 @@ radios:
inter_flight: AN/ARC-164
channels:
type: common
namer: a10c-legacy
intra_flight_radio_index: 1
inter_flight_radio_index: 2
tasks:

View File

@ -25,7 +25,7 @@ radios:
inter_flight: AN/ARC-210
channels:
type: common
# namer: a10c-ii
namer: a10c-ii
intra_flight_radio_index: 2
inter_flight_radio_index: 1
tasks: