Migrate generators to templats

- added all new templates
- deleted the generators
- added documentation
This commit is contained in:
RndName 2022-01-29 00:43:28 +01:00
parent 60c8c80480
commit 344d4e31b7
128 changed files with 2736 additions and 4198 deletions

BIN
doc/templates/ground_object_buy_menu.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

56
doc/templates/template_list.md vendored Normal file
View File

@ -0,0 +1,56 @@
| Role | Tasks | Template Name | Units |
|---------------|------------------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| AntiAir | AAA | AAA Site | <ul><li>Classes = [ AAA]</li><li>Classes = [ Logistics]</li></ul> |
| AntiAir | AAA | AAA Mobile | <ul><li>Classes = [ AAA]</li><li>Classes = [ Logistics]</li></ul> |
| AntiAir | AAA | AAA Radar Site | <ul><li>Classes = [ SearchRadar]</li><li>Classes = [ AAA]</li><li>Classes = [ Logistics]</li></ul> |
| AntiAir | AAA | Cold War Flak Site | <ul><li>Classes = [ SearchRadar]</li><li>8.8 cm Flak 18</li><li>S-60 57mm</li><li>Classes = [ AAA]</li><li>Classes = [ Logistics]</li></ul> |
| AntiAir | AAA | Flak Site | <ul><li>2 cm Flakvierling 38, 8.8 cm Flak 18, 8.8 cm Flak 36, 8.8 cm Flak 37, 8.8 cm Flak 41, 2 cm Flak 38</li><li>2 cm Flakvierling 38</li><li>8.8 cm Flak 36</li><li>SL Flakscheinwerfer 37</li><li>PU Maschinensatz_33</li><li>AAA SP Kdo.G.40</li><li>LUV Kubelwagen 82</li><li>Truck Opel Blitz</li></ul> |
| AntiAir | AAA | WW2 Flak Site | <ul><li>8.8 cm Flak 18</li><li>Truck Opel Blitz</li></ul> |
| AntiAir | AAA | WW2 Ally Flak Site | <ul><li>QF 3.7-inch AA Gun</li><li>M1 37mm Gun</li><li>M45 Quadmount</li><li>Willys Jeep</li><li>M30 Cargo Carrier</li><li>M4 High-Speed Tractor</li><li>Truck Bedford</li></ul> |
| AntiAir | MERAD | Hawk Site | <ul><li>SAM Hawk SR (AN/MPQ-50)</li><li>SAM Hawk Platoon Command Post (PCP)</li><li>SAM Hawk TR (AN/MPQ-46)</li><li>SAM Hawk LN M192</li><li>M163 Vulcan Air Defense System</li></ul> |
| AntiAir | MERAD | SA-2/S-75 Site | <ul><li>SAM P19 "Flat Face" SR (SA-2/3)</li><li>SAM SA-2 S-75 "Fan Song" TR</li><li>SAM SA-2 S-75 "Guideline" LN</li></ul> |
| AntiAir | MERAD | SA-3/S-125 Site | <ul><li>SAM P19 "Flat Face" SR (SA-2/3)</li><li>SAM SA-3 S-125 "Low Blow" TR</li><li>SAM SA-3 S-125 "Goa" LN</li></ul> |
| AntiAir | MERAD | SA-6 Kub Site | <ul><li>SAM SA-6 Kub "Straight Flush" STR</li><li>SAM SA-6 Kub "Gainful" TEL</li></ul> |
| AntiAir | MERAD | SA-11 Buk Battery | <ul><li>SAM SA-11 Buk "Gadfly" Snow Drift SR</li><li>SAM SA-11 Buk "Gadfly" C2</li><li>SAM SA-11 Buk "Gadfly" Fire Dome TEL</li></ul> |
| AntiAir | MERAD | SA-17 Grizzly Battery | <ul><li>SAM SA-11 Buk "Gadfly" Snow Drift SR</li><li>SAM SA-11 Buk "Gadfly" C2</li><li>SAM SA-17 Buk M1-2 LN 9A310M1-2</li></ul> |
| AntiAir | MERAD | NASAMS AIM-120B | <ul><li>SAM NASAMS SR MPQ64F1</li><li>SAM NASAMS C2</li><li>SAM NASAMS LN AIM-120B</li></ul> |
| AntiAir | MERAD | NASAMS AIM-120C | <ul><li>SAM NASAMS SR MPQ64F1</li><li>SAM NASAMS C2</li><li>SAM NASAMS LN AIM-120C</li></ul> |
| AntiAir | SHORAD | Rapier AA Site | <ul><li>SAM Rapier Blindfire TR</li><li>SAM Rapier Tracker</li><li>SAM Rapier LN</li></ul> |
| AntiAir | SHORAD | Roland Site | <ul><li>SAM Roland EWR</li><li>Roland 2 (Marder Chassis)</li><li>Truck M818 6x6</li></ul> |
| AntiAir | SHORAD | HQ-7 Site | <ul><li>HQ-7 Self-Propelled STR</li><li>HQ-7 Launcher</li><li>ZU-23 on Ural-375</li></ul> |
| AntiAir | SHORAD | Freya EWR Site | <ul><li>EWR FuMG-401 Freya LZ</li><li>2 cm Flakvierling 38</li><li>8.8 cm Flak 18</li><li>LUV Kubelwagen 82</li><li>Sd.Kfz.7 Tractor</li><li>LUV Kettenrad</li><li>PU Maschinensatz_33</li><li>AAA SP Kdo.G.40</li><li>Infantry Mauser 98</li></ul> |
| AntiAir | SHORAD | Short Range Anti Air Group | <ul><li>Classes = [ SHORAD]</li><li>Classes = [ Logistics]</li></ul> |
| AntiAir | LORAD | Patriot Battery | <ul><li>SAM Patriot STR</li><li>SAM Patriot CR (AMG AN/MRC-137)</li><li>SAM Patriot ECS</li><li>SAM Patriot C2 ICC</li><li>SAM Patriot EPP-III</li><li>SAM Patriot LN</li><li>Classes = [ AAA]</li><li>Classes = [ SHORAD]</li></ul> |
| AntiAir | LORAD | SA-5/S-200 Site | <ul><li>SAM SA-5 S-200 ST-68U "Tin Shield" SR</li><li>SAM SA-5 S-200 "Square Pair" TR"</li><li>Truck Ural-375</li><li>SAM SA-5 S-200 "Gammon" LN"</li></ul> |
| AntiAir | LORAD | SA-12/S-300V Battery | <ul><li>SAM SA-12 S-300V 9S15 SR</li><li>SAM SA-12 S-300V 9S19 SR</li><li>SAM SA-12 S-300V 9S457 CP</li><li>SAM SA-12 S-300V 9S32 TR</li><li>SAM SA-12 S-300V 9A82 LN</li><li>SAM SA-12 S-300V 9A83 LN</li><li>SA-19 Grison (2K22 Tunguska)</li><li>SA-15 Tor</li></ul> |
| AntiAir | LORAD | SA-20/S-300PMU-1 Battery | <ul><li>SAM SA-20 S-300PMU1 SR 5N66E</li><li>SAM SA-20 S-300PMU1 SR 64N6E</li><li>SAM SA-20 S-300PMU1 CP 54K6</li><li>SAM SA-20 S-300PMU1 TR 30N6E</li><li>SAM SA-20 S-300PMU1 LN 5P85CE</li><li>SAM SA-20 S-300PMU1 LN 5P85DE</li><li>SA-19 Grison (2K22 Tunguska)</li><li>SA-15 Tor</li></ul> |
| AntiAir | LORAD | SA-20B/S-300PMU-2 Battery | <ul><li>SAM SA-20 S-300PMU1 SR 5N66E</li><li>SAM SA-20 S-300PMU1 SR 64N6E</li><li>SAM SA-20B S-300PMU2 CP 54K6E2</li><li>SAM SA-20B S-300PMU2 TR 92H6E(truck)</li><li>SAM SA-20B S-300PMU2 LN 5P85SE2</li><li>SA-19 Grison (2K22 Tunguska)</li><li>SA-15 Tor</li></ul> |
| AntiAir | LORAD | SA-23/S-300VM Battery | <ul><li>SAM SA-23 S-300VM 9S15M2 SR</li><li>SAM SA-23 S-300VM 9S19M2 SR</li><li>SAM SA-23 S-300VM 9S457ME CP</li><li>SAM SA-23 S-300VM 9S32ME TR</li><li>SAM SA-23 S-300VM 9A82ME LN</li><li>SAM SA-23 S-300VM 9A83ME LN</li><li>SA-19 Grison (2K22 Tunguska)</li><li>SA-15 Tor</li></ul> |
| AntiAir | LORAD | SA-10/S-300PS Battery | <ul><li>SAM SA-10 S-300 "Grumble" Clam Shell SR</li><li>SAM SA-10 S-300 "Grumble" Big Bird SR</li><li>SAM SA-10 S-300 "Grumble" C2</li><li>SAM SA-10 S-300 "Grumble" Flap Lid TR</li><li>SAM SA-10 S-300 "Grumble" TEL D</li><li>SAM SA-10 S-300 "Grumble" TEL C</li><li>Classes = [ AAA]</li><li>Classes = [ SHORAD]</li></ul> |
| AntiAir | EarlyWarningRadar | Early-Warning Radar | <ul><li>Classes = [ EarlyWarningRadar]</li></ul> |
| Building | StrikeTarget | ww2bunker1 | <ul><li>Siegfried Line</li><li>Fire Control Bunker</li><li></li></ul> |
| Building | StrikeTarget | allycamp1 | <ul><li>FARP Tent</li><li>Haystack 4</li><li>Haystack 3</li><li>Concertina wire</li><li></li></ul> |
| Building | StrikeTarget | fuel1 | <ul><li>Tank</li><li>Tank 3</li></ul> |
| Building | StrikeTarget | ware1 | <ul><li>Warehouse</li><li>Hangar A</li></ul> |
| Building | StrikeTarget | farp1 | <ul><li>FARP Tent</li><li>FARP Ammo Dump Coating</li><li>FARP CP Blindage</li><li>FARP Fuel Depot</li></ul> |
| Building | StrikeTarget | derrick1 | <ul><li>Oil derrick</li><li>Pump station</li><li>Subsidiary structure 2</li></ul> |
| Building | StrikeTarget | village1 | <ul><li>Small house 1A</li><li>Small werehouse 1</li><li>Small house 1B</li></ul> |
| Building | StrikeTarget | ww2bunker2 | <ul><li>Fire Control Bunker</li><li>Siegfried Line</li><li>Concertina wire</li><li>Belgian gate</li><li>Czech hedgehogs 1</li></ul> |
| Building | Ammo | ammo1 | <ul><li>.Ammunition depot</li><li>Hangar B</li></ul> |
| Building | StrikeTarget, Comms | comms | <ul><li>TV tower, Comms tower M</li></ul> |
| Building | Oil | oil1 | <ul><li>Oil platform</li></ul> |
| Building | FOB | fob1 | <ul><li>.Command Center</li><li>Barracks 2</li><li>Garage small B</li></ul> |
| Building | StrikeTarget, Power | power1 | <ul><li>Repair workshop</li><li>Workshop A</li><li>Garage B</li><li>Farm B</li></ul> |
| Building | Factory | factory1 | <ul><li>Tech combine</li><li>Tech hangar A</li></ul> |
| Defenses | Missile | Missile | <ul><li>Classes = [ Missile]</li><li>Classes = [ Logistics]</li><li>Classes = [ AAA]</li><li>Classes = [ SHORAD]</li></ul> |
| Defenses | Coastal | Silkworm | <ul><li>Classes = [ SearchRadar]</li><li>Classes = [ Missile]</li><li>Classes = [ Logistics]</li><li>Classes = [ AAA]</li><li>Classes = [ SHORAD]</li></ul> |
| GroundForce | BaseDefense, FrontLine | Armor Group | <ul><li>Classes = [ APC, ATGM, IFV, Tank]</li></ul> |
| GroundForce | BaseDefense, FrontLine | Armor Group with Anti-Air | <ul><li>Classes = [ APC, ATGM, IFV, Tank]</li><li>Classes = [ AAA, SHORAD, Manpad]</li></ul> |
| Naval | Navy | WW2 LST Group | <ul><li>LS Samuel Chase</li><li>LST Mk.II</li></ul> |
| Naval | Navy | Russian Navy | <ul><li>Corvette 1124.4 Grish, Corvette 1241.1 Molniya</li><li>Frigate 11540 Neustrashimy, Frigate 1135M Rezky</li><li>Cruiser 1164 Moskva</li></ul> |
| Naval | Navy | Chinese Navy | <ul><li>Type 054A Frigate</li><li>Type 052C Destroyer, Type 052B Destroyer</li></ul> |
| Naval | Navy | Naval Two Ship | <ul><li>Classes = [ Destroyer, Cruiser, Boat, Submarine, LandingShip]</li></ul> |
| Naval | AircraftCarrier | Carrier Group | <ul><li>Classes = [ AircraftCarrier]</li><li>Classes = [ Destroyer]</li></ul> |
| Naval | AircraftCarrier | Carrier Strike Group 8 | <ul><li>CVN-74 John C. Stennis</li><li>DDG Arleigh Burke IIa</li><li>CG Ticonderoga</li></ul> |
| Naval | HelicopterCarrier | LHA Group | <ul><li>Classes = [ HelicopterCarrier]</li><li>Classes = [ Destroyer]</li></ul> |
| Missing Units | SK_C_28_naval_gun, house2arm | | |

BIN
doc/templates/template_miz_example.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
doc/templates/template_overview.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

202
doc/templates/templates.md vendored Normal file
View File

@ -0,0 +1,202 @@
# The Template System
The Template System is a complete rework of the generator-based logic to build theater-ground-objects (Liberation Objects).
In the original system the generator was written in python and generated a group with a defined and static logic, written in code.
The template sytem will now decouple the alignment / positioning from units and the definition of theire actual type (like Ural-375).
The template system allows to define the layout and set which unit types or classes (All logistic units for example) are able to fit into the template.
Ultimately this will allow to have generalized templates which can be reused by multiple types of units. Best example is the definition of a SAM layout.
Previously we had a generator for every different SAM Site, now we can just reuse the alignemnt (e.g. 6 Launchers in a circle alignment) with more generalization.
This also allows Users and Designers to easily create or modify templates as the new templates are defined with the DCS Mission editor and an additional .yaml file which provides mapping information.
In total the new system reduces the complexity and allows to precisely align / orient units as needed and create realistic looking ground units.
As the whole ground unit generation and handling was reworked it is now also possible to add static units to a ground object, so even Fortifcation or similar can be added to templates in the future.
## General Concept
![Overview](template_overview.png)
TODO: Describe the general flow of the Template system
TODO Lifecycle:
The template will be automatically validated on campaign generation against the player and enemy factions.
If the factions support the template (based on the unit_types and unit_classes) then it will be added to the game.
If a faction does not support a group from the template it will be removed if optional == True otherwise the complete template will be marked as unsupported and will not be used for the game.
During campaign initialization the start_generator will request unit_groups for the preset locations defined by the campaign designer. The faction will then offer possible groups and the matching template.
The Liberation Group (TheaterGroundObject) is then being generated from this UnitGroup.
- GroundWar currently does **not** use the template system
- User can buy new SAM or ArmorGroup using this template system
Example for a customized Ground Object Buy Menu which makes use of Templates and UnitGroups:
![ground_object_buy_menu.png](ground_object_buy_menu.png)
### The template miz
*Important*: Every unit_type has to be in a separate Group for the template to work.
The template system merges the groups back together later with the group_id property (defaults to 1 which means that all groups in the template will be merged to group 1)
The function of the miz is to have the positioning and alignment of all the units within the template. Coordinates and headings will be used for the generated group.
Unit Count per group has to be the amount set with the unit_count property.
During template generation the system will go through all possible units and will assign the respective unit_type to the units up to the maximum allow unit_count from the mapping.
![template_miz_example.png](template_miz_example.png)
### The template yaml
Possible Information:
| Property | Type | Required | Description | Example |
|---------------|-----------------------|----------|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| Name | (str) | Yes | A name to identify the template | `name: Armor Group` |
| Role | (GroupRole) | Yes | The role which the template should fit in | `role: AntiAir` or `role: GroundForce` |
| Tasks | (list of GroupTask) | Yes | A list of tasks which the template can fullfill | `tasks: - AAA - SHORAD` |
| Generic | (bool, default False) | No | If this is true this template will be used to create general unitGroups | |
| Description | (str) | No | Short description of the template | |
| category | (str) | No | Only used for building templates to identify the type of the building | `category: ammo` |
| Groups | (list of Groups) | Yes | see below for definition of a group | |
| template_file | (str) | No | the .miz file which has the template included. Only needed if the file has a different name than the yaml file | `template_file: resources/templates/anti_air/legacy_ground_templates.miz` |
Groups within the template are defined as following:
| Property | Type | Required | Description | Example |
|--------------|------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| name | (str) | Yes | The group name used in the .miz. Must match exactly! | |
| optional | (bool, default: False) | No | Defines wether the template can be used without this group if the faction has no access to the unit type or the user wants to disable this group | |
| group | (int, default: 1) | No | The ID of the group which the templategroup will be merged into | |
| unit_count | (list of int) | No | Amount of units to be generated for this group. Can be fixed or a range where it will be picked randomly | |
| unit_types | (list dcs unit types) | No | Specific unit_types for ground units. Complete list from pydcs: [Vehicles.py](https://github.com/pydcs/dcs/blob/master/dcs/vehicles.py). This list is extended by all supported mods! | |
| unit_classes | (list unit classes) | No | Unit_classes of supported units. Defined in [UnitClass](/game/data/units.py) | |
| statics | (list static types) | No | Specific unit_types of statics. Complete list from pydcs: [Statics.py](https://github.com/pydcs/dcs/blob/master/dcs/statics.py) | |
Complete example of a generic template for AAA Groups:
```
name: AAA Site
description: A standard AAA template
generic: true
role: AntiAir
tasks:
- AAA
groups:
- name: AAA Site 0
group: 1
unit_count:
- 2
- 6
unit_classes:
- AAA
- name: AAA Site 1
optional: true
group: 1
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz
```
### Roles, Tasks and Classes
TODO Improve Naming? Same logic as with the Squadrons.. Also brainstorm if we should rename the UnitGroup which basicly is the equivalent of a "Package"
Role and Tasking
[GroupRole and GroupTask](/game/data/groups.py)
[UnitClass](/game/data/units.py)
## How to add / modify a template
template.miz (positioning / alignment) and template.yaml (Mapping)
Best practice:
- Copy existing Template and rename the files
- Adjust the .miz and change the group names accordingly
- Adjust the .yaml file to the needs and check for the correct group names
## Migration from Generators
- All generators removed and migrated to templates
- These templates will in the next step be generalized
TODO: Update the template_list.md with the changes in Role/Tasking
[List of supported templates](template_list.md)
### Updates for Factions
With the rework there were also some changes to the faction file definitions. Older faction files can not be loaded anymore and have to be adopted to the new changes.
During migration all default factions were automatically updated, so they will work out of the box.
What was changed:
- Removed the `ewrs` list. All EWRs are now defined in the list "air_defense_units".
- Added the `air_defense_units` list. All units with the Role AntiAir can be defined here as [GroundUnitType](/game/dcs/groundunittype.py). All possible units are defined in [/resources/units/ground_units](/resources/units/ground_units)
- Added `preset_groups`. This list allows to define Preset Groups (described above) like SAM Systems consisting of Launcher, SR, TR and so on instead of adding them each to "air_defense_units". The presets are defined in [/resources/units/unit_groups](/resources/units/unit_groups)
- Migrated `air_defenses` to air_defense_units and preset_sets.
- `Missiles` are migrated to GroundUnitTypes instead of Generator names (see air_defense_units for how to use)
- Removed `cruisers`, `destroyers` and `naval_generators`. Migrated them to naval_units and preset_groups
- added `naval_units` with the correct ship name found here [/resources/units/ships](/resources/units/ships)
- `aircraft_carrier` and `helicopter_carrier` were moved to `naval_units` as well.
Possible Preset Groups:
TODO generate list with old generator name
Possible EWRs:
| Name in Faction file |
|------------------------------------------------------|
| EWR 1L13 |
| EWR 55G6 |
| MCC-SR Sborka "Dog Ear" SR |
| SAM Roland EWR |
| SAM P19 "Flat Face" SR (SA-2/3) |
| SAM Patriot STR |
| SAM SA-10 S-300 "Grumble" Big Bird SR |
| SAM SA-11 Buk "Gadfly" Snow Drift SR |
| SAM SA-6 Kub "Straight Flush" STR |
| SAM Hawk SR (AN/MPQ-50) |
| SAM SA-5 S-200 ST-68U "Tin Shield" SR |
## Unit Groups
- Sum up groups of different units which are used together (like a sam site).
- UnitGroup allows to define this logical group and add this to the faction file.
- UnitGroups can have preferred templates
# Open Points
- [x] Rework SAM Systems to unit_groups: migrated all `air_defense`
- [ ] Review Naming of all classes and so on
- [X] Improve UI Display Name for the new ShipUniType
- [ ] Verify if the campaign will be generated the same as before
- [x] Fix the generation of buildings
- [ ] Verify the handling of buildings (ammo and factory for example work different.)
- [X] Correct Missiles and Coastal (Counts?)
- [X] Faction Group Count (Navy, Missile, Coastal).. used for?? For nothing! removed.
- [x] Navy Generators -> Destroyers, Cruisers und Preset_groups Migration
- [x] Fix & Generalize Navy Templates (wrong unit number)
- [X] Fix Bug: Enemy Navy PLanes spawn at blue Carrier.
- [x] Add Naming for all AircraftCarrier and HelicopterCarrier (whats with the SC updated ones?)
- [X] Verfiy SuperCarrier Upgrade
- [X] Special Handling for Carrier Strike Group 8 (was not even working before..) can now be added as preset group
- [X] Validate that all Waypoints and taskings are correct and working (some use the group.name)
- [ ] Verify that DEAD Flights are untouched from these changes.. They are missing a attack command
- [ ] Finish Documentation
- [ ] Naming of created groups -> It uses the template name currently which is not great
- [x] Fix the Faction overview site not showing the newly added preset_groups and AA Units
- [ ] Add missing classes to the units so that they can be used by the templates
- [x] Replace BuyUi implementation from Template to "Preset" by using the available UnitGroups
- [x] Fix Buy menu for Armor Groups.
- [x] Fix Buy menu not allowing to change the amount when only one unit_type is available.
- [x] Fix Group order is not correct (group2 is 0, group1 is 1 if dcs_group id for group2 is smaller)
- [ ] Add generalized Templates for Lorad and Merad
- [ ] Generalize all Templates

View File

@ -1,223 +0,0 @@
from __future__ import annotations
import logging
import math
import operator
from collections.abc import Iterable
from typing import Any, Generic, TYPE_CHECKING, Type, TypeVar, Iterator
from dcs import unitgroup
from dcs.mapping import Point
from dcs.point import PointAction
from dcs.unit import Ship, Unit, Vehicle
from dcs.unitgroup import ShipGroup, VehicleGroup
from dcs.unittype import ShipType, UnitType, VehicleType
from game.dcs.groundunittype import GroundUnitType
from game.factions.faction import Faction
from game.theater import MissionTarget
from game.theater.theatergroundobject import NavalGroundObject, TheaterGroundObject
from game.utils import Heading
if TYPE_CHECKING:
from game.game import Game
GroupT = TypeVar("GroupT", VehicleGroup, ShipGroup)
UnitT = TypeVar("UnitT", bound=Unit)
UnitTypeT = TypeVar("UnitTypeT", bound=Type[UnitType])
TgoT = TypeVar("TgoT", bound=TheaterGroundObject)
# TODO: Generate a group description rather than a pydcs group.
# It appears that all of this work gets redone at miz generation time (see
# groundobjectsgen for an example). We can do less work and include the data we
# care about in the format we want if we just generate our own group description
# types rather than pydcs groups.
class GroupGenerator(Generic[GroupT, UnitT, UnitTypeT, TgoT]):
def __init__(self, game: Game, ground_object: TgoT, group: GroupT) -> None:
self.game = game
self.go = ground_object
self.position = ground_object.position
self.heading: Heading = Heading.random()
self.price = 0
self.vg: GroupT = group
self.auxiliary_groups: list[GroupT] = []
def generate(self) -> None:
raise NotImplementedError
def get_generated_group(self) -> GroupT:
return self.vg
@property
def groups(self) -> Iterator[GroupT]:
yield self.vg
yield from self.auxiliary_groups
def add_unit(
self,
unit_type: UnitTypeT,
name: str,
pos_x: float,
pos_y: float,
heading: Heading,
) -> UnitT:
return self.add_unit_to_group(
self.vg, unit_type, name, Point(pos_x, pos_y), heading
)
def add_unit_to_group(
self,
group: GroupT,
unit_type: UnitTypeT,
name: str,
position: Point,
heading: Heading,
) -> UnitT:
raise NotImplementedError
def heading_to_conflict(self) -> Heading:
# Heading for a Group to the enemy.
# Should be the point between the nearest and the most distant conflict
conflicts: dict[MissionTarget, float] = {}
for conflict in self.game.theater.conflicts():
conflicts[conflict] = conflict.distance_to(self.go)
if len(conflicts) == 0:
return self.heading
closest_conflict = min(conflicts.items(), key=operator.itemgetter(1))[0]
most_distant_conflict = max(conflicts.items(), key=operator.itemgetter(1))[0]
conflict_center = Point(
(closest_conflict.position.x + most_distant_conflict.position.x) / 2,
(closest_conflict.position.y + most_distant_conflict.position.y) / 2,
)
return Heading.from_degrees(
self.go.position.heading_between_point(conflict_center)
)
class VehicleGroupGenerator(
Generic[TgoT], GroupGenerator[VehicleGroup, Vehicle, Type[VehicleType], TgoT]
):
def __init__(self, game: Game, ground_object: TgoT) -> None:
super().__init__(
game,
ground_object,
unitgroup.VehicleGroup(game.next_group_id(), ground_object.group_name),
)
wp = self.vg.add_waypoint(self.position, PointAction.OffRoad, 0)
wp.ETA_locked = True
def add_vehicle_group(self) -> VehicleGroup:
gid = self.game.next_group_id()
group = VehicleGroup(gid, f"{self.go.group_name} #{len(self.auxiliary_groups)}")
self.auxiliary_groups.append(group)
return group
def generate(self) -> None:
raise NotImplementedError
def add_unit_to_group(
self,
group: VehicleGroup,
unit_type: Type[VehicleType],
name: str,
position: Point,
heading: Heading,
) -> Vehicle:
unit = Vehicle(self.game.next_unit_id(), f"{group.name}|{name}", unit_type.id)
unit.position = position
unit.heading = heading.degrees
group.add_unit(unit)
# get price of unit to calculate the real price of the whole group
try:
ground_unit_type = next(GroundUnitType.for_dcs_type(unit_type))
self.price += ground_unit_type.price
except StopIteration:
logging.error(f"Cannot get price for unit {unit_type.name}")
return unit
def get_circular_position(
self, num_units: int, launcher_distance: int, coverage: int = 90
) -> Iterable[tuple[float, float, Heading]]:
"""
Given a position on the map, array a group of units in a circle a uniform distance from the unit
:param num_units:
number of units to play on the circle
:param launcher_distance:
distance the units should be from the center unit
:param coverage:
0-360
:return:
list of tuples representing each unit location
[(pos_x, pos_y, heading), ...]
"""
if coverage == 360:
# one of the positions is shared :'(
outer_offset = coverage / num_units
else:
outer_offset = coverage / (num_units - 1)
positions = []
if num_units % 2 == 0:
current_offset = self.heading.degrees - ((coverage / (num_units - 1)) / 2)
else:
current_offset = self.heading.degrees
current_offset -= outer_offset * (math.ceil(num_units / 2) - 1)
for _ in range(1, num_units + 1):
x: float = self.position.x + launcher_distance * math.cos(
math.radians(current_offset)
)
y: float = self.position.y + launcher_distance * math.sin(
math.radians(current_offset)
)
positions.append((x, y, Heading.from_degrees(current_offset)))
current_offset += outer_offset
return positions
class ShipGroupGenerator(
GroupGenerator[ShipGroup, Ship, Type[ShipType], NavalGroundObject]
):
"""Abstract class for other ship generator classes"""
def __init__(self, game: Game, ground_object: NavalGroundObject, faction: Faction):
super().__init__(
game,
ground_object,
unitgroup.ShipGroup(game.next_group_id(), ground_object.group_name),
)
self.faction = faction
wp = self.vg.add_waypoint(self.position, 0)
wp.ETA_locked = True
def add_auxiliary_group(self) -> ShipGroup:
gid = self.game.next_group_id()
group = ShipGroup(gid, f"{self.go.group_name} #{len(self.auxiliary_groups)}")
self.auxiliary_groups.append(group)
return group
def generate(self) -> None:
raise NotImplementedError
def add_unit_to_group(
self,
group: ShipGroup,
unit_type: Type[ShipType],
name: str,
position: Point,
heading: Heading,
) -> Ship:
unit = Ship(self.game.next_unit_id(), f"{self.go.group_name}|{name}", unit_type)
unit.position = position
unit.heading = heading.degrees
group.add_unit(unit)
return unit

View File

@ -1,35 +0,0 @@
import random
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class BoforsGenerator(AirDefenseGroupGenerator):
"""
This generate a Bofors flak artillery group
"""
name = "Bofors AAA"
def generate(self) -> None:
index = 0
for i in range(4):
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
index = index + 1
self.add_unit(
AirDefence.Bofors40,
"AAA#" + str(index),
self.position.x + spacing_x * i,
self.position.y + spacing_y * i,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,99 +0,0 @@
import random
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from game.utils import Heading
GFLAK = [
AirDefence.Flak38,
AirDefence.Flak18,
AirDefence.Flak36,
AirDefence.Flak37,
AirDefence.Flak41,
AirDefence.Flak30,
]
class FlakGenerator(AirDefenseGroupGenerator):
"""
This generate a German flak artillery group
"""
name = "Flak Site"
def generate(self) -> None:
index = 0
mixed = random.choice([True, False])
unit_type = random.choice(GFLAK)
for i in range(4):
index = index + 1
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
self.add_unit(
unit_type,
"AAA#" + str(index),
self.position.x + spacing_x * i + random.randint(1, 5),
self.position.y + spacing_y * i + random.randint(1, 5),
self.heading,
)
if mixed:
unit_type = random.choice(GFLAK)
# Search lights
search_pos = self.get_circular_position(random.randint(2, 3), 80)
for index, pos in enumerate(search_pos):
self.add_unit(
AirDefence.Flakscheinwerfer_37,
"SearchLight#" + str(index),
pos[0],
pos[1],
self.heading,
)
# Support
self.add_unit(
AirDefence.Maschinensatz_33,
"MC33#",
self.position.x - 20,
self.position.y - 20,
self.heading,
)
self.add_unit(
AirDefence.KDO_Mod40,
"KDO#",
self.position.x - 25,
self.position.y - 20,
self.heading,
)
# Commander
self.add_unit(
Unarmed.Kubelwagen_82,
"Kubel#",
self.position.x - 35,
self.position.y - 20,
self.heading,
)
# Some Opel Blitz trucks
index = 0
for i in range(int(max(1, 2))):
for j in range(int(max(1, 2))):
index += 1
self.add_unit(
Unarmed.Blitz_36_6700A,
"BLITZ#" + str(index),
self.position.x + 125 + 15 * i + random.randint(1, 5),
self.position.y + 15 * j + random.randint(1, 5),
Heading.from_degrees(75),
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,45 +0,0 @@
import random
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class Flak18Generator(AirDefenseGroupGenerator):
"""
This generate a German flak artillery group using only free units, thus not requiring the WW2 asset pack
"""
name = "WW2 Flak Site"
def generate(self) -> None:
spacing = random.randint(30, 60)
index = 0
for i in range(3):
for j in range(2):
index = index + 1
self.add_unit(
AirDefence.Flak18,
"AAA#" + str(index),
self.position.x + spacing * i + random.randint(1, 5),
self.position.y + spacing * j + random.randint(1, 5),
self.heading,
)
# Add a commander truck
self.add_unit(
Unarmed.Blitz_36_6700A,
"Blitz#",
self.position.x - 35,
self.position.y - 20,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,41 +0,0 @@
import random
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from pydcs_extensions.highdigitsams import highdigitsams
class KS19Generator(AirDefenseGroupGenerator):
"""
This generate a KS 19 flak artillery group (KS-19 from the High Digit SAM mod)
"""
name = "KS-19 AAA Site"
def generate(self) -> None:
self.add_unit(
highdigitsams.AAA_SON_9_Fire_Can,
"TR",
self.position.x - 20,
self.position.y - 20,
self.heading,
)
index = 0
for i in range(4):
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
index = index + 1
self.add_unit(
highdigitsams.AAA_100mm_KS_19,
"AAA#" + str(index),
self.position.x + spacing_x * i,
self.position.y + spacing_y * i,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,81 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from game.utils import Heading
class AllyWW2FlakGenerator(AirDefenseGroupGenerator):
"""
This generate an ally flak artillery group
"""
name = "WW2 Ally Flak Site"
def generate(self) -> None:
positions = self.get_circular_position(4, launcher_distance=30, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.QF_37_AA,
"AA#" + str(i),
position[0],
position[1],
position[2],
)
positions = self.get_circular_position(8, launcher_distance=60, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.M1_37mm,
"AA#" + str(4 + i),
position[0],
position[1],
position[2],
)
positions = self.get_circular_position(8, launcher_distance=90, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.M45_Quadmount,
"AA#" + str(12 + i),
position[0],
position[1],
position[2],
)
# Add a commander truck
self.add_unit(
Unarmed.Willys_MB,
"CMD#1",
self.position.x,
self.position.y - 20,
Heading.random(),
)
self.add_unit(
Unarmed.M30_CC,
"LOG#1",
self.position.x,
self.position.y + 20,
Heading.random(),
)
self.add_unit(
Unarmed.M4_Tractor,
"LOG#2",
self.position.x + 20,
self.position.y,
Heading.random(),
)
self.add_unit(
Unarmed.Bedford_MWD,
"LOG#3",
self.position.x - 20,
self.position.y,
Heading.random(),
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,32 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZSU57Generator(AirDefenseGroupGenerator):
"""
This generate a Zsu 57 group
"""
name = "ZSU-57-2 Group"
def generate(self) -> None:
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=110, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.ZSU_57_2,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,34 +0,0 @@
import random
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZU23InsurgentGenerator(AirDefenseGroupGenerator):
"""
This generate a ZU23 insurgent flak artillery group
"""
name = "Zu-23 Site"
def generate(self) -> None:
index = 0
for i in range(4):
index = index + 1
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
self.add_unit(
AirDefence.ZU_23_Closed_Insurgent,
"AAA#" + str(index),
self.position.x + spacing_x * i,
self.position.y + spacing_y * i,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,66 +0,0 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Iterator, List
from dcs.unitgroup import VehicleGroup
from game import Game
from game.theater.theatergroundobject import (
SamGroundObject,
SkynetRole,
AirDefenseRange,
)
from gen.group_generator import VehicleGroupGenerator
class AirDefenseGroupGenerator(VehicleGroupGenerator[SamGroundObject], ABC):
"""
This is the base for all SAM group generators
"""
def __init__(self, game: Game, ground_object: SamGroundObject) -> None:
super().__init__(game, ground_object)
self.vg.name = self.group_name_for_role(self.vg.id, self.primary_group_role())
self.auxiliary_groups: List[VehicleGroup] = []
def add_auxiliary_group(self, role: SkynetRole) -> VehicleGroup:
gid = self.game.next_group_id()
group = VehicleGroup(gid, self.group_name_for_role(gid, role))
self.auxiliary_groups.append(group)
return group
def group_name_for_role(self, gid: int, role: SkynetRole) -> str:
if role is SkynetRole.NoSkynetBehavior:
# No special naming needed for air defense groups that don't participate in
# Skynet.
return f"{self.go.group_name}|{gid}"
# For those that do, we need a prefix of `$COLOR|SAM| so our Skynet config picks
# the group up at all. To support PDs we need to append the ID of the TGO so
# that the PD will know which group it's protecting. We then append the role so
# our config knows what to do with the group, and finally the GID of *this*
# group to ensure no conflicts.
return "|".join([self.go.faction_color, "SAM", role.value, str(gid)])
def get_generated_group(self) -> VehicleGroup:
raise RuntimeError(
"Deprecated call to AirDefenseGroupGenerator.get_generated_group "
"misses auxiliary groups. Use AirDefenseGroupGenerator.groups "
"instead."
)
@property
def groups(self) -> Iterator[VehicleGroup]:
yield self.vg
yield from self.auxiliary_groups
@classmethod
@abstractmethod
def range(cls) -> AirDefenseRange:
...
@classmethod
def primary_group_role(cls) -> SkynetRole:
return cls.range().default_role

View File

@ -1,63 +0,0 @@
import random
from typing import Optional
from dcs.unitgroup import VehicleGroup
from game import Game
from game.data.units import UnitClass
from game.dcs.groundunittype import GroundUnitType
from game.factions import FACTIONS
from game.theater.theatergroundobject import VehicleGroupGroundObject
from gen.to_remove.armored_group_generator import (
ArmoredGroupGenerator,
FixedSizeArmorGroupGenerator,
)
def generate_armor_group(
faction: str, game: Game, ground_object: VehicleGroupGroundObject
) -> Optional[VehicleGroup]:
"""
This generate a group of ground units
:return: Generated group
"""
armor_types = (
UnitClass.Apc,
UnitClass.Atgm,
UnitClass.Ifv,
UnitClass.Tank,
)
possible_unit = [
u for u in FACTIONS[faction].frontline_units if u.unit_class in armor_types
]
if len(possible_unit) > 0:
unit_type = random.choice(possible_unit)
return generate_armor_group_of_type(game, ground_object, unit_type)
return None
def generate_armor_group_of_type(
game: Game, ground_object: VehicleGroupGroundObject, unit_type: GroundUnitType
) -> VehicleGroup:
"""
This generate a group of ground units of given type
:return: Generated group
"""
generator = ArmoredGroupGenerator(game, ground_object, unit_type)
generator.generate()
return generator.get_generated_group()
def generate_armor_group_of_type_and_size(
game: Game,
ground_object: VehicleGroupGroundObject,
unit_type: GroundUnitType,
size: int,
) -> VehicleGroup:
"""
This generate a group of ground units of given type and size
:return: Generated group
"""
generator = FixedSizeArmorGroupGenerator(game, ground_object, unit_type, size)
generator.generate()
return generator.get_generated_group()

View File

@ -1,84 +0,0 @@
import random
import dcs.vehicles
from dcs import Point
from game import Game
from game.dcs.groundunittype import GroundUnitType
from game.theater.theatergroundobject import VehicleGroupGroundObject
from game.utils import Heading
from gen.group_generator import VehicleGroupGenerator
class ArmoredGroupGenerator(VehicleGroupGenerator[VehicleGroupGroundObject]):
def __init__(
self,
game: Game,
ground_object: VehicleGroupGroundObject,
unit_type: GroundUnitType,
) -> None:
super().__init__(game, ground_object)
self.unit_type = unit_type
self.heading = Heading.from_degrees(0)
def generate(self) -> None:
grid_x = random.randint(2, 3)
grid_y = random.randint(1, 2)
spacing = random.randint(30, 80)
index = 0
for i in range(grid_x):
for j in range(grid_y):
index = index + 1
self.add_unit(
self.unit_type.dcs_unit_type,
"Armor#" + str(index),
self.position.x + spacing * i,
self.position.y + spacing * j,
self.heading,
)
class FixedSizeArmorGroupGenerator(VehicleGroupGenerator[VehicleGroupGroundObject]):
def __init__(
self,
game: Game,
ground_object: VehicleGroupGroundObject,
unit_type: GroundUnitType,
size: int,
) -> None:
super().__init__(game, ground_object)
self.unit_type = unit_type
self.size = size
self.spacing = random.randint(20, 70)
self.heading = Heading.from_degrees(0)
def generate(self) -> None:
index = 0
for i in range(self.size):
index = index + 1
self.add_unit(
self.unit_type.dcs_unit_type,
"Armor#" + str(index),
self.position.x + self.spacing * i,
self.position.y,
self.heading,
)
class FixedSizeArmorGroupGeneratorWithAA(FixedSizeArmorGroupGenerator):
def generate(self) -> None:
super(FixedSizeArmorGroupGeneratorWithAA, self).generate()
aux_group = self.add_vehicle_group()
index = 0
for i in [1, 2]:
index = index + 1
self.add_unit_to_group(
aux_group,
dcs.vehicles.AirDefence.M6_Linebacker,
"Anti Air#" + str(index),
Point(self.position.x - self.spacing * i, self.position.y),
self.heading,
)

View File

@ -1,124 +0,0 @@
import random
import dcs.ships
from dcs import Point
from gen.group_generator import ShipGroupGenerator
from game.utils import Heading
from dcs.ships import USS_Arleigh_Burke_IIa, TICONDEROG
class CarrierGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
self.add_unit(
dcs.ships.Stennis,
"Carrier",
self.position.x,
self.position.y,
self.heading,
)
aux_group = self.add_auxiliary_group()
# Add destroyers escort
dd_type = dcs.ships.USS_Arleigh_Burke_IIa
self.add_unit_to_group(
aux_group,
dd_type,
"DD1",
Point(self.position.x + 2500, self.position.y + 4500),
self.heading,
)
self.add_unit_to_group(
aux_group,
dd_type,
"DD2",
Point(self.position.x + 2500, self.position.y - 4500),
self.heading,
)
self.add_unit_to_group(
aux_group,
dd_type,
"DD3",
Point(self.position.x + 4500, self.position.y + 8500),
self.heading,
)
self.add_unit_to_group(
aux_group,
dd_type,
"DD4",
Point(self.position.x + 4500, self.position.y - 8500),
self.heading,
)
self.get_generated_group().points[0].speed = 20
class CarrierStrikeGroup8Generator(ShipGroupGenerator):
def generate(self) -> None:
# Carrier Strike Group 8
carrier_type = dcs.ships.Stennis
self.add_unit(
carrier_type,
"CVN-75 Harry S. Truman",
self.position.x,
self.position.y,
self.heading,
)
aux_group = self.add_auxiliary_group()
# Add Arleigh Burke escort
self.add_unit_to_group(
aux_group,
USS_Arleigh_Burke_IIa,
"USS Ramage",
Point(self.position.x + 6482, self.position.y + 6667),
self.heading,
)
self.add_unit_to_group(
aux_group,
USS_Arleigh_Burke_IIa,
"USS Mitscher",
Point(self.position.x - 7963, self.position.y + 7037),
self.heading,
)
self.add_unit_to_group(
aux_group,
USS_Arleigh_Burke_IIa,
"USS Forrest Sherman",
Point(self.position.x - 7408, self.position.y - 7408),
self.heading,
)
self.add_unit_to_group(
aux_group,
USS_Arleigh_Burke_IIa,
"USS Lassen",
Point(self.position.x + 8704, self.position.y - 6296),
self.heading,
)
# Add Ticonderoga escort
if self.heading >= Heading.from_degrees(180):
self.add_unit_to_group(
aux_group,
TICONDEROG,
"USS Hué City",
Point(self.position.x + 2222, self.position.y - 3333),
self.heading,
)
else:
self.add_unit_to_group(
aux_group,
TICONDEROG,
"USS Hué City",
Point(self.position.x - 3333, self.position.y + 2222),
self.heading,
)
self.get_generated_group().points[0].speed = 20

View File

@ -1,59 +0,0 @@
from __future__ import annotations
import random
from typing import TYPE_CHECKING
from dcs.ships import (
Type_052C,
Type_052B,
Type_054A,
)
from game.factions.faction import Faction
from game.theater.theatergroundobject import ShipGroundObject
from gen.to_remove.dd_group import DDGroupGenerator
from gen.group_generator import ShipGroupGenerator
if TYPE_CHECKING:
from game.game import Game
class ChineseNavyGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
self.add_unit(
Type_054A,
"FF1",
self.position.x + 1200,
self.position.y + 900,
self.heading,
)
self.add_unit(
Type_054A,
"FF2",
self.position.x + 1200,
self.position.y - 900,
self.heading,
)
self.add_unit(
Type_052C,
"DD1",
self.position.x + 2400,
self.position.y + 900,
self.heading,
)
self.add_unit(
Type_052C,
"DD2",
self.position.x + 2400,
self.position.y - 900,
self.heading,
)
self.get_generated_group().points[0].speed = 20
class Type54GroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(Type54GroupGenerator, self).__init__(
game, ground_object, faction, Type_054A
)

View File

@ -1,13 +0,0 @@
import logging
import random
from typing import Optional
from dcs.unitgroup import VehicleGroup
from game import db, Game
from game.theater.theatergroundobject import CoastalSiteGroundObject
from gen.to_remove.silkworm import SilkwormGenerator
COASTAL_MAP = {
"SilkwormGenerator": SilkwormGenerator,
}

View File

@ -1,153 +0,0 @@
import random
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class EarlyColdWarFlakGenerator(AirDefenseGroupGenerator):
"""
This generator attempt to mimic an early cold-war era flak AAA site.
The Flak 18 88mm is used as the main long range gun, S-60 is used as a mid range gun and 2 Bofors 40mm guns provide short range protection.
This does not include search lights and telemeter computer (Kdo.G 40) because these are paid units only available in WW2 asset pack
"""
name = "Early Cold War Flak Site"
def generate(self) -> None:
spacing = random.randint(30, 60)
index = 0
# Long range guns
for i in range(3):
for j in range(2):
index = index + 1
self.add_unit(
AirDefence.Flak18,
"AAA#" + str(index),
self.position.x + spacing * i + random.randint(1, 5),
self.position.y + spacing * j + random.randint(1, 5),
self.heading,
)
# Medium range guns
self.add_unit(
AirDefence.S_60_Type59_Artillery,
"SHO#1",
self.position.x - 40,
self.position.y - 40,
self.heading.opposite,
),
self.add_unit(
AirDefence.S_60_Type59_Artillery,
"SHO#2",
self.position.x + spacing * 2 + 40,
self.position.y + spacing + 40,
self.heading,
),
# Short range guns
self.add_unit(
AirDefence.ZU_23_Emplacement_Closed,
"SHO#3",
self.position.x - 80,
self.position.y - 40,
self.heading.opposite,
),
self.add_unit(
AirDefence.ZU_23_Emplacement_Closed,
"SHO#4",
self.position.x + spacing * 2 + 80,
self.position.y + spacing + 40,
self.heading,
),
# Add a truck
self.add_unit(
Unarmed.KAMAZ_Truck,
"Truck#",
self.position.x - 60,
self.position.y - 20,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA
class ColdWarFlakGenerator(AirDefenseGroupGenerator):
"""
This generator attempt to mimic a cold-war era flak AAA site.
The Flak 18 88mm is used as the main long range gun, 2 S-60 57mm gun improve mid range firepower, while 2 Zu-23 guns even provide short range protection.
The site is also fitted with a P-19 radar for early detection.
"""
name = "Cold War Flak Site"
def generate(self) -> None:
spacing = random.randint(30, 60)
index = 0
# Long range guns
for i in range(3):
for j in range(2):
index = index + 1
self.add_unit(
AirDefence.Flak18,
"AAA#" + str(index),
self.position.x + spacing * i + random.randint(1, 5),
self.position.y + spacing * j + random.randint(1, 5),
self.heading,
)
# Medium range guns
self.add_unit(
AirDefence.S_60_Type59_Artillery,
"SHO#1",
self.position.x - 40,
self.position.y - 40,
self.heading.opposite,
),
self.add_unit(
AirDefence.S_60_Type59_Artillery,
"SHO#2",
self.position.x + spacing * 2 + 40,
self.position.y + spacing + 40,
self.heading,
),
# Short range guns
self.add_unit(
AirDefence.ZU_23_Emplacement_Closed,
"SHO#3",
self.position.x - 80,
self.position.y - 40,
self.heading.opposite,
),
self.add_unit(
AirDefence.ZU_23_Emplacement_Closed,
"SHO#4",
self.position.x + spacing * 2 + 80,
self.position.y + spacing + 40,
self.heading,
),
# Add a P19 Radar for EWR
self.add_unit(
AirDefence.P_19_s_125_sr,
"SR#0",
self.position.x - 60,
self.position.y - 20,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,56 +0,0 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Type
from dcs.ships import PERRY, USS_Arleigh_Burke_IIa
from dcs.unittype import ShipType
from game.factions.faction import Faction
from game.theater.theatergroundobject import ShipGroundObject
from gen.group_generator import ShipGroupGenerator
if TYPE_CHECKING:
from game.game import Game
class DDGroupGenerator(ShipGroupGenerator):
def __init__(
self,
game: Game,
ground_object: ShipGroundObject,
faction: Faction,
ddtype: Type[ShipType],
):
super(DDGroupGenerator, self).__init__(game, ground_object, faction)
self.ddtype = ddtype
def generate(self) -> None:
self.add_unit(
self.ddtype,
"DD1",
self.position.x + 500,
self.position.y + 900,
self.heading,
)
self.add_unit(
self.ddtype,
"DD2",
self.position.x + 500,
self.position.y - 900,
self.heading,
)
self.get_generated_group().points[0].speed = 20
class OliverHazardPerryGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(OliverHazardPerryGroupGenerator, self).__init__(
game, ground_object, faction, PERRY
)
class ArleighBurkeGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(ArleighBurkeGroupGenerator, self).__init__(
game, ground_object, faction, USS_Arleigh_Burke_IIa
)

View File

@ -1,27 +0,0 @@
from gen.to_remove.ewrs import (
BigBirdGenerator,
BoxSpringGenerator,
DogEarGenerator,
FlatFaceGenerator,
HawkEwrGenerator,
PatriotEwrGenerator,
RolandEwrGenerator,
SnowDriftGenerator,
StraightFlushGenerator,
TallRackGenerator,
TinShieldGenerator,
)
EWR_MAP = {
"BoxSpringGenerator": BoxSpringGenerator,
"TallRackGenerator": TallRackGenerator,
"DogEarGenerator": DogEarGenerator,
"RolandEwrGenerator": RolandEwrGenerator,
"FlatFaceGenerator": FlatFaceGenerator,
"PatriotEwrGenerator": PatriotEwrGenerator,
"BigBirdGenerator": BigBirdGenerator,
"SnowDriftGenerator": SnowDriftGenerator,
"StraightFlushGenerator": StraightFlushGenerator,
"HawkEwrGenerator": HawkEwrGenerator,
"TinShieldGenerator": TinShieldGenerator,
}

View File

@ -1,114 +0,0 @@
from typing import Type
from dcs.unittype import VehicleType
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import EwrGroundObject
from gen.group_generator import VehicleGroupGenerator
class EwrGenerator(VehicleGroupGenerator[EwrGroundObject]):
unit_type: Type[VehicleType] = AirDefence.P_19_s_125_sr
@classmethod
def name(cls) -> str:
return cls.unit_type.name
def generate(self) -> None:
self.add_unit(
self.unit_type,
"EWR",
self.position.x,
self.position.y,
self.heading,
)
class BoxSpringGenerator(EwrGenerator):
"""1L13 "Box Spring" EWR."""
unit_type = AirDefence._1L13_EWR
class TallRackGenerator(EwrGenerator):
"""55G6 "Tall Rack" EWR."""
unit_type = AirDefence._55G6_EWR
class DogEarGenerator(EwrGenerator):
"""9S80M1 "Dog Ear" EWR.
This is the SA-8 search radar, but used as an early warning radar.
"""
unit_type = AirDefence.Dog_Ear_radar
class RolandEwrGenerator(EwrGenerator):
"""Roland EWR.
This is the Roland search radar, but used as an early warning radar.
"""
unit_type = AirDefence.Roland_Radar
class FlatFaceGenerator(EwrGenerator):
"""P-19 "Flat Face" EWR.
This is the SA-3 search radar, but used as an early warning radar.
"""
unit_type = AirDefence.P_19_s_125_sr
class PatriotEwrGenerator(EwrGenerator):
"""Patriot EWR.
This is the Patriot search/track radar, but used as an early warning radar.
"""
unit_type = AirDefence.Patriot_str
class BigBirdGenerator(EwrGenerator):
"""64H6E "Big Bird" EWR.
This is the SA-10 track radar, but used as an early warning radar.
"""
unit_type = AirDefence.S_300PS_64H6E_sr
class SnowDriftGenerator(EwrGenerator):
"""9S18M1 "Snow Drift" EWR.
This is the SA-11 search radar, but used as an early warning radar.
"""
unit_type = AirDefence.SA_11_Buk_SR_9S18M1
class StraightFlushGenerator(EwrGenerator):
"""1S91 "Straight Flush" EWR.
This is the SA-6 search/track radar, but used as an early warning radar.
"""
unit_type = AirDefence.Kub_1S91_str
class HawkEwrGenerator(EwrGenerator):
"""Hawk EWR.
This is the Hawk search radar, but used as an early warning radar.
"""
unit_type = AirDefence.Hawk_sr
class TinShieldGenerator(EwrGenerator):
"""19ZH6 "Tin Shield" EWR."""
unit_type = AirDefence.RLS_19J6

View File

@ -1,110 +0,0 @@
from dcs.vehicles import AirDefence, Infantry, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from game.utils import Heading
class FreyaGenerator(AirDefenseGroupGenerator):
"""
This generate a German flak artillery group using only free units, thus not requiring the WW2 asset pack
"""
name = "Freya EWR Site"
def generate(self) -> None:
# TODO : would be better with the Concrete structure that is supposed to protect it
self.add_unit(
AirDefence.FuMG_401,
"EWR#1",
self.position.x,
self.position.y,
self.heading,
)
positions = self.get_circular_position(4, launcher_distance=50, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Flak38,
"AA#" + str(i),
position[0],
position[1],
position[2],
)
positions = self.get_circular_position(4, launcher_distance=100, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Flak18,
"AA#" + str(4 + i),
position[0],
position[1],
position[2],
)
# Command/Logi
self.add_unit(
Unarmed.Kubelwagen_82,
"Kubel#1",
self.position.x - 20,
self.position.y - 20,
self.heading,
)
self.add_unit(
Unarmed.Sd_Kfz_7,
"Sdkfz#1",
self.position.x + 20,
self.position.y + 22,
self.heading,
)
self.add_unit(
Unarmed.Sd_Kfz_2,
"Sdkfz#2",
self.position.x - 22,
self.position.y + 20,
self.heading,
)
# Maschinensatz_33 and Kdo.g 40 Telemeter
self.add_unit(
AirDefence.Maschinensatz_33,
"Energy#1",
self.position.x + 20,
self.position.y - 20,
self.heading,
)
self.add_unit(
AirDefence.KDO_Mod40,
"Telemeter#1",
self.position.x + 20,
self.position.y - 10,
self.heading,
)
self.add_unit(
Infantry.Soldier_mauser98,
"Inf#1",
self.position.x + 20,
self.position.y - 14,
self.heading,
)
self.add_unit(
Infantry.Soldier_mauser98,
"Inf#2",
self.position.x + 20,
self.position.y - 22,
self.heading,
)
self.add_unit(
Infantry.Soldier_mauser98,
"Inf#3",
self.position.x + 20,
self.position.y - 24,
self.heading + Heading.from_degrees(45),
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,13 +0,0 @@
from dcs.ships import La_Combattante_II
from game import Game
from game.factions.faction import Faction
from game.theater.theatergroundobject import ShipGroundObject
from gen.to_remove.dd_group import DDGroupGenerator
class LaCombattanteIIGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(LaCombattanteIIGroupGenerator, self).__init__(
game, ground_object, faction, La_Combattante_II
)

View File

@ -1,39 +0,0 @@
import random
import dcs.ships
from dcs import Point
from gen.group_generator import ShipGroupGenerator
class LHAGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
# Add carrier
self.add_unit(
dcs.ships.LHA_Tarawa,
"LHA",
self.position.x,
self.position.y,
self.heading,
)
# Add destroyers escort
aux_group = self.add_auxiliary_group()
dd_type = dcs.ships.USS_Arleigh_Burke_IIa
self.add_unit_to_group(
aux_group,
dd_type,
"DD1",
Point(self.position.x + 1250, self.position.y + 1450),
self.heading,
)
self.add_unit_to_group(
aux_group,
dd_type,
"DD2",
Point(self.position.x + 1250, self.position.y - 1450),
self.heading,
)
self.get_generated_group().points[0].speed = 20

View File

@ -1,12 +0,0 @@
import logging
import random
from typing import Optional
from dcs.unitgroup import VehicleGroup
from game import db, Game
from game.theater.theatergroundobject import MissileSiteGroundObject
from gen.to_remove.scud_site import ScudGenerator
from gen.to_remove.v1_group import V1GroupGenerator
MISSILES_MAP = {"V1GroupGenerator": V1GroupGenerator, "ScudGenerator": ScudGenerator}

View File

@ -1,92 +0,0 @@
from __future__ import annotations
import random
from typing import TYPE_CHECKING
from dcs.ships import (
ALBATROS,
MOLNIYA,
NEUSTRASH,
REZKY,
MOSCOW,
KILO,
SOM,
)
from game.factions.faction import Faction
from game.theater.theatergroundobject import ShipGroundObject
from gen.to_remove.dd_group import DDGroupGenerator
from gen.group_generator import ShipGroupGenerator
if TYPE_CHECKING:
from game.game import Game
class RussianNavyGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
self.add_unit(
ALBATROS,
"FF1",
self.position.x + 1200,
self.position.y + 900,
self.heading,
)
self.add_unit(
ALBATROS,
"FF2",
self.position.x + 1200,
self.position.y - 900,
self.heading,
)
self.add_unit(
NEUSTRASH,
"DD1",
self.position.x + 2400,
self.position.y + 900,
self.heading,
)
self.add_unit(
NEUSTRASH,
"DD2",
self.position.x + 2400,
self.position.y - 900,
self.heading,
)
# Only include the Moskva for now, the Pyotry Velikiy is an unkillable monster.
# See https://github.com/dcs-liberation/dcs_liberation/issues/567
self.add_unit(
MOSCOW,
"CC1",
self.position.x,
self.position.y,
self.heading,
)
self.get_generated_group().points[0].speed = 20
class GrishaGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(GrishaGroupGenerator, self).__init__(
game, ground_object, faction, ALBATROS
)
class MolniyaGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(MolniyaGroupGenerator, self).__init__(
game, ground_object, faction, MOLNIYA
)
class KiloSubGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(KiloSubGroupGenerator, self).__init__(game, ground_object, faction, KILO)
class TangoSubGroupGenerator(DDGroupGenerator):
def __init__(self, game: Game, ground_object: ShipGroundObject, faction: Faction):
super(TangoSubGroupGenerator, self).__init__(game, ground_object, faction, SOM)

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class AvengerGenerator(AirDefenseGroupGenerator):
"""
This generate an Avenger group
"""
name = "Avenger Group"
def generate(self) -> None:
num_launchers = 2
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x,
self.position.y,
self.heading,
)
positions = self.get_circular_position(
num_launchers, launcher_distance=110, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.M1097_Avenger,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ChaparralGenerator(AirDefenseGroupGenerator):
"""
This generate a Chaparral group
"""
name = "Chaparral Group"
def generate(self) -> None:
num_launchers = 2
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x,
self.position.y,
self.heading,
)
positions = self.get_circular_position(
num_launchers, launcher_distance=110, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.M48_Chaparral,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class GepardGenerator(AirDefenseGroupGenerator):
"""
This generate a Gepard group
"""
name = "Gepard Group"
def generate(self) -> None:
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Gepard,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,172 +0,0 @@
import random
from typing import Dict, Iterable, List, Optional, Sequence, Set, Type
from dcs.unitgroup import VehicleGroup
from game import Game
from game.factions.faction import Faction
from game.theater.theatergroundobject import SamGroundObject, AirDefenseRange
from gen.to_remove.aaa_bofors import BoforsGenerator
from gen.to_remove.aaa_flak import FlakGenerator
from gen.to_remove.aaa_flak18 import Flak18Generator
from gen.to_remove.aaa_ks19 import KS19Generator
from gen.to_remove.aaa_ww2_ally_flak import AllyWW2FlakGenerator
from gen.to_remove.aaa_zsu57 import ZSU57Generator
from gen.to_remove.aaa_zu23_insurgent import ZU23InsurgentGenerator
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from gen.to_remove.cold_war_flak import (
ColdWarFlakGenerator,
EarlyColdWarFlakGenerator,
)
from gen.to_remove.freya_ewr import FreyaGenerator
from gen.to_remove.sam_avenger import AvengerGenerator
from gen.to_remove.sam_chaparral import ChaparralGenerator
from gen.to_remove.sam_gepard import GepardGenerator
from gen.to_remove.sam_hawk import HawkGenerator
from gen.to_remove.sam_hq7 import HQ7Generator
from gen.to_remove.sam_linebacker import LinebackerGenerator
from gen.to_remove.sam_nasams import NasamBGenerator, NasamCGenerator
from gen.to_remove.sam_patriot import PatriotGenerator
from gen.to_remove.sam_rapier import RapierGenerator
from gen.to_remove.sam_roland import RolandGenerator
from gen.to_remove.sam_sa10 import (
SA10Generator,
Tier2SA10Generator,
Tier3SA10Generator,
SA10BGenerator,
SA12Generator,
SA20Generator,
SA20BGenerator,
SA23Generator,
)
from gen.to_remove.sam_sa11 import SA11Generator
from gen.to_remove.sam_sa13 import SA13Generator
from gen.to_remove.sam_sa15 import SA15Generator
from gen.to_remove.sam_sa17 import SA17Generator
from gen.to_remove.sam_sa19 import SA19Generator
from gen.to_remove.sam_sa2 import SA2Generator
from gen.to_remove.sam_sa3 import SA3Generator
from gen.to_remove.sam_sa5 import SA5Generator, SA5FlatFaceGenerator
from gen.to_remove.sam_sa6 import SA6Generator
from gen.to_remove.sam_sa8 import SA8Generator
from gen.to_remove.sam_sa9 import SA9Generator
from gen.to_remove.sam_vulcan import VulcanGenerator
from gen.to_remove.sam_zsu23 import ZSU23Generator
from gen.to_remove.sam_zu23 import ZU23Generator
from gen.to_remove.sam_zu23_ural import ZU23UralGenerator
from gen.to_remove.sam_zu23_ural_insurgent import ZU23UralInsurgentGenerator
SAM_MAP: Dict[str, Type[AirDefenseGroupGenerator]] = {
"HawkGenerator": HawkGenerator,
"ZU23Generator": ZU23Generator,
"ZU23UralGenerator": ZU23UralGenerator,
"ZU23UralInsurgentGenerator": ZU23UralInsurgentGenerator,
"ZU23InsurgentGenerator": ZU23InsurgentGenerator,
"ZSU23Generator": ZSU23Generator,
"VulcanGenerator": VulcanGenerator,
"LinebackerGenerator": LinebackerGenerator,
"RapierGenerator": RapierGenerator,
"AvengerGenerator": AvengerGenerator,
"GepardGenerator": GepardGenerator,
"RolandGenerator": RolandGenerator,
"PatriotGenerator": PatriotGenerator,
"ChaparralGenerator": ChaparralGenerator,
"BoforsGenerator": BoforsGenerator,
"FlakGenerator": FlakGenerator,
"SA2Generator": SA2Generator,
"SA3Generator": SA3Generator,
"SA5Generator": SA5Generator,
"SA5FlatFaceGenerator": SA5FlatFaceGenerator,
"SA6Generator": SA6Generator,
"SA8Generator": SA8Generator,
"SA9Generator": SA9Generator,
"SA10Generator": SA10Generator,
"Tier2SA10Generator": Tier2SA10Generator,
"Tier3SA10Generator": Tier3SA10Generator,
"SA11Generator": SA11Generator,
"SA13Generator": SA13Generator,
"SA15Generator": SA15Generator,
"SA19Generator": SA19Generator,
"HQ7Generator": HQ7Generator,
"Flak18Generator": Flak18Generator,
"ColdWarFlakGenerator": ColdWarFlakGenerator,
"EarlyColdWarFlakGenerator": EarlyColdWarFlakGenerator,
"FreyaGenerator": FreyaGenerator,
"AllyWW2FlakGenerator": AllyWW2FlakGenerator,
"ZSU57Generator": ZSU57Generator,
"KS19Generator": KS19Generator,
"SA10BGenerator": SA10BGenerator,
"SA12Generator": SA12Generator,
"SA17Generator": SA17Generator,
"SA20Generator": SA20Generator,
"SA20BGenerator": SA20BGenerator,
"SA23Generator": SA23Generator,
"NasamBGenerator": NasamBGenerator,
"NasamCGenerator": NasamCGenerator,
}
def get_faction_possible_sams_generator(
faction: Faction,
) -> List[Type[AirDefenseGroupGenerator]]:
"""
Return the list of possible SAM generator for the given faction
:param faction: Faction name to search units for
"""
return [SAM_MAP[s] for s in faction.air_defenses]
def _generate_anti_air_from(
generators: Sequence[Type[AirDefenseGroupGenerator]],
game: Game,
ground_object: SamGroundObject,
) -> List[VehicleGroup]:
if not generators:
return []
sam_generator_class = random.choice(generators)
generator = sam_generator_class(game, ground_object)
generator.generate()
return list(generator.groups)
def generate_anti_air_group(
game: Game,
ground_object: SamGroundObject,
faction: Faction,
ranges: Optional[Iterable[Set[AirDefenseRange]]] = None,
) -> List[VehicleGroup]:
"""
This generate a SAM group
:param game: The Game.
:param ground_object: The ground object which will own the sam group.
:param faction: Owner faction.
:param ranges: Optional list of preferred ranges of the air defense to
create. If None, any generator may be used. Otherwise generators
matching the given ranges will be used in order of preference. For
example, when given `[{Long, Medium}, {Short}]`, long and medium range
air defenses will be tried first with no bias, and short range air
defenses will be used if no long or medium range generators are
available to the faction. If instead `[{Long}, {Medium}, {Short}]` had
been used, long range systems would take precedence over medium range
systems. If instead `[{Long, Medium, Short}]` had been used, all types
would be considered with equal preference.
:return: The generated group, or None if one could not be generated.
"""
generators = get_faction_possible_sams_generator(faction)
if ranges is None:
ranges = [
{
AirDefenseRange.Long,
AirDefenseRange.Medium,
AirDefenseRange.Short,
}
]
for range_options in ranges:
generators_for_range = [g for g in generators if g.range() in range_options]
groups = _generate_anti_air_from(generators_for_range, game, ground_object)
if groups:
return groups
return []

View File

@ -1,66 +0,0 @@
from dcs.mapping import Point
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange, SkynetRole
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class HawkGenerator(AirDefenseGroupGenerator):
"""
This generate an HAWK group
"""
name = "Hawk Site"
def generate(self) -> None:
self.add_unit(
AirDefence.Hawk_sr,
"SR",
self.position.x + 20,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Hawk_pcp,
"PCP",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Hawk_tr,
"TR",
self.position.x + 40,
self.position.y,
self.heading,
)
# Triple A for close range defense
aa_group = self.add_auxiliary_group(SkynetRole.NoSkynetBehavior)
self.add_unit_to_group(
aa_group,
AirDefence.Vulcan,
"AAA",
self.position + Point(20, 30),
self.heading,
)
num_launchers = 6
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Hawk_ln,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,59 +0,0 @@
from dcs.mapping import Point
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange, SkynetRole
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class HQ7Generator(AirDefenseGroupGenerator):
"""
This generate an HQ7 group
"""
name = "HQ-7 Site"
def generate(self) -> None:
self.add_unit(
AirDefence.HQ_7_STR_SP,
"STR",
self.position.x,
self.position.y,
self.heading,
)
# Triple A for close range defense
aa_group = self.add_auxiliary_group(SkynetRole.NoSkynetBehavior)
self.add_unit_to_group(
aa_group,
AirDefence.Ural_375_ZU_23,
"AAA1",
self.position + Point(20, 30),
self.heading,
)
self.add_unit_to_group(
aa_group,
AirDefence.Ural_375_ZU_23,
"AAA2",
self.position - Point(20, 30),
self.heading,
)
num_launchers = 2
if num_launchers > 0:
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.HQ_7_LN_SP,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class LinebackerGenerator(AirDefenseGroupGenerator):
"""
This generate an m6 linebacker group
"""
name = "Linebacker Group"
def generate(self) -> None:
num_launchers = 2
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x,
self.position.y,
self.heading,
)
positions = self.get_circular_position(
num_launchers, launcher_distance=110, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.M6_Linebacker,
"M6#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,67 +0,0 @@
from typing import Type
from dcs.unittype import VehicleType
from dcs.vehicles import AirDefence
from game import Game
from game.theater import SamGroundObject
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class NasamCGenerator(AirDefenseGroupGenerator):
"""
This generate a Nasams group with AIM-120C missiles
"""
name = "NASAMS AIM-120C"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.launcherType: Type[VehicleType] = AirDefence.NASAMS_LN_C
def generate(self) -> None:
# Command Post
self.add_unit(
AirDefence.NASAMS_Command_Post,
"CP",
self.position.x + 30,
self.position.y + 30,
self.heading,
)
# Radar
self.add_unit(
AirDefence.NASAMS_Radar_MPQ64F1,
"RADAR",
self.position.x - 30,
self.position.y - 30,
self.heading,
)
positions = self.get_circular_position(4, launcher_distance=120, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
self.launcherType,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium
class NasamBGenerator(NasamCGenerator):
"""
This generate a Nasams group with AIM-120B missiles
"""
name = "NASAMS AIM-120B"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.launcherType: Type[VehicleType] = AirDefence.NASAMS_LN_B

View File

@ -1,88 +0,0 @@
from dcs.mapping import Point
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import SkynetRole, AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class PatriotGenerator(AirDefenseGroupGenerator):
"""
This generate a Patriot group
"""
name = "Patriot Battery"
def generate(self) -> None:
# Command Post
self.add_unit(
AirDefence.Patriot_str,
"STR",
self.position.x + 30,
self.position.y + 30,
self.heading,
)
self.add_unit(
AirDefence.Patriot_AMG,
"MRC",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Patriot_ECS,
"MSQ",
self.position.x + 30,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Patriot_cp,
"ICC",
self.position.x + 60,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Patriot_EPP,
"EPP",
self.position.x,
self.position.y + 30,
self.heading,
)
positions = self.get_circular_position(8, launcher_distance=120, coverage=360)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Patriot_ln,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
# Short range protection for high value site
aa_group = self.add_auxiliary_group(SkynetRole.NoSkynetBehavior)
positions = self.get_circular_position(2, launcher_distance=200, coverage=360)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
aa_group,
AirDefence.Vulcan,
f"SPAAA#{i}",
Point(x, y),
heading,
)
positions = self.get_circular_position(2, launcher_distance=300, coverage=360)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
aa_group,
AirDefence.M1097_Avenger,
f"Avenger#{i}",
Point(x, y),
heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Long

View File

@ -1,52 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import SkynetRole, AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class RapierGenerator(AirDefenseGroupGenerator):
"""
This generate a Rapier Group
"""
name = "Rapier AA Site"
def generate(self) -> None:
self.add_unit(
AirDefence.Rapier_fsa_blindfire_radar,
"BT",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Rapier_fsa_optical_tracker_unit,
"OT",
self.position.x + 20,
self.position.y,
self.heading,
)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=80, coverage=240
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Rapier_fsa_launcher,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short
@classmethod
def primary_group_role(cls) -> SkynetRole:
return SkynetRole.Sam

View File

@ -1,51 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import SkynetRole, AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class RolandGenerator(AirDefenseGroupGenerator):
"""
This generate a Roland group
"""
name = "Roland Site"
def generate(self) -> None:
num_launchers = 2
self.add_unit(
AirDefence.Roland_Radar,
"EWR",
self.position.x + 40,
self.position.y,
self.heading,
)
positions = self.get_circular_position(
num_launchers, launcher_distance=80, coverage=240
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Roland_ADS,
"ADS#" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short
@classmethod
def primary_group_role(cls) -> SkynetRole:
return SkynetRole.Sam

View File

@ -1,222 +0,0 @@
from typing import Type
from dcs.mapping import Point
from dcs.unittype import VehicleType
from dcs.vehicles import AirDefence
from game import Game
from game.theater import SamGroundObject
from game.theater.theatergroundobject import SkynetRole, AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from pydcs_extensions.highdigitsams import highdigitsams
class SA10Generator(AirDefenseGroupGenerator):
"""
This generate a SA-10 group
"""
name = "SA-10/S-300PS Battery - With ZSU-23"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1: Type[VehicleType] = AirDefence.S_300PS_40B6MD_sr
self.sr2: Type[VehicleType] = AirDefence.S_300PS_64H6E_sr
self.cp: Type[VehicleType] = AirDefence.S_300PS_54K6_cp
self.tr1: Type[VehicleType] = AirDefence.S_300PS_40B6M_tr
self.tr2: Type[VehicleType] = AirDefence.S_300PS_40B6M_tr
self.ln1: Type[VehicleType] = AirDefence.S_300PS_5P85C_ln
self.ln2: Type[VehicleType] = AirDefence.S_300PS_5P85D_ln
def generate(self) -> None:
# Search Radar
self.add_unit(
self.sr1, "SR1", self.position.x, self.position.y + 40, self.heading
)
# Search radar for missiles (optionnal)
self.add_unit(
self.sr2, "SR2", self.position.x - 40, self.position.y, self.heading
)
# Command Post
self.add_unit(self.cp, "CP", self.position.x, self.position.y, self.heading)
# 1 Tracking radar
self.add_unit(
self.tr1, "TR1", self.position.x - 40, self.position.y - 40, self.heading
)
# 2 different launcher type (C & D)
num_launchers = 6
positions = self.get_circular_position(
num_launchers, launcher_distance=100, coverage=360
)
for i, position in enumerate(positions):
if i % 2 == 0:
self.add_unit(
self.ln1, "LN#" + str(i), position[0], position[1], position[2]
)
else:
self.add_unit(
self.ln2, "LN#" + str(i), position[0], position[1], position[2]
)
self.generate_defensive_groups()
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Long
def generate_defensive_groups(self) -> None:
# AAA for defending against close targets.
aa_group = self.add_auxiliary_group(SkynetRole.NoSkynetBehavior)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=210, coverage=360
)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
aa_group,
AirDefence.ZSU_23_4_Shilka,
f"AA#{i}",
Point(x, y),
heading,
)
class Tier2SA10Generator(SA10Generator):
name = "SA-10/S-300PS Battery - With SA-15 PD"
def generate_defensive_groups(self) -> None:
# Create AAA the way the main group does.
super().generate_defensive_groups()
# SA-15 for both shorter range targets and point defense.
pd_group = self.add_auxiliary_group(SkynetRole.PointDefense)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=140, coverage=360
)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
pd_group,
AirDefence.Tor_9A331,
f"PD#{i}",
Point(x, y),
heading,
)
class Tier3SA10Generator(SA10Generator):
name = "SA-10/S-300PS Battery - With SA-15 PD & SA-19 SHORAD"
def generate_defensive_groups(self) -> None:
# AAA for defending against close targets.
aa_group = self.add_auxiliary_group(SkynetRole.NoSkynetBehavior)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=210, coverage=360
)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
aa_group,
AirDefence._2S6_Tunguska,
f"AA#{i}",
Point(x, y),
heading,
)
# SA-15 for both shorter range targets and point defense.
pd_group = self.add_auxiliary_group(SkynetRole.PointDefense)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=140, coverage=360
)
for i, (x, y, heading) in enumerate(positions):
self.add_unit_to_group(
pd_group,
AirDefence.Tor_9A331,
f"PD#{i}",
Point(x, y),
heading,
)
class SA10BGenerator(Tier3SA10Generator):
name = "SA-10B/S-300PS Battery"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1 = highdigitsams.SAM_SA_10B_S_300PS_40B6MD_SR
self.sr2 = highdigitsams.SAM_SA_10B_S_300PS_64H6E_SR
self.cp = highdigitsams.SAM_SA_10B_S_300PS_54K6_CP
self.tr1 = highdigitsams.SAM_SA_10B_S_300PS_30N6_TR
self.tr2 = highdigitsams.SAM_SA_10B_S_300PS_40B6M_TR
self.ln1 = highdigitsams.SAM_SA_10B_S_300PS_5P85SE_LN
self.ln2 = highdigitsams.SAM_SA_10B_S_300PS_5P85SU_LN
class SA12Generator(Tier3SA10Generator):
name = "SA-12/S-300V Battery"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1 = highdigitsams.SAM_SA_12_S_300V_9S15_SR
self.sr2 = highdigitsams.SAM_SA_12_S_300V_9S19_SR
self.cp = highdigitsams.SAM_SA_12_S_300V_9S457_CP
self.tr1 = highdigitsams.SAM_SA_12_S_300V_9S32_TR
self.tr2 = highdigitsams.SAM_SA_12_S_300V_9S32_TR
self.ln1 = highdigitsams.SAM_SA_12_S_300V_9A82_LN
self.ln2 = highdigitsams.SAM_SA_12_S_300V_9A83_LN
class SA20Generator(Tier3SA10Generator):
name = "SA-20/S-300PMU-1 Battery"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1 = highdigitsams.SAM_SA_20_S_300PMU1_SR_5N66E
self.sr2 = highdigitsams.SAM_SA_20_S_300PMU1_SR_64N6E
self.cp = highdigitsams.SAM_SA_20_S_300PMU1_CP_54K6
self.tr1 = highdigitsams.SAM_SA_20_S_300PMU1_TR_30N6E
self.tr2 = highdigitsams.SAM_SA_20_S_300PMU1_TR_30N6E_truck
self.ln1 = highdigitsams.SAM_SA_20_S_300PMU1_LN_5P85CE
self.ln2 = highdigitsams.SAM_SA_20_S_300PMU1_LN_5P85DE
class SA20BGenerator(Tier3SA10Generator):
name = "SA-20B/S-300PMU-2 Battery"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1 = highdigitsams.SAM_SA_20_S_300PMU1_SR_5N66E
self.sr2 = highdigitsams.SAM_SA_20_S_300PMU1_SR_64N6E
self.cp = highdigitsams.SAM_SA_20B_S_300PMU2_CP_54K6E2
self.tr1 = highdigitsams.SAM_SA_20B_S_300PMU2_TR_92H6E_truck
self.tr2 = highdigitsams.SAM_SA_20B_S_300PMU2_TR_92H6E_truck
self.ln1 = highdigitsams.SAM_SA_20B_S_300PMU2_LN_5P85SE2
self.ln2 = highdigitsams.SAM_SA_20B_S_300PMU2_LN_5P85SE2
class SA23Generator(Tier3SA10Generator):
name = "SA-23/S-300VM Battery"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr1 = highdigitsams.SAM_SA_23_S_300VM_9S15M2_SR
self.sr2 = highdigitsams.SAM_SA_23_S_300VM_9S19M2_SR
self.cp = highdigitsams.SAM_SA_23_S_300VM_9S457ME_CP
self.tr1 = highdigitsams.SAM_SA_23_S_300VM_9S32ME_TR
self.tr2 = highdigitsams.SAM_SA_23_S_300VM_9S32ME_TR
self.ln1 = highdigitsams.SAM_SA_23_S_300VM_9A82ME_LN
self.ln2 = highdigitsams.SAM_SA_23_S_300VM_9A83ME_LN

View File

@ -1,48 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA11Generator(AirDefenseGroupGenerator):
"""
This generate a SA-11 group
"""
name = "SA-11 Buk Battery"
def generate(self) -> None:
self.add_unit(
AirDefence.SA_11_Buk_SR_9S18M1,
"SR",
self.position.x + 20,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.SA_11_Buk_CC_9S470M1,
"CC",
self.position.x,
self.position.y,
self.heading,
)
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=140, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.SA_11_Buk_LN_9A310M1,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,47 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA13Generator(AirDefenseGroupGenerator):
"""
This generate a SA-13 group
"""
name = "SA-13 Strela Group"
def generate(self) -> None:
self.add_unit(
Unarmed.UAZ_469,
"UAZ",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
Unarmed.KAMAZ_Truck,
"TRUCK",
self.position.x + 40,
self.position.y,
self.heading,
)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Strela_10M3,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,46 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA15Generator(AirDefenseGroupGenerator):
"""
This generate a SA-15 group
"""
name = "SA-15 Tor Group"
def generate(self) -> None:
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Tor_9A331,
"ADS#" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
Unarmed.UAZ_469,
"EWR",
self.position.x + 40,
self.position.y,
self.heading,
)
self.add_unit(
Unarmed.KAMAZ_Truck,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,46 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
from pydcs_extensions.highdigitsams import highdigitsams
class SA17Generator(AirDefenseGroupGenerator):
"""
This generate a SA-17 group
"""
name = "SA-17 Grizzly Battery"
def generate(self) -> None:
self.add_unit(
AirDefence.SA_11_Buk_SR_9S18M1,
"SR",
self.position.x + 20,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.SA_11_Buk_CC_9S470M1,
"CC",
self.position.x,
self.position.y,
self.heading,
)
positions = self.get_circular_position(3, launcher_distance=140, coverage=180)
for i, position in enumerate(positions):
self.add_unit(
highdigitsams.SAM_SA_17_Buk_M1_2_LN_9A310M1_2,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,42 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA19Generator(AirDefenseGroupGenerator):
"""
This generate a SA-19 group
"""
name = "SA-19 Tunguska Group"
def generate(self) -> None:
num_launchers = 2
if num_launchers == 1:
self.add_unit(
AirDefence._2S6_Tunguska,
"LN#0",
self.position.x,
self.position.y,
self.heading,
)
else:
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence._2S6_Tunguska,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,48 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA2Generator(AirDefenseGroupGenerator):
"""
This generate a SA-2 group
"""
name = "SA-2/S-75 Site"
def generate(self) -> None:
self.add_unit(
AirDefence.P_19_s_125_sr,
"SR",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.SNR_75V,
"TR",
self.position.x + 20,
self.position.y,
self.heading,
)
num_launchers = 6
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.S_75M_Volhov,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,48 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA3Generator(AirDefenseGroupGenerator):
"""
This generate a SA-3 group
"""
name = "SA-3/S-125 Site"
def generate(self) -> None:
self.add_unit(
AirDefence.P_19_s_125_sr,
"SR",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.Snr_s_125_tr,
"TR",
self.position.x + 20,
self.position.y,
self.heading,
)
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence._5p73_s_125_ln,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,77 +0,0 @@
from typing import Type
from dcs.unittype import VehicleType
from dcs.vehicles import AirDefence, Unarmed
from game import Game
from game.theater import SamGroundObject
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA5Generator(AirDefenseGroupGenerator):
"""
This generate a SA-5 group using the TinShield SR
"""
name = "SA-5/S-200 Site"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr: Type[VehicleType] = AirDefence.RLS_19J6
def generate(self) -> None:
self.add_unit(
self.sr,
"SR",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
AirDefence.RPC_5N62V,
"TR",
self.position.x + 20,
self.position.y,
self.heading,
)
self.add_unit(
Unarmed.Ural_375,
"LOGI",
self.position.x - 20,
self.position.y,
self.heading,
)
num_launchers = 6
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.S_200_Launcher,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Long
# TODO Replace this legacy handling once the Generators can be faction sensitive #1903
class SA5FlatFaceGenerator(SA5Generator):
"""
This generate a SA-5 group using the P-19 FlatFace SR
"""
name = "SA-5/S-200 Site wit FlatFace SR"
def __init__(self, game: Game, ground_object: SamGroundObject):
super().__init__(game, ground_object)
self.sr: Type[VehicleType] = AirDefence.P_19_s_125_sr

View File

@ -1,41 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA6Generator(AirDefenseGroupGenerator):
"""
This generate a SA-6 group
"""
name = "SA-6 Kub Site"
def generate(self) -> None:
self.add_unit(
AirDefence.Kub_1S91_str,
"STR",
self.position.x,
self.position.y,
self.heading,
)
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Kub_2P25_ln,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA8Generator(AirDefenseGroupGenerator):
"""
This generate a SA-8 group
"""
name = "SA-8 OSA Site"
def generate(self) -> None:
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Osa_9A33_ln,
"OSA" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
AirDefence.SA_8_Osa_LD_9T217,
"LD",
self.position.x + 20,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Medium

View File

@ -1,47 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class SA9Generator(AirDefenseGroupGenerator):
"""
This generate a SA-9 group
"""
name = "SA-9 Group"
def generate(self) -> None:
self.add_unit(
Unarmed.UAZ_469,
"UAZ",
self.position.x,
self.position.y,
self.heading,
)
self.add_unit(
Unarmed.KAMAZ_Truck,
"TRUCK",
self.position.x + 40,
self.position.y,
self.heading,
)
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Strela_1_9P31,
"LN#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.Short

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class VulcanGenerator(AirDefenseGroupGenerator):
"""
This generate a Vulcan group
"""
name = "Vulcan Group"
def generate(self) -> None:
num_launchers = 2
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Vulcan,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,40 +0,0 @@
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZSU23Generator(AirDefenseGroupGenerator):
"""
This generate a ZSU 23 group
"""
name = "ZSU-23 Group"
def generate(self) -> None:
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=120, coverage=180
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.ZSU_23_4_Shilka,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,41 +0,0 @@
import random
from dcs.vehicles import AirDefence, Unarmed
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZU23Generator(AirDefenseGroupGenerator):
"""
This generate a ZU23 flak artillery group
"""
name = "ZU-23 Group"
def generate(self) -> None:
index = 0
for i in range(4):
index = index + 1
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
self.add_unit(
AirDefence.ZU_23_Emplacement_Closed,
"AAA#" + str(index),
self.position.x + spacing_x * i,
self.position.y + spacing_y * i,
self.heading,
)
self.add_unit(
Unarmed.M_818,
"TRUCK",
self.position.x + 80,
self.position.y,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,33 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZU23UralGenerator(AirDefenseGroupGenerator):
"""
This generate a Zu23 Ural group
"""
name = "ZU-23 Ural Group"
def generate(self) -> None:
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=80, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Ural_375_ZU_23,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA

View File

@ -1,33 +0,0 @@
from dcs.vehicles import AirDefence
from game.theater.theatergroundobject import AirDefenseRange
from gen.to_remove.airdefensegroupgenerator import (
AirDefenseGroupGenerator,
)
class ZU23UralInsurgentGenerator(AirDefenseGroupGenerator):
"""
This generate a Zu23 Ural group
"""
name = "ZU-23 Ural Insurgent Group"
@classmethod
def range(cls) -> AirDefenseRange:
return AirDefenseRange.AAA
def generate(self) -> None:
num_launchers = 4
positions = self.get_circular_position(
num_launchers, launcher_distance=80, coverage=360
)
for i, position in enumerate(positions):
self.add_unit(
AirDefence.Ural_375_ZU_23_Insurgent,
"SPAA#" + str(i),
position[0],
position[1],
position[2],
)

View File

@ -1,20 +0,0 @@
import random
from dcs.ships import Schnellboot_type_S130
from gen.group_generator import ShipGroupGenerator
class SchnellbootGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
for i in range(random.randint(2, 4)):
self.add_unit(
Schnellboot_type_S130,
"Schnellboot" + str(i),
self.position.x + i * random.randint(100, 250),
self.position.y + (random.randint(100, 200) - 100),
self.heading,
)
self.get_generated_group().points[0].speed = 20

View File

@ -1,68 +0,0 @@
import random
from dcs.vehicles import Unarmed, MissilesSS, AirDefence
from game import Game
from game.factions.faction import Faction
from game.theater.theatergroundobject import MissileSiteGroundObject
from game.utils import Heading
from gen.group_generator import VehicleGroupGenerator
class ScudGenerator(VehicleGroupGenerator[MissileSiteGroundObject]):
def __init__(
self, game: Game, ground_object: MissileSiteGroundObject, faction: Faction
) -> None:
super(ScudGenerator, self).__init__(game, ground_object)
self.faction = faction
def generate(self) -> None:
# Scuds
self.add_unit(
MissilesSS.Scud_B,
"V1#0",
self.position.x,
self.position.y + random.randint(1, 8),
self.heading,
)
self.add_unit(
MissilesSS.Scud_B,
"V1#1",
self.position.x + 50,
self.position.y + random.randint(1, 8),
self.heading,
)
self.add_unit(
MissilesSS.Scud_B,
"V1#2",
self.position.x + 100,
self.position.y + random.randint(1, 8),
self.heading,
)
# Commander
self.add_unit(
Unarmed.UAZ_469,
"Kubel#0",
self.position.x - 35,
self.position.y - 20,
self.heading,
)
# Shorad
self.add_unit(
AirDefence.ZSU_23_4_Shilka,
"SHILKA#0",
self.position.x - 55,
self.position.y - 38,
self.heading,
)
self.add_unit(
AirDefence.Strela_1_9P31,
"STRELA#0",
self.position.x + 200,
self.position.y + 15,
Heading.from_degrees(90),
)

View File

@ -1,52 +0,0 @@
from __future__ import annotations
import logging
import random
from typing import TYPE_CHECKING, Optional
from dcs.unitgroup import ShipGroup
from game import db
from game.theater.theatergroundobject import (
LhaGroundObject,
CarrierGroundObject,
ShipGroundObject,
)
from gen.to_remove.carrier_group import CarrierGroupGenerator
from gen.to_remove.cn_dd_group import ChineseNavyGroupGenerator, Type54GroupGenerator
from gen.to_remove.dd_group import (
ArleighBurkeGroupGenerator,
OliverHazardPerryGroupGenerator,
)
from gen.to_remove.lacombattanteII import LaCombattanteIIGroupGenerator
from gen.to_remove.lha_group import LHAGroupGenerator
from gen.to_remove.ru_dd_group import (
RussianNavyGroupGenerator,
GrishaGroupGenerator,
MolniyaGroupGenerator,
KiloSubGroupGenerator,
TangoSubGroupGenerator,
)
from gen.to_remove.schnellboot import SchnellbootGroupGenerator
from gen.to_remove.uboat import UBoatGroupGenerator
from gen.to_remove.ww2lst import WW2LSTGroupGenerator
if TYPE_CHECKING:
from game import Game
SHIP_MAP = {
"SchnellbootGroupGenerator": SchnellbootGroupGenerator,
"WW2LSTGroupGenerator": WW2LSTGroupGenerator,
"UBoatGroupGenerator": UBoatGroupGenerator,
"OliverHazardPerryGroupGenerator": OliverHazardPerryGroupGenerator,
"ArleighBurkeGroupGenerator": ArleighBurkeGroupGenerator,
"RussianNavyGroupGenerator": RussianNavyGroupGenerator,
"ChineseNavyGroupGenerator": ChineseNavyGroupGenerator,
"GrishaGroupGenerator": GrishaGroupGenerator,
"MolniyaGroupGenerator": MolniyaGroupGenerator,
"KiloSubGroupGenerator": KiloSubGroupGenerator,
"TangoSubGroupGenerator": TangoSubGroupGenerator,
"Type54GroupGenerator": Type54GroupGenerator,
"LaCombattanteIIGroupGenerator": LaCombattanteIIGroupGenerator,
}

View File

@ -1,64 +0,0 @@
from dcs.vehicles import MissilesSS, Unarmed, AirDefence
from game import Game
from game.factions.faction import Faction
from game.theater.theatergroundobject import CoastalSiteGroundObject
from game.utils import Heading
from gen.group_generator import VehicleGroupGenerator
class SilkwormGenerator(VehicleGroupGenerator[CoastalSiteGroundObject]):
def __init__(
self, game: Game, ground_object: CoastalSiteGroundObject, faction: Faction
) -> None:
super(SilkwormGenerator, self).__init__(game, ground_object)
self.faction = faction
def generate(self) -> None:
positions = self.get_circular_position(5, launcher_distance=120, coverage=180)
self.add_unit(
MissilesSS.Silkworm_SR,
"SR#0",
self.position.x,
self.position.y,
self.heading,
)
# Launchers
for i, p in enumerate(positions):
self.add_unit(
MissilesSS.Hy_launcher,
"Missile#" + str(i),
p[0],
p[1],
self.heading,
)
# Commander
self.add_unit(
Unarmed.KAMAZ_Truck,
"KAMAZ#0",
self.position.x - 35,
self.position.y - 20,
self.heading,
)
# Shorad
self.add_unit(
AirDefence.ZSU_23_4_Shilka,
"SHILKA#0",
self.position.x - 55,
self.position.y - 38,
self.heading,
)
# Shorad 2
self.add_unit(
AirDefence.Strela_1_9P31,
"STRELA#0",
self.position.x + 200,
self.position.y + 15,
Heading.from_degrees(90),
)

View File

@ -1,20 +0,0 @@
import random
from dcs.ships import Uboat_VIIC
from gen.group_generator import ShipGroupGenerator
class UBoatGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
for i in range(random.randint(1, 4)):
self.add_unit(
Uboat_VIIC,
"Uboat" + str(i),
self.position.x + i * random.randint(100, 250),
self.position.y + (random.randint(100, 200) - 100),
self.heading,
)
self.get_generated_group().points[0].speed = 20

View File

@ -1,70 +0,0 @@
import random
from dcs.vehicles import Unarmed, MissilesSS, AirDefence
from game import Game
from game.factions.faction import Faction
from game.theater.theatergroundobject import MissileSiteGroundObject
from game.utils import Heading
from gen.group_generator import VehicleGroupGenerator
class V1GroupGenerator(VehicleGroupGenerator[MissileSiteGroundObject]):
def __init__(
self, game: Game, ground_object: MissileSiteGroundObject, faction: Faction
) -> None:
super(V1GroupGenerator, self).__init__(game, ground_object)
self.faction = faction
def generate(self) -> None:
# Ramps
self.add_unit(
MissilesSS.V1_launcher,
"V1#0",
self.position.x,
self.position.y + random.randint(1, 8),
self.heading,
)
self.add_unit(
MissilesSS.V1_launcher,
"V1#1",
self.position.x + 50,
self.position.y + random.randint(1, 8),
self.heading,
)
self.add_unit(
MissilesSS.V1_launcher,
"V1#2",
self.position.x + 100,
self.position.y + random.randint(1, 8),
self.heading,
)
# Commander
self.add_unit(
Unarmed.Kubelwagen_82,
"Kubel#0",
self.position.x - 35,
self.position.y - 20,
self.heading,
)
# Self defense flak
flak_unit = random.choice([AirDefence.Flak38, AirDefence.Flak30])
self.add_unit(
flak_unit,
"FLAK#0",
self.position.x - 55,
self.position.y - 38,
self.heading,
)
self.add_unit(
Unarmed.Blitz_36_6700A,
"Blitz#0",
self.position.x + 200,
self.position.y + 15,
Heading.from_degrees(90),
)

View File

@ -1,29 +0,0 @@
import random
from dcs.ships import USS_Samuel_Chase, LST_Mk2
from gen.group_generator import ShipGroupGenerator
class WW2LSTGroupGenerator(ShipGroupGenerator):
def generate(self) -> None:
# Add LS Samuel Chase
self.add_unit(
USS_Samuel_Chase,
"SamuelChase",
self.position.x,
self.position.y,
self.heading,
)
for i in range(1, random.randint(3, 4)):
self.add_unit(
LST_Mk2,
"LST" + str(i),
self.position.x + i * random.randint(800, 1200),
self.position.y,
self.heading,
)
self.get_generated_group().points[0].speed = 20

Binary file not shown.

View File

@ -0,0 +1,23 @@
name: AAA Mobile
description: A standard AAA template
generic: true
role: AntiAir
tasks:
- AAA
groups:
- name: AAA Mobile 0
group: 1
unit_count:
- 2
- 6
unit_classes:
- AAA
- name: AAA Mobile 1
optional: true
group: 1
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz

View File

@ -0,0 +1,29 @@
name: AAA Radar Site
description: AAA Template with a Radar
generic: false
role: AntiAir
tasks:
- AAA
groups:
- name: AAA Radar Site 0
group: 1
unit_count:
- 1
unit_classes:
- SearchRadar
- name: AAA Radar Site 1
group: 1
unit_count:
- 2
- 6
unit_classes:
- AAA
- name: AAA Radar Site 2
optional: true
group: 1
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz

View File

@ -0,0 +1,23 @@
name: AAA Site
description: A standard AAA template
generic: true
role: AntiAir
tasks:
- AAA
groups:
- name: AAA Site 0
group: 1
unit_count:
- 2
- 6
unit_classes:
- AAA
- name: AAA Site 1
optional: true
group: 1
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/AAA.miz

View File

@ -0,0 +1,36 @@
name: Cold War Flak Site
role: AntiAir
tasks:
- AAA
groups:
- name: Cold War Flak Site Radar
optional: true # Only available to Late Cold War
unit_count:
- 1
unit_classes:
- SearchRadar
- name: Cold War Flak Site Flak
unit_count:
- 4
- 6
unit_types:
- flak18
- name: Cold War Flak Site S-60
unit_count:
- 2
unit_types:
- S-60_Type59_Artillery
- name: Cold War Flak Site AAA
optional: true
unit_count:
- 2
unit_classes:
- AAA
- name: Cold War Flak Site Logistics
optional: true
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/flak.miz

View File

@ -0,0 +1,15 @@
name: Early-Warning Radar
generic: true
role: AntiAir
tasks:
- EarlyWarningRadar
groups:
- name: Early-Warning Radar 0
unit_count:
- 1
unit_classes:
- EarlyWarningRadar
alternative_classes:
- SearchRadar
- SearchTrackRadar
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,51 @@
name: Flak Site
role: AntiAir
tasks:
- AAA
groups:
- name: Flak Site 0
unit_count:
- 4
unit_types:
- flak38
- flak18
- flak36
- flak37
- flak41
- flak30
- name: Flak Site 1
unit_count:
- 1
unit_types:
- flak38
- name: Flak Site 2
unit_count:
- 1
unit_types:
- flak36
- name: Flak Site 3
unit_count:
- 2
unit_types:
- Flakscheinwerfer_37
- name: Flak Site 4
unit_count:
- 1
unit_types:
- Maschinensatz_33
- name: Flak Site 5
unit_count:
- 1
unit_types:
- KDO_Mod40
- name: Flak Site 6
unit_count:
- 1
unit_types:
- Kubelwagen_82
- name: Flak Site 7
unit_count:
- 4
unit_types:
- Blitz_36-6700A
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,51 @@
name: Freya EWR Site
role: AntiAir
tasks:
- SHORAD
groups:
- name: Freya EWR Site 0
unit_count:
- 1
unit_types:
- FuMG-401
- name: Freya EWR Site 1
unit_count:
- 4
unit_types:
- flak38
- name: Freya EWR Site 2
unit_count:
- 4
unit_types:
- flak18
- name: Freya EWR Site 3
unit_count:
- 1
unit_types:
- Kubelwagen_82
- name: Freya EWR Site 4
unit_count:
- 1
unit_types:
- Sd_Kfz_7
- name: Freya EWR Site 5
unit_count:
- 1
unit_types:
- Sd_Kfz_2
- name: Freya EWR Site 6
unit_count:
- 1
unit_types:
- Maschinensatz_33
- name: Freya EWR Site 7
unit_count:
- 1
unit_types:
- KDO_Mod40
- name: Freya EWR Site 8
unit_count:
- 3
unit_types:
- soldier_mauser98
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,24 @@
name: HQ-7 Site
role: AntiAir
tasks:
- SHORAD
groups:
- name: HQ-7 Site 0
group: 1
unit_count:
- 1
unit_types:
- HQ-7_STR_SP
- name: HQ-7 Site 1
group: 1
unit_count:
- 2
unit_types:
- HQ-7_LN_SP
- name: HQ-7 Site 2
group: 2
unit_count:
- 2
unit_types:
- Ural-375 ZU-23
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,36 @@
name: Hawk Site
role: AntiAir
tasks:
- MERAD
groups:
- name: Hawk Site 0
group: 1
unit_count:
- 1
unit_types:
- Hawk sr
- name: Hawk Site 1
group: 1
unit_count:
- 1
unit_types:
- Hawk pcp
- name: Hawk Site 2
group: 1
unit_count:
- 1
unit_types:
- Hawk tr
- name: Hawk Site 3
group: 1
unit_count:
- 6
unit_types:
- Hawk ln
- name: Hawk Site 4
group: 2
unit_count:
- 1
unit_types:
- Vulcan
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: NASAMS AIM-120B
role: AntiAir
tasks:
- MERAD
groups:
- name: NASAMS AIM-120B 1
unit_count:
- 1
unit_types:
- NASAMS_Radar_MPQ64F1
- name: NASAMS AIM-120B 0
unit_count:
- 1
unit_types:
- NASAMS_Command_Post
- name: NASAMS AIM-120B 2
unit_count:
- 4
unit_types:
- NASAMS_LN_B
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: NASAMS AIM-120C
role: AntiAir
tasks:
- MERAD
groups:
- name: NASAMS AIM-120C 1
unit_count:
- 1
unit_types:
- NASAMS_Radar_MPQ64F1
- name: NASAMS AIM-120C 0
unit_count:
- 1
unit_types:
- NASAMS_Command_Post
- name: NASAMS AIM-120C 2
unit_count:
- 4
unit_types:
- NASAMS_LN_C
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,56 @@
name: Patriot Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: Patriot Battery 0
group: 1
unit_count:
- 1
unit_types:
- Patriot str
- name: Patriot Battery 1
group: 1
unit_count:
- 1
unit_types:
- Patriot AMG
- name: Patriot Battery 2
group: 1
unit_count:
- 1
unit_types:
- Patriot ECS
- name: Patriot Battery 3
group: 1
unit_count:
- 1
unit_types:
- Patriot cp
- name: Patriot Battery 4
group: 1
unit_count:
- 1
unit_types:
- Patriot EPP
- name: Patriot Battery 5
group: 1
unit_count:
- 8
unit_types:
- Patriot ln
- name: Patriot Battery 6
optional: true
group: 2
unit_count:
- 2
unit_classes:
- AAA
- name: Patriot Battery 7
optional: true
group: 2
unit_count:
- 2
unit_classes:
- SHORAD
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: Rapier AA Site
role: AntiAir
tasks:
- SHORAD
groups:
- name: Rapier AA Site 0
unit_count:
- 1
unit_types:
- rapier_fsa_blindfire_radar
- name: Rapier AA Site 1
unit_count:
- 1
unit_types:
- rapier_fsa_optical_tracker_unit
- name: Rapier AA Site 2
unit_count:
- 2
unit_types:
- rapier_fsa_launcher
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: Roland Site
role: AntiAir
tasks:
- SHORAD
groups:
- name: Roland Site 0
unit_count:
- 1
unit_types:
- Roland Radar
- name: Roland Site 1
unit_count:
- 2
unit_types:
- Roland ADS
- name: Roland Site 2
unit_count:
- 1
unit_types:
- M 818
template_file: resources/templates/anti_air/legacy_ground_templates.miz

Binary file not shown.

View File

@ -0,0 +1,62 @@
name: SA-10/S-300PS Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-10/S-300PS Battery SR1
group: 1
unit_count:
- 1
unit_types:
- S-300PS 40B6MD sr
- name: SA-10/S-300PS Battery SR2
group: 1
unit_count:
- 1
unit_types:
- S-300PS 64H6E sr
- name: SA-10/S-300PS Battery CP
group: 1
unit_count:
- 1
unit_types:
- S-300PS 54K6 cp
- name: SA-10/S-300PS Battery TR
group: 1
unit_count:
- 1
unit_types:
- S-300PS 40B6M tr
- name: SA-10/S-300PS Battery LN1
group: 1
unit_count:
- 3
unit_types:
- S-300PS 5P85C ln
- name: SA-10/S-300PS Battery LN2
group: 1
unit_count:
- 3
unit_types:
- S-300PS 5P85D ln
- name: SA-10/S-300PS Battery AAA
group: 2
unit_count:
- 2
unit_classes:
- AAA
- name: SA-10/S-300PS Battery SHORAD1
group: 3
unit_count:
- 0
- 2
unit_classes:
- SHORAD
# - name: SA-10/S-300PS Battery SHORAD2
# group: 3
# unit_count:
# - 0
# - 2
# unit_classes:
# - SHORAD
template_file: resources/templates/anti_air/SA-10.miz

View File

@ -0,0 +1,21 @@
name: SA-11 Buk Battery
role: AntiAir
tasks:
- MERAD
groups:
- name: SA-11 Buk Battery 0
unit_count:
- 1
unit_types:
- SA-11 Buk SR 9S18M1
- name: SA-11 Buk Battery 1
unit_count:
- 1
unit_types:
- SA-11 Buk CC 9S470M1
- name: SA-11 Buk Battery 2
unit_count:
- 4
unit_types:
- SA-11 Buk LN 9A310M1
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,54 @@
name: SA-12/S-300V Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-12/S-300V Battery 0
group: 1
unit_count:
- 1
unit_types:
- S-300V 9S15 sr
- name: SA-12/S-300V Battery 1
group: 1
unit_count:
- 1
unit_types:
- S-300V 9S19 sr
- name: SA-12/S-300V Battery 2
group: 1
unit_count:
- 1
unit_types:
- S-300V 9S457 cp
- name: SA-12/S-300V Battery 3
group: 1
unit_count:
- 1
unit_types:
- S-300V 9S32 tr
- name: SA-12/S-300V Battery 4
group: 1
unit_count:
- 3
unit_types:
- S-300V 9A82 ln
- name: SA-12/S-300V Battery 5
group: 1
unit_count:
- 3
unit_types:
- S-300V 9A83 ln
- name: SA-12/S-300V Battery 6
group: 2
unit_count:
- 2
unit_types:
- 2S6 Tunguska
- name: SA-12/S-300V Battery 7
group: 3
unit_count:
- 2
unit_types:
- Tor 9A331
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: SA-17 Grizzly Battery
role: AntiAir
tasks:
- MERAD
groups:
- name: SA-17 Grizzly Battery 0
unit_count:
- 1
unit_types:
- SA-11 Buk SR 9S18M1
- name: SA-17 Grizzly Battery 1
unit_count:
- 1
unit_types:
- SA-11 Buk CC 9S470M1
- name: SA-17 Grizzly Battery 2
unit_count:
- 3
unit_types:
- SA-17 Buk M1-2 LN 9A310M1-2
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,48 @@
name: SA-20B/S-300PMU-2 Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-20B/S-300PMU-2 Battery 0
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 40B6MD sr
- name: SA-20B/S-300PMU-2 Battery 1
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 64N6E sr
- name: SA-20B/S-300PMU-2 Battery 2
group: 1
unit_count:
- 1
unit_types:
- S-300PMU2 54K6E2 cp
- name: SA-20B/S-300PMU-2 Battery 3
group: 1
unit_count:
- 1
unit_types:
- S-300PMU2 92H6E tr
- name: SA-20B/S-300PMU-2 Battery 4
group: 1
unit_count:
- 6
unit_types:
- S-300PMU2 5P85SE2 ln
- name: SA-20B/S-300PMU-2 Battery 5
group: 2
unit_count:
- 2
unit_types:
- 2S6 Tunguska
- name: SA-20B/S-300PMU-2 Battery 6
group: 3
unit_count:
- 2
unit_types:
- Tor 9A331
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,54 @@
name: SA-20/S-300PMU-1 Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-20/S-300PMU-1 Battery 0
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 40B6MD sr
- name: SA-20/S-300PMU-1 Battery 1
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 64N6E sr
- name: SA-20/S-300PMU-1 Battery 2
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 54K6 cp
- name: SA-20/S-300PMU-1 Battery 3
group: 1
unit_count:
- 1
unit_types:
- S-300PMU1 40B6M tr
- name: SA-20/S-300PMU-1 Battery 4
group: 1
unit_count:
- 3
unit_types:
- S-300PMU1 5P85CE ln
- name: SA-20/S-300PMU-1 Battery 5
group: 1
unit_count:
- 3
unit_types:
- S-300PMU1 5P85DE ln
- name: SA-20/S-300PMU-1 Battery 6
group: 2
unit_count:
- 2
unit_types:
- 2S6 Tunguska
- name: SA-20/S-300PMU-1 Battery 7
group: 3
unit_count:
- 2
unit_types:
- Tor 9A331
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,54 @@
name: SA-23/S-300VM Battery
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-23/S-300VM Battery 0
group: 1
unit_count:
- 1
unit_types:
- S-300VM 9S15M2 sr
- name: SA-23/S-300VM Battery 1
group: 1
unit_count:
- 1
unit_types:
- S-300VM 9S19M2 sr
- name: SA-23/S-300VM Battery 2
group: 1
unit_count:
- 1
unit_types:
- S-300VM 9S457ME cp
- name: SA-23/S-300VM Battery 3
group: 1
unit_count:
- 1
unit_types:
- S-300VM 9S32ME tr
- name: SA-23/S-300VM Battery 4
group: 1
unit_count:
- 3
unit_types:
- S-300VM 9A82ME ln
- name: SA-23/S-300VM Battery 5
group: 1
unit_count:
- 3
unit_types:
- S-300VM 9A83ME ln
- name: SA-23/S-300VM Battery 6
group: 2
unit_count:
- 2
unit_types:
- 2S6 Tunguska
- name: SA-23/S-300VM Battery 7
group: 3
unit_count:
- 2
unit_types:
- Tor 9A331
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: SA-2/S-75 Site
role: AntiAir
tasks:
- MERAD
groups:
- name: SA-2/S-75 Site 0
unit_count:
- 1
unit_types:
- p-19 s-125 sr
- name: SA-2/S-75 Site 1
unit_count:
- 1
unit_types:
- SNR_75V
- name: SA-2/S-75 Site 2
unit_count:
- 6
unit_types:
- S_75M_Volhov
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,21 @@
name: SA-3/S-125 Site
role: AntiAir
tasks:
- MERAD
groups:
- name: SA-3/S-125 Site 0
unit_count:
- 1
unit_types:
- p-19 s-125 sr
- name: SA-3/S-125 Site 1
unit_count:
- 1
unit_types:
- snr s-125 tr
- name: SA-3/S-125 Site 2
unit_count:
- 4
unit_types:
- 5p73 s-125 ln
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,26 @@
name: SA-5/S-200 Site
role: AntiAir
tasks:
- LORAD
groups:
- name: SA-5/S-200 Site 0
unit_count:
- 1
unit_types:
- RLS_19J6
- name: SA-5/S-200 Site 1
unit_count:
- 1
unit_types:
- RPC_5N62V
- name: SA-5/S-200 Site 2
unit_count:
- 1
unit_types:
- Ural-375
- name: SA-5/S-200 Site 3
unit_count:
- 6
unit_types:
- S-200_Launcher
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,16 @@
name: SA-6 Kub Site
role: AntiAir
tasks:
- MERAD
groups:
- name: SA-6 Kub Site 0
unit_count:
- 1
unit_types:
- Kub 1S91 str
- name: SA-6 Kub Site 1
unit_count:
- 4
unit_types:
- Kub 2P25 ln
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,19 @@
name: Short Range Anti Air Group
role: AntiAir
generic: true
tasks:
- SHORAD
groups:
- name: SHORAD Group 0
unit_count:
- 2
unit_classes:
- SHORAD
- name: SHORAD Group 1
optional: true
unit_count:
- 1
- 2
unit_classes:
- Logistics
template_file: resources/templates/anti_air/shorad.miz

View File

@ -0,0 +1,41 @@
name: WW2 Ally Flak Site
role: AntiAir
tasks:
- AAA
groups:
- name: WW2 Ally Flak Site 0
unit_count:
- 4
unit_types:
- QF_37_AA
- name: WW2 Ally Flak Site 1
unit_count:
- 8
unit_types:
- M1_37mm
- name: WW2 Ally Flak Site 2
unit_count:
- 8
unit_types:
- M45_Quadmount
- name: WW2 Ally Flak Site 3
unit_count:
- 1
unit_types:
- Willys_MB
- name: WW2 Ally Flak Site 4
unit_count:
- 1
unit_types:
- M30_CC
- name: WW2 Ally Flak Site 5
unit_count:
- 1
unit_types:
- M4_Tractor
- name: WW2 Ally Flak Site 6
unit_count:
- 1
unit_types:
- Bedford_MWD
template_file: resources/templates/anti_air/legacy_ground_templates.miz

View File

@ -0,0 +1,16 @@
name: WW2 Flak Site
role: AntiAir
tasks:
- AAA
groups:
- name: WW2 Flak Site 0
unit_count:
- 6
unit_types:
- flak18
- name: WW2 Flak Site 1
unit_count:
- 1
unit_types:
- Blitz_36-6700A
template_file: resources/templates/anti_air/legacy_ground_templates.miz

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,83 @@
name: allycamp1
role: Building
tasks:
- StrikeTarget
- AllyCamp
groups:
- name: allycamp1 0
statics:
- allycamp1 0-0
- allycamp1 0-1
- allycamp1 0-2
- allycamp1 0-3
unit_count:
- 4
unit_types:
- FARP Tent
- name: allycamp1 1
statics:
- allycamp1 1-0
- allycamp1 1-1
- allycamp1 1-2
- allycamp1 1-3
- allycamp1 1-4
- allycamp1 1-5
- allycamp1 1-6
- allycamp1 1-7
- allycamp1 1-8
- allycamp1 1-9
- allycamp1 1-10
- allycamp1 1-11
- allycamp1 1-12
- allycamp1 1-13
- allycamp1 1-14
- allycamp1 1-15
- allycamp1 1-16
- allycamp1 1-17
- allycamp1 1-18
- allycamp1 1-19
- allycamp1 1-20
- allycamp1 1-21
unit_count:
- 22
unit_types:
- Haystack 4
- name: allycamp1 2
statics:
- allycamp1 2-0
- allycamp1 2-1
- allycamp1 2-2
- allycamp1 2-3
- allycamp1 2-4
- allycamp1 2-5
- allycamp1 2-6
- allycamp1 2-7
- allycamp1 2-8
- allycamp1 2-9
- allycamp1 2-10
- allycamp1 2-11
unit_count:
- 12
unit_types:
- Haystack 3
- name: allycamp1 3
statics:
- allycamp1 3-0
- allycamp1 3-1
- allycamp1 3-2
- allycamp1 3-3
- allycamp1 3-4
- allycamp1 3-5
- allycamp1 3-6
- allycamp1 3-7
unit_count:
- 8
unit_types:
- Concertina wire
- name: allycamp1 4
group: 2 # Vehicle and static can not be mixed
unit_count:
- 4
unit_types:
- house2arm
template_file: resources/templates/buildings/buildings.miz

View File

@ -0,0 +1,21 @@
name: ammo1
role: Building
tasks:
- Ammo
groups:
- name: ammo1 0
statics:
- ammo1 0-0
unit_count:
- 1
unit_types:
- .Ammunition depot
- name: ammo1 1
statics:
- ammo1 1-0
- ammo1 1-1
unit_count:
- 2
unit_types:
- Hangar B
template_file: resources/templates/buildings/buildings.miz

Binary file not shown.

View File

@ -0,0 +1,15 @@
name: comms
role: Building
tasks:
- StrikeTarget
- Comms
groups:
- name: comms1 0
statics:
- comms1 0-0
unit_count:
- 1
unit_types:
- TV tower
- Comms tower M
template_file: resources/templates/buildings/buildings.miz

Some files were not shown because too many files have changed in this diff Show More