Replace Overriden getTriggerPhrase() with setTriggerPhrase() usage (#9343)

This commit is contained in:
Alex Vasile 2022-08-08 23:28:46 -04:00 committed by GitHub
parent 188e6dd8c1
commit ebdb6b53a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
406 changed files with 918 additions and 2665 deletions

View file

@ -19,8 +19,8 @@ import java.util.UUID;
*/
public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl {
protected FilterCreaturePermanent filter;
protected boolean attacksYouOrYourPlaneswalker;
protected final FilterCreaturePermanent filter;
protected final boolean attacksYouOrYourPlaneswalker;
protected SetTargetPointer setTargetPointer;
protected boolean controller;
@ -42,11 +42,13 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl {
this.attacksYouOrYourPlaneswalker = attacksYouOrYourPlaneswalker;
this.setTargetPointer = setTargetPointer;
this.controller = controller;
setTriggerPhrase("Whenever " + CardUtil.addArticle(filter.getMessage()) + " attacks"
+ (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "") + ", ");
}
public AttacksAllTriggeredAbility(final AttacksAllTriggeredAbility ability) {
super(ability);
this.filter = ability.filter.copy();
this.filter = ability.filter; // TODO: Does this have to be a copy?
this.attacksYouOrYourPlaneswalker = ability.attacksYouOrYourPlaneswalker;
this.setTargetPointer = ability.setTargetPointer;
this.controller = ability.controller;
@ -96,11 +98,4 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl {
public AttacksAllTriggeredAbility copy() {
return new AttacksAllTriggeredAbility(this);
}
@Override
public String getTriggerPhrase() {
return "Whenever " + CardUtil.addArticle(filter.getMessage()) + " attacks"
+ (attacksYouOrYourPlaneswalker ? " you or a planeswalker you control" : "") + ", ";
}
}