示例#1
0
        public static string GetEquipFxName(ItemDrop.ItemData equippedItem, out FxAttachMode mode)
        {
            if (equippedItem.IsMagic(out var magicItem))
            {
                if (magicItem.IsUniqueLegendary())
                {
                    if (!string.IsNullOrEmpty(magicItem.GetLegendaryInfo()?.EquipFx))
                    {
                        mode = FxAttachMode.EquipRoot;
                        return(magicItem.GetLegendaryInfo().EquipFx);
                    }
                }
                else
                {
                    var equipEffect = magicItem.GetFirstEquipEffect(out mode);
                    if (!string.IsNullOrEmpty(equipEffect))
                    {
                        return(equipEffect);
                    }
                }
            }

            mode = FxAttachMode.None;
            return(null);
        }
示例#2
0
        public string GetFirstEquipEffect(out FxAttachMode mode)
        {
            foreach (var effect in Effects)
            {
                var effectDef = MagicItemEffectDefinitions.Get(effect.EffectType);
                if (effectDef != null && !string.IsNullOrEmpty(effectDef.EquipFx))
                {
                    mode = effectDef.EquipFxMode;
                    return(effectDef.EquipFx);
                }
            }

            mode = FxAttachMode.None;
            return(null);
        }
示例#3
0
        private static bool OtherItemsUseThisEffect(Humanoid humanoid, string equipFx, ItemDrop.ItemData item, FxAttachMode mode)
        {
            if (humanoid == null || !humanoid.IsPlayer())
            {
                return(false);
            }

            var player = (Player)humanoid;

            foreach (var equipmentItemData in player.GetEquipment())
            {
                if (equipmentItemData == item)
                {
                    continue;
                }

                if (GetEquipFxName(equipmentItemData, out var equippedItemMode) == equipFx && equippedItemMode == mode)
                {
                    return(true);
                }
            }

            return(false);
        }