- Convert Lighthouse Chronologist to script

This commit is contained in:
Sol
2012-11-23 21:44:19 +00:00
parent cf4d65bf73
commit 4f49ba3ac7
2 changed files with 3 additions and 46 deletions

View File

@@ -6,9 +6,11 @@ PT:1/3
K:Level up:U K:Level up:U
K:maxLevel:7 K:maxLevel:7
S:Mode$ Continuous | Affected$ Card.Self | SetPower$ 2 | SetToughness$ 4 | CheckSVar$ X | SVarCompare$ EQ1 | Description$ LEVEL 4-6 2/4 S:Mode$ Continuous | Affected$ Card.Self | SetPower$ 2 | SetToughness$ 4 | CheckSVar$ X | SVarCompare$ EQ1 | Description$ LEVEL 4-6 2/4
S:Mode$ Continuous | Affected$ Card.Self | SetPower$ 3 | SetToughness$ 5 | AddKeyword$ At the beginning of each end step, if it's not your turn, take an extra turn after this one. | CheckSVar$ Y | SVarCompare$ EQ1 | Description$ LEVEL 7+ 3/5 At the beginning of each end step, if it's not your turn, take an extra turn after this one. S:Mode$ Continuous | Affected$ Card.Self | SetPower$ 3 | SetToughness$ 5 | AddTrigger$ TriggerExtraTurn | CheckSVar$ Y | SVarCompare$ EQ1 | Description$ LEVEL 7+ 3/5 At the beginning of each end step, if it's not your turn, take an extra turn after this one.
SVar:X:Count$Valid Card.Self+counters_GE4_LEVEL+counters_LE6_LEVEL SVar:X:Count$Valid Card.Self+counters_GE4_LEVEL+counters_LE6_LEVEL
SVar:Y:Count$Valid Card.Self+counters_GE7_LEVEL SVar:Y:Count$Valid Card.Self+counters_GE7_LEVEL
SVar:TriggerExtraTurn:Mode$ Phase | Phase$ End of Turn | OpponentTurn$ True | Execute$ TrigExtraTurn | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each end step, if it's not your turn, take an extra turn after this one.
SVar:TrigExtraTurn:DB$ AddTurn | NumTurns$ 1
SVar:Rarity:Mythic SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/lighthouse_chronologist.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/lighthouse_chronologist.jpg
SetInfo:ROE|Mythic|http://magiccards.info/scans/en/roe/75.jpg SetInfo:ROE|Mythic|http://magiccards.info/scans/en/roe/75.jpg

View File

@@ -17,15 +17,8 @@
*/ */
package forge.game.phase; package forge.game.phase;
import java.util.ArrayList;
import java.util.List;
import com.google.common.base.Predicate;
import forge.Card; import forge.Card;
import forge.CardLists;
import forge.CounterType;
import forge.Singletons; import forge.Singletons;
import forge.card.spellability.Ability; import forge.card.spellability.Ability;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
@@ -53,12 +46,6 @@ public class EndOfTurn extends Phase {
*/ */
@Override @Override
public final void executeAt() { public final void executeAt() {
// TODO - should this freeze the Stack?
//EndOfTurn.endOfTurnWallOfReverence();
EndOfTurn.endOfTurnLighthouseChronologist();
// reset mustAttackEntity for me // reset mustAttackEntity for me
Singletons.getModel().getGame().getPhaseHandler().getPlayerTurn().setMustAttackEntity(null); Singletons.getModel().getGame().getPhaseHandler().getPlayerTurn().setMustAttackEntity(null);
@@ -209,36 +196,4 @@ public class EndOfTurn extends Phase {
} // executeAt() } // executeAt()
private static void endOfTurnLighthouseChronologist() {
final Player player = Singletons.getModel().getGame().getPhaseHandler().getPlayerTurn();
final Player opponent = player.getOpponent();
List<Card> list = new ArrayList<Card>(opponent.getCardsIn(ZoneType.Battlefield));
list = CardLists.filter(list, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return c.getName().equals("Lighthouse Chronologist") && (c.getCounters(CounterType.LEVEL) >= 7);
}
});
Ability ability;
for (int i = 0; i < list.size(); i++) {
final Card card = list.get(i);
ability = new Ability(list.get(i), "0") {
@Override
public void resolve() {
Singletons.getModel().getGame().getPhaseHandler().addExtraTurn(card.getController());
}
};
final StringBuilder sb = new StringBuilder();
sb.append(card).append(" - ").append(card.getController()).append(" takes an extra turn.");
ability.setStackDescription(sb.toString());
ability.setDescription(sb.toString());
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability);
}
}
} // end class EndOfTurn } // end class EndOfTurn