mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
[MIR] Implement Barreling Attack (#11529)
This commit is contained in:
parent
f7f72036b2
commit
ab69653cd7
2 changed files with 76 additions and 0 deletions
75
Mage.Sets/src/mage/cards/b/BarrelingAttack.java
Normal file
75
Mage.Sets/src/mage/cards/b/BarrelingAttack.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.BlockingCreatureCount;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Cguy7777
|
||||
*/
|
||||
public final class BarrelingAttack extends CardImpl {
|
||||
|
||||
public BarrelingAttack(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}{R}");
|
||||
|
||||
// Target creature gains trample until end of turn.
|
||||
// When that creature becomes blocked this turn, it gets +1/+1 until end of turn for each creature blocking it.
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new BarrelingAttackTriggeredAbility()));
|
||||
}
|
||||
|
||||
private BarrelingAttack(final BarrelingAttack card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrelingAttack copy() {
|
||||
return new BarrelingAttack(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarrelingAttackTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
BarrelingAttackTriggeredAbility() {
|
||||
super(new BoostTargetEffect(BlockingCreatureCount.TARGET, BlockingCreatureCount.TARGET, Duration.EndOfTurn),
|
||||
Duration.EndOfTurn, false);
|
||||
setTriggerPhrase("When that creature becomes blocked this turn, ");
|
||||
}
|
||||
|
||||
private BarrelingAttackTriggeredAbility(final BarrelingAttackTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CREATURE_BLOCKED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(this.getFirstTarget())) {
|
||||
Permanent attackingCreature = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||
return attackingCreature != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrelingAttackTriggeredAbility copy() {
|
||||
return new BarrelingAttackTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,7 @@ public final class Mirage extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Bad River", 324, Rarity.UNCOMMON, mage.cards.b.BadRiver.class));
|
||||
cards.add(new SetCardInfo("Barbed Foliage", 207, Rarity.UNCOMMON, mage.cards.b.BarbedFoliage.class));
|
||||
cards.add(new SetCardInfo("Barbed-Back Wurm", 105, Rarity.UNCOMMON, mage.cards.b.BarbedBackWurm.class));
|
||||
cards.add(new SetCardInfo("Barreling Attack", 157, Rarity.RARE, mage.cards.b.BarrelingAttack.class));
|
||||
cards.add(new SetCardInfo("Basalt Golem", 294, Rarity.UNCOMMON, mage.cards.b.BasaltGolem.class));
|
||||
cards.add(new SetCardInfo("Bay Falcon", 54, Rarity.COMMON, mage.cards.b.BayFalcon.class));
|
||||
cards.add(new SetCardInfo("Bazaar of Wonders", 55, Rarity.RARE, mage.cards.b.BazaarOfWonders.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue