mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38: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
|
ManaCost:1 R
|
||||||
Types:Instant
|
Types:Instant
|
||||||
Text:no text
|
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: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:PlayMain1:TRUE
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Gorilla War Cry
|
|||||||
ManaCost:1 R
|
ManaCost:1 R
|
||||||
Types:Instant
|
Types:Instant
|
||||||
Text:no text
|
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: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: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
|
SVar:PlayMain1:TRUE
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Ruthless Invasion
|
|||||||
ManaCost:3 PR
|
ManaCost:3 PR
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
Text:no text
|
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:KWPump:Mode$ Continuous | Affected$ Creature.nonArtifact | AddKeyword$ CARDNAME can't block. | Description$ Nonartifact creatures can't block this turn.
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import forge.AllZone;
|
|||||||
import forge.AllZoneUtil;
|
import forge.AllZoneUtil;
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CardList;
|
import forge.CardList;
|
||||||
|
import forge.CardListFilter;
|
||||||
import forge.CombatUtil;
|
import forge.CombatUtil;
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.ComputerUtil;
|
import forge.ComputerUtil;
|
||||||
@@ -244,6 +245,26 @@ public class AbilityFactoryEffect {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
randomReturn = CombatUtil.lifeInDanger(AllZone.getCombat());
|
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);
|
human = human.getValidCards(valid, this.hostCard.getController(), this.hostCard);
|
||||||
|
|
||||||
// only count creatures that can attack
|
// only count creatures that can attack
|
||||||
human = human.filter(new CardListFilter() {
|
comp = comp.filter(new CardListFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean addCard(final Card c) {
|
public boolean addCard(final Card c) {
|
||||||
return CombatUtil.canAttack(c) && !AbilityFactoryPump.this.abilityFactory.isCurse();
|
return CombatUtil.canAttack(c) && !AbilityFactoryPump.this.abilityFactory.isCurse();
|
||||||
|
|||||||
Reference in New Issue
Block a user