mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Extended OblivionRing logic for Suspension Field
- Implemented rudimentary logic for Outlast - Fixed mana cost for Dazzling Ramparts
This commit is contained in:
@@ -730,7 +730,18 @@ public class AiController {
|
||||
final ZoneType origin = ZoneType.listValueOf(effectExile.getParam("Origin")).get(0);
|
||||
final TargetRestrictions tgt = effectExile.getTargetRestrictions();
|
||||
final List<Card> list = CardLists.getValidCards(game.getCardsIn(origin), tgt.getValidTgts(), player, card);
|
||||
if (CardLists.getTargetableCards(list, sa).isEmpty()) {
|
||||
List<Card> targets = CardLists.getTargetableCards(list, sa);
|
||||
if (sa.getHostCard().getName().equals("Suspension Field")) {
|
||||
//existing "exile until leaves" enchantments only target opponent's permanents
|
||||
final Player ai = sa.getActivatingPlayer();
|
||||
targets = CardLists.filter(targets, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return !c.getController().equals(ai);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (targets.isEmpty()) {
|
||||
return AiPlayDecision.AnotherTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import forge.game.card.CardLists;
|
||||
import forge.game.card.CounterType;
|
||||
import forge.game.combat.CombatUtil;
|
||||
import forge.game.cost.Cost;
|
||||
import forge.game.phase.PhaseHandler;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerActionConfirmMode;
|
||||
@@ -163,6 +164,19 @@ public class CountersPutAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
PhaseHandler ph = ai.getGame().getPhaseHandler();
|
||||
if (sa.isOutlast()) {
|
||||
if (ph.is(PhaseType.MAIN2, ai)) { //applicable to non-attackers only
|
||||
float chance = 0.8f;
|
||||
if (!ai.getOpponent().getCreaturesInPlay().isEmpty()) {
|
||||
chance /= 2; //needs a better way to check if target is required as a blocker
|
||||
}
|
||||
return chance > r.nextFloat();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// don't use it if no counters to add
|
||||
if (amount <= 0) {
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name:Dazzling Ramparts
|
||||
ManaCost:1 W
|
||||
ManaCost:4 W
|
||||
Types:Creature Wall
|
||||
PT:0/7
|
||||
K:Defender
|
||||
|
||||
Reference in New Issue
Block a user