diff --git a/game/db.py b/game/db.py index 17648057..7253d4d2 100644 --- a/game/db.py +++ b/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, diff --git a/game/event/insurgentattack.py b/game/event/insurgentattack.py index 5a5d3f0a..a04d2168 100644 --- a/game/event/insurgentattack.py +++ b/game/event/insurgentattack.py @@ -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()) diff --git a/game/game.py b/game/game.py index 7de3101d..3215202f 100644 --- a/game/game.py +++ b/game/game.py @@ -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 diff --git a/game/operation/intercept.py b/game/operation/intercept.py index 27dabcda..b1ad1ee2 100644 --- a/game/operation/intercept.py +++ b/game/operation/intercept.py @@ -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) diff --git a/game/operation/operation.py b/game/operation/operation.py index 19ff9611..2631da4e 100644 --- a/game/operation/operation.py +++ b/game/operation/operation.py @@ -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) diff --git a/gen/heli.py b/gen/heli.py deleted file mode 100644 index dc4968c5..00000000 --- a/gen/heli.py +++ /dev/null @@ -1,5 +0,0 @@ -from .aircraft import * - - -class HelicopterConflictGenerator(AircraftConflictGenerator): - pass diff --git a/gen/shipgen.py b/gen/shipgen.py index bdff7234..47808961 100644 --- a/gen/shipgen.py +++ b/gen/shipgen.py @@ -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