Merge pull request #3953 from theelk801/master

Updated gen-card.py for subtype enum
This commit is contained in:
theelk801 2017-09-07 17:16:55 -04:00 committed by GitHub
commit 634c79a0a5
4 changed files with 19 additions and 10 deletions

View file

@ -29,6 +29,7 @@ package mage.cards.h;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.constants.SubType;
import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -42,8 +43,8 @@ public class HuatlisSnubhorn extends CardImpl {
public HuatlisSnubhorn(UUID ownerId, CardSetInfo setInfo) { public HuatlisSnubhorn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.subtype.add("Dinosaur"); this.subtype.add(SubType.DINOSAUR);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);

View file

@ -62,7 +62,7 @@ public class TempleOfAclazotz extends CardImpl {
this.addAbility(new BlackManaAbility()); this.addAbility(new BlackManaAbility());
// {T}, Sacrifice a creature: You gain life equal to the sacrificed creatures toughness. // {T}, Sacrifice a creature: You gain life equal to the sacrificed creatures toughness.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MirenTheMoallEffect(), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TempleOfAclazotzEffect(), new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true))); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true)));
this.addAbility(ability); this.addAbility(ability);
} }
@ -77,20 +77,20 @@ public class TempleOfAclazotz extends CardImpl {
} }
} }
class MirenTheMoallEffect extends OneShotEffect { class TempleOfAclazotzEffect extends OneShotEffect {
public MirenTheMoallEffect() { public TempleOfAclazotzEffect() {
super(Outcome.GainLife); super(Outcome.GainLife);
this.staticText = "You gain life equal to the sacrificed creature's toughness"; this.staticText = "You gain life equal to the sacrificed creature's toughness";
} }
public MirenTheMoallEffect(final MirenTheMoallEffect effect) { public TempleOfAclazotzEffect(final TempleOfAclazotzEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public MirenTheMoallEffect copy() { public TempleOfAclazotzEffect copy() {
return new MirenTheMoallEffect(this); return new TempleOfAclazotzEffect(this);
} }
@Override @Override

View file

@ -34,6 +34,9 @@ if ($power || $power eq 0) {
}else { }else {
$OUT .= "\nimport mage.MageInt;" $OUT .= "\nimport mage.MageInt;"
} }
if ($hasSubTypes eq 'true') {
$OUT .="\nimport mage.constants.SubType;"
}
} }
=][=$abilitiesImports=] =][=$abilitiesImports=]
import mage.cards.CardImpl; import mage.cards.CardImpl;

View file

@ -186,6 +186,8 @@ $vars{'toughness'} = $card[7];
my @types; my @types;
$vars{'planeswalker'} = 'false'; $vars{'planeswalker'} = 'false';
$vars{'subType'} = ''; $vars{'subType'} = '';
$vars{'hasSubTypes'} = 'false';
$vars{'hasSuperTypes'} = 'false';
my $cardAbilities = $card[8]; my $cardAbilities = $card[8];
my $type = $card[5]; my $type = $card[5];
while ($type =~ m/([a-zA-Z]+)( )*/g) { while ($type =~ m/([a-zA-Z]+)( )*/g) {
@ -197,10 +199,13 @@ while ($type =~ m/([a-zA-Z]+)( )*/g) {
} }
} else { } else {
if (@types) { if (@types) {
$vars{'subType'} .= "\n this.subtype.add(\"$1\");"; my $st = uc($1);
$vars{'subType'} .= "\n this.subtype.add(SubType.$st);";
$vars{'hasSubTypes'} = 'true';
} else { } else {
my $st = uc($1); my $st = uc($1);
$vars{'subType'} .= "\n addSuperType(SuperType.$st);"; $vars{'subType'} .= "\n this.addSuperType(SuperType.$st);";
$vars{'hasSuperTypes'} = 'true';
} }
} }
} }