Skip to content

Commit

Permalink
- Fixed #8101. also little fix of Ranar the Ever Watchful for some si…
Browse files Browse the repository at this point in the history
…de-cases.
  • Loading branch information
jeffwadsworth committed Aug 6, 2021
1 parent 3406ef6 commit c1772cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Mage.Sets/src/mage/cards/c/CharmedPendant.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public Mana produceMana(Game game, Ability source) {
for (Mana manaOption : manaOptions) {
manaChoice.getChoices().add(manaOption.toString());
}
if (manaChoice.getChoices().isEmpty()) { // no mana choices available
return mana;
}
if (controller.choose(outcome, manaChoice, game)) {
for (Mana manaOption : manaOptions) {
if (manaChoice.getChoice().equals(manaOption.toString())) {
Expand Down
7 changes: 4 additions & 3 deletions Mage.Sets/src/mage/cards/r/RanarTheEverWatchful.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public RanarTheEverWatchful(UUID ownerId, CardSetInfo setInfo) {

// The first card you foretell each turn costs 0 to foretell
Ability ability = new SimpleStaticAbility(new RanarTheEverWatchfulCostReductionEffect());
this.addAbility(ability);
this.addAbility(ability, new ForetoldWatcher());

// Whenever you exile one or more cards from your hand and/or permanents from the battlefield, create a 1/1 white Spirit creature token with flying.
this.addAbility(new RanarTheEverWatchfulTriggeredAbility());
Expand Down Expand Up @@ -87,7 +87,7 @@ public boolean apply(Game game, Ability source, Ability abilityToModify) {

@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
ForetoldWatcher watcher = game.getState().getWatcher(ForetoldWatcher.class, source.getControllerId());
ForetoldWatcher watcher = game.getState().getWatcher(ForetoldWatcher.class);
return (watcher != null
&& watcher.countNumberForetellThisTurn() == 0
&& abilityToModify.isControlledBy(source.getControllerId())
Expand Down Expand Up @@ -125,7 +125,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
}
switch (zEvent.getFromZone()) {
case BATTLEFIELD:
return controllerId.equals(zEvent.getSource().getControllerId())
return zEvent.getSource() != null // source ability/spell that exiled the permanent
&& controllerId.equals(zEvent.getSource().getControllerId())
&& numberExiled > 0; // must include both card permanents and tokens on the battlefield
case HAND:
return zEvent
Expand Down

0 comments on commit c1772cb

Please sign in to comment.