mirror of
https://github.com/correl/mage.git
synced 2025-04-12 09:11:05 -09:00
added Academy Drake, Knight of Malice, Hexproof from White
This commit is contained in:
parent
ad8b046b05
commit
af83a34c64
6 changed files with 163 additions and 4 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage
43
Mage.Sets/src/mage/cards/a/AcademyDrake.java
Normal file
43
Mage.Sets/src/mage/cards/a/AcademyDrake.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class AcademyDrake extends CardImpl {
|
||||
|
||||
public AcademyDrake(UUID ownerId, CardSetInfo cardSetInfo) {
|
||||
super(ownerId, cardSetInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
subtype.add(SubType.DRAKE);
|
||||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
|
||||
|
||||
// Kicker {4}
|
||||
this.addAbility(new KickerAbility("{4}"));
|
||||
// Flying
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
// If Academy Drake was kicked, it enters the battlefield with two +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it.", ""));
|
||||
|
||||
}
|
||||
|
||||
public AcademyDrake(final AcademyDrake academyDrake) {
|
||||
super(academyDrake);
|
||||
}
|
||||
|
||||
public AcademyDrake copy() {
|
||||
return new AcademyDrake(this);
|
||||
}
|
||||
}
|
62
Mage.Sets/src/mage/cards/k/KnightOfMalice.java
Normal file
62
Mage.Sets/src/mage/cards/k/KnightOfMalice.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.AnyPlayerControlsCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.HexproofFromBlackAbility;
|
||||
import mage.abilities.keyword.HexproofFromWhiteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class KnightOfMalice extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("white permanent");
|
||||
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
}
|
||||
|
||||
public KnightOfMalice(UUID ownerId, CardSetInfo cardSetInfo) {
|
||||
super(ownerId, cardSetInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
subtype.add(SubType.HUMAN);
|
||||
subtype.add(SubType.KNIGHT);
|
||||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
addAbility(FirstStrikeAbility.getInstance());
|
||||
addAbility(HexproofFromWhiteAbility.getInstance());
|
||||
|
||||
|
||||
//Knight of Malice gets +1/+0 as long as any player controls a white permanent.
|
||||
addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
|
||||
new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield),
|
||||
new AnyPlayerControlsCondition(filter),
|
||||
"{this} gets +1/+0 as long as any player controls a white permanent.")));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public KnightOfMalice(final KnightOfMalice knightOfGrace){
|
||||
super(knightOfGrace);
|
||||
}
|
||||
|
||||
public KnightOfMalice copy(){
|
||||
return new KnightOfMalice(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -59,5 +59,7 @@ public class Dominaria extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Jhoira, Weatherlight Captain", 200, Rarity.MYTHIC, mage.cards.j.JhoiraWeatherlightCaptain.class));
|
||||
cards.add(new SetCardInfo("Lyra Dawnbringer", 14, Rarity.MYTHIC, mage.cards.l.LyraDawnbringer.class));
|
||||
cards.add(new SetCardInfo("Serra Disciple", 34, Rarity.COMMON, mage.cards.s.SerraDisciple.class));
|
||||
cards.add(new SetCardInfo("Knight of Malice", 52, Rarity.UNCOMMON, mage.cards.k.KnightOfMalice.class));
|
||||
cards.add(new SetCardInfo("Academy Drake", 40, Rarity.UNCOMMON, mage.cards.a.AcademyDrake.class));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,13 +51,13 @@ import mage.target.common.TargetOpponent;
|
|||
public class Modes extends LinkedHashMap<UUID, Mode> {
|
||||
|
||||
private Mode currentMode; // the current mode of the selected modes
|
||||
private final ArrayList<UUID> selectedModes = new ArrayList<>();
|
||||
private final List<UUID> selectedModes = new ArrayList<>();
|
||||
private int minModes;
|
||||
private int maxModes;
|
||||
private TargetController modeChooser;
|
||||
private boolean eachModeMoreThanOnce; // each mode can be selected multiple times during one choice
|
||||
private boolean eachModeOnlyOnce; // state if each mode can be chosen only once as long as the source object exists
|
||||
private final LinkedHashMap<UUID, Mode> duplicateModes = new LinkedHashMap<>();
|
||||
private final Map<UUID, Mode> duplicateModes = new LinkedHashMap<>();
|
||||
private OptionalAdditionalModeSourceCosts optionalAdditionalModeSourceCosts = null; // only set if costs have to be paid
|
||||
private Filter maxModesFilter = null; // calculates the max number of available modes
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
|
|||
return null;
|
||||
}
|
||||
|
||||
public ArrayList<UUID> getSelectedModes() {
|
||||
public List<UUID> getSelectedModes() {
|
||||
return selectedModes;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
|
|||
* @param source
|
||||
* @param game
|
||||
*/
|
||||
private void setAlreadySelectedModes(ArrayList<UUID> selectedModes, Ability source, Game game) {
|
||||
private void setAlreadySelectedModes(List<UUID> selectedModes, Ability source, Game game) {
|
||||
for (UUID modeId : selectedModes) {
|
||||
String key = getKey(source, game, modeId);
|
||||
game.getState().setValue(key, true);
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
|
||||
/**
|
||||
* Hexproof from white (This creature or player can't be the target of white spells or abilities
|
||||
* your opponents control.)
|
||||
*
|
||||
* @author igoudt
|
||||
*/
|
||||
public class HexproofFromWhiteAbility extends SimpleStaticAbility implements MageSingleton {
|
||||
|
||||
private static final HexproofFromWhiteAbility instance;
|
||||
|
||||
static {
|
||||
instance = new HexproofFromWhiteAbility();
|
||||
}
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static HexproofFromWhiteAbility getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HexproofFromWhiteAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HexproofFromWhiteAbility copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "hexproof from white";
|
||||
}
|
||||
}
|
|
@ -955,6 +955,14 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
}
|
||||
|
||||
if (abilities.containsKey(HexproofFromWhiteAbility.getInstance().getId()) ) {
|
||||
if (game.getPlayer(this.getControllerId()).hasOpponent(sourceControllerId, game)
|
||||
&& !game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, sourceControllerId, game)
|
||||
&& source.getColor(game).isWhite()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasProtectionFrom(source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue