• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Targeting.Target类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Targeting.Target的典型用法代码示例。如果您正苦于以下问题:C# Target类的具体用法?C# Target怎么用?C# Target使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Target类属于Server.Targeting命名空间,在下文中一共展示了Target类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnTarget

		public override bool OnTarget( Mobile m, Target t, object o )
		{
			if ( m.Spell != null && m.Spell is MarkSpell && m.AccessLevel == AccessLevel.Player )
			{
				m.SendLocalizedMessage( 501800 ); // You cannot mark an object at that location.
				return false;
			}

			return base.OnTarget( m, t, o );
		}
开发者ID:bugraerdogan,项目名称:silverlight-uo-client,代码行数:10,代码来源:HouseRaffleRegion.cs


示例2: ProcessTarget

        private void ProcessTarget( Target targ, NeedDelegate[] func )
        {
            Mobile toHelp = Find( func );

            if ( toHelp != null )
            {
                if ( targ.Range != -1 && !m_Mobile.InRange( toHelp, targ.Range ) )
                {
                    DoMove( m_Mobile.GetDirectionTo( toHelp ) | Direction.Running );
                }
                else
                {
                    targ.Invoke( m_Mobile, toHelp );
                }
            }
            else
            {
                targ.Cancel( m_Mobile, TargetCancelType.Canceled );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:20,代码来源:HealerAI.cs


示例3: ClearTarget

 public void ClearTarget()
 {
     m_Target = null;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:Mobile.cs


示例4: CheckTarget

 public virtual bool CheckTarget( Mobile from, Target targ, object targeted )
 {
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:Mobile.cs


示例5: CheckTarget

        public override bool CheckTarget( Mobile from, Target targ, object targeted )
        {
            if ( !base.CheckTarget( from, targ, targeted ) )
                return false;

            object root = this.RootParent;

            if ( root is PlayerVendor && ((PlayerVendor)root).IsOwner( from ) )
                return true;

            return ( targ is PlayerVendor.PVBuyTarget );
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:12,代码来源:PlayerVendor.cs


示例6: ProcessTarget

		public override void ProcessTarget(Target targ)
		{
			bool isDispel = (targ is DispelSpell.InternalTarget);
			bool isParalyze = (targ is ParalyzeSpell.InternalTarget);
			bool isTeleport = (targ is TeleportSpell.InternalTarget);
			bool isCrossHeal = (targ is GreaterHealSpell.InternalTarget);
			bool isTrap = (targ is MagicTrapSpell.InternalTarget);
			bool teleportAway = false;
			bool isReveal = (targ is RevealSpell.InternalTarget || targ is DetectHidden.InternalTarget);

			Mobile toTarget = null;
			Mobile toHeal = null;

			if (isReveal)
			{
				targ.Invoke(m_Mobile, m_Mobile);
			}

			if (isTrap)
			{
				Pouch p = FindPouch(m_Mobile);
				if (p != null)
				{
					targ.Invoke(m_Mobile, p);
				}
				else
					targ.Cancel(m_Mobile, TargetCancelType.Canceled);
			}

			if (isDispel)
			{
				toTarget = FindDispelTarget(false);

				if (toTarget != null && m_Mobile.InRange(toTarget, 10) && !toTarget.Paralyzed)
					RunFrom(toTarget);
			}

			if (CrossHeals && isCrossHeal)
			{
				toHeal = FindHealTarget(true);

				if (toHeal != null && !m_Mobile.InRange(toHeal, 8))
				{

					RunTo(toHeal, CanRun);
				}
			}

			else if (isParalyze || isTeleport)
			{
				toTarget = FindDispelTarget(true);

				if (toTarget == null)
				{
					toTarget = m_Mobile.Combatant;

					if (toTarget != null && !m_Mobile.InRange(toTarget, 8))
						RunTo(toTarget, CanRun);
				}
				else if (m_Mobile.InRange(toTarget, 10))
				{
					RunFrom(toTarget);
					teleportAway = true;
				}
				else
				{
					teleportAway = true;
				}
			}

			else
			{
				if (m_Mobile.ControlOrder == OrderType.Come && isTeleport)
				{
					toTarget = m_Mobile.ControlMaster;
				}
				else
				{
					toTarget = m_Mobile.Combatant;
				}

				if (toTarget != null)
				{

					RunTo(toTarget, CanRun);
				}
			}

			if ((targ.Flags & TargetFlags.Harmful) != 0 && toTarget != null)
			{
				if ((m_Mobile.InRange(toTarget, 10)) && m_Mobile.CanSee(toTarget) && m_Mobile.InLOS(toTarget))
				{
					targ.Invoke(m_Mobile, toTarget);
				}
				else if (isDispel)
				{
					targ.Cancel(m_Mobile, TargetCancelType.Canceled);
				}

			}
//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:BaseHybridAI.cs


示例7: CheckTarget

		public override bool CheckTarget( Mobile from, Target targ, object targeted )
		{
			if ( !base.CheckTarget( from, targ, targeted ) )
				return false;

			if ( from.AccessLevel >= AccessLevel.GameMaster )
				return true;

			return targ.GetType().IsDefined( typeof( PlayerVendorTargetAttribute ), false );
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:10,代码来源:PlayerVendor.cs


示例8: TimeoutTimer

            public TimeoutTimer( Target target, Mobile m, TimeSpan delay )
                : base(delay)
            {
                m_Target = target;
                m_Mobile = m;

                if ( delay >= ThirtySeconds )
                    Priority = TimerPriority.FiveSeconds;
                else if ( delay >= TenSeconds )
                    Priority = TimerPriority.OneSecond;
                else if ( delay >= OneSecond )
                    Priority = TimerPriority.TwoFiftyMS;
                else
                    Priority = TimerPriority.TwentyFiveMS;
            }
开发者ID:Leorgrium,项目名称:runuo,代码行数:15,代码来源:Target.cs


示例9: CheckTarget

        //This Wraps the target and resets the targeted ITEM to it's child BASECREATURE
        //Unfortunately, there is no accessible Array for a player's followers,
        //so we must use the GetMobilesInRage(int range) method for our reference checks!
        public override bool CheckTarget( Mobile from, Target targ, object targeted )
        {
            #region CheckEntity

            //Check to see if we have an Entity Link (Child BaseCreature)
            //If not, create one!
            //(Without Combatant Change, since this is for pets)

            PlayerMobile pm = from as PlayerMobile;

            if( pm != null )
            {

                if( m_Child != null && !m_Child.Deleted )
                {
                    m_Child.Update( );
                }
                else
                {
                    ProvideEntity( );

                    if( m_Child != null && !m_Child.Deleted )
                    {
                        m_Child.Update( );
                    }
                }
            }
            #endregion

            if( targ is AIControlMobileTarget && targeted == this )
            {
                //Wrap the target
                AIControlMobileTarget t = targ as AIControlMobileTarget;
                //Get the OrderType
                OrderType order = t.Order;

                //Search for our controlled pets within screen range
                foreach( Mobile m in from.GetMobilesInRange( 16 ) )
                {
                    if( !( m is BaseCreature ) )
                        continue;

                    BaseCreature bc = m as BaseCreature;

                    if( from != null && !from.Deleted && from.Alive )
                    {
                        if( bc == null || bc.Deleted || !bc.Alive || !bc.Controlled || bc.ControlMaster != from )
                            continue;

                        //Reset the pet's ControlTarget and OrderType.
                        bc.ControlTarget = m_Child;
                        bc.ControlOrder = t.Order;
                    }
                }
            }

            return base.CheckTarget( from, targ, targeted );
        }
开发者ID:zerodowned,项目名称:My-Stuff,代码行数:61,代码来源:LivingStatue_BaseDes.cs


示例10: ProcessTarget

        private void ProcessTarget( Target targ )
        {
            bool isDispel = ( targ is DispelSpell.InternalTarget );
            bool isParalyze = ( targ is ParalyzeSpell.InternalTarget );

            Mobile toTarget;

            if ( isDispel )
            {
                toTarget = FindDispelTarget( false );

                if ( !SmartAI && toTarget != null )
                    RunTo( toTarget );
                else if ( toTarget != null && m_Mobile.InRange( toTarget, 8 ) )
                    RunFrom( toTarget );
            }
            else if ( SmartAI && isParalyze )
            {
                toTarget = FindDispelTarget( true );

                if ( toTarget == null )
                {
                    toTarget = m_Mobile.Combatant;

                    if ( toTarget != null )
                        RunTo( toTarget );
                }
            }
            else
            {
                toTarget = m_Mobile.Combatant;

                if ( toTarget != null )
                    RunTo( toTarget );
            }

            if ( (targ.Flags & TargetFlags.Harmful) != 0 && toTarget != null )
            {
                if ( (targ.Range == -1 || m_Mobile.InRange( toTarget, targ.Range )) && m_Mobile.CanSee( toTarget ) && m_Mobile.InLOS( toTarget ) )
                {
                    targ.Invoke( m_Mobile, toTarget );
                }
                else if ( isDispel )
                {
                    targ.Cancel( m_Mobile, TargetCancelType.Canceled );
                }
            }
            else if ( (targ.Flags & TargetFlags.Beneficial) != 0 )
            {
                targ.Invoke( m_Mobile, m_Mobile );
            }
            else
            {
                targ.Cancel( m_Mobile, TargetCancelType.Canceled );
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:56,代码来源:MageAI.cs


示例11: OnTarget

		public virtual bool OnTarget( Mobile m, Target t, object o )
		{
			if ( m_Parent != null )
				return m_Parent.OnTarget( m, t, o );

			return true;
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:7,代码来源:Region.cs


示例12: OnTarget

        public override bool OnTarget(Mobile m, Target t, object o)
        {
            if (!Participant(m))
                return false;

            return base.OnTarget(m, t, o);
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:DuelRegion.cs


示例13: OnTarget

		public override bool OnTarget( Mobile m, Target t, object o )
		{
			if( m_ExistingRegion != null )
			{
				return m_ExistingRegion.OnTarget(m,t,o);
			}
			else
			{
				return base.OnTarget(m,t,o);
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:11,代码来源:CampfireRegion.cs


示例14: OnTarget

 public virtual bool OnTarget( Mobile m, Target t, object o )
 {
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:BaseRegion.cs


示例15: OnTarget

		public override bool OnTarget(Mobile m, Target t, object o)
		{
			if (Battle != null && Battle.State != PvPBattleState.Internal && !Battle.Hidden && !Battle.OnTarget(m, t, o))
			{
				return false;
			}

			return base.OnTarget(m, t, o);
		}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:9,代码来源:Regions.cs


示例16: ProcessTarget

		private void ProcessTarget( Target targ )
		{
			bool isDispel = ( targ is DispelSpell.InternalTarget );
			bool isParalyze = ( targ is ParalyzeSpell.InternalTarget );
			bool isTeleport = ( targ is TeleportSpell.InternalTarget );
			bool teleportAway = false;

			Mobile toTarget;

			if ( isDispel )
			{
				toTarget = FindDispelTarget( false );

				if ( !SmartAI && toTarget != null )
					RunTo( toTarget );
				else if ( toTarget != null && m_Mobile.InRange( toTarget, 10 ) )
					RunFrom( toTarget );
			}
			else if ( SmartAI && (isParalyze || isTeleport) )
			{
				toTarget = FindDispelTarget( true );

				if ( toTarget == null )
				{
					toTarget = m_Mobile.Combatant;

					if ( toTarget != null )
						RunTo( toTarget );
				}
				else if ( m_Mobile.InRange( toTarget, 10 ) )
				{
					RunFrom( toTarget );
					teleportAway = true;
				}
				else
				{
					teleportAway = true;
				}
			}
			else
			{
				toTarget = m_Mobile.Combatant;

				if ( toTarget != null )
					RunTo( toTarget );
			}

			if ( (targ.Flags & TargetFlags.Harmful) != 0 && toTarget != null )
			{
				if ( (targ.Range == -1 || m_Mobile.InRange( toTarget, targ.Range )) && m_Mobile.CanSee( toTarget ) && m_Mobile.InLOS( toTarget ) )
				{
					targ.Invoke( m_Mobile, toTarget );
				}
				else if ( isDispel )
				{
					targ.Cancel( m_Mobile, TargetCancelType.Canceled );
				}
			}
			else if ( (targ.Flags & TargetFlags.Beneficial) != 0 )
			{
				targ.Invoke( m_Mobile, m_Mobile );
			}
			else if ( isTeleport && toTarget != null )
			{
				Map map = m_Mobile.Map;

				if ( map == null )
				{
					targ.Cancel( m_Mobile, TargetCancelType.Canceled );
					return;
				}

				int px, py;

				if ( teleportAway )
				{
					int rx = m_Mobile.X - toTarget.X;
					int ry = m_Mobile.Y - toTarget.Y;

					double d = m_Mobile.GetDistanceToSqrt( toTarget );

					px = toTarget.X + (int)(rx * (10 / d));
					py = toTarget.Y + (int)(ry * (10 / d));
				}
				else
				{
					px = toTarget.X;
					py = toTarget.Y;
				}

				for ( int i = 0; i < m_Offsets.Length; i += 2 )
				{
					int x = m_Offsets[i], y = m_Offsets[i + 1];

					Point3D p = new Point3D( px + x, py + y, 0 );

					LandTarget lt = new LandTarget( p, map );

					if ( (targ.Range == -1 || m_Mobile.InRange( p, targ.Range )) && m_Mobile.InLOS( lt ) && map.CanSpawnMobile( px + x, py + y, lt.Z ) && !SpellHelper.CheckMulti( p, map ) )
					{
//.........这里部分代码省略.........
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:101,代码来源:VampireAI.cs


示例17: ProcessTarget

		private void ProcessTarget( Target targ )
		{
			targ.Invoke( m_Mobile, m_Mobile );
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:4,代码来源:PaladinAI.cs


示例18: TargetReq

 public TargetReq( Target t )
     : base(0x6C, 19)
 {
     m_Stream.Write( (bool) t.AllowGround );
     m_Stream.Write( (int)  t.TargetID );
     m_Stream.Write( (byte) t.Flags );
     m_Stream.Fill();
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:8,代码来源:Packets.cs


示例19: OnTarget

		public override bool OnTarget( Mobile m, Target t, object o )
		{
			if(m.AccessLevel == AccessLevel.Player && t is Server.Spells.Third.TeleportSpell.InternalTarget)
			{
                m.SendLocalizedMessage(501802); // that spell doesn't seem to work.
				return false;
			}
				
			return base.OnTarget(m, t, o);
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:10,代码来源:Region.cs


示例20: OnTarget

		public virtual bool OnTarget(Mobile m, Target target, object o)
		{
			return m != null && !m.Deleted && target != null && o != null;
		}
开发者ID:rokann,项目名称:JustUO,代码行数:4,代码来源:Battle_Actions.cs



注:本文中的Server.Targeting.Target类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PacketEngine.Packet类代码示例发布时间:2022-05-26
下一篇:
C# Targeting.LandTarget类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap