mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Corrosive Ooze - Fixed that the equipments were not destroyed.
This commit is contained in:
parent
242e55dcd4
commit
b496adcb11
2 changed files with 7 additions and 16 deletions
|
@ -27,26 +27,19 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.DestroyAllAttachedEquipmentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.EquippedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -82,4 +75,4 @@ public class CorrosiveOoze extends CardImpl {
|
|||
public CorrosiveOoze copy() {
|
||||
return new CorrosiveOoze(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -8,15 +11,10 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Quercitron
|
||||
*/
|
||||
|
||||
public class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
|
||||
|
||||
public DestroyAllAttachedEquipmentEffect() {
|
||||
|
@ -37,9 +35,9 @@ public class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||
if (target != null) {
|
||||
List<UUID> attachments = new ArrayList<>(target.getAttachments());
|
||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null) {
|
||||
List<UUID> attachments = new ArrayList<>(targetPermanent.getAttachments());
|
||||
for (UUID attachmentId : attachments) {
|
||||
Permanent attachment = game.getPermanent(attachmentId);
|
||||
if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {
|
||||
|
|
Loading…
Reference in a new issue