disable default equipments

This commit is contained in:
Le Duc Anh
2025-11-19 11:04:21 +07:00
parent 542780ed10
commit b1fb758ce3
4 changed files with 122 additions and 74 deletions
@@ -3,63 +3,63 @@ namespace BrewMonster.Scripts
public class InventoryConst
{
// Index of item in equipment inventory
public static int EQUIPIVTR_WEAPON = 0;
public static int EQUIPIVTR_HEAD = 1;
public static int EQUIPIVTR_NECK = 2;
public static int EQUIPIVTR_SHOULDER = 3;
public static int EQUIPIVTR_BODY = 4;
public static int EQUIPIVTR_WAIST = 5;
public static int EQUIPIVTR_LEG = 6;
public static int EQUIPIVTR_FOOT = 7;
public static int EQUIPIVTR_WRIST = 8;
public static int EQUIPIVTR_FINGER1 = 9;
public static int EQUIPIVTR_FINGER2 = 10;
public static int EQUIPIVTR_PROJECTILE = 11;
public static int EQUIPIVTR_FLYSWORD = 12;
public static int EQUIPIVTR_FASHION_BODY = 13;
public static int EQUIPIVTR_FASHION_LEG = 14;
public static int EQUIPIVTR_FASHION_FOOT = 15;
public static int EQUIPIVTR_FASHION_WRIST = 16;
public static int EQUIPIVTR_RUNE = 17;
public static int EQUIPIVTR_BIBLE = 18;
public static int EQUIPIVTR_SPEAKER = 19;
public static int EQUIPIVTR_AUTOHP = 20;
public static int EQUIPIVTR_AUTOMP = 21;
public static int EQUIPIVTR_POCKET = 22;
public static int EQUIPIVTR_GOBLIN = 23;
public static int EQUIPIVTR_CERTIFICATE = 24;
public static int EQUIPIVTR_FASHION_HEAD = 25;
public static int EQUIPIVTR_FORCE_TOKEN = 26;
public static int EQUIPIVTR_DYNSKILLEQUIP1 = 27;
public static int EQUIPIVTR_DYNSKILLEQUIP2 = 28;
public static int EQUIPIVTR_FASHION_WEAPON = 29;
public static int SIZE_EQUIPIVTR = 30;
public static int EQUIPIVTR_UNUSED1 = 30;
public static int EQUIPIVTR_UNUSED2 = 31;
public static int EQUIPIVTR_GENERALCARD1 = 32;
public static int EQUIPIVTR_GENERALCARD2 = 33;
public static int EQUIPIVTR_GENERALCARD3 = 34;
public static int EQUIPIVTR_GENERALCARD4 = 35;
public static int EQUIPIVTR_GENERALCARD5 = 36;
public static int EQUIPIVTR_GENERALCARD6 = 37;
public static int SIZE_ALL_EQUIPIVTR = 38;
public static int SIZE_GENERALCARD_EQUIPIVTR = 6; // SIZE_ALL_EQUIPIVTR - EQUIPIVTR_GENERALCARD1
public const int EQUIPIVTR_WEAPON = 0;
public const int EQUIPIVTR_HEAD = 1;
public const int EQUIPIVTR_NECK = 2;
public const int EQUIPIVTR_SHOULDER = 3;
public const int EQUIPIVTR_BODY = 4;
public const int EQUIPIVTR_WAIST = 5;
public const int EQUIPIVTR_LEG = 6;
public const int EQUIPIVTR_FOOT = 7;
public const int EQUIPIVTR_WRIST = 8;
public const int EQUIPIVTR_FINGER1 = 9;
public const int EQUIPIVTR_FINGER2 = 10;
public const int EQUIPIVTR_PROJECTILE = 11;
public const int EQUIPIVTR_FLYSWORD = 12;
public const int EQUIPIVTR_FASHION_BODY = 13;
public const int EQUIPIVTR_FASHION_LEG = 14;
public const int EQUIPIVTR_FASHION_FOOT = 15;
public const int EQUIPIVTR_FASHION_WRIST = 16;
public const int EQUIPIVTR_RUNE = 17;
public const int EQUIPIVTR_BIBLE = 18;
public const int EQUIPIVTR_SPEAKER = 19;
public const int EQUIPIVTR_AUTOHP = 20;
public const int EQUIPIVTR_AUTOMP = 21;
public const int EQUIPIVTR_POCKET = 22;
public const int EQUIPIVTR_GOBLIN = 23;
public const int EQUIPIVTR_CERTIFICATE = 24;
public const int EQUIPIVTR_FASHION_HEAD = 25;
public const int EQUIPIVTR_FORCE_TOKEN = 26;
public const int EQUIPIVTR_DYNSKILLEQUIP1 = 27;
public const int EQUIPIVTR_DYNSKILLEQUIP2 = 28;
public const int EQUIPIVTR_FASHION_WEAPON = 29;
public const int SIZE_EQUIPIVTR = 30;
public const int EQUIPIVTR_UNUSED1 = 30;
public const int EQUIPIVTR_UNUSED2 = 31;
public const int EQUIPIVTR_GENERALCARD1 = 32;
public const int EQUIPIVTR_GENERALCARD2 = 33;
public const int EQUIPIVTR_GENERALCARD3 = 34;
public const int EQUIPIVTR_GENERALCARD4 = 35;
public const int EQUIPIVTR_GENERALCARD5 = 36;
public const int EQUIPIVTR_GENERALCARD6 = 37;
public const int SIZE_ALL_EQUIPIVTR = 38;
public const int SIZE_GENERALCARD_EQUIPIVTR = 6; // SIZE_ALL_EQUIPIVTR - EQUIPIVTR_GENERALCARD1
// Inventory size constants
public static int IVTRSIZE_EQUIPPACK = 32; // Equipment (SIZE_ALL_EQUIPIVTR)
public static int IVTRSIZE_TASKPACK = 32; // Task pack
public static int IVTRSIZE_DEALPACK = 24; // Deal pack
public static int IVTRSIZE_NPCPACK = 32; // NPC pack
public static int IVTRSIZE_TRASHBOX = 16; // Trash box
public static int IVTRSIZE_BUYPACK = 12; // Buy pack
public static int IVTRSIZE_SELLPACK = 12; // Sell pack
public static int IVTRSIZE_BOOTHSPACK = 12; // Default booth pack for selling
public static int IVTRSIZE_BOOTHBPACK = 12; // Default booth pack for buying
public static int IVTRSIZE_BOOTHSPACK_MAX = 20; // Max booth pack for selling (player may use certificate...)
public static int IVTRSIZE_BOOTHBPACK_MAX = 20; // Max booth pack for buying
public const int IVTRSIZE_EQUIPPACK = 32; // Equipment (SIZE_ALL_EQUIPIVTR)
public const int IVTRSIZE_TASKPACK = 32; // Task pack
public const int IVTRSIZE_DEALPACK = 24; // Deal pack
public const int IVTRSIZE_NPCPACK = 32; // NPC pack
public const int IVTRSIZE_TRASHBOX = 16; // Trash box
public const int IVTRSIZE_BUYPACK = 12; // Buy pack
public const int IVTRSIZE_SELLPACK = 12; // Sell pack
public const int IVTRSIZE_BOOTHSPACK = 12; // Default booth pack for selling
public const int IVTRSIZE_BOOTHBPACK = 12; // Default booth pack for buying
public const int IVTRSIZE_BOOTHSPACK_MAX = 20; // Max booth pack for selling (player may use certificate...)
public const int IVTRSIZE_BOOTHBPACK_MAX = 20; // Max booth pack for buying
public static int IVTRSIZE_CLIENTCARDPACK = 32; // Client pack for general card collection
public const int IVTRSIZE_CLIENTCARDPACK = 32; // Client pack for general card collection
public static int NUM_NPCIVTR = 8; // NPC inventory number
public const int NUM_NPCIVTR = 8; // NPC inventory number
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: dc1282c835bed1b43bc32a2a09563390
@@ -121,7 +121,7 @@ public partial class CECPlayer
{
if (_playerDefaultEquipments == null)
{
_playerDefaultEquipments = GetComponent<PlayerDefaultEquipments>();
_playerDefaultEquipments = GetComponentInChildren<PlayerDefaultEquipments>();
}
return _playerDefaultEquipments;
}
@@ -151,6 +151,10 @@ public partial class CECPlayer
{
var elemendataman = BrewMonster.ElementDataManProvider.GetElementDataMan();
DATA_TYPE DataType = default;
bool useDefaultUpper = false;
bool useDefaultLower = false;
bool useDefaultWrist = false;
bool useDefaultFoot = false;
for (int i = 0; i < InventoryConst.IVTRSIZE_EQUIPPACK; i++)
{
//TODO: The equipment ids store the stone information, we need to extract the stone information from the equipment id.
@@ -239,7 +243,6 @@ public partial class CECPlayer
case DATA_TYPE.DT_ARMOR_ESSENCE:
var pArmor = (ARMOR_ESSENCE)equipData;
var nLocation = pArmor.equip_location;
bool useDefaultArmor = true;
// BMLogger.Log($"ShowEquipments():: Armor Essence: {pArmor.RealName}");
var armorSkinPath = _GenEquipmentSkinPath(UnityGameSession.Instance.GetRoleInfo().occupation, UnityGameSession.Instance.GetRoleInfo().gender, pArmor.RealName);
@@ -267,31 +270,76 @@ public partial class CECPlayer
}
}
useDefaultArmor = false;
// disable/enable the default equipment
switch (nLocation)
{
case (uint)SkinIndex.SKIN_UPPER_BODY_INDEX:
useDefaultUpper = false;
break;
case (uint)SkinIndex.SKIN_LOWER_INDEX:
useDefaultLower = false;
break;
case (uint)SkinIndex.SKIN_WRIST_INDEX:
useDefaultWrist = false;
break;
case (uint)SkinIndex.SKIN_FOOT_INDEX:
useDefaultFoot = false;
break;
}
}
// disable/enable the default equipment
switch (nLocation)
else
{
case (uint)SkinIndex.SKIN_UPPER_BODY_INDEX:
PlayerDefaultEquipments.DefaultUpper.SetActive(useDefaultArmor);
break;
case (uint)SkinIndex.SKIN_LOWER_INDEX:
PlayerDefaultEquipments.DefaultLower.SetActive(useDefaultArmor);
break;
case (uint)SkinIndex.SKIN_WRIST_INDEX:
PlayerDefaultEquipments.DefaultWirst.SetActive(useDefaultArmor);
break;
case (uint)SkinIndex.SKIN_FOOT_INDEX:
PlayerDefaultEquipments.DefaultFoot.SetActive(useDefaultArmor);
break;
// disable/enable the default equipment
switch (nLocation)
{
case (uint)SkinIndex.SKIN_UPPER_BODY_INDEX:
useDefaultUpper = true;
break;
case (uint)SkinIndex.SKIN_LOWER_INDEX:
useDefaultLower = true;
break;
case (uint)SkinIndex.SKIN_WRIST_INDEX:
useDefaultWrist = true;
break;
case (uint)SkinIndex.SKIN_FOOT_INDEX:
useDefaultFoot = true;
break;
}
}
break;
default:
break;
}
}
if (m_aEquips[i] == 0)
{
switch (i)
{
case InventoryConst.EQUIPIVTR_BODY:
useDefaultUpper = true;
break;
case InventoryConst.EQUIPIVTR_LEG:
useDefaultLower = true;
break;
case InventoryConst.EQUIPIVTR_WRIST:
useDefaultWrist = true;
break;
case InventoryConst.EQUIPIVTR_FOOT:
useDefaultFoot = true;
break;
}
}
}
// enable/disable the default equipment
PlayerDefaultEquipments.DefaultUpper.SetActive(useDefaultUpper);
PlayerDefaultEquipments.DefaultLower.SetActive(useDefaultLower);
PlayerDefaultEquipments.DefaultWirst.SetActive(useDefaultWrist);
PlayerDefaultEquipments.DefaultFoot.SetActive(useDefaultFoot);
}
#region Helper Methods
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6a8905cc691a49242a2b4519e56cd5bb