mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Increased priority of token generators when AI has no creatures to improve usage of planeswalkers like Nissa, Sage Animist and Sarkan Unbroken
This commit is contained in:
@@ -793,16 +793,18 @@ public class AiController {
|
|||||||
private int getSpellAbilityPriority(SpellAbility sa) {
|
private int getSpellAbilityPriority(SpellAbility sa) {
|
||||||
int p = 0;
|
int p = 0;
|
||||||
Card source = sa.getHostCard();
|
Card source = sa.getHostCard();
|
||||||
|
final Player ai = source.getController();
|
||||||
|
final boolean noCreatures = ai.getCreaturesInPlay().isEmpty();
|
||||||
// puts creatures in front of spells
|
// puts creatures in front of spells
|
||||||
if (source.isCreature()) {
|
if (source.isCreature()) {
|
||||||
p += 1;
|
p += 1;
|
||||||
}
|
}
|
||||||
// don't play equipments before having any creatures
|
// don't play equipments before having any creatures
|
||||||
if (source.isEquipment() && sa.getHostCard().getController().getCreaturesInPlay().isEmpty()) {
|
if (source.isEquipment() && noCreatures) {
|
||||||
p -= 9;
|
p -= 9;
|
||||||
}
|
}
|
||||||
// artifacts and enchantments with effects that do not stack
|
// artifacts and enchantments with effects that do not stack
|
||||||
if ("True".equals(source.getSVar("NonStackingEffect")) && source.getController().isCardInPlay(source.getName())) {
|
if ("True".equals(source.getSVar("NonStackingEffect")) && ai.isCardInPlay(source.getName())) {
|
||||||
p -= 9;
|
p -= 9;
|
||||||
}
|
}
|
||||||
// sort planeswalker abilities for ultimate
|
// sort planeswalker abilities for ultimate
|
||||||
@@ -815,6 +817,10 @@ public class AiController {
|
|||||||
if (ApiType.DestroyAll == sa.getApi()) {
|
if (ApiType.DestroyAll == sa.getApi()) {
|
||||||
p += 4;
|
p += 4;
|
||||||
}
|
}
|
||||||
|
if (ApiType.Token == sa.getApi() && noCreatures) {
|
||||||
|
//hack to force planeswalkers to defend themselves
|
||||||
|
p += 3;
|
||||||
|
}
|
||||||
else if (ApiType.Mana == sa.getApi()) {
|
else if (ApiType.Mana == sa.getApi()) {
|
||||||
p -= 9;
|
p -= 9;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user