forked from External/mage
[DFT] Add Guidelight Matrix artifact
add static method from SaddleAbility to saddle a permanent add common saddle effect refactor Alacrian Armory with new saddle effect
This commit is contained in:
parent
37fc173701
commit
a472ff9f18
5 changed files with 130 additions and 16 deletions
|
|
@ -48,6 +48,23 @@ public class SaddleAbility extends SimpleActivatedAbility {
|
|||
this.value = ability.value;
|
||||
}
|
||||
|
||||
public static boolean applySaddle(Permanent permanent, Game game) {
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
SaddleAbility saddleAbility = permanent.getAbilities().stream()
|
||||
.filter(a -> a instanceof SaddleAbility)
|
||||
.map(a -> (SaddleAbility) a)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (saddleAbility != null) {
|
||||
SaddleEventEffect effect = new SaddleEventEffect();
|
||||
effect.apply(game, saddleAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SaddleAbility copy() {
|
||||
return new SaddleAbility(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue