Fixes Phyrexian Totem

I thought phyrexian totem's ability should only trigger if what dealt
damage to it was a creature however that's not the case, it should
trigger only if Phyrexian Totem itself is a creature when it's dealt
damage to. Also fix it to use checkInterveningIfClause() (please review
this if it was done correctly) so it checks on resolution as well.

Also fixes to wrongly credited cards.
This commit is contained in:
FenrisulfrX 2015-03-24 23:05:09 -03:00
parent 8eeab28581
commit bac1e6618d
8 changed files with 27 additions and 21 deletions

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianBattleflies extends mage.sets.phyrexiavsthecoalition.PhyrexianBattleflies {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianColossus extends mage.sets.eighthedition.PhyrexianColossus {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianProcessor extends mage.sets.urzassaga.PhyrexianProcessor {

View file

@ -37,7 +37,6 @@ import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
@ -46,8 +45,8 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
@ -80,7 +79,7 @@ public class PhyrexianTotem extends CardImpl {
private class PhyrexianTotemToken extends Token {
PhyrexianTotemToken() {
super("", "a 5/5 black Horror artifact creature with trample");
super("Horror", "a 5/5 black Horror artifact creature with trample");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setBlack(true);
@ -107,19 +106,26 @@ class PhyrexianTotemTriggeredAbility extends TriggeredAbilityImpl {
return new PhyrexianTotemTriggeredAbility(this);
}
@Override
public boolean checkInterveningIfClause(Game game) {
Permanent permanent = game.getPermanentOrLKIBattlefield(getSourceId());
if (permanent != null) {
return permanent.getCardType().contains(CardType.CREATURE);
}
return false;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_CREATURE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if(event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
UUID controller = game.getControllerId(event.getTargetId());
if(controller != null) {
Player player = game.getPlayer(controller);
Card card = game.getCard(event.getSourceId());
if(player != null && card.getCardType().contains(CardType.CREATURE)) {
getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
((SacrificeEffect) getEffects().get(0)).setAmount(new StaticValue(event.getAmount()));
return true;
}
}
if (event.getTargetId().equals(getSourceId())) {
getEffects().get(0).setTargetPointer(new FixedTarget(getControllerId()));
((SacrificeEffect) getEffects().get(0)).setAmount(new StaticValue(event.getAmount()));
return true;
}
return false;
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianColossus extends mage.sets.eighthedition.PhyrexianColossus {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class HornetCannon extends mage.sets.phyrexiavsthecoalition.HornetCannon {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianTotem extends mage.sets.phyrexiavsthecoalition.PhyrexianTotem {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
/**
*
* @author anonymous
* @author FenrisulfrX
*/
public class PhyrexianColossus extends mage.sets.eighthedition.PhyrexianColossus {