@Override public EnchantedCreatureBlockedTriggeredAbility copy() { return new EnchantedCreatureBlockedTriggeredAbility(this); } }
@Override public boolean checkTrigger(GameEvent event, Game game) { Permanent equipment = game.getPermanent(sourceId); if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipped = game.getPermanent(equipment.getAttachedTo()); if (equipped.getId().equals(event.getTargetId())) { getEffects().get(1).setTargetPointer(new FixedTarget(equipped, game)); return true; } } return false; }
public LaccolithRig(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature becomes blocked, you may have it deal damage equal to its power to target creature. If you do, the first creature assigns no combat damage this turn. Ability ability2 = new EnchantedCreatureBlockedTriggeredAbility(new LaccolithRigEffect(), true); ability2.addTarget(new TargetCreaturePermanent()); Effect effect = new GainAbilityTargetEffect(new SimpleStaticAbility(Zone.BATTLEFIELD, new AssignNoCombatDamageSourceEffect(Duration.Custom, true).setText("")), Duration.EndOfTurn, "If you do, the first creature assigns no combat damage this turn"); ability2.addEffect(effect); this.addAbility(ability2); }
public BestialFury(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(enchantAbility); // When Bestial Fury enters the battlefield, draw a card at the beginning of the next turn's upkeep. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse)), false)); // Whenever enchanted creature becomes blocked, it gets +4/+0 and gains trample until end of turn. Ability pumpAbility = new EnchantedCreatureBlockedTriggeredAbility(new BoostEnchantedEffect(4, 0, Duration.EndOfTurn), false); pumpAbility.addEffect(new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA, Duration.EndOfTurn)); this.addAbility(pumpAbility); }