mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Fix issues with the ChosenSubtypePredicate and clone effects. (#5164)
Update ChosenSubtypePredicate to be an ObjectPlayer predicate. This fixes how cards that use it act when cloned. Fixes https://github.com/magefree/mage/issues/5136
This commit is contained in:
parent
a164dad83f
commit
14520097a5
10 changed files with 45 additions and 18 deletions
|
|
@ -1,29 +1,26 @@
|
|||
|
||||
package mage.filter.predicate.mageobject;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.ObjectPlayerPredicate;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public class ChosenSubtypePredicate implements Predicate<MageObject> {
|
||||
public class ChosenSubtypePredicate implements ObjectPlayerPredicate<ObjectSourcePlayer<MageObject>> {
|
||||
|
||||
private final UUID cardID;
|
||||
|
||||
public ChosenSubtypePredicate(UUID cardID) {
|
||||
this.cardID = cardID;
|
||||
public ChosenSubtypePredicate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(cardID, game);
|
||||
return input.hasSubtype(subType, game);
|
||||
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
|
||||
SubType subType = ChooseCreatureTypeEffect.getChoosenCreatureType(input.getSourceId(), game);
|
||||
return input.getObject().hasSubtype(subType, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue