SHARE
TWEET

Untitled

a guest Jun 19th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. super(self.__class__, self).__init__()
  2.  
  3.     self.card_name = card_name
  4.     try:
  5.         self.card_profile_img = pygame.image.load(card_name + '.png')
  6.     except pygame.error:
  7.         self.card_profile_img = pygame.image.load('beta_pic.png')
  8.  
  9.     if player_class == 'ironclad':
  10.         with open('ironclad_cards.txt', 'r') as f:
  11.             cards = f.read().split('n')
  12.             for card in cards:
  13.                 if card.split('$')[0] == card_name:
  14.                     self.card_type = card.split('$')[1]
  15.                     self.card_rarity = card.split('$')[2]
  16.                     self.card_img = pygame.image.load(self.card_rarity + '_' + self.card_type + '.png')
  17.                     self.energy_cost = int(card.split('$')[3])
  18.                     self.card_des = card.split('$')[4]
  19.                     self.card_effect = card.split('$')[5]
  20.  
  21.     elif player_class == 'silent':
  22.         with open('silent_cards.txt', 'r') as f:
  23.             cards = f.read().split('n')
  24.             for card in cards:
  25.                 if card.split('$')[0] == card_name:
  26.                     self.card_type = card.split('$')[1]
  27.                     self.card_rarity = card.split('$')[2]
  28.                     self.card_img = pygame.image.load(self.card_rarity + '_' + self.card_type + '.png')
  29.                     self.energy_cost = card.split('$')[3]
  30.                     self.card_des = card.split('$')[4]
  31.                     self.card_effect = card.split('$')[5]
  32.  
  33.     elif player_class == 'defect':
  34.         with open('defect_cards.txt', 'r') as f:
  35.             cards = f.read().split('n')
  36.             for card in cards:
  37.                 if card.split('$')[0] == card_name:
  38.                     self.card_type = card.split('$')[1]
  39.                     self.card_rarity = card.split('$')[2]
  40.                     self.card_img = pygame.image.load(self.card_rarity + '_' + self.card_type + '.png')
  41.                     self.energy_cost = card.split('$')[3]
  42.                     self.card_des = card.split('$')[4]
  43.                     self.card_effect = card.split('$')[5]
  44.  
  45.     self.card_img_rect = self.card_img.get_rect()
  46.     self.card_img_rect.x = 0
  47.     self.card_img_rect.y = 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top