From c248c55d45b7ac6cbb6e8d36d0a3f39db8ad05fe Mon Sep 17 00:00:00 2001 From: Extremelyd1 <10898310+Extremelyd1@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:48:43 +0200 Subject: [PATCH] Fix issues with Sly fight --- .../Client/Entity/Action/EntityFsmActions.cs | 40 +++++++++++++++++++ HKMP/Resource/entity-registry.json | 5 ++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/HKMP/Game/Client/Entity/Action/EntityFsmActions.cs b/HKMP/Game/Client/Entity/Action/EntityFsmActions.cs index 6103487..8b2e032 100644 --- a/HKMP/Game/Client/Entity/Action/EntityFsmActions.cs +++ b/HKMP/Game/Client/Entity/Action/EntityFsmActions.cs @@ -2967,6 +2967,46 @@ private static void ApplyNetworkDataFromAction(EntityNetworkData data, SendMessa } } + #endregion + + #region SetCircleCollider + + private static bool GetNetworkDataFromAction(EntityNetworkData data, SetCircleCollider action) { + return action.gameObject != null; + } + + private static void ApplyNetworkDataFromAction(EntityNetworkData data, SetCircleCollider action) { + var gameObject = action.Fsm.GetOwnerDefaultTarget(action.gameObject); + if (gameObject == null) { + return; + } + + var collider = gameObject.GetComponent(); + if (collider != null) { + collider.enabled = action.active.Value; + } + } + + #endregion + + #region SetPolygonCollider + + private static bool GetNetworkDataFromAction(EntityNetworkData data, SetPolygonCollider action) { + return action.gameObject != null; + } + + private static void ApplyNetworkDataFromAction(EntityNetworkData data, SetPolygonCollider action) { + var gameObject = action.Fsm.GetOwnerDefaultTarget(action.gameObject); + if (gameObject == null) { + return; + } + + var collider = gameObject.GetComponent(); + if (collider != null) { + collider.enabled = action.active.Value; + } + } + #endregion /// diff --git a/HKMP/Resource/entity-registry.json b/HKMP/Resource/entity-registry.json index 5c88ee3..d971e1e 100644 --- a/HKMP/Resource/entity-registry.json +++ b/HKMP/Resource/entity-registry.json @@ -1303,7 +1303,10 @@ { "base_object_name": "Sly Boss", "type": "Sly", - "fsm_name": "Control" + "fsm_name": "Control", + "components": [ + "GravityScale" + ] }, { "base_object_name": "HK Prime",