foul-magics/Mage/src/main/java/mage/abilities/effects/common/ExchangeLifeControllerTargetEffect.java
xenohedron d9ca387fad
another batch of text gen improvements (#11247)
* describe targets: UntapTargetEffect

* describe targets: SetBasePowerToughnessTargetEffect

* cleanup text

* describe targets: RegenerateTargetEffect

* describe targets: PhaseOutTargetEffect

* adjust text

* remove superfluous param

* describe targets: TapAllTargetPlayerControlsEffect

* describe targets: TurnFaceUpTargetEffect

* describe targets: TransformTargetEffect

* describe targets: RemoveFromCombatTargetEffect

* describe targets: DetainTargetEffect

* cleanup DiscardHandTargetEffect

* describe targets: DrawCardTargetEffect

* describe targets: GainLifeTargetEffect

* describe targets: LoseLifeTargetEffect

* describe targets: ExchangeLifeTargetEffect

* describe targets: DamageTargetControllerEffect
2023-10-01 22:51:02 -04:00

43 lines
1.2 KiB
Java

package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
* @author Styxo
*/
public class ExchangeLifeControllerTargetEffect extends OneShotEffect {
public ExchangeLifeControllerTargetEffect() {
super(Outcome.Neutral);
}
private ExchangeLifeControllerTargetEffect(final ExchangeLifeControllerTargetEffect effect) {
super(effect);
}
@Override
public ExchangeLifeControllerTargetEffect copy() {
return new ExchangeLifeControllerTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(source.getFirstTarget());
if (controller == null || player == null) {
return false;
}
controller.exchangeLife(player, source, game);
return true;
}
@Override
public String getText(Mode mode) {
return "exchange life totals with " + getTargetPointer().describeTargets(mode.getTargets(), "that player");
}
}