forked from External/mage
more CHK
This commit is contained in:
parent
cf0ef7b398
commit
774cc390d9
28 changed files with 1766 additions and 0 deletions
41
Mage/src/mage/abilities/effects/common/FlipSourceEffect.java
Normal file
41
Mage/src/mage/abilities/effects/common/FlipSourceEffect.java
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
public class FlipSourceEffect extends OneShotEffect<FlipSourceEffect> {
|
||||
|
||||
public FlipSourceEffect() {
|
||||
super(Constants.Outcome.BecomeCreature);
|
||||
}
|
||||
|
||||
public FlipSourceEffect(final FlipSourceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent p = game.getPermanent(source.getSourceId());
|
||||
if (p != null) {
|
||||
p.flip(game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlipSourceEffect copy() {
|
||||
return new FlipSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Ability source) {
|
||||
return "flip it.";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue