mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
[DFT] Canyon Vaulter, Cloudspire Skycycle, Dune Drifter (#13382)
* Support Mounts and Your Main restriction in CrewsVehicleSourceTriggeredAbility * Genericize Reckless Velocitaur * Implement [DFT] Canyon Vaulter, Cloudspire Skycycle, and Dune Drifter
This commit is contained in:
parent
a20e304234
commit
705ce2320d
6 changed files with 192 additions and 48 deletions
|
|
@ -10,14 +10,26 @@ import mage.target.targetpointer.FixedTarget;
|
|||
|
||||
public class CrewsVehicleSourceTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final boolean mountsAlso;
|
||||
private final boolean yourMainPhaseOnly;
|
||||
|
||||
public CrewsVehicleSourceTriggeredAbility(Effect effect) {
|
||||
this(effect, false, false);
|
||||
}
|
||||
|
||||
public CrewsVehicleSourceTriggeredAbility(Effect effect, boolean mountsAlso, boolean yourMainPhaseOnly) {
|
||||
super(Zone.BATTLEFIELD, effect, false);
|
||||
this.addIcon(CardIconImpl.ABILITY_CREW);
|
||||
setTriggerPhrase("Whenever {this} crews a Vehicle, ");
|
||||
this.mountsAlso = mountsAlso;
|
||||
this.yourMainPhaseOnly = yourMainPhaseOnly;
|
||||
setTriggerPhrase("Whenever {this}" + (mountsAlso ? " saddles a Mount or" : "") +
|
||||
" crews a Vehicle" + (yourMainPhaseOnly ? " during your main phase" : "") + ", ");
|
||||
}
|
||||
|
||||
protected CrewsVehicleSourceTriggeredAbility(final CrewsVehicleSourceTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.mountsAlso = ability.mountsAlso;
|
||||
this.yourMainPhaseOnly = ability.yourMainPhaseOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -27,11 +39,14 @@ public class CrewsVehicleSourceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CREWED_VEHICLE;
|
||||
return event.getType() == GameEvent.EventType.CREWED_VEHICLE || (mountsAlso && event.getType() == GameEvent.EventType.SADDLED_MOUNT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (yourMainPhaseOnly && !(game.isMainPhase() && this.isControlledBy(game.getActivePlayerId()))) {
|
||||
return false;
|
||||
}
|
||||
if (event.getTargetId().equals(getSourceId())) {
|
||||
for (Effect effect : getEffects()) {
|
||||
// set the vehicle id as target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue