mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Add 30 AKH card implementations
* Some of the cards still need testing. Will fix and problems and update tomorrow, but pushing them for now to make it clear what's been implemented so far.
This commit is contained in:
parent
804cdf6b21
commit
77586eec7e
35 changed files with 7370 additions and 33 deletions
|
|
@ -0,0 +1,45 @@
|
|||
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;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author stravant
|
||||
*/
|
||||
public class WheneverYouExertCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public WheneverYouExertCreatureTriggeredAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect);
|
||||
}
|
||||
|
||||
public WheneverYouExertCreatureTriggeredAbility(final WheneverYouExertCreatureTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.BECOMES_EXERTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
boolean weAreExerting = getControllerId().equals(event.getPlayerId());
|
||||
Permanent exerted = game.getPermanent(event.getTargetId());
|
||||
boolean exertedIsCreature = (exerted != null) && exerted.isCreature();
|
||||
return weAreExerting && exertedIsCreature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WheneverYouExertCreatureTriggeredAbility copy() {
|
||||
return new WheneverYouExertCreatureTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you exert a creature, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author stravant
|
||||
*/
|
||||
public enum HeckbentCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getPlayer(source.getControllerId()).getHand().size() <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if you have one or fewer cards in hand";
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,8 @@ import mage.filter.common.FilterCreatureSpell;
|
|||
import mage.filter.common.FilterNonlandCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -38,7 +40,15 @@ public final class StaticFilters {
|
|||
|
||||
public static final FilterCreatureSpell FILTER_SPELL_A_CREATURE = new FilterCreatureSpell("a creature spell");
|
||||
|
||||
public static final FilterPermanent FILTER_CREATURE_TOKENS = new FilterCreaturePermanent("creature tokens");
|
||||
|
||||
public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
|
||||
|
||||
static {
|
||||
FILTER_CREATURE_TOKENS.add(new TokenPredicate());
|
||||
|
||||
FILTER_ATTACKING_CREATURES.add(new AttackingPredicate());
|
||||
|
||||
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(
|
||||
new CardTypePredicate(CardType.ARTIFACT),
|
||||
new CardTypePredicate(CardType.CREATURE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue