forked from External/mage
[NEO] Implemented Flame Discharge
This commit is contained in:
parent
9f83d9572f
commit
dfb3f87bb3
4 changed files with 156 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.ControlledModifiedCreatureAsSpellCastWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public enum ControlledModifiedCreatureAsSpellCastCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
ControlledModifiedCreatureAsSpellCastWatcher watcher = game.getState().getWatcher(ControlledModifiedCreatureAsSpellCastWatcher.class);
|
||||
if (sourceObject == null || watcher == null) {
|
||||
return false;
|
||||
}
|
||||
return watcher.checkModifiedCondition(new MageObjectReference(sourceObject, game));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you controlled a modified creature as you cast this spell";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue