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