mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Modular Targeting now should happen as the Modular creature goes to the grave instead of on Resolution. This fixes the Input issue that was occurring due to the Phase changes.
This commit is contained in:
@@ -5254,6 +5254,7 @@ public class CardFactory implements NewConstants {
|
|||||||
card.addCounter(Counters.P1P1, m);
|
card.addCounter(Counters.P1P1, m);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final SpellAbility ability = new Ability(card, "0") {
|
final SpellAbility ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
@@ -5266,32 +5267,8 @@ public class CardFactory implements NewConstants {
|
|||||||
if(choices.size() != 0) CardFactoryUtil.AI_getBestCreature(choices).addCounter(
|
if(choices.size() != 0) CardFactoryUtil.AI_getBestCreature(choices).addCounter(
|
||||||
Counters.P1P1, getSourceCard().getCounters(Counters.P1P1));
|
Counters.P1P1, getSourceCard().getCounters(Counters.P1P1));
|
||||||
} else {
|
} else {
|
||||||
final SpellAbility ability = this;
|
Card card2 = this.getTargetCard();
|
||||||
AllZone.InputControl.setInput(new Input() {
|
card2.addCounter(Counters.P1P1, getSourceCard().getCounters(Counters.P1P1));
|
||||||
|
|
||||||
private static final long serialVersionUID = 2322926875771867901L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showMessage() {
|
|
||||||
AllZone.Display.showMessage("Select target artifact creature");
|
|
||||||
ButtonUtil.enableOnlyCancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void selectButtonCancel() {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void selectCard(Card card2, PlayerZone zone) {
|
|
||||||
if(card2.isCreature() && card2.isArtifact() && zone.is(Constant.Zone.Play)
|
|
||||||
&& CardFactoryUtil.canTarget(ability, card)) {
|
|
||||||
card2.addCounter(Counters.P1P1, ability.getSourceCard().getCounters(
|
|
||||||
Counters.P1P1));//combining input and resolve is skirting rules and hacky at best, but non-stackability of destroyCommand Inputs turns into a major problem when the keyword is mainly used during the simultaneous destruction of combat.
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}//else
|
}//else
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};
|
};
|
||||||
@@ -5302,7 +5279,8 @@ public class CardFactory implements NewConstants {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
ability.setStackDescription("Put " + card.getCounters(Counters.P1P1)
|
ability.setStackDescription("Put " + card.getCounters(Counters.P1P1)
|
||||||
+ " +1/+1 counter/s from " + card + " on target artifact creature.");
|
+ " +1/+1 counter/s from " + card + " on target artifact creature.");
|
||||||
AllZone.Stack.push(ability);
|
// Target as Modular is Destroyed
|
||||||
|
AllZone.InputControl.setInput(CardFactoryUtil.modularInput(ability, card));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2890,6 +2890,35 @@ public class CardFactoryUtil {
|
|||||||
return target;
|
return target;
|
||||||
}//spReturnTgt_input_targetCards_InGraveyard()
|
}//spReturnTgt_input_targetCards_InGraveyard()
|
||||||
|
|
||||||
|
public static Input modularInput(final SpellAbility ability, final Card card){
|
||||||
|
Input modularInput = new Input() {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2322926875771867901L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showMessage() {
|
||||||
|
AllZone.Display.showMessage("Select target artifact creature");
|
||||||
|
ButtonUtil.enableOnlyCancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectButtonCancel() {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectCard(Card card2, PlayerZone zone) {
|
||||||
|
if(card2.isCreature() && card2.isArtifact() && zone.is(Constant.Zone.Play)
|
||||||
|
&& CardFactoryUtil.canTarget(ability, card)) {
|
||||||
|
ability.setTargetCard(card2);
|
||||||
|
AllZone.Stack.add(ability);
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return modularInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static CardList AI_getHumanCreature(final Card spell, boolean targeted) {
|
public static CardList AI_getHumanCreature(final Card spell, boolean targeted) {
|
||||||
CardList creature = new CardList(AllZone.Human_Play.getCards());
|
CardList creature = new CardList(AllZone.Human_Play.getCards());
|
||||||
|
|||||||
Reference in New Issue
Block a user