mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Improved the targeting AI of enControl auras.
- changeController will no longer reset the TurnInZone variable of a card.
This commit is contained in:
@@ -122,7 +122,7 @@ public class EndOfTurn implements java.io.Serializable
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(c.getName().equals("Erg Raiders") && !c.getCreatureAttackedThisTurn() &&
|
if(c.getName().equals("Erg Raiders") && !c.getCreatureAttackedThisTurn() &&
|
||||||
!(c.getTurnInZone() == AllZone.Phase.getTurn()) && AllZone.Phase.isPlayerTurn(c.getController())) {
|
!c.isSick() && AllZone.Phase.isPlayerTurn(c.getController())) {
|
||||||
final Card raider = c;
|
final Card raider = c;
|
||||||
final SpellAbility change = new Ability(raider, "0") {
|
final SpellAbility change = new Ability(raider, "0") {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -144,9 +144,11 @@ public class GameAction {
|
|||||||
//so "enters the battlefield" abilities don't trigger
|
//so "enters the battlefield" abilities don't trigger
|
||||||
|
|
||||||
for(Card c : list){
|
for(Card c : list){
|
||||||
|
int turnInZone = c.getTurnInZone();
|
||||||
oldBattlefield.remove(c);
|
oldBattlefield.remove(c);
|
||||||
c.setController(newController);
|
c.setController(newController);
|
||||||
newBattlefield.add(c);
|
newBattlefield.add(c);
|
||||||
|
c.setTurnInZone(turnInZone); // The number of turns in the zone should not change
|
||||||
if (c.isCreature())
|
if (c.isCreature())
|
||||||
AllZone.Combat.removeFromCombat(c);
|
AllZone.Combat.removeFromCombat(c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2265,8 +2265,6 @@ class CardFactory_Auras {
|
|||||||
if(!super.canPlayAI()) return false;
|
if(!super.canPlayAI()) return false;
|
||||||
|
|
||||||
CardList tgts = CardFactoryUtil.AI_getHumanCreature(card, true);
|
CardList tgts = CardFactoryUtil.AI_getHumanCreature(card, true);
|
||||||
CardListUtil.sortAttack(tgts);
|
|
||||||
CardListUtil.sortFlying(tgts);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a new addition and is used
|
* This is a new addition and is used
|
||||||
@@ -2278,13 +2276,6 @@ class CardFactory_Auras {
|
|||||||
return CardUtil.getConvertedManaCost(c.getManaCost()) <= 2;
|
return CardUtil.getConvertedManaCost(c.getManaCost()) <= 2;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (tgts.isEmpty()) return false;
|
|
||||||
else {
|
|
||||||
CardListUtil.sortAttack(tgts);
|
|
||||||
CardListUtil.sortFlying(tgts);
|
|
||||||
setTargetCard(tgts.get(0));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2301,15 +2292,10 @@ class CardFactory_Auras {
|
|||||||
|
|
||||||
if (tgts.isEmpty()) return false;
|
if (tgts.isEmpty()) return false;
|
||||||
|
|
||||||
if (2 <= tgts.get(0).getNetAttack()
|
Card target = CardFactoryUtil.AI_getBestCreature(tgts);
|
||||||
&& tgts.get(0).getKeyword().contains("Flying")) {
|
|
||||||
setTargetCard(tgts.get(0));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
CardListUtil.sortAttack(tgts);
|
if (CardFactoryUtil.evaluateCreature(target) >= 160) {
|
||||||
if (4 <= tgts.get(0).getNetAttack()) {
|
setTargetCard(target);
|
||||||
setTargetCard(tgts.get(0));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2318,9 +2304,8 @@ class CardFactory_Auras {
|
|||||||
* Do we want the AI to hold these auras when
|
* Do we want the AI to hold these auras when
|
||||||
* losing game and at a creature disadvatange
|
* losing game and at a creature disadvatange
|
||||||
*/
|
*/
|
||||||
if (3 <= tgts.get(0).getNetAttack()
|
if (CardFactoryUtil.evaluateCreature(target) >= 130 && 5 > AllZone.ComputerPlayer.getLife()) {
|
||||||
&& AllZone.HumanPlayer.getLife() > AllZone.ComputerPlayer.getLife()) {
|
setTargetCard(target);
|
||||||
setTargetCard(tgts.get(0));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user