* Regeneration abilities - added card hint about activated and used regeneration;

This commit is contained in:
Oleg Agafonov 2020-08-01 21:29:08 +04:00
parent 4ba7c18d43
commit c7595ca476
15 changed files with 244 additions and 87 deletions

View file

@ -1,8 +1,5 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
@ -26,6 +23,8 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author Styxo
*/
@ -82,7 +81,7 @@ class AnakinSkywalkerEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null) {
permanent.regenerate(source.getSourceId(), game);
permanent.regenerate(source, game);
return new TransformSourceEffect(true).apply(game, source);
}
return false;

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateOnlyByOpponentActivatedAbility;
@ -11,17 +9,14 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.CantBeRegeneratedSourceEffect;
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.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public final class ClergyOfTheHolyNimbus extends CardImpl {
@ -66,7 +61,7 @@ class ClergyOfTheHolyNimbusReplacementEffect extends ReplacementEffectImpl {
Permanent ClergyOfTheHolyNimbus = game.getPermanent(event.getTargetId());
if (ClergyOfTheHolyNimbus != null
&& event.getAmount() == 0) { // 1=noRegen
if (ClergyOfTheHolyNimbus.regenerate(source.getSourceId(), game)) {
if (ClergyOfTheHolyNimbus.regenerate(source, game)) {
game.informPlayers(source.getSourceObject(game).getName() + " has been regenerated.");
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateOnlyByOpponentActivatedAbility;
@ -12,23 +10,20 @@ import mage.abilities.effects.common.CantBeRegeneratedSourceEffect;
import mage.abilities.keyword.FlankingAbility;
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.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class KnightOfTheHolyNimbus extends CardImpl {
public KnightOfTheHolyNimbus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.REBEL);
this.subtype.add(SubType.KNIGHT);
@ -37,13 +32,13 @@ public final class KnightOfTheHolyNimbus extends CardImpl {
// Flanking
this.addAbility(new FlankingAbility());
// If Knight of the Holy Nimbus would be destroyed, regenerate it.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new KnightOfTheHolyNimbusReplacementEffect()));
// {2}: Knight of the Holy Nimbus can't be regenerated this turn. Only any opponent may activate this ability.
this.addAbility(new ActivateOnlyByOpponentActivatedAbility(Zone.BATTLEFIELD, new CantBeRegeneratedSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{2}")));
}
public KnightOfTheHolyNimbus(final KnightOfTheHolyNimbus card) {
@ -70,9 +65,9 @@ class KnightOfTheHolyNimbusReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent knightOfTheHolyNimbus = game.getPermanent(event.getTargetId());
if (knightOfTheHolyNimbus != null
if (knightOfTheHolyNimbus != null
&& event.getAmount() == 0) { // 1=noRegen
if (knightOfTheHolyNimbus.regenerate(source.getSourceId(), game)) {
if (knightOfTheHolyNimbus.regenerate(source, game)) {
game.informPlayers(source.getSourceObject(game).getName() + " has been regenerated.");
return true;
}

View file

@ -1,7 +1,5 @@
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -12,11 +10,7 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
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.Zone;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -27,8 +21,9 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class MossbridgeTroll extends CardImpl {
@ -81,7 +76,7 @@ class MossbridgeTrollReplacementEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent mossbridgeTroll = game.getPermanent(event.getTargetId());
if (mossbridgeTroll != null && event.getAmount() == 0) { // 1=noRegen
return mossbridgeTroll.regenerate(source.getSourceId(), game);
return mossbridgeTroll.regenerate(source, game);
}
return false;
}

View file

@ -1,7 +1,5 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -14,23 +12,24 @@ import mage.constants.*;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class Regeneration extends CardImpl {
public Regeneration(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// {G}: Regenerate enchanted creature.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), new ManaCostsImpl("{G}")));
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -17,14 +15,15 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
*
* @author Ketsuban
*/
public final class SoldeviSentry extends CardImpl {
public SoldeviSentry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[] { CardType.ARTIFACT, CardType.CREATURE }, "{1}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
@ -53,7 +52,7 @@ class SoldeviSentryEffect extends RegenerateSourceEffect {
//20110204 - 701.11
Player opponent = game.getPlayer(source.getFirstTarget());
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && permanent.regenerate(this.getId(), game)) {
if (permanent != null && permanent.regenerate(source, game)) {
if (opponent != null) {
if (opponent.chooseUse(Outcome.DrawCard, "Draw a card?", source, game)) {
opponent.drawCards(1, source.getSourceId(), game);