mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
- Basic Balan, Wandering Knight AI logic
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
package forge.ai.ability;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import forge.ai.ComputerUtilCard;
|
||||
import forge.ai.SpecialCardAi;
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates.Presets;
|
||||
import forge.game.card.CardUtil;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.AbilitySub;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
@@ -93,8 +96,21 @@ public class RepeatEachAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
}
|
||||
// would not hit oppoent, don't do that
|
||||
// would not hit opponent, don't do that
|
||||
return hitOpp;
|
||||
} else if ("EquipAll".equals(logic)) {
|
||||
if (aiPlayer.getGame().getPhaseHandler().is(PhaseType.MAIN1, aiPlayer)) {
|
||||
final CardCollection unequipped = CardLists.filter(aiPlayer.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(Card card) {
|
||||
return card.isEquipment() && card.getAttachedTo() != sa.getHostCard();
|
||||
}
|
||||
});
|
||||
|
||||
return !unequipped.isEmpty();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO Add some normal AI variability here
|
||||
|
||||
@@ -4,7 +4,7 @@ Types:Legendary Creature Cat Knight
|
||||
PT:3/3
|
||||
K:First Strike
|
||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Double Strike | CheckSVar$ X | SVarCompare$ GE2 | Description$ CARDNAME has double strike as long as two or more Equipment are attached to it.
|
||||
A:AB$ RepeatEach | Cost$ 1 W | RepeatSubAbility$ DBAttach | RepeatCards$ Equipment.YouCtrl | SpellDescription$ Attach all Equipment you control to CARDNAME.
|
||||
A:AB$ RepeatEach | Cost$ 1 W | RepeatSubAbility$ DBAttach | RepeatCards$ Equipment.YouCtrl | AILogic$ EquipAll | SpellDescription$ Attach all Equipment you control to CARDNAME.
|
||||
SVar:DBAttach:DB$ Attach | Object$ Remembered | Defined$ Self
|
||||
SVar:X:Count$Valid Equipment.Attached
|
||||
SVar:EquipMe:Multiple
|
||||
|
||||
Reference in New Issue
Block a user