Skip to content

Commit

Permalink
fix atk sound repeat, atk range error threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Jul 15, 2024
1 parent 395e0be commit f0d6d2c
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 139 deletions.
246 changes: 123 additions & 123 deletions l2-unity/Assets/Scenes/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -123,56 +123,7 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &413261805
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 413261807}
- component: {fileID: 413261806}
m_Layer: 0
m_Name: Global Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &413261806
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413261805}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 2606cb68fb3b8fa44b4cbf69f8fdc10e, type: 2}
--- !u!4 &413261807
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413261805}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4697.06, y: -65.2639, z: -1535.9979}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &417552713
--- !u!21 &197917878
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -241,6 +192,55 @@ Material:
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!1 &413261805
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 413261807}
- component: {fileID: 413261806}
m_Layer: 0
m_Name: Global Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &413261806
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413261805}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 2606cb68fb3b8fa44b4cbf69f8fdc10e, type: 2}
--- !u!4 &413261807
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413261805}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4697.06, y: -65.2639, z: -1535.9979}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &461980325
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -318,6 +318,41 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
--- !u!21 &487790708
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!1 &803395386
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -707,7 +742,7 @@ PrefabInstance:
- target: {fileID: 14083907825353274, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 1596745618}
objectReference: {fileID: 487790708}
- target: {fileID: 2134954596300280144, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3}
propertyPath: m_Name
value: Height Fog Global
Expand Down Expand Up @@ -902,6 +937,41 @@ Material:
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!21 &1487777543
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!1 &1592191233
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1066,76 +1136,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &1596745618
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!21 &1614989837
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!1001 &521792339377878846
PrefabInstance:
m_ObjectHideFlags: 0
Expand All @@ -1146,15 +1146,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 2808076256991555282, guid: babd2d27777f4774581e9efa23af7856, type: 3}
propertyPath: _logSentPackets
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2808076256991555282, guid: babd2d27777f4774581e9efa23af7856, type: 3}
propertyPath: _logCryptography
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2808076256991555282, guid: babd2d27777f4774581e9efa23af7856, type: 3}
propertyPath: _logReceivedPackets
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2902492874257817939, guid: babd2d27777f4774581e9efa23af7856, type: 3}
propertyPath: m_LocalPosition.x
Expand Down
8 changes: 0 additions & 8 deletions l2-unity/Assets/Scripts/Animation/Player/PlayerStateAtk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInf
return;
}

if (!moved) {
if ((stateInfo.normalizedTime - _lastNormalizedTime) >= 1f) {
_lastNormalizedTime = stateInfo.normalizedTime;
PlaySoundAtRatio(CharacterSoundEvent.Atk_1H, _audioHandler.AtkRatio);
PlaySoundAtRatio(ItemSoundEvent.sword_small, _audioHandler.SwishRatio);
}
}

SetBool("atkwait_" + _weaponAnim, false, false);
SetBool("atk01_" + _weaponAnim, false, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ void Update() {
}

public void SetState(PlayerState state) {
Debug.Log($"[StateMachine] New state: {state}");
// Debug.Log($"[StateMachine] New state: {state}");
_state = state;
}

public void SetWaitingForServerReply(bool value) {
Debug.LogWarning($"[StateMachine] Waiting for server reply: {value}");
// Debug.LogWarning($"[StateMachine] Waiting for server reply: {value}");
_waitingForServerReply = value;
}

Expand All @@ -57,7 +57,7 @@ public void SetWaitingForServerReply(bool value) {
public void notifyEvent(Event evt) {
if (evt != Event.THINK) {
_lastEvent = evt;
Debug.Log($"[StateMachine] New event: {evt}");
// Debug.Log($"[StateMachine] New event: {evt}");
}

notifyEvent(evt, null);
Expand Down Expand Up @@ -212,7 +212,7 @@ public void setIntention(Intention intention) {
}

public void setIntention(Intention intention, object arg0) {
Debug.Log($"[StateMachine] New intention: {intention}");
// Debug.Log($"[StateMachine] New intention: {intention}");

_intention = intention;

Expand Down Expand Up @@ -249,10 +249,12 @@ private void onIntentionAttack(Entity entity) {
float distance = Vector3.Distance(transform.position, target.position);
Debug.Log($"target: {target} distance: {distance} range: {attackRange}");

if (distance <= attackRange && !_waitingForServerReply) {
// Is close enough? Is player already waiting for server reply?
if (distance <= attackRange * 0.9f && !_waitingForServerReply) {
notifyEvent(Event.READY_TO_ACT);
} else {
PathFinderController.Instance.MoveTo(target.position, ((PlayerStats)PlayerEntity.Instance.Stats).AttackRange);
// Move to target with a 10% error margin
PathFinderController.Instance.MoveTo(target.position, ((PlayerStats)PlayerEntity.Instance.Stats).AttackRange * 0.9f);
}
}
}
Expand Down Expand Up @@ -288,7 +290,7 @@ public bool CanMove() {


public void OnReachingTarget() {
Debug.Log("On Reaching Target");
// Debug.Log("On Reaching Target");
PathFinderController.Instance.ClearPath();
PlayerController.Instance.ResetDestination();

Expand Down
2 changes: 1 addition & 1 deletion l2-unity/Assets/Scripts/Game/Manager/WorldCombat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void ParticleImpact(Transform attacker, Transform target) {
}

public void StatusUpdate(Entity entity, List<Attribute> attributes) {
Debug.Log("Word combat: Status update");
// Debug.Log("Word combat: Status update");
Status status = entity.Status;
Stats stats = entity.Stats;

Expand Down

0 comments on commit f0d6d2c

Please sign in to comment.