mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Little fixes in the AI blocking code.
This commit is contained in:
@@ -506,7 +506,7 @@ public class CombatUtil {
|
|||||||
int damage = 0;
|
int damage = 0;
|
||||||
int poison = 0;
|
int poison = 0;
|
||||||
CardList attackers = new CardList(combat.getAttackers());
|
CardList attackers = new CardList(combat.getAttackers());
|
||||||
CardList unblocked = new CardList(combat.getAttackers());
|
CardList unblocked = new CardList();
|
||||||
CardList blockers = new CardList();
|
CardList blockers = new CardList();
|
||||||
Card attacker = new Card();
|
Card attacker = new Card();
|
||||||
|
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ public class ComputerUtil_Block2
|
|||||||
//Begin with the weakest blockers
|
//Begin with the weakest blockers
|
||||||
CardListUtil.sortAttackLowFirst(blockersLeft);
|
CardListUtil.sortAttackLowFirst(blockersLeft);
|
||||||
|
|
||||||
CardList currentAttackers = attackersLeft;
|
CardList currentAttackers = new CardList(attackersLeft.toArray());
|
||||||
|
|
||||||
//first choose good blocks only
|
//first choose good blocks only
|
||||||
for(int i = 0; i < attackersLeft.size(); i++) {
|
for(int i = 0; i < attackersLeft.size(); i++) {
|
||||||
@@ -602,7 +602,7 @@ public class ComputerUtil_Block2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
attackersLeft = currentAttackers;
|
attackersLeft = new CardList(currentAttackers.toArray());
|
||||||
|
|
||||||
if(blockersLeft.size() == 0) return combat;
|
if(blockersLeft.size() == 0) return combat;
|
||||||
|
|
||||||
@@ -619,7 +619,7 @@ public class ComputerUtil_Block2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
attackersLeft = currentAttackers;
|
attackersLeft = new CardList(currentAttackers.toArray());
|
||||||
|
|
||||||
//choose necessary chump blocks if life is still in danger
|
//choose necessary chump blocks if life is still in danger
|
||||||
if (CombatUtil.lifeInDanger(combat))
|
if (CombatUtil.lifeInDanger(combat))
|
||||||
|
|||||||
@@ -181,8 +181,7 @@ public class MagicStack extends MyObservable {
|
|||||||
String k[] = parse.split(":");
|
String k[] = parse.split(":");
|
||||||
if (k[1].equals("ActualSpell")
|
if (k[1].equals("ActualSpell")
|
||||||
&& ActualEffectTriggered == false) {
|
&& ActualEffectTriggered == false) {
|
||||||
AllZone.GameAction.checkWheneverKeyword(sp.getSourceCard(),
|
AllZone.GameAction.checkWheneverKeyword(sp.getSourceCard(),"ActualSpell", null);
|
||||||
"ActualSpell", null);
|
|
||||||
sp.getSourceCard().removeIntrinsicKeyword(parse);
|
sp.getSourceCard().removeIntrinsicKeyword(parse);
|
||||||
ActualEffectTriggered = true;
|
ActualEffectTriggered = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTrigger(boolean b) {
|
public void setTrigger(boolean b) {%
|
||||||
trigger = b;
|
trigger = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user