Beispiel #1
0
        public static PLWarpDrive CreateWarpDrive(int Subtype, int level)
        {
            PLWarpDrive InWarpDrive;

            if (Subtype >= Instance.VanillaWarpDriveMaxType)
            {
                InWarpDrive = new PLWarpDrive(EWarpDriveType.E_MAX, level);
                int subtypeformodded = Subtype - Instance.VanillaWarpDriveMaxType;
                if (subtypeformodded <= Instance.WarpDriveTypes.Count && subtypeformodded > -1)
                {
                    WarpDriveMod WarpDriveType = Instance.WarpDriveTypes[Subtype - Instance.VanillaWarpDriveMaxType];
                    InWarpDrive.SubType                       = Subtype;
                    InWarpDrive.Name                          = WarpDriveType.Name;
                    InWarpDrive.Desc                          = WarpDriveType.Description;
                    InWarpDrive.m_IconTexture                 = WarpDriveType.IconTexture;
                    InWarpDrive.ChargeSpeed                   = WarpDriveType.ChargeSpeed;
                    InWarpDrive.WarpRange                     = WarpDriveType.WarpRange;
                    InWarpDrive.EnergySignatureAmt            = WarpDriveType.EnergySignature;
                    InWarpDrive.NumberOfChargingNodes         = WarpDriveType.NumberOfChargesPerFuel;
                    InWarpDrive.m_MaxPowerUsage_Watts         = WarpDriveType.MaxPowerUsage_Watts;
                    InWarpDrive.m_MarketPrice                 = WarpDriveType.MarketPrice;
                    InWarpDrive.CargoVisualPrefabID           = WarpDriveType.CargoVisualID;
                    InWarpDrive.CanBeDroppedOnShipDeath       = WarpDriveType.CanBeDroppedOnShipDeath;
                    InWarpDrive.Experimental                  = WarpDriveType.Experimental;
                    InWarpDrive.Unstable                      = WarpDriveType.Unstable;
                    InWarpDrive.Contraband                    = WarpDriveType.Contraband;
                    InWarpDrive.Price_LevelMultiplierExponent = WarpDriveType.Price_LevelMultiplierExponent;
                }
            }
            else
            {
                InWarpDrive = new PLWarpDrive((EWarpDriveType)Subtype, level);
            }
            return(InWarpDrive);
        }
Beispiel #2
0
        static void Postfix(PLWarpDrive __instance, ref string __result)
        {
            int subtypeformodded = __instance.SubType - WarpDriveModManager.Instance.VanillaWarpDriveMaxType;

            if (subtypeformodded > -1 && subtypeformodded < WarpDriveModManager.Instance.WarpDriveTypes.Count && __instance.ShipStats != null)
            {
                __result = WarpDriveModManager.Instance.WarpDriveTypes[subtypeformodded].GetStatLineRight(__instance);
            }
        }
        public override string GetStatLineRight(PLShipComponent InComp)
        {
            PLWarpDrive me = InComp as PLWarpDrive;

            return(string.Concat(new string[]
            {
                (me.ChargeSpeed * me.LevelMultiplier(0.25f, 1f)).ToString("0"),
                "\n",
                (me.WarpRange * 100f * me.LevelMultiplier(0.2f, 1f)).ToString("0"),
                "\n",
                me.NumberOfChargingNodes.ToString("0")
            }));
        }
Beispiel #4
0
        public static PLWarpDrive CreateWarpDrive(int Subtype, int level)
        {
            PLWarpDrive InWarpDrive;

            if (Subtype >= Instance.VanillaWarpDriveMaxType)
            {
                InWarpDrive = new PLWarpDrive(EWarpDriveType.E_MAX, level);
                int subtypeformodded = Subtype - Instance.VanillaWarpDriveMaxType;
                if (Global.DebugLogging)
                {
                    Logger.Info($"Subtype for modded is {subtypeformodded}");
                }
                if (subtypeformodded <= Instance.WarpDriveTypes.Count && subtypeformodded > -1)
                {
                    if (Global.DebugLogging)
                    {
                        Logger.Info("Creating WarpDrive from list info");
                    }
                    WarpDrivePlugin WarpDriveType = Instance.WarpDriveTypes[Subtype - Instance.VanillaWarpDriveMaxType];
                    InWarpDrive.SubType = Subtype;
                    InWarpDrive.Name    = WarpDriveType.Name;
                    InWarpDrive.Desc    = WarpDriveType.Description;
                    InWarpDrive.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDrive, WarpDriveType.IconTexture);
                    InWarpDrive.ChargeSpeed           = WarpDriveType.ChargeSpeed;
                    InWarpDrive.WarpRange             = WarpDriveType.WarpRange;
                    InWarpDrive.EnergySignatureAmt    = WarpDriveType.EnergySignature;
                    InWarpDrive.NumberOfChargingNodes = WarpDriveType.NumberOfChargesPerFuel;
                    InWarpDrive.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDrive, (ObscuredInt)WarpDriveType.MarketPrice);
                    InWarpDrive.CargoVisualPrefabID     = WarpDriveType.CargoVisualID;
                    InWarpDrive.CanBeDroppedOnShipDeath = WarpDriveType.CanBeDroppedOnShipDeath;
                    InWarpDrive.Experimental            = WarpDriveType.Experimental;
                    InWarpDrive.Unstable   = WarpDriveType.Unstable;
                    InWarpDrive.Contraband = WarpDriveType.Contraband;
                    InWarpDrive.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDrive, (ObscuredFloat)WarpDriveType.Price_LevelMultiplierExponent);
                }
            }
            else
            {
                InWarpDrive = new PLWarpDrive((EWarpDriveType)Subtype, level);
            }
            return(InWarpDrive);
        }