mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Implemented Marble Priest
This commit is contained in:
parent
955ec5064c
commit
3dcfa773e0
3 changed files with 89 additions and 4 deletions
74
Mage.Sets/src/mage/cards/m/MarblePriest.java
Normal file
74
Mage.Sets/src/mage/cards/m/MarblePriest.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
||||
import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MarblePriest extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.WALL, "Walls");
|
||||
|
||||
public MarblePriest(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
|
||||
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// All Walls able to block Marble Priest do so.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new MustBeBlockedByAllSourceEffect(
|
||||
Duration.WhileOnBattlefield,
|
||||
filter
|
||||
)
|
||||
));
|
||||
|
||||
// Prevent all combat damage that would be dealt to Marble Priest by Walls.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new MarblePriestPreventionEffect()
|
||||
));
|
||||
}
|
||||
|
||||
public MarblePriest(final MarblePriest card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarblePriest copy() {
|
||||
return new MarblePriest(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MarblePriestPreventionEffect extends PreventAllDamageToSourceEffect {
|
||||
|
||||
public MarblePriestPreventionEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "Prevent all combat damage that would be dealt to {this} by Walls";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return super.applies(event, source, game)
|
||||
&& event.getFlag()
|
||||
&& game.getObject(event.getSourceId()).hasSubtype(SubType.WALL, game)
|
||||
&& event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
}
|
|
@ -173,6 +173,7 @@ public final class Legends extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Lost Soul", 111, Rarity.COMMON, mage.cards.l.LostSoul.class));
|
||||
cards.add(new SetCardInfo("Mana Drain", 65, Rarity.UNCOMMON, mage.cards.m.ManaDrain.class));
|
||||
cards.add(new SetCardInfo("Mana Matrix", 285, Rarity.RARE, mage.cards.m.ManaMatrix.class));
|
||||
cards.add(new SetCardInfo("Marble Priest", 231, Rarity.UNCOMMON, mage.cards.m.MarblePriest.class));
|
||||
cards.add(new SetCardInfo("Marhault Elsdragon", 244, Rarity.UNCOMMON, mage.cards.m.MarhaultElsdragon.class));
|
||||
cards.add(new SetCardInfo("Mirror Universe", 287, Rarity.RARE, mage.cards.m.MirrorUniverse.class));
|
||||
cards.add(new SetCardInfo("Moat", 28, Rarity.RARE, mage.cards.m.Moat.class));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Duration;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
@ -15,23 +15,33 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class MustBeBlockedByAllSourceEffect extends RequirementEffect {
|
||||
|
||||
private final FilterCreaturePermanent filter;
|
||||
|
||||
public MustBeBlockedByAllSourceEffect() {
|
||||
this(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public MustBeBlockedByAllSourceEffect(Duration duration) {
|
||||
this(duration, StaticFilters.FILTER_PERMANENT_CREATURES);
|
||||
}
|
||||
|
||||
public MustBeBlockedByAllSourceEffect(Duration duration, FilterCreaturePermanent filter) {
|
||||
super(duration);
|
||||
staticText = "All creatures able to block {this} do so";
|
||||
this.filter = filter;
|
||||
staticText = "All " + filter.getMessage() + " able to block {this} do so";
|
||||
}
|
||||
|
||||
public MustBeBlockedByAllSourceEffect(final MustBeBlockedByAllSourceEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
||||
if (sourceCreature != null && sourceCreature.isAttacking()) {
|
||||
if (sourceCreature != null
|
||||
&& sourceCreature.isAttacking()
|
||||
&& filter.match(permanent, game)) {
|
||||
return permanent.canBlock(source.getSourceId(), game);
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue