* Some minor code optimisations.

This commit is contained in:
LevelX2 2014-01-27 18:04:14 +01:00
parent c75c5ac9e1
commit 2e8bbf0406
4 changed files with 10 additions and 12 deletions

View file

@ -94,10 +94,7 @@ class GeistOfSaintTraftEffect extends OneShotEffect<GeistOfSaintTraftEffect> {
public boolean apply(Game game, Ability source) {
AngelToken token = new AngelToken();
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
Permanent p = game.getPermanent(token.getLastAddedToken());
p.setTapped(true);
game.getCombat().addAttackingCreature(p.getId(), game);
if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true)) {
Effect effect = new ExileTargetEffect();
effect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
CreateDelayedTriggeredAbilityEffect createEffect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect));

View file

@ -95,10 +95,7 @@ class KessigCagebreakersEffect extends OneShotEffect<KessigCagebreakersEffect> {
WolfToken token = new WolfToken();
int count = player.getGraveyard().count(new FilterCreatureCard(), game);
for (int i = 0; i < count; i++) {
token.putOntoBattlefield(1, game, source.getId(), source.getControllerId());
Permanent permanent = game.getPermanent(token.getLastAddedToken());
permanent.setTapped(true);
game.getCombat().addAttackingCreature(permanent.getId(), game);
token.putOntoBattlefield(1, game, source.getId(), source.getControllerId(), true, true);
}
return true;
}

View file

@ -105,9 +105,8 @@ class PreeminentCaptainEffect extends OneShotEffect<PreeminentCaptainEffect> {
UUID cardId = target.getFirstTarget();
Card card = player.getHand().get(cardId, game);
if (card != null) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId())) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId(), true)) {
Permanent permanent = game.getPermanent(card.getId());
permanent.setTapped(true);
game.getCombat().addAttackingCreature(permanent.getId(), game);
}
}