mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
Reworked ability source object handling.
This commit is contained in:
parent
e6b78d7a2e
commit
26a93d4427
19 changed files with 292 additions and 288 deletions
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
|
|
@ -31,11 +34,6 @@ import mage.target.common.TargetLandPermanent;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author MTGfan
|
||||
|
|
@ -123,7 +121,6 @@ class CyclopeanTombCreateTriggeredEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Permanent tomb = game.getPermanentOrLKIBattlefield(source.getSourceId()); // we need to set the correct source object
|
||||
DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new CyclopeanTombEffect(), Duration.EndOfGame, false);
|
||||
ability.setSourceObject(tomb, game);
|
||||
ability.setControllerId(source.getControllerId());
|
||||
ability.setSourceId(source.getSourceId());
|
||||
game.addDelayedTriggeredAbility(ability);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
|
|
@ -27,8 +28,6 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
|
|
@ -43,7 +42,7 @@ public final class GiantOyster extends CardImpl {
|
|||
|
||||
public GiantOyster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
|
||||
this.subtype.add(SubType.OYSTER);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
|
@ -111,7 +110,6 @@ class GiantOysterCreateDelayedTriggerEffects extends OneShotEffect {
|
|||
Effect addCountersEffect = new AddCountersTargetEffect(CounterType.M1M1.createInstance(1));
|
||||
addCountersEffect.setTargetPointer(getTargetPointer().getFixedTarget(game, source));
|
||||
DelayedTriggeredAbility drawStepAbility = new AtTheBeginOfYourNextDrawStepDelayedTriggeredAbility(addCountersEffect, Duration.Custom, false);
|
||||
drawStepAbility.setSourceObject(oyster, game);
|
||||
drawStepAbility.setControllerId(source.getControllerId());
|
||||
UUID drawStepAbilityUUID = game.addDelayedTriggeredAbility(drawStepAbility, source);
|
||||
|
||||
|
|
@ -161,4 +159,4 @@ class GiantOysterLeaveUntapDelayedTriggeredAbility extends DelayedTriggeredAbili
|
|||
public String getRule() {
|
||||
return "When {this} leaves the battlefield or becomes untapped, remove all -1/-1 counters from the creature.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -9,9 +8,9 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.util.functions.EmptyApplyToPermanent;
|
||||
|
|
@ -23,7 +22,7 @@ import mage.util.functions.EmptyApplyToPermanent;
|
|||
public final class PermeatingMass extends CardImpl {
|
||||
|
||||
public PermeatingMass(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
|
@ -62,7 +61,7 @@ class PermeatingMassEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability ability) {
|
||||
Permanent copyTo = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, ability));
|
||||
if (copyTo != null) {
|
||||
Permanent copyFrom = (Permanent) ability.getSourceObject(game);
|
||||
Permanent copyFrom = ability.getSourcePermanentOrLKI(game);
|
||||
if (copyFrom != null) {
|
||||
game.copyPermanent(Duration.Custom, copyFrom, copyTo.getId(), ability, new EmptyApplyToPermanent());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue