use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class UnnaturalGrowthEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
ContinuousEffect effect = new BoostTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue());
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class UnleashFuryEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
game.addEffect(new BoostTargetEffect(permanent.getPower().getValue(), 0, Duration.EndOfTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class WhenFluffyBunniesAttackEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
ChoiceImpl choice = new ChoiceImpl(true);
choice.setMessage("Choose letter");
Set<String> choices = new HashSet<>();
for (Character letter = 'A'; letter <= 'Z'; letter++) {
choices.add(letter.toString());
}
choice.setChoices(choices);
if (controller != null && permanent != null && controller.choose(outcome, choice, game)) {
if (!game.isSimulation()) {
MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject != null) {
game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + choice.getChoice());
}
}
Character chosenLetter = choice.getChoice().charAt(0);
int unboostValue = 0;
String permName = permanent.getName();
for (int i = 0; i < permName.length(); i++) {
Character letter = permName.charAt(i);
if (Character.isLetter(letter) && Character.toUpperCase(letter) == chosenLetter) {
unboostValue--;
}
}
BoostTargetEffect effect = new BoostTargetEffect(unboostValue, unboostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class XenagosGodOfRevelsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature == null) {
return false;
}
int power = targetCreature.getPower().getValue();
game.addEffect(new BoostTargetEffect(power, power, Duration.EndOfTurn).setTargetPointer(this.getTargetPointer()), source);
return false;
}
use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.
the class BlizzardBrawlEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget());
Permanent creature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (creature1 == null) {
return false;
}
if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) >= 3) {
game.addEffect(new BoostTargetEffect(1, 0, Duration.EndOfTurn).setTargetPointer(new FixedTarget(creature1.getId(), game)), source);
game.addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTarget(creature1.getId(), game)), source);
}
if (creature2 == null) {
return true;
}
game.getState().processAction(game);
return creature1.fight(creature2, source, game);
}
Aggregations