mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
Implemented Bone Miser
This commit is contained in:
parent
247973da76
commit
c75a689efd
5 changed files with 128 additions and 15 deletions
|
|
@ -0,0 +1,53 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
|
||||
public class DiscardCardControllerTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final FilterCard filter;
|
||||
|
||||
public DiscardCardControllerTriggeredAbility(Effect effect, boolean isOptional) {
|
||||
this(effect, isOptional, StaticFilters.FILTER_CARD);
|
||||
}
|
||||
|
||||
public DiscardCardControllerTriggeredAbility(Effect effect, boolean isOptional, FilterCard filter) {
|
||||
super(Zone.BATTLEFIELD, effect, isOptional);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
private DiscardCardControllerTriggeredAbility(final DiscardCardControllerTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.filter = ability.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscardCardControllerTriggeredAbility copy() {
|
||||
return new DiscardCardControllerTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DISCARDED_CARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return event.getPlayerId().equals(getControllerId())
|
||||
&& filter.match(game.getCard(event.getTargetId()), getId(), getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you discard " + filter.getMessage() + ", " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
|
@ -13,31 +8,30 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
|
||||
public class DiscardsACardPlayerTriggeredAbility extends TriggeredAbilityImpl {
|
||||
public class DiscardCardPlayerTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private SetTargetPointer setTargetPointer;
|
||||
|
||||
public DiscardsACardPlayerTriggeredAbility(Effect effect, boolean isOptional) {
|
||||
public DiscardCardPlayerTriggeredAbility(Effect effect, boolean isOptional) {
|
||||
this(effect, isOptional, SetTargetPointer.NONE);
|
||||
}
|
||||
|
||||
public DiscardsACardPlayerTriggeredAbility(Effect effect, boolean isOptional, SetTargetPointer setTargetPointer) {
|
||||
public DiscardCardPlayerTriggeredAbility(Effect effect, boolean isOptional, SetTargetPointer setTargetPointer) {
|
||||
super(Zone.BATTLEFIELD, effect, isOptional);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public DiscardsACardPlayerTriggeredAbility(final DiscardsACardPlayerTriggeredAbility ability) {
|
||||
private DiscardCardPlayerTriggeredAbility(final DiscardCardPlayerTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.setTargetPointer = ability.setTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscardsACardPlayerTriggeredAbility copy() {
|
||||
return new DiscardsACardPlayerTriggeredAbility(this);
|
||||
public DiscardCardPlayerTriggeredAbility copy() {
|
||||
return new DiscardCardPlayerTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,6 +46,6 @@ import mage.game.events.GameEvent;
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever player discards a card, " + super.getRule();
|
||||
return "Whenever a player discards a card, " + super.getRule();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue