mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Improved AI playing equipments.
This commit is contained in:
@@ -489,9 +489,9 @@ public class AiController {
|
||||
|
||||
// cast 0 mana cost spells first (might be a Mox)
|
||||
if (a1 == 0) {
|
||||
b1 = -2;
|
||||
return -1;
|
||||
} else if (b1 == 0) {
|
||||
a1 = -2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
a1 += getSpellAbilityPriority(a);
|
||||
@@ -506,6 +506,10 @@ public class AiController {
|
||||
if (sa.getSourceCard().isCreature()) {
|
||||
p += 1;
|
||||
}
|
||||
// don't play equipments before having any creatures
|
||||
if (sa.getSourceCard().isEquipment() && sa.getSourceCard().getController().getCreaturesInPlay().isEmpty()) {
|
||||
p -= 9;
|
||||
}
|
||||
// sort planeswalker abilities for ultimate
|
||||
if (sa.getRestrictions().getPlaneswalker()) {
|
||||
if (sa.hasParam("Ultimate")) {
|
||||
|
||||
@@ -810,6 +810,14 @@ public class ComputerUtil {
|
||||
|| card.hasKeyword("Haste"))) || card.hasKeyword("Exalted")) {
|
||||
return true;
|
||||
}
|
||||
//cast equipments in Main1 when there are creatures to equip
|
||||
if (card.isEquipment()) {
|
||||
for (Card c : card.getController().getCreaturesInPlay()) {
|
||||
if (CombatUtil.canAttackNextTurn(c) && c.canBeEquippedBy(card)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get all cards the computer controls with BuffedBy
|
||||
final List<Card> buffed = ai.getCardsIn(ZoneType.Battlefield);
|
||||
|
||||
Reference in New Issue
Block a user