r2mods/ilspy_dump/ror2_csproj/EntityStates.Seeker/SeekerInitialWeaponState.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using RoR2.Skills;
using RoR2.UI;
namespace EntityStates.Seeker;
public class SeekerInitialWeaponState : BaseState
{
public override void OnEnter()
{
base.OnEnter();
GenericSkill genericSkill = base.skillLocator.FindSkillByFamilyName("SeekerBodyPrimaryFamily");
if (genericSkill == null)
{
outer.SetNextStateToMain();
return;
}
SeekerWeaponSkillDef seekerWeaponSkillDef = genericSkill.skillDef as SeekerWeaponSkillDef;
if (seekerWeaponSkillDef == null)
{
outer.SetNextStateToMain();
return;
}
HandleCrosshair(seekerWeaponSkillDef);
HandleTargetTracking(seekerWeaponSkillDef);
outer.SetNextStateToMain();
}
private void HandleTargetTracking(SeekerWeaponSkillDef seekerWeapon)
{
HuntressTracker component = GetComponent<HuntressTracker>();
if (!(component == null))
{
component.enabled = seekerWeapon.targetTrackingIndicator;
}
}
private void HandleCrosshair(SeekerWeaponSkillDef seekerWeapon)
{
CrosshairUtils.RequestOverrideForBody(base.characterBody, seekerWeapon.crosshairOverridePrefab, CrosshairUtils.OverridePriority.Skill);
}
}