mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -43,7 +43,7 @@ import forge.game.player.Player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this effect description with needed prelude and epilogue
|
||||
* Returns this effect description with needed prelude and epilogue.
|
||||
* @param params
|
||||
* @param commonSpell
|
||||
* @return
|
||||
@@ -59,12 +59,13 @@ import forge.game.player.Player;
|
||||
|
||||
// Own description
|
||||
String stackDesc = params.get("StackDescription");
|
||||
if ( stackDesc != null ) {
|
||||
if ( !"None".equalsIgnoreCase(stackDesc) ) // by typing "none" they want to suppress output
|
||||
sb.append( stackDesc.replace("CARDNAME", sa.getSourceCard().getName()));
|
||||
} else
|
||||
if (stackDesc != null) {
|
||||
if (!"None".equalsIgnoreCase(stackDesc)) { // by typing "none" they want to suppress output
|
||||
sb.append(stackDesc.replace("CARDNAME", sa.getSourceCard().getName()));
|
||||
}
|
||||
} else {
|
||||
sb.append(this.getStackDescription(sa));
|
||||
|
||||
}
|
||||
|
||||
// This inlcudes all subAbilities
|
||||
final AbilitySub abSub = sa.getSubAbility();
|
||||
@@ -95,14 +96,16 @@ import forge.game.player.Player;
|
||||
// Some checked target first and params["Defined"] then - @see targetIsPreferred
|
||||
// Some wanted empty list when params["Defined"] was not set - @see wantEmptyAsDefault
|
||||
// Poor me had to gather it all in a single place
|
||||
private final static List<Player> emptyPlayerList = Collections.unmodifiableList(new ArrayList<Player>());
|
||||
private static final List<Player> emptyPlayerList = Collections.unmodifiableList(new ArrayList<Player>());
|
||||
private List<Player> getTargetPlayers(SpellAbility sa, final boolean wantEmptyAsDefault, final boolean targetIsPreferred) {
|
||||
final Target tgt = sa.getTarget();
|
||||
final String defined = sa.getParam("Defined");
|
||||
if ( tgt != null && ( targetIsPreferred || ( StringUtils.isEmpty(defined) && !wantEmptyAsDefault ) ) )
|
||||
if (tgt != null && (targetIsPreferred || (StringUtils.isEmpty(defined) && !wantEmptyAsDefault))) {
|
||||
return tgt.getTargetPlayers();
|
||||
if ( StringUtils.isEmpty(defined) && wantEmptyAsDefault )
|
||||
}
|
||||
if (StringUtils.isEmpty(defined) && wantEmptyAsDefault) {
|
||||
return emptyPlayerList;
|
||||
}
|
||||
return AbilityFactory.getDefinedPlayers(sa.getSourceCard(), defined, sa);
|
||||
}
|
||||
|
||||
@@ -116,5 +119,4 @@ import forge.game.player.Player;
|
||||
return tgt != null ? tgt.getTargets() : AbilityFactory.getDefinedObjects(sa.getSourceCard(), sa.getParam("Defined"), sa);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user