TargetAmount refactors (#13128)

* Add minimum and maximum target counts as parameters for TargetAmount and its subclasses; update/add several rules comments (and one actual text) for clarity; remove unused imports

* Get amount+description from target instead of parameters for DistributeCountersEffect and DamageMultiEffect; additions to TargetImpl.getDescription to accommodate

* Create separate method to check if "any number" phrasing should be used, override it in TargetAmount

* Check instanceof TargetAmount before casting

* Add new constructors to chain off of for TargetCreaturePermanentAmount & TargetCreatureOrPlaneswalkerAmount

* Fix text for Storm the Seedcore

* Use Integer.MAX_VALUE instead of 0 to represent no maximum targets

* Add comment about getUseAnyNumber()

* Use amount-only constructors in some TargetAmount subclasses, add clarifying documentation

* Fix a few calls

* Require more specific filters
This commit is contained in:
Cameron Merkel 2024-12-17 18:23:18 -06:00 committed by GitHub
parent 960c26a291
commit 73b63d14ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
123 changed files with 444 additions and 365 deletions

View file

@ -22,9 +22,8 @@ public abstract class TargetPermanentOrPlayerAmount extends TargetAmount {
protected FilterPermanentOrPlayer filter;
TargetPermanentOrPlayerAmount(DynamicValue amount, int maxNumberOfTargets) {
super(amount);
this.maxNumberOfTargets = maxNumberOfTargets;
TargetPermanentOrPlayerAmount(DynamicValue amount, int minNumberOfTargets, int maxNumberOfTargets) {
super(amount, minNumberOfTargets, maxNumberOfTargets);
}
TargetPermanentOrPlayerAmount(final TargetPermanentOrPlayerAmount target) {