小修
This commit is contained in:
@@ -24,6 +24,10 @@ MonoBehaviour:
|
||||
cardLayoutTags: []
|
||||
functionText: Card_Basic_ArmyOfTheDead_FunctionText
|
||||
cardDescription:
|
||||
intentionIconKeys:
|
||||
- Summon
|
||||
intentionValueNames:
|
||||
- SummonCount
|
||||
baseWeight: 1
|
||||
variableAttributes:
|
||||
dictionaryList:
|
||||
|
||||
@@ -25,8 +25,11 @@ MonoBehaviour:
|
||||
functionText: Card_Basic_GreatswordSweep_FunctionText
|
||||
cardDescription: '$Keyword("Sorcery"), $Keyword("LifeSteal"): $Attribute("LifeStealPercent",
|
||||
true, true), deal $Attribute("Damage") darkness damage 3 times to all enemies.'
|
||||
intentionIconKeys: []
|
||||
intentionValueNames: []
|
||||
intentionIconKeys:
|
||||
- PhysicsAttack
|
||||
intentionValueNames:
|
||||
- Damage
|
||||
intentionTextOverride: $Attribute("Damage") ALL
|
||||
baseWeight: 0
|
||||
variableAttributes:
|
||||
dictionaryList:
|
||||
|
||||
@@ -25,8 +25,11 @@ MonoBehaviour:
|
||||
cardLayoutTags: []
|
||||
functionText: Card_Basic_HellfireBlast_FunctionText
|
||||
cardDescription:
|
||||
intentionIconKeys: []
|
||||
intentionValueNames: []
|
||||
intentionIconKeys:
|
||||
- MagicAttack
|
||||
- Weaken
|
||||
intentionValueNames:
|
||||
- Damage
|
||||
baseWeight: 1
|
||||
variableAttributes:
|
||||
dictionaryList:
|
||||
|
||||
@@ -24,6 +24,10 @@ MonoBehaviour:
|
||||
cardLayoutTags: []
|
||||
functionText: Card_Basic_NecromanticInfusion_FunctionText
|
||||
cardDescription:
|
||||
intentionIconKeys:
|
||||
- Boost
|
||||
- Weaken
|
||||
intentionValueNames: []
|
||||
baseWeight: 0
|
||||
variableAttributes:
|
||||
dictionaryList:
|
||||
|
||||
@@ -25,6 +25,11 @@ MonoBehaviour:
|
||||
cardLayoutTags: []
|
||||
functionText: Card_Basic_WrathOfUnderworld_FunctionText
|
||||
cardDescription:
|
||||
intentionIconKeys:
|
||||
- PhysicsAttack
|
||||
intentionValueNames:
|
||||
- Damage
|
||||
intentionTextOverride: '$Attribute("Damage")*$Attribute("AttackCount") '
|
||||
baseWeight: 1
|
||||
variableAttributes:
|
||||
dictionaryList:
|
||||
@@ -44,6 +49,10 @@ MonoBehaviour:
|
||||
Value: 0
|
||||
index: 3
|
||||
isKeyDuplicated: 0
|
||||
- Key: AttackCount
|
||||
Value: 5
|
||||
index: 4
|
||||
isKeyDuplicated: 0
|
||||
dividerPosProp: 0.5
|
||||
originalAttributes:
|
||||
dictionaryList: []
|
||||
|
||||
@@ -18,16 +18,16 @@ namespace Continentis.Mods.Basic.Cards
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup singleTargetGroup = new CommandGroup(ExecutionMode.Parallel,
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
new Cmd_ParamFunction<CharacterBase>(0.4f, target =>
|
||||
List<CommandBase> templates = new List<CommandBase>();
|
||||
templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack"));
|
||||
for (int i = 0; i < GetAttribute("AttackCount"); i++)
|
||||
{
|
||||
templates.Add(new Cmd_ParamFunction<CharacterBase>(0.4f, target =>
|
||||
{
|
||||
user.Attack(target, GetTargetedFinalDamage(target));
|
||||
})
|
||||
);
|
||||
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList, ExecutionMode.Parallel, ExecutionMode.Sequential,
|
||||
singleTargetGroup, singleTargetGroup, singleTargetGroup, singleTargetGroup, singleTargetGroup);
|
||||
}));
|
||||
}
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList, ExecutionMode.Parallel, ExecutionMode.Sequential, templates.ToArray());
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@ namespace Continentis.Mods.Basic.Cards
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
base.PlayEffect(targetList);
|
||||
|
||||
List<CommandBase> templates = new List<CommandBase>();
|
||||
templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack"));
|
||||
for (int i = 0; i < GetAttribute("AttackCount"); i++) //多段攻击(段数可变)情况的处理
|
||||
|
||||
@@ -16,7 +16,36 @@ MonoBehaviour:
|
||||
- groupName: CardKeywords
|
||||
items:
|
||||
- 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
|
||||
items:
|
||||
- PhysicsAttack
|
||||
- MagicAttack
|
||||
- Block
|
||||
- Dodge
|
||||
- Dodge
|
||||
- Summon
|
||||
- Boost
|
||||
- Weaken
|
||||
- Unknown
|
||||
|
||||
@@ -16,6 +16,41 @@ MonoBehaviour:
|
||||
handCardObject: {fileID: 3557185132091183519, guid: 1dad8eae410dd904d9823c5abbb8c410, type: 3}
|
||||
intentionCardObject: {fileID: 3557185132091183519, guid: 743c2d994309ea8498ecc0f93f5d29eb, type: 3}
|
||||
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:
|
||||
dictionaryList:
|
||||
- Key: Basic
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Continentis.MainGame
|
||||
public GameObject handCardObject;
|
||||
public GameObject intentionCardObject;
|
||||
public GameObject inspectionCardObject;
|
||||
public SerializableDictionary<string, Sprite> intentionMarkIcons;
|
||||
public SerializableDictionary<string, CardViewCollection> cardViewCollections;
|
||||
|
||||
[Header("GeneralUI")] public GameObject customImage;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
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, 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}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace Continentis.MainGame.Card
|
||||
[Header("Intention")]
|
||||
public List<string> intentionIconKeys;
|
||||
public List<string> intentionValueNames;
|
||||
public string intentionTextOverride;
|
||||
public float baseWeight = 0f;
|
||||
|
||||
[Header("Attributes")] [Tooltip("可变属性,这个属性会自动设置BaseAttr进入Original,设置Attr,BaseAttrOffset=0,以及DisplayAttr进入Current")]
|
||||
|
||||
@@ -188,6 +188,26 @@ namespace Continentis.MainGame.Card
|
||||
this.intentionCardView = intentionCardView;
|
||||
intentionCardView.transform.localScale = Vector3.one;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,13 @@ namespace Continentis.MainGame.Card
|
||||
public void SetMark(Sprite sprite, string text)
|
||||
{
|
||||
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)
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Continentis.MainGame.Card
|
||||
|
||||
private SerializedProperty intentionIconKeysProp;
|
||||
private SerializedProperty intentionValueNamesProp;
|
||||
private SerializedProperty intentionTextOverrideProp;
|
||||
private SerializedProperty baseWeightProp;
|
||||
|
||||
|
||||
@@ -60,6 +61,7 @@ namespace Continentis.MainGame.Card
|
||||
|
||||
intentionIconKeysProp = serializedObject.FindProperty("intentionIconKeys");
|
||||
intentionValueNamesProp = serializedObject.FindProperty("intentionValueNames");
|
||||
intentionTextOverrideProp = serializedObject.FindProperty("intentionTextOverride");
|
||||
baseWeightProp = serializedObject.FindProperty("baseWeight");
|
||||
|
||||
variableAttributesProp = serializedObject.FindProperty("variableAttributes");
|
||||
@@ -131,6 +133,7 @@ namespace Continentis.MainGame.Card
|
||||
EditorGUILayout.LabelField("Attributes", EditorStyles.boldLabel);
|
||||
DrawListWithEditRefSelector(intentionIconKeysProp, "IntentionIconKeys");
|
||||
DrawListWithLocalSelector(intentionValueNamesProp, "variableAttributes");
|
||||
EditorGUILayout.PropertyField(intentionTextOverrideProp);
|
||||
EditorGUILayout.PropertyField(baseWeightProp);
|
||||
EditorGUILayout.PropertyField(variableAttributesProp, true);
|
||||
EditorGUILayout.PropertyField(originalAttributesProp, true);
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace SLSFramework.UModAssistance
|
||||
if (GUILayout.Button(item, EditorStyles.label))
|
||||
{
|
||||
_onSelectCallback?.Invoke(item);
|
||||
// this.Close(); // 可选:点击后关闭
|
||||
this.Close(); // 可选:点击后关闭
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user