2022-03-24 20:36:13 +00:00
|
|
|
|
using OWML.Common;
|
|
|
|
|
using QSB.CampfireSync.WorldObjects;
|
2022-03-24 15:02:31 +00:00
|
|
|
|
using QSB.ItemSync.WorldObjects.Items;
|
|
|
|
|
using QSB.RoastingSync;
|
|
|
|
|
using QSB.Tools;
|
|
|
|
|
using QSB.Tools.FlashlightTool;
|
|
|
|
|
using QSB.Tools.ProbeLauncherTool;
|
2022-04-16 09:08:59 +00:00
|
|
|
|
using QSB.Tools.ProbeLauncherTool.WorldObjects;
|
2022-03-24 15:02:31 +00:00
|
|
|
|
using QSB.Tools.ProbeTool;
|
2022-03-24 20:35:49 +00:00
|
|
|
|
using QSB.Utility;
|
2022-03-24 15:02:31 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace QSB.Player;
|
|
|
|
|
|
|
|
|
|
public partial class PlayerInfo
|
|
|
|
|
{
|
|
|
|
|
public GameObject ProbeBody { get; set; }
|
2022-08-27 18:30:15 +00:00
|
|
|
|
public QSBSurveyorProbe Probe { get; set; }
|
2022-03-24 15:02:31 +00:00
|
|
|
|
public QSBFlashlight FlashLight => CameraBody == null ? null : CameraBody.GetComponentInChildren<QSBFlashlight>();
|
|
|
|
|
public QSBTool Signalscope => GetToolByType(ToolType.Signalscope);
|
|
|
|
|
public QSBTool Translator => GetToolByType(ToolType.Translator);
|
2022-04-16 09:08:59 +00:00
|
|
|
|
public QSBProbeLauncherTool ProbeLauncherTool => (QSBProbeLauncherTool)GetToolByType(ToolType.ProbeLauncher);
|
2022-03-24 15:02:31 +00:00
|
|
|
|
private Transform _handPivot;
|
|
|
|
|
public Transform HandPivot
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_handPivot == null)
|
|
|
|
|
{
|
|
|
|
|
_handPivot = Body.transform.Find(
|
|
|
|
|
// TODO : kill me for my sins
|
|
|
|
|
"REMOTE_Traveller_HEA_Player_v2/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_Trajectory_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_ROOT_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_Spine_01_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_Spine_02_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_Spine_Top_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_RT_Arm_Clavicle_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_RT_Arm_Shoulder_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_RT_Arm_Elbow_Jnt/" +
|
|
|
|
|
"Traveller_Rig_v01:Traveller_RT_Arm_Wrist_Jnt/" +
|
|
|
|
|
"REMOTE_ItemCarryTool/" +
|
|
|
|
|
"HandPivot"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _handPivot;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-24 20:35:49 +00:00
|
|
|
|
public Transform ItemSocket => GetSocket("REMOTE_ItemSocket");
|
|
|
|
|
public Transform ScrollSocket => GetSocket("REMOTE_ScrollSocket");
|
|
|
|
|
public Transform SharedStoneSocket => GetSocket("REMOTE_SharedStoneSocket");
|
|
|
|
|
public Transform WarpCoreSocket => GetSocket("REMOTE_WarpCoreSocket");
|
|
|
|
|
public Transform VesselCoreSocket => GetSocket("REMOTE_VesselCoreSocket");
|
|
|
|
|
public Transform SimpleLanternSocket => GetSocket("REMOTE_SimpleLanternSocket");
|
|
|
|
|
public Transform DreamLanternSocket => GetSocket("REMOTE_DreamLanternSocket");
|
|
|
|
|
public Transform SlideReelSocket => GetSocket("REMOTE_SlideReelSocket");
|
|
|
|
|
public Transform VisionTorchSocket => GetSocket("REMOTE_VisionTorchSocket");
|
|
|
|
|
|
|
|
|
|
private Transform GetSocket(string name)
|
|
|
|
|
{
|
|
|
|
|
var handSocket = HandPivot.Find(name);
|
|
|
|
|
if (handSocket != null)
|
|
|
|
|
{
|
|
|
|
|
return handSocket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var cameraSocket = CameraBody.transform.Find("REMOTE_ItemCarryTool").Find(name);
|
|
|
|
|
if (cameraSocket != null)
|
|
|
|
|
{
|
|
|
|
|
DebugLog.ToConsole($"Warning - Could not find hand socket for socket name {name}, defaulting to camera socket.", MessageType.Warning);
|
|
|
|
|
return cameraSocket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DebugLog.ToConsole($"Error - Could not find hand socket or camera socket for socket name {name}.", MessageType.Error);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-24 15:02:31 +00:00
|
|
|
|
public QSBMarshmallow Marshmallow { get; set; }
|
|
|
|
|
public QSBCampfire Campfire { get; set; }
|
|
|
|
|
public IQSBItem HeldItem { get; set; }
|
|
|
|
|
public bool FlashlightActive { get; set; }
|
|
|
|
|
public bool SuitedUp { get; set; }
|
2022-04-16 09:08:59 +00:00
|
|
|
|
public bool LocalProbeLauncherEquipped { get; set; }
|
2022-03-24 15:02:31 +00:00
|
|
|
|
public bool SignalscopeEquipped { get; set; }
|
|
|
|
|
public bool TranslatorEquipped { get; set; }
|
|
|
|
|
public bool ProbeActive { get; set; }
|
|
|
|
|
public GameObject RoastingStick { get; set; }
|
2022-04-16 09:08:59 +00:00
|
|
|
|
public QSBProbeLauncher ProbeLauncherEquipped { get; set; }
|
2022-07-01 09:48:30 +00:00
|
|
|
|
public bool IsTranslating { get; set; }
|
2022-03-24 15:02:31 +00:00
|
|
|
|
}
|