Fix copying fused spells; also fixes #9545 (#9546)

This commit is contained in:
Alex W. Jackson 2022-09-22 01:59:21 -04:00 committed by GitHub
parent fddec2ae9c
commit 3996127032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 81 deletions

View file

@ -16,7 +16,7 @@ public class DamageWithPowerFromOneToAnotherTargetEffect extends OneShotEffect {
String firstTargetName;
public DamageWithPowerFromOneToAnotherTargetEffect() {
this((String) null);
this("");
}
public DamageWithPowerFromOneToAnotherTargetEffect(String firstTargetName) {
@ -64,10 +64,6 @@ public class DamageWithPowerFromOneToAnotherTargetEffect extends OneShotEffect {
throw new IllegalStateException("It must have two targets, but found " + mode.getTargets().size());
}
String targetName = mode.getTargets().get(1).getTargetName();
// Target creature you control deals damage equal to its power to target creature you don't control
String sb = (this.firstTargetName != null ? this.firstTargetName : "Target " + mode.getTargets().get(0).getTargetName()) +
" deals damage equal to its power to " + (targetName.contains("other") ? "" : "target ") + targetName;
return sb;
return (firstTargetName.isEmpty() ? mode.getTargets().get(0).getDescription() : firstTargetName) + " deals damage equal to its power to " + mode.getTargets().get(1).getDescription();
}
}