Merge branch 'develop' into feature/skill-data

# Conflicts:
#	Assets/PerfectWorld/Scripts/Managers/A3DTerrain2.cs
#	Assets/PerfectWorld/Scripts/Managers/CECManager.cs
#	Assets/PerfectWorld/Scripts/Managers/EC_HPWork.cs
#	Assets/PerfectWorld/Scripts/Managers/EC_HPWorkStand.cs
#	Assets/PerfectWorld/Scripts/Managers/EC_HPWorkTrace.cs
#	Assets/PerfectWorld/Scripts/Managers/aabbcd.cs
#	Assets/PerfectWorld/Scripts/Move/CECPlayer.cs
#	Assets/PerfectWorld/Scripts/Move/EC_CDR.cs
#	Assets/PerfectWorld/Scripts/PlayerState/PlayerIdleState.cs
#	Assets/PerfectWorld/Scripts/PlayerState/PlayerMoveState.cs
#	Assets/Scripts/CECHostPlayer.cs
#	Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
This commit is contained in:
VDH
2025-12-04 17:58:10 +07:00
57 changed files with 3931 additions and 1103 deletions
@@ -45,6 +45,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: a81dab17b00ef4b4494a71ee88b10cc0
m_Address: "\u7A0B\u5E8F\u8054\u5165/\u89D2\u8272\u5347\u7EA7\u4EBA\u7C7B.gfx"
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 070edb522e6e54c14a99055900003890, type: 2}
m_SchemaSet:
+41 -9
View File
@@ -6,9 +6,9 @@ using UnityEngine.EventSystems;
public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler
{
public float Horizontal { get { return SnapToDiscrete(input.x); } }
public float Vertical { get { return SnapToDiscrete(input.y); } }
public Vector2 Direction { get { return new Vector2(Horizontal, Vertical); } }
public float Horizontal { get { return input.x; } }
public float Vertical { get { return input.y; } }
public Vector2 Direction { get { return input; } }
public float HandleRange
{
@@ -78,8 +78,8 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
HandleInput(input.magnitude, input.normalized, radius, cam);
handle.anchoredPosition = input * radius * handleRange;
// Send event when value changes to -1 or 1
Vector2 currentSnapped = new Vector2(Horizontal, Vertical);
// Send event when value changes significantly (for 360-degree smooth movement)
Vector2 currentSnapped = new Vector2(SnapToDiscrete(input.x), SnapToDiscrete(input.y));
if ((currentSnapped.x == -1 || currentSnapped.x == 1 || currentSnapped.y == -1 || currentSnapped.y == 1) &&
currentSnapped != previousSnappedInput)
{
@@ -95,8 +95,9 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
{
if (magnitude > deadZone)
{
if (magnitude > 1)
input = normalised;
// Normalize to ensure speed is always 1 (full speed) or 0 (no movement)
// This keeps 360-degree direction but binary speed
input = normalised;
}
else
input = Vector2.zero;
@@ -110,10 +111,41 @@ public class Joystick : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoint
input = new Vector2(0f, input.y);
}
private Vector2 SnapTo8Directions(Vector2 input)
{
// Snap to 8 directions: N, NE, E, SE, S, SW, W, NW
// Returns values of -1, 0, or 1 for each axis
if (input.magnitude < 0.4f)
return Vector2.zero;
// Calculate angle in degrees (0 = up/North, 90 = right/East)
float angle = Mathf.Atan2(input.x, input.y) * Mathf.Rad2Deg;
// Normalize angle to 0-360
if (angle < 0) angle += 360f;
// Snap to 8 directions (every 45 degrees)
// 0° = N, 45° = NE, 90° = E, 135° = SE, 180° = S, 225° = SW, 270° = W, 315° = NW
float snappedAngle = Mathf.Round(angle / 45f) * 45f;
// Convert back to direction vector
float rad = snappedAngle * Mathf.Deg2Rad;
Vector2 snapped = new Vector2(Mathf.Sin(rad), Mathf.Cos(rad));
// Ensure values are exactly -1, 0, or 1
snapped.x = Mathf.Round(snapped.x);
snapped.y = Mathf.Round(snapped.y);
return snapped;
}
private float SnapToDiscrete(float value)
{
// Snap to -1, 1, or 0
if (value == 0)
// Snap to -1, 1, or 0 for 8-directional movement
// Use a small threshold to ensure diagonal movement works
const float threshold = 0.1f;
if (Mathf.Abs(value) < threshold)
return 0;
return value > 0 ? 1 : -1;
}
@@ -2,7 +2,14 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
{
Properties
{
_Texture_1 ("Texture", 2D) = "white" {}
_Texture_1 ("Layer 1 Texture", 2D) = "black" {}
_Texture_2 ("Layer 2 Texture", 2D) = "black" {}
_Texture_3 ("Layer 3 Texture", 2D) = "black" {}
_Texture_4 ("Layer 4 Texture", 2D) = "black" {}
_Texture_5 ("Layer 5 Texture", 2D) = "black" {}
_Texture_6 ("Layer 6 Texture", 2D) = "black" {}
_MaskTexture ("Mask Texture", 2D) = "black" {}
_MaskTexture2 ("Mask Texture 2", 2D) = "black" {}
_ShadowStrength ("Shadow Strength", Range(0, 1)) = 0.5
_Brightness ("Brightness", Range(0, 10)) = 5.0
}
@@ -34,8 +41,36 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
TEXTURE2D(_Texture_1);
SAMPLER(sampler_Texture_1);
TEXTURE2D(_Texture_2);
SAMPLER(sampler_Texture_2);
TEXTURE2D(_Texture_3);
SAMPLER(sampler_Texture_3);
TEXTURE2D(_MaskTexture);
SAMPLER(sampler_MaskTexture);
TEXTURE2D(_Texture_4);
SAMPLER(sampler_Texture_4);
TEXTURE2D(_Texture_5);
SAMPLER(sampler_Texture_5);
TEXTURE2D(_Texture_6);
SAMPLER(sampler_Texture_6);
TEXTURE2D(_MaskTexture2);
SAMPLER(sampler_MaskTexture2);
CBUFFER_START(UnityPerMaterial)
float4 _Texture_1_ST;
float4 _Texture_2_ST;
float4 _Texture_3_ST;
float4 _Texture_4_ST;
float4 _Texture_5_ST;
float4 _Texture_6_ST;
float4 _MaskTexture_ST;
float4 _MaskTexture2_ST;
half _ShadowStrength;
half _Brightness;
CBUFFER_END
@@ -44,6 +79,8 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
float2 uvMask : TEXCOORD3;
float2 uvMask2 : TEXCOORD7;
float3 normalOS : NORMAL;
float4 color : COLOR;
};
@@ -52,10 +89,19 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
float3 positionWS : TEXCOORD1;
float3 normalWS : TEXCOORD2;
float2 uv2 : TEXCOORD1;
float2 uv3 : TEXCOORD2;
float2 uvMask : TEXCOORD3;
float2 uv4 : TEXCOORD4;
float2 uv5 : TEXCOORD5;
float2 uv6 : TEXCOORD6;
float2 uvMask2 : TEXCOORD7;
float3 positionWS : TEXCOORD8;
float3 normalWS : TEXCOORD9;
float4 color : COLOR;
float fogCoord : TEXCOORD3;
float fogCoord : TEXCOORD10;
};
Varyings vert(Attributes input)
@@ -76,6 +122,13 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
// UV
output.uv = TRANSFORM_TEX(input.uv, _Texture_1);
output.uv2 = TRANSFORM_TEX(input.uv, _Texture_2);
output.uv3 = TRANSFORM_TEX(input.uv, _Texture_3);
output.uv4 = TRANSFORM_TEX(input.uv, _Texture_4);
output.uv5 = TRANSFORM_TEX(input.uv, _Texture_5);
output.uv6 = TRANSFORM_TEX(input.uv, _Texture_6);
output.uvMask = TRANSFORM_TEX(input.uvMask, _MaskTexture);
output.uvMask2 = TRANSFORM_TEX(input.uvMask2, _MaskTexture2);
// Fog
output.fogCoord = ComputeFogFactor(vertexInput.positionCS.z);
@@ -87,10 +140,28 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
{
// Sample the texture
half4 texColor = SAMPLE_TEXTURE2D(_Texture_1, sampler_Texture_1, input.uv);
half4 texColor2 = SAMPLE_TEXTURE2D(_Texture_2, sampler_Texture_2, input.uv2);
half4 texColor3 = SAMPLE_TEXTURE2D(_Texture_3, sampler_Texture_3, input.uv3);
half4 texColor4 = SAMPLE_TEXTURE2D(_Texture_4, sampler_Texture_4, input.uv4);
half4 texColor5 = SAMPLE_TEXTURE2D(_Texture_5, sampler_Texture_5, input.uv5);
half4 texColor6 = SAMPLE_TEXTURE2D(_Texture_6, sampler_Texture_6, input.uv6);
half4 maskColor = SAMPLE_TEXTURE2D(_MaskTexture, sampler_MaskTexture, input.uvMask);
half4 maskColor2 = SAMPLE_TEXTURE2D(_MaskTexture2, sampler_MaskTexture2, input.uvMask2);
// half4 totalWeight = maskColor.r + maskColor.g + maskColor.b;
half4 layer1Weight = 1 - (maskColor.r + maskColor.g + maskColor.b);// / totalWeight;
half4 layer2Weight = maskColor.g;// / totalWeight;
half4 layer3Weight = maskColor.b;// / totalWeight;
half4 layer4Weight = maskColor2.r;// / totalWeight;
half4 layer5Weight = maskColor2.g;// / totalWeight;
half4 layer6Weight = maskColor2.b;// / totalWeight;
// Apply brightness to vertex color then multiply with texture
half4 brightColor = input.color * _Brightness;
half4 color = texColor * brightColor;
half4 color = texColor * layer1Weight + texColor2 * layer2Weight + texColor3 * layer3Weight;
color += texColor4 * layer4Weight + texColor5 * layer5Weight + texColor6 * layer6Weight;
// color = maskColor2;
color *= brightColor;
// Shadow calculation
float4 shadowCoord = TransformWorldToShadowCoord(input.positionWS);
@@ -126,6 +197,9 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
CBUFFER_START(UnityPerMaterial)
float4 _Texture_1_ST;
float4 _Texture_2_ST;
float4 _Texture_3_ST;
float4 _MaskTexture_ST;
half _Brightness;
CBUFFER_END
@@ -133,6 +207,9 @@ Shader "BrewMonster/UnlitVertexColorUnlit"
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float2 texcoord2 : TEXCOORD1;
float2 texcoord3 : TEXCOORD2;
float2 texcoord4 : TEXCOORD3;
};
struct Varyings
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: d2d95ef77cdc4e64c969442caa95e479
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 182bc0e55106bfd48a0fe11a16acf78a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 6f0ac04f2e700fa4f985c6269235f4db
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: e1793ce297934ce4f811bc9fecd84235
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 77c26a19a43477349805b77e1f61a5a6
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 481 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: f76b0de48c321eb469922435d2fba676
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 517 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 5923de13232cf8c45893c9f87f7cc971
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 4a62d7c65e362df44aa763a03950ba9a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 545 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: d64094a49477c6f4aae58280a6309469
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 2023d5d869e902b45b053b8e305b0879
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: b9321e916df07c247b433d6f0b0ce158
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 52f7a7bdf9ded9c44bffa1d98d2bd5be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: d792b160621dd214198cd2191bf098b3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,3 @@
using BrewMonster.Scripts.Player;
using CSNetwork.GPDataType;
using NUnit.Framework;
using System.Collections.Generic;
@@ -1,5 +1,4 @@
using BrewMonster.Network;
using BrewMonster.Scripts.Player;
using System.Collections.Generic;
namespace BrewMonster.Scripts
@@ -444,11 +443,52 @@ namespace BrewMonster.Scripts
public bool DelayWork(int iPriority, CECHPWork pWork)
{
return false;
if (pWork == null)
{
// ASSERT(false);
return false;
}
if (!ValidatePriority(iPriority))
{
// ASSERT(false);
return false;
}
if (!IsAnyWorkRunning())
{
return false;
}
if (CanRunSimultaneouslyWithCurrentWork(iPriority, pWork))
{
return false;
}
bool bDelay = false;
if (m_pHost.IsMeleeing())
{
UnityGameSession.c2s_CmdCancelAction();
bDelay = true;
}
else if (IsPickingUp() || IsSpellingMagic())
{
bDelay = true;
}
if (bDelay)
{
ClearDelayedWork();
m_Delayed.iPriority = iPriority;
m_Delayed.pWork = pWork;
// LOG_DEBUG_INFO(AString().Format("CECHPWork::%s delayed, priority=%d", pWork->GetWorkName(), iPriority));
}
return bDelay;
}
public void StartDelayedWork()
{
if (!HasDelayedWork()){
return;
}
CECHPWork pWork = m_Delayed.pWork;
m_Delayed.pWork = null;
// LOG_DEBUG_INFO(AString().Format("CECHPWork:: start delayed work %s, priority=%d", pWork->GetWorkName(), m_Delayed.iPriority));
InternallyStartWork(m_Delayed.iPriority, pWork);
}
public bool HasDelayedWork()
{
@@ -456,7 +496,12 @@ namespace BrewMonster.Scripts
}
public void ClearDelayedWork()
{
if (!HasDelayedWork()){
return;
}
// LOG_DEBUG_INFO(AString().Format("delayed CECHPWork::%s priority=%d cleared", m_Delayed.pWork->GetWorkName(), m_Delayed.iPriority));
// delete m_Delayed.pWork;
m_Delayed.pWork = null;
}
public CECHPWork GetDelayedWork()
{
@@ -516,7 +561,7 @@ namespace BrewMonster.Scripts
//case CECHPWork.Host_work_ID.WORK_DEAD: pWork = new CECHPWorkDead(this); break;
//case CECHPWork.Host_work_ID.WORK_FOLLOW: pWork = new CECHPWorkFollow(this); break;
case CECHPWork.Host_work_ID.WORK_FLYOFF: pWork = new CECHPWorkFly(this); break;
//case CECHPWork.Host_work_ID.WORK_FREEFALL: pWork = new CECHPWorkFall(this); break;
case CECHPWork.Host_work_ID.WORK_FREEFALL: pWork = new CECHPWorkFall(this); break;
//case CECHPWork.Host_work_ID.WORK_SIT: pWork = new CECHPWorkSit(this); break;
//case CECHPWork.Host_work_ID.WORK_PICKUP: pWork = new CECHPWorkPick(this); break;
//case CECHPWork.Host_work_ID.WORK_CONCENTRATE: pWork = new CECHPWorkConcentrate(this); break;
@@ -714,8 +759,49 @@ namespace BrewMonster.Scripts
}
}
}
}
public bool IsReviving()
{
return IsWorkRunning(Host_work_ID.WORK_REVIVE);
}
public bool IsSpellingMagic()
{
return IsWorkRunning(Host_work_ID.WORK_SPELLOBJECT);
}
public bool IsUsingItem()
{
return IsWorkRunning(Host_work_ID.WORK_USEITEM);
}
public bool IsPassiveMoving()
{
return IsWorkRunning(Host_work_ID.WORK_PASSIVEMOVE);
}
public bool IsSitting()
{
return IsWorkRunning(Host_work_ID.WORK_SIT);
}
//todo: use this method
public void FinishAllWork(bool bGotoStand)
{
for (int i = 0; i < Work_priority.NUM_PRIORITY; ++i)
{
FinishWorkAtPriority(i);
}
ClearDelayedWork();
if (bGotoStand)
{
StartWork_p0(CreateWork(CECHPWork.Host_work_ID.WORK_STAND));
}
}
bool IsPickingUp()
{
return IsWorkRunning(CECHPWork.Host_work_ID.WORK_PICKUP);
}
private bool HasDelayedWork()
{
return GetDelayedWork() != null;
}
}
public abstract class CECHPWorkPostTickCommand
{
public abstract bool Run(CECHPWorkMan pWorkMan);
@@ -0,0 +1,317 @@
using CSNetwork.GPDataType;
using System;
using System.Runtime.ConstrainedExecution;
using UnityEngine;
using static CECPlayer;
namespace BrewMonster.Scripts
{
public class CECHPWorkFall : CECHPWork
{
protected A3DVECTOR3 m_vDirH;
protected float m_fSpeedH;
protected bool m_bEnterWater;
protected int m_iFallMode;
protected int m_nCurStage;
protected int m_iFallType;
protected bool m_fForceDown;
Vector3 g_vOrigin = Vector3.zero;
public static class FlyFallStage
{
public const int enumStageNone = 0,
enumStageUpperAir = 1,
enumStageLowerAir = 2,
enumStageShallowWater = 3,
enumStageDeepWater = 4,
enumStageLandOn = 5;
};
// Fall type
public static class Fall_type
{
public const int TYPE_FREEFALL = 0,
TYPE_FLYFALL = 1;
};
// This work is do player moving ?
// public override bool IsMoving() { return true; }
// Copy work data
// Set fall type
public void SetFallType(int iType) { m_iFallType = iType; }
public int GetFallType() { return m_iFallType; }
public CECHPWorkFall(CECHPWorkMan pWorkMan) : base(Host_work_ID.WORK_FREEFALL, pWorkMan)
{
m_dwMask = Work_mask.MASK_FREEFALL;
m_dwTransMask = Work_mask.MASK_STAND;
Reset();
}
// Reset work
public override void Reset()
{
base.Reset();
m_bEnterWater = false;
m_nCurStage = FlyFallStage.enumStageNone;
m_iFallType = Fall_type.TYPE_FREEFALL;
m_fForceDown = false;
}
// Copy work data
public override bool CopyData(CECHPWork pWork)
{
if (!base.CopyData(pWork))
return false;
CECHPWorkFall pSrc = (CECHPWorkFall)pWork;
m_bEnterWater = pSrc.m_bEnterWater;
m_nCurStage = pSrc.m_nCurStage;
m_iFallType = pSrc.m_iFallType;
m_fForceDown = pSrc.m_fForceDown;
return true;
}
// On first tick
protected override void OnFirstTick()
{
m_pHost.m_iMoveEnv = (int)MoveEnvironment.MOVEENV_GROUND;
m_pHost.m_iMoveMode = (int)MoveMode.MOVE_FREEFALL;
m_vDirH = m_pHost.m_vVelocity;
m_vDirH.y = 0.0f;
m_fSpeedH = m_vDirH.Normalize();
if (m_fSpeedH > m_pHost.GetGroundSpeed())
m_fSpeedH = m_pHost.GetGroundSpeed();
// Clear N
m_pHost.m_CDRInfo.vTPNormal = Vector3.zero;
}
// Work is cancel
public override void Cancel()
{
m_pHost.m_CDRInfo.vAbsVelocity = Vector3.zero;
if (m_pHost.m_CDRInfo.vTPNormal == Vector3.zero)
m_pHost.m_CDRInfo.fYVel = 0.0f;
base.Cancel();
}
// Tick routine
public override bool Tick(float dwDeltaTime)
{
base.Tick(dwDeltaTime);
var m_pEquipPack = m_pHost.GetInventory(InventoryConst.IVTRTYPE_EQUIPPACK);
if (m_pEquipPack.GetItem(InventoryConst.EQUIPIVTR_FLYSWORD, false) == null)
m_iFallMode = (int)GPMoveMode.GP_MOVE_FALL;
else
m_iFallMode = (int)GPMoveMode.GP_MOVE_FLYFALL;
if (m_pHost.IsDead())
m_iFallMode |= (int)GPMoveMode.GP_MOVE_DEAD;
if (!m_pHost.IsRooting())
{
float fDeltaTime = dwDeltaTime * 0.001f;
if (m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_GROUND ||
m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_AIR)
{
if (m_iFallType == Fall_type.TYPE_FLYFALL)
Fall_Air(fDeltaTime);
else
FreeFall_Air(fDeltaTime);
}
//else // m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_WATER
//{
// if (m_iFallType == Fall_type.TYPE_FLYFALL)
// Fall_Water(fDeltaTime);
// else
// FreeFall_Water(fDeltaTime);
//}
}
return true;
}
// Free fall in air
public bool Fall_Air(float fDeltaTime)
{
A3DVECTOR3 vCurPos = m_pHost.GetPos();
// A3DVECTOR3 vCurVel = m_pHost.m_vVelocity;
CDR_INFO cdr = m_pHost.m_CDRInfo;
bool bWorkEnd = false;
if (m_pHost.m_GndInfo.bOnGround)
{
bWorkEnd = true;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON_SWORD, false);
}
else
{
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vDirH, m_fSpeedH, fDeltaTime);
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
bWorkEnd = true;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON_SWORD, false);
}
else
{
float fHei = vCurPos.y - m_pHost.m_GndInfo.fGndHei;
if (fHei > 25f)
{
if (m_nCurStage == FlyFallStage.enumStageNone)
{
m_nCurStage = FlyFallStage.enumStageUpperAir;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN_SWORD_HIGH, false);
}
}
else if (fHei > 20f)
{
if (m_nCurStage == FlyFallStage.enumStageNone)
{
m_nCurStage = FlyFallStage.enumStageLowerAir;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN_WING_LOW, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN_SWORD_LOW, false);
}
}
else if (fHei > 3.0f)
{
if (m_nCurStage == FlyFallStage.enumStageNone
|| m_nCurStage == FlyFallStage.enumStageUpperAir)
{
m_nCurStage = FlyFallStage.enumStageLowerAir;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN_WING_LOW, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_FLYDOWN_SWORD_LOW, false);
}
}
else
{
if (m_nCurStage != FlyFallStage.enumStageLandOn)
{
m_nCurStage = FlyFallStage.enumStageLandOn;
//if (m_pHost.UsingWing())
if (m_pHost.GetWingType() == enumWingType.WINGTYPE_WING)
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON, false);
else
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_LANDON_SWORD, false);
}
}
}
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
}
if (bWorkEnd)
{
Finish();
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
float fSpeed = cdr.vAbsVelocity.magnitude;
if (Math.Abs(fSpeed - 0) < float.Epsilon)
fSpeed = m_pHost.GetFlySpeed();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, m_iFallMode);
m_pHost.m_vVelocity.Clear();
return true;
}
else
{
m_pHost.m_MoveCtrl.SendMoveCmd(vCurPos, 2, EC_Utility.ToA3DVECTOR3(g_vOrigin), EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity), m_iFallMode);
}
return true;
}
// Free fall in air
public bool FreeFall_Air(float fDeltaTime)
{
A3DVECTOR3 vCurPos = m_pHost.GetPos();
// A3DVECTOR3 vCurVel = m_pHost.m_vVelocity;
CDR_INFO cdr = m_pHost.m_CDRInfo;
if (m_pHost.m_GndInfo.bOnGround)
{
Finish();
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
float fSpeed = cdr.vAbsVelocity.magnitude;
if (Math.Abs(fSpeed - 0) < float.Epsilon)
fSpeed = m_pHost.GetFlySpeed();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, m_iFallMode);
m_pHost.m_vVelocity.Clear();
}
else
{
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vDirH, m_fSpeedH, fDeltaTime);
// If player is blocked, add disturb speed at random direction
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
cdr.fYVel = 0.0f;
Finish();
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), 5.0f, m_iFallMode);
}
/* {
m_fSpeedH = 3.0f;
m_vDirH = glb_RandomVectorH();
}
else
{
m_fSpeedH = 0.0f;
m_vDirH.Clear();
} */
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
m_pHost.m_MoveCtrl.SendMoveCmd(vCurPos, 2, EC_Utility.ToA3DVECTOR3(g_vOrigin), EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity), m_iFallMode);
m_pHost.PlayAction((int)PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false);
}
return true;
}
// Finish
public void Finish()
{
m_bFinished = true;
m_pHost.m_CDRInfo.vAbsVelocity = Vector3.zero;
// m_pHost.m_CDRInfo.fYVel = 0.0f;
//if (m_iFallType == Fall_type.TYPE_FLYFALL)
// m_pHost.ShowWing(false);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a85280d3ca5f703449ffa56b24ca7e47
@@ -106,7 +106,7 @@ class CECHPWorkMelee : CECHPWork
return true;
}
// Reset work
public virtual void Reset()
public override void Reset()
{
base.Reset();
@@ -1,11 +1,14 @@
using BrewMonster.Network;
using CSNetwork.GPDataType;
using UnityEngine;
using static CECPlayer;
using Types = BrewMonster.Scripts.CECHPWorkMove.DestTypes;
namespace BrewMonster.Scripts
{
public class CECHPWorkMove : CECHPWork
{
public static class Types
public static class DestTypes
{
public const int DEST_2D = 0,
DEST_3D = 1,
@@ -15,6 +18,8 @@ namespace BrewMonster.Scripts
DEST_AUTOPF = 5; // Movement type
}
private const uint MoveInputMask = 0x0F; // MD_FORWARD | MD_RIGHT | MD_BACK | MD_LEFT
protected A3DVECTOR3 m_vMoveDest; // Move destination position or direction
protected int m_iDestType; // Destination type
protected bool m_bHaveDest; // true, have destination
@@ -30,6 +35,8 @@ namespace BrewMonster.Scripts
protected float m_fCurPitch;
protected float m_fPushPitch;
protected float m_fPushLean;
protected A3DVECTOR3 vDir = new A3DVECTOR3();
protected bool m_bUseAutoMoveDialog; // Auto move
protected float m_fAutoHeight; // Height of auto moving destination
@@ -121,126 +128,204 @@ namespace BrewMonster.Scripts
}
// Tick routine
public virtual bool Tick(float dwDeltaTime)
public override bool Tick(float dwDeltaTime)
{
//UpdateResetUseAutoPF();
//if (m_bSwitchTo2D)
//{
// SwitchToDest2D();
// m_bSwitchTo2D = false;
// return true;
//}
//if (IsAutoPF())
//{
// if (CECIntelligentRoute::Instance().IsIdle())
// {
// // Ѱ·ģʽδɹʱȴ¸ Tick л DEST_2D ģʽ
// return true;
// }
// if (m_pHost.IsFlying())
// {
// // ;лģʽʱл DEST_2D ģʽ
// CECIntelligentRoute::Instance().ResetSearch();
// m_bSwitchTo2D = true;
// return true;
// }
//}
UpdateResetUseAutoPF();
if (m_bSwitchTo2D)
{
SwitchToDest2D();
m_bSwitchTo2D = false;
return true;
}
/* if (IsAutoPF())
{
if (CECIntelligentRoute::Instance().IsIdle())
{
// Ѱ·ģʽδɹʱȴ¸ Tick л DEST_2D ģʽ
return true;
}
if (m_pHost.IsFlying())
{
// ;лģʽʱл DEST_2D ģʽ
CECIntelligentRoute::Instance().ResetSearch();
m_bSwitchTo2D = true;
return true;
}
}*/
//base.Tick(dwDeltaTime);
base.Tick(dwDeltaTime);
//if (m_pHost.IsRooting())
// return true;
if (m_pHost.IsRooting())
return true;
//if (m_bUseAutoMoveDialog)
//{
// if (m_pHost.IsFlying())
// {
// m_bAutoFly = false;
// m_bAutoFlyPending = false;
// }
if (m_bUseAutoMoveDialog)
{
if (m_pHost.IsFlying())
{
m_bAutoFly = false;
m_bAutoFlyPending = false;
}
// if (m_bAutoFly && !m_bAutoFlyPending && !m_pHost.IsFlying())
// {
// if (m_pHost.CmdFly())
// {
// m_bAutoFly = false;
// m_bAutoFlyPending = true;
// }
// }
//}
//else
//{
// // Make sure 'Win_AutoPlay' dialog doesn't show up
// CECGameUIMan pGameUI = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
// pGameUI.AutoMoveShowDialog(false);
//}
if (m_bAutoFly && !m_bAutoFlyPending && !m_pHost.IsFlying())
{
/* if (m_pHost.CmdFly())
{
m_bAutoFly = false;
m_bAutoFlyPending = true;
}*/
}
}
else
{
// Make sure 'Win_AutoPlay' dialog doesn't show up
/* CECGameUIMan pGameUI = g_pGame.GetGameRun().GetUIManager().GetInGameUIMan();
pGameUI.AutoMoveShowDialog(false);*/
}
////Ѱ·ҵNPCתΪWorkTrace״̬
//if ((m_vMoveDest - m_pHost.GetPos()).MagnitudeH() <= 5.0f)
//{
// if (m_iNPCTempleId)
// {
// CECNPC pNPC = g_pGame.GetGameRun().GetWorld().GetNPCMan().FindNPCByTempleID(m_iNPCTempleId);
// if (pNPC && m_pHost.SelectTarget(pNPC.GetNPCID()))
// {
// CECHPWorkTrace pWork = m_pWorkMan.CreateNPCTraceWork(pNPC, m_iTaskId);
// if (pWork)
// {
// m_bAutoLand = false; //ֹ״̬Ѱ·תworktrace֮ǰԶ½workfall
// Finish();
// m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(pWork, true));
// return true;
// }
// }
// }
//}
//Ѱ·ҵNPCתΪWorkTrace״̬
/*if ((m_vMoveDest - m_pHost.GetPos()).MagnitudeH() <= 5.0f)
{
if (m_iNPCTempleId != 0)
{
CECNPC pNPC = EC_Game.GetGameRun().GetWorld().GetNPCMan().FindNPCByTempleID(m_iNPCTempleId);
if (pNPC && m_pHost.SelectTarget(pNPC.GetNPCID()))
{
CECHPWorkTrace pWork = m_pWorkMan.CreateNPCTraceWork(pNPC, m_iTaskId);
if (pWork != null)
{
m_bAutoLand = false; //ֹ״̬Ѱ·תworktrace֮ǰԶ½workfall
Finish();
m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(pWork, true));
return true;
}
}
}
}*/
m_pHost.SetGroundInfoClient();
float fDeltaTime = dwDeltaTime;
if (m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_GROUND ||
m_pHost.m_iMoveEnv == (int)MoveEnvironment.MOVEENV_WATER && m_pHost.IsJumping() && (m_pHost.m_CDRInfo.vAbsVelocity.y > 0 || m_pHost.m_CDRInfo.fYVel > 0))
{
// Play appropriate actions
if (!m_pHost.IsJumping() && !m_pHost.IsPlayingAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_TRICK_RUN) &&
m_pHost.m_iMoveMode != (int)MoveMode.MOVE_SLIDE && !m_bMeetSlide)
{
int iAction = m_pHost.GetMoveStandAction(true);
m_pHost.PlayAction(iAction, false);
}
//float fDeltaTime = dwDeltaTime;
//if (m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_GROUND ||
// m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_WATER && m_pHost.IsJumping() && (m_pHost.m_CDRInfo.vAbsVelocity.y > 0 || m_pHost.m_CDRInfo.fYVel > 0))
//{
// // Play appropriate actions
// if (!m_pHost.IsJumping() && !m_pHost.IsPlayingAction(CECPlayer::ACT_TRICK_RUN) &&
// m_pHost.m_iMoveMode != CECPlayer::MOVE_SLIDE && !m_bMeetSlide)
// {
// int iAction = m_pHost.GetMoveStandAction(true);
// m_pHost.PlayAction(iAction, false);
// }
Tick_Walk(fDeltaTime);
}
else // (m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_AIR || m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_WATER)
{
m_pHost.ResetJump();
// Tick_Walk(fDeltaTime);
//}
//else // (m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_AIR || m_pHost.m_iMoveEnv == CECPlayer::MOVEENV_WATER)
//{
// m_pHost.ResetJump();
// Play appropriate actions
if (!m_bGliding)
{
int iAction = m_pHost.GetMoveStandAction(true);
m_pHost.PlayAction(iAction, false);
}
// // Play appropriate actions
// if (!m_bGliding)
// {
// int iAction = m_pHost.GetMoveStandAction(true);
// m_pHost.PlayAction(iAction, false);
// }
// Tick_FlySwim(fDeltaTime);
//}
Tick_FlySwim(fDeltaTime);
}
return true;
}
// Reset work
public virtual void Reset()
public override void Reset()
{
base.Reset();
m_iDestType = DestTypes.DEST_2D;
m_bHaveDest = false;
m_bMeetSlide = false;
m_bReadyCancel = false;
m_bGliding = false;
m_fGlideTime = 0;
m_fCurPitch = 0;
m_fPushPitch = 0;
m_fPushLean = 0;
m_bUseAutoMoveDialog = false;
m_fAutoHeight = -1.0f;
m_bAutoLand = false;
m_bAutoFly = false;
m_bReachedHeight = true;
m_bAutoFlyPending = false;
m_iNPCTempleId = 0;
m_iTaskId = 0;
m_bSwitchTo2D = false;
m_bResetAutoPF = false;
}
// Work is cancel
public virtual void Cancel()
public override void Cancel()
{
//if (m_pHost.m_pMoveTargetGFX)
// m_pHost.m_pMoveTargetGFX.Stop();
//A3DVECTOR3 vDir = m_pHost.GetDir();
//vDir.y = 0;
//vDir.Normalize();
//if (!vDir.IsZero())
//{
// m_pHost.StopModelMove(vDir, g_vAxisY, 0);
//}
ClearResetUseAutoPF();
//if (CECIntelligentRoute::Instance().IsUsageMove())
//{
// if (!CECIntelligentRoute::Instance().IsIdle())
// {
// CECIntelligentRoute::Instance().ResetSearch();
// m_bSwitchTo2D = true; // Æô¶¯·ÉÐÐÖжϺó»Ö¸´Ê±¡¢ÐèÒªÇл»µ½ DEST_2D ģʽ
// }
//}
base.Cancel();
//AP_ActionEvent(AP_EVENT_MOVEFINISHED);
}
// This work is do player moving ?
public virtual bool IsMoving() { return true; }
public override bool IsMoving() { return true; }
// Copy work data
public virtual bool CopyData(CECHPWork pWork)
public override bool CopyData(CECHPWork pWork)
{
if (!base.CopyData(pWork))
return false;
CECHPWorkMove pSrc = pWork as CECHPWorkMove;
m_iDestType = pSrc.m_iDestType;
m_bHaveDest = pSrc.m_bHaveDest;
m_bMeetSlide = pSrc.m_bMeetSlide;
m_bReadyCancel = pSrc.m_bReadyCancel;
m_bGliding = pSrc.m_bGliding;
m_fGlideTime = pSrc.m_fGlideTime;
m_fGlideSpan = pSrc.m_fGlideSpan;
m_fGlideAng = pSrc.m_fGlideAng;
m_fGlideVel = pSrc.m_fGlideVel;
m_fGlidePitch = pSrc.m_fGlidePitch;
m_fCurPitch = pSrc.m_fCurPitch;
m_fPushPitch = pSrc.m_fPushPitch;
m_fPushLean = pSrc.m_fPushLean;
m_iDestType = pSrc.m_iDestType;
m_vMoveDest = pSrc.m_vMoveDest;
m_vCurDir = pSrc.m_vCurDir;
m_bUseAutoMoveDialog = pSrc.m_bUseAutoMoveDialog;
m_fAutoHeight = pSrc.m_fAutoHeight;
m_bAutoLand = pSrc.m_bAutoLand;
m_bAutoFly = pSrc.m_bAutoFly;
m_bReachedHeight = pSrc.m_bReachedHeight;
m_bAutoFlyPending = pSrc.m_bAutoFlyPending;
m_iNPCTempleId = pSrc.m_iNPCTempleId;
m_iTaskId = pSrc.m_iTaskId;
m_bSwitchTo2D = pSrc.m_bSwitchTo2D;
m_bResetAutoPF = pSrc.m_bResetAutoPF;
return true;
}
@@ -319,16 +404,352 @@ namespace BrewMonster.Scripts
//SetUseAutoMoveDialog(true);
}
// On first tick
protected virtual void OnFirstTick()
protected override void OnFirstTick()
{
m_pHost.m_iMoveMode = Move_Mode.MOVE_MOVE;
//PlayMoveTargetGFX();
//if (m_pHost.m_iMoveEnv != CECPlayer::MOVEENV_AIR)
// m_pHost.ShowWing(false);
if (!m_pHost.IsJumping())
{
int iAction = m_pHost.GetMoveStandAction(true);
m_pHost.PlayAction(iAction, false);
}
}
// Tick routine of walking on ground
protected bool Tick_Walk(float fDeltaTime)
{
A3DVECTOR3 vCurPos = m_pHost.GetPos();
ref CDR_INFO cdr = ref m_pHost.m_CDRInfo;
if (m_pHost.m_iMoveMode == (int)MoveMode.MOVE_SLIDE)
{
m_pHost.PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false);
A3DVECTOR3 vDir;
if (m_iDestType == DestTypes.DEST_DIR)
{
vDir = m_vCurDir;
}
else if (m_iDestType == DestTypes.DEST_PUSH)
{
vDir = GetCurrentModelDir();
}
#if ENABLE_CEC_INTELLIGENT_ROUTE
else if (IsAutoPF())
{
vDir = CECIntelligentRoute.Instance().GetCurDest() - vCurPos;
vDir.y = 0.0f;
vDir.Normalize();
}
#endif
else
{
vDir = m_vMoveDest - vCurPos;
vDir.y = 0.0f;
vDir.Normalize();
}
float fMaxSpeedV = 0.0f;
m_bMeetSlide = m_pHost.m_MoveCtrl.MeetSlope(vDir, fMaxSpeedV);
cdr.fYVel = EC_Utility.a_ClampFloor(cdr.fYVel, -fMaxSpeedV);
if (m_pHost.m_GndInfo.bOnGround)
m_vCurDir = vDir;
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vCurDir, m_pHost.GetGroundSpeed(), fDeltaTime);
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
m_pHost.m_MoveCtrl.SetSlideLock(true);
cdr.fYVel = 0.0f;
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), m_pHost.GetGroundSpeed(), (int)GPMoveMode.GP_MOVE_SLIDE);
}
else
{
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
#if ENABLE_CEC_INTELLIGENT_ROUTE
if (IsAutoPF() && CECIntelligentRoute.Instance().IsMoveOn())
CECIntelligentRoute.Instance().OnPlayerPosChange(vCurPos);
#endif
#if SHOW_AUTOMOVE_FOOTPRINTS
if (IsAutoPF() || m_iDestType == DestTypes.DEST_2D)
g_AutoPFFollowPoints.Add(vCurPos);
#endif
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
2,
GPDataTypeHelper.g_vOrigin,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
(int)GPMoveMode.GP_MOVE_SLIDE);
}
}
else if (!m_bMeetSlide)
{
float fSpeed = m_pHost.GetGroundSpeed();
int iMoveMode = m_pHost.m_bWalkRun ? (int)GPMoveMode.GP_MOVE_RUN : (int)GPMoveMode.GP_MOVE_WALK;
if (m_pHost.IsJumping())
iMoveMode = (int)GPMoveMode.GP_MOVE_JUMP;
else if (!m_pHost.m_GndInfo.bOnGround)
iMoveMode = (int)GPMoveMode.GP_MOVE_FALL;
if (m_bReadyCancel && m_pHost.m_GndInfo.bOnGround)
{
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
return true;
}
if ((GetMoveRelDirMask() & (uint)((MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT | MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK))) != 0)
m_iDestType = DestTypes.DEST_PUSH;
if (m_iDestType == DestTypes.DEST_2D)
{
float fDist;
if (m_pHost.m_GndInfo.bOnGround)
{
m_vCurDir = m_vMoveDest - vCurPos;
m_vCurDir.y = 0.0f;
fDist = m_vCurDir.Normalize();
}
else
{
fDist = (m_vMoveDest - vCurPos).MagnitudeH();
}
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vCurDir, fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
Debug.LogError(vCurPos);
UpdateFacingFromDelta(vCurPos);
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
cdr.fYVel = 0.0f;
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else if (cdr.vTPNormal != Vector3.zero)
{
A3DVECTOR3 vMoveDelta = vCurPos - m_pHost.GetPos();
vMoveDelta.y = 0.0f;
float fMoveDist = vMoveDelta.Normalize();
if (fMoveDist >= fDist)
{
Finish();
m_bUseAutoMoveDialog = false;
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else
{
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
0,
m_vMoveDest,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
#if SHOW_AUTOMOVE_FOOTPRINTS
g_AutoPFFollowPoints.Add(vCurPos);
#endif
}
else
{
#if SHOW_AUTOMOVE_FOOTPRINTS
g_AutoPFFollowPoints.Add(vCurPos);
#endif
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
1,
m_vMoveDest,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
}
else if (m_iDestType == DestTypes.DEST_DIR)
{
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vCurDir, fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
UpdateFacingFromDelta(vCurPos);
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
cdr.fYVel = 0.0f;
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else if (m_pHost.m_GndInfo.bOnGround)
{
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
2,
GPDataTypeHelper.g_vOrigin,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
else
{
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
1,
m_vMoveDest,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
}
else if (m_iDestType == DestTypes.DEST_STANDJUMP)
{
if (!m_pHost.IsJumping())
{
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
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);
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
m_pHost.ResetJump();
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else
{
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
0,
m_vMoveDest,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
}
}
else if (m_iDestType == DestTypes.DEST_PUSH)
{
Vector3 vMoveDir = Vector3.zero;//EC_Utility.ToVector3(GPDataTypeHelper.g_vOrigin);
fSpeed = m_pHost.GetGroundSpeed();
bool bFinish = false;
if (m_pHost.GetPushDir(ref vMoveDir, (uint)(MOVE_DIR.MD_FORWARD | MOVE_DIR.MD_BACK | MOVE_DIR.MD_LEFT | MOVE_DIR.MD_RIGHT), fDeltaTime))
{
if (vMoveDir != Vector3.zero)
{
m_pHost.SetRotationHP(vMoveDir);
}
vCurPos = m_pHost.m_MoveCtrl.GroundMove(EC_Utility.ToA3DVECTOR3(vMoveDir), fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
//Debug.LogError("vCurPos =" + vCurPos);
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
}
else
{
if (!m_bUseAutoMoveDialog)
bFinish = true;
else
m_iDestType = DestTypes.DEST_2D;
}
if (bFinish || m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
cdr.fYVel = 0.0f;
Finish();
m_pHost.m_vVelocity.Clear();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else
{
m_pHost.m_vVelocity = EC_Utility.ToA3DVECTOR3(vMoveDir) * fSpeed;
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
2,
GPDataTypeHelper.g_vOrigin,
m_pHost.m_vVelocity,
iMoveMode);
}
}
//else if (m_iDestType == DestTypes.DEST_PUSH)
//{
// m_iDestType = DestTypes.DEST_2D;
//}
#if ENABLE_CEC_INTELLIGENT_ROUTE
else if (IsAutoPF())
{
float fDist = 0.0f;
A3DVECTOR3 vCurDest = CECIntelligentRoute.Instance().GetCurDest();
if (m_pHost.m_GndInfo.bOnGround)
{
m_vCurDir = vCurDest - vCurPos;
m_vCurDir.y = 0.0f;
fDist = m_vCurDir.Normalize();
}
else
{
fDist = (vCurDest - vCurPos).MagnitudeH();
}
vCurPos = m_pHost.m_MoveCtrl.GroundMove(m_vCurDir, fSpeed, fDeltaTime, m_pHost.m_fVertSpeed);
if (!m_vCurDir.IsZero())
{
//m_pHost.StartModelMove(m_vCurDir, GPDataTypeHelper.g_vAxisY, 100);
//m_pHost.ChangeModelTargetDirAndUp(m_vCurDir, GPDataTypeHelper.g_vAxisY);
UpdateFacingFromDelta(vCurPos);
}
if (m_pHost.m_MoveCtrl.MoveBlocked() >= 3)
{
cdr.fYVel = 0.0f;
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else
{
m_pHost.SetPos(EC_Utility.ToVector3(vCurPos));
CECIntelligentRoute.Instance().OnPlayerPosChange(vCurPos);
if (CECIntelligentRoute.Instance().IsPathFinished())
{
Finish();
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), fSpeed, iMoveMode);
}
else
{
m_pHost.m_MoveCtrl.SendMoveCmd(
vCurPos,
1,
vCurDest,
EC_Utility.ToA3DVECTOR3(cdr.vAbsVelocity),
iMoveMode);
}
}
}
#else
else if (IsAutoPF())
{
m_bSwitchTo2D = true;
}
#endif
}
else
{
m_pHost.m_MoveCtrl.SendStopMoveCmd(EC_Utility.ToVector3(vCurPos), m_pHost.GetGroundSpeed(), (int)GPMoveMode.GP_MOVE_SLIDE);
Finish();
}
return true;
}
// Tick routine of flying or swimming
protected bool Tick_FlySwim(float fDeltaTime)
{
@@ -348,7 +769,7 @@ namespace BrewMonster.Scripts
protected void ClearResetUseAutoPF()
{
m_bResetAutoPF = false;
}
protected void UpdateResetUseAutoPF()
{
@@ -390,5 +811,30 @@ namespace BrewMonster.Scripts
// ClearResetUseAutoPF();
}
protected virtual uint GetMoveRelDirMask()
{
// TODO: hook up CECHostPlayer move-direction flags when available.
return 0;
}
private void UpdateFacingFromDelta(A3DVECTOR3 nextPos)
{
A3DVECTOR3 prevPos = m_pHost.GetPos();
Vector3 delta = EC_Utility.ToVector3(nextPos - prevPos);
delta.y = 0.0f;
if (delta.sqrMagnitude > 1e-6f)
{
delta.Normalize();
m_pHost.SetDirAndUp(delta, Vector3.up);
}
}
private A3DVECTOR3 GetCurrentModelDir()
{
Vector3 forward = m_pHost != null ? m_pHost.transform.forward : Vector3.forward;
return new A3DVECTOR3(forward.x, forward.y, forward.z);
}
}
}
@@ -12,7 +12,7 @@ namespace BrewMonster.Scripts
protected bool m_bMoving; // moving flag
protected bool m_bStopSlide; // stop sliding flag
protected int m_iCurAction; // current playing action
protected int m_oldAction; // cache old played action
//protected int m_oldAction; // cache old played action
public CECHPWorkStand(CECHPWorkMan pWorkMan) : base(Host_work_ID.WORK_STAND, pWorkMan)
{
@@ -132,18 +132,19 @@ namespace BrewMonster.Scripts
var pWork = (CECHPWorkMove)m_pWorkMan.CreateWork(Host_work_ID.WORK_MOVETOPOS);
if (pWork != null)
{
pWork.SetDestination(CECHPWorkMove.Types.DEST_STANDJUMP, GPDataTypeHelper.g_vOrigin);
pWork.SetDestination(CECHPWorkMove.DestTypes.DEST_STANDJUMP, GPDataTypeHelper.g_vOrigin);
m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(
pWork, false, CECHPWorkMan.Work_priority.PRIORITY_1, true, (uint)dwDeltaTime));
}
}
else if (iMoveReason == 2)
{
// var pWork = (CECHPWorkFall)m_pWorkMan.CreateWork(Host_work_ID.WORK_FREEFALL);
// if (pWork != null) {
// pWork.SetFallType(CECHPWorkFall.TYPE_FREEFALL);
// m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(pWork));
// }
var pWork = (CECHPWorkFall)m_pWorkMan.CreateWork(Host_work_ID.WORK_FREEFALL);
if (pWork != null)
{
pWork.SetFallType(CECHPWorkFall.Fall_type.TYPE_FREEFALL);
m_pWorkMan.SetPostTickCommand(new CECHPWorkPostTickRunWorkCommand(pWork));
}
}
else
{
@@ -160,7 +161,7 @@ namespace BrewMonster.Scripts
m_iCurAction = m_pHost.GetMoveStandAction(false, bFight);
}
float fDeltaTime = dwDeltaTime * 0.001f;
float fDeltaTime = dwDeltaTime /** 0.001f*/;
if (!m_pHost.IsRooting())
{
@@ -170,11 +171,11 @@ namespace BrewMonster.Scripts
Tick_FlySwim(fDeltaTime);*/
}
if (m_iPoseAction == (int)PLAYER_ACTION_TYPE.ACT_STAND && m_oldAction != m_iCurAction)
if (m_iPoseAction == (int)PLAYER_ACTION_TYPE.ACT_STAND)
{
// Chariot war special case omitted for now
m_pHost.PlayAction(m_iCurAction, false, 300);
m_oldAction = m_iCurAction;
m_pHost.PlayAction(m_iCurAction, false, 0);
//m_oldAction = m_iCurAction;
}
// Force to update object's direction and up
@@ -245,6 +246,9 @@ namespace BrewMonster.Scripts
return true;
}*/
// Get stop sliding flag
public bool GetStopSlideFlag() { return m_bStopSlide; }
}
}
@@ -189,21 +189,21 @@ namespace BrewMonster
{
bool bRet = false;
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
{
bRet = true;
}
else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
{
CECSkill pSkill = m_pHost.m_pPrepSkill;
if (pSkill == null || pSkill.GetTargetType() != 2)
{
bRet = true;
m_pHost.m_pPrepSkill = null;
}
//else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
//{
// CECSkill pSkill = m_pHost.m_pPrepSkill;
// if (pSkill == null || pSkill.GetTargetType() != 2)
// {
// bRet = true;
// m_pHost.m_pPrepSkill = null;
// }
//}
return bRet;
}
return bRet;
}
public override A3DVECTOR3 GetTargetPos()
{
@@ -218,9 +218,10 @@ namespace BrewMonster
{
CECNPC pNPC = (CECNPC)GetTargetObject();
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_TALK)
{
if ((!m_pHost.IsInBattle() || m_pHost.InSameBattleCamp(pNPC)) /*&&
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_TALK)
{
//TODO: Visite other's booth, send hello message to him
if ((!m_pHost.IsInBattle() || m_pHost.InSameBattleCamp(pNPC)) /*&&
!g_pGame.GetGameRun().GetUIManager().GetInGameUIMan().GetDialog("Win_SkillAction").IsShow()*/)
{
UnityGameSession.c2s_CmdNPCSevHello(m_iObjectId);
@@ -291,21 +292,21 @@ namespace BrewMonster
{
bool bRet = false;
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
{
bRet = true;
}
else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
{
CECSkill pSkill = m_pHost.m_pPrepSkill;
if (pSkill == null || pSkill.GetTargetType() != 2)
{
bRet = true;
m_pHost.m_pPrepSkill = null;
}
//else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
//{
// CECSkill pSkill = m_pHost.m_pPrepSkill;
// if (pSkill == null || pSkill.GetTargetType() != 2)
// {
// bRet = true;
// m_pHost.m_pPrepSkill = null;
// }
//}
return bRet;
}
return bRet;
}
public override A3DVECTOR3 GetTargetPos()
{
@@ -320,92 +321,90 @@ namespace BrewMonster
}
}
public override bool OnTouched()
public override bool OnTouched()
{
bool bActionDone = false;
if (GPDataTypeHelper.ISPLAYERID(m_iObjectId))
{
bool bActionDone = false;
if (GPDataTypeHelper.ISPLAYERID(m_iObjectId))
if (m_iObjectId == 0 || m_iObjectId == m_pHost.GetCharacterID())
{
if (m_iObjectId == 0 || m_iObjectId == m_pHost.GetCharacterID())
// Handle special case
if (!m_pHost.CannotAttack())
{
// Handle special case
//ASSERT(m_iReason == CECHPWorkTrace::TRACE_SPELL);
//if (!m_pHost.CannotAttack())
//{
// if (m_pHost.CastSkill(m_iObjectId, m_bForceAttack, null))
// bActionDone = true;
//}
//else
//{
// m_pHost.m_pPrepSkill = null;
//}
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- special case- TRACE_SPELL");
return bActionDone;
}
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
{
if (m_iObjectId == m_pHost.m_idSelTarget &&
m_pHost.AttackableJudge(m_iObjectId, m_bForceAttack) == 1)
{
byte byPVPMask = EC_Utility.glb_BuildPVPMask(m_bForceAttack);
UnityGameSession.c2s_CmdNormalAttack(byPVPMask);
m_pHost.m_bPrepareFight = true;
if (m_pHost.CastSkill(m_iObjectId, m_bForceAttack, null))
bActionDone = true;
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_ATTACK");
}
}
//else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
//{
// //a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_SPELL");
// if (!m_pHost.CastSkill(m_iObjectId, m_bForceAttack, GetTargetObject()))
// {
// m_pHost.m_pPrepSkill = null;
// }
// else
// {
// bActionDone = true;
// }
//}
else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_TALK)
else
{
m_pHost.m_pPrepSkill = null;
}
return bActionDone;
}
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
{
if (m_iObjectId == m_pHost.m_idSelTarget &&
m_pHost.AttackableJudge(m_iObjectId, m_bForceAttack) == 1)
{
byte byPVPMask = EC_Utility.glb_BuildPVPMask(m_bForceAttack);
UnityGameSession.c2s_CmdNormalAttack(byPVPMask);
m_pHost.m_bPrepareFight = true;
bActionDone = true;
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_ATTACK");
}
}
else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
{
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_SPELL");
if (!m_pHost.CastSkill(m_iObjectId, m_bForceAttack, GetTargetObject()))
{
m_pHost.m_pPrepSkill = null;
}
else
{
// Visite other's booth, send hello message to him
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_TALK");
UnityGameSession.c2s_CmdNPCSevHello(m_iObjectId);
bActionDone = true;
}
}
return bActionDone;
else if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_TALK)
{
// Visite other's booth, send hello message to him
//a_LogOutput(1, "[NormalATK]- CECTracedPlayer- OnTouched- TRACE_TALK");
UnityGameSession.c2s_CmdNPCSevHello(m_iObjectId);
bActionDone = true;
}
}
return bActionDone;
}
public override CECTracedObject Clone()
{
return new CECTracedPlayer(this);
}
public override bool IsTargetMissing()
public override bool IsTargetMissing()
{
if (base.IsTargetMissing())
{
if (base.IsTargetMissing())
return true;
}
CECPlayer pPlayer = GetTargetObject() as CECPlayer;
if (pPlayer.IsElsePlayer())
{
if (pPlayer.IsDead())
{
if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
{
CECSkill pSkill = m_pHost.m_pPrepSkill;
if (pSkill != null && pSkill.GetTargetType() == 2)
{
return false;
}
}
return true;
}
CECPlayer pPlayer = GetTargetObject() as CECPlayer;
if (pPlayer.IsElsePlayer())
{
if (pPlayer.IsDead())
{
//if (m_iReason == CECHPWorkTrace.Trace_reason.TRACE_SPELL)
//{
// CECSkill pSkill = m_pHost.m_pPrepSkill;
// if (pSkill && pSkill.GetTargetType() == 2)
// {
// return false;
// }
//}
return true;
}
}
return false;
}
};
return false;
}
};
public class CECTracedMatter : CECTracedObject
{
@@ -650,32 +649,33 @@ namespace BrewMonster
{
base.Reset();
m_bHaveMoved = false;
m_bMeetSlide = false;
m_bCheckTouch = true;
m_bReadyCancel = false;
m_bMoreClose = false;
//m_pPrepSkill = null;
m_bForceAttack = false;
m_bActionDone = false;
ClearResetUseAutoPF();
m_bUseAutoPF = false;
m_dwAutoPFNextCheckTime = 0;
m_pTraceObject = null;
}
// Work is cancel
public override void Cancel()
{
//if (m_pHost.m_pPrepSkill && m_pTraceObject.GetTraceReason() == Trace_reason.TRACE_SPELL)
// m_pHost.m_pPrepSkill = null;
m_bHaveMoved = false;
m_bMeetSlide = false;
m_bCheckTouch = true;
m_bReadyCancel = false;
m_bMoreClose = false;
//m_pPrepSkill = null;
m_bForceAttack = false;
m_bActionDone = false;
ClearResetUseAutoPF();
m_bUseAutoPF = false;
m_dwAutoPFNextCheckTime = 0;
m_pTraceObject = null;
}
// Work is cancel
public override void Cancel()
{
if (m_pHost.m_pPrepSkill != null && m_pTraceObject.GetTraceReason() == Trace_reason.TRACE_SPELL)
m_pHost.m_pPrepSkill = null;
ClearResetUseAutoPF();
if (GetUseAutoPF())
{
SetUseAutoPF(false);
}
//m_pHost.StopModelMove();
base.Cancel();
ClearResetUseAutoPF();
if (GetUseAutoPF())
{
SetUseAutoPF(false);
}
//TODO: m_pHost.StopModelMove(); uncomment and add logic
//m_pHost.StopModelMove();
base.Cancel();
//AP_ActionEvent(m_bActionDone ? AP_EVENT_TRACEOK : AP_EVENT_MOVEFINISHED, m_pTraceObject.GetTraceReason());
}
@@ -710,15 +710,15 @@ namespace BrewMonster
return true;
}
// User press cancel button
public void PressCancel()
{
m_bReadyCancel = true;
//if (m_pTraceObject.GetTraceReason() == TRACE_SPELL)
// m_pHost.m_pPrepSkill = NULL;
}
// Set move close flag
public void SetMoveCloseFlag(bool bMoveClose) { m_pTraceObject.SetMoveCloseFlag(bMoveClose); }
// User press cancel button
public void PressCancel()
{
m_bReadyCancel = true;
if (m_pTraceObject.GetTraceReason() == Trace_reason.TRACE_SPELL)
m_pHost.m_pPrepSkill = null;
}
// Set move close flag
public void SetMoveCloseFlag(bool bMoveClose) { m_pTraceObject.SetMoveCloseFlag(bMoveClose); }
// Set / Get force attack flag
public void SetForceAttack(bool bTrue) { m_bForceAttack = bTrue; }
@@ -750,18 +750,18 @@ namespace BrewMonster
public void SetActionDone(bool bActionDone) { m_bActionDone = bActionDone; }
public void OnTargetMissing()
public void OnTargetMissing()
{
StopMove(true);
if ((m_pTraceObject.GetTraceType() == TraceObjectType.TRACE_NPC) || (m_pTraceObject.GetTraceType() == TraceObjectType.TRACE_PLAYER))
{
StopMove(true);
if ((m_pTraceObject.GetTraceType() == TraceObjectType.TRACE_NPC) || (m_pTraceObject.GetTraceType() == TraceObjectType.TRACE_PLAYER))
{
m_pTraceObject.OnTargetMissing();
}
//else if (m_pTraceObject.GetTraceReason() == Trace_reason.TRACE_SPELL)
//{
// m_pHost.m_pPrepSkill = null;
//}
m_pTraceObject.OnTargetMissing();
}
else if (m_pTraceObject.GetTraceReason() == Trace_reason.TRACE_SPELL)
{
m_pHost.m_pPrepSkill = null;
}
}
public void OnTouchTarget()
{
@@ -0,0 +1,212 @@
using BrewMonster.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts;
using CSNetwork.GPDataType;
using System;
using UnityEngine;
namespace BrewMonster
{
public partial class CECHostPlayer
{
float _JumpTime = -1;
public void OnKeyDown()
{
if (Input.GetMouseButtonDown(0) && mainCam != null)
{
OnMsgLBtnClick();
}
if (Input.GetKeyDown(KeyCode.Space))
{
//if (bInAutoMode) return;
if (IsJumpInWater() || IsFlying())
return;
if (IsUnderWater())
{
if (!CanTakeOffWater())
return;
else if (_JumpTime <= 0)
{
_JumpTime = Time.realtimeSinceStartup;
return;
}
else if ((Time.realtimeSinceStartup - _JumpTime) < 1f) // logic in c++, _JumpTime is milisecond
return;
else
_JumpTime = -1f;
}
m_GndInfo.bOnGround = GroundCheck(out lastGroundHit);
OnMsgHstJump();
}
}
public void OnMsgLBtnClick()
{
int idTraceTarget = 0, idSelTarget = 0;
bool bForceAttack = false;
int iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_NONE;
bool bWikiMonster = false;
ray = mainCam.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.gameObject.TryGetComponent<CECObject>(out CECObject clickedObject))
{
int idObject = CECObject.GetObjectID(clickedObject);
if (idObject != 0)
{
CECNPC pNPC = EC_ManMessageMono.Instance._CECNPCMan.GetNPC(idObject);
if (pNPC != null)
{
if (!pNPC.IsDead() && m_idSelTarget == idObject)
{
idTraceTarget = idObject;
}
else
{
idSelTarget = idObject;
}
if (idTraceTarget != 0)
{
if (AttackableJudge(idObject, bForceAttack) == 1)
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
else if (pNPC.IsServerNPC())
{
if (!IsInBattle() || InSameBattleCamp(pNPC))
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
}
}
}
else
{
// pCDS.m_RayTraceRt.iEntity == ECENT_PLAYER
CECPlayer pPlayer = EC_ManMessageMono.Instance.EC_ManPlayer.GetPlayer(idObject);
// 1. Msg.dwParam4 is double click flag.
// 2. Buddy player counld't be traced
if (!pPlayer.IsDead() /*&& pPlayer.GetCharacterID() != m_iBuddyId*/ &&
(m_idSelTarget == idObject /*|| (Msg.dwParam4 && m_idUCSelTarget == idObject)*/))
{
idTraceTarget = idObject;
//bForceAttack = glb_GetForceAttackFlag(&Msg.dwParam3);
if (AttackableJudge(idObject, bForceAttack) == 1)
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_ATTACK;
else if (pPlayer.GetBoothState() != 0)
iTraceReason = CECHPWorkTrace.Trace_reason.TRACE_TALK;
}
else
{
idSelTarget = idObject;
}
}
// cancel this action if not selectable
if (!CanSelectTarget(idTraceTarget))
{
idTraceTarget = 0;
//return;
}
}
}
}
// Tell server we select a target
if (idSelTarget != 0 && m_idSelTarget != idSelTarget)
{
m_idUCSelTarget = idSelTarget;
SelectTarget(m_idUCSelTarget);
}
if (idTraceTarget != 0)
{
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_ATTACK)
{
if (!CanDo(ActionCanDo.CANDO_MELEE))
return;
NormalAttackObject(idTraceTarget, bForceAttack);
}
else
{
if (!CanDo(ActionCanDo.CANDO_MOVETO))
return;
CECHPWork pWork;
if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_PICKUP)
{
//PickupObject(idTraceTarget, false);
}
else if (iTraceReason == CECHPWorkTrace.Trace_reason.TRACE_GATHER)
{
//PickupObject(idTraceTarget, true);
}
else if ((pWork = m_pWorkMan.GetWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT)) != null)
{
CECHPWorkTrace pWorkTrace = (pWork) as CECHPWorkTrace;
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
}
else if (m_pWorkMan.CanStartWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT) && !bWikiMonster)
{
CECHPWorkTrace pWorkTrace = (CECHPWorkTrace)m_pWorkMan.CreateWork(CECHPWork.Host_work_ID.WORK_TRACEOBJECT);
pWorkTrace.SetTraceTarget(pWorkTrace.CreatTraceTarget(idTraceTarget, iTraceReason, bForceAttack));
m_pWorkMan.StartWork_p1(pWorkTrace);
}
}
}
}
public void OnMsgHstJump()
{
// first of all see if we need to cancel sitdown work.
if (m_pWorkMan.IsSitting())
{
UnityGameSession.c2s_CmdStandUp();
return;
}
if (!CanDo(ActionCanDo.CANDO_JUMP))
return;
float fVertSpeed = 10.0f;
if (m_iJumpCount == 0)
{
if (m_iMoveEnv == Move_environment.MOVEENV_WATER)
{
if (!IsUnderWater())
return;
fVertSpeed = 7.0f;
SetJumpInWater(true);
}
else if (!m_GndInfo.bOnGround)
return;
}
if (InSlidingState())
return;
m_iJumpCount++;
m_fVertSpeed = fVertSpeed;
m_CDRInfo.vAbsVelocity.y = fVertSpeed;
m_CDRInfo.fYVel = 0.0f;
m_CDRInfo.vTPNormal = Vector3.zero;
if (m_iJumpCount == 1)
{
m_MoveCtrl.SendMoveCmd(GetPos(), 2, GPDataTypeHelper.g_vAxisY, EC_Utility.ToA3DVECTOR3(m_CDRInfo.vAbsVelocity), m_iMoveMode, true);
// BubbleText(BUBBLE_HITMISSED, 0);
}
PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_START);
PlayAction((int)CECPlayer.PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false, 0, true);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c64966b4075658b48a5bc694d91a47fc
+199 -181
View File
@@ -77,13 +77,16 @@ namespace BrewMonster
private static Dictionary<uint, PLAYER_ACTION_INFO_CONFIG> _default_skill_actions
= new Dictionary<uint, PLAYER_ACTION_INFO_CONFIG>();
protected int m_iBoothState = 0; // Booth state. 0, none; 1, prepare; 2, open booth; 3, visite other's booth
public int m_idFRole = GNETRoles._R_UNMEMBER; // ID of player's faction role
protected int m_idCountry = 0; // ¹úÕ½ÕóÓª id
public static int MAX_REINCARNATION = 2;
protected List<int> m_aCurEffects = new List<int>(); // Current effects
byte m_ReincarnationCount = 0;
string m_strName; // Player name
protected int m_iBoothState = 0; // Booth state. 0, none; 1, prepare; 2, open booth; 3, visite other's booth
public int m_idFRole = GNETRoles._R_UNMEMBER; // ID of player's faction role
protected int m_idCountry = 0; // ¹úÕ½ÕóÓª id
public static int MAX_REINCARNATION = 2;
protected List<int> m_aCurEffects = new List<int>(); // Current effects
byte m_ReincarnationCount = 0;
string m_strName; // Player name
// 需要是可能 || Need is possible
protected bool m_bHangerOn = false;
protected int m_iCurAction;
public MOVECONST m_MoveConst; // Const used when moving control
public Move_Mode m_MoveMode;
@@ -213,18 +216,18 @@ namespace BrewMonster
}
public static async Task<bool> LoadPlayerSkin(GameObject aSkins, int index, string szFile)
{
// these are LOD suffix
string[] suffix1 = { "一?", "二级", "三级" };
string[] suffix2 = { "", "二级", "三级" };
public static async Task<bool> LoadPlayerSkin(GameObject aSkins, int index, string szFile)
{
// these are LOD suffix
string[] suffix1 = { "一?", "二级", "三级" };
string[] suffix2 = { "", "二级", "三级" };
string szSkinFile = "";
string szSkinFile = "";
if (index == EC_Player_Skin_Const.SKIN_BODY_INDEX || index == EC_Player_Skin_Const.SKIN_HEAD_INDEX)
szSkinFile = $"{szFile}{suffix2[0]}";
else
szSkinFile = $"{szFile}{suffix1[0]}";
if (index == EC_Player_Skin_Const.SKIN_BODY_INDEX || index == EC_Player_Skin_Const.SKIN_HEAD_INDEX)
szSkinFile = $"{szFile}{suffix2[0]}";
else
szSkinFile = $"{szFile}{suffix1[0]}";
aSkins = await AddressableManager.Instance.LoadPrefabAsync(szSkinFile);
@@ -384,38 +387,38 @@ namespace BrewMonster
return PlayActionWithConfig(iAction, 0, bRestart, iTransTime, bQueue);
}
public bool PlayActionWithConfig(int iAction, int actionConfigID, bool bRestart = true, int iTransTime = 200,
bool bQueue = false)
private bool PlayActionWithConfig(int iAction, int actionConfigID, bool bRestart = true, int iTransTime = 200,
bool bQueue = false)
{
if (iAction < 0 || iAction >= (int)PLAYER_ACTION_TYPE.ACT_MAX)
{
if (iAction < 0 || iAction >= (int)PLAYER_ACTION_TYPE.ACT_MAX)
{
return false;
}
if (actionConfigID > 0)
{
DATA_TYPE dt = DATA_TYPE.DT_INVALID;
var p = ElementDataManProvider.GetElementDataMan()
.get_data_ptr((uint)actionConfigID, ID_SPACE.ID_SPACE_CONFIG, ref dt);
if (dt == DATA_TYPE.DT_PLAYER_ACTION_INFO_CONFIG)
{
PLAYER_ACTION actionConfig;
actionConfig.type = (PLAYER_ACTION_TYPE)iAction;
actionConfig.data = (PLAYER_ACTION_INFO_CONFIG)p;
return PlayActionWithConfig(iAction, actionConfig, bRestart, iTransTime, bQueue);
}
else
{
}
}
return PlayActionWithConfig(iAction, m_PlayerActions[iAction], bRestart, iTransTime, bQueue);
return false;
}
public bool PlayActionWithConfig(int iAction, in PLAYER_ACTION actionConfig,
bool bRestart = true, int iTransTime = 200, bool bQueue = false)
if (actionConfigID > 0)
{
PLAYER_ACTION action = actionConfig;
DATA_TYPE dt = DATA_TYPE.DT_INVALID;
var p = ElementDataManProvider.GetElementDataMan()
.get_data_ptr((uint)actionConfigID, ID_SPACE.ID_SPACE_CONFIG, ref dt);
if (dt == DATA_TYPE.DT_PLAYER_ACTION_INFO_CONFIG)
{
PLAYER_ACTION actionConfig;
actionConfig.type = (PLAYER_ACTION_TYPE)iAction;
actionConfig.data = (PLAYER_ACTION_INFO_CONFIG)p;
return PlayActionWithConfig(iAction, actionConfig, bRestart, iTransTime, bQueue);
}
else
{
}
}
return PlayActionWithConfig(iAction, m_PlayerActions[iAction], bRestart, iTransTime, bQueue);
}
private bool PlayActionWithConfig(int iAction, in PLAYER_ACTION actionConfig,
bool bRestart = true, int iTransTime = 200, bool bQueue = false)
{
m_iCurAction = iAction;
PLAYER_ACTION action = actionConfig;
var szAct = EC_Utility.BuildActionName(action, 0);
EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szAct));
@@ -497,50 +500,50 @@ namespace BrewMonster
CECAttackEvent pAttack = null;
// first try to find if there is already a skill attack event in attackman
CECAttackerEvents attackerEvents = CECAttacksMan.Instance.FindAttackByAttacker(GetPlayerInfo().cid);
if (attackerEvents)
// first try to find if there is already a skill attack event in attackman
CECAttackerEvents attackerEvents = CECAttacksMan.Instance.FindAttackByAttacker(GetPlayerInfo().cid);
if (attackerEvents)
{
CECAttackEvent pAttack1 = attackerEvents.Find(idSkill, nSection);
if (pAttack1 != null)
{
CECAttackEvent pAttack1 = attackerEvents.Find(idSkill, nSection);
if (pAttack1 != null)
{
// Ãæ¹¥»÷µÄ·ÇµÚÒ»´ÎÉ˺¦ÏûÏ¢
pAttack1.AddTarget(idTarget, dwModifier, nDamage);
goto EXIT;
}
else
{
attackerEvents.Signal();
}
}
if (ElementSkill.IsGoblinSkill((uint)idSkill) &&
ElementSkill.GetType((uint)idSkill) == 2)
{
pAttack = CECAttacksMan.Instance.AddSkillAttack(
GetPlayerInfo().cid, GetPlayerInfo().cid, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
// Ãæ¹¥»÷µÄ·ÇµÚÒ»´ÎÉ˺¦ÏûÏ¢
pAttack1.AddTarget(idTarget, dwModifier, nDamage);
goto EXIT;
}
else
{
// begin a skill attack
pAttack = CECAttacksMan.Instance.AddSkillAttack(
GetPlayerInfo().cid, m_idCurSkillTarget, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
attackerEvents.Signal();
}
}
if (ElementSkill.IsGoblinSkill((uint)idSkill) &&
ElementSkill.GetType((uint)idSkill) == 2)
{
pAttack = CECAttacksMan.Instance.AddSkillAttack(
GetPlayerInfo().cid, GetPlayerInfo().cid, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
}
else
{
// begin a skill attack
pAttack = CECAttacksMan.Instance.AddSkillAttack(
GetPlayerInfo().cid, m_idCurSkillTarget, idTarget, GetWeaponID(), idSkill, skillLevel, dwModifier, nDamage);
}
if (pAttack != null)
if (pAttack != null)
{
int unusedInt = 0;
pAttack.SetSkillSection(nSection);
if (!IsDead() && (dwModifier & (uint)MOD.MOD_RETORT) == 0
&& (dwModifier & (uint)MOD.MOD_ATTACK_AURA) == 0
&& PlaySkillAttackAction(idSkill, nAttackSpeed, ref unusedInt, nSection, pAttack)
&& (dwModifier & (uint)MOD.MOD_BEAT_BACK) == 0)
{
int unusedInt = 0;
pAttack.SetSkillSection(nSection);
if (!IsDead() && (dwModifier & (uint)MOD.MOD_RETORT) == 0
&& (dwModifier & (uint)MOD.MOD_ATTACK_AURA) == 0
&& PlaySkillAttackAction(idSkill, nAttackSpeed, ref unusedInt, nSection, pAttack)
&& (dwModifier & (uint)MOD.MOD_BEAT_BACK) == 0)
{
}
else
{
pAttack.m_bSignaled = true;
}
}
else
{
pAttack.m_bSignaled = true;
}
}
EXIT:
// // For skill attacking, time is always set to 0
@@ -554,9 +557,19 @@ namespace BrewMonster
EventBus.PublishChannel(m_PlayerInfo.cid, new ClearComActFlagAllRankNodesEvent(v));
}
public bool PlayAttackAction(int nAttackSpeed, ref int attackTime, CECAttackEvent attackEvent)
public struct ClearComActFlagAllRankNodesEvent
{
public bool v;
public ClearComActFlagAllRankNodesEvent(bool value)
{
//attackTime = 0;
v = value;
}
}
public bool PlayAttackAction(int nAttackSpeed, ref int attackTime, CECAttackEvent attackEvent)
{
//attackTime = 0;
//if (_pPlayerModel == null)
// return false;
@@ -575,24 +588,24 @@ namespace BrewMonster
ShowWeaponByConfig(action.data);
/* var pRightHandWeapon = GetRightHandWeapon();
bool bHideFX = !CECOptimize.Instance.GFX.CanShowAttack(GetCharacterID(), GetClassID());*/
// ==============================
// Ground Attack
// ==============================
if (GetMoveEnv() == (int)MoveEnvironment.MOVEENV_GROUND)
{
/* var pRightHandWeapon = GetRightHandWeapon();
bool bHideFX = !CECOptimize.Instance.GFX.CanShowAttack(GetCharacterID(), GetClassID());*/
// ==============================
// Ground Attack
// ==============================
if (GetMoveEnv() == (int)MoveEnvironment.MOVEENV_GROUND)
{
// “起? 动作(挥起)
szAct = EC_Utility.BuildActionName(action, weapon_type, "起");
EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szAct));
szAct = EC_Utility.BuildActionName(action, weapon_type, "落");
queueActionEvent.SetData(szAct, SetApplyDamage, true, attackEvent);
EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent);
//PlayNonSkillActionWithName(iAction, szAct, true, 200, true, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);gagága
/*
if (pRightHandWeapon != null && IsUsingMagicWeapon())
pRightHandWeapon.PlayActionByName(_GenWeaponActionName(szAct, m_iGender), 1.0f, true, 200, true, iAction, bHideFX);
// “起? 动作(挥起)
szAct = EC_Utility.BuildActionName(action, weapon_type, "起");
EventBus.PublishChannel(m_PlayerInfo.cid, new PlayActionEvent(szAct));
szAct = EC_Utility.BuildActionName(action, weapon_type, "落");
queueActionEvent.SetData(szAct, SetApplyDamage, true, attackEvent);
EventBus.PublishChannelClass(m_PlayerInfo.cid, queueActionEvent);
//PlayNonSkillActionWithName(iAction, szAct, true, 200, true, ref pActFlag, COMACT_FLAG_MODE_ONCE_MULTIIGNOREGFX);gagága
/*
if (pRightHandWeapon != null && IsUsingMagicWeapon())
pRightHandWeapon.PlayActionByName(_GenWeaponActionName(szAct, m_iGender), 1.0f, true, 200, true, iAction, bHideFX);
nTime1 = _pPlayerModel.GetComActTimeSpanByName(szAct);
@@ -986,44 +999,47 @@ namespace BrewMonster
// iAction = ACT_HANGINWATER;
}
return iAction;
}
public void Damaged(int nDamage, uint dwModifier = 0, int skill = 0)
return iAction;
}
public A3DVECTOR3 GetModelMoveDir()
{ // ÒÆ¶¯Ê±¡¢·µ»ØÒƶ¯³¯Ïò£¬¾²Ö¹Ê±¡¢·µ»ØÄ£Ðͳ¯Ïò
return EC_Utility.ToA3DVECTOR3(transform.forward);
}
public void Damaged(int nDamage, uint dwModifier = 0, int skill = 0)
{
if (nDamage == -2)
{
if (nDamage == -2)
// this message is caused by a help skill, so don't use a wounded action here
/* if (dwModifier & CECAttackEvent::MOD_IMMUNE)
BubbleText(BUBBLE_IMMUNE, 0);
else if (dwModifier & CECAttackEvent::MOD_NULLITY)
BubbleText(BUBBLE_INVALIDHIT, 0);
else if (dwModifier & CECAttackEvent::MOD_DODGE_DEBUFF)
BubbleText(BUBBLE_DODGE_DEBUFF, 0);*/
}
else if (nDamage == -1)
{
// when else player hit this player iDamage is -1,
// Just play a wounded action
if (!OnDamaged(skill))
{
// this message is caused by a help skill, so don't use a wounded action here
/* if (dwModifier & CECAttackEvent::MOD_IMMUNE)
BubbleText(BUBBLE_IMMUNE, 0);
else if (dwModifier & CECAttackEvent::MOD_NULLITY)
BubbleText(BUBBLE_INVALIDHIT, 0);
else if (dwModifier & CECAttackEvent::MOD_DODGE_DEBUFF)
BubbleText(BUBBLE_DODGE_DEBUFF, 0);*/
// PlayAction((int)PLAYER_ACTION_TYPE.ACT_WOUNDED);
}
else if (nDamage == -1)
/*if (dwModifier & CECAttackEvent::MOD_IMMUNE)
BubbleText(BUBBLE_IMMUNE, 0);
else if (dwModifier & CECAttackEvent::MOD_NULLITY)
BubbleText(BUBBLE_INVALIDHIT, 0);
else if (dwModifier & CECAttackEvent::MOD_DODGE_DEBUFF)
BubbleText(BUBBLE_DODGE_DEBUFF, 0);*/
}
else
{
// Popup a damage decal
if (nDamage > 0)
{
// when else player hit this player iDamage is -1,
// Just play a wounded action
if (!OnDamaged(skill))
{
// PlayAction((int)PLAYER_ACTION_TYPE.ACT_WOUNDED);
}
/*if (dwModifier & CECAttackEvent::MOD_IMMUNE)
BubbleText(BUBBLE_IMMUNE, 0);
else if (dwModifier & CECAttackEvent::MOD_NULLITY)
BubbleText(BUBBLE_INVALIDHIT, 0);
else if (dwModifier & CECAttackEvent::MOD_DODGE_DEBUFF)
BubbleText(BUBBLE_DODGE_DEBUFF, 0);*/
}
else
{
// Popup a damage decal
if (nDamage > 0)
{
int p1 = 0;
/*if (dwModifier & CECAttackEvent::MOD_CRITICAL_STRIKE)
p1 |= 0x0001;
int p1 = 0;
/*if (dwModifier & CECAttackEvent::MOD_CRITICAL_STRIKE)
p1 |= 0x0001;
if (dwModifier & CECAttackEvent::MOD_RETORT)
p1 |= 0x0002;*/
@@ -1141,19 +1157,19 @@ namespace BrewMonster
int weapon_type = GetShowingWeaponType();
if (!_default_skill_actions.TryGetValue((uint)idSkill, out PLAYER_ACTION_INFO_CONFIG data) ||
data.action_prefix == null || data.action_prefix.Length == 0 || data.action_prefix[0] == 0)
if (!_default_skill_actions.TryGetValue((uint)idSkill, out PLAYER_ACTION_INFO_CONFIG data) ||
data.action_prefix == null || data.action_prefix.Length == 0 || data.action_prefix[0] == 0)
{
// Check if it's a target item skill / 检查是否为目标道具技能
if (ElementSkill.GetCommonCoolDown((uint)idSkill) > 1 << 4)
{
// Check if it's a target item skill / 检查是否为目标道具技能
if (ElementSkill.GetCommonCoolDown((uint)idSkill) > 1 << 4)
{
PLAYER_ACTION_INFO_CONFIG? data2 = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_USING_TARGET_ITEM].data;
if (data2 == null || data2.Value.action_prefix == null || data2.Value.action_prefix.Length == 0 || data2.Value.action_prefix[0] == 0)
return false;
}
else
PLAYER_ACTION_INFO_CONFIG? data2 = m_PlayerActions[(int)PLAYER_ACTION_TYPE.ACT_USING_TARGET_ITEM].data;
if (data2 == null || data2.Value.action_prefix == null || data2.Value.action_prefix.Length == 0 || data2.Value.action_prefix[0] == 0)
return false;
}
else
return false;
}
int nTime1, nTime2;
bool bInfinite = false;
@@ -1162,15 +1178,15 @@ namespace BrewMonster
var atkMan = CECAttacksMan.Instance;
if (GetMoveEnv() == (int)MoveEnvironment.MOVEENV_GROUND)
{
szAct = EC_Utility.BuildActionName(data, weapon_type, "_施放起_");
GetSkillSectionActionName(ref szAct, idSkill, nSection);
if (GetMoveEnv() == (int)MoveEnvironment.MOVEENV_GROUND)
{
szAct = EC_Utility.BuildActionName(data, weapon_type, "_施放起_");
GetSkillSectionActionName(ref szAct, idSkill, nSection);
if (!PlaySkillAttackActionWithName(idSkill, szAct, bHideFX, attackEvent))
{
return false;
}
if (!PlaySkillAttackActionWithName(idSkill, szAct, bHideFX, attackEvent))
{
return false;
}
// nTime1 = m_pPlayerModel->GetComActTimeSpanByName(szAct); // 获取动作时长 / Get action time span
// pAct = m_pPlayerModel->GetComActByName(szAct);
@@ -1181,36 +1197,36 @@ namespace BrewMonster
GetSkillSectionActionName(ref szAct, idSkill, nSection);
QueueSkillAttackActionWithName(idSkill, szAct, 0, bHideFX);
// nTime2 = m_pPlayerModel->GetComActTimeSpanByName(szAct);
// pAct = m_pPlayerModel->GetComActByName(szAct);
// if (pAct) bInfinite |= pAct->IsInfinite();
nTime2 = 1000; // 临时值 / Temporary value
// nTime2 = m_pPlayerModel->GetComActTimeSpanByName(szAct);
// pAct = m_pPlayerModel->GetComActByName(szAct);
// if (pAct) bInfinite |= pAct->IsInfinite();
nTime2 = 1000; // 临时值 / Temporary value
}
else
{
// 空中动作 / Air action
string szActionMiddleName = null;
if ((m_wingType == enumWingType.WINGTYPE_WING && IsFlying()) ||
(m_iProfession == PROFESSION.PROF_ANGEL) ||
(m_iProfession == PROFESSION.PROF_ARCHOR) ||
(m_iProfession == PROFESSION.PROF_MONK) ||
(m_iProfession == PROFESSION.PROF_GHOST))
{
szActionMiddleName = "_空中翅膀"; // Air with wings / 空中翅膀
}
else
{
// 空中动作 / Air action
string szActionMiddleName = null;
if ((m_wingType == enumWingType.WINGTYPE_WING && IsFlying()) ||
(m_iProfession == PROFESSION.PROF_ANGEL) ||
(m_iProfession == PROFESSION.PROF_ARCHOR) ||
(m_iProfession == PROFESSION.PROF_MONK) ||
(m_iProfession == PROFESSION.PROF_GHOST))
{
szActionMiddleName = "_空中翅膀"; // Air with wings / 空中翅膀
}
else
{
szActionMiddleName = "_空中飞剑"; // Air with sword / 空中飞剑
}
szActionMiddleName = "_空中飞剑"; // Air with sword / 空中飞剑
}
szActionMiddleName += "_施放起_";
szAct = EC_Utility.BuildActionName(data, weapon_type, szActionMiddleName);
GetSkillSectionActionName(ref szAct, idSkill, nSection);
szActionMiddleName += "_施放起_";
szAct = EC_Utility.BuildActionName(data, weapon_type, szActionMiddleName);
GetSkillSectionActionName(ref szAct, idSkill, nSection);
if (!PlaySkillAttackActionWithName(idSkill, szAct, bHideFX, attackEvent))
{
return false;
}
if (!PlaySkillAttackActionWithName(idSkill, szAct, bHideFX, attackEvent))
{
return false;
}
// if (pRightHandWeapon && IsUsingMagicWeapon())
// pRightHandWeapon->PlayActionByName(_GenWeaponActionName(szAct, m_iGender), 1.0f, true, 200, true, ACT_CASTSKILL, bHideFX);
@@ -1475,12 +1491,14 @@ namespace BrewMonster
public byte GetReincarnationCount() { return m_ReincarnationCount; }
public string GetName()
{
return m_strName;
}
public string GetName()
{
return m_strName;
}
public enumWingType GetWingType() { return m_wingType; }
}
public struct PlayActionEvent
{
public string AnimationName;
+29 -29
View File
@@ -1,4 +1,4 @@
using BrewMonster.Scripts;
using BrewMonster.Scripts;
using BrewMonster.Scripts.Ornament;
using BrewMonster.Scripts.Player;
using BrewMonster.Scripts.World;
@@ -215,7 +215,7 @@ namespace BrewMonster
{
vDelta = vVelocity * fTime;
float fDeltaDist = vDelta.magnitude;
//if (fDeltaDist < DIST_EPSILON) break;
if (fDeltaDist < DIST_EPSILON) break;
// TO DO: fix later beacuse logic in CollideWithEnv_BoxCast is wrong
//bool hasHit = CollideWithEnv_BoxCast(vStart, vDelta, vExt, mask,
@@ -230,7 +230,7 @@ namespace BrewMonster
CDRInfo.fMoveDist += fDeltaDist;
break;
}
//if (bStartSolid)
//if (trcInfo.bStartSolid)
//{
// CDRInfo.fMoveDist = 0f;
// if (CDRInfo.vTPNormal.y < CDRInfo.fSlopeThresh) CDRInfo.vTPNormal = Vector3.up;
@@ -276,35 +276,35 @@ namespace BrewMonster
bTryPull = true;
}
//if (!bPull)
//{
// if (vVelocity.sqrMagnitude > 1e-12f)
// {
// vVelDir = vVelocity.normalized;
// fVelSpeed = vVelocity.magnitude * (1f - nTry * 0.1f);
if (!bPull)
{
if (vVelocity.sqrMagnitude > 1e-12f)
{
vVelDir = vVelocity.normalized;
fVelSpeed = vVelocity.magnitude * (1f - nTry * 0.1f);
// dtp = Vector3.Dot(vNormal, vVelDir);
// float fRelSpeed = Mathf.Min(fVelSpeed, 5.0f);
dtp = Vector3.Dot(vNormal, vVelDir);
float fRelSpeed = Mathf.Min(fVelSpeed, 5.0f);
// if (dtp >= 0f && dtp < 1e-4f)
// {
// vVelocity += vNormal * VEL_REFLECT * fRelSpeed;
// }
// else
// {
// vVelocity = (vVelDir - vNormal * dtp) * fVelSpeed - vNormal * dtp * VEL_REFLECT * fRelSpeed;
// }
// }
if (dtp >= 0f && dtp < 1e-4f)
{
vVelocity += vNormal * VEL_REFLECT * fRelSpeed;
}
else
{
vVelocity = (vVelDir - vNormal * dtp) * fVelSpeed - vNormal * dtp * VEL_REFLECT * fRelSpeed;
}
}
// if (fYVel > VEL_EPSILON)
// {
// if (vNormal.y >= CDRInfo.fSlopeThresh || vNormal.y < -NORMAL_EPSILON) fYVel = 0f;
// }
// else if (fYVel < -VEL_EPSILON)
// {
// if (vNormal.y >= CDRInfo.fSlopeThresh) fYVel = 0f;
// }
//}
if (fYVel > VEL_EPSILON)
{
if (vNormal.y >= CDRInfo.fSlopeThresh || vNormal.y < -NORMAL_EPSILON) fYVel = 0f;
}
else if (fYVel < -VEL_EPSILON)
{
if (vNormal.y >= CDRInfo.fSlopeThresh) fYVel = 0f;
}
}
}
// “vertical ground trace” thay RetrieveSupportPlane
@@ -1280,5 +1280,12 @@ namespace CSNetwork
gamedatasend.Data = C2SCommandFactory.CreateTaskNotifyCmd(pData, dwDataSize);
SendProtocol(gamedatasend);
}
public void c2s_SendCmdStandUp()
{
gamedatasend gamedatasend = new gamedatasend();
gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.STAND_UP);
SendProtocol(gamedatasend);
}
}
}
@@ -318,6 +318,11 @@ namespace BrewMonster.Network
{
Instance._gameSession.c2s_SendCmdNPCSevTaskMatter(idTask);
}
public static void c2s_CmdStandUp()
{
Instance._gameSession.c2s_SendCmdStandUp();
}
#region Task
public static void c2s_CmdGetAllData(bool byPack, bool byEquip, bool byTask)
{
@@ -1,27 +0,0 @@
using BrewMonster.Scripts.Player;
using UnityEngine;
namespace BrewMonster
{
public class PlayerIdleState : PlayerState
{
public PlayerIdleState(CECHostPlayer characterCtrl) : base(characterCtrl)
{
}
public override void Enter()
{
_characterCtrl.PlayAction((int)PLAYER_ACTION_TYPE.ACT_STAND, true, 1, false);
}
public override void Exit()
{
}
public override void Update()
{
}
}
}
@@ -1,28 +0,0 @@
using BrewMonster.Scripts.Player;
using UnityEngine;
namespace BrewMonster
{
public class PlayerMoveState : PlayerState
{
public PlayerMoveState(CECHostPlayer characterCtrl) : base(characterCtrl)
{
}
public override void Enter()
{
_characterCtrl.PlayAction((int)PLAYER_ACTION_TYPE.ACT_RUN, true, 1, false);
}
public override void Exit()
{
_characterCtrl.StopMovement();
}
public override void Update()
{
_characterCtrl.HandleMovement();
}
}
}
@@ -1,16 +0,0 @@
using UnityEngine;
namespace BrewMonster
{
public abstract class PlayerState
{
protected readonly CECHostPlayer _characterCtrl;
public PlayerState(CECHostPlayer characterCtrl)
{
_characterCtrl = characterCtrl;
}
public abstract void Enter();
public abstract void Exit();
public abstract void Update();
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 1c3e8f4466ed88340aeb27f86dc0c172
@@ -138,7 +138,21 @@ namespace BrewMonster
//if (!m_pPlayerModel) return;
//if (!IsValidAction(iCurAction)) return;
PlayAction(GetMoveStandAction(true), true, 1, false);
// PlayAction(GetMoveStandAction(true), true, 1, false);
// Play action
if (IsValidAction(m_iCurAction))
{
if (!IsPlayingAction((int)PLAYER_ACTION_TYPE.ACT_TRICK_JUMP) && !IsPlayingAction((int)PLAYER_ACTION_TYPE.ACT_TRICK_RUN))
{
if (m_iMoveMode == Move_Mode.MOVE_JUMP || m_iMoveMode == Move_Mode.MOVE_SLIDE)
PlayAction((int)PLAYER_ACTION_TYPE.ACT_JUMP_LOOP, false);
else
PlayAction(GetMoveStandAction(true), false);
}
}
else
PlayAction(GetMoveStandAction(true), true, 1, false);
}
public bool MovingTo(float dwDeltaTime)
@@ -154,15 +168,20 @@ namespace BrewMonster
float fDist = vDir.Normalize();
if (vDir.IsZero()) return false;
Quaternion targetRotation = Quaternion.LookRotation(EC_Utility.ToVector3(vDir));
if (Quaternion.Angle(transform.rotation, targetRotation) < 0.5f)
transform.rotation = targetRotation;
else
transform.rotation = Quaternion.Slerp(
transform.rotation,
targetRotation,
rotationSpeed * Time.deltaTime
);
Vector3 flatDir = EC_Utility.ToVector3(vDir);
flatDir.y = 0;
if (flatDir.sqrMagnitude > 0.001f)
{
Quaternion targetRotation = Quaternion.LookRotation(flatDir);
if (Quaternion.Angle(transform.rotation, targetRotation) < 0.5f)
transform.rotation = targetRotation;
else
transform.rotation = Quaternion.Slerp(
transform.rotation,
targetRotation,
rotationSpeed * Time.deltaTime
);
}
vPos = MoveStep(vDir, m_fMoveSpeed, fDeltaTime);
@@ -187,15 +206,20 @@ namespace BrewMonster
A3DVECTOR3 vDir = m_vMoveDir;
vDir.Normalize();
Quaternion targetRotation = Quaternion.LookRotation(EC_Utility.ToVector3(vDir));
if (Quaternion.Angle(transform.rotation, targetRotation) < 0.5f)
transform.rotation = targetRotation;
else
transform.rotation = Quaternion.Slerp(
transform.rotation,
targetRotation,
rotationSpeed * Time.deltaTime
);
Vector3 flatDir = EC_Utility.ToVector3(vDir);
flatDir.y = 0;
if (flatDir.sqrMagnitude > 0.001f)
{
Quaternion targetRotation = Quaternion.LookRotation(flatDir);
if (Quaternion.Angle(transform.rotation, targetRotation) < 0.5f)
transform.rotation = targetRotation;
else
transform.rotation = Quaternion.Slerp(
transform.rotation,
targetRotation,
rotationSpeed * Time.deltaTime
);
}
vPos = MoveStep(vDir, m_fMoveSpeed, fDeltaTime);
SetPos(vPos);
float fDist = A3d_Magnitude(m_vServerPos - vCurPos);
@@ -295,10 +319,10 @@ namespace BrewMonster
m_cdr.vCenter += vDelta;
m_cdr.vecGroundNormal = g_vAxisY;
//if (m_cdr.bTraceGround)
// SetGroundNormal(m_cdr.vecGroundNormal);
//else
// SetGroundNormal(g_vAxisY);
if (m_cdr.bTraceGround)
SetGroundNormal(m_cdr.vecGroundNormal);
else
SetGroundNormal(g_vAxisY);
return m_cdr.vCenter - g_vAxisY * m_cdr.vExts.y;
}
@@ -613,6 +637,11 @@ namespace BrewMonster
//
PlayGfx(EC_Resource.res_GFXFile((int)GfxResourceType.RES_GFX_LEVELUP), null, 1f,1);//PLAYERMODEL_TYPEALL
}
bool IsPlayingAction(int iAction)
{
return m_iCurAction == iAction;
}
}
// Player appear flag
@@ -237,7 +237,7 @@ namespace BrewMonster.Scripts.Skills
public virtual int GetRequiredGenius(int idSkill) { return 0; }
// Чļ
public virtual byte[] GetEffect() { return null; }
public virtual string GetEffect() { return null; }
public static string GetEffect(uint id)
{
SkillStub stub = SkillStub.GetStub(id);
@@ -82,6 +82,30 @@ namespace BrewMonster.Scripts.Skills
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);
}
}
@@ -1,11 +1,7 @@
using BrewMonster.Network;
using BrewMonster.Scripts.Managers;
using BrewMonster.Scripts.Player;
using CSNetwork.GPDataType;
using PerfectWorld.Scripts.Task;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using CSNetwork;
using UnityEngine;
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:73d34a362e429fa75e583ca88989d3ab3d29f8d85bcdff8fa64582b7145930c2
size 530552564
oid sha256:94045fc7eb49643c229531f88aa7ac1d8a6f59d3e0d2bfb5a4939f9b3fb0ed04
size 200173095
File diff suppressed because it is too large Load Diff
-44
View File
@@ -1,44 +0,0 @@
using UnityEngine;
namespace BrewMonster.Scripts.Player
{
public class PlayerStateMachine
{
PlayerState _state;
CECHostPlayer _characterCtrl;
public PlayerState State { get => _state; }
public void InitState(PlayerState state)
{
if (_state != null)
{
Debug.LogWarning("_state is already inited");
return;
}
_state = state;
_state.Enter();
}
public void ChangeState(PlayerState state)
{
if (_state == null)
{
Debug.LogError("you need to init state first ");
return;
}
if (_state == state)
{
Debug.LogWarning("Unchanged state");
}
_state.Exit();
_state = state;
_state.Enter();
}
public void UpdateState()
{
_state.Update();
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 99f098b6660da2c4f8ff06b5043a254b
-2
View File
@@ -1,7 +1,5 @@
using Animancer;
using BrewMonster;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
@@ -1,5 +1,4 @@
using BrewMonster;
using BrewMonster.Scripts.Player;
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
File diff suppressed because one or more lines are too long