forked from External/mage
game: improved cost tags to support card hints on stack (example: evidence, fixes #12522);
This commit is contained in:
parent
74b3d26a41
commit
8a4a23bb8f
4 changed files with 75 additions and 5 deletions
|
|
@ -1732,11 +1732,27 @@ public final class CardUtil {
|
|||
*/
|
||||
public static Map<String, Object> getSourceCostsTagsMap(Game game, Ability source) {
|
||||
Map<String, Object> costTags;
|
||||
|
||||
// from spell ability - direct access
|
||||
costTags = source.getCostsTagMap();
|
||||
if (costTags == null && source.getSourcePermanentOrLKI(game) != null) {
|
||||
costTags = game.getPermanentCostsTags().get(CardUtil.getSourceStackMomentReference(game, source));
|
||||
if (costTags != null) {
|
||||
return costTags;
|
||||
}
|
||||
return costTags;
|
||||
|
||||
// from any ability after resolve - access by permanent
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
if (permanent != null) {
|
||||
costTags = game.getPermanentCostsTags().get(CardUtil.getSourceStackMomentReference(game, source));
|
||||
return costTags;
|
||||
}
|
||||
|
||||
// from any ability before resolve (on stack) - access by spell ability
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject instanceof Spell) {
|
||||
return ((Spell) sourceObject).getSpellAbility().getCostsTagMap();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue