mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08:00
* Fixed a problem that Emblems created by permanents where its owner left the game caused errors in clients. Some handling cganges of emblems.
This commit is contained in:
parent
81caed134f
commit
8075ea2e50
56 changed files with 894 additions and 850 deletions
|
|
@ -36,7 +36,6 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameState;
|
||||
|
|
@ -112,19 +111,13 @@ public class CardsView extends LinkedHashMap<UUID, CardView> {
|
|||
case COMMAND:
|
||||
sourceObject = game.getObject(ability.getSourceId());
|
||||
if (sourceObject instanceof Emblem) {
|
||||
Card planeswalkerCard = game.getCard(((Emblem) sourceObject).getSourceId());
|
||||
if (planeswalkerCard != null) {
|
||||
if (!planeswalkerCard.getCardType().contains(CardType.PLANESWALKER)) {
|
||||
if (planeswalkerCard.getSecondCardFace() != null) {
|
||||
planeswalkerCard = planeswalkerCard.getSecondCardFace();
|
||||
}
|
||||
}
|
||||
abilityView = new AbilityView(ability, "Emblem " + planeswalkerCard.getName(), new CardView(new EmblemView((Emblem) sourceObject, planeswalkerCard)));
|
||||
abilityView.setName("Emblem " + planeswalkerCard.getName());
|
||||
abilityView.setExpansionSetCode(planeswalkerCard.getExpansionSetCode());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Source card for emblem not found.");
|
||||
}
|
||||
// Card sourceCard = (Card) ((Emblem) sourceObject).getSourceObject();
|
||||
// if (sourceCard == null) {
|
||||
// throw new IllegalArgumentException("Source card for emblem not found.");
|
||||
// }
|
||||
abilityView = new AbilityView(ability, sourceObject.getName(), new CardView(new EmblemView((Emblem) sourceObject)));
|
||||
abilityView.setName(((Emblem) sourceObject).getName());
|
||||
// abilityView.setExpansionSetCode(sourceCard.getExpansionSetCode());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class EmblemView implements CommandObjectView, Serializable {
|
|||
} else {
|
||||
expansionSetCode = emblem.getExpansionSetCodeForImage();
|
||||
}
|
||||
|
||||
|
||||
rules = emblem.getAbilities().getRules(sourceCard.getName());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import java.util.UUID;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.constants.Zone;
|
||||
|
|
@ -127,20 +126,10 @@ public class GameView implements Serializable {
|
|||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, token.getName(), new CardView(token)));
|
||||
checkPaid(stackObject.getId(), (StackAbility) stackObject);
|
||||
} else if (object instanceof Emblem) {
|
||||
Card sourceCard = game.getCard(((Emblem) object).getSourceId());
|
||||
CardView cardView;
|
||||
if (sourceCard != null) {
|
||||
if (!sourceCard.getCardType().contains(CardType.PLANESWALKER)) {
|
||||
if (sourceCard.getSecondCardFace() != null) {
|
||||
sourceCard = sourceCard.getSecondCardFace();
|
||||
}
|
||||
}
|
||||
((StackAbility) stackObject).setName("Emblem " + sourceCard.getName());
|
||||
((StackAbility) stackObject).setExpansionSetCode(sourceCard.getExpansionSetCode());
|
||||
cardView = new CardView(new EmblemView(((Emblem) object), sourceCard));
|
||||
} else {
|
||||
cardView = new CardView(new EmblemView((Emblem) object));
|
||||
}
|
||||
CardView cardView = new CardView(new EmblemView((Emblem) object));
|
||||
// Card sourceCard = (Card) ((Emblem) object).getSourceObject();
|
||||
((StackAbility) stackObject).setName(((Emblem) object).getName());
|
||||
// ((StackAbility) stackObject).setExpansionSetCode(sourceCard.getExpansionSetCode());
|
||||
stack.put(stackObject.getId(),
|
||||
new StackAbilityView(game, (StackAbility) stackObject, object.getName(), cardView));
|
||||
checkPaid(stackObject.getId(), ((StackAbility) stackObject));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.counters.Counters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -139,17 +138,7 @@ public class PlayerView implements Serializable {
|
|||
if (commandObject instanceof Emblem) {
|
||||
Emblem emblem = (Emblem) commandObject;
|
||||
if (emblem.getControllerId().equals(this.playerId)) {
|
||||
Card sourceCard = game.getCard(((CommandObject) emblem).getSourceId());
|
||||
if (sourceCard != null) {
|
||||
if (!sourceCard.getCardType().contains(CardType.PLANESWALKER)) {
|
||||
if (sourceCard.getSecondCardFace() != null) {
|
||||
sourceCard = sourceCard.getSecondCardFace();
|
||||
}
|
||||
}
|
||||
commandList.add(new EmblemView(emblem, sourceCard));
|
||||
} else {
|
||||
commandList.add(new EmblemView(emblem));
|
||||
}
|
||||
commandList.add(new EmblemView(emblem));
|
||||
}
|
||||
} else if (commandObject instanceof Commander) {
|
||||
Commander commander = (Commander) commandObject;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue