Exemplo n.º 1
0
        public void BroadcastArmAction(TechType techType, IExosuitArm exosuitArm, ExosuitArmAction armAction)
        {
            NitroxId id = NitroxEntity.GetId(exosuitArm.GetGameObject());
            ExosuitArmActionPacket packet = new ExosuitArmActionPacket(techType, id, armAction, Optional <Vector3> .Empty(), Optional <Quaternion> .Empty());

            packetSender.Send(packet);
        }
        public static bool Prefix(Exosuit __instance, ref bool hasPropCannon)
        {
            IExosuitArm exosuitArmLeft = __instance.leftArmAttach.GetComponentInChildren <IExosuitArm>();

            if (exosuitArmLeft.GetGameObject().TryGetComponent(out ArmTag armTagLeft))
            {
                if (armTagLeft.armTemplate == ArmTemplate.PropulsionArm)
                {
                    hasPropCannon = true;
                    return(true);
                }
            }

            IExosuitArm exosuitArmRight = __instance.rightArmAttach.GetComponentInChildren <IExosuitArm>();

            if (exosuitArmRight.GetGameObject().TryGetComponent(out ArmTag armTagRight))
            {
                if (armTagRight.armTemplate == ArmTemplate.PropulsionArm)
                {
                    hasPropCannon = true;
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        public void BroadcastArmAction(TechType techType, IExosuitArm exosuitArm, ExosuitArmAction armAction)
        {
            NitroxId id = NitroxEntity.GetId(exosuitArm.GetGameObject());
            ExosuitArmActionPacket packet = new ExosuitArmActionPacket(techType, id, armAction, null, null);

            packetSender.Send(packet);
        }
Exemplo n.º 4
0
        public void BroadcastArmAction(TechType techType, IExosuitArm exosuitArm, ExosuitArmAction armAction, Vector3?opVector, Quaternion?opRotation)
        {
            NitroxId id = NitroxEntity.GetId(exosuitArm.GetGameObject());
            ExosuitArmActionPacket packet = new ExosuitArmActionPacket(techType, id, armAction, opVector, opRotation);

            packetSender.Send(packet);
        }
Exemplo n.º 5
0
        public void BroadcastArmAction(TechType techType, IExosuitArm exosuitArm, ExosuitArmAction armAction, Optional <Vector3> opVector = null, Optional <Quaternion> opRotation = null)
        {
            string guid = GuidHelper.GetGuid(exosuitArm.GetGameObject());
            ExosuitArmActionPacket packet = new ExosuitArmActionPacket(techType, guid, armAction, opVector, opRotation);

            packetSender.Send(packet);
        }
Exemplo n.º 6
0
        public void BroadcastArmAction(TechType techType, IExosuitArm exosuitArm, ExosuitArmAction armAction, Optional <Vector3> opVector = null, Optional <Quaternion> opRotation = null)
        {
            NitroxId id = NitroxIdentifier.GetId(exosuitArm.GetGameObject());
            ExosuitArmActionPacket packet = new ExosuitArmActionPacket(techType, id, armAction, opVector, opRotation);

            packetSender.Send(packet);
        }
Exemplo n.º 7
0
 public void ResetArms()
 {
     foreach (var fieldName in ExosuitArmsStatics.ExosuitArmFieldNames)
     {
         IExosuitArm exosuitArm = GetIExosuitArm(fieldName);
         if (exosuitArm != null)
         {
             exosuitArm.Reset();
         }
     }
 }
Exemplo n.º 8
0
        static bool Prefix(Exosuit __instance, TechType techType, Transform parent, ref IExosuitArm __result)
        {
            if (techType != GrapplingArmUpgradeModule.TechType)
            {
                return(true);
            }

            __result = __instance.SpawnArm(TechType.ExosuitGrapplingArmModule, parent);
            __result.GetGameObject().AddComponent <GrapplingArmUpgraded>();

            return(false);
        }
Exemplo n.º 9
0
        public void ResetArms()
        {
            foreach (var fieldName in ExosuitArmsStatics.ExosuitArmFieldNames)
            {
                IExosuitArm exosuitArm = GetIExosuitArm(fieldName);
                if (exosuitArm != null)
#if SUBNAUTICA_STABLE
                { exosuitArm.Reset(); }
#elif BELOWZERO
                { exosuitArm.ResetArm(); }
#endif
            }
        }
Exemplo n.º 10
0
        public void SpawnedArm(Exosuit exosuit)
        {
            string       Guid         = GuidHelper.GetGuid(exosuit.gameObject);
            ExosuitModel exosuitModel = vehicles.GetVehicles <ExosuitModel>(Guid);

            IExosuitArm rightArm = (IExosuitArm)exosuit.ReflectionGet("rightArm");
            IExosuitArm leftArm  = (IExosuitArm)exosuit.ReflectionGet("leftArm");

            try
            {
                GameObject rightArmGameObject = rightArm.GetGameObject();
                rightArmGameObject.SetNewGuid(exosuitModel.RightArmGuid);
                GameObject leftArmGameObject = leftArm.GetGameObject();
                leftArmGameObject.SetNewGuid(exosuitModel.LeftArmGuid);
            } catch (Exception e)
            {
                Log.Warn("Got error setting arm GameObjects. This is probably due to docking sync and can be ignored\nErromessage: " + e.Message + "\n" + e.StackTrace);
            }
            Log.Debug("Spawn exosuit arms for: " + Guid);
        }
Exemplo n.º 11
0
        public void SpawnedArm(Exosuit exosuit)
        {
            NitroxId     id           = NitroxEntity.GetId(exosuit.gameObject);
            ExosuitModel exosuitModel = vehicles.GetVehicles <ExosuitModel>(id);

            IExosuitArm rightArm = exosuit.rightArm;
            IExosuitArm leftArm  = exosuit.leftArm;

            try
            {
                GameObject rightArmGameObject = rightArm.GetGameObject();
                NitroxEntity.SetNewId(rightArmGameObject, exosuitModel.RightArmId);

                GameObject leftArmGameObject = leftArm.GetGameObject();
                NitroxEntity.SetNewId(leftArmGameObject, exosuitModel.LeftArmId);
            }
            catch (Exception e)
            {
                Log.Warn("Got error setting arm GameObjects. This is probably due to docking sync and can be ignored\nErromessage: " + e.Message + "\n" + e.StackTrace);
            }

            Log.Debug("Spawn exosuit arms for: " + id);
        }
 public static void Postfix(Exosuit __instance, TechType techType, Transform parent, ref IExosuitArm __result)
 {
     if (Main.graphics.ModdedArmPrefabs.ContainsKey(techType))
     {
         __result.GetGameObject().SetActive(true);
     }
 }