forked from External/mage
* Fixed a bug that replacemet effects did not work if the source object of the replacemet effect also changed zone (fixes #759).
This commit is contained in:
parent
6bd17716cd
commit
01ef3f9354
3 changed files with 37 additions and 5 deletions
|
|
@ -331,6 +331,7 @@ public class ContinuousEffects implements Serializable {
|
|||
if(auraReplacementEffect.checksEventType(event, game) && auraReplacementEffect.applies(event, null, game)){
|
||||
replaceEffects.put(auraReplacementEffect, null);
|
||||
}
|
||||
boolean checkLKI = event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT);
|
||||
//get all applicable transient Replacement effects
|
||||
for (ReplacementEffect effect: replacementEffects) {
|
||||
if (!effect.checksEventType(event, game)) {
|
||||
|
|
@ -344,7 +345,7 @@ public class ContinuousEffects implements Serializable {
|
|||
HashSet<Ability> abilities = replacementEffects.getAbility(effect.getId());
|
||||
HashSet<Ability> applicableAbilities = new HashSet<>();
|
||||
for (Ability ability : abilities) {
|
||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, null, false)) {
|
||||
if (!(ability instanceof StaticAbility) || ability.isInUseableZone(game, null, checkLKI)) {
|
||||
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
||||
if (!game.getScopeRelevant() || effect.hasSelfScope() || !event.getTargetId().equals(ability.getSourceId())) {
|
||||
if (checkAbilityStillExists(ability, effect, event, game)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue