mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
refactor Friends Forever ability to be a Partner variant
This commit is contained in:
parent
ab885be2d5
commit
c2ba51af88
11 changed files with 14 additions and 73 deletions
|
|
@ -1,37 +0,0 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.StaticAbility;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class FriendsForeverAbility extends StaticAbility implements MageSingleton {
|
||||
|
||||
private static final FriendsForeverAbility instance = new FriendsForeverAbility();
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static FriendsForeverAbility getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private FriendsForeverAbility() {
|
||||
super(Zone.BATTLEFIELD, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Friends forever <i>(You can have two commanders if both have friends forever.)</i>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FriendsForeverAbility copy() {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public enum PartnerVariantType {
|
||||
FATHER_AND_SON("Father & son"),
|
||||
FRIENDS_FOREVER("Friends forever"),
|
||||
SURVIVORS("Survivors"),
|
||||
CHARACTER_SELECT("Character select");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
package mage.util.validation;
|
||||
|
||||
import mage.abilities.keyword.FriendsForeverAbility;
|
||||
import mage.cards.Card;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum FriendsForeverValidator implements CommanderValidator {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean checkPartner(Card commander1, Card commander2) {
|
||||
return commander1.getAbilities().containsClass(FriendsForeverAbility.class);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue