forked from External/mage
* Some minor changes.
This commit is contained in:
parent
47ca2bdc65
commit
2544c12d48
6 changed files with 23 additions and 14 deletions
|
|
@ -940,7 +940,8 @@ public class GameController implements GameCallback {
|
|||
private void sendMessage(UUID userId, Command command) {
|
||||
final UUID playerId = userPlayerMap.get(userId);
|
||||
// player has game under control (is not cotrolled by other player)
|
||||
if (game.getPlayer(playerId).isGameUnderControl()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null && player.isGameUnderControl()) {
|
||||
// if it's your priority (or game not started yet in which case it will be null)
|
||||
// then execute only your action
|
||||
if (game.getPriorityPlayerId() == null || game.getPriorityPlayerId().equals(playerId)) {
|
||||
|
|
@ -950,15 +951,12 @@ public class GameController implements GameCallback {
|
|||
}
|
||||
} else {
|
||||
// otherwise execute the action under other player's control
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (UUID controlled : player.getPlayersUnderYourControl()) {
|
||||
if (gameSessions.containsKey(controlled) && game.getPriorityPlayerId().equals(controlled)) {
|
||||
cancelTimeout();
|
||||
command.execute(controlled);
|
||||
}
|
||||
}
|
||||
}
|
||||
// else player has no priority to do something, so ignore the command
|
||||
// e.g. you click at one of your cards, but you can't play something at that moment
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility {
|
|||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getSourceId() != null && event.getSourceId().equals(getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.EXILED) {
|
||||
if (zEvent.getTarget() != null && zEvent.getTarget().getSubtype().contains("Faerie")) {
|
||||
if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ public class GloriousAnthem extends CardImpl {
|
|||
super(ownerId, 17, "Glorious Anthem", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}");
|
||||
this.expansionSetCode = "10E";
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
@ -149,12 +150,13 @@ class GoblinGuideEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player defender = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (defender != null) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && defender != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = defender.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
defender.revealCards("Goblin Guide", cards, game);
|
||||
defender.revealCards(sourceObject.getLogName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
defender.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,17 @@ public class MomentousFallTest extends CardTestPlayerBase {
|
|||
public void testSacrificeCostAndLKI() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
addCard(Zone.HAND, playerA, "Momentous Fall");
|
||||
|
||||
// Geralf's Messenger enters the battlefield tapped.
|
||||
// When Geralf's Messenger enters the battlefield, target opponent loses 2 life.
|
||||
// Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Geralf's Messenger", 1);
|
||||
|
||||
// Creatures you control get +1/+1.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Glorious Anthem", 1);
|
||||
|
||||
// As an additional cost to cast Momentous Fall, sacrifice a creature.
|
||||
// You draw cards equal to the sacrificed creature's power, then you gain life equal to its toughness.
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Momentous Fall");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue