- First steps towards fixing Phased/Phased indirectly permanents.

This commit is contained in:
Jeff 2019-03-15 10:01:02 -05:00
parent da5058d0ab
commit 5c1f41f3a7
2 changed files with 12 additions and 4 deletions

View file

@ -38,7 +38,9 @@ public class DestroySourceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null) {
if (permanent != null
&& permanent.isPhasedIn()
&& !permanent.isPhasedOutIndirectly()) {
permanent.destroy(source.getSourceId(), game, noRegen);
return true;
}

View file

@ -58,11 +58,15 @@ public class DestroyTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int affectedTargets = 0;
if (multitargetHandling && source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate
if (multitargetHandling
&& source.getTargets().size() > 1
&& targetPointer instanceof FirstTargetPointer) { // Decimate
for (Target target : source.getTargets()) {
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
if (permanent != null
&& permanent.isPhasedIn()
&& !permanent.isPhasedOutIndirectly()) {
permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++;
}
@ -71,7 +75,9 @@ public class DestroyTargetEffect extends OneShotEffect {
} else {
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
if (permanent != null
&& permanent.isPhasedIn()
&& !permanent.isPhasedOutIndirectly()) {
permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++;
}