mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed Double face cards triggerd ability and Moonscarred Werewolf. Issue #55
This commit is contained in:
parent
5cb18092a0
commit
222b74c8ea
2 changed files with 6 additions and 6 deletions
|
@ -36,7 +36,6 @@ import mage.MageInt;
|
|||
import mage.Mana;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
|
@ -44,6 +43,7 @@ import mage.abilities.effects.common.BasicManaEffect;
|
|||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ public class MoonscarredWerewolf extends CardImpl<MoonscarredWerewolf> {
|
|||
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
// {tap}: Add {G}{G} to your mana pool.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost()));
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost()));
|
||||
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Moonscarred Werewolf.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability,
|
||||
|
|
|
@ -57,7 +57,7 @@ public class TriggeredAbilities extends HashMap<String, TriggeredAbility> {
|
|||
if (ability.isInUseableZone(game, null, true)) {
|
||||
MageObject object = getMageObject(event, game, ability);
|
||||
if (object != null) {
|
||||
if (checkAbilityStillExists(ability, object)) {
|
||||
if (checkAbilityStillExists(ability, event, object)) {
|
||||
if (object instanceof Permanent) {
|
||||
ability.setControllerId(((Permanent) object).getControllerId());
|
||||
}
|
||||
|
@ -71,13 +71,13 @@ public class TriggeredAbilities extends HashMap<String, TriggeredAbility> {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean checkAbilityStillExists(TriggeredAbility ability, MageObject object) {
|
||||
private boolean checkAbilityStillExists(TriggeredAbility ability, GameEvent event, MageObject object) {
|
||||
boolean exists = true;
|
||||
if (!object.getAbilities().contains(ability)) {
|
||||
exists = false;
|
||||
if (object instanceof PermanentCard) {
|
||||
PermanentCard permanent = (PermanentCard)object;
|
||||
if (permanent.canTransform()) {
|
||||
if (permanent.canTransform() && event.getType() == GameEvent.EventType.TRANSFORMED) {
|
||||
exists = permanent.getCard().getAbilities().contains(ability);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue