当前位置: 首页>>代码示例>>C#>>正文


C# BaseWeapon.Delete方法代码示例

本文整理汇总了C#中Server.Items.BaseWeapon.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BaseWeapon.Delete方法的具体用法?C# BaseWeapon.Delete怎么用?C# BaseWeapon.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Items.BaseWeapon的用法示例。


在下文中一共展示了BaseWeapon.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EquipItem

        /// <summary>
        /// Auto-equips the weapon if the mobile can equip it.
        /// Else, the item is added to the mobile backpack.
        /// </summary>
        /// <param name="item">Item to equip</param>
        /// <param name="mustEquip">Forces the item to be equipped</param>
        /// <param name="m">Mobile to be equipped</param>
        /// <param name="t">Type of the item</param>
        private static void EquipItem(BaseWeapon item, bool mustEquip, Mobile m, Type t)
        {
            Container pack = m.Backpack;
            Layer layer = item.Layer;
            Item equips = m.FindItemOnLayer(layer);

            item.Quality = WeaponQuality.Exceptional;

            if (mustEquip)
            {
                if (equips != null)
                    pack.DropItem(equips);
            }

            if (pack.FindItemByType(t) != null || equips == item)
            {
                m.EquipItem(equips);
                return;
            }
            else
            {
                if (!Core.AOS)
                {
                    item.LootType = LootType.Regular;
                }

                if (mustEquip)
                {
                    if (equips != null)
                        pack.DropItem(equips);
                }

                if (m != null && m.EquipItem(item))
                    return;

                if (!mustEquip && pack != null)
                    pack.DropItem(item);
                else
                    item.Delete();
            }
        }
开发者ID:greeduomacro,项目名称:RunUO-1,代码行数:49,代码来源:SupplyStone.cs

示例2: StackWith

        private static void StackWith(BaseWeapon toStack, List<BaseWeapon> itemList, int startIndex)
        {
            if (toStack == null || toStack.Deleted)
                return;

            for (int i = startIndex; i < itemList.Count; i++)
            {
                BaseWeapon item = itemList[i];
                if (ValidateWeapon(toStack, item))
                {
                    item.Amount += toStack.Amount;
                    toStack.Delete();
                    return;
                }
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:16,代码来源:SystemCleanup.cs


注:本文中的Server.Items.BaseWeapon.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。