mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Converted the other two cards with "At the beginning of your upkeep, destroy CARDNAME" keyword to script
This commit is contained in:
@@ -6,10 +6,8 @@ SVar:ChooseColor:DB$ ChooseColor | Defined$ You | SpellDescription$ As CARDNAME
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigDamageOpp | TriggerDescription$ At the beginning of each opponent's upkeep, CARDNAME deals X damage to that player, where X is the number of nontoken permanents of the chosen color he or she controls
|
||||
SVar:TrigDamageOpp:AB$ DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ X | References$ X
|
||||
SVar:X:Count$Valid Permanent.ActivePlayerCtrl+ChosenColor+nonToken
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSacrifice | TriggerDescription$ At the beginning of your upkeep, destroy CARDNAME unless you sacrifice two Islands.
|
||||
SVar:TrigSacrifice:AB$ Sacrifice | Cost$ 0 | Optional$ True | SacValid$ Card.Island | Amount$ 2 | RememberSacrificed$ True | SubAbility$ DBDestroyMe
|
||||
SVar:DBDestroyMe:DB$ Destroy | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ0 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDestroy | TriggerDescription$ At the beginning of your upkeep, destroy CARDNAME unless you sacrifice two Islands.
|
||||
SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ Self | UnlessPayer$ You | UnlessCost$ Sac<2/Island>
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/psychic_allergy.jpg
|
||||
Oracle:As Psychic Allergy enters the battlefield, choose a color.\nAt the beginning of each opponent's upkeep, Psychic Allergy deals X damage to that player, where X is the number of nontoken permanents of the chosen color he or she controls.\nAt the beginning of your upkeep, destroy Psychic Allergy unless you sacrifice two Islands.
|
||||
@@ -1,7 +1,9 @@
|
||||
Name:The Tabernacle at Pendrell Vale
|
||||
ManaCost:no cost
|
||||
Types:Legendary Land
|
||||
S:Mode$ Continuous | Affected$ Creature | AddKeyword$ At the beginning of your upkeep, destroy CARDNAME unless you pay 1 | Description$ All creatures have "At the beginning of your upkeep, destroy this creature unless you pay 1."
|
||||
S:Mode$ Continuous | Affected$ Creature | AddTrigger$ TabernacleTrig | AddSVar$ TabernacleDestroy | Description$ All creatures have "At the beginning of your upkeep, destroy this creature unless you pay 1."
|
||||
SVar:TabernacleTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TabernacleDestroy | TriggerDescription$ At the beginning of your upkeep, destroy CARDNAME unless you pay 1.
|
||||
SVar:TabernacleDestroy:AB$ Destroy | Cost$ 0 | Defined$ Self | UnlessPayer$ You | UnlessCost$ 1
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/the_tabernacle_at_pendrell_vale.jpg
|
||||
Oracle:All creatures have "At the beginning of your upkeep, destroy this creature unless you pay {1}."
|
||||
@@ -202,40 +202,6 @@ public class Upkeep extends Phase {
|
||||
final Player controller = c.getController();
|
||||
for (String ability : c.getKeyword()) {
|
||||
|
||||
// destroy
|
||||
if (ability.startsWith("At the beginning of your upkeep, destroy CARDNAME")) {
|
||||
final String[] k = ability.split(" pay ");
|
||||
final ManaCost upkeepCost = new ManaCost(new ManaCostParser(k[1]));
|
||||
|
||||
final String sb = "Upkeep for " + c;
|
||||
final Ability upkeepAbility = new Ability(c, ManaCost.ZERO) {
|
||||
@Override
|
||||
public void resolve() {
|
||||
final boolean isUpkeepPaid;
|
||||
if (controller.isHuman()) {
|
||||
InputPayManaExecuteCommands inp = new InputPayManaExecuteCommands(controller, sb, upkeepCost);
|
||||
Singletons.getControl().getInputQueue().setInputAndWait(inp);
|
||||
isUpkeepPaid = inp.isPaid();
|
||||
} else { // computer
|
||||
Ability aiPaid = Upkeep.getBlankAbility(c, new Cost(upkeepCost, true));
|
||||
isUpkeepPaid = ComputerUtilCost.canPayCost(aiPaid, controller) && !c.hasKeyword("Indestructible");
|
||||
if (isUpkeepPaid) {
|
||||
ComputerUtil.playNoStack(controller, aiPaid, game);
|
||||
}
|
||||
}
|
||||
if( !isUpkeepPaid ) {
|
||||
game.getAction().destroy(c, this);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
upkeepAbility.setActivatingPlayer(controller);
|
||||
upkeepAbility.setStackDescription(sb);
|
||||
upkeepAbility.setDescription(sb);
|
||||
|
||||
game.getStack().addSimultaneousStackEntry(upkeepAbility);
|
||||
} // destroy
|
||||
|
||||
// sacrifice
|
||||
if (ability.startsWith("At the beginning of your upkeep, sacrifice")
|
||||
|| ability.startsWith("Cumulative upkeep")) {
|
||||
|
||||
Reference in New Issue
Block a user