public CountdownTimer(TournamentStone stone) : base(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)) { m_TournamentStone = stone; count = m_TournamentStone.StartDelay; CommandHandlers.BroadcastMessage(AccessLevel.Player, 38, string.Format("An automated and supplied 1v1 tournament will start in {0} minute{1}! Type .jointour to join or .watchtour to watch", count, count == 1 ? "" : "s")); }
public EndMatchTimer(TournamentStone stone, Rectangle2D area) : base(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(50)) { this.m_Stone = stone; this.m_Area = area; IPooledEnumerable eable = m_Stone.JoinMap.GetMobilesInBounds(m_Area); m_Fighters = new List <Mobile>(); foreach (Mobile m in eable) { if (m_Stone.Fighting.Contains(m)) { m_Fighters.Add(m); } } eable.Free(); }
private static void EventSink_Disconnected(DisconnectedEventArgs e) { Mobile m = e.Mobile; if (m == null) { return; } TournamentStone stone = GetPlayerStone(m); if (stone != null && IsInTournament(m)) { new DisconnectTimer(stone, m).Start(); } }
private static void EventSink_PlayerDeath(PlayerDeathEventArgs e) { Mobile m = e.Mobile; if (m == null) { return; } if (IsInTournament(m)) { TournamentStone stone = GetPlayerStone(m); if (stone != null) { stone.HandleDeath(m); } } }
/* * public static void TryShowScoreBoard(Mobile from) * { * if (IsInTournament(from)) * { * TournamentStone ts = GetPlayerStone(from); * * if (ts != null) * ts.ShowScore(from); * } * } */ private static bool AllowTournamentJoin(Mobile from, TournamentStone stone) { if (stone != null) { if (stone.EventSupplier != null) { stone.AddPlayer(from); return(true); } from.SendAsciiMessage("There is no event supplier connected to the death match"); } else { from.SendMessage("Either a tournament has not been started or it's not accepting more players."); } return(false); }
public static void TryLeaveTournament(Mobile from, bool kicked) { if (IsInTournament(from)) { TournamentStone ts = GetPlayerStone(from); if (ts != null) { if (ts.Fighting != null && ts.Fighting.Contains(from)) { from.SendAsciiMessage("You cannot leave a tournament while fighting"); } else { ts.RemovePlayer(from, false, kicked); } } } }
public static bool TryJoinTournament(Mobile from, TournamentStone tStone) { if (Factions.Sigil.ExistsOn(from)) { from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (IsInTournament(from)) { from.SendMessage("You are already in a tournament. Type .leavetour to leave."); } else if (from.IsInEvent) { from.SendMessage("You cannot join a tournament while in an event"); } else if (from.Spell != null) { from.SendLocalizedMessage(1049616); // You are too busy to do that at the moment. } else if (!from.Alive) { from.SendMessage("You cannot join a tournament while dead."); } else if (from.IsBodyMod && !from.Body.IsHuman) { from.SendMessage("You cannot join a tournament while polymorphed."); } else if (TournamentStones.Count < 1) { from.SendMessage("No tournament system exists on the server."); } else if (from.AccessLevel > AccessLevel.Player) { from.SendMessage("You cannot join a tournament as staff."); } else { return(AllowTournamentJoin(from, tStone)); } return(false); }
public MatchTimer(TournamentStone stone, Rectangle2D area, bool final) : base(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)) { m_TournamentStone = stone; m_Count = final ? m_TournamentStone.MatchTimerInMins * 3 : m_TournamentStone.MatchTimerInMins; m_Area = area; }
public StartFightTimer(TournamentStone stone, Mobile m) : base(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1)) { m_Mobile = m; m_Stone = stone; m_Count = m_Stone.FightDelayInSecs; }
public DisconnectTimer(TournamentStone stone, Mobile m) : base(TimeSpan.FromMinutes(3.0)) { m_Mobile = m; m_Stone = stone; }