* Scaleguard Sentinels - Fixed that the +1/+1 counter was not added if a dragon from hand was revealed.

This commit is contained in:
LevelX2 2015-03-20 18:08:19 +01:00
parent 0f37405480
commit 26c66799df
2 changed files with 14 additions and 5 deletions

View file

@ -47,6 +47,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
@ -124,9 +125,12 @@ class OratorOfOjutaiEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
if (watcher != null && watcher.castWithConditionTrue(source.getId())) {
controller.drawCards(1, game);
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
if (watcher != null && watcher.castWithConditionTrue(sourcePermanent.getSpellAbility().getId())) {
controller.drawCards(1, game);
}
}
return true;
}

View file

@ -43,6 +43,7 @@ import mage.counters.CounterType;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.watchers.common.DragonOnTheBattlefieldWhileSpellWasCastWatcher;
@ -110,7 +111,11 @@ class ScaleguardSentinelsCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
return (watcher != null && watcher.castWithConditionTrue(source.getId()));
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher");
return (watcher != null && watcher.castWithConditionTrue(sourcePermanent.getSpellAbility().getId()));
}
return false;
}
}