WIP for possibility to select player and ennemy faction

This commit is contained in:
Khopa
2019-06-30 05:31:22 +02:00
parent 09135adadc
commit fbd01fbfdb
31 changed files with 448 additions and 357 deletions

View File

@@ -39,7 +39,7 @@ class BaseAttackEvent(Event):
if self.departure_cp.captured:
self.to_cp.captured = True
self.to_cp.ground_objects = []
self.to_cp.base.filter_units(db.UNIT_BY_COUNTRY[self.attacker_name])
self.to_cp.base.filter_units(db.UNIT_BY_COUNTRY[self.attacker_name]["units"])
self.to_cp.base.affect_strength(+self.STRENGTH_RECOVERY)
else:

View File

@@ -47,11 +47,11 @@ class Event:
@property
def is_player_attacking(self) -> bool:
return self.attacker_name == self.game.player
return self.attacker_name == self.game.player_name
@property
def enemy_cp(self) -> ControlPoint:
if self.attacker_name == self.game.player:
if self.attacker_name == self.game.player_name:
return self.to_cp
else:
return self.departure_cp

View File

@@ -51,7 +51,7 @@ class InterceptEvent(Event):
def commit(self, debriefing: Debriefing):
super(InterceptEvent, self).commit(debriefing)
if self.attacker_name == self.game.player:
if self.attacker_name == self.game.player_name:
if self.is_successfull(debriefing):
for _, cp in self.game.theater.conflicts(True):
cp.base.affect_strength(-self.STRENGTH_INFLUENCE)

View File

@@ -61,7 +61,7 @@ class NavalInterceptEvent(Event):
def commit(self, debriefing: Debriefing):
super(NavalInterceptEvent, self).commit(debriefing)
if self.attacker_name == self.game.player:
if self.attacker_name == self.game.player_name:
if self.is_successfull(debriefing):
self.to_cp.base.affect_strength(-self.STRENGTH_INFLUENCE)
else: