mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Remove redundant fields from AffinityForLandTypeAbility
This commit is contained in:
parent
60e0fba7f2
commit
8eff633a9c
1 changed files with 9 additions and 21 deletions
|
|
@ -13,33 +13,21 @@ import mage.filter.common.FilterControlledPermanent;
|
|||
*/
|
||||
|
||||
public class AffinityForLandTypeAbility extends SimpleStaticAbility {
|
||||
private final String rulesText;
|
||||
|
||||
private final FilterControlledPermanent filter;
|
||||
|
||||
String text;
|
||||
SubType landType;
|
||||
|
||||
public AffinityForLandTypeAbility(SubType landType, String text) {
|
||||
super(Zone.ALL, new AffinityEffect(getFilter(landType)));
|
||||
this.filter = getFilter(landType);
|
||||
public AffinityForLandTypeAbility(SubType landType, String pluralName) {
|
||||
super(Zone.ALL, null);
|
||||
rulesText = "Affinity for " + pluralName + " <i>(This spell costs {1} less to cast for each " + landType + " you control.)</i>";
|
||||
setRuleAtTheTop(true);
|
||||
this.text = text;
|
||||
this.landType = landType;
|
||||
|
||||
this.addHint(new ValueHint(landType + " you control", new PermanentsOnBattlefieldCount(filter)));
|
||||
}
|
||||
|
||||
private static FilterControlledPermanent getFilter(SubType landType) {
|
||||
FilterControlledPermanent affinityfilter = new FilterControlledPermanent();
|
||||
affinityfilter.add(landType.getPredicate());
|
||||
return affinityfilter;
|
||||
|
||||
FilterControlledPermanent filter = new FilterControlledPermanent(landType);
|
||||
addEffect(new AffinityEffect(filter));
|
||||
addHint(new ValueHint(pluralName + " you control", new PermanentsOnBattlefieldCount(filter)));
|
||||
}
|
||||
|
||||
public AffinityForLandTypeAbility(final AffinityForLandTypeAbility ability) {
|
||||
super(ability);
|
||||
this.text = ability.text;
|
||||
this.filter = ability.filter.copy();
|
||||
this.rulesText = ability.rulesText;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -49,6 +37,6 @@ public class AffinityForLandTypeAbility extends SimpleStaticAbility {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Affinity for " + text + " <i>(This spell costs 1 less to cast for each " + landType + " you control.)</i>";
|
||||
return rulesText;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue