mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added the new AI logic "Evasion" to AF Effect.
This commit is contained in:
@@ -2,7 +2,7 @@ Name:Falter
|
||||
ManaCost:1 R
|
||||
Types:Instant
|
||||
Text:no text
|
||||
A:SP$ Effect | Cost$ 1 R | Name$ Falter Effect | StaticAbilities$ KWPump | SpellDescription$ Creatures without flying can't block this turn.
|
||||
A:SP$ Effect | Cost$ 1 R | Name$ Falter Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Creatures without flying can't block this turn.
|
||||
SVar:KWPump:Mode$ Continuous | Affected$ Creature.withoutFlying | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures without flying can't block this turn.
|
||||
SVar:PlayMain1:TRUE
|
||||
SVar:RemAIDeck:True
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Gorilla War Cry
|
||||
ManaCost:1 R
|
||||
Types:Instant
|
||||
Text:no text
|
||||
A:SP$ Effect | Cost$ 1 R | Name$ Gorilla War Cry Effect | StaticAbilities$ Blocking | ActivationPhases$ BeginCombat->Declare Attackers - Play Instants and Abilities | SubAbility$ DBDraw | SpellDescription$ Cast CARDNAME only during combat before blockers are declared. Creatures can't be blocked this turn except by two or more creatures.
|
||||
A:SP$ Effect | Cost$ 1 R | Name$ Gorilla War Cry Effect | StaticAbilities$ Blocking | ActivationPhases$ BeginCombat->Declare Attackers - Play Instants and Abilities | AILogic$ Evasion | SubAbility$ DBDraw | SpellDescription$ Cast CARDNAME only during combat before blockers are declared. Creatures can't be blocked this turn except by two or more creatures.
|
||||
SVar:DBDraw:DB$Draw | NumCards$ 1 | NextUpkeep$ True | SpellDescription$ Draw a card at the beginning of the next upkeep.
|
||||
SVar:Blocking:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't be blocked except by two or more creatures. | Description$ Creatures can't be blocked this turn except by two or more creatures.
|
||||
SVar:PlayMain1:TRUE
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Ruthless Invasion
|
||||
ManaCost:3 PR
|
||||
Types:Sorcery
|
||||
Text:no text
|
||||
A:SP$ Effect | Cost$ 3 PR | Name$ Ruthless Invasion Effect | StaticAbilities$ KWPump | SpellDescription$ Nonartifact creatures can't block this turn.
|
||||
A:SP$ Effect | Cost$ 3 PR | Name$ Ruthless Invasion Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Nonartifact creatures can't block this turn.
|
||||
SVar:KWPump:Mode$ Continuous | Affected$ Creature.nonArtifact | AddKeyword$ CARDNAME can't block. | Description$ Nonartifact creatures can't block this turn.
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Common
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.AllZone;
|
||||
import forge.AllZoneUtil;
|
||||
import forge.Card;
|
||||
import forge.CardList;
|
||||
import forge.CardListFilter;
|
||||
import forge.CombatUtil;
|
||||
import forge.Command;
|
||||
import forge.ComputerUtil;
|
||||
@@ -244,6 +245,26 @@ public class AbilityFactoryEffect {
|
||||
return false;
|
||||
}
|
||||
randomReturn = CombatUtil.lifeInDanger(AllZone.getCombat());
|
||||
} else if (logic.equals("Evasion")) {
|
||||
CardList comp = AllZone.getComputerPlayer().getCardsIn(Zone.Battlefield).getType("Creature");
|
||||
CardList human = AllZone.getHumanPlayer().getCardsIn(Zone.Battlefield).getType("Creature");
|
||||
|
||||
// only count creatures that can attack or block
|
||||
comp = comp.filter(new CardListFilter() {
|
||||
@Override
|
||||
public boolean addCard(final Card c) {
|
||||
return CombatUtil.canAttack(c);
|
||||
}
|
||||
});
|
||||
human = human.filter(new CardListFilter() {
|
||||
@Override
|
||||
public boolean addCard(final Card c) {
|
||||
return CombatUtil.canBlock(c);
|
||||
}
|
||||
});
|
||||
if (comp.size() < 2 || human.size() < 1) {
|
||||
randomReturn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1117,7 +1117,7 @@ public class AbilityFactoryPump {
|
||||
human = human.getValidCards(valid, this.hostCard.getController(), this.hostCard);
|
||||
|
||||
// only count creatures that can attack
|
||||
human = human.filter(new CardListFilter() {
|
||||
comp = comp.filter(new CardListFilter() {
|
||||
@Override
|
||||
public boolean addCard(final Card c) {
|
||||
return CombatUtil.canAttack(c) && !AbilityFactoryPump.this.abilityFactory.isCurse();
|
||||
|
||||
Reference in New Issue
Block a user