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

View file

@ -62,7 +62,7 @@ public class TempleOfAclazotz extends CardImpl {
this.addAbility(new BlackManaAbility());
// {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)));
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);
this.staticText = "You gain life equal to the sacrificed creature's toughness";
}
public MirenTheMoallEffect(final MirenTheMoallEffect effect) {
public TempleOfAclazotzEffect(final TempleOfAclazotzEffect effect) {
super(effect);
}
@Override
public MirenTheMoallEffect copy() {
return new MirenTheMoallEffect(this);
public TempleOfAclazotzEffect copy() {
return new TempleOfAclazotzEffect(this);
}
@Override

View file

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

View file

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