mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
canvas map overview WIP
This commit is contained in:
@@ -92,6 +92,7 @@ class InterceptEvent(Event):
|
||||
ESCORT_AMOUNT_FACTOR = 2
|
||||
BONUS_BASE = 5
|
||||
STRENGTH_INFLUENCE = 0.25
|
||||
AIRDEFENSE_COUNT = 3
|
||||
|
||||
def __str__(self):
|
||||
return "Intercept at {} ({})".format(self.to_cp, "*" * self.difficulty)
|
||||
@@ -112,6 +113,8 @@ class InterceptEvent(Event):
|
||||
transport_unit = random.choice(db.find_unittype(Transport, self.defender.name))
|
||||
assert transport_unit is not None
|
||||
|
||||
airdefense_unit = db.find_unittype(AirDefence, self.defender.name)[0]
|
||||
|
||||
self.operation = InterceptOperation(mission=self.mission,
|
||||
attacker=self.attacker,
|
||||
defender=self.defender,
|
||||
@@ -121,6 +124,7 @@ class InterceptEvent(Event):
|
||||
destination_port=self.to_cp.airport,
|
||||
escort=escort,
|
||||
transport={transport_unit: 1},
|
||||
airdefense={airdefense_unit: self.AIRDEFENSE_COUNT},
|
||||
interceptors=interceptors)
|
||||
|
||||
def player_defending(self, escort: db.PlaneDict, clients: db.PlaneDict):
|
||||
@@ -137,7 +141,8 @@ class InterceptEvent(Event):
|
||||
destination_port=self.to_cp.airport,
|
||||
escort=escort,
|
||||
transport={transport_unit: 1},
|
||||
interceptors=interceptors)
|
||||
interceptors=interceptors,
|
||||
airdefense={})
|
||||
|
||||
|
||||
class CaptureEvent(Event):
|
||||
|
||||
11
game/game.py
11
game/game.py
@@ -24,7 +24,7 @@ COMMISION_AMOUNTS_FACTORS = {
|
||||
|
||||
|
||||
ENEMY_INTERCEPT_PROBABILITY_BASE = 25
|
||||
ENEMY_CAPTURE_PROBABILITY_BASE = 15
|
||||
ENEMY_CAPTURE_PROBABILITY_BASE = 5
|
||||
|
||||
PLAYER_INTERCEPT_PROBABILITY_BASE = 30
|
||||
PLAYER_GROUNDINTERCEPT_PROBABILITY_BASE = 30
|
||||
@@ -49,10 +49,11 @@ class Game:
|
||||
|
||||
def _fill_cap_events(self):
|
||||
for from_cp, to_cp in self.theater.conflicts(True):
|
||||
self.events.append(CaptureEvent(attacker_name=self.player,
|
||||
defender_name=self.enemy,
|
||||
from_cp=from_cp,
|
||||
to_cp=to_cp))
|
||||
if to_cp not in [x.to_cp for x in self.events]:
|
||||
self.events.append(CaptureEvent(attacker_name=self.player,
|
||||
defender_name=self.enemy,
|
||||
from_cp=from_cp,
|
||||
to_cp=to_cp))
|
||||
|
||||
def _generate_enemy_caps(self):
|
||||
for from_cp, to_cp in self.theater.conflicts(False):
|
||||
|
||||
@@ -48,7 +48,7 @@ class CaptureOperation(Operation):
|
||||
attack: db.ArmorDict,
|
||||
intercept: db.PlaneDict,
|
||||
defense: db.ArmorDict,
|
||||
aa: db.AADict):
|
||||
aa: db.AirDefenseDict):
|
||||
conflict = to_cp.conflict_attack(from_cp, attacker, defender)
|
||||
|
||||
super(CaptureOperation, self).__init__(mission, conflict)
|
||||
@@ -84,6 +84,7 @@ class InterceptOperation(Operation):
|
||||
destination_port: Airport,
|
||||
escort: db.PlaneDict,
|
||||
transport: db.PlaneDict,
|
||||
airdefense: db.AirDefenseDict,
|
||||
interceptors: db.PlaneDict):
|
||||
conflict = Conflict.intercept_conflict(
|
||||
attacker=attacker,
|
||||
@@ -99,12 +100,14 @@ class InterceptOperation(Operation):
|
||||
self.defender_clients = defender_clients
|
||||
self.escort = escort
|
||||
self.transport = transport
|
||||
self.airdefense = airdefense
|
||||
self.interceptors = interceptors
|
||||
|
||||
def generate(self):
|
||||
self.airgen.generate_transport(self.transport, self.destination_port)
|
||||
self.airgen.generate_transport_escort(self.escort, clients=self.defender_clients)
|
||||
self.airgen.generate_interception(self.interceptors, clients=self.attacker_clients)
|
||||
self.aagen.generate(self.airdefense)
|
||||
|
||||
|
||||
class GroundInterceptOperation(Operation):
|
||||
|
||||
Reference in New Issue
Block a user