mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
* Some minor changes.
This commit is contained in:
parent
3a8afb9418
commit
8228cee30c
4 changed files with 73 additions and 22 deletions
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
@ -37,7 +36,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -50,7 +49,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
|
|||
public class Curfew extends CardImpl {
|
||||
|
||||
public Curfew(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
|
||||
// Each player returns a creature he or she controls to its owner's hand.
|
||||
this.getSpellAbility().addEffect(new CurfewEffect());
|
||||
|
|
@ -66,7 +65,7 @@ public class Curfew extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class CurfewEffect extends OneShotEffect{
|
||||
class CurfewEffect extends OneShotEffect {
|
||||
|
||||
public CurfewEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
|
|
@ -78,27 +77,20 @@ class CurfewEffect extends OneShotEffect{
|
|||
game.informPlayers("Each player returns a creature he or she controls to its owner's hand");
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, filter, true);
|
||||
List<Permanent> liste = game.getBattlefield().getActivePermanents(filter, playerId, game);
|
||||
if(!liste.isEmpty()){
|
||||
player.choose(Outcome.ReturnToHand, target, source.getSourceId(), game);
|
||||
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
}
|
||||
if (player != null && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game) > 0) {
|
||||
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_CREATURE, true);
|
||||
player.choose(Outcome.ReturnToHand, target, source.getSourceId(), game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
player.moveCards(permanent, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Effect copy() {
|
||||
return new CurfewEffect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue