mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Merge pull request #7103 from magefree/cardfix/ArchonOfValorsReach
Fixed Archon of Valors Reach ContinuousRuleModifyingEffect not working
This commit is contained in:
commit
aba9f6895b
1 changed files with 12 additions and 8 deletions
|
@ -19,11 +19,12 @@ import mage.game.events.GameEvent;
|
|||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
import static mage.game.events.GameEvent.EventType.CAST_SPELL;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ArchonOfValorsReach extends CardImpl {
|
||||
|
||||
public ArchonOfValorsReach(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{W}");
|
||||
|
||||
|
@ -74,26 +75,29 @@ class ArchonOfValorsReachReplacementEffect extends ContinuousRuleModifyingEffect
|
|||
@Override
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
Object savedType = game.getState().getValue(source.getSourceId() + "_type");
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (savedType instanceof String && sourceCard != null) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (savedType instanceof String && card != null) {
|
||||
CardType cardType = CardType.fromString((String) savedType);
|
||||
return "You can't cast " + cardType.toString() + " spells (" + sourceCard.getIdName() + ").";
|
||||
return "You can't cast " + cardType.toString() + " spells (" + card.getIdName() + ").";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CAST_SPELL;
|
||||
return event.getType() == CAST_SPELL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Object savedType = game.getState().getValue(source.getSourceId() + "_type");
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (savedType instanceof String && sourceCard != null) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
|
||||
if (savedType instanceof String && card != null) {
|
||||
CardType cardType = CardType.fromString((String) savedType);
|
||||
return cardType != null && sourceCard != null && sourceCard.getCardType().contains(cardType);
|
||||
if (cardType != null && card != null && card.getCardType().contains(cardType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue