mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
* Gather the Pack - Fixed that the cards were not revealed.
This commit is contained in:
parent
6cac559fcf
commit
14d79588e6
1 changed files with 4 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
||||||
package mage.sets.magicorigins;
|
package mage.sets.magicorigins;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.SpellMasteryCondition;
|
import mage.abilities.condition.common.SpellMasteryCondition;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -83,12 +84,14 @@ class GatherThePackEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller == null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
|
if (controller == null || sourceObject == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl(Zone.LIBRARY);
|
Cards cards = new CardsImpl(Zone.LIBRARY);
|
||||||
cards.addAll(controller.getLibrary().getTopCards(game, 5));
|
cards.addAll(controller.getLibrary().getTopCards(game, 5));
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
|
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||||
int creatures = cards.count(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game);
|
int creatures = cards.count(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game);
|
||||||
if (creatures > 0) {
|
if (creatures > 0) {
|
||||||
int max = 1;
|
int max = 1;
|
||||||
|
|
Loading…
Reference in a new issue