forked from External/mage
* Signal Pest - Fixed that Signal Pests restriction effect did not work always if more than one Signal Pest was in the game.
This commit is contained in:
parent
666308bd67
commit
ea9fe5df55
2 changed files with 12 additions and 6 deletions
|
|
@ -27,18 +27,20 @@
|
|||
*/
|
||||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.keyword.BattleCryAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -70,10 +72,14 @@ public class SignalPest extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class SignalPestAbility extends EvasionAbility {
|
||||
class SignalPestAbility extends EvasionAbility implements MageSingleton {
|
||||
|
||||
private static SignalPestAbility instance;
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static SignalPestAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new SignalPestAbility();
|
||||
|
|
|
|||
|
|
@ -734,8 +734,8 @@ public abstract class AbilityImpl implements Ability {
|
|||
|
||||
MageObject object;
|
||||
UUID parameterSourceId;
|
||||
// for singleton abilities like Flying we can't rely on abilities' source
|
||||
// so will use the one that came as a parameter if it is not null
|
||||
// for singleton abilities like Flying we can't rely on abilities' source because it's only once in continuous effects
|
||||
// so will use the sourceId of the object itself that came as a parameter if it is not null
|
||||
if (this instanceof MageSingleton && source != null) {
|
||||
object = source;
|
||||
parameterSourceId = source.getId();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue