mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Added Fossil Find and Search for Survivors
This commit is contained in:
@@ -190,6 +190,7 @@ public enum ApiType {
|
||||
RemoveCounter (CountersRemoveEffect.class, CountersRemoveAi.class),
|
||||
RemoveCounterAll (CountersRemoveAllEffect.class, CannotPlayAi.class),
|
||||
RemoveFromCombat (RemoveFromCombatEffect.class, RemoveFromCombatAi.class),
|
||||
ReorderZone (ReorderZoneEffect.class, AlwaysPlayAi.class),
|
||||
Repeat (RepeatEffect.class, RepeatAi.class),
|
||||
RepeatEach (RepeatEachEffect.class, RepeatEachAi.class),
|
||||
RestartGame (RestartGameEffect.class, RestartGameAi.class),
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package forge.card.ability.effects;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.Card;
|
||||
import forge.card.ability.SpellAbilityEffect;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Lang;
|
||||
import forge.util.MyRandom;
|
||||
|
||||
public class ReorderZoneEffect extends SpellAbilityEffect {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility)
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
final ZoneType zone = ZoneType.smartValueOf(sa.getParam("Zone"));
|
||||
final List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||
boolean shuffle = sa.hasParam("Random");
|
||||
|
||||
return "Reorder " + Lang.joinHomogenous(tgtPlayers)+ " " + zone.toString() + " " + (shuffle ? "at random." : "as your choose.");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* reorderZoneResolve.
|
||||
* </p>
|
||||
* @param sa
|
||||
* a {@link forge.card.spellability.SpellAbility} object.
|
||||
* @param af
|
||||
* a {@link forge.card.ability.AbilityFactory} object.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
final ZoneType zone = ZoneType.smartValueOf(sa.getParam("Zone"));
|
||||
boolean shuffle = sa.hasParam("Random");
|
||||
final Target tgt = sa.getTarget();
|
||||
|
||||
|
||||
for (final Player p : getTargetPlayers(sa)) {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
List<Card> list = Lists.newArrayList(p.getCardsIn(zone));
|
||||
if (shuffle) {
|
||||
final Random ran = MyRandom.getRandom();
|
||||
Collections.shuffle(list, ran);
|
||||
p.getZone(zone).setCards(list);
|
||||
} else {
|
||||
p.getController().orderMoveToZoneList(list, zone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class CostPutCardToLib extends CostPartWithList {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new cost exile.
|
||||
* Instantiates a new cost CostPutCardToLib.
|
||||
*
|
||||
* @param amount
|
||||
* the amount
|
||||
@@ -251,7 +251,7 @@ public class CostPutCardToLib extends CostPartWithList {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this method.
|
||||
* PutFromMiscZone
|
||||
* @param sa
|
||||
* @param nNeeded
|
||||
* @param typeList
|
||||
|
||||
@@ -367,7 +367,7 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
} else if (destinationZone == ZoneType.Battlefield) {
|
||||
return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, cards, null, null);
|
||||
} else if (destinationZone == ZoneType.Graveyard) {
|
||||
return GuiChoose.order("Choose order of cards to put into the graveyard", "Closest to top", 0, cards, null, null);
|
||||
return GuiChoose.order("Choose order of cards to put into the graveyard", "Closest to bottom", 0, cards, null, null);
|
||||
}
|
||||
return cards;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user