Make more fields public, create cloak volume manually

This commit is contained in:
Nick 2023-07-13 18:54:35 -04:00
parent 5503d2aad0
commit fbbaeb4fb6
2 changed files with 27 additions and 7 deletions

View File

@ -44,14 +44,21 @@ namespace NewHorizons.Builder.Body
Object.Destroy(newCloak.GetComponent<PlayerCloakEntryRedirector>());
var cloakFieldController = newCloak.GetComponent<CloakFieldController>();
cloakFieldController._cloakScaleDist = radius * 2000 / 3000f;
cloakFieldController._farCloakRadius = radius * 500 / 3000f;
cloakFieldController._innerCloakRadius = radius * 900 / 3000f;
cloakFieldController._nearCloakRadius = radius * 800 / 3000f;
cloakFieldController._cloakScaleDist = module.cloakScaleDist ?? (radius * 2000 / 3000f);
cloakFieldController._farCloakRadius = module.farCloakRadius ?? (radius * 500 / 3000f);
cloakFieldController._innerCloakRadius = module.innerCloakRadius ?? (radius * 900 / 3000f);
cloakFieldController._nearCloakRadius = module.nearCloakRadius ?? (radius * 800 / 3000f);
cloakFieldController._referenceFrameVolume = OWRB._attachedRFVolume;
cloakFieldController._exclusionSector = null;
cloakFieldController._cloakSphereVolume = (sector?.transform ?? planetGO.transform).GetComponentInChildren<OWTriggerVolume>();
var cloakVolumeObj = new GameObject("CloakVolume");
cloakVolumeObj.transform.parent = planetGO.transform;
cloakVolumeObj.transform.localPosition = Vector3.zero;
var cloakVolume = cloakVolumeObj.AddComponent<SphereShape>();
cloakVolume.radius = module.farCloakRadius ?? (radius * 500 / 3000f);
cloakFieldController._cloakSphereVolume = cloakVolumeObj.AddComponent<OWTriggerVolume>();
cloakFieldController._ringworldFadeRenderers = new OWRenderer[0];
var cloakSectorController = newCloak.AddComponent<CloakSectorController>();

View File

@ -7,11 +7,24 @@ namespace NewHorizons.External.Modules
public class CloakModule
{
/// <summary>
/// Radius of the cloaking field around the planet. It's a bit finicky so experiment with different values. If you
/// don't want a cloak, leave this as 0.
/// Radius of the cloaking field around the planet. For the Stranger this is 3000
/// </summary>
public float radius;
/// <summary>
/// Not sure what this is. For the Stranger it is 2000. Optional (will default to be proportional to the cloak radius).
/// </summary>
public float? cloakScaleDist;
/// Not sure what this is. For the Stranger it is 900. Optional (will default to be proportional to the cloak radius).
public float? innerCloakRadius;
/// Not sure what this is. For the Stranger it is 800. Optional (will default to be proportional to the cloak radius).
public float? nearCloakRadius;
/// Not sure what this is. For the Stranger it is 500. Optional (will default to be proportional to the cloak radius).
public float? farCloakRadius;
[Obsolete("audioClip is deprecated, please use audio instead")]
public string audioClip;