mirror of
https://github.com/correl/mage.git
synced 2025-04-10 01:01:05 -09:00
This commit is contained in:
parent
39edc3feef
commit
e195bddf09
2 changed files with 31 additions and 22 deletions
Mage.Sets/src/mage/cards/g
Mage/src/main/java/mage/abilities/effects/common/combat
|
@ -1,30 +1,16 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.*;
|
||||||
import mage.abilities.effects.AsThoughManaEffect;
|
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.combat.GoadTargetEffect;
|
import mage.abilities.effects.common.combat.GoadTargetEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AsThoughEffectType;
|
import mage.constants.*;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.ManaType;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
|
@ -38,12 +24,16 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801, LevelX2
|
* @author TheElk801, LevelX2
|
||||||
*/
|
*/
|
||||||
public final class GrenzoHavocRaiser extends CardImpl {
|
public final class GrenzoHavocRaiser extends CardImpl {
|
||||||
|
|
||||||
|
static final String goadEffectName = "goad target creature that player controls";
|
||||||
|
|
||||||
public GrenzoHavocRaiser(UUID ownerId, CardSetInfo setInfo) {
|
public GrenzoHavocRaiser(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{R}");
|
||||||
|
|
||||||
|
@ -56,7 +46,7 @@ public final class GrenzoHavocRaiser extends CardImpl {
|
||||||
// Whenever a creature you control deals combat damage to a player, choose one —
|
// Whenever a creature you control deals combat damage to a player, choose one —
|
||||||
//Goad target creature that player controls;
|
//Goad target creature that player controls;
|
||||||
Effect effect = new GoadTargetEffect();
|
Effect effect = new GoadTargetEffect();
|
||||||
effect.setText("goad target creature that player controls");
|
effect.setText(goadEffectName);
|
||||||
Ability ability = new GrenzoHavocRaiserTriggeredAbility(effect);
|
Ability ability = new GrenzoHavocRaiserTriggeredAbility(effect);
|
||||||
//or Exile the top card of that player's library. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
|
//or Exile the top card of that player's library. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
|
||||||
Mode mode = new Mode();
|
Mode mode = new Mode();
|
||||||
|
@ -77,12 +67,15 @@ public final class GrenzoHavocRaiser extends CardImpl {
|
||||||
|
|
||||||
class GrenzoHavocRaiserTriggeredAbility extends TriggeredAbilityImpl {
|
class GrenzoHavocRaiserTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
|
String damagedPlayerName = null;
|
||||||
|
|
||||||
public GrenzoHavocRaiserTriggeredAbility(Effect effect) {
|
public GrenzoHavocRaiserTriggeredAbility(Effect effect) {
|
||||||
super(Zone.BATTLEFIELD, effect, false);
|
super(Zone.BATTLEFIELD, effect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GrenzoHavocRaiserTriggeredAbility(final GrenzoHavocRaiserTriggeredAbility ability) {
|
public GrenzoHavocRaiserTriggeredAbility(final GrenzoHavocRaiserTriggeredAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
|
this.damagedPlayerName = ability.damagedPlayerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -97,11 +90,22 @@ class GrenzoHavocRaiserTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
this.damagedPlayerName = null;
|
||||||
|
this.getEffects().get(0).setText(GrenzoHavocRaiser.goadEffectName);
|
||||||
|
|
||||||
Player damagedPlayer = game.getPlayer(event.getPlayerId());
|
Player damagedPlayer = game.getPlayer(event.getPlayerId());
|
||||||
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
||||||
if (damagedPlayer != null && permanent != null
|
Permanent abilitySourcePermanent = this.getSourcePermanentIfItStillExists(game);
|
||||||
&& ((DamagedEvent) event).isCombatDamage()
|
if (damagedPlayer == null || permanent == null || abilitySourcePermanent == null) {
|
||||||
&& isControlledBy(permanent.getControllerId())) {
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((DamagedEvent) event).isCombatDamage() && isControlledBy(permanent.getControllerId())) {
|
||||||
|
|
||||||
|
this.damagedPlayerName = damagedPlayer.getLogName();
|
||||||
|
this.getEffects().get(0).setText(GrenzoHavocRaiser.goadEffectName + " (" + this.damagedPlayerName + ")");
|
||||||
|
game.informPlayers(abilitySourcePermanent.getLogName() + " triggered for damaged " + this.damagedPlayerName);
|
||||||
|
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + damagedPlayer.getLogName() + " controls");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + damagedPlayer.getLogName() + " controls");
|
||||||
filter.add(new ControllerIdPredicate(damagedPlayer.getId()));
|
filter.add(new ControllerIdPredicate(damagedPlayer.getId()));
|
||||||
this.getTargets().clear();
|
this.getTargets().clear();
|
||||||
|
|
|
@ -62,6 +62,11 @@ public class GoadTargetEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText(Mode mode) {
|
public String getText(Mode mode) {
|
||||||
return "goad target " + mode.getTargets().get(0).getTargetName() + ". <i>(Until your next turn, that creature attacks each combat if able and attacks a player other than you if able.)</i>";
|
if (staticText != null && !staticText.isEmpty()) {
|
||||||
|
return staticText;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "goad target " + (!mode.getTargets().isEmpty() ? mode.getTargets().get(0).getTargetName() : " creature")
|
||||||
|
+ ". <i>(Until your next turn, that creature attacks each combat if able and attacks a player other than you if able.)</i>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue