Merge branch 'develop' into feature/hp_normal_attack

This commit is contained in:
Tungdv
2025-10-11 15:53:46 +07:00
2 changed files with 37 additions and 1 deletions
@@ -23,6 +23,7 @@ namespace ModelRenderer.Scripts.GameData
}
}
#region Dictionary for mapping id with other stuffs
public Dictionary<uint, DATA_TYPE> essence_id_data_type_map = new Dictionary<uint, DATA_TYPE>();
public Dictionary<int, uint> essence_index_id_map = new Dictionary<int, uint>();
public Dictionary<uint, object> essence_id_data_map = new Dictionary<uint, object>();
@@ -46,7 +47,9 @@ namespace ModelRenderer.Scripts.GameData
public Dictionary<uint, DATA_TYPE> addon_id_data_type_map = new Dictionary<uint, DATA_TYPE>();
public Dictionary<int, uint> addon_index_id_map = new Dictionary<int, uint>();
public Dictionary<uint, object> addon_id_data_map = new Dictionary<uint, object>();
#endregion
#region Arrays for storing the data
public EQUIPMENT_ADDON[] equipment_addon_array = new EQUIPMENT_ADDON[0];
public WEAPON_MAJOR_TYPE[] weapon_major_type_array = new WEAPON_MAJOR_TYPE[0];
public WEAPON_SUB_TYPE[] weapon_sub_type_array = new WEAPON_SUB_TYPE[0];
@@ -283,6 +286,7 @@ namespace ModelRenderer.Scripts.GameData
public FASHION_SUITE_ESSENCE[] fashion_suite_essence_array = new FASHION_SUITE_ESSENCE[0];
public FASHION_BEST_COLOR_CONFIG[] fashion_best_color_config_array = new FASHION_BEST_COLOR_CONFIG[0];
public SIGN_AWARD_CONFIG[] sign_award_config_array = new SIGN_AWARD_CONFIG[0];
#endregion
public int load_data(string pathname = "")
{
@@ -1480,6 +1484,34 @@ namespace ModelRenderer.Scripts.GameData
return id;
}
/// <summary>
/// Go through the id - DATA_TYPE map and return the id with the given data type.
/// </summary>
/// <param name="idSpace">The id space to search in. Each id space has its own id - DATA_TYPE map.</param>
/// <param name="dataType">The data type to search for.</param>
/// <returns>The id with the given data type. Return 0 if no id is found.</returns>
public uint get_id_with_data_type(ID_SPACE idSpace, DATA_TYPE dataType)
{
switch (idSpace)
{
case ID_SPACE.ID_SPACE_ESSENCE:
foreach (var item in essence_id_data_type_map)
{
if (item.Value == dataType)
{
return item.Key;
}
}
break;
// TODO: Add other id spaces here.
default:
return 0;
}
return 0;
}
void add_id_data(ID_SPACE idSpace, uint id, object data)
{
switch (idSpace)
@@ -5,6 +5,10 @@ using ModelRenderer.Scripts.Common;
namespace BrewMonster
{
public class ExpTypesConstants
{
public const int NUM_WEAPON_TYPE = 14;
}
public class ElementDataConstants
{
public const int ELEMENTDATA_NUM_PROFESSION = 12; // Number of professions
@@ -4870,7 +4874,7 @@ namespace BrewMonster
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public ushort[] name; // name
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = ExpTypesConstants.NUM_WEAPON_TYPE)]
public uint[] action_mask; // fashion weapon action masks
}