mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[OTC] Implement Savvy Trader
This commit is contained in:
parent
7a54359d28
commit
9da91b51ea
5 changed files with 201 additions and 23 deletions
|
|
@ -0,0 +1,23 @@
|
|||
package mage.filter.predicate.other;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
public enum SpellCastFromAnywhereOtherThanHand implements ObjectSourcePlayerPredicate<Card> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
|
||||
if (input.getObject() instanceof Spell) {
|
||||
return !input.getObject().isOwnedBy(input.getPlayerId())
|
||||
|| !Zone.HAND.match(((Spell) input.getObject()).getFromZone());
|
||||
} else {
|
||||
return !input.getObject().isOwnedBy(input.getPlayerId())
|
||||
|| !Zone.HAND.match(game.getState().getZone(input.getObject().getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue