mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
- First steps towards fixing Phased/Phased indirectly permanents.
This commit is contained in:
parent
da5058d0ab
commit
5c1f41f3a7
2 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue