forked from External/mage
* Make ChoosePlaneswalkerTypeEffect * Make REMOVE_COUNTER and REMOVE_COUNTERS events so they can be replaced/modified * Deification initial attempt, need to filter for damage * add optional damage flag to removeCounters * wrap logs in sim check * check that planeswalker is chosen subtype * cast to RemoveCountersEvent and reduce indents * use counterRemovedDueToDamage * add tests * make other counterRemovedDueToDamage headers public * remove logs * remove isSimulation check from informPlayers * remove logger * make chosen planeswalker type predicate * move event modification to replaceEvent
29 lines
892 B
Java
29 lines
892 B
Java
package mage.game.events;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.cards.Card;
|
|
import mage.players.Player;
|
|
|
|
public class RemoveCounterEvent extends GameEvent {
|
|
|
|
boolean isDamage;
|
|
|
|
public RemoveCounterEvent(String name, Card targetCard, Ability source, boolean isDamage){
|
|
super(GameEvent.EventType.REMOVE_COUNTER, targetCard.getId(), source,
|
|
(source == null ? null : source.getControllerId()));
|
|
setData(name);
|
|
this.isDamage = isDamage;
|
|
}
|
|
|
|
public RemoveCounterEvent(String name, Player targetPlayer, Ability source, boolean isDamage){
|
|
super(GameEvent.EventType.REMOVE_COUNTER, targetPlayer.getId(), source,
|
|
(source == null ? null : source.getControllerId()));
|
|
setData(name);
|
|
this.isDamage = isDamage;
|
|
}
|
|
|
|
public boolean counterRemovedDueToDamage(){
|
|
return this.isDamage;
|
|
}
|
|
|
|
}
|