forked from External/mage
Replace Overriden getTriggerPhrase() with setTriggerPhrase() usage (#9343)
This commit is contained in:
parent
188e6dd8c1
commit
ebdb6b53a4
406 changed files with 918 additions and 2665 deletions
|
|
@ -8,9 +8,10 @@ import mage.game.events.GameEvent;
|
|||
public class AtTheBeginOfCombatDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
public AtTheBeginOfCombatDelayedTriggeredAbility(Effect effect) {
|
||||
super(effect);
|
||||
setTriggerPhrase(" At the beginning of the next combat, ");
|
||||
}
|
||||
|
||||
public AtTheBeginOfCombatDelayedTriggeredAbility(AtTheBeginOfCombatDelayedTriggeredAbility ability) {
|
||||
public AtTheBeginOfCombatDelayedTriggeredAbility(final AtTheBeginOfCombatDelayedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
|
@ -28,9 +29,4 @@ public class AtTheBeginOfCombatDelayedTriggeredAbility extends DelayedTriggeredA
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return " At the beginning of the next combat, ";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class AtTheBeginOfMainPhaseDelayedTriggeredAbility extends DelayedTrigger
|
|||
super(effect, phaseSelection.duration, true, optional);
|
||||
this.targetController = targetController;
|
||||
this.phaseSelection = phaseSelection;
|
||||
|
||||
setTriggerPhrase(generateTriggerPhrase());
|
||||
}
|
||||
|
||||
public AtTheBeginOfMainPhaseDelayedTriggeredAbility(final AtTheBeginOfMainPhaseDelayedTriggeredAbility ability) {
|
||||
|
|
@ -73,23 +73,18 @@ public class AtTheBeginOfMainPhaseDelayedTriggeredAbility extends DelayedTrigger
|
|||
return true;
|
||||
case YOU:
|
||||
return event.getPlayerId().equals(this.controllerId);
|
||||
|
||||
case OPPONENT:
|
||||
if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
return game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game);
|
||||
case CONTROLLER_ATTACHED_TO:
|
||||
Permanent attachment = game.getPermanent(sourceId);
|
||||
if (attachment != null && attachment.getAttachedTo() != null) {
|
||||
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
||||
if (attachedTo != null && attachedTo.isControlledBy(event.getPlayerId())) {
|
||||
return true;
|
||||
}
|
||||
if (attachment == null || attachment.getAttachedTo() == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
||||
return attachedTo != null && attachedTo.isControlledBy(event.getPlayerId());
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkPhase(EventType eventType) {
|
||||
|
|
@ -106,8 +101,7 @@ public class AtTheBeginOfMainPhaseDelayedTriggeredAbility extends DelayedTrigger
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
private String generateTriggerPhrase() {
|
||||
switch (targetController) {
|
||||
case YOU:
|
||||
return "At the beginning of your " + phaseSelection + ", ";
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ public class AtTheBeginOfNextEndStepDelayedTriggeredAbility extends DelayedTrigg
|
|||
|
||||
public AtTheBeginOfNextEndStepDelayedTriggeredAbility(Effect effect, TargetController targetController, Condition condition, boolean optional) {
|
||||
super(effect, Duration.Custom, true, optional);
|
||||
this.zone = zone;
|
||||
this.targetController = targetController;
|
||||
this.condition = condition;
|
||||
setTriggerPhrase(generateTriggerPhrase());
|
||||
}
|
||||
|
||||
public AtTheBeginOfNextEndStepDelayedTriggeredAbility(final AtTheBeginOfNextEndStepDelayedTriggeredAbility ability) {
|
||||
|
|
@ -83,8 +83,7 @@ public class AtTheBeginOfNextEndStepDelayedTriggeredAbility extends DelayedTrigg
|
|||
return new AtTheBeginOfNextEndStepDelayedTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
private String generateTriggerPhrase() {
|
||||
switch (targetController) {
|
||||
case YOU:
|
||||
return "At the beginning of your next end step, ";
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import mage.game.events.GameEvent;
|
|||
public class AtTheEndOfCombatDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
public AtTheEndOfCombatDelayedTriggeredAbility(Effect effect) {
|
||||
super(effect);
|
||||
setTriggerPhrase("At end of combat, ");
|
||||
}
|
||||
|
||||
public AtTheEndOfCombatDelayedTriggeredAbility(AtTheEndOfCombatDelayedTriggeredAbility ability) {
|
||||
|
|
@ -28,9 +29,4 @@ public class AtTheEndOfCombatDelayedTriggeredAbility extends DelayedTriggeredAbi
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "At end of combat, ";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTrigge
|
|||
public AtTheEndOfTurnStepPostDelayedTriggeredAbility(Effect effect, boolean usesStack) {
|
||||
super(effect);
|
||||
this.usesStack = usesStack;
|
||||
setTriggerPhrase("At end of turn ");
|
||||
}
|
||||
|
||||
|
||||
public AtTheEndOfTurnStepPostDelayedTriggeredAbility(AtTheEndOfTurnStepPostDelayedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
@ -39,9 +39,4 @@ public class AtTheEndOfTurnStepPostDelayedTriggeredAbility extends DelayedTrigge
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "At end of turn " ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public class ManaSpentDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public ManaSpentDelayedTriggeredAbility(Effect effect, FilterSpell filter) {
|
||||
super(effect, Duration.Custom, true, false);
|
||||
this.filter = filter;
|
||||
setTriggerPhrase("When you spend this mana to cast " + filter.getMessage() + ", ");
|
||||
}
|
||||
|
||||
private ManaSpentDelayedTriggeredAbility(final ManaSpentDelayedTriggeredAbility ability) {
|
||||
|
|
@ -76,9 +77,4 @@ public class ManaSpentDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
.map(ManaPoolItem::getSourceId)
|
||||
.noneMatch(getSourceId()::equals);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "When you spend this mana to cast " + filter.getMessage() + ", ";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public class PactDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
|
||||
public PactDelayedTriggeredAbility(ManaCosts cost) {
|
||||
super(new PactEffect(cost));
|
||||
setTriggerPhrase("<br>At the beginning of your next upkeep, ");
|
||||
}
|
||||
|
||||
public PactDelayedTriggeredAbility(PactDelayedTriggeredAbility ability) {
|
||||
|
|
@ -36,11 +37,6 @@ public class PactDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return game.isActivePlayer(this.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "<br>At the beginning of your next upkeep, ";
|
||||
}
|
||||
}
|
||||
|
||||
class PactEffect extends OneShotEffect {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue