mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
Added Sen Triplets (Alara Reborn = 100%).
This commit is contained in:
parent
5b02b5b32c
commit
2547753dcb
40 changed files with 249 additions and 51 deletions
|
|
@ -30,9 +30,9 @@ package mage.abilities;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -52,7 +52,8 @@ public class PlayLandAbility extends ActivatedAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
if (!controlsAbility(playerId, game)) {
|
||||
if (!controlsAbility(playerId, game) &&
|
||||
!game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game)) {
|
||||
return false;
|
||||
}
|
||||
//20091005 - 114.2a
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ public class SpellAbility extends ActivatedAbilityImpl {
|
|||
return false;
|
||||
}
|
||||
// fix for Gitaxian Probe and casting opponent's spells
|
||||
if (!controllerId.equals(playerId)) {
|
||||
if (!game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game)
|
||||
&& !controllerId.equals(playerId)) {
|
||||
return false;
|
||||
}
|
||||
// Check if spell has no costs (not {0} mana costs), than it's not castable. E.g. for spells like Living End, that only can be cast by Suspend Ability.
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
|
|||
}
|
||||
|
||||
public PlayTheTopCardEffect(FilterCard filter) {
|
||||
super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
this.filter = filter;
|
||||
staticText = "You may play the top card of your library if it's a " + filter.getMessage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public enum AsThoughEffectType {
|
|||
BLOCK_SHADOW,
|
||||
BLOCK_DRAGON,
|
||||
BE_BLOCKED,
|
||||
PLAY_FROM_NON_HAND_ZONE,
|
||||
PLAY_FROM_NOT_OWN_HAND_ZONE,
|
||||
CAST_AS_INSTANT,
|
||||
ACTIVATE_AS_INSTANT,
|
||||
DAMAGE,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ public class Revealed extends HashMap<String, Cards> implements Serializable, Co
|
|||
this.get(name).add(card);
|
||||
}
|
||||
|
||||
public void update(String name, Cards cards) {
|
||||
this.put(name, cards.copy());
|
||||
}
|
||||
|
||||
public void add(String name, Cards cards) {
|
||||
if (this.containsKey(name)) {
|
||||
this.get(name).addAll(cards);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import java.util.Map.Entry;
|
|||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Abilities;
|
||||
|
|
@ -130,7 +129,6 @@ import mage.target.common.TargetCardInLibrary;
|
|||
import mage.target.common.TargetDiscard;
|
||||
import mage.util.CardUtil;
|
||||
import mage.util.GameLog;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public abstract class PlayerImpl implements Player, Serializable {
|
||||
|
|
@ -1097,10 +1095,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return true;
|
||||
}
|
||||
if (ability instanceof PlayLandAbility) {
|
||||
Card card = hand.get(ability.getSourceId(), game);
|
||||
if (card == null) {
|
||||
card = game.getCard(ability.getSourceId());
|
||||
}
|
||||
|
||||
|
||||
Card card = game.getCard(ability.getSourceId());
|
||||
result = playLand(card, game);
|
||||
} else {
|
||||
if (!ability.canActivate(this.playerId, game)) {
|
||||
|
|
@ -1214,7 +1211,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) {
|
||||
if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) {
|
||||
for (Ability ability : object.getAbilities()) {
|
||||
ability.setControllerId(this.getId());
|
||||
if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND)
|
||||
|
|
@ -1317,7 +1314,11 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
|
||||
@Override
|
||||
public void revealCards(String name, Cards cards, Game game, boolean postToLog) {
|
||||
game.getState().getRevealed().add(name, cards);
|
||||
if (postToLog) {
|
||||
game.getState().getRevealed().add(name, cards);
|
||||
} else {
|
||||
game.getState().getRevealed().update(name, cards);
|
||||
}
|
||||
if (postToLog && !game.isSimulation()) {
|
||||
StringBuilder sb = new StringBuilder(getLogName()).append(" reveals ");
|
||||
int current = 0, last = cards.size();
|
||||
|
|
@ -2409,7 +2410,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
for (Card card : graveyard.getUniqueCards(game)) {
|
||||
boolean asThoughtCast = game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game);
|
||||
boolean asThoughtCast = game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game);
|
||||
for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.ALL)) {
|
||||
boolean possible = false;
|
||||
if (ability.getZone().match(Zone.GRAVEYARD)) {
|
||||
|
|
@ -2431,7 +2432,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
for (ExileZone exile : game.getExile().getExileZones()) {
|
||||
for (Card card : exile.getCards(game)) {
|
||||
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) {
|
||||
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability.getZone().match(Zone.HAND)) {
|
||||
ability.setControllerId(this.getId()); // controller must be set for case owner != caster
|
||||
|
|
@ -2447,7 +2448,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
for (Cards cards : game.getState().getRevealed().values()) {
|
||||
for (Card card : cards.getCards(game)) {
|
||||
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) {
|
||||
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) {
|
||||
for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) {
|
||||
if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) {
|
||||
playable.add(ability);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue