[WHO] Time Reaper, Add target adjuster for "that player controls/owns" damage trigger targets (#12528)

* Implement Time Reaper, start rework

* Create DamagedPlayerControlsTargetAdjuster, convert Aberrant to use it

* Always add targets for EachOpponentPermanentTargetsAdjuster

* Improve target name, finish Time Reaper

* Convert some cards

* Improve documentation, more cards

* More cards, fix cards that needed to use owner instead of controller

* Fix unfinished AlelaCunningConqueror changes

* more cards

* All remaining cards

* Fix target type

* Remove outdated attempt at TargetController.SOURCE_EFFECT_TARGET_POINTER

* Finish removal of SOURCE_EFFECT_TARGET_POINTER

* Change targetAdjuster blueprint target to be set inside setTargetAdjuster, add error checking

* Always add Target Adjuster after Target

* Add comment

* Fix TolarianContemptTest to skip opponent with no valid targets

* Forgot to git add the new abstract GenericTargetAdjuster

* Test now possible after merge, fix missed ChangeOfPlans adjuster order

* Text and optional-ness fixes

* Always set target pointer
This commit is contained in:
ssk97 2024-07-01 21:46:14 -07:00 committed by GitHub
parent bccf323c0f
commit 7cb669603f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
172 changed files with 891 additions and 2219 deletions

View file

@ -13,8 +13,7 @@ import mage.target.Target;
/**
* @author TheElk801, notgreat
*/
public class PowerTargetAdjuster implements TargetAdjuster {
private Target blueprintTarget = null;
public class PowerTargetAdjuster extends GenericTargetAdjuster {
private final DynamicValue dynamicValue;
private final ComparisonType comparison;
@ -33,12 +32,9 @@ public class PowerTargetAdjuster implements TargetAdjuster {
this(ManacostVariableValue.REGULAR, comparison);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (blueprintTarget == null) {
blueprintTarget = ability.getTargets().get(0).copy();
blueprintTarget.clearChosen();
}
Target newTarget = blueprintTarget.copy();
int amount = dynamicValue.calculate(game, ability, ability.getEffects().get(0));
Filter<MageObject> filter = newTarget.getFilter();