mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Merge branch 'stackdesc3' into 'master'
AnimateEffect / DamageDealEffect improve getStackDescription See merge request core-developers/forge!6176
This commit is contained in:
@@ -238,51 +238,45 @@ public class AnimateEffect extends AnimateEffectBase {
|
|||||||
|
|
||||||
// if power is -1, we'll assume it's not just setting toughness
|
// if power is -1, we'll assume it's not just setting toughness
|
||||||
if (power != null && toughness != null) {
|
if (power != null && toughness != null) {
|
||||||
sb.append("become");
|
sb.append(tgts.size() == 1 ? "becomes " : "become ");
|
||||||
if (tgts.size() == 1) {
|
|
||||||
sb.append("s ");
|
|
||||||
}
|
|
||||||
sb.append(" ").append(power).append("/").append(toughness);
|
sb.append(" ").append(power).append("/").append(toughness);
|
||||||
} else if (power != null) {
|
} else if (power != null) {
|
||||||
sb.append("power becomes ").append(power);
|
sb.append("power becomes ").append(power);
|
||||||
} else if (toughness != null) {
|
} else if (toughness != null) {
|
||||||
sb.append("toughness becomes ").append(toughness);
|
sb.append("toughness becomes ").append(toughness);
|
||||||
} else{
|
} else {
|
||||||
sb.append("become");
|
sb.append(tgts.size() == 1 ? "becomes " : "become ");
|
||||||
if (tgts.size() == 1) {
|
|
||||||
sb.append("s ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colors.size() > 0) {
|
|
||||||
sb.append(" ");
|
|
||||||
}
|
|
||||||
if (colors.contains("ChosenColor")) {
|
if (colors.contains("ChosenColor")) {
|
||||||
sb.append("color of that player's choice");
|
sb.append("color of that player's choice");
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < colors.size(); i++) {
|
for (int i = 0; i < colors.size(); i++) {
|
||||||
sb.append(colors.get(i));
|
sb.append(colors.get(i)).append(" ");
|
||||||
if (i < (colors.size() - 1)) {
|
if (i < (colors.size() - 1)) {
|
||||||
sb.append(" and ");
|
sb.append("and ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append(" ");
|
|
||||||
if (types.contains("ChosenType")) {
|
if (types.contains("ChosenType")) {
|
||||||
sb.append("type of player's choice ");
|
sb.append("type of player's choice ");
|
||||||
} else {
|
} else {
|
||||||
for (int i = types.size() - 1; i >= 0; i--) {
|
for (int i = 0; i < types.size(); i++) {
|
||||||
sb.append(types.get(i));
|
String type = types.get(i);
|
||||||
sb.append(" ");
|
if (i == 0 && tgts.size() == 1) {
|
||||||
|
sb.append(Lang.startsWithVowel(type) ? "an " : "a ");
|
||||||
|
}
|
||||||
|
sb.append(CardType.CoreType.isValidEnum(type) ? type.toLowerCase() : type).append(" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keywords.size() > 0) {
|
if (keywords.size() > 0) {
|
||||||
sb.append("with ");
|
sb.append("with ");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < keywords.size(); i++) {
|
for (int i = 0; i < keywords.size(); i++) {
|
||||||
sb.append(keywords.get(i));
|
sb.append(keywords.get(i)).append(" ");
|
||||||
if (i < (keywords.size() - 1)) {
|
if (i < (keywords.size() - 1)) {
|
||||||
sb.append(" and ");
|
sb.append("and ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sb.append(abilities)
|
// sb.append(abilities)
|
||||||
@@ -290,17 +284,17 @@ public class AnimateEffect extends AnimateEffectBase {
|
|||||||
if (!permanent) {
|
if (!permanent) {
|
||||||
final String duration = sa.getParam("Duration");
|
final String duration = sa.getParam("Duration");
|
||||||
if ("UntilEndOfCombat".equals(duration)) {
|
if ("UntilEndOfCombat".equals(duration)) {
|
||||||
sb.append(" until end of combat.");
|
sb.append("until end of combat.");
|
||||||
} else if ("UntilHostLeavesPlay".equals(duration)) {
|
} else if ("UntilHostLeavesPlay".equals(duration)) {
|
||||||
sb.append(" until ").append(host).append(" leaves the battlefield.");
|
sb.append("until ").append(host).append(" leaves the battlefield.");
|
||||||
} else if ("UntilYourNextUpkeep".equals(duration)) {
|
} else if ("UntilYourNextUpkeep".equals(duration)) {
|
||||||
sb.append(" until your next upkeep.");
|
sb.append("until your next upkeep.");
|
||||||
} else if ("UntilYourNextTurn".equals(duration)) {
|
} else if ("UntilYourNextTurn".equals(duration)) {
|
||||||
sb.append(" until your next turn.");
|
sb.append("until your next turn.");
|
||||||
} else if ("UntilControllerNextUntap".equals(duration)) {
|
} else if ("UntilControllerNextUntap".equals(duration)) {
|
||||||
sb.append(" until its controller's next untap step.");
|
sb.append("until its controller's next untap step.");
|
||||||
} else {
|
} else {
|
||||||
sb.append(" until end of turn.");
|
sb.append("until end of turn.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sb.append(".");
|
sb.append(".");
|
||||||
|
|||||||
@@ -43,19 +43,13 @@ public class DamageDealEffect extends DamageBaseEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<GameObject> targets = SpellAbilityEffect.getTargets(spellAbility);
|
List<GameObject> targets = SpellAbilityEffect.getTargets(spellAbility);
|
||||||
if (targets.isEmpty()) {
|
final List<Card> definedSources = AbilityUtils.getDefinedCards(spellAbility.getHostCard(), spellAbility.getParam("DamageSource"), spellAbility);
|
||||||
|
|
||||||
|
if (targets.isEmpty() || definedSources.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Card> definedSources = AbilityUtils.getDefinedCards(spellAbility.getHostCard(), spellAbility.getParam("DamageSource"), spellAbility);
|
stringBuilder.append(definedSources.get(0).toString()).append(" deals").append(" ").append(dmg).append(" damage ");
|
||||||
|
|
||||||
if (!definedSources.isEmpty() && definedSources.get(0) != spellAbility.getHostCard()) {
|
|
||||||
stringBuilder.append(definedSources.get(0).toString()).append(" deals");
|
|
||||||
} else {
|
|
||||||
stringBuilder.append("Deals");
|
|
||||||
}
|
|
||||||
|
|
||||||
stringBuilder.append(" ").append(dmg).append(" damage ");
|
|
||||||
|
|
||||||
// if use targeting we show all targets and corresponding damage
|
// if use targeting we show all targets and corresponding damage
|
||||||
if (spellAbility.usesTargeting()) {
|
if (spellAbility.usesTargeting()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user