use of mage.abilities.keyword.MenaceAbility in project mage by magefree.
the class EiganjoUprisingEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
int amount = source.getManaCostsToPay().getX();
if (amount < 1) {
return false;
}
Token token = new SamuraiToken();
token.putOntoBattlefield(amount, game, source);
game.addEffect(new GainAbilityTargetEffect(new MenaceAbility(false)).setTargetPointer(new FixedTargets(token, game)), source);
game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance()).setTargetPointer(new FixedTargets(token, game)), source);
if (amount < 2) {
return true;
}
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
token.putOntoBattlefield(amount - 1, game, source, opponentId);
}
return true;
}
use of mage.abilities.keyword.MenaceAbility in project mage by magefree.
the class BladeOfTheOniEffect method apply.
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
if (sourcePermanent == null) {
return false;
}
Permanent permanent = game.getPermanent(sourcePermanent.getAttachedTo());
if (permanent == null) {
return false;
}
switch(layer) {
case AbilityAddingRemovingEffects_6:
permanent.addAbility(new MenaceAbility(false), source.getSourceId(), game);
return true;
case ColorChangingEffects_5:
permanent.getColor(game).setBlack(true);
return true;
case TypeChangingEffects_4:
permanent.addSubType(game, SubType.DEMON);
return true;
case PTChangingEffects_7:
if (sublayer != SubLayer.SetPT_7b) {
return false;
}
permanent.getPower().setValue(5);
permanent.getToughness().setValue(5);
return true;
}
return false;
}
Aggregations