상속: BaseContainer
예제 #1
0
        protected override void FinishEffect(Point3D p, Map map, Mobile from)
        {
            if (from.Skills.Fishing.Value < 10)
            {
                from.SendLocalizedMessage(1074487); // The creatures are too quick for you!
            }
            else
            {
                BaseFish fish = this.GiveFish(from);
                FishBowl bowl = Aquarium.GetEmptyBowl(from);

                if (bowl != null)
                {
                    fish.StopTimer();
                    bowl.AddItem(fish);
                    from.SendLocalizedMessage(1074489); // A live creature jumps into the fish bowl in your pack!
                    this.Delete();
                    return;
                }
                else
                {
                    if (from.PlaceInBackpack(fish))
                    {
                        from.PlaySound(0x5A2);
                        from.SendLocalizedMessage(1074490); // A live creature flops around in your pack before running out of air.

                        fish.Kill();
                        this.Delete();
                        return;
                    }
                    else
                    {
                        fish.Delete();

                        from.SendLocalizedMessage(1074488); // You could not hold the creature.
                    }
                }
            }

            this.InUse   = false;
            this.Movable = true;

            if (!from.PlaceInBackpack(this))
            {
                if (from.Map == null || from.Map == Map.Internal)
                {
                    this.Delete();
                }
                else
                {
                    this.MoveToWorld(from.Location, from.Map);
                }
            }
        }
예제 #2
0
        public static FishBowl GetEmptyBowl(Mobile from)
        {
            if (from == null || from.Backpack == null)
            {
                return(null);
            }

            Item[] items = from.Backpack.FindItemsByType(typeof(FishBowl));

            for (int i = 0; i < items.Length; i++)
            {
                if (items[i] is FishBowl)
                {
                    FishBowl bowl = (FishBowl)items[i];

                    if (bowl.Empty)
                    {
                        return(bowl);
                    }
                }
            }

            return(null);
        }
예제 #3
0
파일: FishBowl.cs 프로젝트: twlizer/runuo
 public RemoveCreature(FishBowl bowl) : base(6242, 3)                 // Remove creature
 {
     m_Bowl = bowl;
 }
예제 #4
0
 public RemoveCreature(FishBowl bowl) : base(6242, 3) => m_Bowl = bowl;
예제 #5
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (!HasAccess(from))
            {
                from.SendLocalizedMessage(1073821); // You do not have access to that item for use with the aquarium.
                return(false);
            }

            if (m_VacationLeft > 0)
            {
                from.SendLocalizedMessage(1074427); // The aquarium is in vacation mode.
                return(false);
            }

            bool takeItem = true;

            if (dropped is FishBowl)
            {
                FishBowl bowl = (FishBowl)dropped;

                if (bowl.Empty || !AddFish(from, bowl.Fish))
                {
                    return(false);
                }

                bowl.InvalidateProperties();

                takeItem = false;
            }
            else if (dropped is BaseFish)
            {
                BaseFish fish = (BaseFish)dropped;

                if (!AddFish(from, fish))
                {
                    return(false);
                }
            }
            else if (dropped is VacationWafer)
            {
                m_VacationLeft = VacationWafer.VacationDays;
                dropped.Delete();

                from.SendLocalizedMessage(1074428, m_VacationLeft.ToString()); // The aquarium will be in vacation mode for ~1_DAYS~ days
            }
            else if (dropped is AquariumFood)
            {
                m_Food.Added += 1;
                dropped.Delete();

                from.SendLocalizedMessage(1074259, "1"); // ~1_NUM~ unit(s) of food have been added to the aquarium.
            }
            else if (dropped is BaseBeverage)
            {
                BaseBeverage beverage = (BaseBeverage)dropped;

                if (beverage.IsEmpty || !beverage.Pourable || beverage.Content != BeverageType.Water)
                {
                    from.SendLocalizedMessage(500840); // Can't pour that in there.
                    return(false);
                }

                m_Water.Added     += 1;
                beverage.Quantity -= 1;

                from.PlaySound(0x4E);
                from.SendLocalizedMessage(1074260, "1"); // ~1_NUM~ unit(s) of water have been added to the aquarium.

                takeItem = false;
            }
            else if (!AddDecoration(from, dropped))
            {
                takeItem = false;
            }

            from.CloseGump(typeof(AquariumGump));

            InvalidateProperties();

            if (takeItem)
            {
                from.PlaySound(0x42);
            }

            return(takeItem);
        }
예제 #6
0
 // Remove creature
 public RemoveCreature( FishBowl bowl )
     : base(6242, 0)
 {
     m_Bowl = bowl;
 }
예제 #7
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house == null || !house.IsCoOwner(from))
            {
                from.SendLocalizedMessage(1073821);                   // You do not have access to that item for use with the aquarium.
                return(false);
            }

            if (m_VacationLeft > 0)
            {
                from.SendLocalizedMessage(1074427);                   // The aquarium is in vacation mode.
                return(false);
            }

            if (dropped is FishBowl)
            {
                FishBowl bowl = (FishBowl)dropped;

                if (bowl.Empty)
                {
                    return(false);
                }

                if (AddFish(from, bowl.Fish))
                {
                    bowl.InvalidateProperties();
                }

                return(false);
            }
            else if (dropped is BaseFish)
            {
                BaseFish fish = (BaseFish)dropped;

                if (!AddFish(from, fish))
                {
                    return(false);
                }
            }
            else if (dropped is VacationWafer)
            {
                m_VacationLeft += 7;
                ((Item)dropped).Delete();

                from.SendLocalizedMessage(1074428, "" + m_VacationLeft);                   // The aquarium will be in vacation mode for ~1_DAYS~ days
            }
            else if (dropped is AquariumFood)
            {
                m_Food.Added += 1;
                ((Item)dropped).Delete();

                from.SendLocalizedMessage(1074259, "" + 1);                   // ~1_NUM~ unit(s) of food have been added to the aquarium.
            }
            else if (dropped is BaseBeverage)
            {
                BaseBeverage beverage = (BaseBeverage)dropped;

                if (beverage.IsEmpty || !beverage.Pourable || beverage.Content != BeverageType.Water)
                {
                    from.SendLocalizedMessage(500840);                       // Can't pour that in there.
                    return(false);
                }

                m_Water.Added     += 1;
                beverage.Quantity -= 1;

                from.PlaySound(0x4E);
                from.SendLocalizedMessage(1074260, "" + 1);                   // ~1_NUM~ unit(s) of water have been added to the aquarium.
                return(false);
            }
            else if (!AddDecoration(from, dropped))
            {
                return(false);
            }

            InvalidateProperties();

            from.CloseGump(typeof(AquariumGump));

            return(true);
        }
예제 #8
0
			public RemoveCreature( FishBowl bowl ) : base( 6242, 3 ) // Remove creature
			{
				m_Bowl = bowl;
			}
예제 #9
0
 // Remove creature
 public RemoveCreature(FishBowl bowl)
     : base(6242, 3)
 {
     this.m_Bowl = bowl;
 }