forked from External/mage
[AFR] added card icons with class level info (#7808)
This commit is contained in:
parent
20245f32f6
commit
2d8be6663b
8 changed files with 67 additions and 3 deletions
|
|
@ -2,7 +2,15 @@ package mage.abilities.keyword;
|
|||
|
||||
import mage.abilities.StaticAbility;
|
||||
import mage.abilities.hint.common.ClassLevelHint;
|
||||
import mage.abilities.icon.CardIcon;
|
||||
import mage.abilities.icon.CardIconImpl;
|
||||
import mage.abilities.icon.CardIconType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -27,4 +35,27 @@ public class ClassReminderAbility extends StaticAbility {
|
|||
public String getRule() {
|
||||
return "<i>(Gain the next level as a sorcery to add its ability.)</i>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardIcon> getIcons(Game game) {
|
||||
if (game == null) {
|
||||
return this.icons;
|
||||
}
|
||||
|
||||
// dynamic GUI icon with current level
|
||||
List<CardIcon> res = new ArrayList<>();
|
||||
Permanent permanent = this.getSourcePermanentOrLKI(game);
|
||||
if (permanent == null) {
|
||||
return res;
|
||||
}
|
||||
|
||||
CardIcon levelIcon = new CardIconImpl(
|
||||
CardIconType.ABILITY_CLASS_LEVEL,
|
||||
"Current class level: " + permanent.getClassLevel(),
|
||||
String.valueOf(permanent.getClassLevel())
|
||||
);
|
||||
res.add(levelIcon);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue