protected override EmbedBuilder AddLore(EmbedBuilder body) { var effects = Lore?.StartsWith("Pendulum Effect") == true?Lore?.Split("Monster Effect") : null; return(effects is null? base.AddLore(body) : body .AddField("Pendulum Effect", effects[0].Substring(15).Trim()) .AddField($"[ {Types.Join(" / ")} ]", effects[1].Trim())); }
public string GenerateJson(bool topLevel) { var b = new StringBuilder(); var b2 = new StringBuilder("display:{"); if (!string.IsNullOrWhiteSpace(Name)) { b2.AppendFormat("Name:\"{0}\",", Name.EscapeJsonString()); } if (Color != 0) { b2.AppendFormat("color:{0},", Color); } if (!string.IsNullOrWhiteSpace(Lore)) { var lines = Lore.Split(new[] { Environment.NewLine, "\r", "\n" }, StringSplitOptions.None); b2.Append("Lore:["); foreach (var line in lines) { b2.AppendFormat("\"{0}\",", line.EscapeJsonString()); } b2.Remove(b2.Length - 1, 1); b2.Append("],"); } b2.Remove(b2.Length - 1, 1); b2.Append("},"); if (b2.Length > 11) { b.Append(b2); } if (DisplayHideFlags != DisplayHideFlags.None) { b.AppendFormat("HideFlags:{0},", (int)DisplayHideFlags); } return(b.ToString()); }