mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Fixed errors on empty targets in some effects;
Added export code example for mtgjson4 project;
This commit is contained in:
parent
fd043fa913
commit
942ecc5328
4 changed files with 149 additions and 13 deletions
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -14,8 +12,9 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author North
|
||||
*/
|
||||
|
|
@ -161,11 +160,15 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
if (!targetDescription.isEmpty()) {
|
||||
sb.append(targetDescription);
|
||||
} else {
|
||||
String targetName = mode.getTargets().get(0).getTargetName();
|
||||
if (targetName.contains("any")) {
|
||||
sb.append(targetName);
|
||||
if (!mode.getTargets().isEmpty()) {
|
||||
String targetName = mode.getTargets().get(0).getTargetName();
|
||||
if (targetName.contains("any")) {
|
||||
sb.append(targetName);
|
||||
} else {
|
||||
sb.append("target ").append(targetName);
|
||||
}
|
||||
} else {
|
||||
sb.append("target ").append(targetName);
|
||||
sb.append("that target");
|
||||
}
|
||||
}
|
||||
if (!message.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -13,7 +12,6 @@ import mage.players.Player;
|
|||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class PutLibraryIntoGraveTargetEffect extends OneShotEffect {
|
||||
|
|
@ -61,7 +59,12 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
String message = amount.getMessage();
|
||||
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
|
||||
if (!mode.getTargets().isEmpty()) {
|
||||
sb.append("target ").append(mode.getTargets().get(0).getTargetName());
|
||||
} else {
|
||||
sb.append("that target");
|
||||
}
|
||||
|
||||
sb.append(" puts the top ");
|
||||
if (message.isEmpty()) {
|
||||
if (amount.toString().equals("1")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue