當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。