コード例 #1
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (!m_Flag.Game.Running)
                {
                    from.SendMessage("You cannot pass or capture after the game end.");
                    return;
                }

                CTFTeam fteam = m_Flag.Game.GetTeam(from);

                if (target is Mobile)
                {
                    Mobile  targ  = (Mobile)target;
                    CTFTeam tteam = m_Flag.Game.GetTeam(targ);
                    if (targ.Alive && tteam == fteam && from != targ)
                    {
                        if (targ.Backpack != null)
                        {
                            m_Flag.RandomizeItemID();
                            targ.Backpack.DropItem(m_Flag);
                            targ.SendMessage("{0} gave you the {1} flag!", from.Name, m_Flag.Team.Name);
                            m_Flag.Game.PlayerMessage("{0} passed the {1} flag to {2}!", from.Name, m_Flag.Team.Name, targ.Name);
                        }
                    }
                    else
                    {
                        from.SendMessage("You cannot give the flag to them!");
                    }
                }
                else if (target is CTFFlag)
                {
                    CTFFlag flag = target as CTFFlag;
                    if (flag.Team == fteam)
                    {
                        if (flag.Home)
                        {
                            CTFScoreBoard.Captured(from);
                            if (m_Flag.Game != null && m_Flag.Game.IsLeagueGame)
                            {
                                CTFLScoreBoard.Captured(from);
                            }
                            from.SendMessage("You captured the {0} flag!", m_Flag.Team.Name);
                            flag.Game.PlayerMessage("{0} ({1}) captured the {2} flag!", from.Name, fteam.Name, m_Flag.Team.Name);
                            m_Flag.ReturnToHome();
                            fteam.Points += 15;
                        }
                        else
                        {
                            from.SendMessage("Your flag must be at home to capture!");
                        }
                    }
                    else
                    {
                        from.SendMessage("You can only capture for your own team!");
                    }
                }
            }
コード例 #2
0
ファイル: CTF.cs プロジェクト: jackuoll/Pre-AOS-RunUO
		public CTFBase(CTFGauntlet gauntlet, int team) : base( 0x1183 )
		{
            Movable = false;
            Hue = BaseChallengeGame.TeamColor(team);
            Team = team;
            Name = String.Format("Team {0} Base", team);
            m_gauntlet = gauntlet;

            // add the flag

            Flag = new CTFFlag(this, team);
            Flag.HomeBase = this;
            HasFlag = true;
		}
コード例 #3
0
ファイル: CTF.cs プロジェクト: oldman73/xmlspawner
        public CTFBase(CTFGauntlet gauntlet, int team) : base(0x1183)
        {
            Movable    = false;
            Hue        = BaseChallengeGame.TeamColor(team);
            Team       = team;
            Name       = String.Format("Team {0} Base", team);
            m_gauntlet = gauntlet;

            // add the flag

            Flag          = new CTFFlag(this, team);
            Flag.HomeBase = this;
            HasFlag       = true;
        }
コード例 #4
0
            protected override void OnTarget(Mobile from, object target)
            {
                CTFTeam fteam = m_Flag.Game.GetTeam(from);

                if (target is Mobile)
                {
                    Mobile  targ  = (Mobile)target;
                    CTFTeam tteam = m_Flag.Game.GetTeam(targ);
                    if (tteam == fteam && from != targ)
                    {
                        if (targ.Backpack != null)
                        {
                            targ.Backpack.DropItem(m_Flag);
                            targ.SendAsciiMessage("{0} gave you the {1} flag!", from.Name, m_Flag.Team.Name);
                            m_Flag.Game.PlayerMessage("{0} passed the {1} flag to {2}!", from.Name, m_Flag.Team.Name, targ.Name);
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You cannot give the flag to them!");
                    }
                }
                else if (target is CTFFlag)
                {
                    CTFFlag flag = target as CTFFlag;
                    if (flag.Team == fteam)
                    {
                        if (flag.Home)
                        {
                            from.SendAsciiMessage("You captured the {0} flag!", m_Flag.Team.Name);
                            flag.Game.PlayerMessage("{0} ({1}) captured the {2} flag!", from.Name, fteam.Name, m_Flag.Team.Name);
                            m_Flag.ReturnToHome();
                            fteam.Points += 15;
                        }
                        else
                        {
                            from.SendAsciiMessage("Your flag must be at home to capture!");
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You can only capture for your own team!");
                    }
                }
            }
コード例 #5
0
			public ReturnTimer( CTFFlag flag ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( 30.0 ) )
			{
				m_Flag = flag;
				m_Start = DateTime.Now;
				Priority = TimerPriority.TwoFiftyMS;
			}
コード例 #6
0
			public CaptureTarget( CTFFlag flag ) : base( 3, false, TargetFlags.None )
			{
				m_Flag = flag;
			}
コード例 #7
0
 public ReturnTimer(CTFFlag flag) : base(TimeSpan.Zero, TimeSpan.FromSeconds(30.0))
 {
     m_Flag   = flag;
     m_Start  = DateTime.Now;
     Priority = TimerPriority.TwoFiftyMS;
 }
コード例 #8
0
 public CaptureTarget(CTFFlag flag) : base(3, false, TargetFlags.None)
 {
     m_Flag = flag;
 }