forked from External/mage
Moved some custom "Cast only" effects to the framework.
This commit is contained in:
parent
e2c8b8f583
commit
f4a9a66974
22 changed files with 421 additions and 678 deletions
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.effects.common.ruleModifying.CastOnlyDuringPhaseStepSourceEffect;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class CastOnlyDuringPhaseStepSourceAbility extends SimpleStaticAbility {
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(TurnPhase turnPhase) {
|
||||
this(turnPhase, null, null);
|
||||
}
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(TurnPhase turnPhase, Condition condition) {
|
||||
this(turnPhase, null, condition);
|
||||
}
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(PhaseStep phaseStep) {
|
||||
this(null, phaseStep, null);
|
||||
}
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(PhaseStep phaseStep, Condition condition) {
|
||||
this(null, phaseStep, condition);
|
||||
}
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(TurnPhase turnPhase, PhaseStep phaseStep, Condition condition) {
|
||||
this(turnPhase, phaseStep, condition, null);
|
||||
}
|
||||
|
||||
public CastOnlyDuringPhaseStepSourceAbility(TurnPhase turnPhase, PhaseStep phaseStep, Condition condition, String effectText) {
|
||||
super(Zone.BATTLEFIELD, new CastOnlyDuringPhaseStepSourceEffect(turnPhase, phaseStep, condition));
|
||||
this.setRuleAtTheTop(true);
|
||||
if (effectText != null) {
|
||||
getEffects().get(0).setText(effectText);
|
||||
}
|
||||
}
|
||||
|
||||
private CastOnlyDuringPhaseStepSourceAbility(final CastOnlyDuringPhaseStepSourceAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CastOnlyDuringPhaseStepSourceAbility copy() {
|
||||
return new CastOnlyDuringPhaseStepSourceAbility(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue