public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            m_Game  = reader.ReadItem() as CTFGame;
            m_Stone = reader.ReadItem() as GameJoinStone;
            int count = reader.ReadEncodedInt();

            m_Times = new TimeSpan[count];
            for (int i = 0; i < count; i++)
            {
                m_Times[i] = reader.ReadTimeSpan();
            }
            bool active = reader.ReadBool();

            m_Duration        = reader.ReadTimeSpan();
            m_Doors           = reader.ReadItem() as BaseDoor;
            m_CTFJoinMessage  = reader.ReadString();
            m_CTFStartMessage = reader.ReadString();
            m_CTFMessageHue   = reader.ReadInt();

            Activate(active);
        }
Esempio n. 2
0
        public void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_Flag = reader.ReadItem() as IGameFlag;
                goto case 0;
            }

            case 0:
            {
                m_Members  = reader.ReadMobileList();
                m_Home     = reader.ReadPoint3D();
                m_FlagHome = reader.ReadPoint3D();
                m_Map      = reader.ReadMap();
                m_Points   = reader.ReadInt();
                m_Name     = reader.ReadString();
                m_Hue      = reader.ReadInt();
                m_UId      = reader.ReadInt();
                m_Game     = reader.ReadItem() as CTFGame;
                break;
            }
            }
        }
		public GameTeamSelector( CTFGame game, int teamSize, bool randomTeam ) : base( 50, 50 )
		{
			m_Game = game;
			m_TeamSize = teamSize;
			m_RandomTeam = randomTeam;

			//Closable = false;
			Dragable = false;

			AddPage( 0 );
			AddBackground( 0, 0, 250, 220, 5054 );
			AddBackground( 10, 10, 230, 200, 3000 );

			AddPage( 1 );
			AddLabel( 20, 20, 0, "Select a team:" );

			if ( m_RandomTeam )
			{
				AddButton( 20, 60, 4005, 4006, 1, GumpButtonType.Reply, 0 );
				AddLabel( 55, 60, 0, "Join Random Team" );
			}
			else
			{
				for (int i=0;i<m_Game.Teams.Count;i++)
				{
					CTFTeam team = (CTFTeam)m_Game.Teams[i];
					if ( team.ActiveMemberCount < m_TeamSize )
					{
						AddButton( 20, 60 + i*20, 4005, 4006, i+1, GumpButtonType.Reply, 0 );
						AddLabel( 55, 60 + i*20, 0, "Join Team " + team.Name );
					}
				}
			}

		}
Esempio n. 4
0
		public void Deserialize( GenericReader reader )
		{
			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_Flag = reader.ReadItem() as IGameFlag;
					goto case 0;
				}
				case 0:
				{
					m_Members = reader.ReadMobileList();
					m_Home = reader.ReadPoint3D();
					m_FlagHome = reader.ReadPoint3D();
					m_Map = reader.ReadMap();
					m_Points = reader.ReadInt();
					m_Name = reader.ReadString();
					m_Hue = reader.ReadInt();
					m_UId = reader.ReadInt();
					m_Game = reader.ReadItem() as CTFGame;
					break;
				}
			}
		}
Esempio n. 5
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_DominationTime = reader.ReadInt();
                goto case 1;
            }

            case 1:
            {
                m_TeamControl = reader.ReadItem() as DDTeamControl;
                goto case 0;
            }

            case 0:
            {
                m_Game       = reader.ReadItem() as CTFGame;
                m_OtherPoint = reader.ReadItem() as DDWayPoint;
                break;
            }
            }

            if (m_DominationTime == 0)
            {
                m_DominationTime = 10;
            }
            new InitTimer(this).Start();
        }
Esempio n. 6
0
 public CTFTeam(CTFGame game, int uid)
 {
     m_UId  = uid;
     m_Game = game;
     Console.WriteLine("Ovas");
     m_Points  = 0;
     m_Home    = Point3D.Zero;
     m_Map     = Map.Felucca;
     m_Members = new ArrayList();
 }
Esempio n. 7
0
        public CTFTeam( CTFGame game, int uid )
        {
            m_UId = uid;
            m_Game = game;

            m_Points = 0;
            m_Home = Point3D.Zero;
            m_Map = Map.Felucca;
            m_Members = new ArrayList();
        }
Esempio n. 8
0
        public CTFTeam(CTFGame game, int uid)
        {
            m_UId  = uid;
            m_Game = game;

            m_Points  = 0;
            m_Home    = Point3D.Zero;
            m_Map     = Map.Felucca;
            m_Members = new ArrayList();
        }
Esempio n. 9
0
        public override void UseGate(Mobile m)
        {
            CTFTeam team = CTFGame.FindTeamFor(m);

            if (team != null)
            {
                team.Game.LeaveGame(m);
            }

            base.UseGate(m);
        }
Esempio n. 10
0
        public GameJoinGump(CTFGame game, string gameName)
            : base(String.Format("Welcome to {0}! Enter the game with caution! All non-bless/non-newbied items will be lost! All pets will be lost! Bank your items before joining, supplies will be provided.  Enjoy!", gameName), null)
        {
            m_Game = game;

            List<String> mAnswers = new List<String>();

            mAnswers.Add( "Cancel" );
            mAnswers.Add( "Okay, Join!" );

            Answers = mAnswers.ToArray();
        }
Esempio n. 11
0
        public static CTFTeam FindTeamFor(Mobile m)
        {
            for (int i = 0; i < m_Registry.Count; i++)
            {
                CTFGame game = (CTFGame)m_Registry[i];
                CTFTeam team = game.GetTeam(m);
                if (team != null)
                {
                    return(team);
                }
            }

            return(null);
        }
Esempio n. 12
0
 private static void EndGame_Target(Mobile from, object o)
 {
     if (o is CTFGame)
     {
         CTFGame game = (CTFGame)o;
         game.EndGame();
         from.SendMessage("The game has been ended.");
     }
     else
     {
         from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(EndGame_Target));
         from.SendMessage("Target the game stone.");
     }
 }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			switch ( version )
			{
				case 0:
				{
					m_Game = reader.ReadItem() as CTFGame;
					break;
				}
			}
		}
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Game = reader.ReadItem() as CTFGame;
                break;
            }
            }
        }
Esempio n. 15
0
        private static void StartGame_Target(Mobile from, object o, object state)
        {
            bool reset = state is bool?(bool)state : false;

            if (o is CTFGame)
            {
                CTFGame game = (CTFGame)o;
                game.StartGame(reset);
                from.SendMessage("The game has been started.");
            }
            else
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(StartGame_Target), reset);
                from.SendMessage("Target the game stone.");
            }
        }
Esempio n. 16
0
            protected override void OnTick()
            {
                Mobile  owner = m_Flag.RootParent as Mobile;
                CTFGame game  = m_Flag.Game;

                TimeSpan left = MaxFlagHoldTime - (DateTime.Now - m_Start);

                if (left >= TimeSpan.FromSeconds(1.0))
                {
                    if (left > TimeSpan.FromMinutes(1.0))
                    {
                        Interval = TimeSpan.FromSeconds(30.0);
                    }
                    else if (left > TimeSpan.FromSeconds(30.0))
                    {
                        Interval = TimeSpan.FromSeconds(15.0);
                    }
                    else if (left >= TimeSpan.FromSeconds(10.0))
                    {
                        Interval = TimeSpan.FromSeconds(5.0);
                    }
                    else
                    {
                        Interval = TimeSpan.FromSeconds(1.0);
                    }

                    if (owner != null)
                    {
                        owner.SendAsciiMessage("You must take the {0} flag to your flag in {1} seconds or be killed!", m_Flag.Team.Name, (int)left.TotalSeconds);
                    }
                }
                else
                {
                    if (owner != null)
                    {
                        owner.BoltEffect(0);
                        owner.PlaySound(0xDC);                          //snake hiss
                        owner.Kill();
                    }

                    m_Flag.Game.PlayerMessage("The {0} flag has been returned to base!", m_Flag.Team.Name);
                    m_Flag.ReturnToHome();
                    Stop();
                }
            }
Esempio n. 17
0
        public GameTeamSelector( CTFGame game, int teamSize )
            : base("Select a Team", null)
        {
            List<String> mTeams = new List<String>();

            m_Game = game;
            m_TeamSize = teamSize;

            for (int i=0;i<m_Game.Teams.Count;i++)
            {
                CTFTeam team = (CTFTeam)m_Game.Teams[i];
                if ( team.ActiveMemberCount < m_TeamSize )
                {
                    mTeams.Add( "Join Team " + team.Name );
                }
            }

            Answers = mTeams.ToArray();
        }
Esempio n. 18
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_TeamID = reader.ReadInt();
                m_Game   = reader.ReadItem() as CTFGame;

                break;
            }
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(ReturnToHome));
        }
Esempio n. 19
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			switch ( version )
			{
				case 1:
				{
					m_RandomTeam = reader.ReadBool();
					goto case 0;
				}
				case 0:
				{
					m_GameName = reader.ReadString();
					m_Game = reader.ReadItem() as CTFGame;
					break;
				}
			}
		}
Esempio n. 20
0
		public scoregump(CTFGame game, Mobile mob) : base( 200, 0 )
		{
			m_Game = game;
			m_Mob = mob;
			this.Closable=true;
			this.Disposable=false;
			this.Dragable=false;
			this.Resizable=false;
			this.AddPage(0);
			this.AddBackground(177, -3, 103, 26, 9550);


					CTFTeam team = (CTFTeam)m_Game.Teams[0];
					CTFTeam team2 = (CTFTeam)m_Game.Teams[1];
				if ( team != null)
					this.AddLabel(224, 1, team.Hue,""+team.Points+"" );
				else
					this.AddLabel(224, 1, team2.Hue,""+team2.Points+"" );

		}
Esempio n. 21
0
        public GameJoinGump( CTFGame game, string gameName )
            : base(20, 30)
        {
            m_Game = game;

            AddPage( 0 );
            AddBackground( 0, 0, 550, 220, 5054 );
            AddBackground( 10, 10, 530, 200, 3000 );

            AddPage( 1 );
            AddLabel( 20, 20, 0, String.Format( "Welcome to {0}!", gameName ) );
            //AddLabel( 20, 60, 0, "Let it be known to all who join the the melee that lays within, you will not" );
            AddLabel( 20, 60, 0, "Enter the game with caution! ll non-bless/non-newbied items will be lost!" );
            AddLabel( 20, 80, 0, "All pets will be lost! Bank your items before joining, supplies" );
            AddLabel( 20, 100, 0, "will be provided.  Enjoy!" );

            AddLabel( 55, 180, 0, "Cancel" );
            AddButton( 20, 180, 4005, 4006, 0, GumpButtonType.Reply, 0 );
            AddLabel( 165, 180, 0, "Okay, Join!" );
            AddButton( 130, 180, 4005, 4006, 1, GumpButtonType.Reply, 0 );
        }
Esempio n. 22
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_RandomTeam = reader.ReadBool();
                goto case 0;
            }

            case 0:
            {
                m_GameName = reader.ReadString();
                m_Game     = reader.ReadItem() as CTFGame;
                break;
            }
            }
        }
Esempio n. 23
0
		public GameTeamSelector( CTFGame game, int teamSize ) : base( 50, 50 )
		{
                            
			m_Game = game;
			m_TeamSize = teamSize;



			Closable = true;
			Dragable = false;

			AddPage( 0 );
			AddBackground( 0, 0, 250, 220, 5054 );
			AddBackground( 10, 10, 230, 200, 3000 );

			AddPage( 1 );
			AddLabel( 20, 20, 0, "Select a team:" );

					AddButton( 20, 60, 4005, 4006, 1, GumpButtonType.Reply, 0 );
					AddLabel( 55, 60, 0, "Join To CTF");	

		}
Esempio n. 24
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_TeamControl = reader.ReadItem() as DDTeamControl;
					goto case 0;
				}
				case 0:
				{
					m_Game = reader.ReadItem() as CTFGame;
					m_OtherPoint = reader.ReadItem() as DDWayPoint;
					break;
				}
			}

			new InitTimer( this ).Start();
		}
Esempio n. 25
0
			public LogoutTimer( Mobile mob, CTFGame gam ) : base( TimeSpan.FromSeconds(0.1) )
			{
				m_Mob = mob;
				m_Game = gam;
			}
Esempio n. 26
0
			public ScoreTimer( CTFGame g ) : base( TimeSpan.FromSeconds( 90 ), TimeSpan.FromSeconds( 90 ) )
			{
				m_Game = g;
			}
Esempio n. 27
0
			public StartTimer( CTFGame game, ArrayList list ) : base( StartDelay )
			{
				m_Game = game;
				m_List = list;
				Priority = TimerPriority.TwoFiftyMS;
			}
Esempio n. 28
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_TeamID = reader.ReadInt();
					m_Game = reader.ReadItem() as CTFGame;

					break;
				}
			}

            ItemID = 0x1627;
			Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ReturnToHome ) );
		}
Esempio n. 29
0
 public ScoreTimer( CTFGame g )
     : base(TimeSpan.FromMinutes( 5.0 ), TimeSpan.FromMinutes( 5.0 ))
 {
     m_Game = g;
 }
Esempio n. 30
0
		public GameJoinGump( CTFGame game, string gameName ) : base( 20, 30 )
		{
			m_Game = game;

			AddPage( 0 );
			AddBackground( 0, 0, 550, 220, 5054 );
			AddBackground( 10, 10, 530, 200, 3000 );
			
			AddPage( 1 );
			AddLabel( 20, 20, 0, String.Format( "Welcome to {0}!", gameName ) );
			AddLabel( 20, 60, 0, "You may join to this game and finally will get your prize!" );
			AddLabel( 20, 80, 0, "For any cheater actions you will go to jail." );
			AddLabel( 20, 100, 0, "Will be HONEST.  Enjoy!" );

			AddLabel( 55, 180, 0, "Cancel" );
			AddButton( 20, 180, 4005, 4006, 0, GumpButtonType.Reply, 0 );
			AddLabel( 165, 180, 0, "Okay, Join!" );
			AddButton( 130, 180, 4005, 4006, 1, GumpButtonType.Reply, 0 );
		}
		public GameTeamSelector( CTFGame game, bool randomTeam ) : this( game, game.TeamSize, randomTeam )
		{
		}
		public GameJoinGump( CTFGame game, string gameName, bool randomTeam ) : base( 20, 30 )
		{
			m_Game = game;
			m_RandomTeam = randomTeam;

			AddPage( 0 );
			AddBackground( 0, 0, 550, 220, 5054 );
			AddBackground( 10, 10, 530, 200, 3000 );

			AddPage( 1 );
			AddLabel( 20, 20, 0, String.Format( "Welcome to {0}!", gameName ) );
			AddLabel( 20, 80, 0, "Bank your items before joining, supplies" );
			AddLabel( 20, 100, 0, "will be provided.  Enjoy!" );

			AddLabel( 55, 180, 0, "Cancel" );
			AddButton( 20, 180, 4005, 4006, 0, GumpButtonType.Reply, 0 );
			AddLabel( 165, 180, 0, "Okay, Join!" );
			AddButton( 130, 180, 4005, 4006, 1, GumpButtonType.Reply, 0 );
		}
Esempio n. 33
0
 public StartTimer(CTFGame game, ArrayList list) : base(StartDelay)
 {
     m_Game   = game;
     m_List   = list;
     Priority = TimerPriority.TwoFiftyMS;
 }
Esempio n. 34
0
 public ScoreTimer(CTFGame g) : base(TimeSpan.FromMinutes(5.0), TimeSpan.FromMinutes(5.0))
 {
     m_Game = g;
 }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();

			m_Game = reader.ReadItem() as CTFGame;
			m_Stone = reader.ReadItem() as GameJoinStone;
			int count = reader.ReadEncodedInt();
			m_Times = new TimeSpan[count];
			for ( int i = 0; i < count; i++ )
				m_Times[i] = reader.ReadTimeSpan();
			bool active = reader.ReadBool();
			m_Duration = reader.ReadTimeSpan();
			m_Doors = reader.ReadItem() as BaseDoor;
			m_CTFJoinMessage = reader.ReadString();
			m_CTFStartMessage = reader.ReadString();
			m_CTFMessageHue = reader.ReadInt();

			Activate( active );
		}
Esempio n. 36
0
		public GameTeamSelector( CTFGame game ) : this( game, game.TeamSize )
		{
		}
Esempio n. 37
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			switch ( version )
			{
				case 5:
				{
				  m_Game = reader.ReadItem() as CTFGame;
                                  goto case 4;
				}
                                case 4:
                                {
			          m_GameName = reader.ReadString();
                                  goto case 3;
                                }
				case 3:
				{
                                  m_ppln = reader.ReadInt();
                                  goto case 2;
				}

				case 2:
				{
                                  m_pplm = reader.ReadInt();
                                  goto case 1;
				}
				case 1:
				{
				  m_AllowSameIP = reader.ReadBool();
                                  goto case 0;
				}
                                case 0:
                                {
                                  break;
                                }
			}
		}