Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile m)
        {
            if (!this.CheckDoubleClick(m, true, false, 3))
            {
                return;
            }

            if (ProducesWaste && Products > 0)
            {
                double pFactor   = Products / Math.Max(Products, ProductsMax);
                var    pDuration = TimeSpan.FromSeconds(60.0 * pFactor);

                var waste = new SepticWaste(Products);

                if (m.PlaceInBackpack(waste))
                {
                    m.SendMessage(0x55, "You gather the decomposed waste and place it in your backpack.");
                }
                else
                {
                    waste.MoveToWorld(m.Location, m.Map);
                    m.SendMessage(0x55, "The waste spills out at your feet.");
                }

                if (SwagMode)
                {
                    var fx = GetClaimEffect(m);

                    if (fx != null)
                    {
                        if (StinkMode)
                        {
                            fx.EffectHandler = e => e.Source.GetMobilesInRange(e.Map, 0).ForEach(mob => MakeStinky(mob, pDuration, pFactor));
                        }

                        fx.Send();
                    }
                }
                else if (StinkMode)
                {
                    MakeStinky(m, pDuration, pFactor);
                }

                Products = 0;
            }
            else
            {
                m.SendMessage("You rummage around in the decomposing waste, but find nothing.");

                MakeStinky(m, TimeSpan.FromSeconds(60.0 * Utility.RandomDouble()), 0.10);
            }
        }
Ejemplo n.º 2
0
        public override bool OnDragDrop(Mobile m, Item trashed)
        {
            if (m == null || trashed == null || trashed.Deleted || !IsAccessibleTo(m))
            {
                return(false);
            }

            if (RootParent == null)
            {
                if (trashed is SepticWaste)
                {
                    if (!ProducesWaste)
                    {
                        m.SendMessage("Dumping the waste in the {0} would be lazy, dispose of it properly!", this.ResolveName(m));
                        return(false);
                    }

                    if (Products >= ProductsMax)
                    {
                        m.SendMessage("The {0} is full.", this.ResolveName(m));
                        return(false);
                    }

                    SepticWaste waste = (SepticWaste)trashed;

                    if (Products + waste.Amount > ProductsMax)
                    {
                        int diff = (Products + waste.Amount) - ProductsMax;
                        Products     = ProductsMax;
                        waste.Amount = diff;

                        m.SendMessage("You dump as much of the waste into the {0} as possible.", this.ResolveName(m));
                    }
                    else
                    {
                        Products += waste.Amount;
                        waste.Delete();
                        m.SendMessage("You dump the waste into the {0}.", this.ResolveName(m));
                    }

                    return(false);
                }

                return(Trash(m, trashed));
            }

            m.SendMessage(0x22, "The {0} must be on the ground to dispose your items.", this.ResolveName(m));
            return(false);
        }
Ejemplo n.º 3
0
		public override void OnDoubleClick(Mobile m)
		{
			if (!this.CheckDoubleClick(m, true, false, 3))
			{
				return;
			}

			if (ProducesWaste && Products > 0)
			{
				double pFactor = Products / Math.Max(Products, ProductsMax);
				TimeSpan pDuration = TimeSpan.FromSeconds(60.0 * pFactor);

				SepticWaste waste = new SepticWaste(Products);

				if (m.PlaceInBackpack(waste))
				{
					m.SendMessage(0x55, "You gather the decomposed waste and place it in your backpack.");
				}
				else
				{
					waste.MoveToWorld(m.Location, m.Map);
					m.SendMessage(0x55, "The waste spills out at your feet.");
				}

				if (SwagMode)
				{
					BaseExplodeEffect fx = GetClaimEffect(m);

					if (fx != null)
					{
						if (StinkMode)
						{
							fx.EffectHandler = e => e.Source.GetMobilesInRange(e.Map, 0).ForEach(mob => MakeStinky(mob, pDuration, pFactor));
						}

						fx.Send();
					}
				}
				else if (StinkMode)
				{
					MakeStinky(m, pDuration, pFactor);
				}

				Products = 0;
			}
			else
			{
				m.SendMessage("You rummage around in the decomposing waste, but find nothing.");

				MakeStinky(m, TimeSpan.FromSeconds(60.0 * Utility.RandomDouble()), 0.10);
			}
		}