mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Merge pull request #1988 from spjspj/master
spjspj - Clean up code for Eye of the Storm (RAV) - aka EotS should
This commit is contained in:
commit
a1f9a5745c
1 changed files with 10 additions and 8 deletions
|
|
@ -103,7 +103,7 @@ class EyeOfTheStormAbility extends TriggeredAbilityImpl {
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getZone() == Zone.HAND) {
|
if (event.getZone() == Zone.HAND) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
if (spell != null) {
|
if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
|
||||||
for (Effect effect : this.getEffects()) {
|
for (Effect effect : this.getEffects()) {
|
||||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||||
}
|
}
|
||||||
|
|
@ -152,12 +152,13 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
|
||||||
if (controller.moveCardsToExile(spell, source, game, true, exileZoneId, EyeOfTheStorm.getIdName())) {
|
if (controller.moveCardsToExile(spell, source, game, true, exileZoneId, EyeOfTheStorm.getIdName())) {
|
||||||
EyeOfTheStorm.imprint(card.getId(), game);
|
EyeOfTheStorm.imprint(card.getId(), game);
|
||||||
|
|
||||||
Player player = game.getPlayer(spell.getControllerId());
|
|
||||||
|
|
||||||
if (EyeOfTheStorm != null && EyeOfTheStorm.getImprinted() != null && EyeOfTheStorm.getImprinted().size() > 0 && controller != null) {
|
if (EyeOfTheStorm != null && EyeOfTheStorm.getImprinted() != null && EyeOfTheStorm.getImprinted().size() > 0 && controller != null) {
|
||||||
CardsImpl copiedCards = new CardsImpl();
|
CardsImpl copiedCards = new CardsImpl();
|
||||||
for (UUID uuid : EyeOfTheStorm.getImprinted()) {
|
for (UUID uuid : EyeOfTheStorm.getImprinted()) {
|
||||||
card = game.getCard(uuid);
|
card = game.getCard(uuid);
|
||||||
|
|
||||||
|
// Check if owner of card is still in game
|
||||||
|
if (game.getPlayer(card.getOwnerId()) != null) {
|
||||||
if (card.isSplitCard()) {
|
if (card.isSplitCard()) {
|
||||||
copiedCards.add(((SplitCard) card).getLeftHalfCard());
|
copiedCards.add(((SplitCard) card).getLeftHalfCard());
|
||||||
copiedCards.add(((SplitCard) card).getRightHalfCard());
|
copiedCards.add(((SplitCard) card).getRightHalfCard());
|
||||||
|
|
@ -165,6 +166,7 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
|
||||||
copiedCards.add(card);
|
copiedCards.add(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean continueCasting = true;
|
boolean continueCasting = true;
|
||||||
while (continueCasting) {
|
while (continueCasting) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue