forked from External/mage
[OTJ] Implementing "saddle" mechanic (#12012)
* [OTJ] Implement Trained Arynx * implement saddle cost * update saddled effect * add test * add sorcery speed to saddle ability * apply requested changes * [OTJ] Implement Quilled Charger * rework test
This commit is contained in:
parent
2dbd313956
commit
8fbc7c9507
12 changed files with 447 additions and 2 deletions
|
|
@ -0,0 +1,37 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class AttacksWhileSaddledTriggeredAbility extends AttacksTriggeredAbility {
|
||||
|
||||
public AttacksWhileSaddledTriggeredAbility(Effect effect) {
|
||||
super(effect);
|
||||
this.setTriggerPhrase("Whenever {this} attacks while saddled, ");
|
||||
}
|
||||
|
||||
private AttacksWhileSaddledTriggeredAbility(final AttacksWhileSaddledTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttacksWhileSaddledTriggeredAbility copy() {
|
||||
return new AttacksWhileSaddledTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return super.checkTrigger(event, game)
|
||||
&& Optional
|
||||
.ofNullable(getSourcePermanentIfItStillExists(game))
|
||||
.map(Permanent::isSaddled)
|
||||
.orElse(false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue