Added cards. Updated mtg-cards-data.txt.

This commit is contained in:
North 2011-06-07 23:23:04 +03:00
parent b7c7290e6f
commit 79583a6ec2
12 changed files with 19690 additions and 19471 deletions

View file

@ -30,6 +30,8 @@ package mage.abilities.effects.common;
import mage.Constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
@ -42,9 +44,12 @@ import mage.game.permanent.Permanent;
public class DamageAllEffect extends OneShotEffect<DamageAllEffect> {
private FilterCreaturePermanent filter;
private int amount;
private DynamicValue amount;
public DamageAllEffect(int amount, FilterCreaturePermanent filter) {
this(new StaticValue(amount), filter);
}
public DamageAllEffect(DynamicValue amount, FilterCreaturePermanent filter) {
super(Outcome.Damage);
this.amount = amount;
this.filter = filter;
@ -64,14 +69,14 @@ public class DamageAllEffect extends OneShotEffect<DamageAllEffect> {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
permanent.damage(amount, source.getId(), game, true, false);
permanent.damage(amount.calculate(game, source), source.getId(), game, true, false);
}
return true;
}
@Override
public String getText(Ability source) {
return "{source} deals " + Integer.toString(amount) + " damage to each " + filter.getMessage();
return "{source} deals " + amount.toString() + " damage to each " + filter.getMessage() + amount.getMessage();
}
}

View file

@ -0,0 +1,53 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.Constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author North
*/
public class LoseLifeControllerEffect extends OneShotEffect<LoseLifeControllerEffect> {
protected int amount;
public LoseLifeControllerEffect(int amount) {
super(Outcome.Damage);
this.amount = amount;
}
public LoseLifeControllerEffect(final LoseLifeControllerEffect effect) {
super(effect);
}
@Override
public LoseLifeControllerEffect copy() {
return new LoseLifeControllerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent targetPermanent = game.getPermanent(source.getFirstTarget());
if (targetPermanent != null) {
Player player = game.getPlayer(targetPermanent.getControllerId());
if (player != null) {
player.loseLife(amount, game);
return true;
}
}
return false;
}
@Override
public String getText(Ability source) {
return "Its controller loses " + amount + " life";
}
}