mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
added Gazelle as CAS aircraft + minor fixes
This commit is contained in:
parent
270820de0b
commit
05c968edc2
10
game/db.py
10
game/db.py
@ -39,10 +39,10 @@ PRICES = {
|
|||||||
# fighter
|
# fighter
|
||||||
C_101CC: 8,
|
C_101CC: 8,
|
||||||
MiG_23MLD: 18,
|
MiG_23MLD: 18,
|
||||||
Su_27: 24,
|
Su_27: 20,
|
||||||
Su_33: 25,
|
Su_33: 22,
|
||||||
MiG_29A: 24,
|
MiG_29A: 23,
|
||||||
MiG_29S: 26,
|
MiG_29S: 25,
|
||||||
|
|
||||||
F_5E_3: 6,
|
F_5E_3: 6,
|
||||||
MiG_15bis: 5,
|
MiG_15bis: 5,
|
||||||
@ -52,7 +52,7 @@ PRICES = {
|
|||||||
AV8BNA: 13,
|
AV8BNA: 13,
|
||||||
M_2000C: 13,
|
M_2000C: 13,
|
||||||
FA_18C_hornet: 18,
|
FA_18C_hornet: 18,
|
||||||
F_15C: 24,
|
F_15C: 20,
|
||||||
|
|
||||||
# bomber
|
# bomber
|
||||||
Su_25: 15,
|
Su_25: 15,
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class InsurgentAttackEvent(Event):
|
|||||||
SUCCESS_FACTOR = 0.7
|
SUCCESS_FACTOR = 0.7
|
||||||
TARGET_VARIETY = 2
|
TARGET_VARIETY = 2
|
||||||
TARGET_AMOUNT_FACTOR = 0.5
|
TARGET_AMOUNT_FACTOR = 0.5
|
||||||
|
STRENGTH_INFLUENCE = 0.1
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def threat_description(self):
|
def threat_description(self):
|
||||||
@ -31,6 +32,9 @@ class InsurgentAttackEvent(Event):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Destroy insurgents"
|
return "Destroy insurgents"
|
||||||
|
|
||||||
|
def skip(self):
|
||||||
|
self.to_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
||||||
|
|
||||||
def is_successfull(self, debriefing: Debriefing):
|
def is_successfull(self, debriefing: Debriefing):
|
||||||
killed_units = sum([v for k, v in debriefing.destroyed_units[self.attacker_name].items() if db.unit_task(k) == PinpointStrike])
|
killed_units = sum([v for k, v in debriefing.destroyed_units[self.attacker_name].items() if db.unit_task(k) == PinpointStrike])
|
||||||
all_units = sum(self.targets.values())
|
all_units = sum(self.targets.values())
|
||||||
|
|||||||
@ -58,14 +58,14 @@ EVENT_PROBABILITIES = {
|
|||||||
InfantryTransportEvent: [25, 0],
|
InfantryTransportEvent: [25, 0],
|
||||||
|
|
||||||
# events conditionally present; for both enemy and player
|
# events conditionally present; for both enemy and player
|
||||||
BaseAttackEvent: [100, 8],
|
BaseAttackEvent: [100, 9],
|
||||||
|
|
||||||
# events randomly present; for both enemy and player
|
# events randomly present; for both enemy and player
|
||||||
InterceptEvent: [25, 8],
|
InterceptEvent: [25, 9],
|
||||||
NavalInterceptEvent: [25, 8],
|
NavalInterceptEvent: [25, 9],
|
||||||
|
|
||||||
# events randomly present; only for the enemy
|
# events randomly present; only for the enemy
|
||||||
InsurgentAttackEvent: [0, 5],
|
InsurgentAttackEvent: [0, 6],
|
||||||
}
|
}
|
||||||
|
|
||||||
# amount of strength player bases recover for the turn
|
# amount of strength player bases recover for the turn
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class InterceptOperation(Operation):
|
|||||||
conflict=conflict)
|
conflict=conflict)
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.prepare_carriers(self.interceptors.keys())
|
self.prepare_carriers(db.unitdict_from(self.interceptors))
|
||||||
|
|
||||||
self.airgen.generate_transport(self.transport, self.to_cp.at)
|
self.airgen.generate_transport(self.transport, self.to_cp.at)
|
||||||
self.airgen.generate_defenders_escort(*assigned_units_split(self.escort), at=self.defenders_starting_position)
|
self.airgen.generate_defenders_escort(*assigned_units_split(self.escort), at=self.defenders_starting_position)
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class Operation:
|
|||||||
if not global_cp.is_global:
|
if not global_cp.is_global:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
ship = self.shipgen.generate_carrier(for_units=for_units,
|
ship = self.shipgen.generate_carrier(for_units=[t for t, c in for_units.items() if c > 0],
|
||||||
country=self.game.player,
|
country=self.game.player,
|
||||||
at=global_cp.at)
|
at=global_cp.at)
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
from .aircraft import *
|
|
||||||
|
|
||||||
|
|
||||||
class HelicopterConflictGenerator(AircraftConflictGenerator):
|
|
||||||
pass
|
|
||||||
@ -16,13 +16,9 @@ class ShipGenerator:
|
|||||||
self.m = mission
|
self.m = mission
|
||||||
self.conflict = conflict
|
self.conflict = conflict
|
||||||
|
|
||||||
def generate_carrier(self, for_units: db.UnitsDict, country: str, at: Point) -> ShipGroup:
|
def generate_carrier(self, for_units: typing.Collection[UnitType], country: str, at: Point) -> ShipGroup:
|
||||||
type = db.find_unittype(Carriage, country)[0]
|
type = db.find_unittype(Carriage, country)[0]
|
||||||
print(for_units)
|
for unit_type in for_units:
|
||||||
for unit_type, unit_count in for_units.items():
|
|
||||||
if unit_count == 0:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if unit_type in db.CARRIER_TYPE_BY_PLANE:
|
if unit_type in db.CARRIER_TYPE_BY_PLANE:
|
||||||
type = db.CARRIER_TYPE_BY_PLANE[unit_type]
|
type = db.CARRIER_TYPE_BY_PLANE[unit_type]
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user