mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Merge remote-tracking branch 'upstream/master' into patch-carddb-performance
This commit is contained in:
@@ -238,6 +238,9 @@ public class ComputerUtilCost {
|
||||
}
|
||||
for (final CostPart part : cost.getCostParts()) {
|
||||
if (part instanceof CostSacrifice) {
|
||||
if (!ai.isAI()) {
|
||||
return false;
|
||||
}
|
||||
CardCollection list = new CardCollection();
|
||||
final CardCollection exclude = new CardCollection();
|
||||
if (AiCardMemory.getMemorySet(ai, MemorySet.PAYS_SAC_COST) != null) {
|
||||
|
||||
@@ -53,6 +53,7 @@ public enum SpellApiToAi {
|
||||
.put(ApiType.ClassLevelUp, AlwaysPlayAi.class)
|
||||
.put(ApiType.Cleanup, AlwaysPlayAi.class)
|
||||
.put(ApiType.Clone, CloneAi.class)
|
||||
.put(ApiType.CompanionChoose, ChooseCompanionAi.class)
|
||||
.put(ApiType.CopyPermanent, CopyPermanentAi.class)
|
||||
.put(ApiType.CopySpellAbility, CopySpellAbilityAi.class)
|
||||
.put(ApiType.ControlPlayer, CannotPlayAi.class)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package forge.ai.ability;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
@@ -36,10 +32,4 @@ public class CanPlayAsDrawbackAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellAbility chooseSingleSpellAbility(Player player, SpellAbility sa, List<SpellAbility> spells,
|
||||
Map<String, Object> params) {
|
||||
// This might be called from CopySpellAbilityEffect - to hide warning (for having no overload) use this simple overload
|
||||
return spells.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ public class CountersProliferateAi extends SpellAbilityAi {
|
||||
|
||||
@Override
|
||||
protected boolean checkApiLogic(Player ai, SpellAbility sa) {
|
||||
|
||||
final List<Card> cperms = Lists.newArrayList();
|
||||
final List<Player> allies = ai.getAllies();
|
||||
allies.add(ai);
|
||||
@@ -87,7 +86,6 @@ public class CountersProliferateAi extends SpellAbilityAi {
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
return !cperms.isEmpty() || !hperms.isEmpty() || opponentPoison || allyExpOrEnergy;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ public class UnattachAllAi extends SpellAbilityAi {
|
||||
*/
|
||||
@Override
|
||||
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
||||
|
||||
// prevent run-away activations - first time will always return true
|
||||
boolean chance = MyRandom.getRandom().nextFloat() <= .9;
|
||||
|
||||
|
||||
@@ -154,8 +154,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
||||
copies.add(copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (int i = 0; i < amount; i++) {
|
||||
SpellAbility copy = CardFactory.copySpellAbilityAndPossiblyHost(sa, chosenSA, controller);
|
||||
if (sa.hasParam("MayChooseTarget")) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -768,8 +768,7 @@ public class Combat {
|
||||
if (divideCombatDamageAsChoose) {
|
||||
if (orderedBlockers == null || orderedBlockers.isEmpty()) {
|
||||
orderedBlockers = getDefendersCreatures();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (Card c : getDefendersCreatures()) {
|
||||
if (!orderedBlockers.contains(c)) {
|
||||
orderedBlockers.add(c);
|
||||
@@ -798,8 +797,7 @@ public class Combat {
|
||||
} else if (trampler || !band.isBlocked()) { // this is called after declare blockers, no worries 'bout nulls in isBlocked
|
||||
damageMap.put(attacker, defender, damageDealt);
|
||||
} // No damage happens if blocked but no blockers left
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Player assigningPlayer = getAttackingPlayer();
|
||||
// Defensive Formation is very similar to Banding with Blockers
|
||||
// It allows the defending player to assign damage instead of the attacking player
|
||||
|
||||
Reference in New Issue
Block a user