* Body Count - fixed game error on usage (miss watcher)

This commit is contained in:
Oleg Agafonov 2023-03-25 16:16:11 +04:00
parent f9c82bee99
commit bfba179bdf
18 changed files with 16 additions and 18 deletions

View file

@ -29,7 +29,7 @@ public final class BloodForTheBloodGod extends CardImpl {
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SpellCostReductionSourceEffect(CreaturesDiedThisTurnCount.instance)
.setText("this spell costs {1} less to cast for each creature that died this turn")
).addHint(CreaturesDiedThisTurnHint.instance).setRuleAtTheTop(true), new CreaturesDiedWatcher());
).addHint(CreaturesDiedThisTurnHint.instance).setRuleAtTheTop(true));
// Discard your hand, then draw eight cards. Blood for the Blood God! deals 8 damage to each opponent. Exile Blood for the Blood God!.
this.getSpellAbility().addEffect(new DiscardHandControllerEffect());

View file

@ -34,7 +34,7 @@ public final class BloodcrazedPaladin extends CardImpl {
// Bloodcrazed Paladin enters the battlefield with a +1/+1 counter on it for each creature that died this turn.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(
CounterType.P1P1.createInstance(0), CreaturesDiedThisTurnCount.instance, true
).setText("with a +1/+1 counter on it for each creature that died this turn.")).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).setText("with a +1/+1 counter on it for each creature that died this turn.")).addHint(CreaturesDiedThisTurnHint.instance));
}
private BloodcrazedPaladin(final BloodcrazedPaladin card) {

View file

@ -44,7 +44,7 @@ public final class BontuTheGlorified extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance());
// Bontu the Glorified can't attack or block unless a creature died under your control this turn.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BontuTheGlorifiedRestrictionEffect()), new CreaturesDiedWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BontuTheGlorifiedRestrictionEffect()));
// {1}{B}, Sacrifice another creature: Scry 1. Each opponent loses 1 life and you gain 1 life.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(1, false), new ManaCostsImpl<>("{1}{B}"));

View file

@ -35,7 +35,7 @@ public final class CanopyStalker extends CardImpl {
this.addAbility(new DiesSourceTriggeredAbility(
new GainLifeEffect(CreaturesDiedThisTurnCount.instance)
.setText("you gain 1 life for each creature that died this turn")
).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).addHint(CreaturesDiedThisTurnHint.instance));
}
private CanopyStalker(final CanopyStalker card) {

View file

@ -30,7 +30,7 @@ public final class DiregrafRebirth extends CardImpl {
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SpellCostReductionSourceEffect(CreaturesDiedThisTurnCount.instance)
.setText("this spell costs {1} less to cast for each creature that died this turn")
).addHint(CreaturesDiedThisTurnHint.instance).setRuleAtTheTop(true), new CreaturesDiedWatcher());
).addHint(CreaturesDiedThisTurnHint.instance).setRuleAtTheTop(true));
// Return target creature card from your graveyard to the battlefield.
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());

View file

@ -23,7 +23,6 @@ public final class FreshMeat extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}");
// Create a 3/3 green Beast creature token for each creature put into your graveyard from the battlefield this turn.
this.getSpellAbility().addWatcher(new CreaturesDiedWatcher());
this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken(), new FreshMeatDynamicValue()));
}

View file

@ -34,7 +34,7 @@ public final class GrizzlyGhoul extends CardImpl {
// Grizzly Ghoul enters the battlefield with a +1/+1 counter on it for each creature that died this turn.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(
CounterType.P1P1.createInstance(0), CreaturesDiedThisTurnCount.instance, true
).setText("with a +1/+1 counter on it for each creature that died this turn.")).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).setText("with a +1/+1 counter on it for each creature that died this turn.")).addHint(CreaturesDiedThisTurnHint.instance));
}
private GrizzlyGhoul(final GrizzlyGhoul card) {

View file

@ -38,7 +38,7 @@ public final class IngaRuneEyes extends CardImpl {
// When Inga Rune-Eyes dies, draw three cards if three or more creatures died this turn.
this.addAbility(new DiesSourceTriggeredAbility(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(3), IngaRuneEyesCondition.instance
).setText("draw three cards if three or more creatures died this turn")), new CreaturesDiedWatcher());
).setText("draw three cards if three or more creatures died this turn")));
}
private IngaRuneEyes(final IngaRuneEyes card) {

View file

@ -29,7 +29,7 @@ public final class KhabalGhoul extends CardImpl {
// At the beginning of each end step, put a +1/+1 counter on Khabal Ghoul for each creature that died this turn.
this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(),
CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false).addHint(CreaturesDiedThisTurnHint.instance));
}
private KhabalGhoul(final KhabalGhoul card) {

View file

@ -44,8 +44,7 @@ public final class KuonOgreAscendant extends CardImpl {
Zone.BATTLEFIELD,
new FlipSourceEffect(new KuonsEssenceToken()),
TargetController.ANY,
KuonOgreAscendantCondition.instance, false),
new CreaturesDiedWatcher());
KuonOgreAscendantCondition.instance, false));
}
private KuonOgreAscendant(final KuonOgreAscendant card) {

View file

@ -46,7 +46,7 @@ public final class LagomosHandOfHatred extends CardImpl {
new SearchLibraryPutInHandEffect(new TargetCardInLibrary()),
new TapSourceCost(),
LagomosHandOfHatredCondition.instance
), new CreaturesDiedWatcher());
));
}
private LagomosHandOfHatred(final LagomosHandOfHatred card) {

View file

@ -35,7 +35,7 @@ public final class MahadiEmporiumMaster extends CardImpl {
new CreateTokenEffect(
new TreasureToken(), CreaturesDiedThisTurnCount.instance
).setText("create a Treasure token for each creature that died this turn"), TargetController.YOU, false
).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).addHint(CreaturesDiedThisTurnHint.instance));
}
private MahadiEmporiumMaster(final MahadiEmporiumMaster card) {

View file

@ -42,7 +42,7 @@ public final class NevinyrralUrborgTyrant extends CardImpl {
// When Nevinyrral, Urborg Tyrant enters the battlefield, create a tapped 2/2 black Zombie creature token for each creature that died this turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(
new ZombieToken(), CreaturesDiedThisTurnCount.instance, true, false
).setText("create a tapped 2/2 black Zombie creature token for each creature that died this turn")).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).setText("create a tapped 2/2 black Zombie creature token for each creature that died this turn")).addHint(CreaturesDiedThisTurnHint.instance));
// When Nevinyrral dies, you may pay {1}. When you do, destroy all artifacts, creatures, and enchantments.
this.addAbility(new DiesSourceTriggeredAbility(

View file

@ -36,7 +36,7 @@ public final class SautekhImmortal extends CardImpl {
CounterType.P1P1.createInstance(0),
CreaturesDiedThisTurnCount.instance, true
).setText("with a +1/+1 counter on it for each creature that died this turn.")
).withFlavorWord("Elite Troops").addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).withFlavorWord("Elite Troops").addHint(CreaturesDiedThisTurnHint.instance));
}
private SautekhImmortal(final SautekhImmortal card) {

View file

@ -33,7 +33,7 @@ public final class ScavengingGhoul extends CardImpl {
// At the beginning of each end step, put a corpse counter on Scavenging Ghoul for each creature that died this turn.
this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.CORPSE.createInstance(),
CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false).addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
CreaturesDiedThisTurnCount.instance, true), TargetController.ANY, false).addHint(CreaturesDiedThisTurnHint.instance));
// Remove a corpse counter from Scavenging Ghoul: Regenerate Scavenging Ghoul.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(),
new RemoveCountersSourceCost(CounterType.CORPSE.createInstance())));

View file

@ -45,7 +45,7 @@ public final class TallymanOfNurgle extends CardImpl {
"If seven or more creatures died this turn, instead you draw seven cards and you lose 7 life"
).addEffect(new LoseLifeSourceControllerEffect(7)).addOtherwiseEffect(new LoseLifeSourceControllerEffect(1)),
TargetController.YOU, MorbidCondition.instance, false
).withFlavorWord("The Seven-fold Chant").addHint(CreaturesDiedThisTurnHint.instance), new CreaturesDiedWatcher());
).withFlavorWord("The Seven-fold Chant").addHint(CreaturesDiedThisTurnHint.instance));
}
private TallymanOfNurgle(final TallymanOfNurgle card) {

View file

@ -24,7 +24,6 @@ public final class UrborgJustice extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}{B}");
// Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn.
this.getSpellAbility().addWatcher(new CreaturesDiedWatcher());
SacrificeEffect sacrificeEffect = new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new UrborgJusticeDynamicValue(), "");
sacrificeEffect.setText("Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn");

View file

@ -1299,6 +1299,7 @@ public abstract class GameImpl implements Game {
newWatchers.add(new BlockingOrBlockedWatcher());
newWatchers.add(new EndStepCountWatcher());
newWatchers.add(new CommanderPlaysCountWatcher()); // commander plays count uses in non commander games by some cards
newWatchers.add(new CreaturesDiedWatcher());
// runtime check - allows only GAME scope (one watcher per game)
newWatchers.forEach(watcher -> {