mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
* Hushwing Gryff - Fixed that log message was sent out too often (fixes #4548).
This commit is contained in:
parent
871b035bb4
commit
5f98cb685e
5 changed files with 41 additions and 19 deletions
|
|
@ -51,17 +51,17 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public class AmbuscadeShaman extends CardImpl {
|
||||
|
||||
public AmbuscadeShaman(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.subtype.add(SubType.ORC);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Ambuscade Shaman or another creature enters the battlefield under your control, that creature gets +2/+2 until end of turn.
|
||||
Effect effect = new BoostTargetEffect(2,2, Duration.EndOfTurn);
|
||||
Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
|
||||
effect.setText("that creature gets +2/+2 until end of turn");
|
||||
this.addAbility(new AmbuscadeShamanTriggeredAbility(effect));
|
||||
|
||||
|
||||
// Dash {3}{B} <i>(You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)</i>);
|
||||
this.addAbility(new DashAbility(this, "{3}{B}"));
|
||||
|
||||
|
|
@ -103,9 +103,7 @@ class AmbuscadeShamanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent.getControllerId().equals(this.controllerId)
|
||||
&& permanent.isCreature()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
this.getEffects().setTargetPointer(new FixedTarget(permanent, game));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -115,4 +113,4 @@ class AmbuscadeShamanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public String getRule() {
|
||||
return "Whenever {this} or another creature enters the battlefield under your control, that creature gets +2/+2 until end of turn.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
|
|
@ -39,9 +40,9 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
|
|
@ -55,7 +56,7 @@ import mage.game.permanent.Permanent;
|
|||
public class HushwingGryff extends CardImpl {
|
||||
|
||||
public HushwingGryff(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
this.subtype.add(SubType.HIPPOGRIFF);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -92,10 +93,15 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(event.getSourceId());
|
||||
MageObject enteringObject = game.getObject(event.getSourceId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null && sourceObject != null) {
|
||||
return sourceObject.getLogName() + " prevented ability of " + mageObject.getLogName() + " to trigger";
|
||||
Ability ability = (Ability) getValue("targetAbility");
|
||||
if (enteringObject != null && sourceObject != null && ability != null) {
|
||||
MageObject abilitObject = game.getObject(ability.getSourceId());
|
||||
if (abilitObject != null) {
|
||||
return sourceObject.getLogName() + " prevented ability of " + abilitObject.getLogName()
|
||||
+ " to trigger for " + enteringObject.getLogName() + " entering the battlefield.";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -111,7 +117,7 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
return true;
|
||||
return (((TriggeredAbility) ability).checkTrigger(event, game));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ package mage.cards.t;
|
|||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -51,7 +52,7 @@ import mage.game.permanent.Permanent;
|
|||
public class TorporOrb extends CardImpl {
|
||||
|
||||
public TorporOrb(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
// Creatures entering the battlefield don't cause abilities to trigger.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TorporOrbEffect()));
|
||||
|
|
@ -89,7 +90,7 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
if (ability != null && ability.getAbilityType() == AbilityType.TRIGGERED) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
return true;
|
||||
return (((TriggeredAbility) ability).checkTrigger(event, game));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -97,10 +98,15 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
|
||||
@Override
|
||||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(event.getSourceId());
|
||||
MageObject enteringObject = game.getObject(event.getSourceId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null && sourceObject != null) {
|
||||
return sourceObject.getLogName() + " prevented ability of " + mageObject.getLogName() + " to trigger";
|
||||
Ability ability = (Ability) getValue("targetAbility");
|
||||
if (enteringObject != null && sourceObject != null && ability != null) {
|
||||
MageObject abilitObject = game.getObject(ability.getSourceId());
|
||||
if (abilitObject != null) {
|
||||
return sourceObject.getLogName() + " prevented ability of " + abilitObject.getLogName()
|
||||
+ " to trigger for " + enteringObject.getLogName() + " entering the battlefield.";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue