@Override public ControllerGotLifeCount copy() { return new ControllerGotLifeCount(); }
@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { return this.calculate(game, sourceAbility.getControllerId()); }
public VoraciousWurm(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add(SubType.WURM); this.power = new MageInt(2); this.toughness = new MageInt(2); // Voracious Wurm enters the battlefield with X +1/+1 counters on it, where X is the amount of life you've gained this turn. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ControllerGotLifeCount.getInstance(), true)), new PlayerGainedLifeWatcher()); }
public NightmaresThirst(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // You gain 1 life. Target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn. this.getSpellAbility().addEffect(new GainLifeEffect(1)); DynamicValue xValue = new MultipliedValue(ControllerGotLifeCount.getInstance(), -1); this.getSpellAbility().addEffect(new BoostTargetEffect( xValue, xValue, Duration.EndOfTurn, true ).setText("Target creature gets -X/-X until end of turn, where X is the amount of life you gained this turn.")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addWatcher(new PlayerGainedLifeWatcher()); }