forked from External/mage
[MOC] Implement Conclave Sledge-Captain
This commit is contained in:
parent
25636565a9
commit
302e445b90
3 changed files with 87 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -57,11 +58,23 @@ public class BackupAbility extends EntersBattlefieldTriggeredAbility {
|
|||
}
|
||||
|
||||
public void addAbility(Ability ability, Watcher watcher) {
|
||||
addAbility(ability, watcher, false);
|
||||
}
|
||||
|
||||
public void addAbility(Ability ability, boolean dontAddToCard) {
|
||||
addAbility(ability, null, dontAddToCard);
|
||||
}
|
||||
|
||||
public void addAbility(Ability ability, Watcher watcher, boolean dontAddToCard) {
|
||||
if (watcher != null) {
|
||||
ability.addWatcher(watcher);
|
||||
}
|
||||
card.addAbility(ability);
|
||||
if (!dontAddToCard) {
|
||||
card.addAbility(ability);
|
||||
}
|
||||
abilitiesToAdd.add(ability);
|
||||
CardUtil.castStream(this.getEffects().stream(), BackupEffect.class)
|
||||
.forEach(backupEffect -> backupEffect.addAbility(ability));
|
||||
}
|
||||
|
||||
public boolean hasAbilities() {
|
||||
|
|
@ -86,6 +99,10 @@ class BackupEffect extends OneShotEffect {
|
|||
this.abilitiesToAdd.addAll(effect.abilitiesToAdd);
|
||||
}
|
||||
|
||||
void addAbility(Ability ability) {
|
||||
this.abilitiesToAdd.add(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BackupEffect copy() {
|
||||
return new BackupEffect(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue