mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Implemented Jace, Mirror Mage
This commit is contained in:
parent
c84c17a455
commit
6903dad861
7 changed files with 169 additions and 5 deletions
|
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
|
|
@ -65,6 +66,8 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
int getStartingLoyalty();
|
||||
|
||||
void setStartingLoyalty(int startingLoyalty);
|
||||
|
||||
void adjustCosts(Ability ability, Game game);
|
||||
|
||||
void adjustTargets(Ability ability, Game game);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -160,6 +161,15 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStartingLoyalty(int startingLoyalty) {
|
||||
for (Ability ab : getAbilities()) {
|
||||
if (ab instanceof PlaneswalkerEntersWithLoyaltyCountersAbility) {
|
||||
((PlaneswalkerEntersWithLoyaltyCountersAbility) ab).setStartingLoyalty(startingLoyalty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor(Game game) {
|
||||
return color;
|
||||
|
|
@ -307,7 +317,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
*/
|
||||
@Override
|
||||
public void removePTCDA() {
|
||||
for (Iterator<Ability> iter = this.getAbilities().iterator(); iter.hasNext();) {
|
||||
for (Iterator<Ability> iter = this.getAbilities().iterator(); iter.hasNext(); ) {
|
||||
Ability ability = iter.next();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (effect instanceof ContinuousEffect && ((ContinuousEffect) effect).getSublayer() == SubLayer.CharacteristicDefining_7a) {
|
||||
|
|
|
|||
|
|
@ -9,13 +9,12 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
|||
import mage.counters.CounterType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PlaneswalkerEntersWithLoyaltyCountersAbility extends EntersBattlefieldAbility {
|
||||
|
||||
private final int startingLoyalty;
|
||||
|
||||
private int startingLoyalty;
|
||||
|
||||
public PlaneswalkerEntersWithLoyaltyCountersAbility(int loyalty) {
|
||||
super(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(loyalty)));
|
||||
startingLoyalty = loyalty;
|
||||
|
|
@ -26,11 +25,17 @@ public class PlaneswalkerEntersWithLoyaltyCountersAbility extends EntersBattlefi
|
|||
super(ability);
|
||||
startingLoyalty = ability.startingLoyalty;
|
||||
}
|
||||
|
||||
|
||||
public int getStartingLoyalty() {
|
||||
return startingLoyalty;
|
||||
}
|
||||
|
||||
public void setStartingLoyalty(int startingLoyalty) {
|
||||
this.startingLoyalty = startingLoyalty;
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(startingLoyalty)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaneswalkerEntersWithLoyaltyCountersAbility copy() {
|
||||
return new PlaneswalkerEntersWithLoyaltyCountersAbility(this);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -46,6 +47,7 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
private ObjectColor color;
|
||||
private boolean useLKI = false;
|
||||
private boolean isntLegendary = false;
|
||||
private int startingLoyalty = -1;
|
||||
private final List<Ability> additionalAbilities = new ArrayList();
|
||||
|
||||
public CreateTokenCopyTargetEffect(boolean useLKI) {
|
||||
|
|
@ -176,6 +178,10 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
if (isntLegendary) {
|
||||
token.getSuperType().remove(SuperType.LEGENDARY);
|
||||
}
|
||||
|
||||
if (startingLoyalty!=-1){
|
||||
token.setStartingLoyalty(startingLoyalty);
|
||||
}
|
||||
if (additionalCardType != null && !token.getCardType().contains(additionalCardType)) {
|
||||
token.addCardType(additionalCardType);
|
||||
}
|
||||
|
|
@ -288,6 +294,10 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
this.hasHaste = hasHaste;
|
||||
}
|
||||
|
||||
public void setStartingLoyalty(int startingLoyalty) {
|
||||
this.startingLoyalty = startingLoyalty;
|
||||
}
|
||||
|
||||
public void exileTokensCreatedAtNextEndStep(Game game, Ability source) {
|
||||
for (Permanent tokenPermanent : addedTokenPermanents) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue