mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
[DOM] Updated Corrosive Ooze.
This commit is contained in:
parent
ac836cb90e
commit
d2a51dc4c0
2 changed files with 11 additions and 11 deletions
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
@ -35,7 +37,6 @@ 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.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
@ -46,8 +47,6 @@ import mage.filter.predicate.permanent.EquippedPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author rscoates
|
||||
|
@ -68,7 +67,7 @@ public class CorrosiveOoze extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Corrosive Ooze blocks or becomes blocked by an equipped creature, destroy all Equipment attached to that creature at end of combat..
|
||||
// Whenever Corrosive Ooze blocks or becomes blocked by an equipped creature, destroy all Equipment attached to that creature at end of combat.
|
||||
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new CorrosiveOozeEffect()), true);
|
||||
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
|
||||
}
|
||||
|
@ -100,23 +99,24 @@ class CorrosiveOozeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
LinkedList<UUID> attachments = new LinkedList();
|
||||
attachments.addAll(permanent.getAttachments());
|
||||
for (UUID uuid : attachments) {
|
||||
Permanent aura = game.getPermanent(uuid);
|
||||
if (aura != null && aura.hasSubtype(SubType.EQUIPMENT, game)) {
|
||||
aura.destroy(source.getSourceId(), game, false);
|
||||
Permanent attachment = game.getPermanent(uuid);
|
||||
if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {
|
||||
attachment.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "destroy all Equipment attached to that creature";
|
||||
return "destroy all Equipment attached to that creature at end of combat";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl
|
|||
Permanent blocked = game.getPermanent(event.getTargetId());
|
||||
if (blocked != null && filter.match(blocked, game)) {
|
||||
if (setTargetPointer) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
this.getEffects().setTargetPointer(new FixedTarget(blocked, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl
|
|||
Permanent blocker = game.getPermanent(event.getSourceId());
|
||||
if (blocker != null && filter.match(blocker, game)) {
|
||||
if (setTargetPointer) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||
this.getEffects().setTargetPointer(new FixedTarget(blocker, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue