コード例 #1
0
ファイル: PBGameItem.cs プロジェクト: FreeReign/imaginenation
		public void AddPlayer ( Mobile from )
		{
			if ( NpcPlayers != null )
			{
				
			}
			else
			{
				NpcPlayers = new ArrayList();
			}
			
			if ( Players != null )
			{
				
			}
			else
			{
				Players = new ArrayList();
			}
			
			if ( from is PBNpc )
			{
				if ( NpcPlayers != null )
				{
				NpcPlayers.Add( from  );
				AddToTeam( from );
	
				}
			}
			else
			{
				if (Players != null )
				{
					Players.Add( from );
					ArrayList ItemsToMove = new ArrayList();
					ArrayList LayerItems = new ArrayList();
					
					LayerPack LayerP = new LayerPack();
				    ItemsPack ItemsP = new ItemsPack();
					ItemsP.Hue = 1;
					LayerP.Hue = 1;
					LayerP.Name = "Layer from PaintBallGame";
					ItemsP.Name = "Items from PaintBallGame";
					BankBox bankBox = from.BankBox;

					foreach( Item item in from.Items )
						if( item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack )
						LayerItems.Add( item );

                    if (from.Backpack != null)
                    {
                        foreach (Item item in from.Backpack.Items)
                            ItemsToMove.Add(item);
                    }

				    foreach( Item item in ItemsToMove )
						ItemsP.AddItem( item );
					
					foreach( Item item in LayerItems )
						LayerP.AddItem( item );

					
					
					bankBox.AddItem( ItemsP );
					bankBox.AddItem( LayerP );
					

					bankBox.AddItem( new PBPlayerStorage( from ) );

					AddToTeam( from );
				}
			}
			
		}
コード例 #2
0
        public void AddPlayer(Mobile from)
        {
            if (NpcPlayers != null)
            {
            }
            else
            {
                NpcPlayers = new ArrayList();
            }

            if (Players != null)
            {
            }
            else
            {
                Players = new ArrayList();
            }

            if (from is PBNpc)
            {
                if (NpcPlayers != null)
                {
                    NpcPlayers.Add(from);
                    AddToTeam(from);
                }
            }
            else
            {
                if (Players != null)
                {
                    Players.Add(from);
                    ArrayList ItemsToMove = new ArrayList();
                    ArrayList LayerItems  = new ArrayList();

                    LayerPack LayerP = new LayerPack();
                    ItemsPack ItemsP = new ItemsPack();
                    ItemsP.Hue  = 1;
                    LayerP.Hue  = 1;
                    LayerP.Name = "Layer from PaintBallGame";
                    ItemsP.Name = "Items from PaintBallGame";
                    BankBox bankBox = from.BankBox;

                    foreach (Item item in from.Items)
                    {
                        if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack)
                        {
                            LayerItems.Add(item);
                        }
                    }

                    if (from.Backpack != null)
                    {
                        foreach (Item item in from.Backpack.Items)
                        {
                            ItemsToMove.Add(item);
                        }
                    }

                    foreach (Item item in ItemsToMove)
                    {
                        ItemsP.AddItem(item);
                    }

                    foreach (Item item in LayerItems)
                    {
                        LayerP.AddItem(item);
                    }



                    bankBox.AddItem(ItemsP);
                    bankBox.AddItem(LayerP);


                    bankBox.AddItem(new PBPlayerStorage(from));

                    AddToTeam(from);
                }
            }
        }