mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
* Some minor code optimisations.
This commit is contained in:
parent
c75c5ac9e1
commit
2e8bbf0406
4 changed files with 10 additions and 12 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue