diff --git a/Assets/Mods/Basic/Characters/CombatBuffs/General/Sharpness.cs b/Assets/Mods/Basic/Characters/CombatBuffs/General/Sharpness.cs index c145ff3d..aa3e3245 100644 --- a/Assets/Mods/Basic/Characters/CombatBuffs/General/Sharpness.cs +++ b/Assets/Mods/Basic/Characters/CombatBuffs/General/Sharpness.cs @@ -10,15 +10,15 @@ namespace Continentis.Mods.Basic.Buffs { Initialize(BuffType.Positive, BuffDispelLevel.Strong); - this.contentSubmodule = new ContentSubmodule(this, false) + this.contentSubmodule = new ContentSubmodule(this) .AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString()); this.iconSubmodule = new IconSubmodule(this); this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true); - this.coreAttributeSubmodule = new CoreAttributeSubmodule(this); - this.coreAttributeSubmodule.numericChange.Add("PhysicsDamageDealtOffset", stack); + this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this); + this.generalAttributeSubmodule.numericChange.Add("PhysicsDamageDealtOffset", stack); this.eventSubmodule = new EventSubmodule(this); this.eventSubmodule.onDealAttack.Add("Sharpness", new PrioritizedAction(atkRes => diff --git a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Assassin.asset b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Assassin.asset index 49cbc6a6..4ce72607 100644 --- a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Assassin.asset +++ b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Assassin.asset @@ -140,11 +140,11 @@ MonoBehaviour: index: 20 isKeyDuplicated: 0 - Key: StaminaRecoverPerAction - Value: 0 + Value: 3 index: 21 isKeyDuplicated: 0 - Key: ManaRecoverPerAction - Value: 0 + Value: 3 index: 22 isKeyDuplicated: 0 - Key: Speed diff --git a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Cleric.asset b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Cleric.asset index 1ea7326b..aa91b418 100644 --- a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Cleric.asset +++ b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Cleric.asset @@ -140,11 +140,11 @@ MonoBehaviour: index: 20 isKeyDuplicated: 0 - Key: StaminaRecoverPerAction - Value: 0 + Value: 3 index: 21 isKeyDuplicated: 0 - Key: ManaRecoverPerAction - Value: 0 + Value: 3 index: 22 isKeyDuplicated: 0 - Key: Speed diff --git a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Knight.asset b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Knight.asset index 52410411..a8e160d9 100644 --- a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Knight.asset +++ b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Knight.asset @@ -140,11 +140,11 @@ MonoBehaviour: index: 20 isKeyDuplicated: 0 - Key: StaminaRecoverPerAction - Value: 0 + Value: 3 index: 21 isKeyDuplicated: 0 - Key: ManaRecoverPerAction - Value: 0 + Value: 3 index: 22 isKeyDuplicated: 0 - Key: Speed diff --git a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Mage.asset b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Mage.asset index f4e95396..ad2698d2 100644 --- a/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Mage.asset +++ b/Assets/Mods/Basic/Characters/Data/CharacterData_Basic_Mage.asset @@ -128,11 +128,11 @@ MonoBehaviour: index: 17 isKeyDuplicated: 0 - Key: StaminaRecoverPerAction - Value: 0 + Value: 3 index: 18 isKeyDuplicated: 0 - Key: ManaRecoverPerAction - Value: 0 + Value: 3 index: 19 isKeyDuplicated: 0 - Key: Speed diff --git a/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs b/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs index 656fdf6e..4c8fc1f1 100644 --- a/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs +++ b/Assets/Mods/Basic/Rules/Basic_AttributeRulesCollection.cs @@ -15,8 +15,8 @@ namespace Continentis.Mods.Basic.Rules } float level = core["Level"]; - general["MaximumHealth"] += Mathf.FloorToInt(level * 3); - general["MaximumMana"] += Mathf.FloorToInt(level / 2); + //general["MaximumHealth"] += Mathf.FloorToInt(level * 3); + //general["MaximumMana"] += Mathf.FloorToInt(level / 2); float strengthOffset = core["Strength"] - 12; general["MaximumStamina"] += Mathf.FloorToInt(strengthOffset / 4); //最大行动点加成 @@ -33,11 +33,13 @@ namespace Continentis.Mods.Basic.Rules float physiqueOffset = core["Physique"] - 12; general["MaximumHealth"] += core["Physique"] * 6; //最大生命值加成 + Debug.Log("Physique Offset: " + physiqueOffset); general["StaminaRecoverPerAction"] += Mathf.FloorToInt(physiqueOffset / 6); //每回合恢复行动点 general["OffsetFromPhysique"] += Mathf.FloorToInt(physiqueOffset / 3); //来自核心属性(体质)的调整值 float perceptionOffset = core["Perception"] - 12; general["DrawCardAmountPerAction"] += Mathf.FloorToInt(perceptionOffset / 6); //来自核心属性(感知)的每回合额外抽牌数量 + general["DrawCardAmountPerAction"] += 10; //TODO: 临时的,后续会移除 general["Awareness"] += perceptionOffset; //增加感知 general["OffsetFromPerception"] += Mathf.FloorToInt(perceptionOffset / 3); //来自核心属性(感知)的调整值 diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 9e583943..a9a5b30a 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -1505,6 +1505,8 @@ GameObject: - component: {fileID: 368630473} - component: {fileID: 368630475} - component: {fileID: 368630476} + - component: {fileID: 368630477} + - component: {fileID: 368630478} m_Layer: 5 m_Name: TeamSwitchButton m_TagString: Untagged @@ -1631,6 +1633,46 @@ MonoBehaviour: button: {fileID: 368630475} buttonText: {fileID: 1783939752} teamPileText: {fileID: 833598973} +--- !u!223 &368630477 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368630471} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 1 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 1 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 1876474179 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &368630478 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368630471} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 --- !u!1 &373312357 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/MainGame/Base/Interpreters/DynamicTextInterpreter.cs b/Assets/Scripts/MainGame/Base/Interpreters/DynamicTextInterpreter.cs index 8187fc33..c3b7d11d 100644 --- a/Assets/Scripts/MainGame/Base/Interpreters/DynamicTextInterpreter.cs +++ b/Assets/Scripts/MainGame/Base/Interpreters/DynamicTextInterpreter.cs @@ -37,7 +37,7 @@ namespace Continentis.MainGame public static string Parse(Interpreter interpreter, string template) { - try + //try { while (template.Contains("$")) { @@ -58,10 +58,10 @@ namespace Continentis.MainGame template = template.Substring(0, startIndex) + resultAsLiteral + template.Substring(endIndex + 1); } } - catch (Exception ex) + /*catch (Exception ex) { throw new Exception($"解析模板时发生严重错误: {ex.Message}\nStackTrace: {ex.StackTrace}"); - } + }*/ return template; } diff --git a/Assets/Scripts/MainGame/Card/CardMainFunctions.cs b/Assets/Scripts/MainGame/Card/CardMainFunctions.cs index 120e5533..779fe753 100644 --- a/Assets/Scripts/MainGame/Card/CardMainFunctions.cs +++ b/Assets/Scripts/MainGame/Card/CardMainFunctions.cs @@ -191,11 +191,6 @@ namespace Continentis.MainGame.Card this.user.ModifyStamina(-GetAttribute("StaminaCost")); this.user.ModifyMana(-GetAttribute("ManaCost")); - if (this.user is PlayerHero) - { - CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons(); - } - Debug.Log($"Starting to play card: {contentSubmodule.cardName}"); CommandQueueManager.Instance.AddCommand(new Cmd_Function(() => diff --git a/Assets/Scripts/MainGame/Card/LogicComponents/CardLogicComponent_SelectHandCards.cs b/Assets/Scripts/MainGame/Card/LogicComponents/CardLogicComponent_SelectHandCards.cs index 1f847a34..1cf3152a 100644 --- a/Assets/Scripts/MainGame/Card/LogicComponents/CardLogicComponent_SelectHandCards.cs +++ b/Assets/Scripts/MainGame/Card/LogicComponents/CardLogicComponent_SelectHandCards.cs @@ -33,9 +33,10 @@ namespace Continentis.MainGame.Card /// /// 目标指令组 /// 选择卡牌的描述性标题 + /// 是否包含队伍内的卡牌,如果不包含,则强制切换到角色手牌,且禁用切换按钮 /// 最大选择数量 /// 是否强制选择最大数量 - public void AddSelectionCommands(ref CommandGroup commandGroup, string title, int maxSelection, bool forceMax = false) + public void AddSelectionCommands(ref CommandGroup commandGroup, string title, int maxSelection, bool forceMax = false, bool includeTeam = false) { selectedCards = new List(); HandCardSelectionInterface handCardSelector = CombatUIManager.Instance.combatMainPage.handCardSelector; @@ -43,12 +44,21 @@ namespace Continentis.MainGame.Card commandGroup.AddCommand(new Cmd_Function(() => { handCardSelector.Setup(title, mainLogic.card, maxSelection, selectCondition, forceMax); + if (!includeTeam) + { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.SwitchToCurrentCharacter(); + CombatUIManager.Instance.combatMainPage.teamSwitchButton.button.interactable = false; + } })); commandGroup.AddCommand(new Cmd_WaitForUI(handCardSelector)); commandGroup.AddCommand(new Cmd_Function(() => { selectedCards = handCardSelector.selectedCards.ToList(); selectedCards.ForEach(selectEffect); + if (!includeTeam) + { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.button.interactable = true; + } })); } diff --git a/Assets/Scripts/MainGame/Character/CharacterBuff/BuffSubmodules.cs b/Assets/Scripts/MainGame/Character/CharacterBuff/BuffSubmodules.cs index 853f4889..d88ffa5f 100644 --- a/Assets/Scripts/MainGame/Character/CharacterBuff/BuffSubmodules.cs +++ b/Assets/Scripts/MainGame/Character/CharacterBuff/BuffSubmodules.cs @@ -39,7 +39,7 @@ namespace Continentis.MainGame.Character modifiedAttributes.AddRange(numericChange.Select(kvp => kvp.Key)); modifiedAttributes.AddRange(percentageChangeOfAccumulation.Select(kvp => kvp.Key)); modifiedAttributes.AddRange(percentageChangeOfMultiplication.Select(kvp => kvp.Key)); - + modifiedAttributes.ForEach(attr => character.attributeSubmodule.RefreshCoreAttribute(attr)); character.attributeSubmodule.RefreshAllGeneralAttributes(); //刷新核心属性后,需要刷新通用属性 diff --git a/Assets/Scripts/MainGame/Character/CharacterMainFunctions.cs b/Assets/Scripts/MainGame/Character/CharacterMainFunctions.cs index 2bc0dd58..2de897b6 100644 --- a/Assets/Scripts/MainGame/Character/CharacterMainFunctions.cs +++ b/Assets/Scripts/MainGame/Character/CharacterMainFunctions.cs @@ -46,6 +46,11 @@ namespace Continentis.MainGame.Character { ModifyAttribute("Stamina", staminaValue); ClampAttribute("Stamina", 0, GetAttribute("MaximumStamina")); + + if (this is PlayerHero) + { + CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons(); + } } /// @@ -63,6 +68,11 @@ namespace Continentis.MainGame.Character { ModifyAttribute("Mana", manaValue); ClampAttribute("Stamina", 0, GetAttribute("MaximumStamina")); + + if (this is PlayerHero) + { + CombatUIManager.Instance.combatMainPage.combatResourcesDisplayer.UpdateIcons(); + } } } diff --git a/Assets/Scripts/MainGame/Character/CharacterSubmodules/DeckSubmodule.cs b/Assets/Scripts/MainGame/Character/CharacterSubmodules/DeckSubmodule.cs index 1090f537..166e0eec 100644 --- a/Assets/Scripts/MainGame/Character/CharacterSubmodules/DeckSubmodule.cs +++ b/Assets/Scripts/MainGame/Character/CharacterSubmodules/DeckSubmodule.cs @@ -93,6 +93,7 @@ namespace Continentis.MainGame.Character new Cmd_DiscardCards(card.deck, new List() { card }, initiative, interval), new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 弃牌后的处理 })); @@ -111,6 +112,7 @@ namespace Continentis.MainGame.Character } discardCardGroup.AddCommand(new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 弃牌后的处理 })); @@ -124,9 +126,9 @@ namespace Continentis.MainGame.Character new Cmd_ExhaustCards(owner is PlayerHero, card.deck, new List() { card }, interval), new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 消耗牌后的处理 })); - return discardCardGroup; } @@ -142,6 +144,7 @@ namespace Continentis.MainGame.Character } discardCardGroup.AddCommand(new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 弃牌后的处理 })); @@ -155,6 +158,7 @@ namespace Continentis.MainGame.Character new Cmd_UsePowerCards(owner is PlayerHero, card.deck, new List() { card }, interval), new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 消耗牌后的处理 })); @@ -173,6 +177,7 @@ namespace Continentis.MainGame.Character } discardCardGroup.AddCommand(new Cmd_Function(0, () => { + CombatUIManager.Instance.combatMainPage.teamSwitchButton.UpdateTeamPileText(owner.team); //Debug.Log((context.sharedInfo["DrawnCards"] as List).Count); //TODO: 弃牌后的处理 })); diff --git a/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs b/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs index fe82c1fb..b6f7d77d 100644 --- a/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs +++ b/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs @@ -40,6 +40,12 @@ namespace Continentis.MainGame.UI discardPile.cardViews.Clear(); exhaustPile.cardViews.Clear(); gravePile.cardViews.Clear(); + + drawPile.UpdateCountText(); + handPile.UpdateCountText(); + discardPile.UpdateCountText(); + exhaustPile.UpdateCountText(); + gravePile.UpdateCountText(); } public PileBase Pile(string pileName) diff --git a/Assets/Scripts/MainGame/UI/CombatMainPage/HandPile.cs b/Assets/Scripts/MainGame/UI/CombatMainPage/HandPile.cs index a4d70e32..97ebf063 100644 --- a/Assets/Scripts/MainGame/UI/CombatMainPage/HandPile.cs +++ b/Assets/Scripts/MainGame/UI/CombatMainPage/HandPile.cs @@ -26,7 +26,7 @@ namespace Continentis.MainGame.UI if (count == 0 || index < 0) return Vector2.zero; - float cardSpacing = cardSpacingBase + cardSpacingFactor / count; + float cardSpacing = cardSpacingBase + Mathf.Max((cardSpacingFactor - (count * 20)), -200) / count; // 计算中间索引,保证手牌居中排列 float midIndex = (count - 1) / 2f; diff --git a/Assets/Scripts/MainGame/UI/CombatMainPage/PileBase.cs b/Assets/Scripts/MainGame/UI/CombatMainPage/PileBase.cs index 39708414..db873c93 100644 --- a/Assets/Scripts/MainGame/UI/CombatMainPage/PileBase.cs +++ b/Assets/Scripts/MainGame/UI/CombatMainPage/PileBase.cs @@ -15,7 +15,6 @@ namespace Continentis.MainGame.UI { base.Awake(); cardViews = new List(); - UpdateCountText(); } public virtual void AddCard(CardViewBase cardObject) @@ -40,7 +39,7 @@ namespace Continentis.MainGame.UI //Debug.Log($"Removed {cardObject.cardInstance.cardLogic.contentSubmodule.cardName} from {this.name}" ); } - private void UpdateCountText() + public void UpdateCountText() { if (cardCountText != null) { diff --git a/Assets/Scripts/MainGame/UI/CombatMainPage/TeamSwitchButton.cs b/Assets/Scripts/MainGame/UI/CombatMainPage/TeamSwitchButton.cs index 1c00f18d..2fb7cc53 100644 --- a/Assets/Scripts/MainGame/UI/CombatMainPage/TeamSwitchButton.cs +++ b/Assets/Scripts/MainGame/UI/CombatMainPage/TeamSwitchButton.cs @@ -21,24 +21,24 @@ namespace Continentis.MainGame.UI button.onClick.AddListener(() => { - isTeam = !isTeam; if (isTeam) { - SwitchToTeam(); - buttonText.text = "Team"; - teamPileText.gameObject.SetActive(true); + SwitchToCurrentCharacter(); + } else { - SwitchToCurrentCharacter(); - buttonText.text = "Hero"; - teamPileText.gameObject.SetActive(false); + SwitchToTeam(); + } }); } - private void SwitchToTeam() + public void SwitchToTeam() { + if(isTeam) return; + isTeam = true; + Sequence seq = DOTween.Sequence(); seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(-300f, 0.2f) .OnComplete(() => @@ -49,6 +49,8 @@ namespace Continentis.MainGame.UI { card.user = CombatMainManager.Instance.currentCharacter; card.RefreshCardAttributes(); + buttonText.text = "Team"; + teamPileText.gameObject.SetActive(true); }); })); @@ -57,8 +59,10 @@ namespace Continentis.MainGame.UI seq.Play(); } - private void SwitchToCurrentCharacter() + public void SwitchToCurrentCharacter() { + if(!isTeam) return; + isTeam = false; if (CombatMainManager.Instance.currentCharacter is PlayerHero playerHero) { Sequence seq = DOTween.Sequence(); @@ -67,6 +71,8 @@ namespace Continentis.MainGame.UI { CombatUIManager.Instance.combatMainPage.ClearAllCardViews(); playerHero.deckSubmodule.SetUpHandCardViews(); + buttonText.text = "Hero"; + teamPileText.gameObject.SetActive(false); })); seq.AppendInterval(0.1f); seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(80f, 0.2f)); @@ -81,6 +87,8 @@ namespace Continentis.MainGame.UI public void UpdateTeamPileText(CombatTeam team) { int currentCardCount = team.deckSubmodule.HandPile.Count; + + Debug.Log($"Current team hand pile count: {currentCardCount}"); gameObject.SetActive(currentCardCount != 0);