foul-magics/Mage/src/main/java/mage/abilities/effects/common/LoseGameSourceControllerEffect.java
2018-06-02 17:59:49 +02:00

41 lines
955 B
Java

package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class LoseGameSourceControllerEffect extends OneShotEffect {
public LoseGameSourceControllerEffect() {
super(Outcome.Detriment);
this.staticText = "you lose the game";
}
public LoseGameSourceControllerEffect(final LoseGameSourceControllerEffect effect) {
super(effect);
}
@Override
public LoseGameSourceControllerEffect copy() {
return new LoseGameSourceControllerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.lost(game);
return true;
}
return false;
}
}