mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
[FIC] Implement Vincent, Vengeful Atoner
This commit is contained in:
parent
fcdf4093fd
commit
199315e48b
3 changed files with 110 additions and 16 deletions
98
Mage.Sets/src/mage/cards/v/VincentVengefulAtoner.java
Normal file
98
Mage.Sets/src/mage/cards/v/VincentVengefulAtoner.java
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
|
||||
import mage.abilities.common.OneOrMoreCombatDamagePlayerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class VincentVengefulAtoner extends CardImpl {
|
||||
|
||||
public VincentVengefulAtoner(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ASSASSIN);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// Whenever one or more creatures you control deal combat damage to a player, put a +1/+1 counter on Vincent.
|
||||
this.addAbility(new OneOrMoreCombatDamagePlayerTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance())
|
||||
));
|
||||
|
||||
// Chaos -- Whenever Vincent deals combat damage to an opponent, it deals that much damage to each other opponent if Vincent's power is 7 or greater.
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(
|
||||
new VincentVengefulAtonerEffect(), false, true, true
|
||||
));
|
||||
}
|
||||
|
||||
private VincentVengefulAtoner(final VincentVengefulAtoner card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VincentVengefulAtoner copy() {
|
||||
return new VincentVengefulAtoner(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VincentVengefulAtonerEffect extends OneShotEffect {
|
||||
|
||||
VincentVengefulAtonerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "it deals that much damage to each other opponent if {this}'s power is 7 or greater";
|
||||
}
|
||||
|
||||
private VincentVengefulAtonerEffect(final VincentVengefulAtonerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VincentVengefulAtonerEffect copy() {
|
||||
return new VincentVengefulAtonerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (Optional
|
||||
.ofNullable(source.getSourcePermanentOrLKI(game))
|
||||
.map(MageObject::getPower)
|
||||
.map(MageInt::getValue)
|
||||
.orElse(0) < 7) {
|
||||
return false;
|
||||
}
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount < 1) {
|
||||
return false;
|
||||
}
|
||||
UUID targetId = getTargetPointer().getFirst(game, source);
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Optional.ofNullable(opponentId)
|
||||
.filter(uuid -> !uuid.equals(targetId))
|
||||
.map(game::getPlayer)
|
||||
.map(player -> player.damage(amount, source, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -365,6 +365,8 @@ public final class FinalFantasyCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Unfinished Business", 259, Rarity.RARE, mage.cards.u.UnfinishedBusiness.class));
|
||||
cards.add(new SetCardInfo("Vandalblast", 298, Rarity.UNCOMMON, mage.cards.v.Vandalblast.class));
|
||||
cards.add(new SetCardInfo("Vanquish the Horde", 260, Rarity.RARE, mage.cards.v.VanquishTheHorde.class));
|
||||
cards.add(new SetCardInfo("Vincent, Vengeful Atoner", 157, Rarity.RARE, mage.cards.v.VincentVengefulAtoner.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Vincent, Vengeful Atoner", 64, Rarity.RARE, mage.cards.v.VincentVengefulAtoner.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Vindicate", 330, Rarity.RARE, mage.cards.v.Vindicate.class));
|
||||
cards.add(new SetCardInfo("Vineglimmer Snarl", 440, Rarity.RARE, mage.cards.v.VineglimmerSnarl.class));
|
||||
cards.add(new SetCardInfo("Void Rend", 331, Rarity.RARE, mage.cards.v.VoidRend.class));
|
||||
|
|
|
|||
|
|
@ -55,22 +55,16 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getSourceId().equals(this.sourceId)
|
||||
&& game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
|
||||
if (onlyCombat && event instanceof DamagedPlayerEvent) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||
if (!damageEvent.isCombatDamage()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
effect.setValue("damage", event.getAmount());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
if (!event.getSourceId().equals(this.getSourceId())
|
||||
|| !game.getOpponents(this.getControllerId()).contains(event.getTargetId())
|
||||
|| onlyCombat
|
||||
&& !((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
this.getEffects().setValue("damage", event.getAmount());
|
||||
if (setTargetPointer) {
|
||||
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId(), game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue