Fixed some missing return statements.

This commit is contained in:
LevelX2 2014-08-01 00:22:20 +02:00
parent 0e40fb41dd
commit 16b58a337d
4 changed files with 18 additions and 9 deletions

View file

@ -89,12 +89,13 @@ class SwordsToPlowsharesEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {
player.gainLife(permanent.getPower().getValue(), game);
}
return true;
}
return false;
}

View file

@ -38,6 +38,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -86,15 +87,19 @@ class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null) {
ArrayList<UUID> attachments = new ArrayList<>(target.getAttachments());
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Equipment")) {
attachment.destroy(source.getSourceId(), game, false);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null) {
ArrayList<UUID> attachments = new ArrayList<>(target.getAttachments());
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype().contains("Equipment")) {
attachment.destroy(source.getSourceId(), game, false);
}
}
}
return true;
}
return false;
}

View file

@ -161,8 +161,8 @@ class EvolveEffect extends OneShotEffect {
game.getState().setValue("EvolveAddCounterActive", Boolean.TRUE);
sourceCreature.addCounters(CounterType.P1P1.createInstance(), game);
game.getState().setValue("EvolveAddCounterActive", Boolean.FALSE);
return true;
}
return true;
}
return false;
}

View file

@ -43,6 +43,9 @@ since 1.3.0-2014-07-11
git log 458255cd0627af90c2ebeab4c410a16d55a36f41..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.3.0-2014-07-19
git log 75eb0bdfdf36ba83dd5a3e2c6a204ceb186c9d5e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.3.0-2014-07-30
git log 69ce53e6e8036bf01bdd090e8785f4d63c486d1e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
3. Copy added_cards.txt to trunk\Utils folder