Some fixes (#1911)

This commit is contained in:
tool4ever
2022-11-16 21:55:43 +01:00
committed by GitHub
parent e8391525e0
commit 3728e926cc
9 changed files with 8 additions and 12 deletions

View File

@@ -22,7 +22,6 @@ import forge.game.phase.PhaseType;
import forge.game.player.Player;
import forge.game.spellability.Spell;
import forge.game.spellability.SpellAbility;
import forge.game.trigger.WrappedAbility;
import forge.game.zone.ZoneType;
import forge.util.MyRandom;
import forge.util.TextUtil;
@@ -594,7 +593,7 @@ public class ComputerUtilCost {
}
// Ward - will be accounted for when rechecking a targeted ability
if (!(sa instanceof WrappedAbility) && sa.usesTargeting() && !cannotBeCountered) {
if (!sa.isTrigger() && sa.usesTargeting() && (!sa.isSpell() || !cannotBeCountered)) {
for (Card tgt : sa.getTargets().getTargetCards()) {
if (tgt.hasKeyword(Keyword.WARD) && tgt.isInPlay() && tgt.getController().isOpponentOf(sa.getHostCard().getController())) {
Cost wardCost = ComputerUtilCard.getTotalWardCost(tgt);
@@ -797,7 +796,7 @@ public class ComputerUtilCost {
if (ApiType.Counter.equals(sa.getApi())) {
List<SpellAbility> spells = AbilityUtils.getDefinedSpellAbilities(source, sa.getParamOrDefault("Defined", "Targeted"), sa);
for (SpellAbility toBeCountered : spells) {
if (sa.isSpell() && !CardFactoryUtil.isCounterable(toBeCountered.getHostCard())) {
if (toBeCountered.isSpell() && !CardFactoryUtil.isCounterable(toBeCountered.getHostCard())) {
return false;
}
// TODO check hasFizzled

View File

@@ -1406,8 +1406,7 @@ public class ComputerUtilMana {
public static int getAvailableManaEstimate(final Player p, final boolean checkPlayable) {
int availableMana = 0;
final CardCollectionView list = new CardCollection(p.getCardsIn(ZoneType.Battlefield));
final List<Card> srcs = CardLists.filter(list, new Predicate<Card>() {
final List<Card> srcs = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return !c.getManaAbilities().isEmpty();

View File

@@ -260,7 +260,7 @@ public class PumpAi extends PumpAiBase {
// Donate step 1 - try to target an opponent, preferably one who does not have a donate target yet
return SpecialCardAi.Donate.considerTargetingOpponent(ai, sa);
} else if (aiLogic.equals("InfernoOfTheStarMounts")) {
int numRedMana = ComputerUtilMana.determineLeftoverMana(sa, ai, "R", false);
int numRedMana = ComputerUtilMana.determineLeftoverMana(new SpellAbility.EmptySa(source), ai, "R", false);
int currentPower = source.getNetPower();
if (currentPower < 20 && currentPower + numRedMana >= 20) {
return true;

View File

@@ -2593,7 +2593,6 @@ public class CardFactoryUtil {
}
else if (keyword.startsWith("If CARDNAME would be put into a graveyard "
+ "from anywhere, reveal CARDNAME and shuffle it into its owner's library instead.")) {
StringBuilder sb = new StringBuilder("Event$ Moved | Destination$ Graveyard | ValidCard$ Card.Self ");
// to show it on Nexus

View File

@@ -76,7 +76,6 @@ public enum Keyword {
EVOKE("Evoke", KeywordWithCost.class, false, "You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield."),
EVOLVE("Evolve", SimpleKeyword.class, false, "Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature."),
EXALTED("Exalted", SimpleKeyword.class, false, "Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn."),
EXERTED("Exerted", SimpleKeyword.class, true, "This creature won't untap during your next untap step."),
EXPLOIT("Exploit", SimpleKeyword.class, false, "When this creature enters the battlefield, you may sacrifice a creature."),
EXTORT("Extort", SimpleKeyword.class, false, "Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life."),
FABRICATE("Fabricate", KeywordWithAmount.class, false, "When this creature enters the battlefield, put {%1$d:+1/+1 counter} on it, or create {%1$d:1/1 colorless Servo artifact creature token}."),

View File

@@ -2641,7 +2641,7 @@ public class Player extends GameEntity implements Comparable<Player> {
for (Card c : list) {
if (c.getDamageHistory().getCreatureAttackedThisCombat() > 0) {
c.getDamageHistory().setCreatureAttackedThisCombat(null, 0);
c.getDamageHistory().setCreatureAttackedThisCombat(null, -1);
}
if (c.getDamageHistory().getCreatureBlockedThisCombat()) {
c.getDamageHistory().setCreatureBlockedThisCombat(false);

View File

@@ -5,7 +5,7 @@ Loyalty:3
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0.
SVar:PlayMain1:TRUE
A:AB$ Mana | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Produced$ Combo R G | Amount$ 1 | AILogic$ Always | SubAbility$ DBEffect | SpellDescription$ Add {R} or {G}.
SVar:DBEffect:DB$ Effect | Name$ Domri, Anarch of Bolas Effect | StaticAbilities$ AntiMagic | SpellDescription$ Creature spells you cast this turn can't be countered
SVar:DBEffect:DB$ Effect | StaticAbilities$ AntiMagic | SpellDescription$ Creature spells you cast this turn can't be countered
SVar:AntiMagic:Mode$ Continuous | Affected$ Creature.wasCastByYou | AffectedZone$ Stack | EffectZone$ Command | AddHiddenKeyword$ CARDNAME can't be countered.
A:AB$ Pump | Planeswalker$ True | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | AILogic$ Fight | SpellDescription$ Target creature you control fights target creature you don't control. | SubAbility$ DBFight
SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Select target creature you don't control

View File

@@ -4,6 +4,6 @@ Types:Artifact Equipment
K:Equip:4
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | Description$ Equipped creature doesn't untap during its controller's untap step.
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddAbility$ Damage | Description$ Equipped creature has "{T}: This creature deals 2 damage to any target."
SVar:Damage:AB$DealDamage | Cost$ T | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to any target.
SVar:Damage:AB$ DealDamage | Cost$ T | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to any target.
SVar:NonStackingAttachEffect:True
Oracle:Equipped creature doesn't untap during its controller's untap step.\nEquipped creature has "{T}: This creature deals 2 damage to any target."\nEquip {4}

View File

@@ -2,6 +2,6 @@ Name:Heckling Fiends
ManaCost:2 R
Types:Creature Devil
PT:2/2
A:AB$ Effect | Cost$ 2 R | ValidTgts$ Creature | RememberObjects$ Targeted | ExileOnMoved$ Battlefield | SpellDescription$ Target creature attacks this turn if able.
A:AB$ Effect | Cost$ 2 R | ValidTgts$ Creature | RememberObjects$ Targeted | ExileOnMoved$ Battlefield | StaticAbilities$ MustAttack | SpellDescription$ Target creature attacks this turn if able.
SVar:MustAttack:Mode$ MustAttack | ValidCreature$ Card.IsRemembered | Description$ This creature attacks this turn if able.
Oracle:{2}{R}: Target creature attacks this turn if able.