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


C# Mobile.FindItemOnLayer方法代码示例

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


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

示例1: IsEnemy

		public override bool IsEnemy( Mobile m )
		{
			if ( m.Player && m.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
				return false;

			return base.IsEnemy( m );
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:7,代码来源:OrcScout.cs

示例2: VerifyCast

		public static bool VerifyCast( Mobile Caster, bool messages )
		{
			if( Caster == null ) // Sanity
				return false;

			BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if( weap == null )
				weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( weap != null ) {
				if ( Core.ML && Caster.Skills[weap.Skill].Base < 50 ) {
					if ( messages ) {
						Caster.SendLocalizedMessage( 1076206 ); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
					}
					return false;
				}
			} else if ( !( Caster.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 1062944 ); // You must have a weapon or a shield equipped to use this ability!
				}
				return false;
			}

			if ( !Caster.CanBeginAction( typeof( Evasion ) ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
				}
				return false;
			}

			return true;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:33,代码来源:Evasion.cs

示例3: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (from.FindItemOnLayer(Layer.OneHanded) is SmithHammer)
            {
                bool hasForge, hasAnvil;
                DefBlacksmithy.CheckAnvilAndForge(from, 4, out hasAnvil, out hasForge);

                if (hasForge && hasAnvil)
                {
                    CraftSubRes subRes = CustomCraftMenu.GetSubRes(DefBlacksmithy.CraftSystem, GetType(), null);
                    int num = CraftResources.GetIndex(m_Resource);

                    if (subRes == null || !CustomCraftMenu.ResourceInfoList.ContainsKey(subRes))
                    {
                        from.SendAsciiMessage("You can't use that.");
                        return;
                    }

                    if (from.Skills[DefBlacksmithy.CraftSystem.MainSkill].Base < subRes.RequiredSkill)
                    {
                        from.SendAsciiMessage("You cannot work this strange and unusual metal.");
                        return;
                    }

                    from.SendGump(new CraftGump(from, DefBlacksmithy.CraftSystem, (BaseTool)from.FindItemOnLayer(Layer.OneHanded), null, num));
                }
                else
                    from.SendAsciiMessage("You need to be close to a forge and anvil.");
            }
            else
                from.SendAsciiMessage("You need to equip a smith's hammer.");

            base.OnDoubleClick(from);
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Ingots.cs

示例4: CheckSpellEvasion

		public static bool CheckSpellEvasion( Mobile defender )
		{
			BaseWeapon weap = defender.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if ( weap == null )
				weap = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( Core.ML ) {
				if ( defender.Spell != null && defender.Spell.IsCasting ) {
					return false;
				}
				
				if ( weap != null ) {
					if ( defender.Skills[weap.Skill].Base < 50  ) {
						return false;
					}
				} else if ( !( defender.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
					return false;
				}
			}
			
			if ( IsEvading( defender ) && BaseWeapon.CheckParry( defender ) ) {
				defender.Emote( "*evades*" ); // Yes.  Eew.  Blame OSI.
				defender.FixedEffect( 0x37B9, 10, 16 );
				return true;
			}

			return false;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:29,代码来源:Evasion.cs

示例5: FullSet

 public static bool FullSet( Mobile m )
 {
     return m.FindItemOnLayer( Layer.Gloves ) is HunterGloves
         && m.FindItemOnLayer( Layer.Pants ) is HunterLeggings
         && m.FindItemOnLayer( Layer.Arms ) is HunterSleeves
         && m.FindItemOnLayer( Layer.InnerTorso ) is HunterTunic;
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:HunterSet.cs

示例6: OnHit

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

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:35,代码来源:Disarm.cs

示例7: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendLocalizedMessage(502138); // That is too far away for you to use
                return;
            }
            else if (from != this.m_Caster)
            {
                // from.SendLocalizedMessage( ); // 
                return;
            }

            BaseWeapon weapon = from.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;

            if (weapon == null)
                weapon = from.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;

            if (weapon != null)
            {
                from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone.
            }
            else if (from.BeginAction(typeof(BaseHealPotion)))
            {
                from.Heal(Utility.RandomMinMax(BasePotion.Scale(from, 13), BasePotion.Scale(from, 16)));
                this.Consume();
                Timer.DelayCall(TimeSpan.FromSeconds(8.0), new TimerStateCallback(ReleaseHealLock), from);
            }
            else
                from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone.
        }
开发者ID:m309,项目名称:ForkUO,代码行数:31,代码来源:HealingStone.cs

示例8: OnHit

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

            ClearCurrentAbility(attacker);
            Item toDisrobe = defender.FindItemOnLayer(Layer.InnerTorso);

            if (toDisrobe == null || !toDisrobe.Movable)
                toDisrobe = defender.FindItemOnLayer(Layer.OuterTorso);

            Container pack = defender.Backpack;

            if (pack == null || toDisrobe == null || !toDisrobe.Movable)
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (this.CheckMana(attacker, true))
            {
                //attacker.SendLocalizedMessage( 1060092 ); // You disarm their weapon!
                defender.SendLocalizedMessage(1062002); // You can no longer wear your ~1_ARMOR~

                defender.PlaySound(0x3B9);
                //defender.FixedParticles( 0x37BE, 232, 25, 9948, EffectLayer.InnerTorso );

                pack.DropItem(toDisrobe);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:30,代码来源:Disrobe.cs

示例9: FullSet

 public static bool FullSet( Mobile m )
 {
     return m.FindItemOnLayer( Layer.Gloves ) is AssassinGloves
         && m.FindItemOnLayer( Layer.Pants ) is AssassinLeggings
         && m.FindItemOnLayer( Layer.Arms ) is AssassinSleeves
         && m.FindItemOnLayer( Layer.InnerTorso ) is AssassinTunic;
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:AssassinSet.cs

示例10: OnEquip

		public override bool OnEquip( Mobile from )
		{
			Item item = from.FindItemOnLayer( Layer.TwoHanded );
			
			if ( item != null && item.GetType() == typeof( MalekisHonor ) )
			{
				
				Effects.PlaySound( from.Location, from.Map, 503 );
				from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
				
				Hue = 0x388;
				WeaponAttributes.SelfRepair = 3;
				Attributes.WeaponSpeed = 35;
				MalekisHonor shield = from.FindItemOnLayer( Layer.TwoHanded ) as MalekisHonor;
				shield.Hue = 0x388;
				shield.Attributes.BonusStr = 10;
				shield.Attributes.DefendChance = 10;
				shield.ArmorAttributes.SelfRepair = 3;
				
				from.SendLocalizedMessage( 1072391 );
				
			}
			
			this.InvalidateProperties();
			return base.OnEquip( from );
			
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:27,代码来源:EvocaricusSword.cs

示例11: FullSet

 public static bool FullSet( Mobile m )
 {
     return m.FindItemOnLayer( Layer.Gloves ) is AcolyteGloves
         && m.FindItemOnLayer( Layer.Pants ) is AcolyteLeggings
         && m.FindItemOnLayer( Layer.Arms ) is AcolyteSleeves
         && m.FindItemOnLayer( Layer.InnerTorso ) is AcolyteTunic;
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:AcolyteSet.cs

示例12: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Helm ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.LowerManaCost, 10 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +10 necromancy (total)
            SkillMod skillmod = new DefaultSkillMod( SkillName.Necromancy, true, 10.0 );
            skillmod.ObeyCap = true;
            m_Table.Add( m, skillmod );
            m.AddSkillMod( skillmod );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:27,代码来源:NecromancerSet.cs

示例13: FullSet

 public static bool FullSet( Mobile m )
 {
     return m.FindItemOnLayer( Layer.Gloves ) is DeathsEssenceGloves
         && m.FindItemOnLayer( Layer.Pants ) is DeathsEssenceLeggings
         && m.FindItemOnLayer( Layer.Arms ) is DeathsEssenceSleeves
         && m.FindItemOnLayer( Layer.Helm ) is DeathsEssenceHelm
         && m.FindItemOnLayer( Layer.InnerTorso ) is DeathsEssenceTunic;
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:8,代码来源:NecromancerSet.cs

示例14: FullSet

        public static bool FullSet( Mobile m )
        {
            if ( m == null )
                return false;

            return m.FindItemOnLayer( Layer.Bracelet ) is NovoBleue
                && m.FindItemOnLayer( Layer.Ring ) is EtoileBleue;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:8,代码来源:LuckJewelrySet.cs

示例15: FullSet

        public static bool FullSet( Mobile m )
        {
            if ( m == null )
                return false;

            return m.FindItemOnLayer( Layer.Cloak ) is Feathernock
                && m.FindItemOnLayer( Layer.TwoHanded ) is Swiftflight;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:8,代码来源:MarksmanSet.cs


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