Пример #1
0
            public InternalTarget(ShipCannonDeed deed)
                : base(-1, true, TargetFlags.None)
            {
                m_Deed = deed;

                CheckLOS = false;
            }
Пример #2
0
            public InternalTarget(ShipCannonDeed deed)
                : base(-1, true, TargetFlags.None)
            {
                m_Deed = deed;

                CheckLOS = false;
            }
Пример #3
0
        public virtual void OnChop(Mobile from)
        {
            if (CanBeChoppedDateTime > DateTime.UtcNow)
            {
                from.SendMessage(38, "You cannot move the cannon so soon after it has been placed!");
                return;
            }

            if (Boat != null && Boat.CanCommand(from) && Boat.BoatComponents.Contains(this))
            {
                if (!Boat.Contains(from))
                {
                    from.SendMessage(38, "You must be on the boat to chop the cannon!");
                    return;
                }

                Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
                from.SendLocalizedMessage(500461); // You destroy the item.

                /*
                 * int hue = 0;
                 *
                 * if (RetainDeedHue)
                 * {
                 *  for (int i = 0; hue == 0 && i < m_Components.Count; ++i)
                 *  {
                 *      AddonComponent c = m_Components[i];
                 *
                 *      if (c.Hue != 0)
                 *          hue = c.Hue;
                 *  }
                 * }*/

                Delete();

                Boat.BoatComponents.Remove(this);

                ShipCannonDeed deed = Deed;

                if (deed != null)
                {
                    //if (RetainDeedHue)
                    //    deed.Hue = hue;

                    from.AddToBackpack(deed);
                }
            }
            else
            {
                from.SendMessage(38, "You must be able to control the boat to chop the cannon!");
            }
        }
Пример #4
0
            public override void OnClick()
            {
                ShipCannonDeed deed = Cannon.GetDeed;

                Cannon.DoAreaMessage(1116073, 10, From); //~1_NAME~ dismantles the ship cannon.
                Cannon.Delete();

                Container pack = From.Backpack;

                if (pack == null || !pack.TryDropItem(From, deed, false))
                {
                    deed.MoveToWorld(From.Location, From.Map);
                }
            }
Пример #5
0
 public InternalTarget(ShipCannonDeed deed, BaseGalleon galleon)
     : base(2, false, TargetFlags.None)
 {
     Deed    = deed;
     Galleon = galleon;
 }
Пример #6
0
 public InternalTarget(ShipCannonDeed deed, BaseBoat boat) : base(3, false, TargetFlags.None)
 {
     m_Deed = deed;
     m_Boat = boat;
 }
Пример #7
0
 public InternalTarget(ShipCannonDeed deed, BaseBoat boat) : base(3, false, TargetFlags.None)
 {
     m_Deed = deed;
     m_Boat = boat;
 }
Пример #8
0
        public bool TryAddCannon(Mobile from, Point3D pnt, BaseCannon cannon, ShipCannonDeed deed)
        {
            if (cannon == null)
                return false;

            if (IsValidCannonSpot(ref pnt, from))
            {
                cannon.MoveToWorld(pnt, this.Map);
                m_Cannons.Add((Item)cannon);
                UpdateCannonID(cannon);
                cannon.Position = GetCannonPosition(pnt);
                cannon.DoAreaMessage(1116074, 10, from); //~1_NAME~ deploys a ship cannon.

                if (deed != null && from.AccessLevel == AccessLevel.Player)
                    deed.Delete();

                return true;
            }
            cannon.Delete();
            return false;
        }
Пример #9
0
        public bool TryAddCannon(Mobile from, Point3D pnt, ShipCannonDeed deed)
        {
            BaseCannon item;
            switch (deed.CannonType)
            {
                default:
                case CannonType.Light: item = new LightShipCannon(this); break;
                case CannonType.Heavy: item = new HeavyShipCannon(this); break;
            }

            return TryAddCannon(from, pnt, item, deed);
        }