mirror of
https://github.com/correl/mage.git
synced 2025-04-11 01:01:05 -09:00
Fixed Jace, Architect of Though's first ability when attacking with more than one creature. Fixed that the unboost effect didn't check if the creature is still attacking and only applies, if this is true.
This commit is contained in:
parent
31d9934b5f
commit
c9a40f4431
1 changed files with 41 additions and 6 deletions
|
@ -42,6 +42,7 @@ import mage.abilities.LoyaltyAbility;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
|
@ -61,8 +62,8 @@ import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
import mage.target.common.TargetCardInExile;
|
import mage.target.common.TargetCardInExile;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,8 +149,7 @@ class JaceArchitectOfThoughtGainAbilityEffect extends ContinuousEffectImpl<JaceA
|
||||||
class JaceArchitectOfThoughtTriggeredAbility extends TriggeredAbilityImpl<JaceArchitectOfThoughtTriggeredAbility> {
|
class JaceArchitectOfThoughtTriggeredAbility extends TriggeredAbilityImpl<JaceArchitectOfThoughtTriggeredAbility> {
|
||||||
|
|
||||||
public JaceArchitectOfThoughtTriggeredAbility() {
|
public JaceArchitectOfThoughtTriggeredAbility() {
|
||||||
super(Constants.Zone.BATTLEFIELD, new BoostTargetEffect(-1,0, Duration.EndOfTurn));
|
super(Constants.Zone.BATTLEFIELD, new JaceArchitectOfThoughtEffectUnboostEffect(-1,0, Duration.EndOfTurn));
|
||||||
addTarget(new TargetCreaturePermanent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JaceArchitectOfThoughtTriggeredAbility(final JaceArchitectOfThoughtTriggeredAbility ability) {
|
public JaceArchitectOfThoughtTriggeredAbility(final JaceArchitectOfThoughtTriggeredAbility ability) {
|
||||||
|
@ -168,8 +168,10 @@ class JaceArchitectOfThoughtTriggeredAbility extends TriggeredAbilityImpl<JaceAr
|
||||||
Player defender = game.getPlayer(event.getTargetId());
|
Player defender = game.getPlayer(event.getTargetId());
|
||||||
Player you = game.getPlayer(controllerId);
|
Player you = game.getPlayer(controllerId);
|
||||||
if (attacker.getControllerId() != you.getId()
|
if (attacker.getControllerId() != you.getId()
|
||||||
&& defender == you) {
|
&& defender == you) {
|
||||||
getTargets().get(0).addTarget(attacker.getId(), this, game, true);
|
for (Effect effect : getEffects()) {
|
||||||
|
effect.setTargetPointer(new FixedTarget(attacker.getId()));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,6 +184,38 @@ class JaceArchitectOfThoughtTriggeredAbility extends TriggeredAbilityImpl<JaceAr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* effect only applies if creature continues to attack (if it's left the combat, it#s no longer attacking
|
||||||
|
*/
|
||||||
|
class JaceArchitectOfThoughtEffectUnboostEffect extends BoostTargetEffect {
|
||||||
|
|
||||||
|
public JaceArchitectOfThoughtEffectUnboostEffect(int power, int toughness, Duration duration) {
|
||||||
|
super(power, toughness, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public JaceArchitectOfThoughtEffectUnboostEffect (final JaceArchitectOfThoughtEffectUnboostEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JaceArchitectOfThoughtEffectUnboostEffect copy() {
|
||||||
|
return new JaceArchitectOfThoughtEffectUnboostEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||||
|
Permanent target = (Permanent) game.getPermanent(permanentId);
|
||||||
|
if (target != null && target.isAttacking()) {
|
||||||
|
return super.apply(game, source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class JaceArchitectOfThoughtEffect2 extends OneShotEffect<JaceArchitectOfThoughtEffect2> {
|
class JaceArchitectOfThoughtEffect2 extends OneShotEffect<JaceArchitectOfThoughtEffect2> {
|
||||||
|
|
||||||
public JaceArchitectOfThoughtEffect2() {
|
public JaceArchitectOfThoughtEffect2() {
|
||||||
|
@ -348,4 +382,5 @@ class JaceArchitectOfThoughtEffect3 extends OneShotEffect<JaceArchitectOfThought
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue