Merge origin/master

Conflicts:
	Mage.Sets/src/mage/cards/t/TanaTheBloodsower.java
	Mage.Sets/src/mage/cards/t/ThrasiosTritonHero.java
This commit is contained in:
LevelX2 2016-11-05 11:55:24 +01:00
commit e4e76c159b
3 changed files with 75 additions and 71 deletions

View file

@ -61,7 +61,7 @@ import mage.target.TargetCard;
public class OathOfNissa extends CardImpl { public class OathOfNissa extends CardImpl {
public OathOfNissa(UUID ownerId, CardSetInfo setInfo) { public OathOfNissa(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.supertype.add("Legendary"); this.supertype.add("Legendary");
// When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order. // When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
@ -143,7 +143,7 @@ class OathOfNissaEffect extends OneShotEffect {
class OathOfNissaSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { class OathOfNissaSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect {
public OathOfNissaSpendAnyManaEffect() { public OathOfNissaSpendAnyManaEffect() {
super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.Custom, Outcome.Benefit); super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "you may spend mana as though it were mana of any color to cast planeswalker spells"; staticText = "you may spend mana as though it were mana of any color to cast planeswalker spells";
} }

View file

@ -45,13 +45,13 @@ import mage.players.Player;
/** /**
* *
* @author LevelX2 * @author spjspj
*/ */
public class TanaTheBloodsower extends CardImpl { public class TanaTheBloodsower extends CardImpl {
public TanaTheBloodsower(UUID ownerId, CardSetInfo setInfo) { public TanaTheBloodsower(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
this.supertype.add("Legendary"); this.supertype.add("Legendary");
this.subtype.add("Elf"); this.subtype.add("Elf");
this.subtype.add("Druid"); this.subtype.add("Druid");
@ -61,7 +61,8 @@ public class TanaTheBloodsower extends CardImpl {
// Trample // Trample
this.addAbility(TrampleAbility.getInstance()); this.addAbility(TrampleAbility.getInstance());
// Whenever Tana, the Bloodsower deals combat damage to a player, create that many 1/1 green Saproling creature tokens. // Whenever Tana, the Bloodsower deals combat damage to a player, create that many 1/1 green Saproling creature tokens.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new TanaTheBloodsowerEffect(), false)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new TanaTheBloodsowerEffect(), false, true));
// Partner // Partner
this.addAbility(PartnerAbility.getInstance()); this.addAbility(PartnerAbility.getInstance());
} }
@ -77,29 +78,30 @@ public class TanaTheBloodsower extends CardImpl {
} }
class TanaTheBloodsowerEffect extends OneShotEffect { class TanaTheBloodsowerEffect extends OneShotEffect {
public TanaTheBloodsowerEffect() { public TanaTheBloodsowerEffect() {
super(Outcome.PutCreatureInPlay); super(Outcome.PutCreatureInPlay);
this.staticText = "create that many 1/1 green Saproling creature tokens"; this.staticText = "create that many 1/1 green Saproling creature tokens";
} }
public TanaTheBloodsowerEffect(final TanaTheBloodsowerEffect effect) { public TanaTheBloodsowerEffect(final TanaTheBloodsowerEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public TanaTheBloodsowerEffect copy() { public TanaTheBloodsowerEffect copy() {
return new TanaTheBloodsowerEffect(this); return new TanaTheBloodsowerEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (controller != null) { if (player != null) {
Integer damage = (Integer) getValue("damage"); int amount = (Integer)getValue("damage");
if (damage > 0) { if (amount > 0) {
return new CreateTokenEffect(new SaprolingToken(), damage).apply(game, source); return new CreateTokenEffect(new SaprolingToken(), amount).apply(game, source);
} }
return true;
} }
return false; return false;
} }

View file

@ -1,58 +1,60 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
#author: North #author: North
use strict; use strict;
my $dataFile = 'mtg-cards-data.txt'; my $dataFile = 'mtg-cards-data.txt';
my $knownSetsFile = "known-sets.txt"; my $knownSetsFile = "known-sets.txt";
my %knownSets; my %knownSets;
my @setCards; my @setCards;
sub toCamelCase { sub toCamelCase {
my $string = $_[0]; my $string = $_[0];
$string =~ s/\b([\w']+)\b/ucfirst($1)/ge; $string =~ s/\b([\w']+)\b/ucfirst($1)/ge;
$string =~ s/[-,\s\']//g; $string =~ s/[-,\s\']//g;
$string; $string;
} }
print 'Enter a set name: '; print 'Enter a set name: ';
my $setName = <STDIN>; my $setName = <STDIN>;
chomp $setName; chomp $setName;
open (DATA, $dataFile) || die "can't open $dataFile"; open (DATA, $dataFile) || die "can't open $dataFile";
while(my $line = <DATA>) { while(my $line = <DATA>) {
my @data = split('\\|', $line); my @data = split('\\|', $line);
if ($data[1] eq $setName) { if ($data[1] eq $setName) {
push(@setCards, \@data); push(@setCards, \@data);
} }
} }
close(DATA); close(DATA);
open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; open (DATA, $knownSetsFile) || die "can't open $knownSetsFile";
while(my $line = <DATA>) { while(my $line = <DATA>) {
my @data = split('\\|', $line); my @data = split('\\|', $line);
$knownSets{$data[0]}= $data[1]; $knownSets{$data[0]}= $data[1];
} }
close(DATA); close(DATA);
if(!exists $knownSets{$setName}) { if(!exists $knownSets{$setName}) {
die "You must add the set to known-sets.txt\n"; die "You must add the set to known-sets.txt\n";
} }
my $packageName = $knownSets{$setName}; my $packageName = $knownSets{$setName};
$setName =~ s/"/\\"/g; $setName =~ s/"/\\"/g;
system("./gen-existing-cards-by-set.pl \"$setName\""); system("gen-existing-cards-by-set.pl \"$setName\"");
# Generate missing simple cards # Generate missing simple cards
print "Simple cards generated: \n"; print "Simple cards generated: \n";
foreach my $cardName (@setCards) { foreach my $cardName (@setCards) {
my $fileName = "../Mage.Sets/src/mage/sets/" . $packageName . "/" . toCamelCase(${$cardName}[0]) . ".java"; print "CardName: ".${$cardName}[0]." \n";
if(!-e $fileName) { my $fileName = "../Mage.Sets/src/mage/sets/" . $packageName . "/" . toCamelCase(${$cardName}[0]) . ".java";
system("./gen-card.pl \"${$cardName}[0]\" true"); if(!-e $fileName) {
} print "fileName: ".$fileName." \n";
system("gen-card.pl \"${$cardName}[0]\" true");
}
} }