mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Improved the AI of the ChangeZone AF.
- Added Tapped as option for ChangeZoneAll. - Converted Retract to ChangeZoneAll. - Added Planar Birth.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -4011,6 +4011,7 @@ res/cardsfolder/plague_wind.txt -text svneol=native#text/plain
|
|||||||
res/cardsfolder/plague_witch.txt -text svneol=native#text/plain
|
res/cardsfolder/plague_witch.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/plagued_rusalka.txt -text svneol=native#text/plain
|
res/cardsfolder/plagued_rusalka.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/plains.txt -text svneol=native#text/plain
|
res/cardsfolder/plains.txt -text svneol=native#text/plain
|
||||||
|
res/cardsfolder/planar_birth.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/planar_cleansing.txt -text svneol=native#text/plain
|
res/cardsfolder/planar_cleansing.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/planar_collapse.txt -text svneol=native#text/plain
|
res/cardsfolder/planar_collapse.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/planar_despair.txt -text svneol=native#text/plain
|
res/cardsfolder/planar_despair.txt -text svneol=native#text/plain
|
||||||
|
|||||||
9
res/cardsfolder/planar_birth.txt
Normal file
9
res/cardsfolder/planar_birth.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:Planar Birth
|
||||||
|
ManaCost:1 W
|
||||||
|
Types:Sorcery
|
||||||
|
Text:no text
|
||||||
|
A:SP$ChangeZoneAll | Cost$ 1 W | ChangeType$ Land.Basic | Origin$ Graveyard | Destination$ Battlefield | Tapped$ True | SpellDescription$ Return all basic land cards from all graveyards to the battlefield tapped under their owners' control.
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Rarity:Rare
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/planar_birth.jpg
|
||||||
|
End
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
Name:Retract
|
Name:Retract
|
||||||
ManaCost:U
|
ManaCost:U
|
||||||
Types:Instant
|
Types:Instant
|
||||||
Text:Return all artifacts you control to their owner's hand.
|
Text:no text
|
||||||
K:spBounceAll:Artifact.YouCtrl:Hand
|
A:SP$ChangeZoneAll | Cost$ U | ChangeType$ Artifact.YouCtrl | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return all artifacts you control to their owner's hand.
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/retract.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/retract.jpg
|
||||||
|
|||||||
@@ -646,8 +646,9 @@ public class AbilityFactory_ChangeZone {
|
|||||||
// AI Targeting
|
// AI Targeting
|
||||||
Card choice = null;
|
Card choice = null;
|
||||||
|
|
||||||
if (list.getNotType("Creature").size() == 0 && destination.equals("Battlefield"))
|
if (CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), false).isCreature()
|
||||||
choice = CardFactoryUtil.AI_getBestCreature(list); //if only creatures take the best
|
&& destination.equals("Battlefield"))
|
||||||
|
choice = CardFactoryUtil.AI_getBestCreatureToBounce(list); //if a creature is most expensive take the best
|
||||||
else if (destination.equals("Battlefield"))
|
else if (destination.equals("Battlefield"))
|
||||||
choice = CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), false);
|
choice = CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), false);
|
||||||
else{
|
else{
|
||||||
@@ -1035,11 +1036,13 @@ public class AbilityFactory_ChangeZone {
|
|||||||
else if (origin.equals("Battlefield")){
|
else if (origin.equals("Battlefield")){
|
||||||
// this statement is assuming the AI is trying to use this spell offensively
|
// this statement is assuming the AI is trying to use this spell offensively
|
||||||
// if the AI is using it defensively, then something else needs to occur
|
// if the AI is using it defensively, then something else needs to occur
|
||||||
if (computerType.size()+1 > humanType.size())
|
// if only creatures are affected evaluate both lists and pass only if human creatures are more valuable
|
||||||
return false;
|
if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) {
|
||||||
|
if(CardFactoryUtil.evaluateCreatureList(computerType) + 200 >= CardFactoryUtil.evaluateCreatureList(humanType))
|
||||||
if (humanType.size() <= 1) // unless that 1 thing is going to kill me soon?
|
return false;
|
||||||
return false;
|
} // otherwise evaluate both lists by CMC and pass only if human permanents are more valuable
|
||||||
|
else if(CardFactoryUtil.evaluatePermanentList(computerType) + 3 >= CardFactoryUtil.evaluatePermanentList(humanType))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Don't cast during main1?
|
// Don't cast during main1?
|
||||||
if (AllZone.Phase.is(Constant.Phase.Main1, AllZone.ComputerPlayer))
|
if (AllZone.Phase.is(Constant.Phase.Main1, AllZone.ComputerPlayer))
|
||||||
@@ -1066,14 +1069,21 @@ public class AbilityFactory_ChangeZone {
|
|||||||
|
|
||||||
if (destination.equals(Constant.Zone.Battlefield)){
|
if (destination.equals(Constant.Zone.Battlefield)){
|
||||||
if (params.get("GainControl") != null){
|
if (params.get("GainControl") != null){
|
||||||
// todo: don't activate if less than 4 cards.
|
// Check if the cards are valuable enough
|
||||||
// although if those cards are awesome, or we need the blockers maybe we should
|
if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) {
|
||||||
if (humanType.size() + computerType.size() < 4)
|
if(CardFactoryUtil.evaluateCreatureList(computerType) + CardFactoryUtil.evaluateCreatureList(humanType) < 400)
|
||||||
|
return false;
|
||||||
|
} // otherwise evaluate both lists by CMC and pass only if human permanents are less valuable
|
||||||
|
else if(CardFactoryUtil.evaluatePermanentList(computerType) + CardFactoryUtil.evaluatePermanentList(humanType) < 6)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// don't activate if human gets more back than AI does
|
// don't activate if human gets more back than AI does
|
||||||
if (humanType.size() > computerType.size())
|
if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) {
|
||||||
|
if(CardFactoryUtil.evaluateCreatureList(computerType) <= CardFactoryUtil.evaluateCreatureList(humanType) + 100)
|
||||||
|
return false;
|
||||||
|
} // otherwise evaluate both lists by CMC and pass only if human permanents are less valuable
|
||||||
|
else if(CardFactoryUtil.evaluatePermanentList(computerType) <= CardFactoryUtil.evaluatePermanentList(humanType) + 2)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1128,6 +1138,8 @@ public class AbilityFactory_ChangeZone {
|
|||||||
// I don't know if library position is necessary. It's here if it is, just in case
|
// I don't know if library position is necessary. It's here if it is, just in case
|
||||||
int libraryPos = params.containsKey("LibraryPosition") ? Integer.parseInt(params.get("LibraryPosition")) : 0;
|
int libraryPos = params.containsKey("LibraryPosition") ? Integer.parseInt(params.get("LibraryPosition")) : 0;
|
||||||
for(Card c : cards){
|
for(Card c : cards){
|
||||||
|
if (destination.equals("Battlefield") && params.containsKey("Tapped"))
|
||||||
|
c.tap();
|
||||||
if (params.containsKey("GainControl"))
|
if (params.containsKey("GainControl"))
|
||||||
AllZone.GameAction.moveToPlay(c, sa.getActivatingPlayer());
|
AllZone.GameAction.moveToPlay(c, sa.getActivatingPlayer());
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ public class CardFactoryUtil {
|
|||||||
if (biggest.isToken()) biggestvalue += 100; // raise the value of tokens
|
if (biggest.isToken()) biggestvalue += 100; // raise the value of tokens
|
||||||
newvalue = evaluateCreature(all.get(i));
|
newvalue = evaluateCreature(all.get(i));
|
||||||
if (all.get(i).isToken()) newvalue += 100; // raise the value of tokens
|
if (all.get(i).isToken()) newvalue += 100; // raise the value of tokens
|
||||||
if(evaluateCreature(biggest) < evaluateCreature(all.get(i))) biggest = all.get(i);
|
if(biggestvalue < newvalue) biggest = all.get(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return biggest;
|
return biggest;
|
||||||
|
|||||||
Reference in New Issue
Block a user