Merge pull request 'feature/skill-data' (#121) from feature/skill-data into develop

Reviewed-on: https://git.brew.monster/Unity/perfect-world-unity/pulls/121
This commit is contained in:
hoangvd
2026-01-15 06:46:39 +00:00
44 changed files with 5003 additions and 2347 deletions
+276 -6
View File
@@ -115,25 +115,189 @@ PrefabInstance:
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 1464374634028484465, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_margin.z
value: 0.030044556
objectReference: {fileID: 0}
- target: {fileID: 1464374634028484465, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
- target: {fileID: 1464374634028484465, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 2100000, guid: 13f71bf0225d0c0439db9931000d75d0, type: 2}
- target: {fileID: 1464374634028484465, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_VerticalAlignment
value: 4096
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.x
value: -25.7078
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2224911469552029187, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: -4.397293
objectReference: {fileID: 0}
- target: {fileID: 2891120192736919771, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.x
value: 262.3562
objectReference: {fileID: 0}
- target: {fileID: 2891120192736919771, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.y
value: 25.9796
objectReference: {fileID: 0}
- target: {fileID: 2891120192736919771, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 74.25657
objectReference: {fileID: 0}
- target: {fileID: 2891120192736919771, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 28.228401
objectReference: {fileID: 0}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSize
value: 17
objectReference: {fileID: 0}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMax
value: 18
objectReference: {fileID: 0}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMin
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeBase
value: 17
objectReference: {fileID: 0}
- target: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 2100000, guid: 31b77628c21b17e45a6577a3d3d5aef0, type: 2}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.x
value: -18.9426
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3992890073798626326, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: -5.0738983
objectReference: {fileID: 0}
- target: {fileID: 4823752405346273106, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_Name
value: HUDPlayer
objectReference: {fileID: 0}
- target: {fileID: 5777532589522199890, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 2.300003
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_text
value: 0/0
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSize
value: 17
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMax
value: 18
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMin
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeBase
value: 17
objectReference: {fileID: 0}
- target: {fileID: 5872129684784782099, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 2100000, guid: 31b77628c21b17e45a6577a3d3d5aef0, type: 2}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_text
value: 0/0
value: 150K/150K
objectReference: {fileID: 0}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSize
value: 17
objectReference: {fileID: 0}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMax
value: 30
objectReference: {fileID: 0}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMin
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeBase
value: 17
objectReference: {fileID: 0}
- target: {fileID: 6583662924878292146, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 2100000, guid: 31b77628c21b17e45a6577a3d3d5aef0, type: 2}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_Pivot.x
value: 0.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_Pivot.y
value: 0.5
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.x
@@ -159,6 +323,18 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 133
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_LocalScale.x
value: 1.3
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_LocalScale.y
value: 1.3
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_LocalScale.z
value: 1.3
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@@ -189,11 +365,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 230.5
value: 25
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.y
value: -66.5
value: -9
objectReference: {fileID: 0}
- target: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -207,10 +383,68 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8086917028654197348, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_Type
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8086917028654197348, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_FillMethod
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.x
value: -20.6339
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8575537839465846660, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_AnchoredPosition.x
value: -2.8752
objectReference: {fileID: 0}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_text
value: 10
value: '105
'
objectReference: {fileID: 0}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontAsset
value:
objectReference: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontStyle
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMax
value: 17
objectReference: {fileID: 0}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_fontSizeMin
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8867137494968155958, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 2100000, guid: 31b77628c21b17e45a6577a3d3d5aef0, type: 2}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -219,6 +453,17 @@ PrefabInstance:
insertIndex: -1
addedObject: {fileID: 4616316815177720404}
m_SourcePrefab: {fileID: 100100000, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
--- !u!114 &246901321761552071 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5335503683694560306, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
m_PrefabInstance: {fileID: 5289107387155542773}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &835354389023896999 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4823752405346273106, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
@@ -241,6 +486,9 @@ MonoBehaviour:
expText: {fileID: 9091953190536401803}
nameText: {fileID: 6716045574192280964}
levelText: {fileID: 3632374887765724611}
healthImage: {fileID: 4133230328392276113}
manaImage: {fileID: 246901321761552071}
expImage: {fileID: 7351517459147011958}
neededExp: 0
--- !u!114 &1313768687643874887 stripped
MonoBehaviour:
@@ -280,6 +528,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &4133230328392276113 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8086917028654197348, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
m_PrefabInstance: {fileID: 5289107387155542773}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &6716045574192280964 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1464374634028484465, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
@@ -291,6 +550,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &7351517459147011958 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3414706020273276291, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
m_PrefabInstance: {fileID: 5289107387155542773}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &9091953190536401803 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3984476637502251390, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
@@ -443,7 +443,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4284393271722921544, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5717981154351234976, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_Pivot.x
@@ -564,7 +564,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4284393271722921544, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5717981154351234976, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_Pivot.x
@@ -685,7 +685,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4284393271722921544, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5717981154351234976, guid: 8586a375545487f43b57c6ffdce6fbfd, type: 3}
propertyPath: m_Pivot.x
@@ -0,0 +1,627 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1448650841350251410
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1931146730219979515}
- component: {fileID: 7931617368933511578}
- component: {fileID: 5031655611580643013}
m_Layer: 5
m_Name: TitileText (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1931146730219979515
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1448650841350251410}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8578995796031649400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 84}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7931617368933511578
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1448650841350251410}
m_CullTransparentMesh: 1
--- !u!114 &5031655611580643013
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1448650841350251410}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: MessageBox
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &3318234767486795022
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7677644201189461152}
- component: {fileID: 5808684862484431307}
- component: {fileID: 6436262686944836630}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7677644201189461152
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318234767486795022}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7906706137011413807}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -81}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5808684862484431307
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318234767486795022}
m_CullTransparentMesh: 1
--- !u!114 &6436262686944836630
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3318234767486795022}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: OK
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4839074738306786208
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7906706137011413807}
- component: {fileID: 8280971203118505009}
- component: {fileID: 8250962023850685786}
- component: {fileID: 7766051278568089760}
m_Layer: 5
m_Name: ButtonExit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7906706137011413807
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4839074738306786208}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7677644201189461152}
m_Father: {fileID: 8578995796031649400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8280971203118505009
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4839074738306786208}
m_CullTransparentMesh: 1
--- !u!114 &8250962023850685786
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4839074738306786208}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7766051278568089760
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4839074738306786208}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 8250962023850685786}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &5199518178703117250
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6428994832978992641}
- component: {fileID: 655909173274991632}
- component: {fileID: 7448521238108099750}
m_Layer: 5
m_Name: MessageText (TMP) (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6428994832978992641
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5199518178703117250}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8578995796031649400}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 3}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &655909173274991632
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5199518178703117250}
m_CullTransparentMesh: 1
--- !u!114 &7448521238108099750
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5199518178703117250}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Content
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278190080
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5492547392745930423
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8578995796031649400}
- component: {fileID: 2243330050876855902}
- component: {fileID: 3372223705930781376}
- component: {fileID: 1069295583529170983}
m_Layer: 5
m_Name: MessageBox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8578995796031649400
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5492547392745930423}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7906706137011413807}
- {fileID: 1931146730219979515}
- {fileID: 6428994832978992641}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 30.6318}
m_SizeDelta: {x: 434.6896, y: 248.9211}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2243330050876855902
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5492547392745930423}
m_CullTransparentMesh: 1
--- !u!114 &3372223705930781376
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5492547392745930423}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1069295583529170983
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5492547392745930423}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6672523dc3dacfa46b2104f504acdb6e, type: 3}
m_Name:
m_EditorClassIdentifier:
titleText: {fileID: 5031655611580643013}
messageText: {fileID: 7448521238108099750}
okButton: {fileID: 7766051278568089760}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 54cccb2c6a758a24183474cd385ccb2c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+53 -127
View File
@@ -2777,8 +2777,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -50, y: 357}
m_SizeDelta: {x: 81.9939, y: 49.1664}
m_AnchoredPosition: {x: -49.2245, y: 357.7831}
m_SizeDelta: {x: 90.8501, y: 55.7939}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5968563249516142148
CanvasRenderer:
@@ -2861,19 +2861,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 3650411900463707999}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 2299336709516784351}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
m_Calls: []
--- !u!1 &6830984368220482060
GameObject:
m_ObjectHideFlags: 0
@@ -3020,6 +3008,7 @@ GameObject:
m_Component:
- component: {fileID: 2780428059708698453}
- component: {fileID: 1890210201668811196}
- component: {fileID: 6678802354138057098}
m_Layer: 0
m_Name: UIManager
m_TagString: Untagged
@@ -3063,9 +3052,23 @@ MonoBehaviour:
currentTargetNPCID: 0
dialogResouce: {fileID: 11400000, guid: 540bc8e61556ba4479407a2d68e17580, type: 2}
canvasDlg: {fileID: 7894129013412138377}
cDlgQuickBar: {fileID: 1319801370889024573}
btnSecondClick: {fileID: 1330222957695115484}
m_pDlgQuickBar1: {fileID: 8338623026378970694}
m_pDlgSkillAction: {fileID: 0}
--- !u!114 &6678802354138057098
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6950113420985123515}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c007a40af961624cae5041be0798d18, type: 3}
m_Name:
m_EditorClassIdentifier:
uiSkillButton: {fileID: 1484158212461992110}
skillUI: {fileID: 2299336709516784351}
--- !u!1 &7222864739775630687
GameObject:
m_ObjectHideFlags: 0
@@ -7045,32 +7048,20 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1617375721872166299, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1617375721872166299, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1617375721872166299, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 468.781
objectReference: {fileID: 0}
- target: {fileID: 1617375721872166299, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -31.05
objectReference: {fileID: 0}
- target: {fileID: 1851903413579782982, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: label
value:
objectReference: {fileID: 4660130238732286921}
- target: {fileID: 1851903413579782982, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: levelName
value:
objectReference: {fileID: 4660130238732286921}
- target: {fileID: 1851903413579782982, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_subDialog
value:
objectReference: {fileID: 2580090463562447698}
- target: {fileID: 2825516843822704547, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 1
@@ -7081,7 +7072,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2825516843822704547, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 155.2475
objectReference: {fileID: 0}
- target: {fileID: 2825516843822704547, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
@@ -7093,35 +7084,35 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3959004304404627642, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3959004304404627642, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3959004304404627642, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 167.0151
objectReference: {fileID: 0}
- target: {fileID: 3959004304404627642, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -22.62375
objectReference: {fileID: 0}
- target: {fileID: 5330897987501731450, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5330897987501731450, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5330897987501731450, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 342.81
objectReference: {fileID: 0}
- target: {fileID: 5330897987501731450, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -105.2475
objectReference: {fileID: 0}
- target: {fileID: 5364487732470765845, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_IsActive
@@ -7129,19 +7120,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5818092462432985527, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5818092462432985527, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5818092462432985527, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 288.8686
objectReference: {fileID: 0}
- target: {fileID: 5818092462432985527, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -31.05
objectReference: {fileID: 0}
- target: {fileID: 6238266639003596740, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_Name
@@ -7153,87 +7144,71 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6375080618180806221, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6375080618180806221, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6375080618180806221, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 83.16
objectReference: {fileID: 0}
- target: {fileID: 6375080618180806221, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -162.18411
objectReference: {fileID: 0}
- target: {fileID: 7661205641906674001, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_pSubRank
value:
objectReference: {fileID: 5821303484157812317}
- target: {fileID: 7661205641906674001, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_pSubSkill
value:
objectReference: {fileID: 2580090463562447698}
- target: {fileID: 7661205641906674001, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_contentRoot
value:
objectReference: {fileID: 4198350107324523797}
- target: {fileID: 7688900625148083785, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: skillIcon
value:
objectReference: {fileID: 9059833306997052970}
- target: {fileID: 8029283128219612690, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8029283128219612690, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8029283128219612690, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 83.16
objectReference: {fileID: 0}
- target: {fileID: 8029283128219612690, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -292.4765
objectReference: {fileID: 0}
- target: {fileID: 8302858527499935758, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_SizeDelta.y
value: 183.2475
value: 28
objectReference: {fileID: 0}
- target: {fileID: 9102658109286783788, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9102658109286783788, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9102658109286783788, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 83.16
objectReference: {fileID: 0}
- target: {fileID: 9102658109286783788, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -48.51895
objectReference: {fileID: 0}
- target: {fileID: 9184880796936692226, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9184880796936692226, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9184880796936692226, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 108.9562
objectReference: {fileID: 0}
- target: {fileID: 9184880796936692226, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -31.05
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
@@ -7245,60 +7220,11 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 6238266639003596740, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2580090463562447698 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7688900625148083785, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 05377af3dd0a3a84fbff62d8e0a572f9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &4198350107324523797 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 8302858527499935758, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4660130238732286921 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 708823501721075410, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &4742272256638967314 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 627631504828013321, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5821303484157812317 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1851903413579782982, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7f3b136cb144656428e4764d58c18c52, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &9059833306997052970 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3801278460223427377, guid: b78469eadfa272c4f8fee4c8cae4b26f, type: 3}
m_PrefabInstance: {fileID: 5294584971749082395}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7325623227323765241
PrefabInstance:
m_ObjectHideFlags: 0
@@ -27,3 +27,5 @@ MonoBehaviour:
prefab: {fileID: 977375840943150650, guid: 51bad2e6d1ec69a4683135ce85288faa, type: 3}
- id: Win_Hpmpxp
prefab: {fileID: 6032603119232429246, guid: 8350aa55906d08448bb47e10a473ca61, type: 3}
- id: DlgMessageBox
prefab: {fileID: 5492547392745930423, guid: 54cccb2c6a758a24183474cd385ccb2c, type: 3}
@@ -158,6 +158,9 @@ namespace BrewMonster.Managers
@@ -148,7 +148,6 @@ namespace BrewMonster
if (m_bCooling)
{
// In cooling state
m_iCoolCnt -= tickTime;
if (m_iCoolCnt <= 0)
{
@@ -195,6 +194,7 @@ namespace BrewMonster
// iTotalTime: total cooling time, 0 means to use cooling time in database
public void StartCooling(int iTotalTime, int iStartCnt)
{
BMLogger.LogError($"StartCooling iTotalTime={iTotalTime}, iStartCnt={iStartCnt}");
m_iCoolTime = iTotalTime != 0 ? iTotalTime : GetCoreCoolingTime();
m_iCoolCnt = iStartCnt;
m_bCooling = true;
@@ -394,11 +394,6 @@ namespace BrewMonster
return m_pSkillCore != null ? m_pSkillCore.GetRequiredLevel() : 0;
}
public int GetRequiredSp()
{
return m_pSkillCore != null ? m_pSkillCore.GetRequiredSp() : 0;
}
public int GetRequiredBook()
{
return m_pSkillCore != null ? m_pSkillCore.GetRequiredBook() : 0;
@@ -409,11 +404,6 @@ namespace BrewMonster
return m_pSkillCore != null ? m_pSkillCore.GetRequiredSkill() : new SkillArrayWrapper(new List<SkillArrayWrapper.IDLevelPair>());
}*/
public int GetRequiredMoney()
{
return m_pSkillCore != null ? m_pSkillCore.GetRequiredMoney() : 0;
}
/* public int GetRequiredItem()
{
return m_pSkillCore != null ? m_pSkillCore.GetItemCost() : 0;
@@ -3,10 +3,12 @@ namespace BrewMonster
partial class CECPlayer
{
protected int m_iMoneyCnt; // Amount of money the player has
protected uint m_iMoneyCnt; // Amount of money the player has
protected int m_iMaxMoney;
public int GetMoneyAmount() { return m_iMoneyCnt; }
public uint GetMoneyAmount() { return m_iMoneyCnt; }
public int GetMaxMoneyAmount() { return m_iMaxMoney; }
public void SetMoneyAmount(uint iMoneyCnt) { m_iMoneyCnt = iMoneyCnt; }
public byte GetShapeMask()
{
// restore the original data from 8~15 bit
+26 -25
View File
@@ -1142,6 +1142,9 @@ namespace BrewMonster
return false;
}
public CECSkill GetCurSkill() { return m_pCurSkill; }
public bool IsHangerOn() { return m_bHangerOn; }
public bool PlaySkillCastActionWithName(int idSkill, string szActName, bool bNoFX/* =false */)
{
return m_pActionController != null
@@ -1577,31 +1580,31 @@ namespace BrewMonster
{
bool bRet = false;
/* if (vPos.y < fWaterHei - m_MoveConst.fShoreDepth)
bRet = true;
else if (vPos.y < fWaterHei && fWaterHei - fGndHei > m_MoveConst.fShoreDepth)
bRet = true;
*/
// if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf - m_aabb.Extents.y)
// if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf + 0.01f)
/* if (vPos.y < fWaterHei - m_MoveConst.fShoreDepth)
bRet = true;
else if (vPos.y < fWaterHei && fWaterHei - fGndHei > m_MoveConst.fShoreDepth)
bRet = true;
*/
// if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf - m_aabb.Extents.y)
// if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf + 0.01f)
/*
if (vPos.y < fWaterHei - m_MoveConst.fShoreDepth)
bRet = true;
else if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf + 0.01f && fWaterHei - fGndHei > m_MoveConst.fShoreDepth)
bRet = true;
*/
/*
if (vPos.y < fWaterHei - m_MoveConst.fShoreDepth)
bRet = true;
else if (vPos.y < fWaterHei - m_MoveConst.fWaterSurf + 0.01f && fWaterHei - fGndHei > m_MoveConst.fShoreDepth)
bRet = true;
*/
//@note : modify the water test. By Kuiwu[12/10/2005]
if (vPos.y + m_aabbServer.Extents.y<fWaterHei - m_MoveConst.fWaterSurf - 0.001f)
{
bRet = true;
}
//else if (vPos.y + m_aabb.Extents.y < fWaterHei- m_MoveConst.fWaterSurf + 1E-4f && vPos.y - fGndHei >= 0.2f )
else if (vPos.y + m_aabbServer.Extents.y<fWaterHei- m_MoveConst.fWaterSurf + 1E-4f && vPos.y - fGndHei >= 0.01f )
{
bRet = true;
}
//@note : modify the water test. By Kuiwu[12/10/2005]
if (vPos.y + m_aabbServer.Extents.y < fWaterHei - m_MoveConst.fWaterSurf - 0.001f)
{
bRet = true;
}
//else if (vPos.y + m_aabb.Extents.y < fWaterHei- m_MoveConst.fWaterSurf + 1E-4f && vPos.y - fGndHei >= 0.2f )
else if (vPos.y + m_aabbServer.Extents.y < fWaterHei - m_MoveConst.fWaterSurf + 1E-4f && vPos.y - fGndHei >= 0.01f)
{
bRet = true;
}
return bRet;
@@ -1611,8 +1614,6 @@ namespace BrewMonster
public void SetAboutToDie(bool bFlag) { m_bAboutToDie = bFlag; }
public bool IsHangerOn() { return m_bHangerOn; }
// Show / hide wing
public void ShowWing(bool bShow)
{
@@ -1409,27 +1409,31 @@ namespace CSNetwork.S2CCommand
// public char data[1];
//};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_sevnpc_hello
{
public int id;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_normal_attack
{
public byte pvp_mask;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_select_target
{
public int id;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_sevnpc_serve
{
public int service_type;
public uint len;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct accept_task_CONTENT
{
public int idTask;
@@ -1437,16 +1441,25 @@ namespace CSNetwork.S2CCommand
public int idRefreshItem;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SevReturnTaskCONTENT
{
public int idTask;
public int iChoice;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SevTaskMatterCONTENT
{
public int idTask;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SevLearnSkillCONTENT
{
public int idSkill;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_sevnpc_serve2
{
public int service_type;
@@ -617,6 +617,20 @@ namespace CSNetwork.C2SCommand
return SerializeCommand(CommandID.SEVNPC_SERVE, cmd, content);
}
public static Octets CreateNPCSevLearnSkillCmd(int idSkill)
{
var cmd = new cmd_sevnpc_serve
{
service_type = NPC_service_type.GP_NPCSEV_LEARN,
len = (uint)Marshal.SizeOf<SevLearnSkillCONTENT>()
};
SevLearnSkillCONTENT content = new SevLearnSkillCONTENT()
{
idSkill = idSkill
};
return SerializeCommand(CommandID.SEVNPC_SERVE, cmd, content);
}
public static Octets CreateNPCSevBuyCmd(int itemNum, CSNetwork.C2SCommand.npc_trade_item[] items)
{
if (itemNum <= 0 || items == null || items.Length < itemNum)
@@ -1584,7 +1584,19 @@ namespace CSNetwork.GPDataType
{
return (id & 0x80000000) != 0 && (id & 0x40000000) == 0;
}
public static string ReplacePercentD(string fmt, params object[] args)
{
if (string.IsNullOrEmpty(fmt) || args == null || args.Length == 0)
return fmt;
for (int i = 0; i < args.Length; i++)
{
int idx = fmt.IndexOf("%d", StringComparison.Ordinal);
if (idx < 0) break; // hết %d
fmt = fmt.Substring(0, idx) + args[i]?.ToString() + fmt.Substring(idx + 2);
}
return fmt;
}
public static bool ISMONEYTID(int tid)
{
return tid == 3044;
File diff suppressed because it is too large Load Diff
@@ -262,7 +262,11 @@ namespace BrewMonster.Network
RequestInventoryAsync(p, onOneDone);
}
}
public static void c2s_SendCmdNPCSevLearnSkill(int idSkill)
{
BMLogger.LogError("c2s_SendCmdNPCSevLearnSkill");
Instance._gameSession.c2s_SendCmdNPCSevLearnSkill(idSkill);
}
public static void c2s_CmdNPCSevHello(int nid)
{
Instance._gameSession.c2s_SendCmdNPCSevHello(nid);
@@ -248,7 +248,6 @@ namespace BrewMonster
SetServerPos(Cmd.dest);
float fDist = m_vMoveDir.Normalize();
BrewMonster.BMLogger.Log($"HoangDev : {fDist} : {MAX_LAGDIST} || {m_fMoveSpeed}");
if (fDist >= MAX_LAGDIST || m_fMoveSpeed < 0.01f)
{
@@ -5,6 +5,7 @@ using ModelRenderer.Scripts.GameData;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
namespace BrewMonster.Scripts.Skills
{
@@ -24,6 +25,7 @@ namespace BrewMonster.Scripts.Skills
set => instance = value;
}
ElementSkill s = null;
Dictionary<int, ElementSkill> m_allProfSkills = new Dictionary<int, ElementSkill>();
Dictionary<int, List<int>> m_allRankProfSkills = new Dictionary<int, List<int>>();
private HashSet<int> m_allProfNPCs = new HashSet<int>();
@@ -32,19 +34,85 @@ namespace BrewMonster.Scripts.Skills
private Dictionary<int, int> m_godRootMap = new Dictionary<int, int>();
private Dictionary<int, int> m_baseRootMap = new Dictionary<int, int>();
private int m_skillLearnNPCNID;
private bool m_bReceivedNPCGreeting;
private bool m_bInitialized;
private Octets m_npcListData;
/// <summary>
/// 获取当前职业的全部技能映射(阶位 -> 技能列表) / Get rank-to-skills map for current profession.
/// </summary>
#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void BeforeSceneLoad()
{
BMLogger.LogError("CECHostSkillModel BeforeSceneLoad Reset");
Instance = null;
}
#endif
public IReadOnlyDictionary<int, List<int>> GetAllRankProfSkills()
{
return m_allRankProfSkills;
}
public CECHostSkillModel()
{
m_skillLearnNPCNID = 0;
m_bReceivedNPCGreeting = false;
m_bInitialized = false;
}
// NPC技能学习相关 / Skill-learn NPC helpers
public bool IsSkillLearnNPC(int nid) => nid == m_skillLearnNPCNID;
public bool IsSkillLearnNPCExsit() => m_skillLearnNPCNID != 0;
public bool IsReceivedNPCGreeting() => m_bReceivedNPCGreeting;
public void SetReceivedNPCGreeting(bool received) => m_bReceivedNPCGreeting = received;
public void OnNpcGreeting(int idObject)
{
// cmd_npc_greeting.idObject is the NPC/player id (nid)
if (idObject == m_skillLearnNPCNID && m_skillLearnNPCNID != 0)
{
m_bReceivedNPCGreeting = true;
//BMLogger.LogError($"[Skill] Received NPC_GREETING from skill-learn NPC nid={m_skillLearnNPCNID}");
}
}
public void SendHelloToSkillLearnNPC()
{
//BMLogger.LogError($"[Skill] Sent SEVNPC_HELLO to skill-learn NPC nid={m_skillLearnNPCNID}");
if (m_skillLearnNPCNID != 0)
{
// C++: g_pGame->GetGameSession()->c2s_CmdNPCSevHello(m_skillLearnNPCNID);
BrewMonster.Network.UnityGameSession.c2s_CmdNPCSevHello(m_skillLearnNPCNID);
//BMLogger.LogError($"[Skill] Sent SEVNPC_HELLO to skill-learn NPC nid={m_skillLearnNPCNID}");
}
}
public enumSkillLearnedState GetSkillLearnedState(int skillID)
{
CECSkill pSkill = CECGameRun.Instance.GetHostPlayer().GetNormalSkill(skillID);
if (pSkill != null)
{
if (pSkill.GetSkillLevel() < pSkill.GetMaxLevel())
{
return enumSkillLearnedState.SKILL_LEARNED;
}
else
{
return enumSkillLearnedState.SKILL_FULL;
}
}
else
{
if (ElementSkill.IsOverridden((uint)skillID))
{
return enumSkillLearnedState.SKILL_OVERRIDDEN;
}
else
{
return enumSkillLearnedState.SKILL_NOT_LEARNED;
}
}
}
public void Initialize()
{
//BMLogger.LogError("HoangDev CECHostSkillModel Initialize called");
// Çå¿ÕËùÓм¼ÄÜ£¬·ÀÖ¹ÒòΪ¶à¸ö½ÇÉ«µÇ¼µ¼ÖÂÖØ¸´¼ÓÔØ¼¼ÄÜ
Release();
@@ -61,9 +129,10 @@ namespace BrewMonster.Scripts.Skills
}
public void ProcessServiceList()
{
//BMLogger.LogError("HoangDev: ProcessServiceList");
if (m_npcListData == null)
{
BMLogger.LogWarning("CECHostSkillModel::ProcessServiceList, m_npcListData is null.");
BMLogger.LogError("CECHostSkillModel::ProcessServiceList, m_npcListData is null.");
return;
}
if (m_npcListData.Size > 0)
@@ -87,17 +156,21 @@ namespace BrewMonster.Scripts.Skills
npcList.list[z] = GPDataTypeHelper.FromBytes<cmd_scene_service_npc_list.NpcEntry>(bodyBytes, offset);
offset += NpcEntrySize;
}
//BMLogger.LogError("ProcessServiceList npcList.count:" + npcList.count);
//BMLogger.LogError("ProcessServiceList m_allProfNPCs.count:" + m_allProfNPCs.Count);
int i;
for (i = 0; i < npcList.count; i++)
{
int tid = npcList.list[i].tid;
//BMLogger.LogError("ProcessServiceList tid:" + tid);
if (m_allProfNPCs.Contains(tid))
{
//BMLogger.LogError("m_skillLearnNPCNID : " + m_skillLearnNPCNID);
//BMLogger.LogError("npcList.list[i].nid : " + npcList.list[i].nid);
if (m_skillLearnNPCNID != npcList.list[i].nid)
{
m_skillLearnNPCNID = npcList.list[i].nid;
m_bReceivedNPCGreeting = false; // new NPC -> need greeting again
SetCurServiceSkills(tid);
var change = new CECSkillPanelChange(CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_NPC, 0, 0);
//NotifyObservers(change);
@@ -113,9 +186,10 @@ namespace BrewMonster.Scripts.Skills
var change = new CECSkillPanelChange(CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_NPC, 0, 0);
//NotifyObservers(change);
}
m_npcListData.Clear();
}
//BMLogger.LogError("HoangDev: m_npcListData.Size :"+ m_npcListData.Size);
}
private readonly HashSet<int> m_curServiceSkills = new HashSet<int>();
public string GetSkillIcon(int skillID)
@@ -125,6 +199,7 @@ namespace BrewMonster.Scripts.Skills
}
public void SetCurServiceSkills(int tid)
{
//BMLogger.LogError("SetCurServiceSkills " + tid);
m_curServiceSkills.Clear();
if (tid == 0)
return;
@@ -138,7 +213,6 @@ namespace BrewMonster.Scripts.Skills
return;
var npcEssence = (NPC_ESSENCE)dataprt;
// Get skill service block from id_skill_service
var dataprt2 = pDB.get_data_ptr(npcEssence.id_skill_service, ID_SPACE.ID_SPACE_ESSENCE, ref dt);
if (dataprt2 == null)
return;
@@ -148,8 +222,74 @@ namespace BrewMonster.Scripts.Skills
foreach (int skillId in skillService.id_skills)
{
if (skillId != 0)
m_curServiceSkills.Add(skillId);
{ m_curServiceSkills.Add(skillId); }
}
//BMLogger.LogError("SetCurServiceSkills m_curServiceSkills count:" + m_curServiceSkills.Count);
//BMLogger.LogError("SetCurServiceSkills skillService.id_skills count:" + skillService.id_skills.Length);
}
public enumSkillFitLevelState GetSkillFitLevel(int skillID)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
BMLogger.LogError("skillID not exist in m_allProfSkills");
return default;
}
int maxLevel = CECGameRun.Instance.GetHostPlayer().GetMaxLevelSofar();
int rank = CECGameRun.Instance.GetHostPlayer().GetBasicProps().iLevel2;
int realmLevel = CECGameRun.Instance.GetHostPlayer().GetRealmLevel();
return GetSkillFitLevel(skillID, maxLevel, rank, realmLevel);
}
enumSkillFitLevelState GetSkillFitLevel(int skillID, int maxLevel, int rank, int realmLevel)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
BMLogger.LogError("skillID not exist in m_allProfSkills");
return default;
}
int skillLevel = 1; //½«ÒªÑ§Ï°µÄ¼¼Äܼ¶±ð
CECSkill pSkill = CECGameRun.Instance.GetHostPlayer().GetNormalSkill(skillID);
if (pSkill != null)
{
skillLevel = pSkill.GetSkillLevel() + 1;
if (skillLevel > pSkill.GetMaxLevel())
{
return enumSkillFitLevelState.SKILL_NOT_FIT_LEVEL;
}
}
s = ElementSkill.Create((uint)skillID, skillLevel);
if (s.GetRequiredLevel() > maxLevel)
{
return enumSkillFitLevelState.SKILL_NOT_FIT_LEVEL;
}
// ÐÞÕæµÈ¼¶²»¹»
CECTaoistRank curTaoistRank = CECTaoistRank.GetTaoistRank(rank);
CECTaoistRank reqTaoistRank = CECTaoistRank.GetTaoistRank(s.GetRank());
if ((curTaoistRank.IsEvilRank() && reqTaoistRank.IsGodRank()) ||
(curTaoistRank.IsGodRank() && reqTaoistRank.IsEvilRank()) ||
(curTaoistRank.GetID() < reqTaoistRank.GetID()))
{
return enumSkillFitLevelState.SKILL_NOT_FIT_LEVEL;
}
// ¾³½ç²»¹»
if (s.GetRequiredRealmLevel() > realmLevel)
{
return enumSkillFitLevelState.SKILL_NOT_FIT_LEVEL;
}
return enumSkillFitLevelState.SKILL_FIT_LEVEL;
}
public int CheckLearnCondition(int skillID)
{
return CECGameRun.Instance.GetHostPlayer().CheckSkillLearnCondition(skillID, true);
}
public int GetRequiredBook(int skillID, int level)
{
int itemId = ElementSkill.GetRequiredBook((uint)skillID, level);
return itemId;
}
public void RecvNPCServiceList(Octets Data)
{
@@ -170,6 +310,24 @@ namespace BrewMonster.Scripts.Skills
InitializeRootOfSkillTree(rootSkillID);
}
}
public int GetSkillCurrentLevel(int skillID)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
BMLogger.LogError("skillID not exist in m_allProfSkills");
return 0;
}
CECSkill pSkill = CECGameRun.Instance.GetHostPlayer().GetNormalSkill(skillID);
if (pSkill != null)
{
return pSkill.GetSkillLevel();
}
else
{
return 0;
}
}
private void InitializeRootOfSkillTree(int rootSkillID)
{
var skillRootMap = GetSkillRootMap(rootSkillID);
@@ -229,7 +387,7 @@ namespace BrewMonster.Scripts.Skills
{
if (!m_allProfSkills.TryGetValue(skillID, out var skill))
{
throw new Exception($"Skill {skillID} not found in m_allProfSkills");
BMLogger.LogError($"Skill {skillID} not found in m_allProfSkills");
}
var juniors = skill.GetJunior();
@@ -262,6 +420,8 @@ namespace BrewMonster.Scripts.Skills
DATA_TYPE dt = DATA_TYPE.DT_NPC_ESSENCE;
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
var map = pDB.GetAllDataTypeWithType(ID_SPACE.ID_SPACE_ESSENCE, dt);
//BMLogger.LogError("Hoang Dev map Count :" + map.Length);
foreach (var obj in map)
{
NPC_ESSENCE npcEssence = (NPC_ESSENCE)obj;
@@ -276,7 +436,12 @@ namespace BrewMonster.Scripts.Skills
{
ElementSkill pSkill = ElementSkill.Create(skillService.id_skills[i], 1);
if (pSkill == null) return;
if (pSkill == null)
{
//BMLogger.LogError($"Hoang Dev pSkill is null for skill {i} :" + skillService.id_skills[i]);
continue;
}
if (pSkill.GetCls() == CECGameRun.Instance.GetHostPlayer().GetProfession())
{
@@ -288,11 +453,12 @@ namespace BrewMonster.Scripts.Skills
}
if (profCorrect)
{
//BMLogger.LogError("m_allProfNPCs.Add " + (int)npcEssence.id);
m_allProfNPCs.Add((int)npcEssence.id);
}
//BMLogger.LogError("Hoang Dev skillService.id_skills.Length :" + skillService.id_skills.Length);
}
}
}
public void InitAllSkillsOfCurProf()
{
@@ -345,8 +511,7 @@ namespace BrewMonster.Scripts.Skills
m_allRankProfSkills[pSkill.GetRank()].Add((int)curID);
}
}
BMLogger.LogError("CECHostSkillModel::InitAllSkillsOfCurProf: total prof skills = " + m_allRankProfSkills.Count);
// --- B3: Sắp xếp skill trong từng rank theo thứ tự hiển thị ---
foreach (var kvp in m_allRankProfSkills)
{
kvp.Value.Sort((lhs, rhs) =>
@@ -378,6 +543,7 @@ namespace BrewMonster.Scripts.Skills
private void Release()
{
//BMLogger.LogError("HoangDev CECHostSkillModel Release called");
m_allProfSkills.Clear();
// Dọn sạch tất cả dictionary / map
@@ -400,6 +566,96 @@ namespace BrewMonster.Scripts.Skills
CECSkill skill = new CECSkill(skillID, 1);
return (skill.GetNameDisplay());
}
public bool CheckPreItem(int itemID)
{
return CECGameRun.Instance.GetHostPlayer().GetPack().FindItem(itemID) != -1;
}
public bool IsSkillServedByNPC(int skillID)
{
return m_curServiceSkills.Contains(skillID);
}
public int GetSkillSp(int skillID, int level)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
BMLogger.LogError("skillID not exist in m_allProfSkills");
return 0;
}
return ElementSkill.GetRequiredSp((uint)skillID, level);
}
public int GetSkillMoney(int skillID, int level)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
BMLogger.LogError("skillID not exist in m_allProfSkills");
return 0;
}
return ElementSkill.GetRequiredMoney((uint)skillID, level);
}
public Dictionary<uint, int> GetRequiredSkill(int skillID, int level)
{
Dictionary<uint, int> requiredSkill = new();
ElementSkill s = ElementSkill.Create((uint)skillID, level);
// giả định GetRequiredSkill() trả về List<KeyValuePair<uint,int>> hoặc IReadOnlyList<...>
Dictionary<uint, int> skills = s.GetRequiredSkill();
if (skills == null || skills.Count == 0)
return null;
foreach (var skill in skills)
{
if (skill.Key != 0)
{
requiredSkill.Add(skill.Key, skill.Value);
}
}
return requiredSkill;
}
public bool CheckPreSkillLevel(int skillID, int level)
{
if (GetSkillLearnedState(skillID) == enumSkillLearnedState.SKILL_OVERRIDDEN)
{
// Èç¹û¸ÃǰÌá¼¼Äܱ»¸²¸Ç£¬ÔòǰÌá¼¼ÄÜÒ»¶¨Âú×ã
return true;
}
return GetSkillCurrentLevel(skillID) >= level;
}
// Called when a skill is learned / 当学习新技能后调用
public void OnLearnSkill(int skillID, int skillLevel)
{
if (!m_allProfSkills.ContainsKey(skillID))
{
return;
}
// 检查学习新技能后是否有技能被覆盖 / Check if any skills are overridden after learning the new skill
bool newOverridden = false;
var juniors = GetJunior(skillID);
if (juniors.Count > 0)
{
newOverridden = true;
}
if (newOverridden)
{
CECSkillPanelChange change = new CECSkillPanelChange(
CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_OVERRIDDEN,
skillID,
skillLevel);
EventBus.Publish(change);
}
else
{
CECSkillPanelChange change = new CECSkillPanelChange(
CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_LEVEL_UP,
skillID,
skillLevel);
EventBus.Publish(change);
}
}
}
public enum enumSkillFitLevelState
@@ -422,7 +678,7 @@ namespace BrewMonster.Scripts.Skills
SKILL_EVIL, // ɼ / Immortal skill
SKILL_GOD, // ħ / Demonic skill
}
public class CECSkillPanelChange : CECObservableChange
public struct CECSkillPanelChange
{
public enum enumChangeMask
{
@@ -442,5 +698,4 @@ namespace BrewMonster.Scripts.Skills
m_skillLevel = level;
}
}
}
@@ -133,6 +133,7 @@ namespace BrewMonster.Scripts.Skills
public const byte FORM_BEASTIE = 2; //С
static SkillStub s;
static Skill skill;
public static uint NextSkill(uint id = 0)
{
@@ -218,20 +219,40 @@ namespace BrewMonster.Scripts.Skills
// ѧϰnҪҼ
public virtual int GetRequiredLevel() { return 0; }
// ѧϰnҪļܵ
public virtual int GetRequiredSp() { return 0; }
public static int GetRequiredSp(uint id, int level)
{
skill = Skill.Create(id, level);
if (skill == null)
return 0;
int ret = skill.GetRequiredSp();
return ret;
}
// ѧϰnҪļ
public virtual int GetRequiredBook() { return 0; }
// ѧϰҪǮ
public virtual int GetRequiredMoney() { return 0; }
public static int GetRequiredBook(uint id, int level)
{
skill = Skill.Create(id, level);
if (skill == null)
return 0;
int ret = skill.GetRequiredBook();
return ret;
}
// ѧϰ󾳽ȼ?
public virtual int GetRequiredRealmLevel() { return 0; }
// ǰ
public virtual Dictionary<uint, int> GetRequiredSkill() => new Dictionary<uint, int>();
// ʾ˳
public virtual int GetShowOrder() { return 0; }
// üܼ
public virtual int SetLevel(int level) { return 0; }
// 󼶱?
public static int SetLevel(uint id, int level)
{
return SkillWrapper.Instance.SetLevel(id, level);
}
public virtual int GetMaxLevel() { return 0; }
public static byte GetType(uint id)
{
@@ -313,5 +334,96 @@ namespace BrewMonster.Scripts.Skills
}
public virtual byte GetAllowForms() { return 0; }
public virtual bool Interrupt() { return true; }
public static int GetRequiredMoney(uint id, int level)
{
skill = Skill.Create(id, level);
if (skill == null)
return 0;
int ret = skill.GetRequiredMoney();
return ret;
}
// 学习技能条件检查 // Learning skill condition check
// 返回值 // Return values:
// 0: 成功 // Success
// 1: 技能点不够 // Not enough skill points
// 2: 等级不够 // Level not enough
// 3: 错误 // Error
// 4: 职业不匹配 // Profession mismatch
// 5: 技能ID // Skill ID error
// 6: 钱不够 // Not enough money
// 7: 阶级不符 // Rank mismatch
// 9: 前置技能级别不够 // Prerequisite skill level not enough
// 10: 熟练度不够 // Ability not enough
// 11: 被覆盖 // Overridden
// 12: 境界等级不够 // Realm level not enough
public static int LearnCondition(uint id, LearnRequirement info, int ilevel)
{
skill = Skill.Create(id, ilevel);
if (skill == null)
return 5;
int ret = 0;
SkillWrapper wrapper = SkillWrapper.Instance;
if (wrapper.IsOverridden(id))
return 11;
int srank, prank;
srank = skill.GetRank();
prank = info.rank;
if (srank > prank)
ret = 7;
else
{
srank = (int)(srank * 0.1);
prank = (int)(prank * 0.1);
if (srank != prank && srank != 0)
ret = 7;
}
if (ilevel < 1 || ilevel > skill.GetMaxLevel())
ret = 3;
else if (info.profession != skill.GetCls() && skill.GetCls() != 255)
ret = 4;
else if (info.level < skill.GetRequiredLevel())
ret = 2;
if (ret != 0)
{
return ret;
}
if (info.sp < skill.GetRequiredSp())
ret = 1;
else if (info.money < skill.GetRequiredMoney())
ret = 6;
var pre_skills = skill.GetRequiredSkill();
foreach (var kvp in pre_skills)
{
uint pre_id = kvp.Key;
int pre_level = kvp.Value;
if (pre_id > 0 && wrapper.GetLevel(pre_id) < pre_level && !wrapper.IsOverridden(pre_id))
{
ret = 9;
break;
}
}
if (ilevel > 1)
{
skill.SetLevel(ilevel - 1);
int ability = skill.GetMaxability();
if (ability > 0 && wrapper.GetAbility(id) < ability)
ret = 10;
}
if (info.realm_level < skill.GetRequiredRealmLevel())
ret = 12;
return ret;
}
}
}
@@ -56,5 +56,43 @@ namespace BrewMonster.Assets.PerfectWorld.Scripts.Skills
}
return false;
}
public int GetLevel(uint id)
{
if (map.TryGetValue(id, out PersistentData data))
return data.level;
return 0;
}
public int GetAbility(uint id)
{
if (map.TryGetValue(id, out PersistentData data))
return data.ability;
return 0;
}
public int SetAbility(uint id, int ability)
{
if (map.TryGetValue(id, out PersistentData data))
{
int old = data.ability;
data.ability = ability;
map[id] = data;
return old;
}
return 0;
}
public int SetLevel(uint id, int level)
{
if (map.TryGetValue(id, out PersistentData data))
{
int old = data.level;
data.level = level;
map[id] = data;
return old;
}
return 0;
}
}
}
+299 -292
View File
@@ -1,293 +1,300 @@
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Skills
{
public class Range
{
/// <summary>0=point 1=line 2=self sphere 3=target sphere 4=cone 5=self</summary>
public byte type; // 0 1 2 3Ŀ 4Բ׶ 5
public bool IsPoint() { return type == 0; }
public bool IsLine() { return type == 1; }
public bool IsSelfBall() { return type == 2; }
public bool IsTargetBall() { return type == 3; }
public bool IsSector() { return type == 4; }
public bool IsSelf() { return type == 5; }
public bool NoTarget() { return type == 2 || type == 5; }
}
// ռλ // Placeholder Skill class
public class Skill : ElementSkill
{
protected SkillStub stub;
protected PlayerWrapper player;
protected uint id;
protected uint level;
Skill(uint i, SkillStub s)
{
id = i;
stub = s;
player = new PlayerWrapper();
}
public static Skill Create(uint id, int n)
{
SkillStub stub = SkillStub.GetStub(id);
if (stub == null)
return null;
Skill skill = new Skill(id, stub);
int max = skill.GetMaxLevel();
if (n > max)
skill.SetLevel(max);
else
skill.SetLevel(n);
return skill;
}
public override int GetMaxLevel() { return stub.GetMaxLevel(); }
public override int SetLevel(int l)
{
uint tmp = level;
level = (uint)l;
return (int)tmp;
}
public override int GetItemCost() { return stub.itemcost; }
public int GetLevel() { return (int)level; }
public PlayerWrapper GetPlayer()
{
return player;
}
public override int GetRank() { return stub.rank; }
public override bool IsInstant() { return stub.time_type == 1; }
public override int GetCls()
{
return stub.GetCls();
}
public override Dictionary<uint, int> GetJunior()
{
return stub.is_senior != 0 ? stub.pre_skills : new Dictionary<uint, int>();
}
public override int GetRangeType() { return stub.GetRange().type; }
public override int GetTargetType()
{
if (stub.restrict_corpse == 1)
return 2;
if (stub.restrict_corpse == 2)
return 3;
if (stub.type == (int)skill_type.TYPE_ATTACK || stub.type == (int)skill_type.TYPE_CURSE)
return 1;
if (stub.type == (int)skill_type.TYPE_BLESSPET)
return 4;
if (stub.GetRange().NoTarget())
return 0;
return 1;
}
public override byte GetType() { return stub.type; }
public override int GetCommonCoolDown() { return stub.commoncooldown; }
public override string GetIcon()
{
return stub.GetIcon();
}
public override string GetName() { return stub.GetName(); }
public override float GetPrayRange(float range, float prayplus)
{
player.SetRange(range);
player.SetPrayrangeplus(prayplus);
if (stub.type == (int)skill_type.TYPE_ATTACK || stub.type == (int)skill_type.TYPE_CURSE)
{
if (stub.auto_attack)
{
float r = 0.3f * stub.GetPraydistance(this);
if (r >= 1.0)
return stub.GetPraydistance(this) - 1.0f;
else
return (float)0.7 * stub.GetPraydistance(this);
}
else
return stub.GetPraydistance(this);
}
if (stub.type == (int)skill_type.TYPE_JUMP)
return stub.GetPraydistance(this);
if (stub.GetRange().NoTarget())
return -1;
else
return stub.GetPraydistance(this);
}
public override int GetCoolingTime() { return stub.GetCoolingtime(this); }
}
public abstract class SkillStub
{
public const int MIN_LEVEL = 1;
public const int MAX_LEVEL = 10;
// Base info
public uint id; // Ψһֱʶ // Unique identifier
public int cls; // ְҵ // Class/Profession
public string name; // // Skill name
public string nativename; // // Native name
public string icon; // ͼ // Skill icon
public int max_level; // 󼶱? // Maximum level
public byte type; // ? 1 2 3ٻ 4 5 // Skill type: 1-Normal 2-Special 3-Partner 4-Mount 5-Other
// Execute condition
public bool allow_ride; // ? // Allow while riding
public short attr; // , 1256 ѡһ Ĭϣ // Attribute: 1-Metal 2-Earth 3-Wood 4-Water 5-Fire 6-Special (Choose one, default none)
public int rank; // // Rank
public int eventflag; // Event flag
public byte is_senior; // Senior flag
public bool is_inherent; // ܣѧ // Inherent skill, cannot be learned
public bool is_movingcast; // ƶʩ // Can cast while moving
public int npcdelay; // NPC delay
public int showorder; // Display order
public byte allow_forms; // Allowed forms
public int apcost; // AP cost
public int apgain; // AP gain
public byte doenchant; // Do enchant
public byte dobless; // Do bless
public int arrowcost; // Arrow cost
public Dictionary<uint, int> pre_skills;
// Execute condition
public bool allow_land; // ½Ч // Effective on land
public bool allow_air; // Ч // Effective in air
public bool allow_water; // ˮЧ // Effective in water
public bool notuse_in_combat; // ս״̬ // Cannot use in combat state
public int restrict_corpse; // ֻʬЧ // Only effective on corpses
public bool restrict_change; // ǷԱ // Whether can transform
public bool restrict_attach; // ǷԸ // Whether can possess
public bool auto_attack; // ʹúǷԶ // Whether to auto attack after use
public byte time_type; // ˲ // Instant cast type
public byte long_range;
public byte posdouble; // λѡ // Position selection
public int clslimit; // ְҵ // Class restriction
public int commoncooldown; // ȴmask bit0-4 ȴ0-4 bit5-9 Ʒȴ0-4
// Common cooldown mask bit0-4 skill cooldown 0-4 bit5-9 item cooldown 0-4
public int commoncooldowntime; // ȴʱλ // Cooldown time in milliseconds
public int itemcost; // ͷʱƷ >0Ч // Item cost when casting, effective if >0
// // Combo related
public int combosk_preskill;
public int combosk_interval;
public int combosk_nobreak;
public string effect;
public string aerial_effect;
public Range range;
public bool has_stateattack;
public List<int> restrict_weapons = new List<int>();
public static Dictionary<uint, SkillStub> map = new Dictionary<uint, SkillStub>();
public static Dictionary<uint, SkillStub> GetMap() => map;
public static Dictionary<uint, List<uint>> comboSkillMap = new Dictionary<uint, List<uint>>();
public static Dictionary<uint, List<uint>> GetComboSkMap() => comboSkillMap;
public static Dictionary<uint, List<uint>> inheritSkillMap = new Dictionary<uint, List<uint>>();
/*#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void OnPlay()
{
BMLogger.LogError("SkillStub OnPlay Reset");
map = new Dictionary<uint, SkillStub>();
comboSkillMap = new Dictionary<uint, List<uint>>();
inheritSkillMap = new Dictionary<uint, List<uint>>();
}
#endif*/
public SkillStub(uint i)
{
id = i;
is_inherent = (false);
is_movingcast = (false);
itemcost = (0);
combosk_preskill = (0);
combosk_interval = (0);
combosk_nobreak = (0);
if (GetStub(id) == null)
{
GetMap().Add(id, this);
}
}
public static List<uint> GetInherentSkillList(uint cls)
{
return inheritSkillMap[cls];
}
public static SkillStub GetStub(uint i)
{
return GetMap().TryGetValue(i, out var stub) ? stub : null;
}
public int GetItemCost() { return itemcost; }
public static void InitStaticData()
{
var map = GetMap();
foreach (var skill in map)
{
SkillStub sk = skill.Value;
if (sk.is_inherent) GetInherentSkillList((uint)sk.cls).Add(sk.id);
if (sk.combosk_preskill > 0) GetComboSkMap()[(uint)sk.combosk_preskill].Add(sk.id);
}
}
public List<uint> GetPostComboSkill(uint id)
{
var m = GetComboSkMap();
if (m.TryGetValue(id, out var list)) return list;
return null;
}
// ΪC++תĽӿ // The following methods are converted from C++
public uint GetId() { return id; }
public int GetCls() { return cls; }
public string GetName() { return name; }
public string GetIcon() { return icon; }
public int GetMaxLevel() { return max_level; }
public Range GetRange() { return range; }
public bool IsMovingSkill() { return is_movingcast; }
public byte GetType() { return type; } // System.Object.GetType // Hide System.Object.GetType
// ʱ // Runtime-related virtual functions
public virtual int GetCoolingtime(Skill skill) { return 5000; }
public virtual int GetRequiredSp(Skill skill) { return 0; }
public virtual int GetRequiredLevel(Skill skill) { return 0; }
public virtual int GetMaxAbility(Skill skill) { return 0; }
public virtual int GetRequiredItem(Skill skill) { return 0; }
public virtual int GetRequiredMoney(Skill skill) { return 0; }
public virtual int GetRequiredRealmLevel(Skill skill) { return 0; }
public virtual float GetPraydistance(Skill skill) { return 0f; }
public virtual float GetMpcost(Skill skill) { return 0f; }
public virtual int GetExecutetime(Skill skill) { return 1000; }
public virtual bool CheckHpCondition(int hp, int max_hp) { return true; }
public virtual bool CheckComboSkExtraCondition(Skill skill) { return true; }
public virtual int GetIntroduction(Skill skill, ushort[] descBuffer, int descBufferLen, ushort[] titleBuffer) { return 0; }
// ЧԼ // Validate weapon restriction
public bool ValidWeapon(int weapon)
{
if (restrict_weapons != null)
{
int i;
for (i = 0; i < restrict_weapons.Count; i++)
{
if (weapon == restrict_weapons[i])
return true;
}
if (i > 0 && i >= restrict_weapons.Count)
return false;
}
return true;
}
}
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster.Scripts.Skills
{
public class Range
{
/// <summary>0=point 1=line 2=self sphere 3=target sphere 4=cone 5=self</summary>
public byte type; // 0 1 2 3Ŀ 4Բ׶ 5
public bool IsPoint() { return type == 0; }
public bool IsLine() { return type == 1; }
public bool IsSelfBall() { return type == 2; }
public bool IsTargetBall() { return type == 3; }
public bool IsSector() { return type == 4; }
public bool IsSelf() { return type == 5; }
public bool NoTarget() { return type == 2 || type == 5; }
}
// ռλ // Placeholder Skill class
public class Skill : ElementSkill
{
protected SkillStub stub;
protected PlayerWrapper player;
protected uint id;
protected uint level;
Skill(uint i, SkillStub s)
{
id = i;
stub = s;
player = new PlayerWrapper();
}
public static Skill Create(uint id, int n)
{
SkillStub stub = SkillStub.GetStub(id);
if (stub == null)
return null;
Skill skill = new Skill(id, stub);
int max = skill.GetMaxLevel();
if (n > max)
skill.SetLevel(max);
else
skill.SetLevel(n);
return skill;
}
public override int GetMaxLevel() { return stub.GetMaxLevel(); }
public override int SetLevel(int l)
{
uint tmp = level;
level = (uint)l;
return (int)tmp;
}
public override int GetItemCost() { return stub.itemcost; }
public int GetLevel() { return (int)level; }
public PlayerWrapper GetPlayer()
{
return player;
}
public override int GetRank() { return stub.rank; }
public override bool IsInstant() { return stub.time_type == 1; }
public override int GetCls()
{
return stub.GetCls();
}
public override Dictionary<uint, int> GetJunior()
{
return stub.is_senior != 0 ? stub.pre_skills : new Dictionary<uint, int>();
}
public override int GetRangeType() { return stub.GetRange().type; }
public override int GetRequiredLevel() { return stub.GetRequiredLevel(this); }
public override int GetTargetType()
{
if (stub.restrict_corpse == 1)
return 2;
if (stub.restrict_corpse == 2)
return 3;
if (stub.type == (int)skill_type.TYPE_ATTACK || stub.type == (int)skill_type.TYPE_CURSE)
return 1;
if (stub.type == (int)skill_type.TYPE_BLESSPET)
return 4;
if (stub.GetRange().NoTarget())
return 0;
return 1;
}
public override byte GetType() { return stub.type; }
public override int GetCommonCoolDown() { return stub.commoncooldown; }
public override string GetIcon()
{
return stub.GetIcon();
}
public override string GetName() { return stub.GetName(); }
public override float GetPrayRange(float range, float prayplus)
{
player.SetRange(range);
player.SetPrayrangeplus(prayplus);
if (stub.type == (int)skill_type.TYPE_ATTACK || stub.type == (int)skill_type.TYPE_CURSE)
{
if (stub.auto_attack)
{
float r = 0.3f * stub.GetPraydistance(this);
if (r >= 1.0)
return stub.GetPraydistance(this) - 1.0f;
else
return (float)0.7 * stub.GetPraydistance(this);
}
else
return stub.GetPraydistance(this);
}
if (stub.type == (int)skill_type.TYPE_JUMP)
return stub.GetPraydistance(this);
if (stub.GetRange().NoTarget())
return -1;
else
return stub.GetPraydistance(this);
}
public override int GetCoolingTime() { return stub.GetCoolingtime(this); }
public int GetRequiredSp() { return stub.GetRequiredSp(this); }
public int GetRequiredMoney() { return stub.GetRequiredMoney(this); }
public override Dictionary<uint, int> GetRequiredSkill() { return stub.pre_skills; }
public int GetRequiredRealmLevel() { return stub.GetRequiredRealmLevel(this); }
public int GetMaxability() { return stub.GetMaxAbility(this); }
public uint GetId() { return id; }
}
public abstract class SkillStub
{
public const int MIN_LEVEL = 1;
public const int MAX_LEVEL = 10;
// Base info
public uint id; // Ψһֱʶ // Unique identifier
public int cls; // ְҵ // Class/Profession
public string name; // // Skill name
public string nativename; // // Native name
public string icon; // ͼ // Skill icon
public int max_level; // 󼶱? // Maximum level
public byte type; // ? 1 2 3ٻ 4 5 // Skill type: 1-Normal 2-Special 3-Partner 4-Mount 5-Other
// Execute condition
public bool allow_ride; // ? // Allow while riding
public short attr; // , 1256 ѡһ Ĭϣ // Attribute: 1-Metal 2-Earth 3-Wood 4-Water 5-Fire 6-Special (Choose one, default none)
public int rank; // // Rank
public int eventflag; // Event flag
public byte is_senior; // Senior flag
public bool is_inherent; // ܣѧ // Inherent skill, cannot be learned
public bool is_movingcast; // ƶʩ // Can cast while moving
public int npcdelay; // NPC delay
public int showorder; // Display order
public byte allow_forms; // Allowed forms
public int apcost; // AP cost
public int apgain; // AP gain
public byte doenchant; // Do enchant
public byte dobless; // Do bless
public int arrowcost; // Arrow cost
public Dictionary<uint, int> pre_skills;
// Execute condition
public bool allow_land; // ½Ч // Effective on land
public bool allow_air; // Ч // Effective in air
public bool allow_water; // ˮЧ // Effective in water
public bool notuse_in_combat; // ս״̬ // Cannot use in combat state
public int restrict_corpse; // ֻʬЧ // Only effective on corpses
public bool restrict_change; // ǷԱ // Whether can transform
public bool restrict_attach; // ǷԸ // Whether can possess
public bool auto_attack; // ʹúǷԶ // Whether to auto attack after use
public byte time_type; // ˲ // Instant cast type
public byte long_range;
public byte posdouble; // λѡ // Position selection
public int clslimit; // ְҵ // Class restriction
public int commoncooldown; // ȴmask bit0-4 ȴ0-4 bit5-9 Ʒȴ0-4
// Common cooldown mask bit0-4 skill cooldown 0-4 bit5-9 item cooldown 0-4
public int commoncooldowntime; // ȴʱλ // Cooldown time in milliseconds
public int itemcost; // ͷʱƷ >0Ч // Item cost when casting, effective if >0
// // Combo related
public int combosk_preskill;
public int combosk_interval;
public int combosk_nobreak;
public string effect;
public string aerial_effect;
public Range range;
public bool has_stateattack;
public List<int> restrict_weapons = new List<int>();
public static Dictionary<uint, SkillStub> map = new Dictionary<uint, SkillStub>();
public static Dictionary<uint, SkillStub> GetMap() => map;
public static Dictionary<uint, List<uint>> comboSkillMap = new Dictionary<uint, List<uint>>();
public static Dictionary<uint, List<uint>> GetComboSkMap() => comboSkillMap;
public static Dictionary<uint, List<uint>> inheritSkillMap = new Dictionary<uint, List<uint>>();
/*#if UNITY_EDITOR
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void OnPlay()
{
BMLogger.LogError("SkillStub OnPlay Reset");
map = new Dictionary<uint, SkillStub>();
comboSkillMap = new Dictionary<uint, List<uint>>();
inheritSkillMap = new Dictionary<uint, List<uint>>();
}
#endif*/
public SkillStub(uint i)
{
id = i;
is_inherent = (false);
is_movingcast = (false);
itemcost = (0);
combosk_preskill = (0);
combosk_interval = (0);
combosk_nobreak = (0);
if (GetStub(id) == null)
{
GetMap().Add(id, this);
}
}
public static List<uint> GetInherentSkillList(uint cls)
{
return inheritSkillMap[cls];
}
public static SkillStub GetStub(uint i)
{
return GetMap().TryGetValue(i, out var stub) ? stub : null;
}
public int GetItemCost() { return itemcost; }
public static void InitStaticData()
{
var map = GetMap();
foreach (var skill in map)
{
SkillStub sk = skill.Value;
if (sk.is_inherent) GetInherentSkillList((uint)sk.cls).Add(sk.id);
if (sk.combosk_preskill > 0) GetComboSkMap()[(uint)sk.combosk_preskill].Add(sk.id);
}
}
public List<uint> GetPostComboSkill(uint id)
{
var m = GetComboSkMap();
if (m.TryGetValue(id, out var list)) return list;
return null;
}
// ΪC++תĽӿ // The following methods are converted from C++
public uint GetId() { return id; }
public int GetCls() { return cls; }
public string GetName() { return name; }
public string GetIcon() { return icon; }
public int GetMaxLevel() { return max_level; }
public Range GetRange() { return range; }
public bool IsMovingSkill() { return is_movingcast; }
public byte GetType() { return type; } // System.Object.GetType // Hide System.Object.GetType
// ʱ // Runtime-related virtual functions
public virtual int GetCoolingtime(Skill skill) { return 5000; }
public virtual int GetRequiredSp(Skill skill) { return 0; }
public virtual int GetRequiredLevel(Skill skill) { return 0; }
public virtual int GetMaxAbility(Skill skill) { return 0; }
public virtual int GetRequiredItem(Skill skill) { return 0; }
public virtual int GetRequiredMoney(Skill skill) { return 0; }
public virtual int GetRequiredRealmLevel(Skill skill) { return 0; }
public virtual float GetPraydistance(Skill skill) { return 0f; }
public virtual float GetMpcost(Skill skill) { return 0f; }
public virtual int GetExecutetime(Skill skill) { return 1000; }
public virtual bool CheckHpCondition(int hp, int max_hp) { return true; }
public virtual bool CheckComboSkExtraCondition(Skill skill) { return true; }
public virtual int GetIntroduction(Skill skill, ushort[] descBuffer, int descBufferLen, ushort[] titleBuffer) { return 0; }
// ЧԼ // Validate weapon restriction
public bool ValidWeapon(int weapon)
{
if (restrict_weapons != null)
{
int i;
for (i = 0; i < restrict_weapons.Count; i++)
{
if (weapon == restrict_weapons[i])
return true;
}
if (i > 0 && i >= restrict_weapons.Count)
return false;
}
return true;
}
}
}
@@ -166,3 +166,6 @@ namespace BrewMonster
}
}
@@ -167,3 +167,6 @@ namespace BrewMonster
}
}
@@ -98,3 +98,6 @@ namespace BrewMonster
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace BrewMonster.UI
protected Canvas m_canvas;
protected Dictionary<int, string> m_StringTable = new Dictionary<int, string>();
protected Dictionary<int, string> m_auiDialog_stringTable = new Dictionary<int, string>();
protected Dictionary<string, AUIDialog> m_DlgName = new Dictionary<string, AUIDialog>();
public Dictionary<string, AUIDialog> m_DlgName = new Dictionary<string, AUIDialog>();
public string GetStringFromTable(int idString)
{
@@ -0,0 +1,29 @@
using BrewMonster.UI;
using UnityEngine;
using static CECUIManager;
namespace BrewMonster
{
public class CDlgMessageBox : AUIDialog
{
[SerializeField] private TMPro.TextMeshProUGUI titleText;
[SerializeField] private TMPro.TextMeshProUGUI messageText;
[SerializeField] private UnityEngine.UI.Button okButton;
private void Awake()
{
okButton.onClick.RemoveAllListeners();
okButton.onClick.AddListener(OnOkClicked);
}
private void OnOkClicked()
{
EventBus.Publish(new MessageBoxEvent(1,this));
Show(false);
}
public void ShowMessageBox(string title, string message)
{
SetName(title);
messageText.text = message;
Show(true);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6672523dc3dacfa46b2104f504acdb6e
@@ -13,14 +13,29 @@ namespace BrewMonster.UI
protected uint m_dwData;
protected object m_pvData;
protected AUIManager m_pAUIManager = null;
string m_szName;
public virtual void Show(bool value)
{
gameObject.SetActive(value);
OnShowDialogue();
}
public string GetName()
{
return m_szName;
}
public bool SetName(string pszName)
{
if (m_pAUIManager.m_DlgName.ContainsKey(pszName))
return false;
public void SetData(uint dwData, string strName)
//m_pAUIManager.m_DlgName.Remove(m_szName);
m_szName = pszName;
m_pAUIManager.m_DlgName[m_szName] = this;
return true;
}
public void SetData(uint dwData, string strName = "")
{
m_strDataName = strName;
m_dwData = dwData;
@@ -83,22 +98,22 @@ namespace BrewMonster.UI
public virtual void OnEnable()
{
}
public virtual void OnDisable()
{
}
public virtual void Awake()
{
m_szName = "Dialog_";
}
public virtual void Start()
{
}
public virtual void Update()
@@ -107,7 +122,7 @@ namespace BrewMonster.UI
}
public virtual void OnShowDialogue()
{
}
public virtual bool Render()
@@ -0,0 +1,55 @@
using BrewMonster.Scripts.Skills;
using BrewMonster.UI;
using System;
using UnityEngine;
using UnityEngine.UI;
namespace BrewMonster
{
public class CDlgSkillAction : AUIDialog
{
[SerializeField] private Button uiSkillButton;
[SerializeField] private GameObject skillUI;
bool m_bOpenAction;
bool m_bReceivedNCPGreeting; // ÊÇ·ñÊÕµ½ÁËNPCµÄGreeting
public override void Awake()
{
base.Awake();
uiSkillButton.onClick.RemoveAllListeners();
uiSkillButton.onClick.AddListener(OnSkillButtonClicked);
}
private void OnSkillButtonClicked()
{
TryOpenDialog(false);
}
public void TryOpenDialog(bool bAction)
{
var boolll = skillUI.activeInHierarchy;
if (boolll)
{
skillUI.SetActive(!boolll);
return;
}
skillUI.SetActive(!boolll);
if (skillUI.activeInHierarchy)
if (!GetHostPlayer().IsTalkingWithNPC())
{
m_bOpenAction = bAction;
CECHostSkillModel.Instance.SendHelloToSkillLearnNPC();
SetReceivedNPCGreeting(false);
}
}
public void SetReceivedNPCGreeting(bool bReceived)
{
m_bReceivedNCPGreeting = bReceived;
}
public bool IsReceivedNPCGreeting()
{
return m_bReceivedNCPGreeting;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3c007a40af961624cae5041be0798d18
@@ -46,7 +46,7 @@ namespace BrewMonster.UI
{
m_contentRoot = transform as RectTransform;
}
EventBus.Subscribe<CECSkillPanelChange>(OnModelChange);
CacheTemplateInfo();
HideTemplates();
}
@@ -163,7 +163,7 @@ namespace BrewMonster.UI
taoistRank != CECTaoistRank.GetBaseRankEnd();
taoistRank = taoistRank.GetNext())
{
BMLogger.LogError("CDlgSkillSubList::ResetDialog: Adding GetBaseRankBegin rank " + taoistRank.GetID());
BMLogger.LogError ("ResetDialog base rank " + taoistRank.GetName());
AddDlgsOfOneRank(taoistRank);
}
@@ -171,8 +171,7 @@ namespace BrewMonster.UI
taoistRank != CECTaoistRank.GetGodRankEnd();
taoistRank = taoistRank.GetNext())
{
BMLogger.LogError("CDlgSkillSubList::ResetDialog: Adding GetGodRankBegin rank " + taoistRank.GetID());
BMLogger.LogError("ResetDialog base rank " + taoistRank.GetName());
AddDlgsOfOneRank(taoistRank);
}
@@ -180,8 +179,7 @@ namespace BrewMonster.UI
taoistRank != CECTaoistRank.GetEvilRankEnd();
taoistRank = taoistRank.GetNext())
{
BMLogger.LogError("CDlgSkillSubList::ResetDialog: Adding GetEvilRankBegin rank " + taoistRank.GetID());
BMLogger.LogError("ResetDialog Evil rank " + taoistRank.GetName());
AddDlgsOfOneRank(taoistRank);
}
@@ -204,6 +202,7 @@ namespace BrewMonster.UI
// ޸ijһ״̬ / Refresh a single skill sub dialog
private void UpdateOneSubDlg(int skillID)
{
//BMLogger.LogError("UpdateOneSubDlg");
if (!m_skillSubDialogsMap.TryGetValue(skillID, out var pSub))
{
return;
@@ -219,7 +218,7 @@ namespace BrewMonster.UI
subListItem.Show(true);
if (GetSelectedSkillID() == skillID)
{
// 选中时可在此扩展树状展示 / Hook skill tree here if needed
//GetGameUIMan()->m_pDlgSkillAction->ShowSkillTree(skillID);
}
}
@@ -271,24 +270,24 @@ namespace BrewMonster.UI
if (allRankProfSkills == null)
{
BMLogger.LogError("HoangDev: AddDlgsOfOneRank allRankProfSkills is null");
//BMLogger.LogError("HoangDev: AddDlgsOfOneRank allRankProfSkills is null");
return;
}
if (IsEvil() && taoistRank.IsGodRank())
{
BMLogger.LogError("HoangDev: AddDlgsOfOneRank IsEvil() && taoistRank.IsGodRank()");
//BMLogger.LogError("HoangDev: AddDlgsOfOneRank IsEvil() && taoistRank.IsGodRank()");
return;
}
else if (!IsEvil() && taoistRank.IsEvilRank())
{
BMLogger.LogError("HoangDev: AddDlgsOfOneRank !IsEvil() && taoistRank.IsEvilRank()");
//BMLogger.LogError("HoangDev: AddDlgsOfOneRank !IsEvil() && taoistRank.IsEvilRank()");
return;
}
if (!allRankProfSkills.TryGetValue(rankID, out var rankItr) || rankItr == null || rankItr.Count == 0)
{
BMLogger.LogError("HoangDev: AddDlgsOfOneRank !allRankProfSkills.TryGetValue(rankID, out var rankItr) || rankItr == null || rankItr.Count == 0");
//BMLogger.LogError($"HoangDev: AddDlgsOfOneRank !allRankProfSkills.TryGetValue({rankID}, out var rankItr) || rankItr == null || rankItr.Count == 0");
return;
}
@@ -481,13 +480,12 @@ namespace BrewMonster.UI
}
// мܱˣҪ / Handle model change notifications
public void OnModelChange(CECHostSkillModel p, CECSkillPanelChange q)
public void OnModelChange(CECSkillPanelChange q)
{
if (q == null)
/* if (!GetGameUIMan().m_pDlgSkillAction.IsShow())
{
return;
}
}*/
if (q.m_changeMask == CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_OVERRIDDEN)
{
ResetDialog();
@@ -508,7 +506,7 @@ namespace BrewMonster.UI
}
else if (q.m_changeMask == CECSkillPanelChange.enumChangeMask.CHANGE_SKILL_NPC)
{
// NPC变化时原逻辑隐藏技能树 / Original logic hides skill tree when NPC changes
//GetGameUIMan()->m_pDlgSkillAction->Show(false);
}
}
}
@@ -47,8 +47,6 @@ namespace BrewMonster
/*CDlgQuickBar* pQuickBar = dynamic_cast<CDlgQuickBar*>(GetGameUIMan()->GetDialog(a_pszPanel[i]));
if (!pQuickBar || !pQuickBar->IsShow()) continue;*/
for (int j = 0; j < AUIImagePictureList.Count; j++)
{
pCell = AUIImagePictureList[j];
@@ -32,6 +32,7 @@ namespace BrewMonster
private void UpdateClockIcon()
{
float progress = (float)(m_iMax - m_iPos) / (m_iMax - m_iMin);
//BMLogger.LogError($"UpdateClockIcon progress:{progress}, m_iMax:{m_iMax}, m_iPos:{m_iPos}, m_iMin:{m_iMin}" );
m_ClockIcon.fillAmount = progress;
}
@@ -1,4 +1,6 @@
using BrewMonster.Scripts.Skills;
using BrewMonster.UI;
using CSNetwork.GPDataType;
using System;
using TMPro;
using UnityEngine;
@@ -9,17 +11,117 @@ using static TMPro.SpriteAssetUtilities.TexturePacker_JsonArray;
namespace BrewMonster
{
[DisallowMultipleComponent]
public class CDlgSkillSubListItem : MonoBehaviour
public class CDlgSkillSubListItem : AUIDialog
{
[SerializeField] private TextMeshProUGUI m_skillNameLbl;
[SerializeField] private TextMeshProUGUI skillLevel;
[SerializeField] private Image skillIcon;
[SerializeField] private GameObject m_highlight;
[SerializeField] private Button m_upgradeBtn;
private int m_skillID;
private int m_curLevel;
private const string l_colorWhite = "<color=#ffffff>";
private const string l_colorRed = "<color=#ff0000>";
private const string l_colorClose = "</color>";
private void Awake()
{
m_upgradeBtn.onClick.RemoveAllListeners();
m_upgradeBtn.onClick.AddListener(OnCommand_Upgrade);
}
private void OnCommand_Upgrade()
{
CECHostPlayer player = GetHostPlayer();
if (player == null)
{
return;
}
var uiManager = CECUIManager.Instance;
var gameUIMan = uiManager.GetInGameUIMan();
if (player.IsDead() ||
player.IsSitting() ||
player.IsChangingFace() ||
player.IsTrading() ||
player.GetBoothState() != 0 ||
player.IsRooting() ||
player.IsHangerOn() ||
player.GetCurSkill() != null ||
player.IsFighting())
{
uiManager.ShowMessageBox("MessageBox", gameUIMan.GetStringFromTable(11327));
}
int nCondition = CECHostSkillModel.Instance.CheckLearnCondition(m_skillID);
int nCheckCode = 0;
if (1 == nCondition)
{
nCheckCode = 270;
}
else if (6 == nCondition)
{
nCheckCode = 527;
}
else if (7 == nCondition)
{
nCheckCode = 541;
}
else if (8 == nCondition)
{
nCheckCode = 271;
}
else if (9 == nCondition)
{
nCheckCode = 556;
}
else if (10 == nCondition)
{
nCheckCode = 557;
}
else if (12 == nCondition)
{
nCheckCode = 11168;
}
else
{
BMLogger.LogError("CheckLearnCondition: " + (nCheckCode == 0));
}
if (nCheckCode == 0)
{
int needMoney = CECHostSkillModel.Instance.GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
string str = GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11326), needMoney, needSp);
var messagebox = uiManager.ShowMessageBox("Game_LearnSkill", str);
messagebox.SetData((uint)m_skillID);
//GetGameUIMan()->MessageBox("Game_LearnSkill", str, //GetGameUIMan()->GetStringFromTable(231),
// MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
//pMsgBox->SetData(m_skillID);
if (!uiManager.m_pDlgSkillAction.IsReceivedNPCGreeting())
{
CECHostSkillModel.Instance.SendHelloToSkillLearnNPC();
}
}
else
{
/* GetGameUIMan()->MessageBox("", GetGameUIMan()->GetStringFromTable(nCheckCode), MB_OK,
A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
pMsgBox->SetLife(3);*/
}
}
public void UpdateSkill(int skillID)
{
//BMLogger.LogError("HoangDev: CDlgSkillSubListItem UpdateSkill skillID " + skillID);
CECHostSkillModel model = CECHostSkillModel.Instance;
m_skillID = skillID;
m_curLevel = model.GetSkillCurrentLevel(m_skillID);
enumSkillLearnedState learnedState = model.GetSkillLearnedState(m_skillID);
var spriteName = model.GetSkillIcon(skillID);
var sprites = Resources.LoadAll<Sprite>("iconlist_skill_multisprite");
if (sprites == null || sprites.Length == 0)
@@ -33,8 +135,21 @@ namespace BrewMonster
break;
}
}
if (enumSkillLearnedState.SKILL_NOT_LEARNED == learnedState)
{
skillIcon.color = Color.gray;
/* skillDsc = model.GetSkillDescription(m_skillID, 1);
reqLevel = GNET::ElementSkill::GetRequiredLevel(m_skillID, 1);
reqRealmLevel = GNET::ElementSkill::GetRequiredRealmLevel(m_skillID, 1);*/
}
else
{
skillIcon.color = Color.white;
/* skillDsc = model.GetSkillDescription(m_skillID, m_curLevel);
reqLevel = GNET::ElementSkill::GetRequiredLevel(m_skillID, m_curLevel);
reqRealmLevel = GNET::ElementSkill::GetRequiredRealmLevel(m_skillID, m_curLevel);*/
}
m_skillID = skillID;
string skillName = model.GetSkillName(m_skillID);
/* if (model.IsPassiveSkill(m_skillID))
{
@@ -45,6 +160,111 @@ namespace BrewMonster
BMLogger.LogError("HoangDev: CDlgSkillSubListItem m_skillNameLbl is null for skillID " + skillID);
}
m_skillNameLbl.text = skillName;
UpdateUpgradeBtn();
if (enumSkillLearnedState.SKILL_NOT_LEARNED == learnedState)
{
skillLevel.gameObject.SetActive(false);
}
else
{
skillLevel.gameObject.SetActive(true);
skillLevel.text = GetStringFromTable(11323).Replace("%d", m_curLevel.ToString());
}
}
private void UpdateUpgradeBtn()
{
CECHostSkillModel model = CECHostSkillModel.Instance;
enumSkillFitLevelState fitLevel = model.GetSkillFitLevel(m_skillID);
enumSkillLearnedState learnedState = model.GetSkillLearnedState(m_skillID);
int requiredItem = model.GetRequiredBook(m_skillID, m_curLevel + 1);
//BMLogger.LogError($"UpdateUpgradeBtn learnedState:{learnedState}, fitLevel={fitLevel}, requiredItem:{requiredItem}, model.CheckPreItem(requiredItem):{model.CheckPreItem(requiredItem)}");
if (enumSkillLearnedState.SKILL_FULL != learnedState &&
enumSkillFitLevelState.SKILL_FIT_LEVEL == fitLevel &&
(requiredItem == 0 || model.CheckPreItem(requiredItem)))
{
m_upgradeBtn.gameObject.SetActive(true);
string str;
if (model.IsSkillServedByNPC(m_skillID))
{
int needSp = model.GetSkillSp(m_skillID, m_curLevel + 1);
int needMoney = model.GetSkillMoney(m_skillID, m_curLevel + 1);
int curSp = GetHostPlayer().GetBasicProps().iSP;
uint curMoney = GetHostPlayer().GetMoneyAmount();
bool spOK = curSp >= needSp;
bool moneyOK = curMoney >= needMoney;
bool preSkillOK = true;
var requiredSkill = model.GetRequiredSkill(m_skillID, m_curLevel + 1);
if (requiredSkill != null && requiredSkill.Count > 0)
{
foreach (var skill in requiredSkill)
{
if (!model.CheckPreSkillLevel((int)skill.Key, skill.Value))
{
preSkillOK = false;
break;
}
}
}
//BMLogger.LogError($"HoangDev: UpdateUpgradeBtn m_skillID:{m_skillID} spOK=" + spOK + ", moneyOK=" + moneyOK + ", preSkillOK=" + preSkillOK);
if (spOK && moneyOK && preSkillOK)
{
m_upgradeBtn.interactable = true;
}
else
{
m_upgradeBtn.interactable = (false);
}
/*string strSp;
string strMoney;
string strPreSkill = "";
strSp = string.Format(GetStringFromTable(11402), needSp);
strMoney = string.Format(GetStringFromTable(11403), needMoney);
if (spOK)
{
strSp = l_colorWhite + strSp + l_colorClose;
}
else
{
strSp = l_colorRed + strSp + l_colorClose;
}
if (moneyOK)
{
strMoney = l_colorWhite + strMoney + l_colorClose;
}
else
{
strMoney = l_colorRed + strMoney + l_colorClose;
}
if (!preSkillOK)
{
strPreSkill = GetStringFromTable(11404);
}*/
// Set tooltip/hint for the button
// m_upgradeBtn.SetHint(strSp + strMoney + strPreSkill);
// Note: Unity doesn't have SetHint, you may need to implement tooltip system
}
else
{
BMLogger.LogError("HoangDev: UpdateUpgradeBtn Skill is not served by NPC m_skillID:" + m_skillID);
str = string.Format(GetStringFromTable(11321));
// m_upgradeBtn.SetHint(str);
m_upgradeBtn.interactable = false;
}
}
else
{
m_upgradeBtn.gameObject.SetActive(false);
}
}
public void SetHighlight(bool bHighlight)
@@ -71,5 +291,13 @@ namespace BrewMonster
{
return m_skillID;
}
private CECHostPlayer GetHostPlayer()
{
// TODO: Implement this method to return the current host player
// This should return the local player instance
return CECGameRun.Instance.GetHostPlayer();
}
}
}
+1 -1
View File
@@ -125,7 +125,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c9177aa9fcd28a94b9042f8a89fdac2d, type: 3}
m_Name:
m_EditorClassIdentifier:
isDebg: 0
isDebg: 1
--- !u!114 &1552922004895094615
MonoBehaviour:
m_ObjectHideFlags: 0
+149 -26
View File
@@ -7867,9 +7867,9 @@ RectTransform:
m_Children: []
m_Father: {fileID: 3016923604946316301}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 83.16, y: -48.51895}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 166.32, y: 97.0379}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &821733676846102905
@@ -7943,9 +7943,9 @@ RectTransform:
- {fileID: 4351609655079222131}
m_Father: {fileID: 2825516843822704547}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 167.0151, y: -22.62375}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 334.0302, y: 45.2475}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5645061043433811765
@@ -10283,9 +10283,9 @@ RectTransform:
- {fileID: 3703262150164293383}
m_Father: {fileID: 3016923604946316301}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 83.16, y: -292.4765}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 166.32, y: 130.2924}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5150156580756960231
@@ -11532,9 +11532,9 @@ RectTransform:
- {fileID: 131742873718785436}
m_Father: {fileID: 3016923604946316301}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 83.16, y: -162.18411}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 166.32, y: 130.2924}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5468634806808161123
@@ -11613,7 +11613,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &2825516843822704547
RectTransform:
m_ObjectHideFlags: 0
@@ -11633,7 +11633,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 358.8119, y: -105.62375}
m_SizeDelta: {x: 685.6238, y: 155.2475}
m_SizeDelta: {x: 685.6238, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4552529476466259825
CanvasRenderer:
@@ -11725,10 +11725,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7f3b136cb144656428e4764d58c18c52, type: 3}
m_Name:
m_EditorClassIdentifier:
m_subDialog: {fileID: 0}
m_subDialog: {fileID: 7688900625148083785}
m_rectTransform: {fileID: 2825516843822704547}
levelName: {fileID: 0}
label: {fileID: 0}
label: {fileID: 708823501721075410}
--- !u!1 &5403634742995450233
GameObject:
m_ObjectHideFlags: 0
@@ -13702,7 +13701,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &627631504828013321
RectTransform:
m_ObjectHideFlags: 0
@@ -15374,6 +15373,126 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7025810558559276645
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7084227105954184495}
- component: {fileID: 4213342741137376170}
- component: {fileID: 4115546771738916658}
- component: {fileID: 2802100335901209485}
m_Layer: 5
m_Name: ButtonUpgrade
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &7084227105954184495
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7025810558559276645}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5330897987501731450}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 293.09116, y: -5}
m_SizeDelta: {x: 99.4427, y: 67.3647}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4213342741137376170
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7025810558559276645}
m_CullTransparentMesh: 1
--- !u!114 &4115546771738916658
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7025810558559276645}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 9de07872267c5419b9fa9c849eb45858, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &2802100335901209485
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7025810558559276645}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4115546771738916658}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &7127928585978759580
GameObject:
m_ObjectHideFlags: 0
@@ -17691,7 +17810,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -361.27, y: 365.44547}
m_SizeDelta: {x: 722.5344, y: 28}
m_SizeDelta: {x: 722.5344, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &7853130943468561016
CanvasRenderer:
@@ -17783,9 +17902,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7304a7aa2183ad34babf66894ed22f7e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_pSubRank: {fileID: 0}
m_pSubSkill: {fileID: 0}
m_contentRoot: {fileID: 0}
m_pSubRank: {fileID: 1851903413579782982}
m_pSubSkill: {fileID: 7688900625148083785}
m_contentRoot: {fileID: 8302858527499935758}
m_contentRootSkill: {fileID: 0}
m_scrollRect: {fileID: 0}
m_windowScale: 1
m_isEvil: 0
@@ -17803,7 +17923,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_subDialog: {fileID: 0}
m_rectTransform: {fileID: 8302858527499935758}
levelName: {fileID: 0}
label: {fileID: 0}
--- !u!1 &7758409605357852732
GameObject:
@@ -17962,11 +18081,12 @@ RectTransform:
- {fileID: 2021305536316673845}
- {fileID: 8723418028367828956}
- {fileID: 187116969457634403}
- {fileID: 7084227105954184495}
m_Father: {fileID: 2825516843822704547}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 342.81, y: -105.2475}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 685.62, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &114056069577405476
@@ -17990,7 +18110,10 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_skillNameLbl: {fileID: 7381636566794381957}
skillLevel: {fileID: 1095789015156331712}
skillIcon: {fileID: 3801278460223427377}
m_highlight: {fileID: 0}
m_upgradeBtn: {fileID: 2802100335901209485}
--- !u!114 &536870940929799852
MonoBehaviour:
m_ObjectHideFlags: 0
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:def3c6a4f58ef9b5c9558210328e5b6f3ed11bfee5b577271ee43fa110616b82
size 200521689
oid sha256:3c76c39b1f6f2ca8de739551935e1461ca08857855d1319c19619dd05b7e35b3
size 200530484
+245 -18
View File
@@ -87,6 +87,8 @@ namespace BrewMonster
private CECSkill m_pTargetItemSkill; // Target item skill
public CECComboSkill m_pComboSkill; // Combo skill
public A3DVECTOR3 m_vAccel; // Accelerate\
public byte m_RealmLevel;
REINCARNATION_TOME m_ReincarnationTome; // תÉú
public bool m_bRushFly = false; // true, in rush fly mode
private CECCounter m_IncantCnt;
@@ -289,6 +291,7 @@ namespace BrewMonster
public bool LoadResources()
{
//BMLogger.LogError("HoangDev: CECHostPlayer::LoadResources");
RoleInfo RoleInfo = UnityGameSession.Instance.GetRoleInfo();
m_iProfession = RoleInfo.occupation;
m_iGender = RoleInfo.gender;
@@ -560,6 +563,8 @@ namespace BrewMonster
case int value when value == EC_MsgDef.MSG_HST_COOLTIMEDATA: OnMsgHstCoolTimeData(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_SETCOOLTIME: OnMsgHstSetCoolTime(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_PRESSCANCEL: OnMsgHstPressCancel(Msg); break;
case int value when value == EC_MsgDef.MSG_HST_LEARNSKILL: OnMsgHstLearnSkill(Msg); break;
case int value when value == EC_MsgDef.MSG_PM_PLAYERFLY: OnMsgPlayerFly(Msg); break;
}
@@ -584,6 +589,53 @@ namespace BrewMonster
}*/
}
private void OnMsgHstLearnSkill(ECMSG Msg)
{
BMLogger.LogError("OnMsgHstLearnSkill");
cmd_learn_skill pCmd = GPDataTypeHelper.FromBytes<cmd_learn_skill>((byte[])Msg.dwParam1);
CECSkill pSkill = GetNormalSkill(pCmd.skill_id);
if (pSkill != null)
{
if (pCmd.skill_level > 0)
{
pSkill.LevelUp();
ElementSkill.SetLevel((uint)pCmd.skill_id, pCmd.skill_level);
}
else
{
RemoveNormalSkill(pCmd.skill_id);
}
}
else if (pCmd.skill_level > 0)
{
pSkill = new CECSkill(pCmd.skill_id, pCmd.skill_level);
if (pSkill == null)
{
Debug.Assert(pSkill != null);
return;
}
if (!pSkill.GetJunior().Empty())
{
ReplaceJuniorSkill(pSkill);
}
else
{
if (pSkill.GetType() != (int)CECSkill.SkillType.TYPE_PASSIVE &&
pSkill.GetType() != (int)CECSkill.SkillType.TYPE_PRODUCE &&
pSkill.GetType() != (int)CECSkill.SkillType.TYPE_LIVE)
m_aPtSkills.Add(pSkill);
else
m_aPsSkills.Add(pSkill);
}
ElementSkill.SetLevel((uint)pCmd.skill_id, pCmd.skill_level);
}
CECHostSkillModel.Instance.OnLearnSkill(pCmd.skill_id, pCmd.skill_level);
}
private void OnMsgHstSetCoolTime(ECMSG Msg)
{
BMLogger.LogError("HoangDev : OnMsgHstSetCoolTime ");
@@ -609,15 +661,15 @@ namespace BrewMonster
// other goblin skills should be set public cool down, 1 second
/* for (i = 0; i < m_aGoblinSkills.GetSize(); i++)
{
if (m_aGoblinSkills[i] && m_aGoblinSkills[i].GetCoolingCnt() == 0)
m_aGoblinSkills[i].StartCooling(GetCoolTime(GP_CT_CAST_ELF_SKILL), GetCoolTime(GP_CT_CAST_ELF_SKILL));
if (m_aGoblinSkills[i] && m_aGoblinSkills[i]->GetCoolingCnt() == 0)
m_aGoblinSkills[i]->StartCooling(GetCoolTime(GP_CT_CAST_ELF_SKILL), GetCoolTime(GP_CT_CAST_ELF_SKILL));
}*/
/* for (i = 0; i < m_aPsSkills.Count; i++)
{
CECSkill pSkill = GetPassiveSkillByIndex(i);
if (pSkill && (pSkill.GetCommonCoolDown() & (1 << (pCmd.cooldown_index - GP_CT_SKILLCOMMONCOOLDOWN0))))
pSkill.StartCooling(GetCoolTime(pCmd.cooldown_index), GetCoolTime(pCmd.cooldown_index));
if (pSkill && (pSkill->GetCommonCoolDown() & (1 << (pCmd->cooldown_index - GP_CT_SKILLCOMMONCOOLDOWN0))))
pSkill->StartCooling(GetCoolTime(pCmd->cooldown_index), GetCoolTime(pCmd->cooldown_index));
}*/
}
@@ -662,7 +714,7 @@ namespace BrewMonster
}
/* else if (pSkill = CECComboSkillState::Instance().GetInherentSkillByID(idSkill))
{
pSkill.StartCooling(pCmd.cooldown_time, pCmd.cooldown_time);
pSkill->StartCooling(pCmd->cooldown_time, pCmd->cooldown_time);
}*/
else if (GetEquipSkillByID(idSkill) == null)
{
@@ -2180,6 +2232,9 @@ namespace BrewMonster
try
{
var money = GPDataTypeHelper.FromBytes<CSNetwork.GPDataType.cmd_get_own_money>(data);
SetMoneyAmount(money.amount);
var ui = GameObject.FindFirstObjectByType<BrewMonster.Scripts.Managers.EC_InventoryUI>();
if (ui == null)
{
@@ -2436,7 +2491,7 @@ namespace BrewMonster
m_bEnterGame = false;
}
CECSkill GetNormalSkill(int id, bool bSenior = false /* false */)
public CECSkill GetNormalSkill(int id, bool bSenior = false /* false */)
{
CECSkill pSkill = null;
if (ElementSkill.GetType((uint)id) == (byte)CECSkill.SkillType.TYPE_PASSIVE ||
@@ -2480,6 +2535,7 @@ namespace BrewMonster
// roleName = Encoding.UTF8.GetString(role.name.ByteArray, 0, role.name.Length);
//}
SetPlayerInfor(new INFO(role.cid, role.crc_e, role.crc_c));
LoadResources();
await SetPlayerModel(UnityGameSession.Instance.GetRoleInfo().occupation,
UnityGameSession.Instance.GetRoleInfo().gender);
isDataAwaitToReady = true;
@@ -2554,7 +2610,6 @@ namespace BrewMonster
m_pWorkMan.StartWork_p1(pWork);
}*/
//m_GndInfo.bOnGround = GroundCheck(out lastGroundHit);
LoadResources();
if (m_pWorkMan == null)
{
return;
@@ -2592,13 +2647,13 @@ namespace BrewMonster
}*/
m_dwMoveRelDir = 0;
if (!CanDo(ActionCanDo.CANDO_MOVETO)) return;
if(joystick.Vertical > 0)
if (joystick.Vertical > 0)
{
if(joystick.Horizontal > 0)
if (joystick.Horizontal > 0)
{
m_dwMoveRelDir |= (uint)(MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_RIGHT);
}
else if(joystick.Horizontal < 0)
else if (joystick.Horizontal < 0)
{
m_dwMoveRelDir |= (uint)(MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_LEFT);
}
@@ -3061,8 +3116,6 @@ namespace BrewMonster
{
if (cooldown_index < 0)
{
// 更新所有装备技能
// Update all equipment skills
for (int i = 0; i < GetEquipSkillNum(); ++i)
{
@@ -3094,8 +3147,6 @@ namespace BrewMonster
}
else
{
// 更新指定技能
// Update specified skill
if (cooldown_index > (int)CoolTimeIndex.GP_CT_SKILL_START)
{
int idSkill = cooldown_index - (int)CoolTimeIndex.GP_CT_SKILL_START;
@@ -4109,6 +4160,7 @@ namespace BrewMonster
return null;
}
public int GetMaxLevelSofar() { return Math.Max(m_ReincarnationTome.max_level, m_BasicProps.iLevel); }
// C# conversion of CECHostPlayer::GetEquipSkillByID
// Assumes: GetEquipSkillNum() returns the count of equipment skills
@@ -5197,6 +5249,7 @@ namespace BrewMonster
// }
// UpdateMonsterSpiritGfx(dwDeltaTime);
}
public byte GetRealmLevel() { return m_RealmLevel; }
// Level up
public void LevelUp()
@@ -5408,7 +5461,7 @@ namespace BrewMonster
}
// Can jump or take off in water ?
bool IsSitting()
public bool IsSitting()
{
return (m_dwStates & PlayerNPCState.GP_STATE_SITDOWN) != 0 ? true : false;
}
@@ -5420,7 +5473,7 @@ namespace BrewMonster
}
// Is host player talking with NPC ?
bool IsTalkingWithNPC()
public bool IsTalkingWithNPC()
{
return m_bTalkWithNPC;
}
@@ -5926,7 +5979,27 @@ namespace BrewMonster
NameHostPlayer = name;
}
}
public struct REINCARNATION_TOME
{
public int tome_exp;
public char tome_active; // 1¼¤»î0δ¼¤»î
public int max_level; // ÀúÊ·×î¸ßµÈ¼¶
cmd_reincarnation_tome_info._entry[] reincarnations;
static int max_exp;
};
public struct cmd_reincarnation_tome_info
{
public int tome_exp;
public char tome_active; // 1¼¤»î0δ¼¤»î
public int count;
public struct _entry
{
int level;
int timestamp;
int exp;
}
public _entry[] records;
};
// Behavior id used by CanDo()
public static class ActionCanDo
@@ -6278,6 +6351,160 @@ namespace BrewMonster
}
}
// Remove skill reference / 删除技能引用
void RemoveSkillReference(int idSkill)
{
if (idSkill <= 0) return;
// Remove reference to self skill / 删除对技能的引用
if (m_pPrepSkill != null && m_pPrepSkill.GetSkillID() == idSkill)
m_pPrepSkill = null;
if (m_pCurSkill != null && m_pCurSkill.GetSkillID() == idSkill)
m_pCurSkill = null;
if (m_pComboSkill != null && m_pComboSkill.FindSkillID(idSkill))
ClearComboSkill();
if (m_pWorkMan != null)
{
CECHPWork pWork = m_pWorkMan.GetWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT);
if (pWork != null)
{
CECHPWorkTrace pWorkTrace = pWork as CECHPWorkTrace;
if (pWorkTrace != null &&
pWorkTrace.GetTraceReason() == CECHPWorkTrace.Trace_reason.TRACE_SPELL &&
pWorkTrace.GetPrepSkill() != null &&
pWorkTrace.GetPrepSkill().GetSkillID() == idSkill)
pWorkTrace.Reset();
}
}
int i;
for (i = 0; i < HostCfgConstants.NUM_HOSTSCSETS1; i++)
{
if (m_aSCSets1[i] != null)
m_aSCSets1[i].RemoveSkillShortcut(idSkill);
}
for (i = 0; i < HostCfgConstants.NUM_HOSTSCSETS2; i++)
{
if (m_aSCSets2[i] != null)
m_aSCSets2[i].RemoveSkillShortcut(idSkill);
}
}
// Remove skill / 删除技能
void RemoveNormalSkill(int idSkill)
{
// Delete equipped skills / 删除装备技能
if (idSkill <= 0) return;
RemoveSkillReference(idSkill);
// Delete skill list pointer / 删除技能列表指针
int i;
for (i = 0; i < m_aPtSkills.Count; i++)
{
if (m_aPtSkills[i].GetSkillID() == idSkill)
{
m_aPtSkills.RemoveAt(i);
return;
}
}
for (i = 0; i < m_aPsSkills.Count; i++)
{
if (m_aPsSkills[i].GetSkillID() == idSkill)
{
m_aPsSkills.RemoveAt(i);
return;
}
}
for (i = 0; i < m_aGoblinSkills.Count; i++)
{
if (m_aGoblinSkills[i].GetSkillID() == idSkill)
{
m_aGoblinSkills.RemoveAt(i);
return;
}
}
}
// Clear combo skill / 清除连击技能
void ClearComboSkill()
{
if (m_pComboSkill != null)
{
m_pComboSkill = null;
}
}
// Replace specified skill with it's senior skill / 用高级技能替换指定的低级技能
void ReplaceJuniorSkill(CECSkill pSeniorSkill)
{
if (pSeniorSkill == null)
{
Debug.Assert(pSeniorSkill != null);
return;
}
SkillArrayWrapper juniorArray = pSeniorSkill.GetJunior();
if (juniorArray.Empty())
{
Debug.Assert(false);
return;
}
int i;
// Update shortcuts ... / 更新快捷方式...
for (i = 0; i < HostCfgConstants.NUM_HOSTSCSETS1; i++)
{
if (m_aSCSets1[i] != null)
m_aSCSets1[i].ReplaceSkillID(juniorArray, pSeniorSkill);
}
for (i = 0; i < HostCfgConstants.NUM_HOSTSCSETS2; i++)
{
if (m_aSCSets2[i] != null)
m_aSCSets2[i].ReplaceSkillID(juniorArray, pSeniorSkill);
}
// Update skill groups ... / 更新技能组...
// Note: Combo skill update logic may need to be added here
// Original C++ code had EC_VIDEO_SETTING and combo skill group logic
}
public int CheckSkillLearnCondition(int idSkill, bool bCheckBook)
{
int iLevel = 1;
CECSkill pSkill = GetNormalSkill(idSkill);
if (pSkill != null)
iLevel = pSkill.GetSkillLevel() + 1;
if (iLevel == 1 && bCheckBook)
{
// Do we have the skill book ?
int idBook = ElementSkill.GetRequiredBook((uint)idSkill, iLevel);
if (idBook != 0 /*&& m_pPack.FindItem(idBook) < 0*/)
return 8;
}
// Build player information
LearnRequirement Info;
Info.level = GetMaxLevelSofar();
Info.sp = m_BasicProps.iSP;
Info.money = (int)m_iMoneyCnt;
Info.profession = m_iProfession;
Info.rank = m_BasicProps.iLevel2;
Info.realm_level = GetRealmLevel();
return ElementSkill.LearnCondition((uint)idSkill, Info, iLevel);
}
private void OnMsgHstPressCancel(ECMSG Msg)
{
CECHPWork pCurWork = null;
@@ -6390,7 +6617,7 @@ namespace BrewMonster
if (pItem == null)
return false;
if(pItem is EC_IvtrEquip)
if (pItem is EC_IvtrEquip)
{
if ((pItem as EC_IvtrEquip).IsDestroying())
return false;
+96 -7
View File
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using BrewMonster;
using BrewMonster.Network;
using BrewMonster.UI;
using CSNetwork;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UIElements;
public class CECUIManager : MonoSingleton<CECUIManager>
{
@@ -21,20 +23,23 @@ public class CECUIManager : MonoSingleton<CECUIManager>
[SerializeField] private DialogScriptTableObject dialogResouce;
[SerializeField] private Canvas canvasDlg;
[SerializeField] private CDlgQuickBar cDlgQuickBar;
[SerializeField] private Button btnSecondClick;
[SerializeField] private UnityEngine.UI.Button btnSecondClick;
[SerializeField] CDlgQuickBar m_pDlgQuickBar1;
CDlgMessageBox m_pDlgMessageBox;
public CDlgSkillAction m_pDlgSkillAction;
protected override void Awake()
{
base.Awake();
EventBus.Subscribe<CECHostPlayer.NPCINFO>(ShowUINPC);
EventBus.Subscribe<NPCDiedEvent>(TryHideUINPC);
EventBus.Subscribe<MessageBoxEvent>(OnMessageBox);
gameUI = new CECGameUIMan();
gameUI.SetDependency(dialogResouce, canvasDlg);
gameUI.Init();
m_pDlgSkillAction = GetComponent<CDlgSkillAction>();
// Wire up second-click button / 连接第二次点击按钮
if (btnSecondClick != null)
{
@@ -53,7 +58,7 @@ public class CECUIManager : MonoSingleton<CECUIManager>
{
EventBus.Unsubscribe<CECHostPlayer.NPCINFO>(ShowUINPC);
EventBus.Unsubscribe<NPCDiedEvent>(TryHideUINPC);
EventBus.Unsubscribe<MessageBoxEvent>(OnMessageBox);
}
private void ShowUINPC(CECHostPlayer.NPCINFO obj)
@@ -65,7 +70,7 @@ public class CECUIManager : MonoSingleton<CECUIManager>
}
public CDlgQuickBar GetCDlgQuickBar()
{
return cDlgQuickBar;
return m_pDlgQuickBar1;
}
private void TryHideUINPC(NPCDiedEvent obj)
{
@@ -97,6 +102,80 @@ public class CECUIManager : MonoSingleton<CECUIManager>
Debug.LogWarning($"Không tìm thấy UI {componentName} đã spawn trong canvasDlg. Type found: {(type != null ? type.FullName : "null")}");
}
public CDlgMessageBox ShowMessageBox(string title, string message)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBox(title, message);
return msgBox;
}
else
{
Debug.LogError("DlgMessageBox not found in InGameUIMan");
}
return null;
}
private void OnMessageBox(MessageBoxEvent messageBoxEvent)
{
BMLogger.LogError("CECUIManager OnMessageBox called");
int iRetVal = messageBoxEvent.iRetVal;
AUIDialog pDlg = messageBoxEvent.pDlg;
if (pDlg == m_pDlgMessageBox)
{
OnNewMessageBox(iRetVal);
return;
}
UnityGameSession pSession = UnityGameSession.Instance;
CECHostPlayer pHost = CECGameRun.Instance.GetHostPlayer();
if (string.Equals(pDlg.GetName(), "Game_Quit", StringComparison.OrdinalIgnoreCase))
{
}
else if ((string.Equals(pDlg.GetName(), "Game_TeachSkill", StringComparison.OrdinalIgnoreCase) && DialogBoxCommandIDs.IDOK == iRetVal) ||
(string.Equals(pDlg.GetName(), "Game_LearnSkill", StringComparison.OrdinalIgnoreCase) && DialogBoxCommandIDs.IDOK == iRetVal))
{
if (string.Equals(pDlg.GetName(), "Game_TeachSkill", StringComparison.OrdinalIgnoreCase))
{
}
else if (string.Equals(pDlg.GetName(), "Game_LearnSkill", StringComparison.OrdinalIgnoreCase))
{
int skillID = (int)pDlg.GetData();
int nCondition = pHost.CheckSkillLearnCondition(skillID, true);
if (0 == nCondition)
{
UnityGameSession.c2s_SendCmdNPCSevLearnSkill(skillID);
}
/*else if (1 == nCondition)
AddChatMessage(GetStringFromTable(270), GP_CHAT_MISC);
else if (6 == nCondition)
AddChatMessage(GetStringFromTable(527), GP_CHAT_MISC);
else if (7 == nCondition)
AddChatMessage(GetStringFromTable(541), GP_CHAT_MISC);
else if (8 == nCondition)
AddChatMessage(GetStringFromTable(271), GP_CHAT_MISC);
else if (9 == nCondition)
AddChatMessage(GetStringFromTable(556), GP_CHAT_MISC);
else if (10 == nCondition)
AddChatMessage(GetStringFromTable(557), GP_CHAT_MISC);
else if (12 == nCondition)
AddChatMessage(GetStringFromTable(11168), GP_CHAT_MISC);*/
}
}
}
private bool OnNewMessageBox(int iRetVal)
{
return true;
}
private System.Type FindTypeByName(string componentName)
{
@@ -270,4 +349,14 @@ public class CECUIManager : MonoSingleton<CECUIManager>
}
}
}
public struct MessageBoxEvent
{
public int iRetVal;
public AUIDialog pDlg;
public MessageBoxEvent(int retVal, AUIDialog dlg)
{
iRetVal = retVal;
pDlg = dlg;
}
}
}
+19
View File
@@ -0,0 +1,19 @@
/*
* Dialog Box Command IDs
* Converted from Windows API definitions
*/
public static class DialogBoxCommandIDs
{
public const int IDOK = 1;
public const int IDCANCEL = 2;
public const int IDABORT = 3;
public const int IDRETRY = 4;
public const int IDIGNORE = 5;
public const int IDYES = 6;
public const int IDNO = 7;
public const int IDCLOSE = 8;
public const int IDHELP = 9;
public const int IDTRYAGAIN = 10;
public const int IDCONTINUE = 11;
public const int IDTIMEOUT = 32000;
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d1c0dbd48a553e9498f6b0d391ec9707
+8
View File
@@ -120,5 +120,13 @@ namespace BrewMonster
offset += size;
}
}
// Learn skill command / 学习技能命令
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct cmd_learn_skill
{
public int skill_id; // Skill ID / 技能ID
public int skill_level; // Skill level / 技能等级
}
}
File diff suppressed because one or more lines are too long
+438
View File
@@ -0,0 +1,438 @@
# C++ to C# Unity String Format Conversion Guide
## Overview
This guide explains how to convert the C++ string formatting pattern used in Perfect World Online to C# Unity.
---
## The Original C++ Code
From `DlgSkillSubListItem.cpp`, line 290:
```cpp
int needMoney = CECHostSkillModel::Instance().GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel::Instance().GetSkillSp(m_skillID, m_curLevel + 1);
ACString str;
str.Format(GetStringFromTable(11326), needMoney, needSp);
GetGameUIMan()->MessageBox("Game_LearnSkill", str, MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
pMsgBox->SetData(m_skillID);
```
### What This Code Does:
1. **Gets skill upgrade costs**: Retrieves the money and skill points needed for the next level
2. **Formats localized string**: Uses `GetStringFromTable(11326)` to get a template string, then formats it with the cost values
3. **Shows confirmation dialog**: Displays a message box with OK/Cancel buttons
4. **Attaches data**: Associates the skill ID with the dialog
---
## The C# Unity Conversion
From `CDlgSkillSubListItem.cs`:
```csharp
// Get the required money and skill points for the next level
int needMoney = CECHostSkillModel.Instance.GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
// Format the confirmation message string
// C++ equivalent: str.Format(GetStringFromTable(11326), needMoney, needSp);
string confirmMessage = string.Format(GetStringFromTable(11326), needMoney, needSp);
// Show confirmation dialog with OK/Cancel buttons
uiManager.ShowConfirmDialog(
"Game_LearnSkill",
confirmMessage,
onConfirm: () => {
// Player confirmed - learn the skill
CECHostSkillModel.Instance.LearnSkill(m_skillID);
},
onCancel: null,
skillData: m_skillID
);
```
---
## Key Conversion Patterns
### 1. String Formatting
**C++ (ACString)**:
```cpp
ACString str;
str.Format(GetStringFromTable(11326), needMoney, needSp);
```
**C# (string)**:
```csharp
string confirmMessage = string.Format(GetStringFromTable(11326), needMoney, needSp);
```
**Notes**:
- C++'s `ACString::Format()` is a member function
- C#'s `string.Format()` is a static function
- Both use the same placeholder syntax: `%d` (C++) or `{0}`, `{1}` (C#)
- If your string table uses C++ format specifiers, you may need to convert them:
- `%d``{0}`, `{1}` for integers
- `%s``{0}`, `{1}` for strings
- `%f``{0}`, `{1}` for floats
### 2. Message Box with Callbacks
**C++ (Pointer-based)**:
```cpp
PAUIDIALOG pMsgBox;
GetGameUIMan()->MessageBox("Game_LearnSkill", str, MB_OKCANCEL,
A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
pMsgBox->SetData(m_skillID);
// Later, in message handler:
void OnMessageBox_OK(const char* szName) {
if (strcmp(szName, "Game_LearnSkill") == 0) {
PAUIDIALOG pMsgBox = GetGameUIMan()->GetDialog(szName);
int skillID = pMsgBox->GetData();
// Learn skill...
}
}
```
**C# (Callback-based)**:
```csharp
uiManager.ShowConfirmDialog(
"Game_LearnSkill",
confirmMessage,
onConfirm: () => {
// This code runs when player clicks OK
CECHostSkillModel.Instance.LearnSkill(m_skillID);
},
onCancel: () => {
// This code runs when player clicks Cancel (optional)
},
skillData: m_skillID
);
```
**Key Differences**:
- C++ uses pointers and manual dialog lookup
- C# uses lambda callbacks (closures) that capture variables
- C# is more straightforward - no need to check dialog names or retrieve data manually
### 3. Localized String Table
**Both versions use the same approach**:
```csharp
// Get localized string template from string table
// String ID 11326 might contain: "学习此技能需要 {0} 金钱和 {1} 技能点,确定学习吗?"
// English: "Learning this skill requires {0} money and {1} skill points, confirm?"
string template = GetStringFromTable(11326);
// Format with actual values
string message = string.Format(template, needMoney, needSp);
// Result: "Learning this skill requires 2480 money and 34200 skill points, confirm?"
```
---
## Complete Example Comparison
### C++ Version (Original)
```cpp
void CDlgSkillSubListItem::OnCommand_Upgrade(const char* szCommand) {
CECHostPlayer* player = GetHostPlayer();
PAUIDIALOG pMsgBox;
// Check player state...
if (player->IsDead() || player->IsSitting() || /* ... */) {
GetGameUIMan()->MessageBox("", GetGameUIMan()->GetStringFromTable(11327),
MB_OK, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
return;
}
// Check learning conditions...
int nCondition = CECHostSkillModel::Instance().CheckLearnCondition(m_skillID);
int nCheckCode = 0;
if (1 == nCondition) {
nCheckCode = 270;
} else if (6 == nCondition) {
nCheckCode = 527;
}
// ... more conditions ...
if (nCheckCode == 0) {
// Show confirmation dialog
int needMoney = CECHostSkillModel::Instance().GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel::Instance().GetSkillSp(m_skillID, m_curLevel + 1);
ACString str;
str.Format(GetStringFromTable(11326), needMoney, needSp);
GetGameUIMan()->MessageBox("Game_LearnSkill", str, MB_OKCANCEL,
A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
pMsgBox->SetData(m_skillID);
if (!GetGameUIMan()->m_pDlgSkillAction->IsReceivedNPCGreeting()) {
CECHostSkillModel::Instance().SendHelloToSkillLearnNPC();
}
} else {
// Show error message
GetGameUIMan()->MessageBox("", GetGameUIMan()->GetStringFromTable(nCheckCode),
MB_OK, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
pMsgBox->SetLife(3);
}
}
// Separate message handler
void CDlgSkillSubListItem::OnMessageBox_OK(const char* szName) {
if (strcmp(szName, "Game_LearnSkill") == 0) {
PAUIDIALOG pMsgBox = GetGameUIMan()->GetDialog(szName);
int skillID = pMsgBox->GetData();
// Send learn skill command to server
CECHostSkillModel::Instance().LearnSkill(skillID);
}
}
```
### C# Unity Version (Converted)
```csharp
private void OnCommand_Upgrade()
{
CECHostPlayer player = GetHostPlayer();
if (player == null)
{
return;
}
var uiManager = CECUIManager.Instance;
var gameUIMan = uiManager.GetInGameUIMan();
// Check player state...
if (player.IsDead() ||
player.IsSitting() ||
player.IsChangingFace() ||
player.IsTrading() ||
player.GetBoothState() != 0 ||
player.IsRooting() ||
player.IsHangerOn() ||
player.GetCurSkill() != null ||
player.IsFighting())
{
uiManager.ShowMessageBox("MessageBox", gameUIMan.GetStringFromTable(11327));
return;
}
// Check learning conditions...
int nCondition = CECHostSkillModel.Instance.CheckLearnCondition(m_skillID);
int nCheckCode = 0;
if (1 == nCondition)
{
nCheckCode = 270;
}
else if (6 == nCondition)
{
nCheckCode = 527;
}
// ... more conditions ...
if (nCheckCode == 0)
{
// Get the required costs
int needMoney = CECHostSkillModel.Instance.GetSkillMoney(m_skillID, m_curLevel + 1);
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
// Format the confirmation message
string confirmMessage = string.Format(GetStringFromTable(11326), needMoney, needSp);
// Show confirmation dialog with inline callback
uiManager.ShowConfirmDialog(
"Game_LearnSkill",
confirmMessage,
onConfirm: () => {
// This runs when player clicks OK
// No need to look up dialog or retrieve data - it's captured in closure
CECHostSkillModel.Instance.LearnSkill(m_skillID);
},
onCancel: null,
skillData: m_skillID
);
// 如果打开对话框时NPC发送的Hello消息没有收到回复,再次发送
// If the NPC Hello message hasn't been received when opening dialog, send again
if (!gameUIMan.IsReceivedNPCGreeting())
{
CECHostSkillModel.Instance.SendHelloToSkillLearnNPC();
}
}
else
{
// Show error message with auto-close after 3 seconds
uiManager.ShowMessageBox("", gameUIMan.GetStringFromTable(nCheckCode), autoCloseTime: 3f);
}
}
```
---
## String Format Examples
### Example 1: Simple Integer Formatting
**C++ String Table Entry (ID 11326)**:
```
"学习此技能需要 %d 金钱和 %d 技能点,确定学习吗?"
```
**C# String Table Entry (ID 11326)** (if you convert to C# format):
```
"学习此技能需要 {0} 金钱和 {1} 技能点,确定学习吗?"
```
**Usage**:
```csharp
string message = string.Format(GetStringFromTable(11326), 2480, 34200);
// Result: "学习此技能需要 2480 金钱和 34200 技能点,确定学习吗?"
// English: "Learning this skill requires 2480 money and 34200 skill points, confirm?"
```
### Example 2: Mixed Types
**String Table**:
```
"Skill: {0}, Level: {1}, Cost: {2:N0} gold"
```
**Usage**:
```csharp
string skillName = "Fireball";
int level = 5;
int cost = 10000;
string message = string.Format(GetStringFromTable(123), skillName, level, cost);
// Result: "Skill: Fireball, Level: 5, Cost: 10,000 gold"
```
### Example 3: With Colors (Unity TextMeshPro)
**C++**:
```cpp
ACString strSp;
strSp.Format(GetStringFromTable(11402), needSp);
if (spOK) {
strSp = l_colorWhite + strSp; // l_colorWhite = "^ffffff"
} else {
strSp = l_colorRed + strSp; // l_colorRed = "^ff0000"
}
```
**C# (Unity TextMeshPro)**:
```csharp
const string l_colorWhite = "<color=#ffffff>";
const string l_colorRed = "<color=#ff0000>";
const string l_colorClose = "</color>";
string strSp = string.Format(GetStringFromTable(11402), needSp);
if (spOK) {
strSp = l_colorWhite + strSp + l_colorClose;
} else {
strSp = l_colorRed + strSp + l_colorClose;
}
```
---
## Common Pitfalls
### ❌ Wrong: Using C++ format specifiers in C#
```csharp
// This won't work if the string uses C++ format specifiers
string template = "Cost: %d gold"; // C++ style
string message = string.Format(template, 1000); // Error!
```
### ✅ Correct: Convert to C# format
```csharp
string template = "Cost: {0} gold"; // C# style
string message = string.Format(template, 1000); // "Cost: 1000 gold"
```
### ❌ Wrong: Forgetting to capture variables in lambda
```csharp
void ShowDialog(int skillID) {
int needMoney = GetMoney(skillID);
// Wrong: using skillID parameter instead of captured value
ShowConfirmDialog("Learn", "Confirm?",
onConfirm: () => {
LearnSkill(skillID); // This captures the parameter, which is fine
}
);
}
```
This is actually correct, but be careful with loop variables:
```csharp
// Dangerous in loops!
for (int i = 0; i < skills.Length; i++) {
int skillID = skills[i];
ShowButton(skillID, () => {
LearnSkill(skillID); // Captures skillID, which changes each iteration
});
}
```
### ✅ Correct: Capture loop variable properly
```csharp
for (int i = 0; i < skills.Length; i++) {
int currentSkillID = skills[i]; // Create a copy for this iteration
ShowButton(currentSkillID, () => {
LearnSkill(currentSkillID); // Captures the copy, safe!
});
}
```
---
## Implementation Checklist
When converting C++ string formatting to C# Unity:
- [ ] Replace `ACString` with `string`
- [ ] Replace `str.Format(...)` with `string.Format(...)`
- [ ] Convert format specifiers if needed (`%d``{0}`)
- [ ] Replace pointer-based message boxes with callback-based dialogs
- [ ] Use lambda expressions to capture context
- [ ] Update color codes for Unity (TextMeshPro uses `<color=#RRGGBB>`)
- [ ] Replace `pMsgBox->SetLife(seconds)` with `autoCloseTime` parameter
- [ ] Remove manual dialog lookup code
- [ ] Keep Chinese comments and add English translations side by side
---
## Summary
The key difference between C++ and C# Unity for string formatting:
| Aspect | C++ | C# Unity |
|--------|-----|----------|
| **String type** | `ACString` | `string` |
| **Format method** | `str.Format(template, args)` | `string.Format(template, args)` |
| **Format specifiers** | `%d`, `%s`, `%f` | `{0}`, `{1}`, `{2}` |
| **Message box** | Pointer + callback lookup | Lambda callbacks |
| **Data passing** | `pMsgBox->SetData(data)` | Closure captures |
| **Colors** | `^ffffff` | `<color=#ffffff>...</color>` |
| **Auto-close** | `pMsgBox->SetLife(seconds)` | `autoCloseTime: seconds` |
The C# version is generally more concise and type-safe thanks to lambda expressions and closure capture!
+29
View File
@@ -0,0 +1,29 @@
# Skill Learn Flow (C++)
1. **CDlgSkillSubListItem::OnCommand_Upgrade**
- Triggered when the player clicks the learn/upgrade button on a skill.
- Performs status checks (dead, trading, etc.), evaluates `CheckLearnCondition`, and shows the `Game_LearnSkill` confirmation dialog.
- If the NPC greeting has not been received yet, calls `CECHostSkillModel::SendHelloToSkillLearnNPC()`.
2. **CECHostSkillModel**
- Maintains `m_skillLearnNPCNID`, the NPC ID that currently offers skill learning.
- `ProcessServiceList()` scans `cmd_scene_service_npc_list` from the server, keeps the valid NPC, and resets `m_bReceivedNPCGreeting` when a new NPC is selected.
- `SendHelloToSkillLearnNPC()` issues `c2s_CmdNPCSevHello(m_skillLearnNPCNID)` to start the NPC service handshake.
- `OnNpcGreeting()` is invoked when `NPC_GREETING` (cmd 70) arrives; it marks the greeting as received so future learns skip re-hello.
3. **CDlgSkillAction::TryOpenDialog**
- Called when the skill dialog is being opened (skill vs action mode).
- If the host isnt currently “talking with the NPC,” it forces the dialog to open, sends `SendHelloToSkillLearnNPC()`, and clears the “received greeting” flag so the next dialog confirms again.
4. **Game UI dialog**
- Player confirms the `Game_LearnSkill` message box (`EC_GameUIMan::OnMessageBoxClose`).
- If `IDOK` and `CheckSkillLearnCondition` still returns zero, it sends `c2s_CmdNPCSevLearnSkill(skillID)`.
- The dialog name `"Game_LearnSkill"` ensures the server hasnt rejected the skill because it missed the handshake.
5. **Server round-trip**
- `SEVNPC_HELLO` establishes the NPC service context.
- Server replies with `NPC_GREETING`, parsed by `GameSession` and forwarded to `CECHostSkillModel::OnNpcGreeting`.
- Only after the greeting can `SEVNPC_SERVE` with `GP_NPCSEV_LEARN` be trusted; else, the server often drops it without a `LEARN_SKILL` response.
Use this sequence when troubleshooting missing `LEARN_SKILL` responses: show/confirm dialog → send `SEVNPC_HELLO` → wait for `NPC_GREETING` → send `GP_NPCSEV_LEARN`.