[STX] Implemented Professor Onyx

This commit is contained in:
Evan Kranzler 2021-03-22 19:25:55 -04:00
parent aa527ea8b2
commit df866f858e
4 changed files with 192 additions and 0 deletions

View file

@ -0,0 +1,44 @@
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
/**
* @author TheElk801
*/
public class MagecraftAbility extends TriggeredAbilityImpl {
public MagecraftAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
private MagecraftAbility(final MagecraftAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COPIED_STACKOBJECT
|| event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Spell spell = game.getSpell(event.getTargetId());
return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstantOrSorcery();
}
@Override
public String getRule() {
return "<i>Magecraft</i> &mdash; Whenever you cast or copy an instant or sorcery spell, " + super.getRule();
}
@Override
public MagecraftAbility copy() {
return new MagecraftAbility(this);
}
}

View file

@ -32,6 +32,7 @@ public enum AbilityWord {
LANDFALL("Landfall"),
LIEUTENANT("Lieutenant"),
METALCRAFT("Metalcraft"),
MAGECRAFT("Magecraft"),
MORBID("Morbid"),
PARLEY("Parley"),
RADIANCE("Radiance"),