Example #1
0
        public static PLHull CreateHull(int Subtype, int level)
        {
            PLHull InHull;

            if (Subtype >= Instance.VanillaHullMaxType)
            {
                InHull = new PLHull(EHullType.E_MAX, level);
                int subtypeformodded = Subtype - Instance.VanillaHullMaxType;
                if (subtypeformodded <= Instance.HullTypes.Count && subtypeformodded > -1)
                {
                    HullMod HullType = Instance.HullTypes[Subtype - Instance.VanillaHullMaxType];
                    InHull.SubType                       = Subtype;
                    InHull.Name                          = HullType.Name;
                    InHull.Desc                          = HullType.Description;
                    InHull.m_IconTexture                 = HullType.IconTexture;
                    InHull.Max                           = HullType.HullMax;
                    InHull.Armor                         = HullType.Armor;
                    InHull.Defense                       = HullType.Defense;
                    InHull.m_MarketPrice                 = HullType.MarketPrice;
                    InHull.CargoVisualPrefabID           = HullType.CargoVisualID;
                    InHull.CanBeDroppedOnShipDeath       = HullType.CanBeDroppedOnShipDeath;
                    InHull.Experimental                  = HullType.Experimental;
                    InHull.Unstable                      = HullType.Unstable;
                    InHull.Contraband                    = HullType.Contraband;
                    InHull.Price_LevelMultiplierExponent = HullType.Price_LevelMultiplierExponent;
                    InHull.Max                          *= 2f;
                    InHull.Current                       = InHull.Max;
                }
            }
            else
            {
                InHull = new PLHull((EHullType)Subtype, level);
            }
            return(InHull);
        }
Example #2
0
        static void Postfix(PLHull __instance, ref string __result)
        {
            int subtypeformodded = __instance.SubType - HullModManager.Instance.VanillaHullMaxType;

            if (subtypeformodded > -1 && subtypeformodded < HullModManager.Instance.HullTypes.Count && __instance.ShipStats != null)
            {
                __result = HullModManager.Instance.HullTypes[subtypeformodded].GetStatLineRight(__instance);
            }
        }
Example #3
0
        static void Postfix(PLHull __instance)
        {
            int subtypeformodded = __instance.SubType - HullModManager.Instance.VanillaHullMaxType;

            if (subtypeformodded > -1 && subtypeformodded < HullModManager.Instance.HullTypes.Count && __instance.ShipStats != null)
            {
                HullModManager.Instance.HullTypes[subtypeformodded].Tick(__instance);
            }
        }
        public override string GetStatLineRight(PLShipComponent InComp)
        {
            PLHull me = InComp as PLHull;

            if (me.SubType == 9)
            {
                return(string.Concat(new string[]
                {
                    (me.Max * me.LevelMultiplier(0.2f, 1f)).ToString("0"),
                    "\n",
                    (me.Armor * 250f * me.LevelMultiplier(0.15f, 1f)).ToString("0"),
                    "\n",
                    (500f * me.LevelMultiplier(0.15f, 1f)).ToString("0")
                }));
            }
            return((me.Max * me.LevelMultiplier(0.2f, 1f)).ToString("0") + "\n" + (this.Armor * 250f * me.LevelMultiplier(0.15f, 1f)).ToString("0"));
        }
        public override string GetStatLineLeft(PLShipComponent InComp)
        {
            PLHull me = InComp as PLHull;

            if (me.SubType == 9)
            {
                return(string.Concat(new string[]
                {
                    PLLocalize.Localize("Integrity", false),
                    "\n",
                    PLLocalize.Localize("Armor", false),
                    "\n",
                    PLLocalize.Localize("Armor (Max)", false)
                }));
            }
            return(PLLocalize.Localize("Integrity", false) + "\n" + PLLocalize.Localize("Armor", false));
        }
        public static PLHull CreateHull(int Subtype, int level)
        {
            PLHull InHull;

            if (Subtype >= Instance.VanillaHullMaxType)
            {
                InHull = new PLHull(EHullType.E_MAX, level);
                int subtypeformodded = Subtype - Instance.VanillaHullMaxType;
                if (Global.DebugLogging)
                {
                    Logger.Info($"Subtype for modded is {subtypeformodded}");
                }
                if (subtypeformodded <= Instance.HullTypes.Count && subtypeformodded > -1)
                {
                    if (Global.DebugLogging)
                    {
                        Logger.Info("Creating Hull from list info");
                    }
                    HullPlugin HullType = Instance.HullTypes[Subtype - Instance.VanillaHullMaxType];
                    InHull.SubType = Subtype;
                    InHull.Name    = HullType.Name;
                    InHull.Desc    = HullType.Description;
                    InHull.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, HullType.IconTexture);
                    InHull.Max     = HullType.HullMax;
                    InHull.Armor   = HullType.Armor;
                    InHull.Defense = HullType.Defense;
                    InHull.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, (ObscuredInt)HullType.MarketPrice);
                    InHull.CargoVisualPrefabID     = HullType.CargoVisualID;
                    InHull.CanBeDroppedOnShipDeath = HullType.CanBeDroppedOnShipDeath;
                    InHull.Experimental            = HullType.Experimental;
                    InHull.Unstable   = HullType.Unstable;
                    InHull.Contraband = HullType.Contraband;
                    InHull.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, (ObscuredFloat)HullType.Price_LevelMultiplierExponent);
                    InHull.Max    *= 2f;
                    InHull.Current = InHull.Max;
                }
            }
            else
            {
                InHull = new PLHull((EHullType)Subtype, level);
            }
            return(InHull);
        }