mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
[STX] Implemented Professor Onyx
This commit is contained in:
parent
aa527ea8b2
commit
df866f858e
4 changed files with 192 additions and 0 deletions
|
|
@ -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> — Whenever you cast or copy an instant or sorcery spell, " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagecraftAbility copy() {
|
||||
return new MagecraftAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ public enum AbilityWord {
|
|||
LANDFALL("Landfall"),
|
||||
LIEUTENANT("Lieutenant"),
|
||||
METALCRAFT("Metalcraft"),
|
||||
MAGECRAFT("Magecraft"),
|
||||
MORBID("Morbid"),
|
||||
PARLEY("Parley"),
|
||||
RADIANCE("Radiance"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue