コード例 #1
0
        public bool Scissor(Mobile from, Scissors scissors)
        {
            if (Deleted || !from.CanSee(this))
            {
                return(false);
            }

            base.ScissorHelper(from, new Bone(), Utility.RandomMinMax(10, 15));

            return(true);
        }
コード例 #2
0
        public virtual bool Scissor(Mobile from, Scissors scissors)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack.
                return(false);
            }

            if (Ethics.Ethic.IsImbued(this))
            {
                from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
                return(false);
            }

            CraftSystem system = DefTailoring.CraftSystem;

            CraftItem item = system.CraftItems.SearchFor(GetType());

            if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
            {
                try
                {
                    Type resourceType = null;

                    CraftResourceInfo info = CraftResources.GetInfo(m_Resource);

                    if (info != null && info.ResourceTypes.Length > 0)
                    {
                        resourceType = info.ResourceTypes[0];
                    }

                    if (resourceType == null)
                    {
                        resourceType = item.Resources.GetAt(0).ItemType;
                    }

                    Item res = (Item)Activator.CreateInstance(resourceType);

                    ScissorHelper(from, res, m_PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1);

                    res.LootType = LootType.Regular;

                    return(true);
                }
                catch
                {
                }
            }

            from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
            return(false);
        }
コード例 #3
0
        private void SalvageCloth(Mobile from)
        {
            Scissors scissors = from.Backpack.FindItemByType(typeof(Scissors)) as Scissors;

            if (scissors == null)
            {
                from.SendLocalizedMessage(1079823); // You need scissors in order to salvage cloth.
                return;
            }

            int salvaged    = 0;
            int notSalvaged = 0;

            Container sBag = this;

            List <Item> scissorables = sBag.FindItemsByType <Item>();

            for (int i = scissorables.Count - 1; i >= 0; --i)
            {
                Item item = scissorables[i];

                if (item is IScissorable)
                {
                    IScissorable scissorable = (IScissorable)item;

                    if (Scissors.CanScissor(from, scissorable) && scissorable.Scissor(from, scissors))
                    {
                        ++salvaged;
                    }
                    else
                    {
                        ++notSalvaged;
                    }
                }
            }

            from.SendLocalizedMessage(1079974, String.Format("{0}\t{1}", salvaged, salvaged + notSalvaged)); // Salvaged: ~1_COUNT~/~2_NUM~ tailored items

            Container pack = from.Backpack;

            foreach (Item i in ((Container)this).FindItemsByType(typeof(Item), true))
            {
                if ((i is Leather) || (i is Cloth) || (i is SpinedLeather) || (i is HornedLeather) || (i is BarbedLeather) || (i is Bandage) || (i is Bone))
                {
                    from.AddToBackpack(i);
                }
            }
        }
コード例 #4
0
ファイル: Hides.cs プロジェクト: libcs/game.ultimaonline.io
        public bool Scissor(Mobile from, Scissors scissors)
        {
            if (Deleted || !from.CanSee(this))
            {
                return(false);
            }

            if (Core.AOS && !IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(502437); // Items you wish to cut must be in your backpack
                return(false);
            }
            base.ScissorHelper(from, new Leather(), 1);

            return(true);
        }
コード例 #5
0
        public override bool Scissor(Mobile from, Scissors scissors)
        {
            if (IsCuttable && IsAccessibleTo(from))
            {
                if (!m_Opened && m_Timer == null)
                {
                    m_Timer = Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(3), new TimerStateCallback <Mobile>(FinishOpening), from);
                    scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071897); // You carefully cut into the organ.
                    return(true);
                }
                else
                {
                    scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071898); // You have already cut this organ open.
                }
            }

            return(false);
        }
コード例 #6
0
        public override bool Scissor(Mobile from, Scissors scissors)
        {
            if (IsAccessibleTo(from))
            {
                if (!m_Cut && m_Timer == null)
                {
                    m_Timer = Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(3), new TimerStateCallback <Mobile>(CuttingDone), from);
                    scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071899); // You begin cutting through the vein.
                    return(true);
                }
                else
                {
                    scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071900); // // This vein has already been cut.
                }
            }

            return(false);
        }
コード例 #7
0
        public virtual bool Scissor(Mobile from, Scissors scissors)
        {
            if (!m_Cut)
            {
                PlagueBeastLord owner = RootParent as PlagueBeastLord;

                m_Cut = true;
                Movable = true;

                from.AddToBackpack(this);
                from.LocalOverheadMessage(MessageType.Regular, 0x34, 1071906); // * You remove the plague mutation core from the plague beast, causing it to dissolve into a pile of goo *				

                if (owner != null)
                    Timer.DelayCall<PlagueBeastLord>(TimeSpan.FromSeconds(1), new TimerStateCallback<PlagueBeastLord>(KillParent), owner);

                return true;
            }

            return false;
        }
コード例 #8
0
 public virtual bool Scissor(Mobile from, Scissors scissors)
 {
     return(false);
 }
コード例 #9
0
 public new bool Scissor(Mobile from, Scissors scissors)
 {
     from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
     return(false);
 }
コード例 #10
0
 public InternalTarget(Scissors item) : base(2, false, TargetFlags.None)
 {
     m_Item = item;
 }