forked from External/mage
[BLB] Implement forage mechanic (#12569)
* [BLB] Implement Corpseberry Cultivator * [BLB] Implement Thornvault Forager * fix verify failure
This commit is contained in:
parent
39e254c914
commit
43e95fd0cf
6 changed files with 208 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class ForageTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public ForageTriggeredAbility(Effect effect) {
|
||||
this(Zone.BATTLEFIELD, effect, false);
|
||||
}
|
||||
|
||||
public ForageTriggeredAbility(Zone zone, Effect effect, boolean optional) {
|
||||
super(zone, effect, optional);
|
||||
setTriggerPhrase("Whenever you forage, ");
|
||||
}
|
||||
|
||||
private ForageTriggeredAbility(final ForageTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForageTriggeredAbility copy() {
|
||||
return new ForageTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.FORAGED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return isControlledBy(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue