mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
* Gain ability effect: fixed rollback error with AI games and too many cards (related to d202278ccd);
This commit is contained in:
parent
8a69ea97e7
commit
9f882824a0
5 changed files with 51 additions and 109 deletions
|
|
@ -102,18 +102,6 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
|||
perm.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
if (!(excludeSource && perm.getId().equals(source.getSourceId())) && selectedByRuntimeData(perm, source, game)) {
|
||||
if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) {
|
||||
perm.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,20 +104,6 @@ public class GainAbilityControlledEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
||||
if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) {
|
||||
for (Ability abilityToAdd : ability) {
|
||||
perm.addAbility(abilityToAdd, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,18 +99,6 @@ public class LoseAbilityAllEffect extends ContinuousEffectImpl {
|
|||
perm.removeAbilities(ability, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
|
||||
Map<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
|
||||
if (LKIBattlefield != null) {
|
||||
for (MageObject mageObject : LKIBattlefield.values()) {
|
||||
Permanent perm = (Permanent) mageObject;
|
||||
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
|
||||
if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) {
|
||||
perm.removeAbilities(ability, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue