示例#1
0
文件: Leaf.py 项目: AdamJacoby/Game
	def legal_ability(self,Pieces,Board):
		temp = False
		for piece in Pieces:
			if piece.controller == self.controller and not(piece.loc_type in ['draft','hand','goal','nutral_zone']):
				temp = True
		if temp ==False:
			return False
		return Piece.legal_ability(self,Pieces,Board)
示例#2
0
 def legal_ability(self, Pieces, Board):
     shots_exists = False
     for piece in Pieces:
         if self.legal_shot(piece, Pieces, Board):
             shots_exists = True
     if not shots_exists:
         return False
     return Piece.legal_ability(self, Pieces, Board)
示例#3
0
	def legal_ability(self,Pieces,Board):
		[targets,directions] =All_Straight_Line_Intersections(self.pos,Pieces,Board)
		targets_exist = False
		for i in range(0,len(targets)):
			if self.legal_target(targets[i],directions[i],Pieces,Board):
				targets_exist=True
		if targets_exist:
			return Piece.legal_ability(self,Pieces,Board)
		return False
示例#4
0
 def legal_ability(self, Pieces, Board):
     legal = False
     for piece in Pieces:
         if piece.controller == self.controller and not piece.loc_type in [
                 'hand', 'draft'
         ]:
             legal = True
     if not legal:
         return False
     return Piece.legal_ability(self, Pieces, Turn_Indicator)
示例#5
0
文件: Shadow.py 项目: AdamJacoby/Game
 def legal_ability(self, Pieces, Board):
     other_pieces = False
     for piece in Pieces:
         if piece.controller == self.controller and not piece.loc_type in [
                 'hand', 'draft'
         ]:
             other_pieces = True
     if not other_pieces:
         return False
     return Piece.legal_ability(self, Pieces, Board)
示例#6
0
文件: Rock.py 项目: AdamJacoby/Game
 def remove(self, Pieces):
     hand = []
     for piece in Pieces:
         if piece.controller == self.controller and piece.loc_type == 'hand':
             hand.append(int(round(piece.loc[0] / self.cell_dim + 1)))
     if len(hand) == 7:
         Piece.remove(self, Pieces)
     else:
         self.loc_type = 'hand'
         for i in range(1, 8):
             if not (i in hand):
                 if self.controller == 1:
                     self.loc = [
                         int(self.cell_dim * (i - 1)),
                         int(round(float(self.board_height) / 4)) -
                         self.cell_dim
                     ]
                 if self.controller == 0:
                     self.loc = [
                         int(self.cell_dim * (i - 1)),
                         int(round(3 * float(self.board_height) / 4))
                     ]
示例#7
0
 def __init__(self, name, surface, draft_loc, move_range, bloackable,
              ability_type, move_text, ability_text, Board):
     self.move_range2 = [[1, 1], [1, -1], [1, 0], [-1, 1], [-1, -1],
                         [-1, 0], [0, 1], [0, -1]]
     Piece.__init__(self, name, surface, draft_loc, move_range, bloackable,
                    ability_type, move_text, ability_text, Board)
示例#8
0
 def __init__(self, name, surface, draft_loc, move_range, bloackable,
              ability_type, attack_range, move_text, ability_text, Board):
     self.attack_range = attack_range
     Piece.__init__(self, name, surface, draft_loc, move_range, bloackable,
                    ability_type, move_text, ability_text, Board)
示例#9
0
 def __init__(self, name, surface, draft_loc, move_range, bloackable,
              ability_type, move_text, ability_text, Board):
     Piece.__init__(self, name, surface, draft_loc, move_range, bloackable,
                    ability_type, move_text, ability_text, Board)
     self.boundry = None
示例#10
0
 def remove(self):
     Piece.remove(self)
     self.boundry = None