This commit is contained in:
SoulliesOfficial
2025-11-30 21:22:39 -05:00
parent afbeeebe75
commit 27af2b7eb2
16 changed files with 143 additions and 24 deletions

View File

@@ -20,11 +20,9 @@ namespace Continentis.MainGame
TextInterpreter.SetVariable(keyword.Key, keyword.Key);
}
}
public static void InterpretText(CardInstance card, bool overrideDescription = false)
public static string InterpretText(CardInstance card, string textToInterpret)
{
//card.contentSubmodule.keywords.Clear();
foreach (KeyValuePair<string, float> attribute in card.attributeSubmodule.attributeGroup.current)
{
TextInterpreter.SetVariable(attribute.Key, attribute.Value);
@@ -34,13 +32,18 @@ namespace Continentis.MainGame
TextInterpreter.SetFunction("Attribute", new Func<string, string>((name) => GetAttribute(card, name, true, false)));
TextInterpreter.SetFunction("Attribute", new Func<string, bool, string>((name, high) => GetAttribute(card, name, high, false)));
TextInterpreter.SetFunction("Attribute", new Func<string, bool, bool, string>((name, high, percent) => GetAttribute(card, name, high, percent)));
string result = DynamicTextInterpreter.Parse(TextInterpreter, textToInterpret);
Debug.Log($"Interpreted Text: {result}");
return result;
}
public static void InterpretText(CardInstance card)
{
string descriptionToParse = card.contentSubmodule.originalFunctionText;
string result = DynamicTextInterpreter.Parse(TextInterpreter, descriptionToParse);
string result = InterpretText(card, descriptionToParse);
card.contentSubmodule.interpretedFunctionText = result;
Debug.Log($"Interpreted Description: {result}");
}
}