Selectable factions wip

This commit is contained in:
Khopa
2019-06-30 14:05:26 +02:00
parent 658120b8d9
commit 309c10c4cb
23 changed files with 359 additions and 132 deletions

View File

@@ -37,6 +37,8 @@ class BaseAttackOperation(Operation):
self.attackers_starting_position = None
conflict = Conflict.capture_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -17,6 +17,8 @@ class ConvoyStrikeOperation(Operation):
super(ConvoyStrikeOperation, self).prepare(terrain, is_quick)
conflict = Conflict.convoy_strike_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -34,6 +34,8 @@ class FrontlineAttackOperation(Operation):
self.defenders_starting_position = None
conflict = Conflict.frontline_cas_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -32,6 +32,8 @@ class FrontlinePatrolOperation(Operation):
self.defenders_starting_position = None
conflict = Conflict.frontline_cap_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -15,6 +15,8 @@ class InfantryTransportOperation(Operation):
super(InfantryTransportOperation, self).prepare(terrain, is_quick)
conflict = Conflict.transport_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -17,6 +17,8 @@ class InsurgentAttackOperation(Operation):
super(InsurgentAttackOperation, self).prepare(terrain, is_quick)
conflict = Conflict.ground_attack_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,

View File

@@ -31,6 +31,8 @@ class InterceptOperation(Operation):
self.attackers_starting_position = None
conflict = Conflict.intercept_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
position=self.location,

View File

@@ -26,6 +26,8 @@ class NavalInterceptionOperation(Operation):
self.attackers_starting_position = None
conflict = Conflict.naval_intercept_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
position=self.location,

View File

@@ -43,9 +43,9 @@ class Operation:
to_cp: ControlPoint = None):
self.game = game
self.attacker_name = attacker_name
self.attacker_country = db.UNIT_BY_COUNTRY[attacker_name]["country"]
self.attacker_country = db.FACTIONS[attacker_name]["country"]
self.defender_name = defender_name
self.defender_country = db.UNIT_BY_COUNTRY[defender_name]["country"]
self.defender_country = db.FACTIONS[defender_name]["country"]
print(self.defender_country, self.attacker_country)
self.from_cp = from_cp
self.departure_cp = departure_cp
@@ -137,7 +137,7 @@ class Operation:
self.extra_aagen.generate()
# triggers
if self.game.is_player_attack(self.conflict.attackers_side):
if self.game.is_player_attack(self.conflict.attackers_country):
cp = self.conflict.from_cp
else:
cp = self.conflict.to_cp

View File

@@ -29,6 +29,8 @@ class StrikeOperation(Operation):
self.attackers_starting_position = None
conflict = Conflict.strike_conflict(
attacker_name=self.attacker_name,
defender_name=self.defender_name,
attacker=self.current_mission.country(self.attacker_country),
defender=self.current_mission.country(self.defender_country),
from_cp=self.from_cp,