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


C# PlayerMobile.FindItemOnLayer方法代码示例

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


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

示例1: isEnnemi

      private bool isEnnemi(PlayerMobile from, TownStone town)
      {    	
      	PomiCloak pomicloak = from.FindItemOnLayer(Layer.Cloak) as PomiCloak;
      	if(pomicloak != null && pomicloak.Name == "Ambassadeur")
				return false;

        foreach (TownStone ville in town.Guerre)
            if (ville.isCitoyen(from))
                return true;

      	return false;
      }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:12,代码来源:PomiAI.cs

示例2: OnTalk

        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            Direction = this.GetDirectionTo( player );
            Animate( 33, 20, 1, true, false, 0 );

            QuestSystem qs = player.Quest;

            if ( qs is WitchApprenticeQuest )
            {
                FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;

                if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.Whiskey )
                {
                    PlaySound( Utility.RandomBool() ? 0x42E : 0x43F );

                    Item hat = player.FindItemOnLayer( Layer.Helm );
                    bool tricorne = hat is TricorneHat;

                    if ( tricorne && player.BAC >= 20 )
                    {
                        obj.Complete();

                        if ( obj.BlackheartMet )
                        {
                            qs.AddConversation( new BlackheartPirateConversation( false ) );
                        }
                        else
                        {
                            qs.AddConversation( new BlackheartPirateConversation( true ) );
                        }
                    }
                    else if ( !obj.BlackheartMet )
                    {
                        obj.Complete();

                        qs.AddConversation( new BlackheartFirstConversation() );
                    }
                    else
                    {
                        qs.AddConversation( new BlackheartNoPirateConversation( tricorne, player.BAC > 0 ) );
                    }

                    return;
                }
            }

            PlaySound( 0x42C );
            SayTo( player, 1055041 ); // The drunken pirate shakes his fist at you and goes back to drinking.
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:49,代码来源:Blackheart.cs

示例3: GetArmourBiteProtection

        private static double GetArmourBiteProtection( PlayerMobile pm )
        {
            double biteProtection = 0;
            // Protection based on a fixed rate of 2% for regular zombies
            // So full armour would block all of the chance of zombie bites

            // If you're wearing a shield
            double shieldFactor = 0.3;
            if ( pm.ShieldArmor as BaseShield != null )
                biteProtection += shieldFactor;

            // If you're wearing boots
            double feetFactor = 0.1;
            Item shoes = pm.FindItemOnLayer( Layer.Shoes );
            if( shoes != null )
            {
                if( shoes is Shoes )
                {
                    biteProtection += feetFactor * 0.66;
                }
                else if ( shoes is Boots || shoes is ThighBoots )
                {
                    biteProtection += feetFactor;
                }
            }

            Dictionary<BaseArmor, double> armourRatings = new Dictionary<BaseArmor, double>();
            if ( pm.NeckArmor as BaseArmor != null )
                armourRatings.Add( pm.NeckArmor as BaseArmor, 0.3 );
            if ( pm.HeadArmor as BaseArmor != null )
                armourRatings.Add( pm.HeadArmor as BaseArmor, 0.3 );
            if ( pm.ChestArmor as BaseArmor != null )
                armourRatings.Add( pm.ChestArmor as BaseArmor, 0.2 );
            if ( pm.LegsArmor as BaseArmor != null )
                armourRatings.Add( pm.LegsArmor as BaseArmor, 0.2 );
            if ( pm.HandArmor as BaseArmor != null )
                armourRatings.Add( pm.HandArmor as BaseArmor, 0.3 );
            if ( pm.ArmsArmor as BaseArmor != null )
                armourRatings.Add( pm.ArmsArmor as BaseArmor, 0.3 );

            foreach(KeyValuePair<BaseArmor, double> entry in armourRatings)
            {
                if( entry.Key != null )
                    biteProtection += GetResourceScale( entry.Key.Resource ) * entry.Value;
            }

            return biteProtection;
        }
开发者ID:jsrn,项目名称:ZUOmbies,代码行数:48,代码来源:ZombieInfection.cs

示例4: RemoveRobe

		public void RemoveRobe( PlayerMobile pm )
		{
			if ( pm != null )
			{
				GameRobe gr = pm.FindItemOnLayer( Layer.OuterTorso ) as GameRobe;
				if ( gr != null )
					gr.Delete();
				if ( pm.Backpack != null )
				{
					Item[] items = pm.Backpack.FindItemsByType( typeof(GameRobe) );
					for ( int i = items.Length-1; i > 0; i-- )
						items[i].Delete();
				}
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:15,代码来源:EGate.cs

示例5: LoadPlayer

        public void LoadPlayer(PlayerMobile pm)
        {
            Backpack pack = (Backpack)pm.Backpack;
			//pm.SendMessage(String.Format("SettingBackpack"));
			
			TeleportAllPets( pm, (Point3D)PlayerLocations[pm.Serial], (Map)PlayerMaps[pm.Serial] );
			
            pm.Location = (Point3D)PlayerLocations[pm.Serial];
			PlayerLocations.Remove(pm.Serial);
			//pm.SendMessage(String.Format("SettingLocation"));
			
            pm.Map = (Map)PlayerMaps[pm.Serial];
			PlayerMaps.Remove(pm.Serial);
			//pm.SendMessage(String.Format("SettingMap"));

            ArrayList items = (ArrayList)PlayerItems[pm.Serial];
			PlayerItems.Remove(pm.Serial);
			//pm.SendMessage(String.Format("Setting Arraylist of Items"));
            for (int i = 0; i < items.Count; ++i)
            {
				//pm.SendMessage(String.Format("LoadPlayer() {0} / {1}.", i , items.Count));
                Item item = (Item)items[i];
                if (item.Layer == Layer.Invalid)
                {
					//pm.SendMessage(String.Format("Layer Invalid!"));
                    item.Location = (Point3D)ItemLocations[item.Serial];
					ItemLocations.Remove(item.Serial);
                    pack.AddItem(item);
                }
                else
                {
                    Item test = (Item)pm.FindItemOnLayer(item.Layer);

                    if (test == null || test == item)
                    {
						ItemLocations.Remove(item.Serial);
                        pm.EquipItem(item);
                        test = (Item)pm.FindItemOnLayer(item.Layer);
                        if ( test == null )
                        	pack.AddItem(item);
                    }
                    else
                    {
                        item.Location = (Point3D)ItemLocations[item.Serial];
						ItemLocations.Remove(item.Serial);
                        if (item != pm.Backpack && item != pm.BankBox)
                            pack.AddItem(item);
                    }
                }
            }
	    
        }
开发者ID:nick12344356,项目名称:The-Basement,代码行数:52,代码来源:FieldController.cs

示例6: FreeThem

		public static void FreeThem( PlayerMobile player )
		{
			if ( null == player )
				return;

			// Take away any JailRock
			// No need to recurse containers since all their items were removed when jailed
			RemoveRockFromList( new ArrayList( player.Items ) ); 
			RemoveRockFromList( new ArrayList( player.Backpack.Items ) ); 

			// Restore their access level
			JailHammer hammer = player.FindItemOnLayer( Layer.OneHanded ) as JailHammer;

			if ( null != hammer )
			{
				player.AccessLevel = hammer.PlayerAccessLevel;
				hammer.Delete();
			}

			if ( player.Kills >= 5 )
				player.MoveToWorld( JailConfig.FreeMurdererLocation, JailConfig.FreeMurdererMap );
			else
				player.MoveToWorld( JailConfig.FreeLocation, JailConfig.FreeMap );
			player.SendMessage( "You have been released from Jail!" );
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:25,代码来源:JailCommand.cs

示例7: CheckPenalty

        public static void CheckPenalty( PlayerMobile m, Layer layer )
        {
            BaseArmor armor = m.FindItemOnLayer( layer ) as BaseArmor;

            if( armor != null && armor is BaseArmor )
            {
                if( armor.ArmourType == ArmourWeight.Light )
                {
                    if( armor.Attributes.BonusStam < 1 )
                        m.LightPieces++;

                    m.LightPenalty += armor.Attributes.BonusStam;
                }

                else if( armor.ArmourType == ArmourWeight.Medium )
                {
                    m.MediumPenalty += armor.Attributes.BonusStam;
                    m.MediumPieces++;
                }

                else
                {
                    m.HeavyPenalty += armor.Attributes.BonusStam;
                    m.HeavyPieces++;
                }

                m.ArmourPieces++;
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:29,代码来源:PlayerMobile.cs


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