mirror of
https://github.com/magefree/mage.git
synced 2026-01-18 17:29:58 -08:00
[EOC] Implement Depthshaker Titan
This commit is contained in:
parent
70ce416e00
commit
6dd213a97d
3 changed files with 98 additions and 4 deletions
|
|
@ -14,9 +14,10 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
||||
|
||||
protected DelayedTriggeredAbility ability;
|
||||
protected boolean copyTargets;
|
||||
protected String rulePrefix;
|
||||
private final DelayedTriggeredAbility ability;
|
||||
private final boolean copyTargets;
|
||||
private final String rulePrefix;
|
||||
private boolean copyToPointer = false;
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability) {
|
||||
this(ability, true);
|
||||
|
|
@ -38,6 +39,7 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
this.ability = effect.ability.copy();
|
||||
this.copyTargets = effect.copyTargets;
|
||||
this.rulePrefix = effect.rulePrefix;
|
||||
this.copyToPointer = effect.copyToPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,7 +51,7 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
DelayedTriggeredAbility delayedAbility = ability.copy();
|
||||
if (this.copyTargets) {
|
||||
if (source.getTargets().isEmpty()) {
|
||||
if (copyToPointer || source.getTargets().isEmpty()) {
|
||||
delayedAbility.getEffects().setTargetPointer(this.getTargetPointer().copy());
|
||||
} else {
|
||||
delayedAbility.getTargets().addAll(source.getTargets());
|
||||
|
|
@ -89,4 +91,9 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect {
|
|||
super.setTargetPointer(targetPointer);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreateDelayedTriggeredAbilityEffect withCopyToPointer(boolean copyToPointer) {
|
||||
this.copyToPointer = copyToPointer;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue