mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Fixed bugs in spDiscard[Opp].
This commit is contained in:
@@ -534,50 +534,54 @@ public class CardFactory implements NewConstants {
|
|||||||
int numHHand = pzH.size();
|
int numHHand = pzH.size();
|
||||||
|
|
||||||
if (numHHand > (nCards - 1))
|
if (numHHand > (nCards - 1))
|
||||||
|
{
|
||||||
|
if (Tgt)
|
||||||
|
setTargetPlayer(Constant.Player.Human);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void resolve()
|
public void resolve()
|
||||||
{
|
{
|
||||||
int nCards = getNumCards();
|
int nCards = getNumCards();
|
||||||
|
String discardingPlayer = "";
|
||||||
|
|
||||||
if (DiscardMethod.equals("OppChoose"))
|
if (Tgt)
|
||||||
|
discardingPlayer = getTargetPlayer();
|
||||||
|
else if (Opp)
|
||||||
|
discardingPlayer = AllZone.GameAction.getOpponent(card.getController());
|
||||||
|
|
||||||
|
if (DiscardMethod.equals("OppChoose") || DiscardMethod.equals("TgtChoose"))
|
||||||
{
|
{
|
||||||
String opp = AllZone.GameAction.getOpponent(card.getController());
|
//String opp = AllZone.GameAction.getOpponent(card.getController());
|
||||||
|
|
||||||
if (!UnlessType[0].equals("none"))
|
if (!UnlessType[0].equals("none"))
|
||||||
AllZone.GameAction.discardUnless(opp, nCards, UnlessType[0]);
|
AllZone.GameAction.discardUnless(discardingPlayer, nCards, UnlessType[0]);
|
||||||
else
|
else
|
||||||
AllZone.GameAction.discard(opp, nCards);
|
AllZone.GameAction.discard(discardingPlayer, nCards);
|
||||||
}
|
|
||||||
else if (DiscardMethod.equals("TgtChoose"))
|
|
||||||
{
|
|
||||||
if (!UnlessType[0].equals("none"))
|
|
||||||
AllZone.GameAction.discardUnless(getTargetPlayer(), nCards, UnlessType[0]);
|
|
||||||
else
|
|
||||||
AllZone.GameAction.discard(getTargetPlayer(), nCards);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (DiscardMethod.equals("AtRandom"))
|
else if (DiscardMethod.equals("AtRandom"))
|
||||||
{
|
{
|
||||||
AllZone.GameAction.discardRandom(getTargetPlayer(), nCards);
|
AllZone.GameAction.discardRandom(discardingPlayer, nCards);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (DiscardMethod.equals("Hand"))
|
else if (DiscardMethod.equals("Hand"))
|
||||||
{
|
{
|
||||||
AllZone.GameAction.discardHand(getTargetPlayer());
|
AllZone.GameAction.discardHand(discardingPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Drawback[0].equals("none"))
|
if (!Drawback[0].equals("none"))
|
||||||
{
|
{
|
||||||
CardFactoryUtil.doDrawBack(Drawback[0], 0, card.getController(), AllZone.GameAction.getOpponent(card.getController()), card.getController(), card, card);
|
CardFactoryUtil.doDrawBack(Drawback[0], nCards, card.getController(), AllZone.GameAction.getOpponent(card.getController()), discardingPlayer, card, card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Tgt)
|
if (Tgt)
|
||||||
spDiscard.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spDiscard));
|
spDiscard.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spDiscard));
|
||||||
else
|
|
||||||
spDiscard.setTargetPlayer(AllZone.GameAction.getOpponent(card.getController()));
|
|
||||||
|
|
||||||
spDiscard.setDescription(spDesc[0]);
|
spDiscard.setDescription(spDesc[0]);
|
||||||
spDiscard.setStackDescription(stDesc[0]);
|
spDiscard.setStackDescription(stDesc[0]);
|
||||||
@@ -588,17 +592,15 @@ public class CardFactory implements NewConstants {
|
|||||||
String bbCost = card.getSVar("Buyback");
|
String bbCost = card.getSVar("Buyback");
|
||||||
if (!bbCost.equals(""))
|
if (!bbCost.equals(""))
|
||||||
{
|
{
|
||||||
SpellAbility bbDiscardTgt = spDiscard.copy();
|
SpellAbility bbDiscard = spDiscard.copy();
|
||||||
bbDiscardTgt.setManaCost(CardUtil.addManaCosts(card.getManaCost(), bbCost));
|
bbDiscard.setManaCost(CardUtil.addManaCosts(card.getManaCost(), bbCost));
|
||||||
bbDiscardTgt.setDescription("Buyback " + bbCost + "(You may pay an additional " + bbCost + " as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
bbDiscard.setDescription("Buyback " + bbCost + "(You may pay an additional " + bbCost + " as you cast this spell. If you do, put this card into your hand as it resolves.)");
|
||||||
bbDiscardTgt.setIsBuyBackAbility(true);
|
bbDiscard.setIsBuyBackAbility(true);
|
||||||
|
|
||||||
if (Tgt)
|
if (Tgt)
|
||||||
bbDiscardTgt.setBeforePayMana(CardFactoryUtil.input_targetPlayer(bbDiscardTgt));
|
bbDiscard.setBeforePayMana(CardFactoryUtil.input_targetPlayer(bbDiscard));
|
||||||
else
|
|
||||||
bbDiscardTgt.setTargetPlayer(AllZone.GameAction.getOpponent(card.getController()));
|
|
||||||
|
|
||||||
card.addSpellAbility(bbDiscardTgt);
|
card.addSpellAbility(bbDiscard);
|
||||||
}
|
}
|
||||||
|
|
||||||
}//spDiscardTgt
|
}//spDiscardTgt
|
||||||
|
|||||||
Reference in New Issue
Block a user