mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
fixes
This commit is contained in:
parent
a99ef071c8
commit
3b1696d8f0
14 changed files with 102 additions and 31 deletions
|
|
@ -35,10 +35,12 @@ import mage.Constants.CardType;
|
|||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.keyword.LevelAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.LevelerCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -112,6 +114,21 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
this.cardNumber = card.getCardNumber();
|
||||
}
|
||||
|
||||
public void checkPermanentOnlyTriggers(ZoneChangeEvent event, Game game) {
|
||||
// we only want to trigger abilities that are not on the underlying card ie. have been added by another effect
|
||||
// card abilities will get triggered later when the card hits the new zone
|
||||
Card card = game.getCard(objectId).copy();
|
||||
for (TriggeredAbility ability: abilities.getTriggeredAbilities(event.getFromZone())) {
|
||||
if (!card.getAbilities().containsKey(ability.getId()))
|
||||
ability.checkTrigger(event, game);
|
||||
}
|
||||
for (TriggeredAbility ability: abilities.getTriggeredAbilities(event.getToZone())) {
|
||||
if (!card.getAbilities().containsKey(ability.getId()))
|
||||
ability.checkTrigger(event, game);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) {
|
||||
Zone fromZone = game.getZone(objectId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue