예제 #1
0
        internal static int Load(ModBase @base, string internalName, Invasion invasion)
        {
            invasion.ID = ++invasionNextType;

            invasions.Add(@base.mod.InternalName + ":" + internalName, invasion);
            invasionTypes.Add(invasion.ID, @base.mod.InternalName + ":" + internalName);

            return(invasion.ID);
        }
예제 #2
0
        static void InvasionWarning(Invasion inv)
        {
            // got from Terraria source

            Color c = new Color(175, 75, 255);

            if (Main.invasionSize <= 0)
            {
                NetHelper.SendText(inv.DefeatedText, c);
            }
            else if (Main.invasionX < Main.spawnTileX)
            {
                NetHelper.SendText(inv.StartText("west"), c);
            }
            else if (Main.invasionX > Main.spawnTileX)
            {
                NetHelper.SendText(inv.StartText("east"), c);
            }
            else
            {
                NetHelper.SendText(inv.ArrivedText, c);
            }
        }
        static void InvasionWarning(Invasion inv)
        {
            // got from Terraria source

            Color c = new Color(175, 75, 255);

            if (Main.invasionSize <= 0)
                NetHelper.SendText(inv.DefeatedText, c);
            else if (Main.invasionX < Main.spawnTileX)
                NetHelper.SendText(inv.StartText("west"), c);
            else if (Main.invasionX > Main.spawnTileX)
                NetHelper.SendText(inv.StartText("east"), c);
            else
                NetHelper.SendText(inv.ArrivedText, c);
        }
        internal static int Load(ModBase @base, string internalName, Invasion invasion)
        {
            invasion.ID = ++invasionNextType;

            invasions.Add(@base.mod.InternalName + ":" + internalName, invasion);
            invasionTypes.Add(invasion.ID, @base.mod.InternalName + ":" + internalName);

            return invasion.ID;
        }
예제 #5
0
        /// <summary>
        /// Starts an invasion.
        /// </summary>
        /// <param name="invasion">The invasion to start.</param>
        public static void StartInvasion(Invasion invasion)
        {
            StopInvasions();

            Main.invasionDelay = 0;
            Main.StartInvasion(invasion.ID);
            invasion.IsActive = true;
        }
 static void LoadInvasions()
 {
     Invasion.Load(Instance, "Wraiths", Wraiths = new WraithInvasion());
 }