public GobletOfCelebration( BeverageType type )
     : base(type)
 {
     LootType = LootType.Blessed;
     Weight = 1.0;
     Hue = 1158;
 }
Ejemplo n.º 2
0
		public MurkyMilk( BeverageType type )
			: base( type )
		{
			Name = "Murky Milk";
			Weight = 1.0;
			Hue = 2306;
			LootType = LootType.Blessed;
		}
Ejemplo n.º 3
0
		public BeverageBuyInfo( string name, Type type, BeverageType content, int price, int amount, int itemID, int hue ) : base( name, type, price, amount, itemID, hue )
		{
			m_Content = content;

			if ( type == typeof( Pitcher ) )
				Name = (1048128 + (int)content).ToString();
			else if ( type == typeof( BeverageBottle ) )
				Name = (1042959 + (int)content).ToString();
			else if ( type == typeof( Jug ) )
				Name = (1042965 + (int)content).ToString();
		}
Ejemplo n.º 4
0
        /// <summary>
        /// Get Coffee given the Beverage Type
        /// Is Factory Method
        /// </summary>
        /// <param name="beverageType"></param>
        /// <returns></returns>
        public IBeverage GetCoffee(BeverageType beverageType)
        {
            IBeverage coffee = null;

            switch (beverageType)
            {
                case BeverageType.HouseBlend:
                    coffee = new SpecialHouseBlend();
                    break;

                case BeverageType.Roast:
                    coffee = new AmazonRoast();
                    break;
            }

            return coffee;
        }
Ejemplo n.º 5
0
        public IBeverage GetCoffee(StoreType storeType, BeverageType beverageType)
        {
            IBeverage coffee = null;

            switch(storeType)
            {
                case StoreType.RegularStore :

                    switch (beverageType)
                    {
                        case BeverageType.HouseBlend:
                            coffee = new HouseBlend();
                            break;

                        case BeverageType.Roast:
                            coffee = new DarkRoast();
                            break;
                    }
                    break;

                case StoreType.ExoticStore:

                    switch (beverageType)
                    {
                        case BeverageType.HouseBlend:
                            coffee = new SpecialHouseBlend();
                            break;

                        case BeverageType.Roast:
                            coffee = new AmazonRoast();
                            break;
                    }
                    break;
            }

            return coffee;
        }
Ejemplo n.º 6
0
 public BaseBeverage(BeverageType type)
 {
     this.m_Content = type;
     this.m_Quantity = this.MaxQuantity;
     this.ItemID = this.ComputeItemID();
 }
Ejemplo n.º 7
0
 public async Task ExtractBeverageFromStoreAsync(BeverageType beverageType)
 {
     beverageType.BeverageStore.Quantity--;
     await db.SaveChangesAsync();
 }
Ejemplo n.º 8
0
 public PewterMug(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 9
0
 public Jug(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 10
0
 public Beverage(string name, string description, double price, double discount, PaymentOption paymentOption, BeverageType beverateType) :
     base(name, description, price, discount, paymentOption)
 {
     BeverageType = beverateType;
 }
Ejemplo n.º 11
0
		public BeverageBottle( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 12
0
		public PewterMug( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 13
0
		public BaseBeverage( BeverageType type )
		{
			m_Content = type;
			m_Quantity = MaxQuantity;
			ItemID = ComputeItemID();
		}
Ejemplo n.º 14
0
		public override void Deserialize( GenericReader reader )
		{
			//handle base StoreEntry deserialization first
			base.Deserialize( reader );
			int version = reader.ReadInt();
			
			switch( version )
			{
				case 0:
				default:
				{
					_BeverageType = (BeverageType)reader.ReadInt();
					break;
				}
				
			}
			
		}//deserialize		
Ejemplo n.º 15
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 4:
					ContentName = reader.ReadString();
					goto case 3;
				case 3:
				case 2:
					Kick = reader.ReadInt();
					goto case 1;
				case 1:
					Poisoner = reader.ReadMobile();
					goto case 0;
				case 0:
					{
						Poison = Poison.Deserialize(reader);
						_Content = (BeverageType)reader.ReadInt();
						_Quantity = reader.ReadInt();
					}
					break;
			}
		}
Ejemplo n.º 16
0
        public Beverage(BeverageType beverageType, Size size)
        {
            switch (beverageType)
            {
            case BeverageType.Imsdal:
            {
                this.Name = "Imsdal ";
                switch (size)
                {
                case Size.Small:
                    this.Price = 3;
                    break;

                case Size.Medium:
                    this.Price = 4;
                    break;

                case Size.Large:
                    this.Price = 5;
                    break;
                }
            }
            break;

            case BeverageType.Pepsi:
            {
                this.Name = "Pepsi  ";
                switch (size)
                {
                case Size.Small:
                    this.Price = 3;
                    break;

                case Size.Medium:
                    this.Price = 4;
                    break;

                case Size.Large:
                    this.Price = 5;
                    break;
                }
            }
            break;

            case BeverageType.Water:
            {
                this.Name = "Water  ";
                switch (size)
                {
                case Size.Small:
                    this.Price = 2;
                    break;

                case Size.Medium:
                    this.Price = 3;
                    break;

                case Size.Large:
                    this.Price = 4;
                    break;
                }
            }
            break;

            case BeverageType.Juice:
            {
                this.Name = "Juice  ";
                switch (size)
                {
                case Size.Small:
                    this.Price = 1;
                    break;

                case Size.Medium:
                    this.Price = 2;
                    break;

                case Size.Large:
                    this.Price = 3;
                    break;
                }
            }
            break;

            case BeverageType.Julmust:
            {
                this.Name = "Julmust";
                switch (size)
                {
                case Size.Small:
                    this.Price = 4;
                    break;

                case Size.Medium:
                    this.Price = 5;
                    break;

                case Size.Large:
                    this.Price = 6;
                    break;
                }
            }
            break;
            }
        }
Ejemplo n.º 17
0
 public Beverage(string mark, BeverageType type)
 {
     this.Mark           = mark;
     this.typeOfBeverage = type;
 }
Ejemplo n.º 18
0
 public SprinklerContainer(BeverageType type) : base(type)
 {
     Weight = 5.0;
 }
 public MagicalKegOfWater(BeverageType type) : base(type)
 {
     Weight = 10.0;
     Name   = "Magical Keg of Water";
     ItemID = 6464;
 }
Ejemplo n.º 20
0
 public GreenGlass(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 21
0
		//default constructor: set up one type, a name, an amount, and default size/offset of artwork
		public BeverageEntry( Type type, BeverageType beveragetype, string name, int amount ) : this( type, beveragetype, name, amount, 25, 0, 0 )
		{
		}
Ejemplo n.º 22
0
 public Beverage(BeverageType itemName, double price)
 {
     ItemName = itemName;
     Price    = price;
 }
Ejemplo n.º 23
0
		public static bool ConsumeTotal( Container pack, BeverageType content, int quantity )
		{
			return ConsumeTotal( pack, typeof( BaseBeverage ), content, quantity );
		}
Ejemplo n.º 24
0
 public GobletOfCelebration(BeverageType type) : base(type)
 {
     LootType = LootType.Blessed;
     Weight   = 1.0;
     Hue      = 1158;
 }
Ejemplo n.º 25
0
		public Jug( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 26
0
        public Item Construct()
        {
            if (m_Type == null)
            {
                return(null);
            }

            Item item;

            try
            {
                if (m_Type == typeofStatic)
                {
                    item = new Static(m_ItemID);
                }
                else if (m_Type == typeofLocalizedStatic)
                {
                    int labelNumber = 0;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("LabelNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                labelNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                                break;
                            }
                        }
                    }

                    item = new LocalizedStatic(m_ItemID, labelNumber);
                }
                else if (m_Type == typeofLocalizedSign)
                {
                    int labelNumber = 0;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("LabelNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                labelNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                                break;
                            }
                        }
                    }

                    item = new LocalizedSign(m_ItemID, labelNumber);
                }
                else if (m_Type == typeofAnkhWest || m_Type == typeofAnkhNorth)
                {
                    bool bloodied = false;

                    for (int i = 0; !bloodied && i < m_Params.Length; ++i)
                    {
                        bloodied = m_Params[i] == "Bloodied";
                    }

                    if (m_Type == typeofAnkhWest)
                    {
                        item = new AnkhWest(bloodied);
                    }
                    else
                    {
                        item = new AnkhNorth(bloodied);
                    }
                }
                else if (m_Type == typeofHintItem)
                {
                    int      range         = 0;
                    int      messageNumber = 0;
                    string   messageString = null;
                    int      hintNumber    = 0;
                    string   hintString    = null;
                    TimeSpan resetDelay    = TimeSpan.Zero;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Range"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("HintString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                hintString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("HintNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("ResetDelay"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                resetDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    HintItem hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);

                    hi.WarningString = messageString;
                    hi.HintString    = hintString;
                    hi.ResetDelay    = resetDelay;

                    item = hi;
                }
                else if (m_Type == typeofWarningItem)
                {
                    int      range         = 0;
                    int      messageNumber = 0;
                    string   messageString = null;
                    TimeSpan resetDelay    = TimeSpan.Zero;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Range"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("ResetDelay"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                resetDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    WarningItem wi = new WarningItem(m_ItemID, range, messageNumber);

                    wi.WarningString = messageString;
                    wi.ResetDelay    = resetDelay;

                    item = wi;
                }
                else if (m_Type == typeofSerpentPillar)
                {
                    string      word        = null;
                    Rectangle2D destination = new Rectangle2D();

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Word"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                word = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("DestStart"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("DestEnd"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                destination.End = Point2D.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    item = new SerpentPillar(word, destination);
                }
                else if (m_Type.IsSubclassOf(typeofBeverage))
                {
                    BeverageType content = BeverageType.Liquor;
                    bool         fill    = false;

                    for (int i = 0; !fill && i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Content"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                content = (BeverageType)Enum.Parse(typeof(BeverageType), m_Params[i].Substring(++indexOf),
                                                                   true);
                                fill = true;
                            }
                        }
                    }

                    item = fill ? m_Type.CreateInstance <Item>(content) : m_Type.CreateInstance <Item>();
                }
                else if (m_Type.IsSubclassOf(typeofBaseDoor))
                {
                    DoorFacing facing = DoorFacing.WestCW;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Facing"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                facing = (DoorFacing)Enum.Parse(typeof(DoorFacing), m_Params[i].Substring(++indexOf), true);
                                break;
                            }
                        }
                    }

                    item = m_Type.CreateInstance <Item>(facing);
                }
                else
                {
                    item = m_Type.CreateInstance <Item>();
                }
            }
            catch (Exception e)
            {
                throw new TypeInitializationException(m_Type.ToString(), e);
            }

            if (item is BaseAddon addon)
            {
                if (m_ItemID > 0)
                {
                    List <AddonComponent> comps = addon.Components;

                    for (int i = 0; i < comps.Count; ++i)
                    {
                        AddonComponent comp = comps[i];

                        if (comp.Offset == Point3D.Zero)
                        {
                            comp.ItemID = m_ItemID;
                        }
                    }
                }
            }
            else if (item is BaseLight light)
            {
                bool unlit = false, unprotected = false;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (!unlit && m_Params[i] == "Unlit")
                    {
                        unlit = true;
                    }
                    else if (!unprotected && m_Params[i] == "Unprotected")
                    {
                        unprotected = true;
                    }

                    if (unlit && unprotected)
                    {
                        break;
                    }
                }

                if (!unlit)
                {
                    light.Ignite();
                }
                if (!unprotected)
                {
                    light.Protected = true;
                }

                if (m_ItemID > 0)
                {
                    light.ItemID = m_ItemID;
                }
            }
            else if (item is RecallRune rune)
            {
                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Description"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Description = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("Marked"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("TargetMap"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Target"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Target = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }
            }
            else if (item is SkillTeleporter st)
            {
                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Skill"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
                        }
                    }
                    else if (m_Params[i].StartsWith("RequiredFixedPoint"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
                        }
                    }
                    else if (m_Params[i].StartsWith("Required"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MessageString"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.MessageString = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("MessageNumber"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            st.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    st.ItemID = m_ItemID;
                }
            }
            else if (item is KeywordTeleporter kt)
            {
                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Substring"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.Substring = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("Keyword"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Range"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            kt.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    kt.ItemID = m_ItemID;
                }
            }
            else if (item is Teleporter tp)
            {
                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    tp.ItemID = m_ItemID;
                }
            }
            else if (item is FillableContainer cont)
            {
                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("ContentType"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            cont.ContentType = (FillableContentType)Enum.Parse(typeof(FillableContentType),
                                                                               m_Params[i].Substring(++indexOf), true);
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    cont.ItemID = m_ItemID;
                }
            }
            else if (m_ItemID > 0)
            {
                item.ItemID = m_ItemID;
            }

            item.Movable = false;

            for (int i = 0; i < m_Params.Length; ++i)
            {
                if (m_Params[i].StartsWith("Light"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
                    }
                }
                else if (m_Params[i].StartsWith("Hue"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        int hue = Utility.ToInt32(m_Params[i].Substring(++indexOf));

                        if (item is DyeTub tub)
                        {
                            tub.DyedHue = hue;
                        }
                        else
                        {
                            item.Hue = hue;
                        }
                    }
                }
                else if (m_Params[i].StartsWith("Name"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        item.Name = m_Params[i].Substring(++indexOf);
                    }
                }
                else if (m_Params[i].StartsWith("Amount"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        // Must supress stackable warnings

                        bool wasStackable = item.Stackable;

                        item.Stackable = true;
                        item.Amount    = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        item.Stackable = wasStackable;
                    }
                }
            }

            return(item);
        }
Ejemplo n.º 27
0
		public GlassMug( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 28
0
 public Jug(BeverageType type)
     : base(type) =>
Ejemplo n.º 29
0
 public FillableBvrge(int weight, Type type, BeverageType content)
     : base(weight, type)
 {
     this.m_Content = content;
 }
Ejemplo n.º 30
0
 public BeverageBottle(BeverageType type)
     : base(type) =>
Ejemplo n.º 31
0
 public BaseBeverage(BeverageType type)
 {
     m_Content  = type;
     m_Quantity = MaxQuantity;
     ItemID     = ComputeItemID();
 }
Ejemplo n.º 32
0
 public void SetBeverageType(int index, BeverageType requiredBeverage)
 {
     CraftItems[index].RequiredBeverage = requiredBeverage;
 }
Ejemplo n.º 33
0
 public CeramicMug(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 34
0
		public GreenGlass( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 35
0
		public BeverageBuyInfo( Type type, BeverageType content, int price, int amount, int itemID, int hue ) : this( null, type, content, price, amount, itemID, hue )
		{
		}
 public FillableBvrge(Type type, BeverageType content) : this(1, type, content)
 {
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Constructor for a beverage
 /// </summary>
 /// <param name="Ingredients"></param>
 /// <param name="Instructions"></param>
 /// <param name="Name"></param>
 /// <param name="Type"></param>
 public void Drink(List<Ingredient> Ingredients, List<string> Instructions, string Name, BeverageType Type)
 {
 }
 public FillableBvrge(int weight, Type type, BeverageType content) : base(weight, type)
 {
     m_Content = content;
 }
Ejemplo n.º 39
0
		public static bool ConsumeTotal(Container pack, Type itemType, BeverageType content, int quantity)
		{
			Item[] items = pack.FindItemsByType(itemType);

			// First pass, compute total
			int total = items.OfType<BaseBeverage>()
							 .Where(bev => bev.Content == content && !bev.IsEmpty)
							 .Sum(bev => bev.Quantity);

			if (total >= quantity)
			{
				// We've enough, so consume it
				int need = quantity;

				foreach (BaseBeverage bev in items.OfType<BaseBeverage>())
				{
					if (bev.Content != content || bev.IsEmpty)
					{
						continue;
					}

					int theirQuantity = bev.Quantity;

					if (theirQuantity < need)
					{
						bev.Quantity = 0;
						need -= theirQuantity;
					}
					else
					{
						bev.Quantity -= need;
						return true;
					}
				}
			}

			return false;
		}
Ejemplo n.º 40
0
 public BaseBeverage(BeverageType type)
 {
     this.m_Content  = type;
     this.m_Quantity = this.MaxQuantity;
     this.ItemID     = this.ComputeItemID();
 }
Ejemplo n.º 41
0
		//default constructor: set up one type, a name, and default 0 quantity
		public BeverageEntry( Type type, BeverageType beveragetype, string name ) : this( type, beveragetype, name, 0 )
		{
		}
Ejemplo n.º 42
0
            private void ConsumeTotal(Mobile from, double percentage)
            {
                if (from == null || from.Backpack == null)
                {
                    return;
                }

                Container pack = from.Backpack;

                for (int i = 0; i < m_Def.Ingredients.Length; i++)
                {
                    Type type      = m_Def.Ingredients[i];
                    int  toConsume = m_Def.Amounts[i];

                    if (i == 0 && type == typeof(Yeast))
                    {
                        for (int j = 0; j < toConsume; j++)
                        {
                            Yeast yeast = m_Context.SelectedYeast[j];

                            if (yeast != null)
                            {
                                yeast.Consume();
                            }
                        }
                    }
                    else if (type == typeof(Pitcher))
                    {
                        toConsume = (int)(toConsume * percentage);
                        BeverageType bType = m_Def.Liquor == Liquor.Brandy ? BeverageType.Wine : BeverageType.Water;

                        Item[] items = pack.FindItemsByType(type);

                        foreach (Item item in items)
                        {
                            Pitcher Pitcher = item as Pitcher;

                            if (Pitcher != null && Pitcher.Content == bType && Pitcher.Quantity >= Pitcher.MaxQuantity)
                            {
                                Pitcher.Quantity = 0;
                                toConsume--;
                            }

                            if (toConsume <= 0)
                            {
                                break;
                            }
                        }
                    }
                    else if (type == typeof(PewterBowlOfCorn))
                    {
                        toConsume = (int)(toConsume * percentage);

                        int totalPewter = pack.GetAmount(type);
                        int totalWooden = pack.GetAmount(typeof(WoodenBowlOfCorn));

                        if (totalPewter >= toConsume)
                        {
                            pack.ConsumeTotal(type, toConsume);
                        }
                        else
                        {
                            pack.ConsumeTotal(type, totalPewter);
                            toConsume -= totalPewter;
                            pack.ConsumeTotal(typeof(WoodenBowlOfCorn), toConsume);
                        }
                    }
                    else
                    {
                        toConsume = (int)(toConsume * percentage);
                        pack.ConsumeTotal(type, toConsume);
                    }
                }
            }
Ejemplo n.º 43
0
		//master constructor: set up type, a name, an amount, and size/offset of artwork
		public BeverageEntry( Type type, BeverageType beveragetype, string name, int amount, int height, int x, int y ) : base( type, null, name, amount, height, x, y )
		{
			_BeverageType = beveragetype;
		}
Ejemplo n.º 44
0
        public void SetBeverageType(int index, BeverageType requiredBeverage)
        {
            CraftItem craftItem = this.m_CraftItems.GetAt(index);

            craftItem.RequiredBeverage = requiredBeverage;
        }
Ejemplo n.º 45
0
		public CraftItem(Type type, TextDefinition groupName, TextDefinition name)
		{
			m_arCraftRes = new CraftResCol();
			m_arCraftSkill = new CraftSkillCol();

			m_Type = type;

			m_GroupNameString = groupName;
			m_NameString = name;

			m_GroupNameNumber = groupName;
			m_NameNumber = name;

			m_RequiredBeverage = BeverageType.Water;
		}
Ejemplo n.º 46
0
 public Goblet(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 47
0
		public static bool ConsumeTotal( Container pack, Type itemType, BeverageType content, int quantity )
		{
			Item[] items = pack.FindItemsByType( itemType );

			// First pass, compute total
			int total = 0;

			for ( int i = 0; i < items.Length; ++i )
			{
				BaseBeverage bev = items[i] as BaseBeverage;

				if ( bev != null && bev.Content == content && !bev.IsEmpty )
					total += bev.Quantity;
			}

			if ( total >= quantity )
			{
				// We've enough, so consume it

				int need = quantity;

				for ( int i = 0; i < items.Length; ++i )
				{
					BaseBeverage bev = items[i] as BaseBeverage;

					if ( bev == null || bev.Content != content || bev.IsEmpty )
						continue;

					int theirQuantity = bev.Quantity;

					if ( theirQuantity < need )
					{
						bev.Quantity = 0;
						need -= theirQuantity;
					}
					else
					{
						bev.Quantity -= need;
						return true;
					}
				}
			}

			return false;
		}
Ejemplo n.º 48
0
 public GlassMug(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 49
0
		public void Deserialize( GenericReader reader, bool read )
		{
			base.Deserialize( reader );

			if ( !read )
				return;

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_Poisoner = reader.ReadMobile();
					goto case 0;
				}
				case 0:
				{
					m_Poison = Poison.Deserialize( reader );
					m_Content = (BeverageType)reader.ReadInt();
					m_Quantity = reader.ReadInt();
					break;
				}
			}
		}
Ejemplo n.º 50
0
 public Pitcher(BeverageType type) : base(type)
 {
     Weight = 2.0;
 }
Ejemplo n.º 51
0
		public CeramicMug( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 52
0
 public BeverageBottle(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 53
0
		public Goblet( BeverageType type ) : base( type )
		{
			Weight = 1.0;
		}
Ejemplo n.º 54
0
 public BeverageBuyInfo(Type type, BeverageType content, int price, int amount, int itemID, int hue) : this(null, type, content, price, amount, itemID, hue)
 {
 }
Ejemplo n.º 55
0
		public Pitcher( BeverageType type ) : base( type )
		{
			Weight = 2.0;
		}
Ejemplo n.º 56
0
        public Item Construct()
        {
            if (m_Type == null)
            {
                return(null);
            }

            Item item;

            try
            {
                if (m_Type == typeofStatic)
                {
                    item = new Static(m_ItemID);
                }
                else if (m_Type == typeofLocalizedStatic)
                {
                    int labelNumber = 0;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("LabelNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                labelNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                                break;
                            }
                        }
                    }

                    item = new LocalizedStatic(m_ItemID, labelNumber);
                }
                else if (m_Type == typeofLocalizedSign)
                {
                    int labelNumber = 0;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("LabelNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                labelNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                                break;
                            }
                        }
                    }

                    item = new LocalizedSign(m_ItemID, labelNumber);
                }
                else if (m_Type == typeofAnkhWest || m_Type == typeofAnkhNorth)
                {
                    bool bloodied = false;

                    for (int i = 0; !bloodied && i < m_Params.Length; ++i)
                    {
                        bloodied = (m_Params[i] == "Bloodied");
                    }

                    if (m_Type == typeofAnkhWest)
                    {
                        item = new AnkhWest(bloodied);
                    }
                    else
                    {
                        item = new AnkhNorth(bloodied);
                    }
                }
                else if (m_Type == typeofMarkContainer)
                {
                    bool bone   = false;
                    bool locked = false;
                    Map  map    = Map.Malas;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i] == "Bone")
                        {
                            bone = true;
                        }
                        else if (m_Params[i] == "Locked")
                        {
                            locked = true;
                        }
                        else if (m_Params[i].StartsWith("TargetMap"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                map = Map.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    MarkContainer mc = new MarkContainer(bone, locked);

                    mc.TargetMap   = map;
                    mc.Description = "strange location";

                    item = mc;
                }
                else if (m_Type == typeofHintItem)
                {
                    int      range         = 0;
                    int      messageNumber = 0;
                    string   messageString = null;
                    int      hintNumber    = 0;
                    string   hintString    = null;
                    TimeSpan resetDelay    = TimeSpan.Zero;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Range"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("HintString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                hintString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("HintNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                hintNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("ResetDelay"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                resetDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    HintItem hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);

                    hi.WarningString = messageString;
                    hi.HintString    = hintString;
                    hi.ResetDelay    = resetDelay;

                    item = hi;
                }
                else if (m_Type == typeofWarningItem)
                {
                    int      range         = 0;
                    int      messageNumber = 0;
                    string   messageString = null;
                    TimeSpan resetDelay    = TimeSpan.Zero;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Range"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningString"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageString = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("WarningNumber"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                messageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("ResetDelay"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                resetDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    WarningItem wi = new WarningItem(m_ItemID, range, messageNumber);

                    wi.WarningString = messageString;
                    wi.ResetDelay    = resetDelay;

                    item = wi;
                }
                else if (m_Type == typeofCannon)
                {
                    CannonDirection direction = CannonDirection.North;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("CannonDirection"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                direction = (CannonDirection)Enum.Parse(typeof(CannonDirection), m_Params[i].Substring(++indexOf), true);
                            }
                        }
                    }

                    item = new Cannon(direction);
                }
                else if (m_Type == typeofSerpentPillar)
                {
                    string      word        = null;
                    Rectangle2D destination = new Rectangle2D();

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Word"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                word = m_Params[i].Substring(++indexOf);
                            }
                        }
                        else if (m_Params[i].StartsWith("DestStart"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                destination.Start = Point2D.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                        else if (m_Params[i].StartsWith("DestEnd"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                destination.End = Point2D.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }

                    item = new SerpentPillar(word, destination);
                }
                else if (m_Type.IsSubclassOf(typeofBeverage))
                {
                    BeverageType content = BeverageType.Liquor;
                    bool         fill    = false;

                    for (int i = 0; !fill && i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Content"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                content = (BeverageType)Enum.Parse(typeof(BeverageType), m_Params[i].Substring(++indexOf), true);
                                fill    = true;
                            }
                        }
                    }

                    if (fill)
                    {
                        item = (Item)Activator.CreateInstance(m_Type, new object[] { content });
                    }
                    else
                    {
                        item = (Item)Activator.CreateInstance(m_Type);
                    }
                }
                else if (m_Type.IsSubclassOf(typeofBaseDoor))
                {
                    DoorFacing facing = DoorFacing.WestCW;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("Facing"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                facing = (DoorFacing)Enum.Parse(typeof(DoorFacing), m_Params[i].Substring(++indexOf), true);
                                break;
                            }
                        }
                    }

                    item = (Item)Activator.CreateInstance(m_Type, new object[] { facing });
                }
                else
                {
                    item = (Item)Activator.CreateInstance(m_Type);
                }
            }
            catch (Exception e)
            {
                throw new Exception(String.Format("Bad type: {0}", m_Type), e);
            }

            if (item is BaseAddon)
            {
                if (item is MaabusCoffin)
                {
                    MaabusCoffin coffin = (MaabusCoffin)item;

                    for (int i = 0; i < m_Params.Length; ++i)
                    {
                        if (m_Params[i].StartsWith("SpawnLocation"))
                        {
                            int indexOf = m_Params[i].IndexOf('=');

                            if (indexOf >= 0)
                            {
                                coffin.SpawnLocation = Point3D.Parse(m_Params[i].Substring(++indexOf));
                            }
                        }
                    }
                }
                else if (m_ItemID > 0)
                {
                    List <AddonComponent> comps = ((BaseAddon)item).Components;

                    for (int i = 0; i < comps.Count; ++i)
                    {
                        AddonComponent comp = (AddonComponent)comps[i];

                        if (comp.Offset == Point3D.Zero)
                        {
                            comp.ItemID = m_ItemID;
                        }
                    }
                }
            }
            else if (item is BaseLight)
            {
                bool unlit = false, unprotected = false;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (!unlit && m_Params[i] == "Unlit")
                    {
                        unlit = true;
                    }
                    else if (!unprotected && m_Params[i] == "Unprotected")
                    {
                        unprotected = true;
                    }

                    if (unlit && unprotected)
                    {
                        break;
                    }
                }

                if (!unlit)
                {
                    ((BaseLight)item).Ignite();
                }
                if (!unprotected)
                {
                    ((BaseLight)item).Protected = true;
                }

                if (m_ItemID > 0)
                {
                    item.ItemID = m_ItemID;
                }
            }
            else if (item is UltimaOnline.Mobiles.Spawner)
            {
                UltimaOnline.Mobiles.Spawner sp = (UltimaOnline.Mobiles.Spawner)item;

                sp.NextSpawn = TimeSpan.Zero;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Spawn"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.SpawnNames.Add(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MinDelay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.MinDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MaxDelay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.MaxDelay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("NextSpawn"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.NextSpawn = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Count"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.Count = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Team"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.Team = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("HomeRange"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.HomeRange = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Running"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.Running = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Group"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            sp.Group = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                }
            }
            else if (item is RecallRune)
            {
                RecallRune rune = (RecallRune)item;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Description"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Description = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("Marked"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Marked = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("TargetMap"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.TargetMap = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Target"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            rune.Target = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }
            }
            else if (item is SkillTeleporter)
            {
                SkillTeleporter tp = (SkillTeleporter)item;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Skill"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Skill = (SkillName)Enum.Parse(typeof(SkillName), m_Params[i].Substring(++indexOf), true);
                        }
                    }
                    else if (m_Params[i].StartsWith("RequiredFixedPoint"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Required = Utility.ToInt32(m_Params[i].Substring(++indexOf)) * 0.1;
                        }
                    }
                    else if (m_Params[i].StartsWith("Required"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Required = Utility.ToDouble(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MessageString"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MessageString = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("MessageNumber"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MessageNumber = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    item.ItemID = m_ItemID;
                }
            }
            else if (item is KeywordTeleporter)
            {
                KeywordTeleporter tp = (KeywordTeleporter)item;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("Substring"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Substring = m_Params[i].Substring(++indexOf);
                        }
                    }
                    else if (m_Params[i].StartsWith("Keyword"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Keyword = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Range"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Range = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    item.ItemID = m_ItemID;
                }
            }
            else if (item is Teleporter)
            {
                Teleporter tp = (Teleporter)item;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("PointDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.PointDest = Point3D.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("MapDest"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.MapDest = Map.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Creatures"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Creatures = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SourceEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SourceEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("DestEffect"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.DestEffect = Utility.ToBoolean(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("SoundID"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.SoundID = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        }
                    }
                    else if (m_Params[i].StartsWith("Delay"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            tp.Delay = TimeSpan.Parse(m_Params[i].Substring(++indexOf));
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    item.ItemID = m_ItemID;
                }
            }
            else if (item is FillableContainer)
            {
                FillableContainer cont = (FillableContainer)item;

                for (int i = 0; i < m_Params.Length; ++i)
                {
                    if (m_Params[i].StartsWith("ContentType"))
                    {
                        int indexOf = m_Params[i].IndexOf('=');

                        if (indexOf >= 0)
                        {
                            cont.ContentType = (FillableContentType)Enum.Parse(typeof(FillableContentType), m_Params[i].Substring(++indexOf), true);
                        }
                    }
                }

                if (m_ItemID > 0)
                {
                    item.ItemID = m_ItemID;
                }
            }
            else if (m_ItemID > 0)
            {
                item.ItemID = m_ItemID;
            }

            item.Movable = false;

            for (int i = 0; i < m_Params.Length; ++i)
            {
                if (m_Params[i].StartsWith("Light"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        item.Light = (LightType)Enum.Parse(typeof(LightType), m_Params[i].Substring(++indexOf), true);
                    }
                }
                else if (m_Params[i].StartsWith("Hue"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        int hue = Utility.ToInt32(m_Params[i].Substring(++indexOf));

                        if (item is DyeTub)
                        {
                            ((DyeTub)item).DyedHue = hue;
                        }
                        else
                        {
                            item.Hue = hue;
                        }
                    }
                }
                else if (m_Params[i].StartsWith("Name"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        item.Name = m_Params[i].Substring(++indexOf);
                    }
                }
                else if (m_Params[i].StartsWith("Amount"))
                {
                    int indexOf = m_Params[i].IndexOf('=');

                    if (indexOf >= 0)
                    {
                        // Must supress stackable warnings

                        bool wasStackable = item.Stackable;

                        item.Stackable = true;
                        item.Amount    = Utility.ToInt32(m_Params[i].Substring(++indexOf));
                        item.Stackable = wasStackable;
                    }
                }
            }

            return(item);
        }
Ejemplo n.º 57
0
 public FillableBvrge(Type type, BeverageType content)
     : this(1, type, content)
 {
 }
Ejemplo n.º 58
0
 public LeprechaunsMug(BeverageType type) : base(type)
 {
     Weight = 1.0;
 }
Ejemplo n.º 59
0
 public void SetBeverageType(int index, BeverageType requiredBeverage)
 {
     CraftItem craftItem = this.m_CraftItems.GetAt(index);
     craftItem.RequiredBeverage = requiredBeverage;
 }
Ejemplo n.º 60
0
 public static bool ConsumeTotal(Container pack, BeverageType content, int quantity)
 {
     return(ConsumeTotal(pack, typeof(BaseBeverage), content, quantity));
 }