forked from External/mage
[MOM] Implement Deeproot Wayfinder
This commit is contained in:
parent
1727ec1fb5
commit
94d1178a5a
3 changed files with 92 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
protected String text;
|
||||
protected boolean onlyOpponents;
|
||||
private boolean orPlaneswalker = false;
|
||||
private boolean orBattle = false;
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
|
|
@ -45,6 +46,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
this.setTargetPointer = ability.setTargetPointer;
|
||||
this.onlyOpponents = ability.onlyOpponents;
|
||||
this.orPlaneswalker = ability.orPlaneswalker;
|
||||
this.orBattle = ability.orBattle;
|
||||
}
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility setOrPlaneswalker(boolean orPlaneswalker) {
|
||||
|
|
@ -52,6 +54,11 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
return this;
|
||||
}
|
||||
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility setOrBattle(boolean orBattle) {
|
||||
this.orBattle = orBattle;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DealsCombatDamageToAPlayerTriggeredAbility copy() {
|
||||
return new DealsCombatDamageToAPlayerTriggeredAbility(this);
|
||||
|
|
@ -78,8 +85,8 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
case DAMAGED_PERMANENT:
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent == null
|
||||
|| !permanent.isPlaneswalker(game)
|
||||
|| !orPlaneswalker) {
|
||||
|| (!orPlaneswalker || !permanent.isPlaneswalker(game))
|
||||
&& (!orBattle || !permanent.isBattle(game))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -104,6 +111,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
return "Whenever {this} deals combat damage to "
|
||||
+ (onlyOpponents ? "an opponent" : "a player")
|
||||
+ (orPlaneswalker ? " or planeswalker" : "")
|
||||
+ (orBattle ? " or battle" : "")
|
||||
+ ", ";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue