Exemplo n.º 1
0
    def air_strike(self, coords, rotation=0):
        result = {}
        for coords in Settings.shape("air_strike"):
            result[coords] = self.battlefield[coords].air_strike()
            if result[coords] == "aircraft destroyed":
                break

        # aircraft isn't lost if it wasnt destroyed unlike other resources
        if "aircraft destroyed" not in result.values():
            self.resourses['aircrafts'] += 1

        return result
Exemplo n.º 2
0
 def battery(self, coords, rotation=0):
     return [self.battlefield[i].hit()
             for i in Settings.shape("battery", coords, rotation)]
Exemplo n.º 3
0
 def torpedo_net(self, coords, rotation=0):
     for i in Settings.shape("torpedo_net", coords, rotation):
         self.battlefield[i].set_torpedo_net()
Exemplo n.º 4
0
 def anti_air(self, coords, rotation=0):
     for i in Settings.shape("anti_air", coords, rotation):
         self.battlefield[i].deploy_anti("air")
Exemplo n.º 5
0
 def radar_jam(self, coords, rotation=0):
     for i in Settings.shape("radar_jam", coords, rotation):
         self.battlefield[i].deploy_anti("radar")
Exemplo n.º 6
0
 def radar_scan(self, coords, rotation=0):
     return [self.battlefield[i].radar_scan()
             for i in Settings.shape("radar_scan", coords, rotation)]