mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
Fixed some missing return statements.
This commit is contained in:
parent
0e40fb41dd
commit
16b58a337d
4 changed files with 18 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue