Get card color from land type
This commit is contained in:
parent
f93d674b8f
commit
621d5da79b
1 changed files with 13 additions and 0 deletions
13
mtg.py
13
mtg.py
|
@ -184,6 +184,19 @@ class Card:
|
|||
self.is_tapped = False
|
||||
self.abilities = []
|
||||
|
||||
# Get color from land type
|
||||
if 'land' in self.type.split(' '):
|
||||
if 'mountain' in self.attributes:
|
||||
self.colors.append('R')
|
||||
if 'plains' in self.attributes:
|
||||
self.colors.append('W')
|
||||
if 'swamp' in self.attributes:
|
||||
self.colors.append('B')
|
||||
if 'island' in self.attributes:
|
||||
self.colors.append('U')
|
||||
if 'forest' in self.attributes:
|
||||
self.colors.append('G')
|
||||
|
||||
if not self.colors:
|
||||
# Try to determine the card's color based on its abilities. Not ideal, but maybe it'll help for now
|
||||
for line in self.text:
|
||||
|
|
Loading…
Reference in a new issue