mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Improved AI using Evolve.
This commit is contained in:
@@ -854,9 +854,8 @@ public class ComputerUtil {
|
|||||||
|
|
||||||
// get all cards the computer controls with BuffedBy
|
// get all cards the computer controls with BuffedBy
|
||||||
final List<Card> buffed = ai.getCardsIn(ZoneType.Battlefield);
|
final List<Card> buffed = ai.getCardsIn(ZoneType.Battlefield);
|
||||||
for (int j = 0; j < buffed.size(); j++) {
|
for (Card buffedcard : buffed) {
|
||||||
final Card buffedcard = buffed.get(j);
|
if (buffedcard.hasSVar("BuffedBy")) {
|
||||||
if (buffedcard.getSVar("BuffedBy").length() > 0) {
|
|
||||||
final String buffedby = buffedcard.getSVar("BuffedBy");
|
final String buffedby = buffedcard.getSVar("BuffedBy");
|
||||||
final String[] bffdby = buffedby.split(",");
|
final String[] bffdby = buffedby.split(",");
|
||||||
if (card.isValid(bffdby, buffedcard.getController(), buffedcard)) {
|
if (card.isValid(bffdby, buffedcard.getController(), buffedcard)) {
|
||||||
@@ -866,12 +865,20 @@ public class ComputerUtil {
|
|||||||
if (card.isEquipment() && buffedcard.isCreature() && CombatUtil.canAttack(buffedcard, ai.getOpponent())) {
|
if (card.isEquipment() && buffedcard.isCreature() && CombatUtil.canAttack(buffedcard, ai.getOpponent())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (card.isCreature() && buffedcard.hasKeyword("Soulbond") && !buffedcard.isPaired()) {
|
if (card.isCreature()) {
|
||||||
|
if (buffedcard.hasKeyword("Soulbond") && !buffedcard.isPaired()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (buffedcard.hasKeyword("Evolve")) {
|
||||||
|
if (buffedcard.getNetAttack() < card.getNetAttack() || buffedcard.getNetDefense() < card.getNetDefense()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (card.hasKeyword("Soulbond") && buffedcard.isCreature() && !buffedcard.isPaired()) {
|
if (card.hasKeyword("Soulbond") && buffedcard.isCreature() && !buffedcard.isPaired()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // BuffedBy
|
} // BuffedBy
|
||||||
|
|
||||||
// get all cards the human controls with AntiBuffedBy
|
// get all cards the human controls with AntiBuffedBy
|
||||||
|
|||||||
Reference in New Issue
Block a user