mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- AI should block a lot more often now.
This commit is contained in:
@@ -100,7 +100,7 @@ public class ComputerUtil_Block2
|
||||
{
|
||||
//do not block a non-flyer with a flyer
|
||||
if((! c.get(i).getKeyword().contains("Flying")) || attacker.getKeyword().contains("Flying"))
|
||||
return c.get(i);
|
||||
return c.get(i);
|
||||
}
|
||||
return null;
|
||||
}//tradeSingleBlock()
|
||||
@@ -231,14 +231,16 @@ public class ComputerUtil_Block2
|
||||
//safe block - attacker dies, blocker lives
|
||||
//if there is only one attacker it might be a trap
|
||||
//if holding a Giant Growth and a 2/2 attacking into a 3/3
|
||||
if(shouldBlock)
|
||||
{
|
||||
c = safeSingleBlock(attackers.get(i));
|
||||
if(c != null)
|
||||
testing("safe");
|
||||
}
|
||||
Random random = new Random();
|
||||
int randomInt = random.nextInt(100);
|
||||
|
||||
if(c == null && shouldBlock)
|
||||
if (randomInt >= 10)
|
||||
{
|
||||
c = safeSingleBlock(attackers.get(i));
|
||||
if(c != null)
|
||||
testing("safe");
|
||||
}
|
||||
if(c == null && randomInt >= 15)
|
||||
{
|
||||
//shield block - attacker lives, blocker lives
|
||||
c = shieldSingleBlock(attackers.get(i));
|
||||
|
||||
Reference in New Issue
Block a user