This commit is contained in:
PCBrew
2025-11-01 19:20:47 +07:00
parent cbaa228446
commit 2dc4c9ae1c
6 changed files with 71 additions and 44 deletions
@@ -1,32 +1,36 @@
using System.Collections.Generic;
using UnityEngine;
public class CECComboSkillState
namespace BrewMonster
{
public static CECComboSkillState instance;
public static CECComboSkillState Instance {
get
{
if (instance == null)
{
instance = new CECComboSkillState();
}
return instance;
}
set => instance = value;
}
private Dictionary<uint, CECSkill> m_inherentSkillMap = new Dictionary<uint, CECSkill>();
public CECSkill GetInherentSkillByID(uint skillID)
public class CECComboSkillState
{
if (m_inherentSkillMap.TryGetValue(skillID, out CECSkill skill))
public static CECComboSkillState instance;
public static CECComboSkillState Instance
{
return skill;
get
{
if (instance == null)
{
instance = new CECComboSkillState();
}
return instance;
}
set => instance = value;
}
else
private Dictionary<uint, CECSkill> m_inherentSkillMap = new Dictionary<uint, CECSkill>();
public CECSkill GetInherentSkillByID(uint skillID)
{
return null;
if (m_inherentSkillMap.TryGetValue(skillID, out CECSkill skill))
{
return skill;
}
else
{
return null;
}
}
}
}
}
@@ -18,7 +18,8 @@ namespace BrewMonster.Scripts.Skills
set => instance = value;
}
Dictionary<int, ElementSkill> m_allProfSkills = new Dictionary<int, ElementSkill>();
Dictionary<int, List<int>> m_allRankProfSkills = new Dictionary<int, List<int>>();
public void Initialize()
{
// Çå¿ÕËùÓм¼ÄÜ£¬·ÀÖ¹ÒòΪ¶à¸ö½ÇÉ«µÇ¼µ¼ÖÂÖØ¸´¼ÓÔØ¼¼ÄÜ
@@ -89,35 +90,31 @@ namespace BrewMonster.Scripts.Skills
bool isSameClass = (cls == playerCls || cls == 255);
bool isProvidedByNPC = npcSkills.Contains(curID);
/*if (isSameClass && isProvidedByNPC)
if (isSameClass && isProvidedByNPC)
{
m_allProfSkills[curID] = pSkill;
m_allProfSkills[(int)curID] = pSkill;
if (!m_allRankProfSkills.ContainsKey(pSkill.GetRank()))
m_allRankProfSkills[pSkill.GetRank()] = new List<int>();
m_allRankProfSkills[pSkill.GetRank()].Add(curID);
m_allRankProfSkills[pSkill.GetRank()].Add((int)curID);
}
else
{
pSkill.Destroy();
}*/
}
// --- B3: Sắp xếp skill trong từng rank theo thứ tự hiển thị ---
/*foreach (var kvp in m_allRankProfSkills)
foreach (var kvp in m_allRankProfSkills)
{
kvp.Value.Sort((lhs, rhs) =>
{
var lSkill = GNET.ElementSkill.Create(lhs, 1);
var rSkill = GNET.ElementSkill.Create(rhs, 1);
var lSkill = ElementSkill.Create((uint)lhs, 1);
var rSkill = ElementSkill.Create((uint)rhs, 1);
bool result;
if (lSkill.GetType() == GNET.ElementSkill.TYPE_PASSIVE &&
rSkill.GetType() != GNET.ElementSkill.TYPE_PASSIVE)
if (lSkill.GetType() == (byte)skill_type.TYPE_PASSIVE &&
rSkill.GetType() != (byte)skill_type.TYPE_PASSIVE)
{
result = false;
}
else if (lSkill.GetType() != GNET.ElementSkill.TYPE_PASSIVE &&
rSkill.GetType() == GNET.ElementSkill.TYPE_PASSIVE)
else if (lSkill.GetType() != (byte)skill_type.TYPE_PASSIVE &&
rSkill.GetType() == (byte)skill_type.TYPE_PASSIVE)
{
result = true;
}
@@ -126,12 +123,9 @@ namespace BrewMonster.Scripts.Skills
result = lSkill.GetShowOrder() < rSkill.GetShowOrder();
}
lSkill.Destroy();
rSkill.Destroy();
return result ? -1 : 1;
});
}*/
}
}
@@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using Unity.VisualScripting;
namespace BrewMonster.Scripts.Skills
{
@@ -112,7 +114,28 @@ namespace BrewMonster.Scripts.Skills
public static uint NextSkill(uint id = 0)
{
//TODO: Implement this
return 0;
var map = SkillStub.GetMap();
// if map is empty, return 0
if (map.Count == 0)
return 0;
// If start == 0, return the first entrys value
if (id == 0)
{
var first = map.First();
return first.Value.GetId();
}
// Try to find 'start' key
var keys = map.Keys.OrderBy(k => k).ToList();
int index = keys.IndexOf(id);
if (index == -1 || index + 1 >= keys.Count)
return 0; // no next skill
var nextKey = keys[index + 1];
return map[nextKey].GetId();
}
public static ElementSkill Create(uint id, int n)
{
@@ -138,7 +161,6 @@ namespace BrewMonster.Scripts.Skills
// Чͷž: <-0.001Ŀ -0.001-0.001 ĬϹ룬>0.001 ͷž
public virtual float GetPrayRange(float range, float prayplus) { return 0; }
//
public virtual int GetRank() { return 0; }
// ѧϰnҪҼ
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2099d0c0fdfc641509729652b0ed485f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+1 -1
View File
@@ -18,7 +18,7 @@ EditorSettings:
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
m_ProjectGenerationRootNamespace:
m_ProjectGenerationRootNamespace: BrewMonster
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_EnableEditorAsyncCPUTextureLoading: 0