This commit is contained in:
tool4EvEr
2021-10-06 10:10:19 +02:00
parent a8115d8a44
commit c65aa86f6b
43 changed files with 80 additions and 90 deletions

View File

@@ -671,7 +671,6 @@ public class ComputerUtilCombat {
int flankingMagnitude = 0;
if (attacker.hasKeyword(Keyword.FLANKING) && !blocker.hasKeyword(Keyword.FLANKING)) {
flankingMagnitude = attacker.getAmountOfKeyword(Keyword.FLANKING);
if (flankingMagnitude >= blocker.getNetToughness()) {

View File

@@ -361,8 +361,7 @@ public class PlayerControllerAi extends PlayerController {
for (Card c: topN) {
if (ComputerUtil.scryWillMoveCardToBottomOfLibrary(player, c)) {
toBottom.add(c);
}
else {
} else {
toTop.add(c);
}
}
@@ -525,8 +524,7 @@ public class PlayerControllerAi extends PlayerController {
if (copySA instanceof Spell) {
Spell spell = (Spell) copySA;
((PlayerControllerAi) player.getController()).getAi().canPlayFromEffectAI(spell, true, true);
}
else {
} else {
getAi().canPlaySa(copySA);
}
}
@@ -884,9 +882,8 @@ public class PlayerControllerAi extends PlayerController {
byte chosenColorMask = MagicColor.fromName(c);
if ((colors.getColor() & chosenColorMask) != 0) {
return chosenColorMask;
} else {
return Iterables.getFirst(colors, (byte)0);
}
return Iterables.getFirst(colors, (byte)0);
}
@Override
@@ -905,10 +902,8 @@ public class PlayerControllerAi extends PlayerController {
if ((colors.getColor() & chosenColorMask) != 0) {
return chosenColorMask;
}
else {
return Iterables.getFirst(colors, MagicColor.WHITE);
}
}
@Override
public ICardFace chooseSingleCardFace(SpellAbility sa, String message,
@@ -1370,8 +1365,7 @@ public class PlayerControllerAi extends PlayerController {
}
@Override
public int chooseNumberForKeywordCost(SpellAbility sa, Cost cost, KeywordInterface keyword, String prompt,
int max) {
public int chooseNumberForKeywordCost(SpellAbility sa, Cost cost, KeywordInterface keyword, String prompt, int max) {
// TODO: improve the logic depending on the keyword and the playability of the cost-modified SA (enough targets present etc.)
int chosenAmount = 0;

View File

@@ -330,7 +330,6 @@ public class DamageDealAi extends DamageAiBase {
*/
private Card dealDamageChooseTgtC(final Player ai, final SpellAbility sa, final int d, final boolean noPrevention,
final Player pl, final boolean mandatory) {
// wait until stack is empty (prevents duplicate kills)
if (!sa.isTrigger() && !ai.getGame().getStack().isEmpty()) {
//TODO:all removal APIs require a check to prevent duplicate kill/bounce/exile/etc.
@@ -345,7 +344,7 @@ public class DamageDealAi extends DamageAiBase {
final Player activator = sa.getActivatingPlayer();
final Card source = sa.getHostCard();
final Game game = source.getGame();
List<Card> hPlay = getTargetableCards(ai, sa, pl, tgt, activator, source, game);
List<Card> hPlay = getTargetableCards(mandatory ? pl : ai, sa, pl, tgt, activator, source, game);
// Filter MustTarget requirements
StaticAbilityMustTarget.filterMustTargetCards(ai, hPlay, sa);

View File

@@ -222,7 +222,7 @@ public class CharmEffect extends SpellAbilityEffect {
});
for (AbilitySub sub : chosen) {
// Clone the chosen, just in case the some subAb gets chosen multiple times
// Clone the chosen, just in case the same subAb gets chosen multiple times
AbilitySub clone = (AbilitySub)sub.copy();
// update ActivatingPlayer
@@ -250,7 +250,6 @@ public class CharmEffect extends SpellAbilityEffect {
// add Clone to Tail of sa
sa.appendSubAbility(clone);
}
}
}

View File

@@ -3580,10 +3580,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
return changed;
}
public boolean clearChangedCardKeywords() {
return clearChangedCardKeywords(false);
}
public boolean clearChangedCardColors() {
boolean changed = false;
@@ -4268,6 +4264,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
return change;
}
public boolean clearChangedCardKeywords() {
return clearChangedCardKeywords(false);
}
public final boolean clearChangedCardKeywords(final boolean updateView) {
if (changedCardKeywords.isEmpty()) {
return false;