forked from External/mage
Improved rule text generation for effects using DynamicValue.
This commit is contained in:
parent
1ed3f1f4f8
commit
ca82485772
22 changed files with 143 additions and 164 deletions
|
|
@ -77,10 +77,14 @@ public class DrawCardTargetEffect extends OneShotEffect<DrawCardTargetEffect> {
|
|||
public String getText(Ability source) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Target player draws ").append(amount).append(" card");
|
||||
if (amount instanceof StaticValue && amount.calculate(null, null) == 1) {
|
||||
} else {
|
||||
try {
|
||||
if (Integer.parseInt(amount.toString()) > 1) {
|
||||
sb.append("s");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
sb.append("s");
|
||||
}
|
||||
sb.append(amount.getMessage());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue