mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Mana Clash - Fixed use in available mana calculation (related to #6698).
This commit is contained in:
parent
674fd6b1a5
commit
6a65e5bb23
6 changed files with 61 additions and 15 deletions
|
|
@ -1563,7 +1563,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
|
||||
private Abilities<ActivatedManaAbilityImpl> getManaAbilitiesSortedByManaCount(MageObject mageObject, final Game game) {
|
||||
Abilities<ActivatedManaAbilityImpl> manaAbilities = mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game);
|
||||
Abilities<ActivatedManaAbilityImpl> manaAbilities = mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, playerId, game);
|
||||
if (manaAbilities.size() > 1) {
|
||||
// Sort mana abilities by number of produced manas, to use ability first that produces most mana (maybe also conditional if possible)
|
||||
Collections.sort(manaAbilities, new Comparator<ActivatedManaAbilityImpl>() {
|
||||
|
|
@ -1609,7 +1609,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
int score = 0;
|
||||
for (ManaCost cost : unpaid) {
|
||||
Abilities:
|
||||
for (ActivatedManaAbilityImpl ability : mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game)) {
|
||||
for (ActivatedManaAbilityImpl ability : mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, playerId, game)) {
|
||||
for (Mana netMana : ability.getNetMana(game)) {
|
||||
if (cost.testPay(netMana)) {
|
||||
score++;
|
||||
|
|
@ -1619,7 +1619,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
}
|
||||
}
|
||||
if (score > 0) { // score mana producers that produce other mana types and have other uses higher
|
||||
score += mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game).size();
|
||||
score += mageObject.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, playerId, game).size();
|
||||
score += mageObject.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD).size();
|
||||
if (!mageObject.getCardType().contains(CardType.LAND)) {
|
||||
score += 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue