mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
* Hamletback Goliath - fixed rollback error (#6882);
This commit is contained in:
parent
1d9d59a8a5
commit
dfaf09e76c
2 changed files with 8 additions and 10 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
|
@ -10,8 +8,8 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -20,14 +18,15 @@ import mage.game.events.GameEvent.EventType;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class HamletbackGoliath extends CardImpl {
|
public final class HamletbackGoliath extends CardImpl {
|
||||||
|
|
||||||
public HamletbackGoliath(UUID ownerId, CardSetInfo setInfo) {
|
public HamletbackGoliath(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{R}");
|
||||||
this.subtype.add(SubType.GIANT);
|
this.subtype.add(SubType.GIANT);
|
||||||
this.subtype.add(SubType.WARRIOR);
|
this.subtype.add(SubType.WARRIOR);
|
||||||
|
|
||||||
|
|
@ -72,7 +71,7 @@ class HamletbackGoliathTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
UUID targetId = event.getTargetId();
|
UUID targetId = event.getTargetId();
|
||||||
Permanent permanent = game.getPermanent(targetId);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
if (permanent.isCreature()
|
if (permanent != null && permanent.isCreature()
|
||||||
&& !(targetId.equals(this.getSourceId()))) {
|
&& !(targetId.equals(this.getSourceId()))) {
|
||||||
for (Effect effect : this.getEffects()) {
|
for (Effect effect : this.getEffects()) {
|
||||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.dynamicvalue.common.EffectKeyValue;
|
import mage.abilities.dynamicvalue.common.EffectKeyValue;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
|
|
@ -15,8 +13,9 @@ import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.NestOfScarabsBlackInsectToken;
|
import mage.game.permanent.token.NestOfScarabsBlackInsectToken;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author stravant
|
* @author stravant
|
||||||
*/
|
*/
|
||||||
public final class NestOfScarabs extends CardImpl {
|
public final class NestOfScarabs extends CardImpl {
|
||||||
|
|
@ -63,7 +62,7 @@ class NestOfScarabsTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
permanent = game.getPermanentEntering(event.getTargetId());
|
permanent = game.getPermanentEntering(event.getTargetId());
|
||||||
}
|
}
|
||||||
if (permanent.isCreature()) {
|
if (permanent != null && permanent.isCreature()) {
|
||||||
getEffects().forEach(effect -> effect.setValue("countersAdded", event.getAmount()));
|
getEffects().forEach(effect -> effect.setValue("countersAdded", event.getAmount()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue