mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Last input converted
This commit is contained in:
@@ -46,6 +46,7 @@ import forge.card.spellability.Target;
|
||||
import forge.card.trigger.Trigger;
|
||||
import forge.card.trigger.TriggerHandler;
|
||||
import forge.control.input.InputSelectCards;
|
||||
import forge.control.input.InputSelectCardsFromList;
|
||||
import forge.game.ai.ComputerUtilCard;
|
||||
import forge.game.ai.ComputerUtilCombat;
|
||||
import forge.game.event.TokenCreatedEvent;
|
||||
@@ -206,11 +207,7 @@ public class CardFactoryCreatures {
|
||||
|
||||
final Card target = this.getTargetCard();
|
||||
|
||||
if (wolves.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(target.canBeTargetedBy(this) && target.isInPlay())) {
|
||||
if (wolves.isEmpty() || !target.canBeTargetedBy(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,17 +217,12 @@ public class CardFactoryCreatures {
|
||||
}
|
||||
|
||||
if (target.getController().isHuman()) { // Human choose spread damage
|
||||
for (int x = 0; x < target.getNetAttack(); x++) {
|
||||
Singletons.getModel().getMatch().getInput().setInput(
|
||||
CardFactoryUtil.masterOfTheWildHuntInputTargetCreature(this, wolves, new Command() {
|
||||
private static final long serialVersionUID = -328305150127775L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
getTargetCard().addDamage(1, target);
|
||||
Singletons.getModel().getGame().getAction().checkStateEffects();
|
||||
}
|
||||
}));
|
||||
final int netAttack = target.getNetAttack();
|
||||
for (int x = 0; x < netAttack; x++) {
|
||||
InputSelectCards inp = new InputSelectCardsFromList(1,1,wolves);
|
||||
inp.setMessage("Select target wolf to damage for " + getSourceCard());
|
||||
FThreads.setInputAndWait(inp);
|
||||
inp.getSelected().get(0).addDamage(1, target);
|
||||
}
|
||||
} else { // AI Choose spread Damage
|
||||
final List<Card> damageableWolves = CardLists.filter(wolves, new Predicate<Card>() {
|
||||
@@ -292,6 +284,7 @@ public class CardFactoryCreatures {
|
||||
}
|
||||
}
|
||||
}
|
||||
target.getController().getGame().getAction().checkStateEffects();
|
||||
} // resolve()
|
||||
|
||||
@Override
|
||||
|
||||
@@ -509,52 +509,6 @@ public class CardFactoryUtil {
|
||||
return entersBattleFieldWithCounters(sourceCard, CounterType.TIME, power);
|
||||
} // vanishing
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* masterOfTheWildHuntInputTargetCreature.
|
||||
* </p>
|
||||
*
|
||||
* @param spell
|
||||
* a {@link forge.card.spellability.SpellAbility} object.
|
||||
* @param choices
|
||||
* a {@link forge.CardList} object.
|
||||
* @param paid
|
||||
* a {@link forge.Command} object.
|
||||
* @return a {@link forge.control.input.InputBase} object.
|
||||
*/
|
||||
public static InputBase masterOfTheWildHuntInputTargetCreature(final SpellAbility spell, final List<Card> choices,
|
||||
final Command paid) {
|
||||
final InputBase target = new InputBase() {
|
||||
private static final long serialVersionUID = -1779224307654698954L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Select target wolf to damage for ").append(spell.getSourceCard());
|
||||
CMatchUI.SINGLETON_INSTANCE.showMessage(sb.toString());
|
||||
ButtonUtil.enableOnlyCancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectButtonCancel() {
|
||||
this.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectCard(final Card card) {
|
||||
if (choices.size() == 0) {
|
||||
this.stop();
|
||||
}
|
||||
if (choices.contains(card)) {
|
||||
spell.setTargetCard(card);
|
||||
paid.execute();
|
||||
this.stop();
|
||||
}
|
||||
} // selectCard()
|
||||
};
|
||||
return target;
|
||||
} // masterOfTheWildHuntInputTargetCreature()
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getNumberOfManaSymbolsControlledByColor.
|
||||
|
||||
@@ -38,7 +38,6 @@ public class HumanPlayer extends Player {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void discardUnless(final int num, final String uType, final SpellAbility sa) {
|
||||
final SpellAbility sp = sa;
|
||||
final List<Card> hand = getCardsIn(ZoneType.Hand);
|
||||
final InputSelectCards target = new InputSelectCardsFromList(num, num, hand) {
|
||||
private static final long serialVersionUID = -5774108410928795591L;
|
||||
@@ -55,7 +54,7 @@ public class HumanPlayer extends Player {
|
||||
target.setMessage("Select %d cards to discard, unless you discard a " + uType + ".");
|
||||
FThreads.setInputAndWait(target);
|
||||
for(Card c : target.getSelected())
|
||||
c.getController().discard(c, sp);
|
||||
c.getController().discard(c, sa);
|
||||
} // input_discardNumUnless
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user