diff --git a/Assets/ModelRenderer/Art/Animations/models/npcs/怪物/2014/剑背狼/tcks_剑背狼/快速移动.anim b/Assets/ModelRenderer/Art/Animations/models/npcs/怪物/2014/剑背狼/tcks_剑背狼/快速移动.anim index 3b19ee7488..a904e74995 100644 --- a/Assets/ModelRenderer/Art/Animations/models/npcs/怪物/2014/剑背狼/tcks_剑背狼/快速移动.anim +++ b/Assets/ModelRenderer/Art/Animations/models/npcs/怪物/2014/剑背狼/tcks_剑背狼/快速移动.anim @@ -10310,7 +10310,907 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2904062089 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2697794434 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 473984651 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 623370192 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2562056908 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2941519199 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2904062089 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2671905850 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2320144522 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2697794434 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3205428742 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 181291755 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 154580831 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1777750735 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429640245 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2817243914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1777417914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 519441964 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4002323032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2613341690 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 473984651 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4218330170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 973752780 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2596236104 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2425874665 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885029503 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2123991493 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 623370192 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3802533241 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 681675820 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 888812595 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2278634959 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2562056908 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4181503832 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2561672102 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2317553494 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2270638035 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4031782725 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1767460607 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2941519199 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 970861809 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3764974733 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2271171554 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3784749727 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2526118409 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 261673907 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2391830708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2089267986 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1177066612 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2872170345 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4131753032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 582302429 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2127582788 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2671905850 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2320144522 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3205428742 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 181291755 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 154580831 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1777750735 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429640245 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3505163164 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2817243914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1777417914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 519441964 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4002323032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2613341690 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4218330170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 973752780 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2596236104 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2425874665 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885029503 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2123991493 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3802533241 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 681675820 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 888812595 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2278634959 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4040557913 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1776243939 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4181503832 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2561672102 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2317553494 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2270638035 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4031782725 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1767460607 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 970861809 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3764974733 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2271171554 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3784749727 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2526118409 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 261673907 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2391830708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2089267986 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1177066612 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2872170345 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4131753032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 582302429 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2127582788 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3505163164 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4040557913 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1776243939 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -10322,7 +11222,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs b/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs index d8e7ee6313..6c68d43354 100644 --- a/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs +++ b/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs @@ -1,4 +1,5 @@ -using UnityEngine; +using System.Runtime.InteropServices; +using UnityEngine; public static class GameConstants { @@ -46,6 +47,8 @@ public struct ROLEBASICPROP iVigour = 0; } }; + +[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct ROLEEXTPROP { public ROLEEXTPROP_BASE bs; @@ -63,6 +66,8 @@ public struct ROLEEXTPROP max_ap = 0; } }; + +[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct ROLEEXTPROP_BASE { /* »ù´¡ÊôÐÔ */ @@ -100,6 +105,8 @@ public struct ROLEEXTPROP_BASE this.mp_gen = mp_gen; } }; + +[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct ROLEEXTPROP_MOVE { /* Ô˶¯ËÙ¶È*/ @@ -125,6 +132,8 @@ public struct ROLEEXTPROP_MOVE this.flight_speed = flight_speed; } }; + +[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct ROLEEXTPROP_ATK { // 物理攻击属性 / Attack properties @@ -135,6 +144,7 @@ public struct ROLEEXTPROP_ATK public float AttackRange; // 攻击范围 // 附加魔法伤害倍数(或附加魔法伤害范围)数组 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public AddonDamageEntry[] AddonDamage; // 魔法攻击伤害 @@ -172,10 +182,12 @@ public struct ROLEEXTPROP_ATK } } +[StructLayout(LayoutKind.Sequential, Pack = 1)] // Role (Player and NPC) extended properties, defense part public struct ROLEEXTPROP_DEF { /* ·ÀÓùÊôÐÔ */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public int[] resistance; // ħ·¨¿¹ÐÔ public int defense; // ·ÀÓùÁ¦ public int armor; // ÉÁ¶ãÂÊ£¨×°¼×µÈ¼¶£© diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HPWork.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HPWork.cs index 762a4eea2f..223e75e744 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HPWork.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HPWork.cs @@ -1,5 +1,6 @@ using BrewMonster.Network; using System.Collections.Generic; +using UnityEngine; namespace BrewMonster.Scripts { @@ -434,11 +435,25 @@ namespace BrewMonster.Scripts public void CancelWork(CECHPWork pWork) { - + if (pWork == null) + { + //ASSERT(false); + return; + } + pWork.Cancel(); } public void CancelWorkAtPriority(int iPriority) { - + if (!ValidatePriority(iPriority)) + { + return; + } + WorkList workList = m_WorkStack[iPriority]; + for (int i = 0; i < workList.Count; ++i) + { + CancelWork(workList[i]); + //LOG_DEBUG_INFO(AString().Format("CECHPWork::%s priority=%d cancelled", workList[i]->GetWorkName(), iPriority)); + } } public bool DelayWork(int iPriority, CECHPWork pWork) @@ -832,7 +847,7 @@ namespace BrewMonster.Scripts int m_iPriority; bool m_bNoDelay; bool m_bShouldTick; - uint m_dwTickTime; + float m_dwTickTime; // Constructor public CECHPWorkPostTickRunWorkCommand( @@ -840,7 +855,7 @@ namespace BrewMonster.Scripts bool bNoDelay = false, int iPriority = CECHPWorkMan.Work_priority.PRIORITY_1, bool bShouldTick = false, - uint dwTickTime = 0) + float dwTickTime = 0) { m_pWork = pWork; m_bNoDelay = bNoDelay; diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs index 33be812169..edb9193385 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMove.cs @@ -1,5 +1,5 @@ -using BrewMonster.Network; using CSNetwork.GPDataType; +using System; using UnityEngine; using Types = BrewMonster.Scripts.CECHPWorkMove.DestTypes; @@ -613,8 +613,7 @@ namespace BrewMonster.Scripts } else { - vCurPos = m_pHost.m_MoveCtrl.GroundMove(GPDataTypeHelper.g_vOrigin, 0.0f, fDeltaTime, m_pHost.m_fVertSpeed); - Debug.LogError("vCurPos = " + vCurPos + " m_pHost.m_fVertSpeed = " + m_pHost.m_fVertSpeed); + vCurPos = m_pHost.m_MoveCtrl.GroundMove(GPDataTypeHelper.g_vOrigin, 0.0f, fDeltaTime, m_pHost.m_fVertSpeed); m_pHost.SetPos(EC_Utility.ToVector3(vCurPos)); if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3) @@ -752,6 +751,120 @@ namespace BrewMonster.Scripts // Tick routine of flying or swimming protected bool Tick_FlySwim(float fDeltaTime) { + A3DVECTOR3 vCurPos = m_pHost.GetPos(); + int iMoveMode = (m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_AIR) ? (int)GPMoveMode.GP_MOVE_AIR : (int)GPMoveMode.GP_MOVE_WATER; + + float na, fMaxSpeed; + bool bInAir; + if (m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_AIR) + { + bInAir = true; + na = CECHostMove.EC_NACCE_AIR; + fMaxSpeed = m_pHost.GetFlySpeed(); + } + else + { + bInAir = false; + na = CECHostMove.EC_NACCE_WATER; + fMaxSpeed = m_pHost.GetSwimSpeedSev(); + } + + if (m_bReadyCancel || m_bMeetSlide) + { + m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fMaxSpeed, iMoveMode | (int)GPMoveMode.GP_MOVE_RUN); + Finish(); + return true; + } + + // for auto move + if (m_bUseAutoMoveDialog && m_fAutoHeight > 0.0f && m_iDestType != DestTypes.DEST_PUSH) + { + if (m_pHost.m_dwMoveRelDir == 0) + { + if ((int)(vCurPos.y / 10.0f) == (int)m_fAutoHeight) + { + if (!m_bReachedHeight) + { + m_pHost.m_vVelocity.y = 0.0f; + m_pHost.m_dwMoveRelDir &= ~((uint)(MOVE_DIR.MD_ABSUP | MOVE_DIR.MD_ABSDOWN)); + m_bReachedHeight = true; + } + } + else + { + if (!m_bReachedHeight) + { + if (vCurPos.y < m_fAutoHeight * 10.0f) + { + m_pHost.m_dwMoveRelDir &= ~((uint)(MOVE_DIR.MD_ABSDOWN)); + m_pHost.m_dwMoveRelDir |= ((uint)MOVE_DIR.MD_ABSUP); + } + else if (vCurPos.y > m_fAutoHeight * 10.0f) + { + m_pHost.m_dwMoveRelDir &= ~((uint)(MOVE_DIR.MD_ABSUP)); + m_pHost.m_dwMoveRelDir |= (uint)MOVE_DIR.MD_ABSDOWN; + } + } + else // Auto adjust height, so we should refresh move height + { + m_fAutoHeight = vCurPos.y / 10.0f; + } + } + } + else // Player manually set auto move height + { + m_bReachedHeight = true; + + m_fAutoHeight = vCurPos.y / 10.0f; + } + } + + if ((m_pHost.m_dwMoveRelDir & (uint)(MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT | MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK)) != 0) + m_iDestType = DestTypes.DEST_PUSH; + + ON_AIR_CDR_INFO cdr = m_pHost.m_AirCDRInfo; + + if (m_iDestType == DestTypes.DEST_DIR) + { + Vector3 vPushDir = Vector3.zero; + m_pHost.GetPushDir(ref vPushDir, (uint)MOVE_DIR.MD_ALL, 0); + vPushDir.x = vPushDir.z = 0.0f; + + float fSpeed1H = m_pHost.m_vVelocity.MagnitudeH(); + float fSpeed1V = m_pHost.m_vVelocity.y; + + A3DVECTOR3 vMoveDirH = m_vMoveDest; + float pa = CECHostMove.EC_PUSH_ACCE; + + float fSpeed2H = fSpeed1H + (pa + na) * fDeltaTime; + if (Math.Abs(pa - 0) < float.Epsilon && fSpeed2H < 0.0f) + fSpeed2H = 0.0f; // Only resistance couldn't generate negative speed + else if (fSpeed2H > fMaxSpeed) + fSpeed2H = fMaxSpeed; + + Glide(5.0f, vMoveDirH, fDeltaTime, bInAir); + + vMoveDirH = m_pHost.GetModelMoveDir(); + vMoveDirH.y = 0; + vMoveDirH.Normalize(); + + // Vertical speed + float fSpeed2V = CalcFlySwimVertSpeed(fSpeed1V, vPushDir.y, CECHostMove.EC_PUSH_ACCE, fDeltaTime); + A3DVECTOR3 vVel2 = vMoveDirH * fSpeed2H + GPDataTypeHelper.g_vAxisY * fSpeed2V; + + // Air/water move + vCurPos = m_pHost.m_MoveCtrl.AirWaterMove(vVel2, fDeltaTime, bInAir); + m_pHost.SetPos(EC_Utility.ToVector3(vCurPos)); + m_pHost.m_vVelocity = vVel2; + + if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3) + { + Finish(); + m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fMaxSpeed, iMoveMode | (int)GPMoveMode.GP_MOVE_RUN); + } + else + m_pHost.m_MoveCtrl.SendMoveCmd(vCurPos, 0, m_vMoveDest, vVel2, iMoveMode | (int)GPMoveMode.GP_MOVE_RUN); + } return true; } // Start gliding diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkStand.cs b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkStand.cs index f9cfba3065..f40ea19a6c 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkStand.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_HPWorkStand.cs @@ -134,7 +134,7 @@ namespace BrewMonster.Scripts { pWork.SetDestination(CECHPWorkMove.DestTypes.DEST_STANDJUMP, GPDataTypeHelper.g_vOrigin); m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand( - pWork, false, CECHPWorkMan.Work_priority.PRIORITY_1, true, (uint)dwDeltaTime)); + pWork, false, CECHPWorkMan.Work_priority.PRIORITY_1, true, dwDeltaTime)); } } else if (iMoveReason == 2) @@ -150,10 +150,8 @@ namespace BrewMonster.Scripts { // ASSERT(0); } - return true; } - // Play appropriate actions if (m_iPoseAction == (int)PLAYER_ACTION_TYPE.ACT_STAND) { @@ -174,7 +172,7 @@ namespace BrewMonster.Scripts if (m_iPoseAction == (int)PLAYER_ACTION_TYPE.ACT_STAND) { // Chariot war special case omitted for now - m_pHost.PlayAction(m_iCurAction, false, 0); + m_pHost.PlayAction(m_iCurAction, false, 300); //m_oldAction = m_iCurAction; } diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs index 05e0a34075..bc28db5ad5 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs @@ -1,6 +1,7 @@ using BrewMonster; using BrewMonster.Managers; using BrewMonster.Network; +using BrewMonster.Scripts; using CSNetwork; using CSNetwork.GPDataType; using CSNetwork.Protocols; @@ -8,6 +9,7 @@ using CSNetwork.Protocols.RPCData; using System; using System.Collections; using System.Collections.Generic; +using System.Reflection; using System.Runtime.InteropServices; using TMPro; using UnityEngine; @@ -74,6 +76,9 @@ namespace PerfectWorld.Scripts.Managers case EC_MsgDef.MSG_PM_PICKUPMATTER: OnMsgPlayerPickupMatter(Msg); break; + case EC_MsgDef.MSG_PM_PLAYEREXTPROP: + OnMsgPlayerExtProp(Msg); + break; } } else @@ -188,15 +193,15 @@ namespace PerfectWorld.Scripts.Managers // TODO: Implement get faction /*/ // Get faction info - if (pPlayer->GetFactionID() && !g_pGame->GetFactionMan()->GetFaction(pPlayer->GetFactionID())) + if (pPlayer.GetFactionID() && !g_pGame.GetFactionMan().GetFaction(pPlayer.GetFactionID())) { int i(0); for (i = 0; i < a4.GetSize(); i++) - if (a4[i] == pPlayer->GetFactionID()) + if (a4[i] == pPlayer.GetFactionID()) break; if (i == a4.GetSize()) - a4.Add(pPlayer->GetFactionID()); + a4.Add(pPlayer.GetFactionID()); } //*/ } @@ -663,6 +668,72 @@ namespace PerfectWorld.Scripts.Managers { return CECGameRun.Instance.GetHostPlayer(); } + + public bool OnMsgPlayerExtProp(ECMSG Msg) + { + object pData; + int idPlayer, iIndex; + + switch (Msg.dwParam2) + { + case CommandID.PLAYER_EXT_PROP_BASE: + { + cmd_pep_base pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); + idPlayer = pCmd.idPlayer; + pData = pCmd.ep_base; + iIndex = (int)ExtendPropertyClass.EXTPROPIDX_BASE; + break; + } + case CommandID.PLAYER_EXT_PROP_MOVE: + { + cmd_pep_move pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); + idPlayer = pCmd.idPlayer; + pData = pCmd.ep_move; + iIndex = (int)ExtendPropertyClass.EXTPROPIDX_MOVE; + break; + } + case CommandID.PLAYER_EXT_PROP_ATK: + { + cmd_pep_attack pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); + idPlayer = pCmd.idPlayer; + pData = pCmd.ep_attack; + iIndex = (int)ExtendPropertyClass.EXTPROPIDX_ATTACK; + break; + } + + case CommandID.PLAYER_EXT_PROP_DEF: + { + cmd_pep_def pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); + idPlayer = pCmd.idPlayer; + pData = pCmd.ep_def; + iIndex = (int)ExtendPropertyClass.EXTPROPIDX_DEF; + break; + } + default: + return false; + } + + if (!GPDataTypeHelper.ISPLAYERID(idPlayer)) + { + //ASSERT(ISPLAYERID(idPlayer)); + return false; + } + + //CECGameSession* pSession = g_pGame.GetGameSession(); + + if (idPlayer == m_pHostPlayer.GetCharacterID()) + { + GetHostPlayer().SetPartExtendProps(iIndex, pData); + } + else + { + EC_ElsePlayer pPlayer = SeekOutElsePlayer(idPlayer); + if (pPlayer) + pPlayer.SetPartExtendProps(iIndex, pData); + } + + return true; + } } } public struct EC_PLAYERLOADRESULT diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_Object.cs b/Assets/PerfectWorld/Scripts/Managers/EC_Object.cs index 3f973d9cdd..9b0eb81ac2 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_Object.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_Object.cs @@ -17,6 +17,7 @@ public class CECObject : MonoBehaviour protected static int ALPHA_HASH = Shader.PropertyToID("_Alpha"); protected Quaternion targetRotation; + protected Quaternion startRotation; // Store starting rotation for Slerp protected Vector3 g_vAxisY = Vector3.up; // Class ID public static class Class_ID @@ -115,6 +116,7 @@ public class CECObject : MonoBehaviour m_bAdjustOrient = true; m_dwOrientTime = dwTime; m_dwOrientTimeCnt = 0; + startRotation = transform.rotation; // Store current rotation as start targetRotation = Quaternion.LookRotation(vDir, Vector3.up); } @@ -182,13 +184,6 @@ public class CECObject : MonoBehaviour { vDir.Normalize(); } - - // Xoay mượt từ rotation hiện tại sang rotation mục tiêu - /* transform.rotation = Quaternion.Slerp( - transform.rotation, - targetRotation, - Time.deltaTime * 5.0f - );*/ SetDestDirAndUp(vDir, g_vAxisY, timeturn); } protected virtual void Update() @@ -287,25 +282,18 @@ public class CECObject : MonoBehaviour protected void AdjustOrientation(float dwDeltaTime) { m_dwOrientTimeCnt += dwDeltaTime; - - A3DMATRIX4 mat; - // Adjust model's orientation if (m_dwOrientTimeCnt >= m_dwOrientTime) { - SetDirAndUp(Vector3.forward,Vector3.up ); + // Set final rotation to target (not Vector3.forward) + transform.rotation = targetRotation; m_bAdjustOrient = false; } else { - float f = (float)m_dwOrientTimeCnt / m_dwOrientTime; - transform.rotation = Quaternion.Slerp( - transform.rotation, - targetRotation, - f - ); - SetDirAndUp(Vector3.forward, Vector3.up); - // Note: SetDirAndUp will change m_bAdjustOrient flag + // Interpolate from START to TARGET rotation based on time progress + float f = m_dwOrientTimeCnt / m_dwOrientTime; + transform.rotation = Quaternion.Slerp(startRotation, targetRotation, f); m_bAdjustOrient = true; } } diff --git a/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs b/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs index ecef044e0d..711434d65f 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECHostMove.cs @@ -1,15 +1,7 @@ using BrewMonster.Network; using BrewMonster.Scripts; -using CSNetwork; -using CSNetwork.C2SCommand; using CSNetwork.GPDataType; -using CSNetwork.Protocols; using System; -using System.Collections.Generic; -using System.Runtime.ConstrainedExecution; -using System.Security.Cryptography; -using System.Text; -using BrewMonster; using UnityEngine; using BrewMonster.Scripts.World; @@ -36,6 +28,22 @@ namespace BrewMonster A3DVECTOR3 m_vBlockMove; bool m_bLocalMove; // true, Moving info isn't sent to server public A3DVECTOR3 m_vFlashTPNormal; + // Negative accelerate in water and air + public const float EC_NACCE_AIR = -5.0f; + public const float EC_NACCE_WATER = -5.0f; + // Push accelerate + public const float EC_PUSH_ACCE = 8.0f; // Normal push accelerate in air and water + public const float EC_FLYOFF_ACCE = 10.0f; // Fly off accelerate + + public const float EC_SLOPE_Y = 0.5f; + public const float EC_GRAVITY = 9.8f; + + // Move length minimum threshold + public const float MIN_MOVELEN_IN_AIR_WATER = 0.5f; + public const float MIN_MOVELEN_ON_GROUND = 0.5f; + public const float MIN_MOVELEN_FOR_DETECT_VIBRATION = 0.05f; + + public CECHostMove(CECHostPlayer pHost) { m_wMoveStamp = 0; @@ -115,7 +123,7 @@ namespace BrewMonster public void SendStopMoveCmd(in Vector3 vPos, float fSpeed, int iMoveMode) { - Debug.LogWarning("HoangDev : SendStopMoveCmd"); + UnityEngine.Debug.LogWarning("HoangDev : SendStopMoveCmd"); iMoveMode |= (int)GPMoveMode.GP_MOVE_DEAD; if (cmdstopdelayCounter >= 500) @@ -220,7 +228,7 @@ namespace BrewMonster if (fTime < 0.05f || fSpeed > 50.0f) { // tương đương ASSERT(0) trong C++, ở đây có thể Debug.LogWarning - Debug.LogWarning("CalcAverageSpeed: invalid input, fallback to default speed."); + UnityEngine.Debug.LogWarning("CalcAverageSpeed: invalid input, fallback to default speed."); return fDefSpeed; } @@ -309,7 +317,7 @@ namespace BrewMonster cdr.fYVel += fSpeedV; EC_CDR.OnGroundMove(ref cdr); - + m_pHost.m_CDRInfo = cdr; //if (g_pGame.GetGameRun().GetWorld().GetAssureMove()) // g_pGame.GetGameRun().GetWorld().GetAssureMove().AssureMove(m_pHost.m_aabbServer.Center, cdr.vCenter); @@ -323,7 +331,9 @@ namespace BrewMonster m_iBlockedCnt = 0; m_fBlockMove += (vNewPos - m_pHost.GetPos()).Magnitude(); m_vBlockMove += vNewPos - m_pHost.GetPos(); - if ((m_fBlockTime += fTime) >= 1.0f) + m_fBlockTime += fTime; + //TO DO: in c++ set 1.0f. Convert to c#, this logic is wrong. If set time is 2.0, game run correct + if ((m_fBlockTime) >= 2.0f) { if (m_fBlockMove < GPDataTypeHelper.MIN_MOVELEN_ON_GROUND || m_vBlockMove.Magnitude() < GPDataTypeHelper.MIN_MOVELEN_FOR_DETECT_VIBRATION) { @@ -410,6 +420,79 @@ namespace BrewMonster return vCurPos; } } + // Get host's last position sent to server + public Vector3 GetLastSevPos() { return m_vLastSevPos; } + public bool GetSlideLock() { return m_bSlideLock; } + + // Air/Water move + public A3DVECTOR3 AirWaterMove(A3DVECTOR3 vSpeed, float fTime, bool bInAir, bool bTrace = false) + { + + A3DVECTOR3 vDir = vSpeed; + float fSpeed = vDir.Normalize(); + return AirWaterMove(vDir, fSpeed, fTime, bInAir, bTrace); + } + + // Air/Water move + A3DVECTOR3 AirWaterMove(A3DVECTOR3 vDir, float fSpeed, float fTime, bool bInAir, bool bTrace/* false */) + { + + A3DVECTOR3 vRealDir = vDir; + + // OnAirMove only accept positive speed value + if (fSpeed< 0.0f) + { + vRealDir = -vDir; + fSpeed = -fSpeed; + } + + float fMaxSpeed = bInAir ? m_pHost.GetFlySpeed() : m_pHost.GetSwimSpeedSev(); + if (fSpeed > fMaxSpeed) + fSpeed = fMaxSpeed; + + ON_AIR_CDR_INFO cdr = m_pHost.m_AirCDRInfo; + + cdr.vCenter = m_pHost.m_aabbServer.Center; + cdr.vVelDir = vRealDir; + cdr.fSpeed = fSpeed; + cdr.fHeightThresh = bInAir? m_pHost.m_MoveConst.fMinAirHei : m_pHost.m_MoveConst.fMinWaterHei; + cdr.t = fTime; + cdr.bOnAir = bInAir; + + // If player is tracing something, let he fly/swim low enough + // if (bTrace) + // cdr.fHeightThresh = 0.2f; + + EC_CDR.OnAirMove(ref cdr); + + // TO DO: fix later + //if(EC_Game.GetGameRun().GetWorld().GetAssureMove() ) + // EC_Game.GetGameRun().GetWorld().GetAssureMove().NoAssureMove(); + + m_pHost.SetGroundNormal(GPDataTypeHelper.g_vAxisY); + + A3DVECTOR3 vNewPos = cdr.vCenter - GPDataTypeHelper.g_vAxisY * m_pHost.m_aabbServer.Extents.y; + + m_iBlockedCnt = 0; + m_fBlockMove += (vNewPos - m_pHost.GetPos()).Magnitude(); + m_vBlockMove += vNewPos - m_pHost.GetPos(); + if ((m_fBlockTime += fTime) >= 1.0f) + { + if (m_fBlockMove("GameRunConfig"); // _playerPrefab = _gameRunConfig.PlayerPrefab; diff --git a/Assets/Scripts/CECHostPlayer.cs b/Assets/Scripts/CECHostPlayer.cs index fb12565c14..216c814151 100644 --- a/Assets/Scripts/CECHostPlayer.cs +++ b/Assets/Scripts/CECHostPlayer.cs @@ -91,6 +91,9 @@ namespace BrewMonster private A3DVECTOR3 g_vOrigin = new A3DVECTOR3(0f); private Transform playerTransform; private float EC_SLOPE_Y = 0.5f; + int m_iOldWalkMode = Move_Mode.MOVE_STAND; // Copy of work mode + public uint m_dwMoveRelDir = 0; // Move relative direction flags + public ON_AIR_CDR_INFO m_AirCDRInfo; // Host config data version const int HOSTCFG_VERSION = 11; @@ -267,20 +270,23 @@ namespace BrewMonster } #endif + // Update cursor based on what's under mouse + EstimateCursor(); //Debug.Log($"(ulong)Time.deltaTime * 1000 {(ulong)(Time.deltaTime * 1000)}"); m_MoveCtrl.Tick((ulong)(Time.deltaTime * 1000)); // Nếu có thay đổi runtime, có thể lấy lại mỗi vài giây/Start nếu bạn thích: // ccRadius = controller.radius; ccSkin = controller.skinWidth; - + EstimateMoveEnv(GetPos()); OnKeyDown(); m_pWorkMan?.Tick(Time.deltaTime); - // Update cursor based on what's under mouse - EstimateCursor(); // Update GFXs UpdateGFXs(Time.deltaTime); + + //m_dwMoveRelDir = 0; + m_fVertSpeed = 0.0f; } public void StopMovement() @@ -430,6 +436,7 @@ namespace BrewMonster case int value when value == EC_MsgDef.MSG_PM_ENCHANTRESULT: OnMsgEnchantResult(Msg); break; + case int value when value == EC_MsgDef.MSG_HST_OWNEXTPROP: OnMsgHstExtProp(Msg); break; } @@ -2102,20 +2109,33 @@ namespace BrewMonster m_aabb.Center = GPDataTypeHelper.g_vOrigin; m_aabb.Extents.Set(0.3f, 0.9f, 0.3f); m_aabbServer = m_aabb; + m_MoveConst.fStepHei = 0.8f; + m_MoveConst.fMinAirHei = 1.6f; + m_MoveConst.fMinWaterHei = 0.3f; + m_MoveConst.fShoreDepth = 1.6f; + m_MoveConst.fWaterSurf = 0.6f; CalcPlayerAABB(); SetPos(pos); //m_CDRInfo.vTPNormal = GroundCheck(out RaycastHit hit) ? hit.normal : Vector3.zero; - m_CDRInfo.vExtent = m_aabbServer.Extents; + m_CDRInfo.vExtent = EC_Utility.ToVector3(m_aabbServer.Extents); + m_CDRInfo.vTPNormal = EC_Utility.ToVector3(g_vOrigin); + m_CDRInfo.fYVel = 0.0f; + m_CDRInfo.fSlopeThresh = EC_SLOPE_Y; + m_CDRInfo.fStepHeight = m_MoveConst.fStepHei; + + m_AirCDRInfo.vExtent = m_aabbServer.Extents; + m_AirCDRInfo.fUnderWaterDistThresh = m_MoveConst.fWaterSurf; + // Create work manager m_pWorkMan = new CECHPWorkMan(this); m_pWorkMan.StartWork_p0(m_pWorkMan.CreateWork(Host_work_ID.WORK_STAND)); if (IsDead()) { - //CECHPWorkDead pWork = (CECHPWorkDead*)m_pWorkMan->CreateWork(CECHPWork.Host_work_ID.WORK_DEAD); - //pWork->SetBeDeadFlag(true); - //m_pWorkMan->StartWork_p0(pWork); - EventBus.PublishChannel(GetCharacterID(), new ClearComActFlagAllRankNodesEvent(true)); + //CECHPWorkDead pWork = (CECHPWorkDead*)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_DEAD); + //pWork.SetBeDeadFlag(true); + //m_pWorkMan.StartWork_p0(pWork); + EventBus.PublishChannel(GetCharacterID(), new CECPlayer.ClearComActFlagAllRankNodesEvent(true)); PlayAction((int)PLAYER_ACTION_TYPE.ACT_GROUNDDIE); if (PopupManager.Instance != null) { @@ -2650,6 +2670,44 @@ namespace BrewMonster { return m_ExtProps.mv.swim_speed; } + + public float GetSwimSpeedSev() + { + float fSpeedSev = GetSwimSpeed(); + LayerMask layerGround = 1 << 6; + LayerMask layerWater = 1 << 8; + while (true) + { + if (!IsUnderWater()) break; + CECWorld pWorld = EC_Game.GetGameRun().GetWorld(); + if (pWorld == null) break; + + A3DVECTOR3 vPos = GetPos(); + Vector3 startPoint = EC_Utility.ToVector3(vPos); + Vector3 dir = EC_Utility.ToVector3(vPos) + Vector3.down; + float fTerrainHeight = 0f; + if (Physics.Raycast(startPoint, dir, out hit, layerGround)) + { + fTerrainHeight = Vector3.Distance(hit.point, startPoint); + } + float fWaterHeight = 0f; + if (Physics.Raycast(startPoint, dir, out hit, layerWater)) + { + fWaterHeight = Vector3.Distance(hit.point, startPoint); + } + if (fWaterHeight <= fTerrainHeight) break; + float fBorderLine = fWaterHeight - 2.0f; + if (vPos.y <= fBorderLine) break; + + // ·þÎñÆ÷¶Ë½«Ë®ÃæÒÔÏÂ2Ã×ÒÔÉÏ´¦ÀíΪ run_speed£¨ÓÐÎÊÌ⣩ + // µ«Î´Ê¹ÓüÓËÙ¼¼ÄÜʱ swim_speed СÓÚ run_speed£¬ + // ¿ÉÒÔÔÚË®ÃæÒÔÏÂ2Ã×ÒÔÉÏ»ñÈ¡³¬¹ý swim_speed µÄËÙ¶È£¬Òò´Ë£¬´Ë´¦È¡Á½Õß½ÏСֵΪºÏÀí×ö·¨ + fSpeedSev = Math.Min(m_ExtProps.mv.run_speed, fSpeedSev); + break; + } + return fSpeedSev; + } + public bool ApplySkillShortcut(int idSkill, bool bCombo = false /* false */, int idSelTarget = 0/* 0 */, int iForceAtk = -1/* -1 */) { @@ -4372,6 +4430,144 @@ namespace BrewMonster m_bIsInKingService = false; //m_pOffShopCtrl.SetNPCSevFlag(COfflineShopCtrl::NPCSEV_NULL); } + public bool GetPushDir(ref Vector3 vPushDir, uint dwMask, float deltaTime) + { + Vector3 vRight = Vector3.zero; + vRight.x = joystick.Horizontal; + vRight.z = joystick.Vertical; + vRight.y = 0f; + vRight.Normalize(); + if (vRight == Vector3.zero) + { + return false; + } + vPushDir = vRight; + /* // reset + vPushDir = Vector3.zero; + Vector3 vRight = Vector3.zero; + bool bMove = false; + + // Không bấm gì → không có hướng + if (m_dwMoveRelDir == 0) + return false; + + // ===== LEFT ===== + if ((m_dwMoveRelDir & MD_LEFT) != 0) + { + // Nếu trên không → xoay camera thay vì di chuyển + if (m_iMoveEnv == MOVEENV_AIR) + { + // giữ nguyên logic PW + ECMSG msg = new ECMSG(); + msg.dwParam2 = 0; + msg.dwParam1 = (uint)(_yaw_vel_air * deltaTime); + + if ((m_dwMoveRelDir & MD_BACK) != 0) + msg.dwParam1 = (uint)(-(int)msg.dwParam1); + + OnMsgHstYaw(msg); // TODO: bạn map hàm này sang Unity + } + else if (m_iMoveEnv == MOVEENV_WATER) + { + ECMSG msg = new ECMSG(); + msg.dwParam2 = 0; + msg.dwParam1 = (uint)(_yaw_vel * deltaTime); + + if ((m_dwMoveRelDir & MD_BACK) != 0) + msg.dwParam1 = (uint)(-(int)msg.dwParam1); + + OnMsgHstYaw(msg); // TODO + } + else + { + // Mặt đất → di chuyển sang trái theo camera + // C++: vRight = -m_CameraCoord.GetRight(); + Vector3 camRight = m_CameraCoord.GetRight(); // TODO: map sang Unity Camera? + vRight = -camRight; + vRight.y = 0; + vRight.Normalize(); + + vPushDir = vRight; + bMove = true; + } + } + + // ===== RIGHT ===== + else if ((m_dwMoveRelDir & MD_RIGHT) != 0) + { + if (m_iMoveEnv == MOVEENV_AIR) + { + ECMSG msg = new ECMSG(); + msg.dwParam2 = 0; + msg.dwParam1 = (uint)((-_yaw_vel_air) * deltaTime); + + if ((m_dwMoveRelDir & MD_BACK) != 0) + msg.dwParam1 = (uint)(-(int)msg.dwParam1); + + OnMsgHstYaw(msg); // TODO + } + else if (m_iMoveEnv == MOVEENV_WATER) + { + ECMSG msg = new ECMSG(); + msg.dwParam2 = 0; + msg.dwParam1 = (uint)((-_yaw_vel) * deltaTime); + + if ((m_dwMoveRelDir & MD_BACK) != 0) + msg.dwParam1 = (uint)(-(int)msg.dwParam1); + + OnMsgHstYaw(msg); // TODO + } + else + { + // Mặt đất → di chuyển sang phải theo camera + Vector3 camRight = m_CameraCoord.GetRight(); // TODO + vRight = camRight; + vRight.y = 0; + vRight.Normalize(); + + vPushDir = vRight; + bMove = true; + } + } + + // ===== FORWARD ===== + if ((m_dwMoveRelDir & MD_FORWARD) != 0) + { + Vector3 forward = m_CameraCoord.GetDir(); // TODO + forward.y = 0; + forward.Normalize(); + + vPushDir = forward; + + if (bMove) + { + vPushDir += vRight; + vPushDir.Normalize(); + } + } + // ===== BACK ===== + else if ((m_dwMoveRelDir & MD_BACK) != 0) + { + Vector3 back = -m_CameraCoord.GetDir(); // TODO + back.y = 0; + back.Normalize(); + + vPushDir = back; + + if (bMove) + { + vPushDir += vRight; + vPushDir.Normalize(); + } + } + // ===== ABS UP (nếu mask cho phép) ===== + else if (((m_dwMoveRelDir & MD_ABSUP) != 0) && ((dwMask & MD_ABSUP) != 0)) + { + vPushDir = Vector3.up; + }*/ + + return true; + } void UpdateGFXs(float dwDeltaTime) { @@ -4636,7 +4832,281 @@ namespace BrewMonster return NormalAttackObject(idTarget, bForceAttack, bMoreClose); } - } + + bool IsJumpInWater() { return m_bJumpInWater; } + // Is under water + bool IsUnderWater() { return m_iMoveEnv == Move_environment.MOVEENV_WATER ? true : false; } + // Can jump or take off in water ? + bool CanTakeOffWater() + { + return true; + //A3DVECTOR3 vPos = GetPos(); + //if (vPos.y < EC_Game.GetGameRun().GetWorld().GetWaterHeight(vPos) - m_MoveConst.fShoreDepth) + // return false; + //else + // return true; + } + + bool IsSitting() { return (m_dwStates & PlayerNPCState.GP_STATE_SITDOWN) != 0 ? true : false; } + // Is host player open trash box ? + bool IsUsingTrashBox() { return m_bUsingTrashBox; } + // Is host player talking with NPC ? + bool IsTalkingWithNPC() { return m_bTalkWithNPC; } + // Is reviving + bool IsReviving() + { + return m_pWorkMan.IsReviving(); + } + // Is spelling magic + bool IsSpellingMagic() + { + return m_pWorkMan.IsSpellingMagic(); + } + // Is picking up something + bool IsPicking() + { + return false; + // TODO: fix later + //CECHPWork pWork = m_pWorkMan.GetRunningWork(Host_work_ID.WORK_PICKUP); + //if (pWork != null) + //{ + // return !(pWork as CECHPWorkPick).IsGather(); + //} + //else + // return false; + } + + // Is gathering resources + bool IsGathering() + { + return false; + // TODO: fix later + //CECHPWork pWork = m_pWorkMan.GetRunningWork(Host_work_ID.WORK_PICKUP); + //if (pWork != null) + // return (pWork as CECHPWorkPick).IsGather(); + //else + // return false; + } + // Is using item ? + bool IsUsingItem() + { + return m_pWorkMan.IsUsingItem(); + } + bool IsPassiveMove() + { + return m_pWorkMan.IsPassiveMoving(); + } + void SetJumpInWater(bool b) { m_bJumpInWater = b; } + // Is host in sliding state (in the state, host is sliding on slope) ? + bool InSlidingState() + { + if (m_iMoveMode != Move_Mode.MOVE_SLIDE) + return false; + CECHPWorkStand pWork = (m_pWorkMan.GetRunningWork(Host_work_ID.WORK_STAND) as CECHPWorkStand); + if (pWork != null) + { + if (pWork.GetStopSlideFlag()) + { + return false; + } + } + + return true; + } + + public void SetGroundInfoClient() + { + isGrounded = GroundCheck(out lastGroundHit); + m_GndInfo.bOnGround = isGrounded; + } + + public void SetRotationHP(Vector3 dir) + { + transform.rotation = Quaternion.LookRotation(dir); + } + + // Estimate move environment + void EstimateMoveEnv(A3DVECTOR3 vPos) + { + if (IsFlying()) + { + m_iMoveEnv = Move_environment.MOVEENV_AIR; + return; + } + + CECWorld pWorld = EC_Game.GetGameRun().GetWorld(); + LayerMask layerMaskTerrain = 1 << 6; + LayerMask layerMaskBush = 1 << 7; + Vector3 vStart = EC_Utility.ToVector3(vPos); + Vector3 vGndPos0 = Vector3.zero; + Vector3 vTestPos0 = m_MoveCtrl.GetLastSevPos() + g_vAxisY * m_aabbServer.Extents.y; + VertRayTrace(vTestPos0, ref vGndPos0, ref m_GndInfo.vGndNormal, 1000f); + m_GndInfo.fGndHei = vGndPos0.y; + + Vector3 vAABBGnd = Vector3.zero; + VertAABBTrace(vTestPos0, EC_Utility.ToVector3(m_aabbServer.Extents), ref vAABBGnd, ref m_GndInfo.vGndNormal, 1000f); + vAABBGnd.y -= m_aabbServer.Extents.y; + + bool bIsInAir = false; + if (m_MoveCtrl.GetLastSevPos().y - vAABBGnd.y > 0.2f) + bIsInAir = true; + + Vector3 vGndPos = Vector3.zero; + A3DVECTOR3 vTestPos = vPos + EC_Utility.ToA3DVECTOR3(g_vAxisY) * m_aabbServer.Extents.y; + VertRayTrace(EC_Utility.ToVector3(vTestPos), ref vGndPos, ref m_GndInfo.vGndNormal, 1000f); + m_GndInfo.fGndHei = vGndPos.y; + //m_GndInfo.fWaterHei = pWorld.GetWaterHeight(vTestPos); + + VertAABBTrace(EC_Utility.ToVector3(vTestPos), EC_Utility.ToVector3(m_aabbServer.Extents), ref vAABBGnd, ref m_GndInfo.vGndNormal, 1000f); + vAABBGnd.y -= m_aabbServer.Extents.y; + + int iNewEnv = Move_environment.MOVEENV_GROUND; + + if (iNewEnv == Move_environment.MOVEENV_GROUND && GetPos().y - vAABBGnd.y < 0.2f && bIsInAir && EC_Utility.ToVector3(GetPos()) != m_MoveCtrl.GetLastSevPos()) + { + m_MoveCtrl.SendMoveCmd(GetPos(), 2, EC_Utility.ToA3DVECTOR3(g_vAxisY), EC_Utility.ToA3DVECTOR3(m_CDRInfo.vAbsVelocity), m_iMoveMode, true); + // BubbleText(BUBBLE_LEVELUP, 0); + } + + if (iNewEnv == Move_environment.MOVEENV_GROUND) + { + m_GndInfo.bOnGround = true; + + // if (vPos.y > m_GndInfo.fGndHei + 0.2f) + if (m_CDRInfo.vTPNormal == Vector3.zero) + { + if (m_iMoveMode != (int)MoveMode.MOVE_FREEFALL) + m_iMoveMode = (int)MoveMode.MOVE_FREEFALL; + + m_GndInfo.bOnGround = false; + if (IsJumping() && m_CDRInfo.vAbsVelocity.y < 0.0f && vPos.y - vAABBGnd.y < 0.6f) + { + PlayAction((int)PLAYER_ACTION_TYPE.ACT_JUMP_LAND, false); + } + } + else + { + if (IsJumping() && m_CDRInfo.vAbsVelocity.y < 0.0f && vPos.y - vAABBGnd.y < 0.6f) + { + PlayAction((int)PLAYER_ACTION_TYPE.ACT_JUMP_LAND, false); + ResetJump(); + } + + // if (m_GndInfo.vGndNormal.y < EC_SLOPE_Y) + if (m_CDRInfo.vTPNormal.y < EC_SLOPE_Y) + { + if (!m_MoveCtrl.GetSlideLock()) + { + if (m_iMoveMode != (int)MoveMode.MOVE_SLIDE) + { + m_iOldWalkMode = m_iMoveMode; + m_iMoveMode = (int)MoveMode.MOVE_SLIDE; + } + } + else + { + m_MoveCtrl.SetSlideLock(false); + m_iMoveMode = (int)MoveMode.MOVE_STAND; + } + } + else + { + m_MoveCtrl.SetSlideLock(false); + if (m_iMoveMode == (int)MoveMode.MOVE_FREEFALL) + { + m_iMoveMode = (int)MoveMode.MOVE_STAND; + } + else if (m_iMoveMode == (int)MoveMode.MOVE_SLIDE) + m_iMoveMode = m_iOldWalkMode; + } + } + } + //else if (iNewEnv == MOVEENV_WATER) + //{ + // m_CDRInfo.fYVel = 0.0f; + + // if (m_iMoveMode == MOVE_SLIDE) + // { + // if (m_pWorkMan.IsMoving()) + // m_iMoveMode = MOVE_MOVE; + // else + // m_iMoveMode = MOVE_STAND; + // } + //} + + m_iMoveEnv = iNewEnv; + } + + // ÏòÏ Trace µØÐκͽ¨Öþ£¬²¢·µ»ØµÚÒ»¸öÅöײµãµÄÇé¿ö + bool VertRayTrace(Vector3 vPos, ref Vector3 vHitPos, ref A3DVECTOR3 vHitNormal, float DeltaY) + { + + Vector3 vTerrainPos = Vector3.zero; + Vector3 vTerrainNormal = Vector3.zero; + Vector3 vBuildingPos = Vector3.zero; + Vector3 vBuildingNormal = Vector3.zero; + + LayerMask layerMaskTerrain = 1 << 6; + LayerMask layerMaskBush = 1 << 7; + if (Physics.Raycast(vPos, (vPos + Vector3.down), out hit, layerMaskTerrain)) + { + vTerrainPos = hit.point; + vTerrainNormal = hit.normal; + } + if (Physics.Raycast(vPos, (vPos + Vector3.down), out hit, DeltaY, layerMaskTerrain)) + { + if (vBuildingPos.y > vTerrainPos.y) + { + // Ó뽨Öþ·¢ÉúÁËÅöײ + vHitPos = vBuildingPos; + vHitNormal = EC_Utility.ToA3DVECTOR3(vBuildingNormal); + return true; + } + } + if (vTerrainPos.y > vPos.y || (vTerrainPos.y <= vPos.y && vTerrainPos.y >= vPos.y - DeltaY)) + { + vHitPos = vTerrainPos; + vHitNormal = EC_Utility.ToA3DVECTOR3(vTerrainNormal); + return true; + } + return false; + } + + void VertAABBTrace(Vector3 vCenter, Vector3 vExt, ref Vector3 vHitPos, ref A3DVECTOR3 vHitNormal, float DeltaY/* =100.0f */) + { + vHitPos = vCenter; + vHitPos.y -= DeltaY; + + LayerMask layerMask = 1 << 6 | 1 << 7; + if(!Physics.BoxCast(vCenter, vExt, (vCenter + Vector3.down).normalized, + out hit, transform.rotation, DeltaY, layerMask)) + { + vHitPos = vCenter; + vHitNormal = EC_Utility.ToA3DVECTOR3(Vector3.up); + } + else + { + vHitPos = hit.point; + vHitNormal = EC_Utility.ToA3DVECTOR3(hit.normal); + } + } + + void OnMsgHstExtProp(ECMSG Msg) + { + cmd_own_ext_prop pCmd = GPDataTypeHelper.FromBytes((byte[])Msg.dwParam1); + m_ExtProps = pCmd.prop; + m_BasicProps.iStatusPt = (int) pCmd.status_point; + m_BasicProps.iAtkDegree = pCmd.attack_degree; + m_BasicProps.iDefDegree = pCmd.defend_degree; + m_BasicProps.iCritRate = pCmd.crit_rate; + m_BasicProps.iCritDamageBonus = pCmd.crit_damage_bonus; + m_BasicProps.iInvisibleDegree = pCmd.invisible_degree; + m_BasicProps.iAntiInvisibleDegree = pCmd.anti_invisible_degree; + m_BasicProps.iPenetration = pCmd.penetration; + m_BasicProps.iResilience = pCmd.resilience; + m_BasicProps.iVigour = pCmd.vigour; + } +} public enum StateAnim { @@ -4683,7 +5153,6 @@ namespace BrewMonster } } enum MOVE_DIR - { MD_FORWARD = 0x01, MD_RIGHT = 0x02,