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); }
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; }
/// <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()); }