mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Added Phylactery Lich.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
Phylactery Lich
|
||||
B B B
|
||||
Creature Zombie
|
||||
As Phylactery Lich enters the battlefield, put a phylactery counter on an artifact you control. When you control no permanents with phylactery counters on them, sacrifice Phylactery Lich.
|
||||
5/5
|
||||
Indestructible
|
||||
|
||||
Soulcatcher
|
||||
1 W
|
||||
Creature Bird Soldier
|
||||
@@ -9886,6 +9893,14 @@ Enchantment
|
||||
no text
|
||||
Whenever a creature is put into a graveyard from the battlefield, that creature's controller may draw a card.
|
||||
|
||||
Soulcatcher
|
||||
1 W
|
||||
Creature Bird Soldier
|
||||
no text
|
||||
1/1
|
||||
Whenever a creature with flying is put into a graveyard from the battlefield, put a +1/+1 counter on Soulcatcher.
|
||||
Flying
|
||||
|
||||
Dauthi Ghoul
|
||||
1 B
|
||||
Creature Dauthi Zombie
|
||||
|
||||
@@ -62,6 +62,7 @@ public class Card extends MyObservable {
|
||||
private boolean reflectedLand = false;
|
||||
private boolean levelUp = false;
|
||||
private boolean bounceAtUntap = false;
|
||||
private boolean finishedEnteringBF = false;
|
||||
|
||||
private boolean firstStrike = false;
|
||||
private boolean doubleStrike = false;
|
||||
@@ -273,6 +274,14 @@ public class Card extends MyObservable {
|
||||
this.bounceAtUntap = bounce;
|
||||
}
|
||||
|
||||
public boolean getFinishedEnteringBF() {
|
||||
return finishedEnteringBF;
|
||||
}
|
||||
|
||||
public void setFinishedEnteringBF(boolean b) {
|
||||
this.finishedEnteringBF = b;
|
||||
}
|
||||
|
||||
public boolean hasFirstStrike() {
|
||||
return firstStrike || getKeyword().contains("First Strike");
|
||||
}
|
||||
|
||||
@@ -3501,6 +3501,97 @@ public class CardFactory_Creatures {
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Phylactery Lich") ) {
|
||||
final CommandReturn getArt = new CommandReturn() {
|
||||
//get target card, may be null
|
||||
public Object execute() {
|
||||
CardList art = AllZoneUtil.getPlayerCardsInPlay(Constant.Player.Computer);
|
||||
art = art.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isArtifact();
|
||||
}
|
||||
});
|
||||
|
||||
CardList list = new CardList(art.toArray());
|
||||
if (list.isEmpty())
|
||||
return null;
|
||||
|
||||
Card target = list.get(0);
|
||||
|
||||
return target;
|
||||
}//execute()
|
||||
};//CommandReturn
|
||||
|
||||
final SpellAbility ability = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card c = getTargetCard();
|
||||
|
||||
if(AllZone.GameAction.isCardInPlay(c) && c.isArtifact()) {
|
||||
c.addCounter(Counters.PHYLACTERY, 1);
|
||||
card.setFinishedEnteringBF(true);
|
||||
}
|
||||
}//resolve()
|
||||
};//SpellAbility
|
||||
Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = -1601957445498569156L;
|
||||
|
||||
public void execute() {
|
||||
Input target = new Input() {
|
||||
|
||||
private static final long serialVersionUID = -806140334868210520L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Select target artifact you control");
|
||||
ButtonUtil.disableAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectCard(Card card, PlayerZone zone) {
|
||||
if(card.isArtifact() && zone.is(Constant.Zone.Play) && card.getController().equals(Constant.Player.Human)) {
|
||||
ability.setTargetCard(card);
|
||||
AllZone.Stack.add(ability);
|
||||
stop();
|
||||
}
|
||||
}
|
||||
};//Input target
|
||||
|
||||
|
||||
if(card.getController().equals(Constant.Player.Human)) {
|
||||
CardList artifacts = AllZoneUtil.getPlayerTypeInPlay(Constant.Player.Human, "Artifact");
|
||||
|
||||
if(artifacts.size() != 0) AllZone.InputControl.setInput(target);
|
||||
|
||||
}
|
||||
else{ //computer
|
||||
Object o = getArt.execute();
|
||||
if(o != null)//should never happen, but just in case
|
||||
{
|
||||
ability.setTargetCard((Card) o);
|
||||
AllZone.Stack.add(ability);
|
||||
}
|
||||
}//else
|
||||
}//execute()
|
||||
};
|
||||
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(new Spell_Permanent(card) {
|
||||
|
||||
private static final long serialVersionUID = -1506199222879057809L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
Object o = getArt.execute();
|
||||
return (o != null) && AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand);
|
||||
}
|
||||
});
|
||||
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Briarhorn")) {
|
||||
|
||||
@@ -27,6 +27,7 @@ public enum Counters {
|
||||
M1M1("-1/-1"),
|
||||
MANA(),
|
||||
MINING(),
|
||||
PHYLACTERY,
|
||||
P0M1("+0/-1"),
|
||||
P0M2("+0/-2"),
|
||||
P1P1("+1/+1"),
|
||||
|
||||
@@ -15862,8 +15862,43 @@ public class GameActionUtil {
|
||||
artifacts = artifacts.getType("Artifact");
|
||||
return artifacts.size();
|
||||
}
|
||||
};
|
||||
|
||||
public static Command Phylactery_Lich = new Command() {
|
||||
|
||||
private static final long serialVersionUID = -1606115081917467754L;
|
||||
int artifacts = 0;
|
||||
|
||||
public void execute() {
|
||||
CardList creature = new CardList();
|
||||
creature.addAll(AllZone.Human_Play.getCards());
|
||||
creature.addAll(AllZone.Computer_Play.getCards());
|
||||
|
||||
creature = creature.getName("Phylactery Lich");
|
||||
|
||||
for(int i = 0; i < creature.size(); i++) {
|
||||
Card c = creature.get(i);
|
||||
artifacts = countArtifacts(c);
|
||||
if(artifacts == 0 && c.getFinishedEnteringBF()) {
|
||||
AllZone.GameAction.sacrifice(c);
|
||||
}
|
||||
}
|
||||
|
||||
}//execute()
|
||||
|
||||
private int countArtifacts(Card c) {
|
||||
PlayerZone play = AllZone.getZone(
|
||||
Constant.Zone.Play, c.getController());
|
||||
CardList artifacts = new CardList(play.getCards());
|
||||
artifacts = artifacts.filter(new CardListFilter()
|
||||
{
|
||||
public boolean addCard(Card crd)
|
||||
{
|
||||
return crd.isArtifact() && crd.getCounters(Counters.PHYLACTERY) > 0;
|
||||
}
|
||||
});
|
||||
return artifacts.size();
|
||||
}
|
||||
};
|
||||
|
||||
public static Command Tethered_Griffin = new Command() {
|
||||
@@ -19244,6 +19279,7 @@ public class GameActionUtil {
|
||||
commands.put("Scion_of_Oona_Other", Scion_of_Oona_Other);
|
||||
|
||||
commands.put("Covetous_Dragon", Covetous_Dragon);
|
||||
commands.put("Phylactery_Lich", Phylactery_Lich);
|
||||
commands.put("Tethered_Griffin", Tethered_Griffin);
|
||||
|
||||
commands.put("Shared_Triumph", Shared_Triumph);
|
||||
|
||||
@@ -133,6 +133,7 @@ public class StaticEffects
|
||||
cardToEffectsList.put("Aven Brigadier", new String[] {"Aven_Brigadier_Soldier_Pump", "Aven_Brigadier_Bird_Pump", "Aven_Brigadier_Other"});
|
||||
cardToEffectsList.put("Scion of Oona", new String[] {"Scion_of_Oona_Pump", "Scion_of_Oona_Other"});
|
||||
cardToEffectsList.put("Covetous Dragon", new String[] {"Covetous_Dragon"});
|
||||
cardToEffectsList.put("Phylactery Lich", new String[]{"Phylactery_Lich"});
|
||||
cardToEffectsList.put("Tethered Griffin", new String[] {"Tethered_Griffin"});
|
||||
cardToEffectsList.put("Shared Triumph", new String[] {"Shared_Triumph"});
|
||||
cardToEffectsList.put("Crucible of Fire", new String[] {"Crucible_of_Fire"});
|
||||
|
||||
Reference in New Issue
Block a user