public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { int len = reader.ReadInt(); for (int i = 0; i < len; i++) { string type = reader.ReadString(); Type teamType = Type.GetType(type, true, true); object[] args = new object[] { this, "" }; BaseGameTeam team = (BaseGameTeam)Activator.CreateInstance(teamType, args); team.Deserialize(reader); m_Teams.Add(team); if (Open) { team.CreateMoongate(); } } break; } } }
public override void OnAdded(object parent) { Mobile m = RootParent as Mobile; if (m != null && Game != null) { BaseGameTeam team = Game.GetTeam(m); if (team != null) { m.SolidHueOverride = team.Hue; // Flag carrier Game.SendPlayerGumps(); } } }
public void SwitchTeam(Mobile player, BaseGameTeam team) { BaseGameTeam oldTeam = GetTeam(player); if (oldTeam == team) { return; } if (oldTeam != null) { oldTeam.RemovePlayer(player); } team.AddPlayer(player); }
private static void EventTeamSay_Command(CommandEventArgs e) { BaseGame Game = ((PlayerMobile)e.Mobile).CurrentEvent; if (Game != null && Game is BaseTeamGame) { BaseTeamGame TeamGame = Game as BaseTeamGame; BaseGameTeam team = TeamGame.GetTeam(e.Mobile); team.TeamMessage(e.Mobile, e.ArgString); } else { e.Mobile.SendAsciiMessage("You are not in a team event."); } }
public void GiveSuppliesToPlayer(Mobile player, BaseGameTeam team) { if (player == null || team == null) { return; } Supplier.ClothHue = team.Hue; Supplier.TeamName = team.Name; EquipmentStorage storage = Supplier.Supply(player); m_PlayerSupplies.Add((PlayerMobile)player, storage); player.Location = team.Home; player.Map = team.HomeMap; }
public override void GivePrizesToPlayers() { if (m_Winners.Count < 2) { return; } BaseGameTeam first = m_Winners[0] as BaseGameTeam; BaseGameTeam second = m_Winners[1] as BaseGameTeam; if (first == null || second == null) { return; } int score = first.Score; if (first.Score == second.Score) { foreach (BaseGameTeam team in Teams) { foreach (Mobile player in team.Players) { if (player is PlayerMobile) { Container bank = ((PlayerMobile)player).BankBox; const int gold = 5000; bank.AddItem(new BankCheck(gold)); player.SendAsciiMessage("A bank check worth {0} gold has been added in your bank", gold); } } } } else { foreach (Mobile player in first.Players) { if (player is PlayerMobile) { Container bank = ((PlayerMobile)player).BankBox; const int gold = 7000; bank.AddItem(new BankCheck(gold)); player.SendAsciiMessage("A bank check worth {0} gold has been added in your bank", gold); } } } }
public void RemoveTeam(BaseGameTeam team) { m_Teams.Remove(team); }
public void AddTeam(BaseGameTeam team) { m_Teams.Add(team); }
public JoinTeamGate(BaseGameTeam team) : this() { Team = team; }
public JoinTeamGate(BaseGameTeam team) : this() { Team = team; }
public void GiveSuppliesToPlayer(Mobile player, BaseGameTeam team) { if (player == null || team == null) return; Supplier.ClothHue = team.Hue; Supplier.TeamName = team.Name; EquipmentStorage storage = Supplier.Supply(player); m_PlayerSupplies.Add((PlayerMobile)player, storage); player.Location = team.Home; player.Map = team.HomeMap; }
public void SwitchTeam(Mobile player, BaseGameTeam team) { BaseGameTeam oldTeam = GetTeam(player); if (oldTeam == team) return; if (oldTeam != null) { oldTeam.RemovePlayer(player); } team.AddPlayer(player); }
public void RemoveTeam(BaseGameTeam team) { m_Teams.Remove(team); }
public void AddTeam(BaseGameTeam team) { m_Teams.Add(team); }