Package mage.game.events

Examples of mage.game.events.DamagedEvent


    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) && event.getTargetId().equals(this.getControllerId())) {
            DamagedEvent damagedEvent = (DamagedEvent) event;
            return damagedEvent.isCombatDamage();
        }
        return false;
    }
View Full Code Here


    }
   
    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event instanceof DamagedEvent) {
            DamagedEvent damageEvent = (DamagedEvent) event;
            if (damageEvent.isCombatDamage()) {
                Permanent permanent = game.getPermanent(event.getSourceId());
                if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
                        && permanent.getControllerId().equals(this.getControllerId())) {
                    this.getEffects().clear();
                    this.getEffects().add(new GainLifeEffect(damageEvent.getAmount()));
                    return true;
                }
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of mage.game.events.DamagedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.