mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08: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
|
|
@ -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…
Add table
Add a link
Reference in a new issue