From 0d226a53cc7a1b93ee6a494be5965c37f98310ae Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 29 十二月 2025 23:21:24 +0800
Subject: [PATCH] 0312 武将招募增加心愿符

---
 Main/Config/PartialConfigs/SkillConfig.Partial.cs |   89 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 1 deletions(-)

diff --git a/Main/Config/PartialConfigs/SkillConfig.Partial.cs b/Main/Config/PartialConfigs/SkillConfig.Partial.cs
index 7e5d604..1f26680 100644
--- a/Main/Config/PartialConfigs/SkillConfig.Partial.cs
+++ b/Main/Config/PartialConfigs/SkillConfig.Partial.cs
@@ -9,16 +9,103 @@
 using System;
 using UnityEngine;
 using LitJson;
+using System.Linq;
 
 public partial class SkillConfig : ConfigBase<int, SkillConfig>
 {
+//澧炵泭锛� 3 5
+// 鍑忕泭锛� 4 6 14
+
+	public static readonly int[] GainSkillType = new int[] { 3, 5 }; // 1-鏅�氭敾鍑� 2-琚姩鎶�鑳� 3-涓撳睘鎶�鑳�
+
+	public static readonly int[] DebuffSkillType = new int[] { 4, 6, 14 };
+
 	public SkillType skillType;
 	public SkillCastMode castMode;
+
 	public SkillEffectType effectType;
-	public SkillEffectAnchor effectAnchor;
+
+	//鎶�鑳界被鍨嬶細鎶�鑳界瓑绾э細鎶�鑳�
+	static Dictionary<int, Dictionary<int, SkillConfig>> skillDics = new Dictionary<int, Dictionary<int, SkillConfig>>();
+	protected override void OnConfigParseCompleted()
+	{
+		base.OnConfigParseCompleted();
+
+		skillType = (SkillType)SkillType;
+		castMode = (SkillCastMode)CastPosition;
+		effectType = (SkillEffectType)EffectType;
+
+		if (DamageDivide == null || DamageDivide.Length == 0)
+		{
+			DamageDivide = new int[1][];
+			DamageDivide[0] = new int[] { 10000 };
+		}
+		
+		// #if UNITY_EDITOR
+		// 		if (Launch.Instance.isOpenBattleDebug)
+		// 		{
+		// 			if (castMode == SkillCastMode.None)
+		// 			{
+		// 				castMode = SkillCastMode.Target;
+		// 			}
+		// 		}
+		// #endif
+
+		Dictionary<int, SkillConfig> tempDic = null;
+		if (!skillDics.TryGetValue((int)skillType, out tempDic))
+		{
+			tempDic = new Dictionary<int, SkillConfig>();
+			skillDics.Add((int)skillType, tempDic);
+		}
+		tempDic[SkillLV] = this;
+	}
+
+	public bool IsGainBuff()
+    {
+        return Array.Exists(GainSkillType, type => type == (int)skillType);
+    }
+
+	public bool IsDebuff()
+    {
+        return Array.Exists(DebuffSkillType, type => type == (int)skillType);
+    }
 
 	public MotionName GetMotionName()
 	{
 		return Enum.Parse<MotionName>(SkillMotionName);
 	}
+
+	public static SkillConfig GetSkillConfig(int skillType, int skillLv)
+	{
+		Dictionary<int, SkillConfig> tempDic = null;
+		if (!skillDics.TryGetValue(skillType, out tempDic))
+		{
+			return null;
+		}
+		SkillConfig config = null;
+		tempDic.TryGetValue(skillLv, out config);
+		return config;
+	}
+
+	public List<int> GetDamageDivide(int _hitIndex)
+	{
+		List<int> damageDivide = new List<int>();
+		if (_hitIndex == 0 && DamageDivide.Length <= 0)
+		{
+			damageDivide.Add(10000);
+		}
+		else
+		{
+			if (DamageDivide.Length <= _hitIndex)
+			{
+				Debug.LogError("鎶�鑳戒激瀹冲垎甯冮厤缃敊璇� skillId: " + SkillID + " hitIndex: " + _hitIndex);
+				damageDivide.Add(10000);
+			}
+			else
+			{
+				damageDivide = DamageDivide[_hitIndex].ToList();
+			}
+		}
+		return damageDivide;
+    }
 }

--
Gitblit v1.8.0