Skip to content

Commit

Permalink
Fix issues with Sly fight
Browse files Browse the repository at this point in the history
  • Loading branch information
Extremelyd1 committed Jul 15, 2024
1 parent f27d3fa commit c248c55
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
40 changes: 40 additions & 0 deletions HKMP/Game/Client/Entity/Action/EntityFsmActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CircleCollider2D>();
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<PolygonCollider2D>();
if (collider != null) {
collider.enabled = action.active.Value;
}
}

#endregion

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion HKMP/Resource/entity-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,10 @@
{
"base_object_name": "Sly Boss",
"type": "Sly",
"fsm_name": "Control"
"fsm_name": "Control",
"components": [
"GravityScale"
]
},
{
"base_object_name": "HK Prime",
Expand Down

0 comments on commit c248c55

Please sign in to comment.