当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.CanSee方法代码示例

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


在下文中一共展示了Mobile.CanSee方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDoubleClick

        // When this object -- the bottle -- is double-clicked...
        public override void OnDoubleClick(Mobile m)
        {
            if (m.Followers >= m.FollowersMax) // If the player's followers is greater than or equal to his max followers...
            {
                m.SendMessage("You need at least one free follower slot to open the bottle.");
            }
            else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (!GetGooInBottle())) // If the bottle is in-range and the goo is not in its bottle...
            {
                m.SendMessage("The goo is out of its bottle!");
                m.SendLocalizedMessage(1010018); // What do you want to use this item on?

                m.Target = new BottleOfGooTarget(this, gooPet); // Creates a target from this mobile with the goo mobile thrown to the new class as a reference.
            }
            else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (GetGooInBottle())) // If the bottle is in-range and the goo IS in its bottle, this function creates a new goo mobile.
            {
                gooPet = new Goo(this);

                ((GenericWarrior)gooPet).Controlled = true;
                ((GenericWarrior)gooPet).ControlMaster = m;

                gooPet.MoveToWorld(m.Location, m.Map);
                gooPet.PlaySound(0x1CC);
                gooPet.Emote("*leaps out of " + m.Name + "'s bottle!*");

                SetGooInBottle(false);
            }
            else
            {
                m.SendLocalizedMessage(500446); //That is too far away.
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:32,代码来源:BottleOfGoo.cs

示例2: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (lastused + delay > DateTime.Now)
                return;
            else
                lastused = DateTime.Now;

            if (IsChildOf(from.Backpack) || from.InRange(this, 2) && from.CanSee(this))
            {
                switch (Utility.Random(8))
                {
                    default:
                    case 0: from.SendMessage("IT IS CERTAIN"); break;
                    case 1: from.SendMessage("WITHOUT A DOUBT"); break;
                    case 2: from.SendMessage("MY REPLY IS NO"); break;
                    case 3: from.SendMessage("ASK AGAIN LATER"); break;
                    case 4: from.SendMessage("VERY DOUBTFUL"); break;
                    case 5: from.SendMessage("CONCENTRATE AND ASK AGAIN"); break;
                    case 6: from.SendMessage("DON'T COUNT ON IT"); break;
                    case 7: from.SendMessage("YES"); break;
                }
                
               // this.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1007000 + Utility.Random(28)); 
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away. 
            }
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:29,代码来源:EightBall.cs

示例3: Effect

        public static void Effect( Mobile attacker, Mobile defender, int featlevel )
        {
            IKhaerosMobile featuser = attacker as IKhaerosMobile;
            ArrayList list = new ArrayList();

            foreach( Mobile m in defender.GetMobilesInRange( featlevel + 2 ) )
            {
                if( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) || featuser.IsAllyOf( m ) )
                    continue;

                if( !attacker.InRange( m, ((BaseWeapon)attacker.Weapon).MaxRange ) )
                    continue;

                if( m != attacker && Spells.SpellHelper.ValidIndirectTarget( attacker, m ) )
                {
                    if( attacker.InLOS( m ) )
                        list.Add( m );
                }
            }

            for( int i = 0; i < Math.Min( list.Count, featlevel + 1 ); ++i )
            {
                int random = Utility.Random( list.Count );
                Mobile m = (Mobile)list[random];

                featuser.CleaveAttack = true;
                ((BaseWeapon)attacker.Weapon).OnSwing( attacker, m, 0.5, true );

            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:30,代码来源:HailOfArrows.cs

示例4: OnTarget

            protected override void OnTarget(Mobile from, object o)
            {
                if (m_deed == null || m_deed.Deleted || !m_deed.IsChildOf(from.Backpack) || !from.CanSee(o))
                    return;

                if (o is Corpse && !((Corpse)o).Deleted)
                {
                    Corpse corpse = (Corpse)o;

                    if (!from.InRange(corpse.Location, 4))
                    {
                        from.SendLocalizedMessage(500446); // That is too far away.
                        return;
                    }

                    if (CheckCorpseType(from, corpse, m_deed) && CanUseWithDeed(from, corpse) && CheckUseWithDeedTime(from, corpse))
                    {
                        corpse.Delete();
                        m_deed.AmountCur++;
                        from.SendMessage("The corpse has been combined with the deed.");

                        from.SendGump(new SmallBODGump(from, m_deed));
                    }
                }
                else
                    from.SendLocalizedMessage(1042600); // That is not a corpse!
            }
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:27,代码来源:HuntBodUtility.cs

示例5: SleeperBedBodyContent

		public SleeperBedBodyContent( Mobile beholder, SleeperBedBody beheld ) : base( 0x3C )
		{
			ArrayList items = beheld.EquipItems;
			int count = items.Count;

			EnsureCapacity( 5 + (count * 19) );

			long pos = m_Stream.Position;

			int written = 0;

			m_Stream.Write( (ushort) 0 );

			for ( int i = 0; i < count; ++i )
			{
				Item child = (Item)items[i];

				if ( !child.Deleted && child.Parent == beheld && beholder.CanSee( child ) )
				{
					m_Stream.Write( (int) child.Serial );
					m_Stream.Write( (ushort) child.ItemID );
					m_Stream.Write( (byte) 0 ); // signed, itemID offset
					m_Stream.Write( (ushort) child.Amount );
					m_Stream.Write( (short) child.X );
					m_Stream.Write( (short) child.Y );
					m_Stream.Write( (int) beheld.Serial );
					m_Stream.Write( (ushort) child.Hue );

					++written;
				}
			}

			m_Stream.Seek( pos, SeekOrigin.Begin );
			m_Stream.Write( (ushort) written );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:35,代码来源:SleeperBedBodyEquip.cs

示例6: BlessingOfKhopesh_OnTarget

		public virtual void BlessingOfKhopesh_OnTarget( Mobile from, object target )
		{
			if( !from.CanSee( target ) )
			{
				from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
			}
			else if( target is Mobile )
			{
				Mobile t = (Mobile)target;
				
				if( !from.InRange( t.Location, 10 ) )
					from.SendMessage( "That is too far away." );
				
				t.BoltEffect( 2 );
				Effects.SendLocationParticles( EffectItem.Create( new Point3D( t.X, t.Y, t.Z + 10 ), t.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
				t.PlaySound( 0x1E1 );
				
				t.Hidden = true;
				t.AllowedStealthSteps = Utility.RandomMinMax( 50, 75 );
				
				from.SendMessage( "You have hidden your target well." );
				t.SendMessage( "You have been hidden well, and can move quietly in the shadows." );
				
				t.AddToBackpack( new KhoMarkGem() );
				
				this.Delete();
			}
			else
			{
				from.SendMessage( "This would not work on that." );
			}

			from.Frozen = false;
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:34,代码来源:SpellScrolls.cs

示例7: Diaper

        public bool Diaper(Mobile from, Diaper Diaper)
        {
            if (Deleted || !from.CanSee(this)) return false;

            from.AddToBackpack(new DirtyDiaper());

            return true;
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:8,代码来源:Baby.cs

示例8: OnHit

        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker )  )
                return;

            ClearCurrentAbility( attacker );

            Map map = attacker.Map;

            if ( map == null )
                return;

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if ( weapon == null )
                return;

            if ( !CheckMana( attacker, true ) )
                return;

            attacker.FixedEffect( 0x3728, 10, 15 );
            attacker.PlaySound( 0x2A1 );

            ArrayList list = new ArrayList();

            foreach ( Mobile m in attacker.GetMobilesInRange( 1 ) )
                list.Add( m );

            Party p = Party.Get( attacker );

            for ( int i = 0; i < list.Count; ++i )
            {
                Mobile m = (Mobile)list[i];

                if (m != defender && m != attacker &&
                    SpellHelper.ValidIndirectTarget(attacker, m) &&
                    attacker.CanBeHarmful(m, false) &&
                    (p == null || !p.Contains(m)))
                {
                    if ( m == null || m.Deleted || attacker.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.Alive || !attacker.CanSee( m ) )
                        continue;

                    if ( !attacker.InRange( m, weapon.MaxRange ) )
                        continue;

                    if ( attacker.InLOS( m ) )
                    {
                        attacker.RevealingAction();

                        attacker.SendLocalizedMessage( 1060161 ); // The whirling attack strikes a target!
                        m.SendLocalizedMessage( 1060162 ); // You are struck by the whirling attack and take damage!

                        weapon.OnHit( attacker, m );
                    }
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:57,代码来源:WhirlwindAttack.cs

示例9: CanUse

 public static bool CanUse(Mobile from, Mobile target, bool harm)
 {
     if (!CanUse(from) || target == null)
         return false;
     else if (!from.CanSee(target))
         return false;
     else
         return CanTarget(from, target, harm);
 }
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:9,代码来源:Abilities.cs

示例10: Scissor

		public bool Scissor( Mobile from, Scissors scissors )
		{
			if ( Deleted || !from.CanSee( this ) )
				return false;

			base.ScissorHelper( from, new Bandage(), 1 );

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

示例11: Scissor

		public bool Scissor( Mobile from, Scissors scissors )
		{
			if ( Deleted || !from.CanSee( this ) )
				return false;

			base.ScissorHelper( from, new Bone(), 1 );
			from.PlaySound( 0x21B );

			return false;
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:10,代码来源:PelvisBone.cs

示例12: Dye

		public virtual bool Dye(Mobile mob, DyeTub sender)
		{
			if (mob == null || sender == null || !mob.CanSee(sender) || !sender.IsAccessibleTo(mob))
			{
				return false;
			}

			Hue = sender.DyedHue;
			return true;
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:10,代码来源:BaseTrashContainer.cs

示例13: OnDoubleClick

		public virtual void OnDoubleClick( Mobile from, bool createWeedsAndDelete )
		{
			if( !from.CanSee( this ) )
			{
				from.SendMessage( "You cannot see that." );
			}
			else if( !(this is HarvestableTree) && !from.InRange( this, 1 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( this is HarvestableTree && !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( (Sower != null && from != m_Sower) && !(this is HarvestableTree) )
			{
				from.SendMessage( "You cannot harvest any of this crop." );
			}
			else if( from.Mounted )
			{
				from.SendMessage( "You cannot do this while riding a mount." );
			}
			else
			{
				int calcYield = CalculateYield( from );
				Item crop = null;

				try { crop = CreateCrop( calcYield ); }
				catch( Exception e ) { Server.Utilities.ExceptionManager.LogException( "BaseGrownCrop.cs", e ); }

				if( crop == null )
				{
					from.SendMessage( "You are unable to harvest any of this crop!" );
				}
				else
				{
					from.AddToBackpack( crop );

					from.Direction = from.GetDirectionTo( this );
					from.Animate( AnimationFrame, 5, 1, true, false, 0 );
					from.PlaySound( 0x133 );
					from.SendMessage( "You successfully harvest the crop!" );
				}

				if( createWeedsAndDelete )
				{
					new Weeds().MoveToWorld( this.Location, this.Map );
					this.Delete();
				}
				else
				{
					OnHarvest( from );
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:55,代码来源:BaseGrownCrop.cs

示例14: Scissor

        public bool Scissor(Mobile from, Scissors scissors)
        {
            if (Deleted || !from.CanSee(this)) return false;

            //base.ScissorHelper(from, new Cloth(), 50);

            from.SendMessage("You removed the tag from the pillow, that is illegal.  You are now a criminal.");
            from.Criminal = true;

            return true;
        }
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:11,代码来源:TaggedPillow.cs

示例15: OnStatsQuery

		public override void OnStatsQuery( Mobile from )
		{
			if ( from.Map == this.Map && Utility.InUpdateRange( this, from ) && from.CanSee( this ) )
			{
				BaseHouse house = BaseHouse.FindHouseAt( this );

				if ( house != null && house.IsCoOwner( from ) )
					from.SendLocalizedMessage( 1072625 ); // As the house owner, you may rename this Parrot.
					
				from.Send( new Server.Network.MobileStatus( from, this ) );
			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:12,代码来源:PetParrot.cs


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