Add additional ability icons (#10549)

* Slightly revamped basic card icons

All icon classes which were just static text have been removed, and instead replaced with a static instance.

A new icon for reach has been added

Some icons have been reused for new abilities (hexproof for shroud and ward, infect for toxic)

When a card would have two icons of the same type, the icons are instead combines into one with a combined hover tooltip.

* Fixed missing capitalization on ward, hexproof
This commit is contained in:
Alexander Novotny 2023-07-03 14:22:07 -07:00 committed by GitHub
parent 9e63858db6
commit fae63d9d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 167 additions and 522 deletions

View file

@ -11,9 +11,7 @@ import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.abilities.icon.CardIcon;
import mage.abilities.icon.other.CommanderCardIcon;
import mage.abilities.icon.other.FaceDownCardIcon;
import mage.abilities.icon.other.VariableCostCardIcon;
import mage.abilities.icon.CardIconImpl;
import mage.abilities.keyword.AftermathAbility;
import mage.cards.*;
import mage.cards.mock.MockCard;
@ -435,13 +433,13 @@ public class CardView extends SimpleCardView {
});
// face down
if (permanent.isFaceDown(game)) {
this.cardIcons.add(FaceDownCardIcon.instance);
this.cardIcons.add(CardIconImpl.FACE_DOWN);
}
// commander
if (game != null) {
Player owner = game.getPlayer(game.getOwnerId(permanent));
if (owner != null && game.isCommanderObject(owner, permanent)) {
this.cardIcons.add(CommanderCardIcon.instance);
this.cardIcons.add(CardIconImpl.COMMANDER);
}
}
} else {
@ -475,7 +473,7 @@ public class CardView extends SimpleCardView {
// other like Stack (can show x icon on stack only, so use normal source)
costX = ManacostVariableValue.REGULAR.calculate(game, card.getSpellAbility(), null);
}
this.cardIcons.add(new VariableCostCardIcon(costX));
this.cardIcons.add(CardIconImpl.variableCost(costX));
}
}

View file

@ -7,7 +7,7 @@ import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.HintUtils;
import mage.abilities.icon.other.VariableCostCardIcon;
import mage.abilities.icon.CardIconImpl;
import mage.cards.Card;
import mage.constants.AbilityType;
import mage.constants.CardType;
@ -83,7 +83,7 @@ public class StackAbilityView extends CardView {
// cost x
if (ability.getManaCostsToPay().containsX()) {
int costX = ManacostVariableValue.END_GAME.calculate(game, ability, null);
this.cardIcons.add(new VariableCostCardIcon(costX));
this.cardIcons.add(CardIconImpl.variableCost(costX));
}
}