attackerPlayer = attackerPlayer.getSubListBooleanState(Card.CARD_SICKNESS, false);
if (attackerPlayer.size()>0)
{
CardList defenderOpponent = opponentCreatures.copyList();
CombatSim cs = new CombatSim(attackerPlayer, defenderOpponent);
CombatSim.attackerLands = myLands ;
CombatSim.blockerLands = opponentLands;
CombatFormation as = cs.simDefensiveBlocker(10, 0);
int opponentLife = Match.match.getLife(Match.match.getOpponent(Match.match.getOwner(myCreatures.getCard(0))));
if (as != null)
if (as.playerDamage > opponentLife)
{
// GO for it, we kill him!
return myCreatures;
}
}
}
if (opponentCreatures.size() == 0)
{
CardList attackerPlayer = myCreatures.copyList();
if (minorMood==0) if (myCreatures.size()<=2) return new CardList();
if (minorMood==1) if (myCreatures.size()<=1) return new CardList();
if (minorMood==0)
{
attackerPlayer = attackerPlayer.sortListByPower();
attackerPlayer.removeCard(attackerPlayer.getCard(0));
attackerPlayer.removeCard(attackerPlayer.getCard(0));
}
else if (minorMood==1)
{
attackerPlayer = attackerPlayer.sortListByPower();
attackerPlayer.removeCard(attackerPlayer.getCard(0));
}
return myCreatures;
}
// first simulate an attack of the opponent to myself
// the cards from myself that are NOT needed in defensive
// action will be "left" over for attack by myself
CardList attackerPlayer = myCreatures.copyList();
CardList attackerOpponent = opponentCreatures.copyList();
attackerOpponent = attackerOpponent.removeWithAbility("Defender");
if (attackerOpponent.size() !=0)
{
CardList defenderPlayer = myCreatures.copyList();
CombatSim cs = new CombatSim(attackerOpponent, defenderPlayer);
// set globals as lands
// needed to get Swampwalk etc right in simulation
CombatSim.attackerLands = opponentLands;
CombatSim.blockerLands = myLands;
// as defensive player we think the worst of our opponent
// he will certainly be aggressive :-)
CombatFormation as = cs.simAgressiveBlocker(intellligence, 2);
if (as==null)
{
D.addLog("as1 null",2);
// return new CardList();
attackerPlayer = new CardList();
}
else
attackerPlayer = as.unUsedBlockerList;
attackerPlayer = adjustVigilance(attackerPlayer, myCreatures);
}
attackerPlayer = attackerPlayer.removeWithAbility("Defender");
attackerPlayer = attackerPlayer.getSubListBooleanState(Card.CARD_TAPPED, false);
attackerPlayer = attackerPlayer.getSubListBooleanState(Card.CARD_SICKNESS, false);
// System.out.println("BlockĀ“Formation: "+as);
// all non blockers can attack!
// idea - with attackers block opponent creatures,
// the ones not needed for killing of blockers - can attack
//System.out.println("Unused blocker: " + as.unUsedBlockerList);
if (minorMood==0) if (attackerPlayer.size()<=2) return new CardList();
if (minorMood==1) if (attackerPlayer.size()<=1) return new CardList();
if (minorMood==0)
{
attackerPlayer = attackerPlayer.sortListByPower();
attackerPlayer.removeCard(attackerPlayer.getCard(0));
attackerPlayer.removeCard(attackerPlayer.getCard(0));
}
else if (minorMood==1)
{
attackerPlayer = attackerPlayer.sortListByPower();
attackerPlayer.removeCard(attackerPlayer.getCard(0));
}
CardList defenderOpponent = opponentCreatures.copyList();
CombatSim cs = new CombatSim(attackerPlayer, defenderOpponent);
CombatSim.attackerLands = myLands ;
CombatSim.blockerLands = opponentLands;
CombatFormation as = cs.simDefensiveBlocker(10, 0);
if (as==null)
{
D.addLog("as2 null",2);
//System.out.println("as2 null");
return attackerPlayer;