mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Fixed Donate. Now it actually targets a player instead of defining the opponent.
This commit is contained in:
@@ -44,6 +44,7 @@ import forge.PlayerUtil;
|
|||||||
import forge.PlayerZone;
|
import forge.PlayerZone;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
import forge.card.spellability.Ability;
|
import forge.card.spellability.Ability;
|
||||||
|
import forge.card.spellability.AbilitySub;
|
||||||
import forge.card.spellability.Spell;
|
import forge.card.spellability.Spell;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.SpellPermanent;
|
import forge.card.spellability.SpellPermanent;
|
||||||
@@ -942,69 +943,51 @@ public class CardFactorySorceries {
|
|||||||
|
|
||||||
// *************** START *********** START **************************
|
// *************** START *********** START **************************
|
||||||
else if (cardName.equals("Donate")) {
|
else if (cardName.equals("Donate")) {
|
||||||
final SpellAbility spell = new Spell(card) {
|
final Target t2 = new Target(card, "Select target Player", "Player".split(","));
|
||||||
private static final long serialVersionUID = 782912579034503349L;
|
final AbilitySub sub = new AbilitySub(card, t2) {
|
||||||
|
private static final long serialVersionUID = 4618047889933691050L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public boolean chkAIDrawback() {
|
||||||
final Card c = this.getTargetCard();
|
return false;
|
||||||
|
|
||||||
if ((c != null) && AllZoneUtil.isCardInPlay(c) && c.canBeTargetedBy(this)) {
|
|
||||||
// Donate should target both the player and the creature
|
|
||||||
c.addController(card.getController().getOpponent());
|
|
||||||
/*
|
|
||||||
* if (!c.isAura()) {
|
|
||||||
*
|
|
||||||
* //AllZone.getGameAction().changeController(new
|
|
||||||
* CardList(c), c.getController(),
|
|
||||||
* c.getController().getOpponent());
|
|
||||||
*
|
|
||||||
* } else //Aura {
|
|
||||||
* c.setController(card.getController().getOpponent());
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public void resolve() {
|
||||||
final CardList list = AllZone.getComputerPlayer().getCardsIn(Zone.Battlefield,
|
final Card permanent = this.getParent().getTargetCard();
|
||||||
"Illusions of Grandeur");
|
final Player player = this.getTargetPlayer();
|
||||||
|
permanent.addController(player);
|
||||||
|
}
|
||||||
|
|
||||||
if (list.size() > 0) {
|
@Override
|
||||||
this.setTargetCard(list.get(0));
|
public boolean doTrigger(final boolean b) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final Input runtime = new Input() {
|
final Cost abCost = new Cost("2 U", cardName, false);
|
||||||
private static final long serialVersionUID = -7823269301012427007L;
|
final Target t1 = new Target(card, "Select target permanent", "Permanent".split(","));
|
||||||
|
final SpellAbility spell = new Spell(card, abCost, t1) {
|
||||||
|
private static final long serialVersionUID = 8964235802256739219L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public boolean canPlayAI() {
|
||||||
CardList perms = AllZone.getHumanPlayer().getCardsIn(Zone.Battlefield);
|
return false;
|
||||||
perms = perms.filter(new CardListFilter() {
|
}
|
||||||
@Override
|
|
||||||
public boolean addCard(final Card c) {
|
|
||||||
return c.isPermanent();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
boolean free = false;
|
@Override
|
||||||
if (this.isFree()) {
|
public void resolve() {
|
||||||
free = true;
|
sub.resolve();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
spell.setSubAbility(sub);
|
||||||
|
|
||||||
this.stopSetNext(CardFactoryUtil.inputTargetSpecific(spell, perms,
|
final StringBuilder sbDesc = new StringBuilder();
|
||||||
"Select a permanent you control", true, free));
|
sbDesc.append("Target player gains control of target permanent");
|
||||||
|
spell.setDescription(sbDesc.toString());
|
||||||
} // showMessage()
|
|
||||||
}; // Input
|
|
||||||
|
|
||||||
spell.setBeforePayMana(runtime);
|
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
|
|
||||||
} // *************** END ************ END **************************
|
} // *************** END ************ END **************************
|
||||||
|
|
||||||
// *************** START *********** START **************************
|
// *************** START *********** START **************************
|
||||||
|
|||||||
Reference in New Issue
Block a user