mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
Add Subtype to the CardAttribute Framework
This is a massive change. I’ve refrained from unrelated refactoring when possible but there are still a lot of changes here.
This commit is contained in:
parent
a1a3c0c6a7
commit
282443c231
272 changed files with 514 additions and 493 deletions
|
|
@ -1340,9 +1340,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
for (Permanent permanent : game.getBattlefield().getActivePermanents(this.getId(), game)) {
|
||||
if (game.getOpponents(this.getId()).contains(permanent.getControllerId())
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)
|
||||
&& permanent.getSubtype().size() > 0) {
|
||||
if (choice.getChoices().contains(permanent.getSubtype().get(0))) {
|
||||
choice.setChoice(permanent.getSubtype().get(0));
|
||||
&& permanent.getSubtype(game).size() > 0) {
|
||||
if (choice.getChoices().contains(permanent.getSubtype(game).get(0))) {
|
||||
choice.setChoice(permanent.getSubtype(game).get(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1352,9 +1352,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
for (UUID opponentId : game.getOpponents(this.getId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
for (Card card : opponent.getGraveyard().getCards(game)) {
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype().get(0))) {
|
||||
choice.setChoice(card.getSubtype().get(0));
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
|
||||
choice.setChoice(card.getSubtype(game).get(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1368,9 +1368,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
// choose a creature type of hand or library
|
||||
for (UUID cardId : this.getHand()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype().get(0))) {
|
||||
choice.setChoice(card.getSubtype().get(0));
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
|
||||
choice.setChoice(card.getSubtype(game).get(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1378,9 +1378,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
if (!choice.isChosen()) {
|
||||
for (UUID cardId : this.getLibrary().getCardList()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype().size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype().get(0))) {
|
||||
choice.setChoice(card.getSubtype().get(0));
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && card.getSubtype(game).size() > 0) {
|
||||
if (choice.getChoices().contains(card.getSubtype(game).get(0))) {
|
||||
choice.setChoice(card.getSubtype(game).get(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import java.io.InputStream;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Class responsible for reading ratings from resources and rating gived cards.
|
||||
* Class responsible for reading ratings from resources and rating given cards.
|
||||
* Based on card relative ratings from resources and card parameters.
|
||||
*
|
||||
* @author nantuko
|
||||
|
|
@ -61,9 +61,9 @@ public class RateCard {
|
|||
type = 15;
|
||||
} else if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
type = 10;
|
||||
} else if (card.getSubtype().contains("Equipment")) {
|
||||
} else if (card.getSubtype(null).contains("Equipment")) {
|
||||
type = 8;
|
||||
} else if (card.getSubtype().contains("Aura")) {
|
||||
} else if (card.getSubtype(null).contains("Aura")) {
|
||||
type = 5;
|
||||
} else if (card.getCardType().contains(CardType.INSTANT)) {
|
||||
type = 7;
|
||||
|
|
@ -78,7 +78,7 @@ public class RateCard {
|
|||
}
|
||||
|
||||
private static int isRemoval(Card card) {
|
||||
if (card.getSubtype().contains("Aura") || card.getCardType().contains(CardType.INSTANT)
|
||||
if (card.getSubtype(null).contains("Aura") || card.getCardType().contains(CardType.INSTANT)
|
||||
|| card.getCardType().contains(CardType.SORCERY)) {
|
||||
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue