mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
CharmEffect: now allows zero choices
This commit is contained in:
@@ -67,6 +67,8 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
|
||||
if (num == min) {
|
||||
sb.append(Lang.getNumeral(num));
|
||||
} else if (min == 0) {
|
||||
sb.append("up to ").append(Lang.getNumeral(num));
|
||||
} else {
|
||||
sb.append(Lang.getNumeral(min)).append(" or ").append(list.size() == 2 ? "both" : "more");
|
||||
}
|
||||
@@ -101,6 +103,8 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
|
||||
if (num == min) {
|
||||
sb.append(Lang.getNumeral(num));
|
||||
} else if (min == 0) {
|
||||
sb.append("up to ").append(Lang.getNumeral(num));
|
||||
} else {
|
||||
sb.append(Lang.getNumeral(min)).append(" or ").append(list.size() == 2 ? "both" : "more");
|
||||
}
|
||||
@@ -158,7 +162,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
||||
|
||||
final int num = sa.hasParam("CharmNumOnResolve") ?
|
||||
AbilityUtils.calculateAmount(sa.getHostCard(), sa.getParam("CharmNumOnResolve"), sa)
|
||||
: Integer.parseInt(sa.hasParam("CharmNum") ? sa.getParam("CharmNum") : "1");
|
||||
: Integer.parseInt(sa.getParamOrDefault("CharmNum", "1"));
|
||||
final int min = sa.hasParam("MinCharmNum") ? Integer.parseInt(sa.getParam("MinCharmNum")) : num;
|
||||
|
||||
Card source = sa.getHostCard();
|
||||
|
||||
@@ -206,15 +206,20 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
} else {
|
||||
saDesc = sa.getDescription();
|
||||
}
|
||||
if (!saDesc.isEmpty()) {
|
||||
// string might have leading whitespace
|
||||
saDesc = saDesc.trim();
|
||||
if (!saDesc.isEmpty()) {
|
||||
// in case sa starts with CARDNAME, dont lowercase it
|
||||
if (!saDesc.startsWith(sa.getHostCard().getName())) {
|
||||
saDesc = saDesc.substring(0, 1).toLowerCase() + saDesc.substring(1);
|
||||
}
|
||||
if (saDesc.contains("ORIGINALHOST") && sa.getOriginalHost() != null) {
|
||||
saDesc = TextUtil.fastReplace(saDesc, "ORIGINALHOST", sa.getOriginalHost().getName());
|
||||
}
|
||||
result = TextUtil.fastReplace(result, "ABILITY", saDesc);
|
||||
} else {
|
||||
saDesc = "<take no action>"; // printed in case nothing is chosen for the ability (e.g. Charm with Up to X)
|
||||
}
|
||||
result = TextUtil.fastReplace(result, "ABILITY", saDesc);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
10
forge-gui/res/cardsfolder/upcoming/ravager_wurm.txt
Normal file
10
forge-gui/res/cardsfolder/upcoming/ravager_wurm.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
Name:Ravager Wurm
|
||||
ManaCost:3 R G G
|
||||
Types:Creature Wurm
|
||||
PT:4/5
|
||||
K:Riot
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCharm | TriggerDescription$ When CARDNAME enters the battlefield, ABILITY
|
||||
SVar:TrigCharm:DB$ Charm | MinCharmNum$ 0 | CharmNum$ 1 | Choices$ DBFight,DBDestroy
|
||||
SVar:DBFight:DB$ Fight | Defined$ TriggeredCardLKICopy | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Choose target creature you don't control | SpellDescription$ CARDNAME fights target creature you don't control.
|
||||
SVar:DBDestroy:DB$ Destroy | ValidTgts$ Land.hasNonManaActivatedAbility | TgtPrompt$ Select target land with an activated ability that isn't a mana ability | SpellDescription$ Destroy target land with an activated ability that iasn't a mana ability.
|
||||
Oracle:Riot (This creature enters the battlefield with your choice of a +1/+1 counter or haste.)\nWhen Ravager Wurm enters the battlefield, choose up to one -\n- Ravager Wurm fights target creature you don't control.\n- Destroy target land with an activated ability that isn't a mana ability.
|
||||
Reference in New Issue
Block a user