Exemple #1
0
        public static InteractionReturn Postfix(InteractionReturn __result, AdvCannonAutoloader __instance)
        {
            var   self              = __instance;
            var   ShellRackModel    = self.ShellRackModel;
            var   Node              = self.Node;
            var   interactionReturn = __result;
            float LengthCapacity    = self.LengthCapacity;

            //Debug.Log("[Walrus Shells Ballistic Madness] Autoloader UI working");
            float lengthMod = Rounding.R2(Mathf.Min(1f / Mathf.Sqrt(LengthCapacity), 1f));

            //Debug.Log("[Walrus Shells Ballistic Madness] Checking For Loaded shell...");
            if (!(ShellRackModel.LoadedShell == null))
            {
                if (ShellRackModel.ContainerCount == 0)
                {
                    lengthMod *= 1.5f;
                }

                float loadtime = ShellConstants.LoadTimeForShellVolume(new ShellModel_Propellant(ShellRackModel.LoadedShell).GetTotalVolume());
                interactionReturn.AddExtraLine(string.Format("<b>Sustained Rate of fire estimate (all):</b> {0} ", Rounding.R2(60 / (loadtime) / (ShellRackModel as ShellRackModel).MultipleDirectionsSpeedUpFactor() * (Node.ShellRacks.Racks.Count() - 1) / ShellRackModel.LoadingTimeComplexityModifier / lengthMod) + "<b>rpm</b>"));
                interactionReturn.AddExtraLine("This estimate is only accurate if all autoloaders use the same shell, and have the same magazine configuration as this one.");
                interactionReturn.AddExtraLine(string.Format("<b>Sustained Rate of fire estimate (just this):</b> {0} ", Rounding.R2(60 / (loadtime) / (ShellRackModel as ShellRackModel).MultipleDirectionsSpeedUpFactor() / ShellRackModel.LoadingTimeComplexityModifier / lengthMod) + "<b>rpm</b>"));
                interactionReturn.AddExtraLine(string.Format("<b>Ammo inputs per autoloader needed:</b> {0} ", Mathf.CeilToInt(2f / ((ShellRackModel as ShellRackModel).MultipleDirectionsSpeedUpFactor() * ShellRackModel.LoadingTimeComplexityModifier * lengthMod))));
                interactionReturn.AddExtraLine(string.Format("<b>Autoloaders total:</b> {0} ", (Node.ShellRacks.Racks.Count() - 1) + "<b> autoloaders found</b>"));
            }
            //else Debug.Log("[Walrus Shells Ballistic Madness] No Shell loaded.");

            return(interactionReturn);
        }
        public override InteractionReturn Secondary()
        {
            InteractionReturn interactionReturn = new InteractionReturn
            {
                SpecialNameField             = "PLYDataStorageBlock",
                SpecialBasicDescriptionField = "ID : " + UniqueId
            };

            interactionReturn.AddExtraLine("Press <<Q>> to settings");
            return(interactionReturn);
        }
Exemple #3
0
        public override InteractionReturn Secondary()
        {
            UpdateColor();

            InteractionReturn interactionReturn = new InteractionReturn
            {
                SpecialNameField = "StereoscopicHologram"
            };

            interactionReturn.AddExtraLine(MeshExtraLine);
            interactionReturn.AddExtraLine(MaterialExtraLine);
            interactionReturn.AddExtraLine("Press <<Q>> to settings");
            return(interactionReturn);
        }
Exemple #4
0
        public static InteractionReturn Postfix(InteractionReturn __result, AdvCannonBeltFeedAutoloader __instance)
        {
            var self              = __instance;
            var ShellRackModel    = self.ShellRackModel;
            var Node              = self.Node;
            var interactionReturn = __result;

            //Debug.Log("[Walrus Shells Ballistic Madness] Belt Autoloader UI working");
            //Debug.Log("[Walrus Shells Ballistic Madness] Checking For Loaded shell...");
            if (!(ShellRackModel.LoadedShell == null))
            {
                float loadtime = ShellConstants.LoadTimeForShellVolume(new ShellModel_Propellant(ShellRackModel.LoadedShell).GetTotalVolume());
                interactionReturn.AddExtraLine(string.Format("<b>Burst Rate of fire estimate (all):</b> {0} ", Rounding.R2(60 / (loadtime) * (Node.ShellRacks.Racks.Count() - 1) / ShellRackModel.LoadingTimeComplexityModifier / 0.2f) + "<b>rpm</b>"));
                interactionReturn.AddExtraLine("This estimate is only accurate if all autoloaders use the same shell, are beltfed, and are all loaded.");
                interactionReturn.AddExtraLine(string.Format("<b>Burst Rate of fire estimate (just this):</b> {0} ", Rounding.R2(60 / (loadtime) / ShellRackModel.LoadingTimeComplexityModifier / 0.2f) + "<b>rpm</b>"));
                interactionReturn.AddExtraLine(string.Format("<b>Autoloaders total:</b> {0} ", (Node.ShellRacks.Racks.Count() - 1) + "<b> autoloaders found</b>"));
            }
            //else Debug.Log("[Walrus Shells Ballistic Madness] No Shell loaded.");

            return(interactionReturn);
        }
Exemple #5
0
        public static InteractionReturn Postfix(InteractionReturn __result, AdvCannonFiringPiece __instance)
        {
            var self              = __instance;
            var ShellRackModel    = self.ShellRackModel;
            var Node              = self.Node;
            var interactionReturn = __result;

            const int maxClipsPerLoader = 4;

            int[] nbLoaders = new int[maxClipsPerLoader + 1];

            int nbBeltLoaders = 0;

            for (int i = 0; i < 5; i++)
            {
                nbLoaders[i] = 0;
            }

            for (int i = 1; i < self.Node.ShellRacks.Racks.Count; i++)
            {
                BeltFeedShellRackModel BeltFeed = self.Node.ShellRacks.Racks[i] as BeltFeedShellRackModel;
                if (null != BeltFeed)
                {
                    nbBeltLoaders++;
                    continue;
                }

                int NbClips = self.Node.ShellRacks.Racks[i].ContainerCount;
                if (NbClips < 0)
                {
                    continue;
                }

                if (NbClips > maxClipsPerLoader)
                {
                    NbClips = maxClipsPerLoader;
                }

                nbLoaders[NbClips]++;
            }

            for (int nbClips = 0; nbClips < (maxClipsPerLoader); nbClips++)
            {
                if (nbLoaders[nbClips] > 0)
                {
                    interactionReturn.AddExtraLine(nbLoaders[nbClips].ToString() + " autoloaders with " + nbClips.ToString() + ((1 == nbClips) ? " clip" : " clips"));
                }
            }
            if (nbLoaders[maxClipsPerLoader] > 0)
            {
                interactionReturn.AddExtraLine(nbLoaders[maxClipsPerLoader].ToString() + " autoloaders with " + maxClipsPerLoader.ToString() + " clips or more");
            }

            if (nbBeltLoaders > 0)
            {
                interactionReturn.AddExtraLine(nbBeltLoaders.ToString() + " belt feed autoloaders");
            }

            interactionReturn.AddExtraLine(self.BarrelSystem.Coolers.ToString() + " coolers. " + self.Node.nRailgunChargers + " railgun chargers and " + self.Node.nRailgunMagnets + " railgun magnets");
            //else Debug.Log("[Walrus Shells Ballistic Madness] No Shell loaded.");

            return(interactionReturn);
        }