Skip to content

Commit

Permalink
[Sonic Frontiers] Disable Sonic Boom for Regular Objects: improve acc…
Browse files Browse the repository at this point in the history
…uracy
  • Loading branch information
hyperbx committed Nov 13, 2023
1 parent 2e6ed57 commit 66b874e
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
Code "Disable Sonic Boom for Regular Objects" in "Gameplay/Skills/Sonic" by "Hyper" does "Disables the Sonic Boom skill when Sonic is targeting anything but enemies, allowing him to freely charge a Spin Dash around targetable objects."
//
#include "BlackboardStatus" noemit

#lib "GameObject"
#lib "Player"

#import "GOComponents"
//
{
if (Player.GetPlayerType() != Player.PlayerType.Sonic)
return;

var pPlayer = Player.GetPlayerData();

if (pPlayer == null)
return;

var pGOCPlayerEyesight = GameObject.GetGOC<GOCPlayerEyesight>(&pPlayer->GameObject);

if (pGOCPlayerEyesight == null)
return;

var pHomingEyesight = pGOCPlayerEyesight->GetEyesightComponent<HomingEyesight>();
var pGameObject = Player.Status.GetLockOnTarget();

if (pHomingEyesight == null)
if (pGameObject == null)
return;

if (pHomingEyesight->IsTargetEnemy())
// Target is an enemy if it has the GOCHealth component.
if (GameObject.GetGOC(pGameObject, "GOCHealth") != null)
{
Player.State.Restore<Sonic.StateID>(Sonic.StateID.StateSonicBoomKick);
}
Expand Down

0 comments on commit 66b874e

Please sign in to comment.