Differentiate required long and medium range SAMs.

To improve IADS design in campaigns, this differentiates required long
and medium range SAMs. SAMs that must be long range SAMs are defined by
SA-10 or Patriot launchers, while medium range SAMs are defined by SA-2,
SA-3, or Hawk launchers.

Long range SAMs positions will only be populated by long range SAMs
(Patriots and SA-10s), and not all factions have those available. Medium
range SAMs currently comprise all air defenses that are not long range
SAMs, so if the faction includes flak guns in their `sams` property then
flak guns may be spawned at medium range SAM locations.

Base defenses and random SAM locations continue to use either type of
SAM.
This commit is contained in:
Dan Albert
2020-11-26 19:42:20 -08:00
parent 3ad57d995b
commit 0e807d84c2
5 changed files with 88 additions and 52 deletions

View File

@@ -248,7 +248,7 @@ class QBuyGroupForGroundObjectDialog(QDialog):
self.init_ui()
def init_ui(self):
faction = self.game.player_name
faction = self.game.player_faction
# Sams
@@ -268,7 +268,7 @@ class QBuyGroupForGroundObjectDialog(QDialog):
# Armored units
armored_units = db.find_unittype(PinpointStrike, faction) # Todo : refactor this legacy nonsense
armored_units = db.find_unittype(PinpointStrike, faction.name) # Todo : refactor this legacy nonsense
for unit in set(armored_units):
self.buyArmorCombo.addItem(db.unit_type_name_2(unit) + " [$" + str(db.PRICES[unit]) + "M]", userData=unit)
self.buyArmorCombo.currentIndexChanged.connect(self.armorComboChanged)