forked from External/mage
GUI: introduced default card hints:
* refactor: added helper emblems instead rad counter's inherent emblems (use initGameDefaultHelperEmblems to define new card hints or other fake objects); * refactor: added card hints support for emblems, planes and other command objects; * GUI: added storm counter as default card hint (use hints tool to see it, closes #12360);
This commit is contained in:
parent
83823acec7
commit
521a0f6e32
36 changed files with 234 additions and 144 deletions
|
|
@ -0,0 +1,52 @@
|
|||
package mage.game.command.emblems;
|
||||
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.cards.repository.TokenInfo;
|
||||
import mage.cards.repository.TokenRepository;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.command.Emblem;
|
||||
|
||||
/**
|
||||
* GUI: inner xmage emblem to show additional info for players like global hints
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class XmageHelperEmblem extends Emblem {
|
||||
|
||||
public XmageHelperEmblem() {
|
||||
super("Helper Emblem");
|
||||
this.frameStyle = FrameStyle.M15_NORMAL;
|
||||
|
||||
TokenInfo foundInfo = TokenRepository.instance.findPreferredTokenInfoForXmage(TokenRepository.XMAGE_IMAGE_NAME_HELPER_EMBLEM, null);
|
||||
if (foundInfo != null) {
|
||||
this.setExpansionSetCode(foundInfo.getSetCode());
|
||||
this.setUsesVariousArt(false);
|
||||
this.setCardNumber("");
|
||||
this.setImageFileName(""); // use default
|
||||
this.setImageNumber(foundInfo.getImageNumber());
|
||||
} else {
|
||||
// how-to fix: add emblem to the tokens-database TokenRepository->loadXmageTokens
|
||||
throw new IllegalArgumentException("Wrong code usage: can't find xmage token info for: " + TokenRepository.XMAGE_IMAGE_NAME_HELPER_EMBLEM);
|
||||
}
|
||||
}
|
||||
|
||||
private XmageHelperEmblem(final XmageHelperEmblem card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XmageHelperEmblem copy() {
|
||||
return new XmageHelperEmblem(this);
|
||||
}
|
||||
|
||||
public XmageHelperEmblem withCardHint(String name, Hint hint) {
|
||||
this.getAbilities().add(new SimpleStaticAbility(
|
||||
Zone.ALL,
|
||||
new InfoEffect(name)).addHint(hint)
|
||||
);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue