mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +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
|
||||
C_101CC: 8,
|
||||
MiG_23MLD: 18,
|
||||
Su_27: 24,
|
||||
Su_33: 25,
|
||||
MiG_29A: 24,
|
||||
MiG_29S: 26,
|
||||
Su_27: 20,
|
||||
Su_33: 22,
|
||||
MiG_29A: 23,
|
||||
MiG_29S: 25,
|
||||
|
||||
F_5E_3: 6,
|
||||
MiG_15bis: 5,
|
||||
@ -52,7 +52,7 @@ PRICES = {
|
||||
AV8BNA: 13,
|
||||
M_2000C: 13,
|
||||
FA_18C_hornet: 18,
|
||||
F_15C: 24,
|
||||
F_15C: 20,
|
||||
|
||||
# bomber
|
||||
Su_25: 15,
|
||||
|
||||
@ -15,6 +15,7 @@ class InsurgentAttackEvent(Event):
|
||||
SUCCESS_FACTOR = 0.7
|
||||
TARGET_VARIETY = 2
|
||||
TARGET_AMOUNT_FACTOR = 0.5
|
||||
STRENGTH_INFLUENCE = 0.1
|
||||
|
||||
@property
|
||||
def threat_description(self):
|
||||
@ -31,6 +32,9 @@ class InsurgentAttackEvent(Event):
|
||||
def __str__(self):
|
||||
return "Destroy insurgents"
|
||||
|
||||
def skip(self):
|
||||
self.to_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
|
||||
|
||||
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])
|
||||
all_units = sum(self.targets.values())
|
||||
|
||||
@ -58,14 +58,14 @@ EVENT_PROBABILITIES = {
|
||||
InfantryTransportEvent: [25, 0],
|
||||
|
||||
# events conditionally present; for both enemy and player
|
||||
BaseAttackEvent: [100, 8],
|
||||
BaseAttackEvent: [100, 9],
|
||||
|
||||
# events randomly present; for both enemy and player
|
||||
InterceptEvent: [25, 8],
|
||||
NavalInterceptEvent: [25, 8],
|
||||
InterceptEvent: [25, 9],
|
||||
NavalInterceptEvent: [25, 9],
|
||||
|
||||
# events randomly present; only for the enemy
|
||||
InsurgentAttackEvent: [0, 5],
|
||||
InsurgentAttackEvent: [0, 6],
|
||||
}
|
||||
|
||||
# amount of strength player bases recover for the turn
|
||||
|
||||
@ -39,7 +39,7 @@ class InterceptOperation(Operation):
|
||||
conflict=conflict)
|
||||
|
||||
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_defenders_escort(*assigned_units_split(self.escort), at=self.defenders_starting_position)
|
||||
|
||||
@ -88,7 +88,7 @@ class Operation:
|
||||
if not global_cp.is_global:
|
||||
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,
|
||||
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.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]
|
||||
print(for_units)
|
||||
for unit_type, unit_count in for_units.items():
|
||||
if unit_count == 0:
|
||||
continue
|
||||
|
||||
for unit_type in for_units:
|
||||
if unit_type in db.CARRIER_TYPE_BY_PLANE:
|
||||
type = db.CARRIER_TYPE_BY_PLANE[unit_type]
|
||||
break
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user