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

@@ -24,6 +24,10 @@ MonoBehaviour:
cardLayoutTags: [] cardLayoutTags: []
functionText: Card_Basic_ArmyOfTheDead_FunctionText functionText: Card_Basic_ArmyOfTheDead_FunctionText
cardDescription: cardDescription:
intentionIconKeys:
- Summon
intentionValueNames:
- SummonCount
baseWeight: 1 baseWeight: 1
variableAttributes: variableAttributes:
dictionaryList: dictionaryList:

View File

@@ -25,8 +25,11 @@ MonoBehaviour:
functionText: Card_Basic_GreatswordSweep_FunctionText functionText: Card_Basic_GreatswordSweep_FunctionText
cardDescription: '$Keyword("Sorcery"), $Keyword("LifeSteal"): $Attribute("LifeStealPercent", cardDescription: '$Keyword("Sorcery"), $Keyword("LifeSteal"): $Attribute("LifeStealPercent",
true, true), deal $Attribute("Damage") darkness damage 3 times to all enemies.' true, true), deal $Attribute("Damage") darkness damage 3 times to all enemies.'
intentionIconKeys: [] intentionIconKeys:
intentionValueNames: [] - PhysicsAttack
intentionValueNames:
- Damage
intentionTextOverride: $Attribute("Damage") ALL
baseWeight: 0 baseWeight: 0
variableAttributes: variableAttributes:
dictionaryList: dictionaryList:

View File

@@ -25,8 +25,11 @@ MonoBehaviour:
cardLayoutTags: [] cardLayoutTags: []
functionText: Card_Basic_HellfireBlast_FunctionText functionText: Card_Basic_HellfireBlast_FunctionText
cardDescription: cardDescription:
intentionIconKeys: [] intentionIconKeys:
intentionValueNames: [] - MagicAttack
- Weaken
intentionValueNames:
- Damage
baseWeight: 1 baseWeight: 1
variableAttributes: variableAttributes:
dictionaryList: dictionaryList:

View File

@@ -24,6 +24,10 @@ MonoBehaviour:
cardLayoutTags: [] cardLayoutTags: []
functionText: Card_Basic_NecromanticInfusion_FunctionText functionText: Card_Basic_NecromanticInfusion_FunctionText
cardDescription: cardDescription:
intentionIconKeys:
- Boost
- Weaken
intentionValueNames: []
baseWeight: 0 baseWeight: 0
variableAttributes: variableAttributes:
dictionaryList: dictionaryList:

View File

@@ -25,6 +25,11 @@ MonoBehaviour:
cardLayoutTags: [] cardLayoutTags: []
functionText: Card_Basic_WrathOfUnderworld_FunctionText functionText: Card_Basic_WrathOfUnderworld_FunctionText
cardDescription: cardDescription:
intentionIconKeys:
- PhysicsAttack
intentionValueNames:
- Damage
intentionTextOverride: '$Attribute("Damage")*$Attribute("AttackCount") '
baseWeight: 1 baseWeight: 1
variableAttributes: variableAttributes:
dictionaryList: dictionaryList:
@@ -44,6 +49,10 @@ MonoBehaviour:
Value: 0 Value: 0
index: 3 index: 3
isKeyDuplicated: 0 isKeyDuplicated: 0
- Key: AttackCount
Value: 5
index: 4
isKeyDuplicated: 0
dividerPosProp: 0.5 dividerPosProp: 0.5
originalAttributes: originalAttributes:
dictionaryList: [] dictionaryList: []

View File

@@ -18,16 +18,16 @@ namespace Continentis.Mods.Basic.Cards
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList) public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{ {
CommandGroup singleTargetGroup = new CommandGroup(ExecutionMode.Parallel, List<CommandBase> templates = new List<CommandBase>();
new Cmd_PlayAnimation(user.characterView, "Attack"), templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack"));
new Cmd_ParamFunction<CharacterBase>(0.4f, target => for (int i = 0; i < GetAttribute("AttackCount"); i++)
{
templates.Add(new Cmd_ParamFunction<CharacterBase>(0.4f, target =>
{ {
user.Attack(target, GetTargetedFinalDamage(target)); user.Attack(target, GetTargetedFinalDamage(target));
}) }));
); }
CommandGroup mainGroup = TargetListCommandGroup(targetList, ExecutionMode.Parallel, ExecutionMode.Sequential, templates.ToArray());
CommandGroup mainGroup = TargetListCommandGroup(targetList, ExecutionMode.Parallel, ExecutionMode.Sequential,
singleTargetGroup, singleTargetGroup, singleTargetGroup, singleTargetGroup, singleTargetGroup);
return new List<CommandBase> { mainGroup }; return new List<CommandBase> { mainGroup };
} }

View File

@@ -16,8 +16,6 @@ namespace Continentis.Mods.Basic.Cards
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList) public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
{ {
base.PlayEffect(targetList);
List<CommandBase> templates = new List<CommandBase>(); List<CommandBase> templates = new List<CommandBase>();
templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack")); templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack"));
for (int i = 0; i < GetAttribute("AttackCount"); i++) //多段攻击(段数可变)情况的处理 for (int i = 0; i < GetAttribute("AttackCount"); i++) //多段攻击(段数可变)情况的处理

View File

@@ -16,7 +16,36 @@ MonoBehaviour:
- groupName: CardKeywords - groupName: CardKeywords
items: items:
- TargetSelf - TargetSelf
- TargetEnemies
- TargetAllies
- TargetAll
- Strike
- Prick
- Slash
- Arcane
- Sorcery
- Swiftness
- Fortitude
- Prediction
- Exhaust
- Instant
- Unplayable
- Innate
- Tardy
- Retain
- Ethereal
- Reuse
- Physics
- Magic
- Exhaustible
- groupName: IntentionIconKeys - groupName: IntentionIconKeys
items: items:
- PhysicsAttack - PhysicsAttack
- MagicAttack - MagicAttack
- Block
- Dodge
- Dodge
- Summon
- Boost
- Weaken
- Unknown

View File

@@ -16,6 +16,41 @@ MonoBehaviour:
handCardObject: {fileID: 3557185132091183519, guid: 1dad8eae410dd904d9823c5abbb8c410, type: 3} handCardObject: {fileID: 3557185132091183519, guid: 1dad8eae410dd904d9823c5abbb8c410, type: 3}
intentionCardObject: {fileID: 3557185132091183519, guid: 743c2d994309ea8498ecc0f93f5d29eb, type: 3} intentionCardObject: {fileID: 3557185132091183519, guid: 743c2d994309ea8498ecc0f93f5d29eb, type: 3}
inspectionCardObject: {fileID: 0} inspectionCardObject: {fileID: 0}
intentionMarkIcons:
dictionaryList:
- Key: PhysicsAttack
Value: {fileID: 21300000, guid: b90cf57e4a981b74ab3222051c7b32de, type: 3}
index: 0
isKeyDuplicated: 0
- Key: MagicAttack
Value: {fileID: 21300000, guid: 71f2ca2dddf77894c8b0300a2f0cc392, type: 3}
index: 1
isKeyDuplicated: 0
- Key: Block
Value: {fileID: 21300000, guid: 914f95cd530d0944aa0a5a72a6c73af0, type: 3}
index: 2
isKeyDuplicated: 0
- Key: Dodge
Value: {fileID: 21300000, guid: 23d250c834ecea143a96400c89c7301d, type: 3}
index: 3
isKeyDuplicated: 0
- Key: Summon
Value: {fileID: 21300000, guid: eaf9e89bd74dad644a7367b0a6e61a16, type: 3}
index: 4
isKeyDuplicated: 0
- Key: Boost
Value: {fileID: 21300000, guid: 655278e667665b340b95bfe1cf45fde7, type: 3}
index: 5
isKeyDuplicated: 0
- Key: Weaken
Value: {fileID: 21300000, guid: bccfadd54b581ee478a7a83ed3870da2, type: 3}
index: 6
isKeyDuplicated: 0
- Key: Unknown
Value: {fileID: 21300000, guid: b1681d93c7048f04491995446f022c8a, type: 3}
index: 7
isKeyDuplicated: 0
dividerPosProp: 0.5
cardViewCollections: cardViewCollections:
dictionaryList: dictionaryList:
- Key: Basic - Key: Basic

View File

@@ -28,6 +28,7 @@ namespace Continentis.MainGame
public GameObject handCardObject; public GameObject handCardObject;
public GameObject intentionCardObject; public GameObject intentionCardObject;
public GameObject inspectionCardObject; public GameObject inspectionCardObject;
public SerializableDictionary<string, Sprite> intentionMarkIcons;
public SerializableDictionary<string, CardViewCollection> cardViewCollections; public SerializableDictionary<string, CardViewCollection> cardViewCollections;
[Header("GeneralUI")] public GameObject customImage; [Header("GeneralUI")] public GameObject customImage;

View File

@@ -21,10 +21,8 @@ namespace Continentis.MainGame
} }
} }
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) foreach (KeyValuePair<string, float> attribute in card.attributeSubmodule.attributeGroup.current)
{ {
TextInterpreter.SetVariable(attribute.Key, attribute.Value); TextInterpreter.SetVariable(attribute.Key, attribute.Value);
@@ -35,12 +33,17 @@ namespace Continentis.MainGame
TextInterpreter.SetFunction("Attribute", new Func<string, bool, string>((name, high) => GetAttribute(card, name, high, 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))); 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 descriptionToParse = card.contentSubmodule.originalFunctionText;
string result = DynamicTextInterpreter.Parse(TextInterpreter, descriptionToParse); string result = InterpretText(card, descriptionToParse);
card.contentSubmodule.interpretedFunctionText = result; card.contentSubmodule.interpretedFunctionText = result;
Debug.Log($"Interpreted Description: {result}");
} }
} }

View File

@@ -46,6 +46,7 @@ namespace Continentis.MainGame.Card
[Header("Intention")] [Header("Intention")]
public List<string> intentionIconKeys; public List<string> intentionIconKeys;
public List<string> intentionValueNames; public List<string> intentionValueNames;
public string intentionTextOverride;
public float baseWeight = 0f; public float baseWeight = 0f;
[Header("Attributes")] [Tooltip("可变属性这个属性会自动设置BaseAttr进入Original设置AttrBaseAttrOffset=0以及DisplayAttr进入Current")] [Header("Attributes")] [Tooltip("可变属性这个属性会自动设置BaseAttr进入Original设置AttrBaseAttrOffset=0以及DisplayAttr进入Current")]

View File

@@ -188,6 +188,26 @@ namespace Continentis.MainGame.Card
this.intentionCardView = intentionCardView; this.intentionCardView = intentionCardView;
intentionCardView.transform.localScale = Vector3.one; intentionCardView.transform.localScale = Vector3.one;
intentionCardView.Setup(this); intentionCardView.Setup(this);
string iconMarkKey = cardData.intentionIconKeys[0];
Sprite iconSprite = MainGameManager.Instance.basePrefabs.intentionMarkIcons[iconMarkKey];
if (string.IsNullOrEmpty(cardData.intentionTextOverride))
{
if (cardData.intentionValueNames.Count > 0)
{
string intentionValue = attributeSubmodule.GetRoundCurrentAttribute(cardData.intentionValueNames[0]).ToString();
intentionCardView.intentionMark.SetMark(iconSprite, intentionValue);
}
else
{
intentionCardView.intentionMark.SetMark(iconSprite);
}
}
else
{
intentionCardView.intentionMark.SetMark(iconSprite, cardData.intentionTextOverride);
}
return intentionCardView; return intentionCardView;
} }

View File

@@ -15,7 +15,13 @@ namespace Continentis.MainGame.Card
public void SetMark(Sprite sprite, string text) public void SetMark(Sprite sprite, string text)
{ {
markImage.sprite = sprite; markImage.sprite = sprite;
markText.text = text; markText.text = CardTextInterpreter.InterpretText(intentionCardView.card, text);
}
public void SetMark(Sprite sprite)
{
markImage.sprite = sprite;
markText.text = string.Empty;
} }
public void OnPointerEnter(PointerEventData eventData) public void OnPointerEnter(PointerEventData eventData)

View File

@@ -29,6 +29,7 @@ namespace Continentis.MainGame.Card
private SerializedProperty intentionIconKeysProp; private SerializedProperty intentionIconKeysProp;
private SerializedProperty intentionValueNamesProp; private SerializedProperty intentionValueNamesProp;
private SerializedProperty intentionTextOverrideProp;
private SerializedProperty baseWeightProp; private SerializedProperty baseWeightProp;
@@ -60,6 +61,7 @@ namespace Continentis.MainGame.Card
intentionIconKeysProp = serializedObject.FindProperty("intentionIconKeys"); intentionIconKeysProp = serializedObject.FindProperty("intentionIconKeys");
intentionValueNamesProp = serializedObject.FindProperty("intentionValueNames"); intentionValueNamesProp = serializedObject.FindProperty("intentionValueNames");
intentionTextOverrideProp = serializedObject.FindProperty("intentionTextOverride");
baseWeightProp = serializedObject.FindProperty("baseWeight"); baseWeightProp = serializedObject.FindProperty("baseWeight");
variableAttributesProp = serializedObject.FindProperty("variableAttributes"); variableAttributesProp = serializedObject.FindProperty("variableAttributes");
@@ -131,6 +133,7 @@ namespace Continentis.MainGame.Card
EditorGUILayout.LabelField("Attributes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Attributes", EditorStyles.boldLabel);
DrawListWithEditRefSelector(intentionIconKeysProp, "IntentionIconKeys"); DrawListWithEditRefSelector(intentionIconKeysProp, "IntentionIconKeys");
DrawListWithLocalSelector(intentionValueNamesProp, "variableAttributes"); DrawListWithLocalSelector(intentionValueNamesProp, "variableAttributes");
EditorGUILayout.PropertyField(intentionTextOverrideProp);
EditorGUILayout.PropertyField(baseWeightProp); EditorGUILayout.PropertyField(baseWeightProp);
EditorGUILayout.PropertyField(variableAttributesProp, true); EditorGUILayout.PropertyField(variableAttributesProp, true);
EditorGUILayout.PropertyField(originalAttributesProp, true); EditorGUILayout.PropertyField(originalAttributesProp, true);

View File

@@ -358,7 +358,7 @@ namespace SLSFramework.UModAssistance
if (GUILayout.Button(item, EditorStyles.label)) if (GUILayout.Button(item, EditorStyles.label))
{ {
_onSelectCallback?.Invoke(item); _onSelectCallback?.Invoke(item);
// this.Close(); // 可选:点击后关闭 this.Close(); // 可选:点击后关闭
} }
} }
} }