game: improved game logs for faced-down spells and exiled cards - now it support popup hint to view card/permanent (part of #11884, related to #11881, #8781)

This commit is contained in:
Oleg Agafonov 2024-03-01 02:08:25 +04:00
parent 4334ac8987
commit c8a9a1a9db
8 changed files with 77 additions and 26 deletions

View file

@ -6,7 +6,6 @@ import mage.abilities.costs.mana.ActivationManaAbilityStep;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.keyword.BestowAbility;
import mage.abilities.keyword.MorphAbility;
import mage.abilities.keyword.PrototypeAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.*;
@ -83,8 +82,8 @@ public class Spell extends StackObjectImpl implements Card {
// simulate another side as new card (another code part in continues effect from disturb ability)
affectedCard = TransformAbility.transformCardSpellStatic(card, card.getSecondCardFace(), game);
}
if (ability instanceof PrototypeAbility){
affectedCard = ((PrototypeAbility)ability).prototypeCardSpell(card);
if (ability instanceof PrototypeAbility) {
affectedCard = ((PrototypeAbility) ability).prototypeCardSpell(card);
this.prototyped = true;
}
@ -100,7 +99,7 @@ public class Spell extends StackObjectImpl implements Card {
this.ability = ability;
this.ability.setControllerId(controllerId);
if (ability.getSpellAbilityCastMode().isFaceDown()){
if (ability.getSpellAbilityCastMode().isFaceDown()) {
// TODO: need research:
// - why it use game param for color and subtype (possible bug?)
// - is it possible to use BecomesFaceDownCreatureEffect.makeFaceDownObject or like that?
@ -202,8 +201,10 @@ public class Spell extends StackObjectImpl implements Card {
}
public String getSpellCastText(Game game) {
if (this.getSpellAbility() instanceof MorphAbility) {
return "a card face down";
if (this.getSpellAbility().getSpellAbilityCastMode().isFaceDown()) {
// add face down name with object link, so user can look at it from logs
return "a " + GameLog.getColoredObjectIdName(this.getSpellAbility().getCharacteristics(game))
+ " using " + this.getSpellAbility().getSpellAbilityCastMode();
}
if (card instanceof AdventureCardSpell) {
@ -677,7 +678,9 @@ public class Spell extends StackObjectImpl implements Card {
}
@Override
public void setManaCost(ManaCosts<ManaCost> costs) { this.manaCost = costs.copy(); }
public void setManaCost(ManaCosts<ManaCost> costs) {
this.manaCost = costs.copy();
}
/**
* 202.3b When calculating the converted mana cost of an object with an {X}