mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-10 16:14:45 +00:00
update ghosts and profile manager
This commit is contained in:
parent
f915da215d
commit
81f12fe1ed
@ -56,7 +56,11 @@ public class QSBIdentifyIntruderAction : QSBGhostAction
|
||||
return -100f;
|
||||
}
|
||||
|
||||
if (_running || (_data.interestedPlayer.sensor.isPlayerHeldLanternVisible && (_data.threatAwareness > GhostData.ThreatAwareness.EverythingIsNormal || _data.interestedPlayer.playerLocation.distance < 20f)) || _data.interestedPlayer.sensor.isIlluminatedByPlayer)
|
||||
if (_running
|
||||
|| (_data.interestedPlayer.sensor.isPlayerHeldLanternVisible
|
||||
&& (_data.threatAwareness > GhostData.ThreatAwareness.EverythingIsNormal || _data.interestedPlayer.playerLocation.distance < 20f)
|
||||
&& _controller.AttachedObject.GetNodeMap().CheckLocalPointInBounds(_data.interestedPlayer.playerLocation.localPosition))
|
||||
|| _data.interestedPlayer.sensor.isIlluminatedByPlayer)
|
||||
{
|
||||
return 80f;
|
||||
}
|
||||
|
@ -37,8 +37,7 @@ public class QSBStalkAction : QSBGhostAction
|
||||
{
|
||||
var flag = _data.interestedPlayer.player.AssignedSimulationLantern.AttachedObject.GetLanternController().IsConcealed();
|
||||
_wasPlayerLanternConcealed = flag;
|
||||
_isFocusingLight = flag;
|
||||
_shouldFocusLightOnPlayer = flag;
|
||||
_isFocusingLight = _shouldFocusLightOnPlayer = flag || !_data.interestedPlayer.sensor.isPlayerHoldingLantern;
|
||||
_changeFocusTime = 0f;
|
||||
_controller.ChangeLanternFocus(_isFocusingLight ? 1f : 0f, 2f);
|
||||
_controller.SetLanternConcealed(!_isFocusingLight, true);
|
||||
@ -80,15 +79,16 @@ public class QSBStalkAction : QSBGhostAction
|
||||
&& _data.interestedPlayer.wasPlayerLocationKnown;
|
||||
|
||||
_wasPlayerLanternConcealed = isPlayerLanternConcealed;
|
||||
if (sawPlayerLanternConceal && !_shouldFocusLightOnPlayer)
|
||||
var flag3 = (!_data.interestedPlayer.sensor.isPlayerHoldingLantern && _data.interestedPlayer.wasPlayerLocationKnown) || _data.interestedPlayer.sensor.isPlayerDroppedLanternVisible;
|
||||
if ((sawPlayerLanternConceal || flag3) && !_shouldFocusLightOnPlayer)
|
||||
{
|
||||
_shouldFocusLightOnPlayer = true;
|
||||
_changeFocusTime = Time.time + 1f;
|
||||
_changeFocusTime = Time.time + 0.5f;
|
||||
}
|
||||
else if (_data.interestedPlayer.sensor.isPlayerHeldLanternVisible && _shouldFocusLightOnPlayer)
|
||||
{
|
||||
_shouldFocusLightOnPlayer = false;
|
||||
_changeFocusTime = Time.time + 1f;
|
||||
_changeFocusTime = Time.time + 0.5f;
|
||||
}
|
||||
|
||||
if (_isFocusingLight != _shouldFocusLightOnPlayer && Time.time > _changeFocusTime)
|
||||
|
@ -81,12 +81,15 @@ internal class GhostPartyPathDirectorPatches : QSBPatch
|
||||
ghostBrain.AttachedObject.transform.eulerAngles = Vector3.up * __instance._ghostSpawns[Random.Range(0, __instance._ghostSpawns.Length)].spawnTransform.eulerAngles.y;
|
||||
ghostBrain.TabulaRasa();
|
||||
partyPathAction.ResetPath();
|
||||
if (__instance._numEnabledGhostProxies < __instance._ghostFinalDestinations.Length && __instance._ghostFinalDestinations[__instance._numEnabledGhostProxies].proxyGhost != null)
|
||||
if (!__instance._disableGhostProxies && __instance._numEnabledGhostProxies < __instance._ghostFinalDestinations.Length)
|
||||
{
|
||||
__instance._ghostFinalDestinations[__instance._numEnabledGhostProxies].proxyGhost.gameObject.SetActive(true);
|
||||
if (__instance._ghostFinalDestinations[__instance._numEnabledGhostProxies].proxyGhost != null)
|
||||
{
|
||||
__instance._ghostFinalDestinations[__instance._numEnabledGhostProxies].proxyGhost.Reveal();
|
||||
}
|
||||
__instance._numEnabledGhostProxies++;
|
||||
}
|
||||
|
||||
__instance._numEnabledGhostProxies++;
|
||||
__instance._waitingGhosts.Add(ghostBrain.AttachedObject);
|
||||
}
|
||||
}
|
||||
|
@ -79,20 +79,30 @@ public class QSBGhostEffects : WorldObject<GhostEffects>, IGhostObject
|
||||
|
||||
var relativeVelocity = AttachedObject._controller.GetRelativeVelocity();
|
||||
var num = (AttachedObject._movementStyle == GhostEffects.MovementStyle.Chase) ? 8f : 2f;
|
||||
var targetValue = new Vector2(relativeVelocity.x / num, relativeVelocity.z / num);
|
||||
float num2 = new Vector2(relativeVelocity.y, relativeVelocity.z).magnitude * Mathf.Sign(relativeVelocity.z);
|
||||
Vector2 targetValue = new Vector2(relativeVelocity.x / num, num2 / num);
|
||||
AttachedObject._smoothedMoveSpeed = AttachedObject._moveSpeedSpring.Update(AttachedObject._smoothedMoveSpeed, targetValue, Time.deltaTime);
|
||||
AttachedObject._animator.SetFloat(GhostEffects.AnimatorKeys.Float_MoveDirectionX, AttachedObject._smoothedMoveSpeed.x);
|
||||
AttachedObject._animator.SetFloat(GhostEffects.AnimatorKeys.Float_MoveDirectionY, AttachedObject._smoothedMoveSpeed.y);
|
||||
|
||||
float num3 = Vector3.SignedAngle(new Vector3(relativeVelocity.x, 0f, relativeVelocity.z), relativeVelocity, Vector3.left);
|
||||
float targetValue2 = Mathf.Clamp(num3 / 30f, -1f, 1f);
|
||||
if (num3 > 15f && AttachedObject._controller.IsApproachingEndOfIncline())
|
||||
{
|
||||
targetValue2 = 0f;
|
||||
}
|
||||
AttachedObject._smoothedMoveSlope = AttachedObject._moveSlopeSpring.Update(AttachedObject._smoothedMoveSlope, targetValue2, Time.deltaTime);
|
||||
AttachedObject._animator.SetFloat(GhostEffects.AnimatorKeys.Float_MoveSlope, AttachedObject._smoothedMoveSlope);
|
||||
|
||||
AttachedObject._smoothedTurnSpeed = AttachedObject._turnSpeedSpring.Update(AttachedObject._smoothedTurnSpeed, AttachedObject._controller.GetAngularVelocity() / 90f, Time.deltaTime);
|
||||
AttachedObject._animator.SetFloat(GhostEffects.AnimatorKeys.Float_TurnSpeed, AttachedObject._smoothedTurnSpeed);
|
||||
|
||||
var target = _data.isIlluminated ? 1f : 0f;
|
||||
var num2 = _data.isIlluminated ? 8f : 0.8f;
|
||||
AttachedObject._eyeGlow = Mathf.MoveTowards(AttachedObject._eyeGlow, target, Time.deltaTime * num2);
|
||||
var num4 = _data.isIlluminated ? 8f : 0.8f;
|
||||
AttachedObject._eyeGlow = Mathf.MoveTowards(AttachedObject._eyeGlow, target, Time.deltaTime * num4);
|
||||
var closestPlayer = QSBPlayerManager.GetClosestPlayerToWorldPoint(AttachedObject.transform.position, true);
|
||||
var num3 = (closestPlayer?.AssignedSimulationLantern?.AttachedObject?.GetLanternController()?.GetLight()?.GetFlickerScale() - 1f + 0.07f) / 0.14f ?? 0;
|
||||
num3 = Mathf.Lerp(0.7f, 1f, num3);
|
||||
var num5 = (closestPlayer?.AssignedSimulationLantern?.AttachedObject?.GetLanternController()?.GetLight()?.GetFlickerScale() - 1f + 0.07f) / 0.14f ?? 0;
|
||||
num5 = Mathf.Lerp(0.7f, 1f, num5);
|
||||
AttachedObject.SetEyeGlow(AttachedObject._eyeGlow * num3);
|
||||
|
||||
if (AttachedObject._playingDeathSequence)
|
||||
|
@ -46,8 +46,10 @@ public class QSBGhostSensors : WorldObject<GhostSensors>, IGhostObject
|
||||
}
|
||||
|
||||
public bool CanGrabPlayer(GhostPlayer player)
|
||||
=> !PlayerState.IsAttached()
|
||||
=> !PlayerState.IsAttached() // TODO : check for each player
|
||||
&& player.playerLocation.distanceXZ < 2f + AttachedObject._grabDistanceBuff
|
||||
&& player.playerLocation.toPosition.y > -2f
|
||||
&& player.playerLocation.toPosition.y < 3f
|
||||
&& player.playerLocation.degreesToPositionXZ < 20f + AttachedObject._grabAngleBuff
|
||||
&& AttachedObject._animator.GetFloat("GrabWindow") > 0.5f;
|
||||
|
||||
|
@ -278,7 +278,7 @@ internal class QSBStandaloneProfileManager : IProfileManager
|
||||
Debug.LogError("Could not find graphics settings for " + profile.profileName);
|
||||
}
|
||||
|
||||
if (inputJSON == "")
|
||||
if (string.IsNullOrEmpty(inputJSON))
|
||||
{
|
||||
profile.brokenRebindingData = File.Exists(inputsPath);
|
||||
inputJSON = ((InputManager)OWInput.SharedInputManager).commandManager.DefaultInputActions.ToJson();
|
||||
|
Loading…
x
Reference in New Issue
Block a user