From 4a8f9db7b0f2fe8c8da47231648b212d3c584c8d Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 17 Jan 2017 19:54:29 +0000 Subject: [PATCH] test(vehicles): check p/t and crew --- scripts/mtg_validate.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/mtg_validate.py b/scripts/mtg_validate.py index 1329ebc..c11367b 100755 --- a/scripts/mtg_validate.py +++ b/scripts/mtg_validate.py @@ -63,8 +63,8 @@ def check_types(card): return list_only(card.types, ['tribal', 'artifact', 'land', 'enchantment']) def check_pt(card): - if 'creature' in card.types or card.pt: - return (('creature' in card.types and len(re.findall(re.escape('/'), card.pt)) == 1) + if ('creature' in card.types or 'vehicle' in card.subtypes) or card.pt: + return ((('creature' in card.types or 'vehicle' in card.subtypes) and len(re.findall(re.escape('/'), card.pt)) == 1) and not card.loyalty) if 'planeswalker' in card.types or card.loyalty: return (('planeswalker' in card.types and card.loyalty) @@ -202,6 +202,12 @@ def check_equipment(card): else: return None +def check_vehicles(card): + if 'vehicle' in card.subtypes: + return 'crew' in card.text.text + else: + return None + def check_planeswalkers(card): if 'planeswalker' in card.types: good_lines = 0 @@ -350,6 +356,7 @@ props = OrderedDict([ ('quotes', check_quotes), ('auras', check_auras), ('equipment', check_equipment), + ('vehicles', check_vehicles), ('planeswalkers', check_planeswalkers), ('levelup', check_levelup), ('chosen', check_chosen),