mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- A bit more Extraplanar Lens logic.
This commit is contained in:
@@ -427,6 +427,46 @@ public class SpecialCardAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extraplanar Lens
|
||||||
|
public static class ExtraplanarLens {
|
||||||
|
public static boolean consider(final Player ai, final SpellAbility sa) {
|
||||||
|
Card bestBasic = null;
|
||||||
|
Card bestBasicSelfOnly = null;
|
||||||
|
|
||||||
|
CardCollection aiLands = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.LANDS_PRODUCING_MANA);
|
||||||
|
CardCollection oppLands = CardLists.filter(ai.getOpponents().getCardsIn(ZoneType.Battlefield),
|
||||||
|
CardPredicates.Presets.LANDS_PRODUCING_MANA);
|
||||||
|
|
||||||
|
int bestCount = 0;
|
||||||
|
int bestSelfOnlyCount = 0;
|
||||||
|
for (String landType : MagicColor.Constant.BASIC_LANDS) {
|
||||||
|
CardCollection landsOfType = CardLists.filter(aiLands, CardPredicates.nameEquals(landType));
|
||||||
|
CardCollection oppLandsOfType = CardLists.filter(oppLands, CardPredicates.nameEquals(landType));
|
||||||
|
|
||||||
|
int numCtrl = CardLists.filter(aiLands, CardPredicates.nameEquals(landType)).size();
|
||||||
|
if (numCtrl > bestCount) {
|
||||||
|
bestCount = numCtrl;
|
||||||
|
bestBasic = ComputerUtilCard.getWorstLand(landsOfType);
|
||||||
|
}
|
||||||
|
if (numCtrl > bestSelfOnlyCount && numCtrl > 1 && oppLandsOfType.isEmpty() && bestBasicSelfOnly == null) {
|
||||||
|
bestSelfOnlyCount = numCtrl;
|
||||||
|
bestBasicSelfOnly = ComputerUtilCard.getWorstLand(landsOfType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sa.resetTargets();
|
||||||
|
if (bestBasicSelfOnly != null) {
|
||||||
|
sa.getTargets().add(bestBasicSelfOnly);
|
||||||
|
return true;
|
||||||
|
} else if (bestBasic != null) {
|
||||||
|
sa.getTargets().add(bestBasic);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Force of Will
|
// Force of Will
|
||||||
public static class ForceOfWill {
|
public static class ForceOfWill {
|
||||||
public static boolean consider(final Player ai, final SpellAbility sa) {
|
public static boolean consider(final Player ai, final SpellAbility sa) {
|
||||||
|
|||||||
@@ -1373,6 +1373,8 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
|||||||
private static boolean knownOriginTriggerAI(final Player ai, final SpellAbility sa, final boolean mandatory) {
|
private static boolean knownOriginTriggerAI(final Player ai, final SpellAbility sa, final boolean mandatory) {
|
||||||
if ("DeathgorgeScavenger".equals(sa.getParam("AILogic"))) {
|
if ("DeathgorgeScavenger".equals(sa.getParam("AILogic"))) {
|
||||||
return SpecialCardAi.DeathgorgeScavenger.consider(ai, sa);
|
return SpecialCardAi.DeathgorgeScavenger.consider(ai, sa);
|
||||||
|
} else if ("ExtraplanarLens".equals(sa.getParam("AILogic"))) {
|
||||||
|
return SpecialCardAi.ExtraplanarLens.consider(ai, sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.getTargetRestrictions() == null) {
|
if (sa.getTargetRestrictions() == null) {
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ Name:Extraplanar Lens
|
|||||||
ManaCost:3
|
ManaCost:3
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigExile | OptionalDecider$ You | TriggerDescription$ Imprint — When CARDNAME enters the battlefield, you may exile target land you control.
|
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigExile | OptionalDecider$ You | TriggerDescription$ Imprint — When CARDNAME enters the battlefield, you may exile target land you control.
|
||||||
SVar:TrigExile:DB$ ChangeZone | Imprint$ True | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land you control | AILogic$ Always
|
SVar:TrigExile:DB$ ChangeZone | Imprint$ True | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land you control | AILogic$ ExtraplanarLens
|
||||||
T:Mode$ TapsForMana | ValidCard$ Land.sharesNameWith Imprinted | Execute$ TrigMana | TriggerZones$ Battlefield | Static$ True | TriggerDescription$ Whenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana to his or her mana pool of any type that land produced.
|
T:Mode$ TapsForMana | ValidCard$ Land.sharesNameWith Imprinted | Execute$ TrigMana | TriggerZones$ Battlefield | Static$ True | TriggerDescription$ Whenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana to his or her mana pool of any type that land produced.
|
||||||
SVar:TrigMana:DB$ ManaReflected | Valid$ Defined.Triggered | ColorOrType$ Type | ReflectProperty$ Produced | Defined$ TriggeredPlayer
|
SVar:TrigMana:DB$ ManaReflected | Valid$ Defined.Triggered | ColorOrType$ Type | ReflectProperty$ Produced | Defined$ TriggeredPlayer
|
||||||
T:Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self | Destination$ Any | Execute$ DBCleanup | Static$ True
|
T:Mode$ ChangesZone | Origin$ Battlefield | ValidCard$ Card.Self | Destination$ Any | Execute$ DBCleanup | Static$ True
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True
|
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True
|
||||||
SVar:NeedsToPlay:Land.YouCtrl+canProduceMana
|
SVar:NeedsToPlay:Land.Basic+YouCtrl+canProduceMana
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/extraplanar_lens.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/extraplanar_lens.jpg
|
||||||
Oracle:Imprint — When Extraplanar Lens enters the battlefield, you may exile target land you control.\nWhenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana to his or her mana pool of any type that land produced.
|
Oracle:Imprint — When Extraplanar Lens enters the battlefield, you may exile target land you control.\nWhenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana to his or her mana pool of any type that land produced.
|
||||||
|
|||||||
Reference in New Issue
Block a user