mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
* Fixed mana effect, that added addional mana to the effect controller instead of the controller of the mana source (Dictate of Karametra, Keeper of Progenitus, Heartbeat of Spring, Zur-Taa Ancient).
This commit is contained in:
parent
bd5ac3756d
commit
a3db429525
1 changed files with 7 additions and 4 deletions
|
@ -57,9 +57,12 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(this.targetPointer.getFirst(game, source));
|
||||
if (controller != null && permanent != null) {
|
||||
if (permanent != null) {
|
||||
Player targetController = game.getPlayer(permanent.getControllerId());
|
||||
if (targetController == null) {
|
||||
return false;
|
||||
}
|
||||
Abilities<ManaAbility> mana = permanent.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
|
||||
Mana types = new Mana();
|
||||
for (ManaAbility ability : mana) {
|
||||
|
@ -91,7 +94,7 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect {
|
|||
if (choice.getChoices().size() == 1) {
|
||||
choice.setChoice(choice.getChoices().iterator().next());
|
||||
} else {
|
||||
controller.choose(outcome, choice, game);
|
||||
targetController.choose(outcome, choice, game);
|
||||
}
|
||||
if (choice.getChoice() == null) {
|
||||
return false;
|
||||
|
@ -117,7 +120,7 @@ public class AddManaOfAnyColorTargetCanProduceEffect extends ManaEffect {
|
|||
newMana.setColorless(1);
|
||||
break;
|
||||
}
|
||||
controller.getManaPool().addMana(newMana, game, source);
|
||||
targetController.getManaPool().addMana(newMana, game, source);
|
||||
checkToFirePossibleEvents(newMana, game, source);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue