images: fixed wrong miss image message in card hints for dungeons and other command objects (part of #12274);

This commit is contained in:
Oleg Agafonov 2024-09-20 17:23:14 +04:00
parent ff02322e0b
commit e1ab0be505
3 changed files with 3 additions and 9 deletions

View file

@ -32,7 +32,7 @@ public class StackAbilityView extends CardView {
public StackAbilityView(Game game, StackAbility ability, String sourceName, MageObject sourceObject, CardView sourceView) { public StackAbilityView(Game game, StackAbility ability, String sourceName, MageObject sourceObject, CardView sourceView) {
this.id = ability.getId(); this.id = ability.getId();
this.mageObjectType = MageObjectType.ABILITY_STACK; this.mageObjectType = sourceView.getMageObjectType().isUseTokensRepository() ? MageObjectType.ABILITY_STACK_FROM_TOKEN : MageObjectType.ABILITY_STACK_FROM_CARD;
this.abilityType = ability.getStackAbility().getAbilityType(); this.abilityType = ability.getStackAbility().getAbilityType();
this.sourceCard = sourceView; this.sourceCard = sourceView;
this.sourceCard.setMageObjectType(mageObjectType); this.sourceCard.setMageObjectType(mageObjectType);

View file

@ -1126,17 +1126,10 @@ public class TestPlayer implements Player {
private Permanent findPermanentWithAssert(PlayerAction action, Game game, Player player, String cardName) { private Permanent findPermanentWithAssert(PlayerAction action, Game game, Player player, String cardName) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(player.getId())) { for (Permanent perm : game.getBattlefield().getAllActivePermanents(player.getId())) {
// need by controller
if (!perm.getControllerId().equals(player.getId())) {
continue;
}
// need by alias or by name // need by alias or by name
if (!hasObjectTargetNameOrAlias(perm, cardName)) { if (!hasObjectTargetNameOrAlias(perm, cardName)) {
continue; continue;
} }
// all fine
return perm; return perm;
} }
printStart(game, "Permanents of " + player.getName()); printStart(game, "Permanents of " + player.getName());

View file

@ -43,7 +43,8 @@ package mage.constants;
* @author LevelX2 * @author LevelX2
*/ */
public enum MageObjectType { public enum MageObjectType {
ABILITY_STACK("Ability on the Stack", false, false, false), ABILITY_STACK_FROM_CARD("Ability on the Stack", false, false, false),
ABILITY_STACK_FROM_TOKEN("Ability on the Stack", false, false, true),
CARD("Card", false, true, false), CARD("Card", false, true, false),
COPY_CARD("Copy of a Card", false, true, false), COPY_CARD("Copy of a Card", false, true, false),
TOKEN("Token", true, true, true), TOKEN("Token", true, true, true),