Face down images and cards rework (#11873)

Face down changes:
* GUI: added visible face down type and real card name for controller/owner (opponent can see it after game ends);
* GUI: added day/night button to view real card for controller/owner (opponent can see it after game ends);
* game: fixed that faced-down card can render symbols, abilities and other hidden data from a real card;
* images: added image support for normal faced-down cards;
* images: added image support for morph and megamorph faced-down cards;
* images: added image support for foretell faced-down cards;

Other changes:
* images: fixed missing tokens from DDD set;
* images: no more client restart to apply newly downloaded images or render settings;
* images: improved backface image quality (use main menu -> symbols to download it);
This commit is contained in:
Oleg Agafonov 2024-02-29 01:14:54 +04:00 committed by GitHub
parent 4901de12c1
commit e38a79f231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
104 changed files with 2178 additions and 1495 deletions

View file

@ -89,7 +89,7 @@ public class Spell extends StackObjectImpl implements Card {
}
this.card = affectedCard;
this.manaCost = this.card.getManaCost().copy();
this.manaCost = affectedCard.getManaCost().copy();
this.color = affectedCard.getColor(null).copy();
this.frameColor = affectedCard.getFrameColor(null).copy();
this.frameStyle = affectedCard.getFrameStyle();
@ -100,7 +100,11 @@ public class Spell extends StackObjectImpl implements Card {
this.ability = ability;
this.ability.setControllerId(controllerId);
if (ability.getSpellAbilityCastMode() == SpellAbilityCastMode.MORPH){
if (ability.getSpellAbilityCastMode() == SpellAbilityCastMode.MORPH
|| ability.getSpellAbilityCastMode() == SpellAbilityCastMode.MEGAMORPH){
// TODO: need research:
// - why it use game param for color and subtype (possible bug?)
// - is it possible to use BecomesFaceDownCreatureEffect.makeFaceDownObject or like that?
this.faceDown = true;
this.getColor(game).setColor(null);
game.getState().getCreateMageObjectAttribute(this.getCard(), game).getSubtype().clear();
@ -238,6 +242,16 @@ public class Spell extends StackObjectImpl implements Card {
throw new IllegalStateException("Wrong code usage: you can't change card number for the spell");
}
@Override
public String getImageFileName() {
return card.getImageFileName();
}
@Override
public void setImageFileName(String imageFile) {
throw new IllegalStateException("Wrong code usage: you can't change image file name for the spell");
}
@Override
public Integer getImageNumber() {
return card.getImageNumber();
@ -509,6 +523,11 @@ public class Spell extends StackObjectImpl implements Card {
return this.controllerId;
}
@Override
public UUID getControllerOrOwnerId() {
return getControllerId();
}
@Override
public String getName() {
return card.getName();
@ -546,6 +565,11 @@ public class Spell extends StackObjectImpl implements Card {
return card.getRarity();
}
@Override
public void setRarity(Rarity rarity) {
throw new IllegalArgumentException("Un-supported operation: " + this, new Throwable());
}
@Override
public List<CardType> getCardType(Game game) {
if (faceDown) {
@ -933,6 +957,11 @@ public class Spell extends StackObjectImpl implements Card {
return card.getUsesVariousArt();
}
@Override
public void setUsesVariousArt(boolean usesVariousArt) {
card.setUsesVariousArt(usesVariousArt);
}
@Override
public List<Mana> getMana() {
return card.getMana();
@ -1104,8 +1133,8 @@ public class Spell extends StackObjectImpl implements Card {
}
@Override
public void checkForCountersToAdd(Permanent permanent, Ability source, Game game) {
card.checkForCountersToAdd(permanent, source, game);
public void applyEnterWithCounters(Permanent permanent, Ability source, Game game) {
card.applyEnterWithCounters(permanent, source, game);
}
@Override