Some minor formatting.

This commit is contained in:
LevelX2 2014-03-15 17:44:08 +01:00
parent 982b95d47a
commit e103ddfd4b
5 changed files with 17 additions and 12 deletions

View file

@ -36,6 +36,7 @@ import mage.game.Game;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
*/
public abstract class StateTriggeredAbility<T extends StateTriggeredAbility<T>> extends TriggeredAbilityImpl<T> {

View file

@ -97,7 +97,9 @@ public abstract class TriggeredAbilityImpl<T extends TriggeredAbilityImpl<T>> ex
if (checkInterveningIfClause(game)) {
// log resolve of triggered ability
if (object != null && object.getName() != null) {
game.informPlayers(new StringBuilder(object.getName()).append(" triggered ability resolves: ").append(this.getRule(object.getName())).toString());
if (this.getRuleVisible()) {
game.informPlayers(new StringBuilder(object.getName()).append(" triggered ability resolves: ").append(this.getRule(object.getName())).toString());
}
} else {
game.informPlayers(new StringBuilder("Ability triggered: ").append(this.getRule()).toString());
}

View file

@ -1,8 +1,8 @@
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
@ -56,16 +56,13 @@ public class DiesCreatureTriggeredAbility extends TriggeredAbilityImpl<DiesCreat
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (game.getPermanent(sourceId) == null) {
if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
return false;
}
}
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
// why is this check neccessary?
// if (game.getPermanentOrLKIBattlefield(sourceId) == null) {
// return false;
// }
if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
if (setTargetPointer) {

View file

@ -35,6 +35,7 @@ import mage.game.events.GameEvent;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <T>
*/
public interface ReplacementEffect<T extends ReplacementEffect<T>> extends ContinuousEffect<T> {

View file

@ -90,7 +90,11 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect<ReturnF
return staticText;
}
StringBuilder sb = new StringBuilder();
sb.append("Return target ").append(mode.getTargets().get(0).getTargetName()).append(" to your hand");
sb.append("Return ");
if (!mode.getTargets().get(0).getTargetName().startsWith("another")) {
sb.append("target ");
}
sb.append(mode.getTargets().get(0).getTargetName()).append(" to your hand");
return sb.toString();
}