[40K] Implemented Broodlord

This commit is contained in:
Evan Kranzler 2022-09-13 08:30:33 -04:00
parent b91cef5dd6
commit 668410dd21
4 changed files with 139 additions and 0 deletions

View file

@ -0,0 +1,86 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.RavenousAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetPermanentAmount;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Broodlord extends CardImpl {
public Broodlord(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{3}{G}");
this.subtype.add(SubType.TYRANID);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Ravenous
this.addAbility(new RavenousAbility());
// Brood Telepathy -- When Broodlord enters the battlefield, distribute X +1/+1 counters among any number of other target creatures you control.
Ability ability = new EntersBattlefieldTriggeredAbility(new BroodlordEffect());
ability.addTarget(new TargetPermanentAmount(ManacostVariableValue.ETB, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE));
this.addAbility(ability.withFlavorWord("Brood Telepathy"));
}
private Broodlord(final Broodlord card) {
super(card);
}
@Override
public Broodlord copy() {
return new Broodlord(this);
}
}
class BroodlordEffect extends OneShotEffect {
BroodlordEffect() {
super(Outcome.Benefit);
staticText = "distribute X +1/+1 counters among any number of other target creatures you control";
}
private BroodlordEffect(final BroodlordEffect effect) {
super(effect);
}
@Override
public BroodlordEffect copy() {
return new BroodlordEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Target target = source.getTargets().get(0);
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
int counters = target.getTargetAmount(targetId);
if (counters < 1) {
continue;
}
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {
continue;
}
permanent.addCounters(CounterType.P1P1.createInstance(counters), source, game);
}
return true;
}
}

View file

@ -23,6 +23,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Abaddon the Despoiler", 2, Rarity.MYTHIC, mage.cards.a.AbaddonTheDespoiler.class)); cards.add(new SetCardInfo("Abaddon the Despoiler", 2, Rarity.MYTHIC, mage.cards.a.AbaddonTheDespoiler.class));
cards.add(new SetCardInfo("Abundance", 210, Rarity.RARE, mage.cards.a.Abundance.class)); cards.add(new SetCardInfo("Abundance", 210, Rarity.RARE, mage.cards.a.Abundance.class));
cards.add(new SetCardInfo("Arcane Signet", 227, Rarity.COMMON, mage.cards.a.ArcaneSignet.class)); cards.add(new SetCardInfo("Arcane Signet", 227, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
cards.add(new SetCardInfo("Broodlord", 89, Rarity.RARE, mage.cards.b.Broodlord.class));
cards.add(new SetCardInfo("Command Tower", 270, Rarity.COMMON, mage.cards.c.CommandTower.class)); cards.add(new SetCardInfo("Command Tower", 270, Rarity.COMMON, mage.cards.c.CommandTower.class));
cards.add(new SetCardInfo("Deathleaper, Terror Weapon", 115, Rarity.RARE, mage.cards.d.DeathleaperTerrorWeapon.class)); cards.add(new SetCardInfo("Deathleaper, Terror Weapon", 115, Rarity.RARE, mage.cards.d.DeathleaperTerrorWeapon.class));
cards.add(new SetCardInfo("Fabricate", 181, Rarity.RARE, mage.cards.f.Fabricate.class)); cards.add(new SetCardInfo("Fabricate", 181, Rarity.RARE, mage.cards.f.Fabricate.class));

View file

@ -0,0 +1,51 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
import mage.counters.CounterType;
import mage.game.Game;
/**
* @author TheElk801
*/
public class RavenousAbility extends EntersBattlefieldAbility {
public RavenousAbility() {
super(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()));
this.addSubAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)),
RavenousAbilityCondition.instance, "When this creature enters the battlefield, " +
"if X is 5 or more, draw a card"
));
}
private RavenousAbility(final RavenousAbility ability) {
super(ability);
}
@Override
public RavenousAbility copy() {
return new RavenousAbility(this);
}
@Override
public String getRule() {
return "Ravenous <i>(This creature enters the battlefield with X +1/+1 counters on it. " +
"If X is 5 or more, draw a card when it enters.)</i>";
}
}
enum RavenousAbilityCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return ManacostVariableValue.ETB.calculate(game, source, null) >= 5;
}
}

View file

@ -91,6 +91,7 @@ Plainswalk|new|
Poisonous|number| Poisonous|number|
Provoke|new| Provoke|new|
Prowess|new| Prowess|new|
Ravenous|new|
Reach|instance| Reach|instance|
Rebound|new| Rebound|new|
Reconfigure|manaString| Reconfigure|manaString|