mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add hit points to unit yamls.
This PR: - Introduces a new member of UnitType, hit_points, which is an abstract representation of the durability of a unit, and loads it in from the YAML files in the various subclasses (Ship, Ground etc). - Adds scripts for populating/updating the unit YAML files with hit point data from DCS. This script also gets the data for static objects, but I'll leave the plugging in of static object data into Liberation for another PR. - Updates the unit YAML files by running the above scripts. I did toy with the idea of adding this data to the unit definitions in pydcs via an export from DCS, but it would be a more involved change, since the current pydcs export script runs in the Hooks Lua environment in DCS and AFAICT the hit points (via Unit.getLife()) is run in the mission scripting environment.
This commit is contained in:
parent
5b858886c0
commit
5af4e56f30
@ -517,6 +517,7 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
||||
LaserCodeConfig.from_yaml(d) for d in data.get("laser_codes", [])
|
||||
],
|
||||
use_f15e_waypoint_names=data.get("use_f15e_waypoint_names", False),
|
||||
hit_points=data.get("hit_points", 1),
|
||||
)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
|
||||
@ -133,4 +133,5 @@ class GroundUnitType(UnitType[Type[VehicleType]]):
|
||||
data.get("skynet_properties", {})
|
||||
),
|
||||
reversed_heading=data.get("reversed_heading", False),
|
||||
hit_points=data.get("hit_points", 1),
|
||||
)
|
||||
|
||||
@ -79,4 +79,5 @@ class ShipUnitType(UnitType[Type[ShipType]]):
|
||||
manufacturer=data.get("manufacturer", "No data."),
|
||||
role=data.get("role", "No data."),
|
||||
price=data["price"],
|
||||
hit_points=data.get("hit_points", 1),
|
||||
)
|
||||
|
||||
@ -27,6 +27,7 @@ class UnitType(ABC, Generic[DcsUnitTypeT]):
|
||||
role: str
|
||||
price: int
|
||||
unit_class: UnitClass
|
||||
hit_points: int
|
||||
|
||||
_loaded: ClassVar[bool] = False
|
||||
|
||||
|
||||
@ -20,3 +20,4 @@ tasks:
|
||||
BAI: 680
|
||||
CAS: 680
|
||||
OCA/Aircraft: 680
|
||||
hit_points: 32
|
||||
|
||||
@ -30,3 +30,4 @@ tasks:
|
||||
OCA/Aircraft: 820
|
||||
OCA/Runway: 380
|
||||
Strike: 380
|
||||
hit_points: 32
|
||||
|
||||
@ -34,3 +34,4 @@ tasks:
|
||||
OCA/Aircraft: 830
|
||||
OCA/Runway: 390
|
||||
Strike: 390
|
||||
hit_points: 32
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
OCA/Aircraft: 160
|
||||
OCA/Runway: 140
|
||||
Strike: 140
|
||||
hit_points: 18
|
||||
|
||||
@ -8,3 +8,4 @@ variants:
|
||||
A-50: null
|
||||
tasks:
|
||||
AEW&C: 10
|
||||
hit_points: 60
|
||||
|
||||
@ -23,3 +23,4 @@ tasks:
|
||||
BAI: 480
|
||||
CAS: 480
|
||||
OCA/Aircraft: 480
|
||||
hit_points: 14
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
BAI: 490
|
||||
CAS: 490
|
||||
OCA/Aircraft: 490
|
||||
hit_points: 14
|
||||
|
||||
@ -25,3 +25,4 @@ tasks:
|
||||
BAI: 500
|
||||
CAS: 500
|
||||
OCA/Aircraft: 500
|
||||
hit_points: 14
|
||||
|
||||
@ -42,3 +42,4 @@ tasks:
|
||||
OCA/Aircraft: 510
|
||||
default_overrides:
|
||||
FCR_RFI_removed: false
|
||||
hit_points: 20
|
||||
|
||||
@ -43,3 +43,4 @@ tasks:
|
||||
OCA/Aircraft: 620
|
||||
OCA/Runway: 620
|
||||
Strike: 630
|
||||
hit_points: 18
|
||||
|
||||
@ -63,3 +63,4 @@ tasks:
|
||||
SEAD: 70
|
||||
SEAD Escort: 70
|
||||
Strike: 590
|
||||
hit_points: 18
|
||||
|
||||
@ -5,3 +5,4 @@ variants:
|
||||
An-26B: null
|
||||
tasks:
|
||||
Transport: 110
|
||||
hit_points: 45
|
||||
|
||||
@ -3,3 +3,4 @@ price: 15
|
||||
variants:
|
||||
An-30M: null
|
||||
tasks: {}
|
||||
hit_points: 45
|
||||
|
||||
@ -23,3 +23,4 @@ variants:
|
||||
tasks:
|
||||
OCA/Runway: 150
|
||||
Strike: 150
|
||||
hit_points: 18
|
||||
|
||||
@ -23,3 +23,4 @@ tasks:
|
||||
OCA/Aircraft: 670
|
||||
OCA/Runway: 670
|
||||
Strike: 700
|
||||
hit_points: 60
|
||||
|
||||
@ -17,3 +17,4 @@ tasks:
|
||||
DEAD: 210
|
||||
OCA/Runway: 660
|
||||
Strike: 690
|
||||
hit_points: 60
|
||||
|
||||
@ -34,3 +34,4 @@ tasks:
|
||||
OCA/Runway: 20
|
||||
Strike: 20
|
||||
TARCAP: 60
|
||||
hit_points: 18
|
||||
|
||||
@ -30,3 +30,4 @@ tasks:
|
||||
OCA/Runway: 170
|
||||
Strike: 170
|
||||
TARCAP: 130
|
||||
hit_points: 18
|
||||
|
||||
@ -5,3 +5,4 @@ variants:
|
||||
C-130: null
|
||||
tasks:
|
||||
Transport: 130
|
||||
hit_points: 45
|
||||
|
||||
@ -5,3 +5,4 @@ variants:
|
||||
C-17A: null
|
||||
tasks:
|
||||
Transport: 150
|
||||
hit_points: 45
|
||||
|
||||
@ -13,3 +13,4 @@ variants:
|
||||
C-47 Dakota: null
|
||||
tasks:
|
||||
Transport: 90
|
||||
hit_points: 18
|
||||
|
||||
@ -10,3 +10,4 @@ variants:
|
||||
tasks:
|
||||
Air Assault: 90
|
||||
Transport: 70
|
||||
hit_points: 20
|
||||
|
||||
@ -10,3 +10,4 @@ variants:
|
||||
tasks:
|
||||
Air Assault: 100
|
||||
Transport: 80
|
||||
hit_points: 20
|
||||
|
||||
@ -16,3 +16,4 @@ variants:
|
||||
E-2D Advanced Hawkeye: {}
|
||||
tasks:
|
||||
AEW&C: 20
|
||||
hit_points: 25
|
||||
|
||||
@ -8,3 +8,4 @@ variants:
|
||||
E-3A: null
|
||||
tasks:
|
||||
AEW&C: 30
|
||||
hit_points: 60
|
||||
|
||||
@ -20,3 +20,4 @@ variants:
|
||||
tasks:
|
||||
Strike: 710
|
||||
has_built_in_target_pod: true
|
||||
hit_points: 20
|
||||
|
||||
@ -59,3 +59,4 @@ tasks:
|
||||
SEAD Escort: 90
|
||||
Strike: 550
|
||||
TARCAP: 520
|
||||
hit_points: 20
|
||||
|
||||
@ -59,3 +59,4 @@ tasks:
|
||||
SEAD Escort: 100
|
||||
Strike: 560
|
||||
TARCAP: 530
|
||||
hit_points: 20
|
||||
|
||||
@ -18,3 +18,4 @@ tasks:
|
||||
Fighter sweep: 540
|
||||
Intercept: 540
|
||||
TARCAP: 540
|
||||
hit_points: 20
|
||||
|
||||
@ -25,3 +25,4 @@ tasks:
|
||||
Strike: 640
|
||||
TARCAP: 240
|
||||
has_built_in_target_pod: true
|
||||
hit_points: 20
|
||||
|
||||
@ -51,3 +51,4 @@ laser_codes:
|
||||
- property:
|
||||
id: Sta8LaserCode
|
||||
digits: 3
|
||||
hit_points: 18
|
||||
|
||||
@ -16,3 +16,4 @@ tasks:
|
||||
OCA/Runway: 570
|
||||
Strike: 570
|
||||
TARCAP: 420
|
||||
hit_points: 14
|
||||
|
||||
@ -78,3 +78,4 @@ laser_codes:
|
||||
digit: 1
|
||||
- id: LaserCode1
|
||||
digit: 0
|
||||
hit_points: 20
|
||||
|
||||
@ -33,3 +33,4 @@ tasks:
|
||||
SEAD Escort: 120
|
||||
Strike: 400
|
||||
TARCAP: 410
|
||||
hit_points: 20
|
||||
|
||||
@ -48,3 +48,4 @@ tasks:
|
||||
OCA/Runway: 190
|
||||
Strike: 200
|
||||
TARCAP: 200
|
||||
hit_points: 16
|
||||
|
||||
@ -26,3 +26,4 @@ tasks:
|
||||
OCA/Runway: 180
|
||||
Strike: 190
|
||||
TARCAP: 150
|
||||
hit_points: 15
|
||||
|
||||
@ -68,3 +68,4 @@ tasks:
|
||||
SEAD Escort: 160
|
||||
Strike: 600
|
||||
TARCAP: 450
|
||||
hit_points: 20
|
||||
|
||||
@ -44,3 +44,4 @@ tasks:
|
||||
OCA/Runway: 0
|
||||
Strike: 0
|
||||
TARCAP: 40
|
||||
hit_points: 18
|
||||
|
||||
@ -33,3 +33,4 @@ tasks:
|
||||
OCA/Runway: 10
|
||||
Strike: 10
|
||||
TARCAP: 50
|
||||
hit_points: 18
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
OCA/Aircraft: 380
|
||||
OCA/Runway: 640
|
||||
Strike: 650
|
||||
hit_points: 18
|
||||
|
||||
@ -28,3 +28,4 @@ tasks:
|
||||
Intercept: 0
|
||||
OCA/Aircraft: 60
|
||||
TARCAP: 0
|
||||
hit_points: 15
|
||||
|
||||
@ -4,3 +4,4 @@ variants:
|
||||
IL-76MD: null
|
||||
tasks:
|
||||
Transport: 120
|
||||
hit_points: 60
|
||||
|
||||
@ -9,3 +9,4 @@ variants:
|
||||
IL-78M: null
|
||||
tasks:
|
||||
Refueling: 30
|
||||
hit_points: 60
|
||||
|
||||
@ -18,3 +18,4 @@ tasks:
|
||||
Fighter sweep: 500
|
||||
Intercept: 500
|
||||
TARCAP: 500
|
||||
hit_points: 18
|
||||
|
||||
@ -53,3 +53,4 @@ tasks:
|
||||
SEAD Escort: 180
|
||||
Strike: 580
|
||||
TARCAP: 440
|
||||
hit_points: 18
|
||||
|
||||
@ -27,3 +27,4 @@ tasks:
|
||||
OCA/Aircraft: 150
|
||||
OCA/Runway: 130
|
||||
Strike: 130
|
||||
hit_points: 18
|
||||
|
||||
@ -17,3 +17,4 @@ variants:
|
||||
KC-135 Stratotanker: {}
|
||||
tasks:
|
||||
Refueling: 50
|
||||
hit_points: 60
|
||||
|
||||
@ -15,3 +15,4 @@ variants:
|
||||
KC-130: {}
|
||||
tasks:
|
||||
Refueling: 10
|
||||
hit_points: 18
|
||||
|
||||
@ -17,3 +17,4 @@ variants:
|
||||
KC-135 Stratotanker MPRS: {}
|
||||
tasks:
|
||||
Refueling: 40
|
||||
hit_points: 18
|
||||
|
||||
@ -6,3 +6,4 @@ variants:
|
||||
KJ-2000: null
|
||||
tasks:
|
||||
AEW&C: 0
|
||||
hit_points: 18
|
||||
|
||||
@ -29,3 +29,4 @@ tasks:
|
||||
CAS: 430
|
||||
DEAD: 113
|
||||
OCA/Aircraft: 430
|
||||
hit_points: 15
|
||||
|
||||
@ -29,3 +29,4 @@ tasks:
|
||||
CAS: 440
|
||||
DEAD: 114
|
||||
OCA/Aircraft: 440
|
||||
hit_points: 15
|
||||
|
||||
@ -30,3 +30,4 @@ tasks:
|
||||
OCA/Runway: 160
|
||||
Strike: 160
|
||||
TARCAP: 120
|
||||
hit_points: 15
|
||||
|
||||
@ -48,3 +48,4 @@ tasks:
|
||||
OCA/Runway: 320
|
||||
Strike: 320
|
||||
TARCAP: 230
|
||||
hit_points: 18
|
||||
|
||||
@ -26,3 +26,4 @@ tasks:
|
||||
OCA/Aircraft: 240
|
||||
OCA/Runway: 200
|
||||
Strike: 180
|
||||
hit_points: 18
|
||||
|
||||
@ -5,3 +5,4 @@ tasks:
|
||||
BAI: 10
|
||||
CAS: 10
|
||||
OCA/Aircraft: 10
|
||||
hit_points: 18
|
||||
|
||||
@ -31,3 +31,4 @@ tasks:
|
||||
BAI: 410
|
||||
CAS: 410
|
||||
OCA/Aircraft: 410
|
||||
hit_points: 20
|
||||
|
||||
@ -30,3 +30,4 @@ tasks:
|
||||
BAI: 400
|
||||
CAS: 400
|
||||
OCA/Aircraft: 400
|
||||
hit_points: 16
|
||||
|
||||
@ -7,3 +7,4 @@ variants:
|
||||
tasks:
|
||||
Air Assault: 30
|
||||
Transport: 0
|
||||
hit_points: 30
|
||||
|
||||
@ -19,3 +19,4 @@ tasks:
|
||||
BAI: 420
|
||||
CAS: 420
|
||||
OCA/Aircraft: 420
|
||||
hit_points: 15
|
||||
|
||||
@ -21,3 +21,4 @@ tasks:
|
||||
CAS: 390
|
||||
OCA/Aircraft: 390
|
||||
Transport: 10
|
||||
hit_points: 18
|
||||
|
||||
@ -33,3 +33,4 @@ tasks:
|
||||
OCA/Runway: 210
|
||||
Strike: 210
|
||||
TARCAP: 140
|
||||
hit_points: 15
|
||||
|
||||
@ -44,3 +44,4 @@ tasks:
|
||||
Intercept: 170
|
||||
OCA/Aircraft: 370
|
||||
TARCAP: 170
|
||||
hit_points: 18
|
||||
|
||||
@ -39,3 +39,4 @@ tasks:
|
||||
OCA/Runway: 220
|
||||
Strike: 220
|
||||
TARCAP: 350
|
||||
hit_points: 20
|
||||
|
||||
@ -25,3 +25,4 @@ tasks:
|
||||
Fighter sweep: 360
|
||||
Intercept: 360
|
||||
TARCAP: 360
|
||||
hit_points: 16
|
||||
|
||||
@ -34,3 +34,4 @@ tasks:
|
||||
Fighter sweep: 390
|
||||
Intercept: 390
|
||||
TARCAP: 390
|
||||
hit_points: 24
|
||||
|
||||
@ -29,3 +29,4 @@ max_range: 500
|
||||
variants:
|
||||
MiG-25RBT Foxbat-B: {}
|
||||
tasks: {}
|
||||
hit_points: 24
|
||||
|
||||
@ -25,3 +25,4 @@ tasks:
|
||||
SEAD: 10
|
||||
SEAD Escort: 10
|
||||
Strike: 230
|
||||
hit_points: 18
|
||||
|
||||
@ -40,3 +40,4 @@ tasks:
|
||||
OCA/Runway: 410
|
||||
Strike: 410
|
||||
TARCAP: 370
|
||||
hit_points: 16
|
||||
|
||||
@ -37,3 +37,4 @@ tasks:
|
||||
OCA/Runway: 420
|
||||
Strike: 420
|
||||
TARCAP: 380
|
||||
hit_points: 16
|
||||
|
||||
@ -40,3 +40,4 @@ tasks:
|
||||
OCA/Runway: 430
|
||||
Strike: 430
|
||||
TARCAP: 470
|
||||
hit_points: 16
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
Fighter sweep: 400
|
||||
Intercept: 400
|
||||
TARCAP: 400
|
||||
hit_points: 24
|
||||
|
||||
@ -21,3 +21,4 @@ tasks:
|
||||
Fighter sweep: 340
|
||||
Intercept: 340
|
||||
TARCAP: 340
|
||||
hit_points: 16
|
||||
|
||||
@ -25,3 +25,4 @@ tasks:
|
||||
OCA/Runway: 310
|
||||
Strike: 310
|
||||
TARCAP: 330
|
||||
hit_points: 18
|
||||
|
||||
@ -22,3 +22,4 @@ tasks:
|
||||
OCA/Runway: 300
|
||||
Strike: 300
|
||||
TARCAP: 320
|
||||
hit_points: 18
|
||||
|
||||
@ -17,3 +17,4 @@ tasks:
|
||||
Fighter sweep: 260
|
||||
Intercept: 260
|
||||
TARCAP: 260
|
||||
hit_points: 18
|
||||
|
||||
@ -31,3 +31,4 @@ tasks:
|
||||
OCA/Runway: 290
|
||||
Strike: 290
|
||||
TARCAP: 310
|
||||
hit_points: 18
|
||||
|
||||
@ -32,3 +32,4 @@ tasks:
|
||||
OCA/Runway: 240
|
||||
Strike: 240
|
||||
TARCAP: 250
|
||||
hit_points: 18
|
||||
|
||||
@ -23,3 +23,4 @@ tasks:
|
||||
OCA/Runway: 280
|
||||
Strike: 280
|
||||
TARCAP: 300
|
||||
hit_points: 18
|
||||
|
||||
@ -22,3 +22,4 @@ tasks:
|
||||
OCA/Runway: 270
|
||||
Strike: 270
|
||||
TARCAP: 290
|
||||
hit_points: 18
|
||||
|
||||
@ -27,3 +27,4 @@ tasks:
|
||||
OCA/Runway: 260
|
||||
Strike: 260
|
||||
TARCAP: 280
|
||||
hit_points: 18
|
||||
|
||||
@ -27,3 +27,4 @@ tasks:
|
||||
OCA/Runway: 250
|
||||
Strike: 250
|
||||
TARCAP: 270
|
||||
hit_points: 18
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
OCA/Runway: 30
|
||||
Strike: 30
|
||||
TARCAP: 70
|
||||
hit_points: 48
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
BAI: 470
|
||||
CAS: 470
|
||||
OCA/Aircraft: 470
|
||||
hit_points: 12
|
||||
|
||||
@ -44,3 +44,4 @@ tasks:
|
||||
OCA/Runway: 80
|
||||
Strike: 80
|
||||
TARCAP: 30
|
||||
hit_points: 24
|
||||
|
||||
@ -44,3 +44,4 @@ tasks:
|
||||
OCA/Runway: 90
|
||||
Strike: 90
|
||||
TARCAP: 20
|
||||
hit_points: 24
|
||||
|
||||
@ -44,3 +44,4 @@ tasks:
|
||||
OCA/Runway: 100
|
||||
Strike: 100
|
||||
TARCAP: 10
|
||||
hit_points: 24
|
||||
|
||||
@ -43,3 +43,4 @@ tasks:
|
||||
OCA/Runway: 70
|
||||
Strike: 70
|
||||
TARCAP: 110
|
||||
hit_points: 18
|
||||
|
||||
@ -43,3 +43,4 @@ tasks:
|
||||
OCA/Runway: 60
|
||||
Strike: 60
|
||||
TARCAP: 100
|
||||
hit_points: 18
|
||||
|
||||
@ -5,3 +5,4 @@ tasks:
|
||||
BAI: 0
|
||||
CAS: 0
|
||||
OCA/Aircraft: 0
|
||||
hit_points: 5
|
||||
|
||||
@ -26,3 +26,4 @@ variants:
|
||||
S-3B Tanker: {}
|
||||
tasks:
|
||||
Refueling: 0
|
||||
hit_points: 25
|
||||
|
||||
@ -26,3 +26,4 @@ tasks:
|
||||
OCA/Aircraft: 570
|
||||
OCA/Runway: 370
|
||||
Strike: 370
|
||||
hit_points: 25
|
||||
|
||||
@ -24,3 +24,4 @@ tasks:
|
||||
BAI: 450
|
||||
CAS: 450
|
||||
OCA/Aircraft: 450
|
||||
hit_points: 18
|
||||
|
||||
@ -27,3 +27,4 @@ tasks:
|
||||
BAI: 460
|
||||
CAS: 460
|
||||
OCA/Aircraft: 460
|
||||
hit_points: 18
|
||||
|
||||
@ -6,3 +6,4 @@ variants:
|
||||
SA342Minigun: null
|
||||
kneeboard_units: "metric"
|
||||
tasks: {}
|
||||
hit_points: 18
|
||||
|
||||
@ -21,3 +21,4 @@ variants:
|
||||
SA 342M Gazelle Mistral: {}
|
||||
kneeboard_units: "metric"
|
||||
tasks: {}
|
||||
hit_points: 18
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user