mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Fixed target and changed name of the effect
This commit is contained in:
parent
0b6e7fdb7d
commit
59cf0cf1f3
2 changed files with 15 additions and 10 deletions
|
@ -31,13 +31,14 @@ import java.util.UUID;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.AddManaOfAnyColorToManaPoolTargetPlayerEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.abilities.effects.common.ChoosePlayerEffect;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
|
||||
/**
|
||||
|
@ -51,10 +52,11 @@ public class SpectralSearchlight extends CardImpl {
|
|||
|
||||
|
||||
// {tap}: Choose a player. That player adds one mana of any color he or she chooses to his or her mana pool.
|
||||
ManaEffect effect = new AddManaOfAnyColorToManaPoolTargetControllerEffect("chosen player");
|
||||
ManaEffect effect = new AddManaOfAnyColorToManaPoolTargetPlayerEffect("chosen player");
|
||||
effect.setText("Choose a player. That player adds one mana of any color he or she chooses to his or her mana pool");
|
||||
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
ability.addTarget(new TargetPlayer(1, 1, true));
|
||||
// choosing player as first effect, before adding mana effect
|
||||
ability.getEffects().add(0, new ChoosePlayerEffect(Outcome.PutManaInPool));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,27 @@ import mage.choices.ChoiceColor;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* Created by Galatolol
|
||||
*/
|
||||
public class AddManaOfAnyColorToManaPoolTargetControllerEffect extends ManaEffect {
|
||||
public class AddManaOfAnyColorToManaPoolTargetPlayerEffect extends ManaEffect {
|
||||
|
||||
public AddManaOfAnyColorToManaPoolTargetControllerEffect(String textManaPoolOwner) {
|
||||
public AddManaOfAnyColorToManaPoolTargetPlayerEffect(String textManaPoolOwner) {
|
||||
super();
|
||||
this.staticText = (textManaPoolOwner.equals("his or her")?"that player adds ":"add ") + "one mana of any color" + " to " + textManaPoolOwner + " mana pool";
|
||||
}
|
||||
|
||||
public AddManaOfAnyColorToManaPoolTargetControllerEffect(final AddManaOfAnyColorToManaPoolTargetControllerEffect effect) {
|
||||
public AddManaOfAnyColorToManaPoolTargetPlayerEffect(final AddManaOfAnyColorToManaPoolTargetPlayerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
UUID playerId = (UUID) game.getState().getValue(source.getSourceId() + "_player");
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
while (!player.choose(outcome, choice, game)) {
|
||||
|
@ -42,8 +45,8 @@ public class AddManaOfAnyColorToManaPoolTargetControllerEffect extends ManaEffec
|
|||
}
|
||||
|
||||
@Override
|
||||
public AddManaOfAnyColorToManaPoolTargetControllerEffect copy() {
|
||||
return new AddManaOfAnyColorToManaPoolTargetControllerEffect(this);
|
||||
public AddManaOfAnyColorToManaPoolTargetPlayerEffect copy() {
|
||||
return new AddManaOfAnyColorToManaPoolTargetPlayerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
Loading…
Reference in a new issue