mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
refactor text gen for DamageAllControlledTargetEffect
This commit is contained in:
parent
91bf9344e2
commit
5a5e320542
9 changed files with 12 additions and 33 deletions
|
|
@ -19,26 +19,11 @@ public class DamageAllControlledTargetEffect extends OneShotEffect {
|
|||
|
||||
private final DynamicValue amount;
|
||||
private final FilterPermanent filter;
|
||||
private String sourceName = "{this}";
|
||||
|
||||
public DamageAllControlledTargetEffect(int amount) {
|
||||
this(amount, StaticFilters.FILTER_PERMANENT_CREATURE);
|
||||
}
|
||||
|
||||
public DamageAllControlledTargetEffect(int amount, String whoDealDamageName) {
|
||||
this(amount, StaticFilters.FILTER_PERMANENT_CREATURE);
|
||||
this.sourceName = whoDealDamageName;
|
||||
}
|
||||
|
||||
public DamageAllControlledTargetEffect(DynamicValue amount) {
|
||||
this(amount, StaticFilters.FILTER_PERMANENT_CREATURE);
|
||||
}
|
||||
|
||||
public DamageAllControlledTargetEffect(DynamicValue amount, String whoDealDamageName) {
|
||||
this(amount, StaticFilters.FILTER_PERMANENT_CREATURE);
|
||||
this.sourceName = whoDealDamageName;
|
||||
}
|
||||
|
||||
public DamageAllControlledTargetEffect(int amount, FilterPermanent filter) {
|
||||
this(StaticValue.get(amount), filter);
|
||||
}
|
||||
|
|
@ -53,7 +38,6 @@ public class DamageAllControlledTargetEffect extends OneShotEffect {
|
|||
super(effect);
|
||||
this.amount = effect.amount.copy();
|
||||
this.filter = effect.filter.copy();
|
||||
this.sourceName = effect.sourceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -78,14 +62,8 @@ public class DamageAllControlledTargetEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(sourceName);
|
||||
sb.append(" deals ").append(amount).append(" damage to each ").append(filter.getMessage());
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
sb.append(" that player");
|
||||
} else {
|
||||
sb.append(" target ").append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
sb.append(" controls");
|
||||
return sb.toString();
|
||||
return "{this} deals " + amount + " damage to each " + filter.getMessage() + ' '
|
||||
+ getTargetPointer().describeTargets(mode.getTargets(), "that player")
|
||||
+ " controls";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue