[ACR] Implement Brotherhood Headquarters (#13360)

This commit is contained in:
4825764518 2025-02-18 10:52:06 -05:00 committed by GitHub
parent 33b3f53643
commit 27ff3ee874
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 108 additions and 2 deletions

View file

@ -0,0 +1,106 @@
package mage.cards.b;
import mage.ConditionalMana;
import mage.MageObject;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.condition.Condition;
import mage.abilities.keyword.FreerunningAbility;
import mage.abilities.mana.ColorlessManaAbility;
import mage.abilities.mana.ConditionalAnyColorManaAbility;
import mage.abilities.mana.builder.ConditionalManaBuilder;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.Filter;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import java.util.UUID;
public class BrotherhoodHeadquarters extends CardImpl {
private static final Predicate<MageObject> predicate = new AbilityPredicate(FreerunningAbility.class);
public BrotherhoodHeadquarters(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// Add one colorless
this.addAbility(new ColorlessManaAbility());
// Add one mana of any color. Spend this mana only to cast an Assassin spell or a spell that has freerunning, or to activate an ability of an Assassin source.
this.addAbility(new ConditionalAnyColorManaAbility(1, new BrotherhoodHeadquartersManaBuilder()));
}
public BrotherhoodHeadquarters(BrotherhoodHeadquarters card) {
super(card);
}
@Override
public BrotherhoodHeadquarters copy() {
return new BrotherhoodHeadquarters(this);
}
class BrotherhoodHeadquartersManaBuilder extends ConditionalManaBuilder {
@Override
public String getRule() {
return "Spend this mana only to cast an Assassin spell or a spell that has freerunning, or to activate an ability of an Assassin source.";
}
@Override
public ConditionalMana build(Object... options) {
return new BrotherhoodHeadquartersConditionalMana(this.mana);
}
}
class BrotherhoodHeadquartersConditionalMana extends ConditionalMana {
public BrotherhoodHeadquartersConditionalMana(Mana mana) {
super(mana);
addCondition(new BrotherhoodHeadquartersAssassinSpellManaCondition());
addCondition(new BrotherhoodHeadquartersFreerunningManaCondition());
addCondition(new BrotherhoodHeadquartersAssassinSourceManaCondition());
setComparisonScope(Filter.ComparisonScope.Any);
}
}
class BrotherhoodHeadquartersAssassinSpellManaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
if (source instanceof SpellAbility) {
Card card = game.getCard(source.getSourceId());
return card != null && card.hasSubtype(SubType.ASSASSIN, game);
}
return false;
}
}
class BrotherhoodHeadquartersFreerunningManaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = game.getObject(source);
return sourceObject != null && predicate.apply(sourceObject, game);
}
}
class BrotherhoodHeadquartersAssassinSourceManaCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
if (source.isActivatedAbility()) {
MageObject object = game.getObject(source.getSourceId());
return object != null && object.hasSubtype(SubType.ASSASSIN, game);
}
return false;
}
}
}

View file

@ -77,8 +77,8 @@ public final class AssassinsCreed extends ExpansionSet {
cards.add(new SetCardInfo("Bleeding Effect", 232, Rarity.UNCOMMON, mage.cards.b.BleedingEffect.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Bleeding Effect", 51, Rarity.UNCOMMON, mage.cards.b.BleedingEffect.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Brotherhood Ambushers", 285, Rarity.UNCOMMON, mage.cards.b.BrotherhoodAmbushers.class));
//cards.add(new SetCardInfo("Brotherhood Headquarters", 266, Rarity.UNCOMMON, mage.cards.b.BrotherhoodHeadquarters.class, NON_FULL_USE_VARIOUS));
//cards.add(new SetCardInfo("Brotherhood Headquarters", 80, Rarity.UNCOMMON, mage.cards.b.BrotherhoodHeadquarters.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Brotherhood Headquarters", 266, Rarity.UNCOMMON, mage.cards.b.BrotherhoodHeadquarters.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Brotherhood Headquarters", 80, Rarity.UNCOMMON, mage.cards.b.BrotherhoodHeadquarters.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Brotherhood Patriarch", 286, Rarity.COMMON, mage.cards.b.BrotherhoodPatriarch.class));
cards.add(new SetCardInfo("Brotherhood Regalia", 255, Rarity.UNCOMMON, mage.cards.b.BrotherhoodRegalia.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Brotherhood Regalia", 71, Rarity.UNCOMMON, mage.cards.b.BrotherhoodRegalia.class, NON_FULL_USE_VARIOUS));