mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Enabled the AI to play counterspells with the new flashback keyword.
- Converted Fervent Denial.
This commit is contained in:
@@ -2,8 +2,8 @@ Name:Fervent Denial
|
||||
ManaCost:3 U U
|
||||
Types:Instant
|
||||
Text:no text
|
||||
K:Flashback 5 U U
|
||||
A:SP$ Counter | Cost$ 3 U U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | SpellDescription$ Counter target spell.
|
||||
A:SP$ Counter | Cost$ 5 U U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | Flashback$ True | CostDesc$ Flashback 5 U U | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.)
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/fervent_denial.jpg
|
||||
SetInfo:ODY|Uncommon|http://magiccards.info/scans/en/od/86.jpg
|
||||
|
||||
@@ -224,18 +224,37 @@ public class ComputerUtil {
|
||||
int bestRestriction = Integer.MIN_VALUE;
|
||||
|
||||
for (SpellAbility sa : possibleCounters) {
|
||||
SpellAbility currentSA = sa;
|
||||
sa.setActivatingPlayer(AllZone.getComputerPlayer());
|
||||
if (canBePlayedAndPayedByAI(sa)) { // checks everything nescessary
|
||||
Card source = sa.getSourceCard();
|
||||
|
||||
//Flashback
|
||||
if (source.isInZone(Constant.Zone.Graveyard) && sa.isSpell() && (source.isInstant() || source.isSorcery())) {
|
||||
for(String keyword : source.getKeyword()) {
|
||||
if (keyword.startsWith("Flashback")) {
|
||||
SpellAbility flashback = sa.copy();
|
||||
flashback.setActivatingPlayer(AllZone.getComputerPlayer());
|
||||
flashback.setFlashBackAbility(true);
|
||||
if (!keyword.equals("Flashback")) {//there is a flashback cost (and not the cards cost)
|
||||
final Cost fbCost = new Cost(keyword.substring(10), source.getName(), false);
|
||||
flashback.setPayCosts(fbCost);
|
||||
}
|
||||
currentSA = flashback;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (canBePlayedAndPayedByAI(currentSA)) { // checks everything nescessary
|
||||
if (bestSA == null) {
|
||||
bestSA = sa;
|
||||
bestRestriction = counterSpellRestriction(sa);
|
||||
bestSA = currentSA;
|
||||
bestRestriction = counterSpellRestriction(currentSA);
|
||||
} else {
|
||||
// Compare bestSA with this SA
|
||||
int restrictionLevel = counterSpellRestriction(sa);
|
||||
int restrictionLevel = counterSpellRestriction(currentSA);
|
||||
|
||||
if (restrictionLevel > bestRestriction) {
|
||||
bestRestriction = restrictionLevel;
|
||||
bestSA = sa;
|
||||
bestSA = currentSA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user