foul-magics/Mage/src/main/java/mage/abilities/common/PlaneswalkerEntersWithLoyaltyCountersAbility.java
2021-02-21 08:15:16 +04:00

39 lines
1.3 KiB
Java

package mage.abilities.common;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.counters.CounterType;
/**
* @author LevelX2
*/
public class PlaneswalkerEntersWithLoyaltyCountersAbility extends EntersBattlefieldAbility {
private int startingLoyalty;
public PlaneswalkerEntersWithLoyaltyCountersAbility(int loyalty) {
super(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(loyalty)));
startingLoyalty = loyalty;
setRuleVisible(false);
}
public PlaneswalkerEntersWithLoyaltyCountersAbility(final PlaneswalkerEntersWithLoyaltyCountersAbility ability) {
super(ability);
startingLoyalty = ability.startingLoyalty;
}
public int getStartingLoyalty() {
return startingLoyalty;
}
public void setStartingLoyalty(int startingLoyalty) {
this.startingLoyalty = startingLoyalty;
this.getEffects().clear();
this.addEffect(new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(startingLoyalty))));
}
@Override
public PlaneswalkerEntersWithLoyaltyCountersAbility copy() {
return new PlaneswalkerEntersWithLoyaltyCountersAbility(this);
}
}