Esempio n. 1
0
        private static void BasicTooltip(Player localPlayer, bool isMax = false)
        {
            if (_item.m_shared.m_dlc.Length > 0)
            {
                DLC();
            }

            WieldType();

            if (!_item.m_shared.m_teleportable)
            {
                Teleport();
            }
            if (_item.m_shared.m_value > 0)
            {
                Value();
            }

            ItemType(_quality);

            if (_item.m_shared.m_useDurability)
            {
                if (isMax)
                {
                    Durability(_quality + 1, _crafting); // Retarded fix, as Durability has its own logic.
                }
                else
                {
                    Durability(_quality, _crafting);
                }

                if (_item.m_shared.m_canBeReparied)
                {
                    RepairStation();
                }
                _sb.Append("\n");
            }

            if (_item.m_shared.m_movementModifier != 0f && localPlayer != null)
            {
                Movement(localPlayer);
            }

            DamageModifiers();

            string setStatusEffectTooltip = _item.GetSetStatusEffectTooltip();

            if (setStatusEffectTooltip.Length > 0)
            {
                StatusEffect(setStatusEffectTooltip);
            }
        }
Esempio n. 2
0
        public static string GetSetTooltip(this ItemDrop.ItemData item)
        {
            var text    = new StringBuilder();
            var setID   = item.GetSetID(out var isMundane);
            var setSize = item.GetSetSize();

            var setPieces          = ItemDataExtensions.GetSetPieces(setID);
            var currentSetEquipped = Player.m_localPlayer.GetEquippedSetPieces(setID);

            var setDisplayName = GetSetDisplayName(item, isMundane);

            text.Append($"\n\n<color={EpicLoot.GetSetItemColor()}> $mod_epicloot_set: {setDisplayName} ({currentSetEquipped.Count}/{setSize}):</color>");

            foreach (var setItemName in setPieces)
            {
                var isEquipped  = IsSetItemEquipped(currentSetEquipped, setItemName, isMundane);
                var color       = isEquipped ? "white" : "grey";
                var displayName = GetSetItemDisplayName(setItemName, isMundane);
                text.Append($"\n  <color={color}>{displayName}</color>");
            }

            if (isMundane)
            {
                var setEffectColor = currentSetEquipped.Count == setSize?EpicLoot.GetSetItemColor() : "grey";

                text.Append($"\n<color={setEffectColor}>({setSize}) ‣ {item.GetSetStatusEffectTooltip().Replace("\n", " ")}</color>");
            }
            else
            {
                var setInfo = item.GetLegendarySetInfo();
                foreach (var setBonusInfo in setInfo.SetBonuses.OrderBy(x => x.Count))
                {
                    var hasEquipped = currentSetEquipped.Count >= setBonusInfo.Count;
                    var effectDef   = MagicItemEffectDefinitions.Get(setBonusInfo.Effect.Type);
                    if (effectDef == null)
                    {
                        EpicLoot.LogError($"Set Tooltip: Could not find effect ({setBonusInfo.Effect.Type}) for set ({setInfo.ID}) bonus ({setBonusInfo.Count})!");
                        continue;
                    }

                    var display = MagicItem.GetEffectText(effectDef, setBonusInfo.Effect.Values?.MinValue ?? 0);
                    text.Append($"\n<color={(hasEquipped ? EpicLoot.GetSetItemColor() : "grey")}>({setBonusInfo.Count}) ‣ {display}</color>");
                }
            }

            return(text.ToString());
        }
        private static void AddSetTooltip(ItemDrop.ItemData item, StringBuilder text)
        {
            var setPieces          = ObjectDB.instance.GetSetPieces(item.m_shared.m_setName);
            var currentSetEquipped = Player.m_localPlayer.GetEquippedSetPieces(item.m_shared.m_setName);
            var setEffectColor     = currentSetEquipped.Count == item.m_shared.m_setSize ? EpicLoot.GetSetItemColor() : "grey";

            TextInfo textInfo       = new CultureInfo("en-US", false).TextInfo;
            var      setDisplayName = textInfo.ToTitleCase(item.m_shared.m_setName);

            text.Append($"\n\n<color={EpicLoot.GetSetItemColor()}>ᛟ Set: {setDisplayName} ({currentSetEquipped.Count}/{item.m_shared.m_setSize}):</color>");

            foreach (var setItem in setPieces)
            {
                var isEquipped = currentSetEquipped.Find(x => x.m_shared.m_name == setItem.m_shared.m_name) != null;
                var color      = isEquipped ? "white" : "grey";
                text.Append($"\n  <color={color}>{setItem.m_shared.m_name}</color>");
            }

            text.Append($"\n<color={setEffectColor}>({item.m_shared.m_setSize}) ‣ {item.GetSetStatusEffectTooltip().Replace("\n", " ")}</color>");
        }
Esempio n. 4
0
        // Token: 0x0600114C RID: 4428 RVA: 0x00077F18 File Offset: 0x00076118
        public static string GetTooltip(ItemDrop.ItemData item, int qualityLevel, bool crafting)
        {
            Player        localPlayer   = Player.m_localPlayer;
            StringBuilder stringBuilder = new StringBuilder(256);

            stringBuilder.Append(item.m_shared.m_description);
            stringBuilder.Append("\n\n");
            if (item.m_shared.m_dlc.Length > 0)
            {
                stringBuilder.Append("\n<color=aqua>$item_dlc</color>");
            }
            ItemDrop.ItemData.AddHandedTip(item, stringBuilder);
            if (item.m_crafterID != 0L)
            {
                stringBuilder.AppendFormat("\n$item_crafter: <color=orange>{0}</color>", item.m_crafterName);
            }
            if (!item.m_shared.m_teleportable)
            {
                stringBuilder.Append("\n<color=orange>$item_noteleport</color>");
            }
            if (item.m_shared.m_value > 0)
            {
                stringBuilder.AppendFormat("\n$item_value: <color=orange>{0}  ({1})</color>", item.GetValue(), item.m_shared.m_value);
            }
            stringBuilder.AppendFormat("\n$item_weight: <color=orange>{0}</color>", item.GetWeight().ToString("0.0"));
            if (item.m_shared.m_maxQuality > 1)
            {
                stringBuilder.AppendFormat("\n$item_quality: <color=orange>{0}</color>", qualityLevel);
            }
            if (item.m_shared.m_useDurability)
            {
                if (crafting)
                {
                    float maxDurability = item.GetMaxDurability(qualityLevel);
                    stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}</color>", maxDurability);
                }
                else
                {
                    float maxDurability2 = item.GetMaxDurability(qualityLevel);
                    float durability     = item.m_durability;
                    stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}%</color> <color=yellow>({1}/{2})</color>", (item.GetDurabilityPercentage() * 100f).ToString("0"), durability.ToString("0"), maxDurability2.ToString("0"));
                }
                if (item.m_shared.m_canBeReparied)
                {
                    Recipe recipe = ObjectDB.instance.GetRecipe(item);
                    if (recipe != null)
                    {
                        int minStationLevel = recipe.m_minStationLevel;
                        stringBuilder.AppendFormat("\n$item_repairlevel: <color=orange>{0}</color>", minStationLevel.ToString());
                    }
                }
            }
            switch (item.m_shared.m_itemType)
            {
            case ItemDrop.ItemData.ItemType.Consumable:
            {
                if (item.m_shared.m_food > 0f)
                {
                    stringBuilder.AppendFormat("\n$item_food_health: <color=orange>{0}</color>", item.m_shared.m_food);
                    stringBuilder.AppendFormat("\n$item_food_stamina: <color=orange>{0}</color>", item.m_shared.m_foodStamina);
                    stringBuilder.AppendFormat("\n$item_food_duration: <color=orange>{0}s</color>", item.m_shared.m_foodBurnTime);
                    stringBuilder.AppendFormat("\n$item_food_regen: <color=orange>{0} hp/tick</color>", item.m_shared.m_foodRegen);
                }
                string statusEffectTooltip = item.GetStatusEffectTooltip();
                if (statusEffectTooltip.Length > 0)
                {
                    stringBuilder.Append("\n\n");
                    stringBuilder.Append(statusEffectTooltip);
                }
                break;
            }

            case ItemDrop.ItemData.ItemType.OneHandedWeapon:
            case ItemDrop.ItemData.ItemType.Bow:
            case ItemDrop.ItemData.ItemType.TwoHandedWeapon:
            case ItemDrop.ItemData.ItemType.Torch:
            {
                stringBuilder.Append(item.GetDamage(qualityLevel).GetTooltipString(item.m_shared.m_skillType));
                stringBuilder.AppendFormat("\n$item_blockpower: <color=orange>{0}</color> <color=yellow>({1})</color>", item.GetBaseBlockPower(qualityLevel), item.GetBlockPowerTooltip(qualityLevel).ToString("0"));
                if (item.m_shared.m_timedBlockBonus > 1f)
                {
                    stringBuilder.AppendFormat("\n$item_deflection: <color=orange>{0}</color>", item.GetDeflectionForce(qualityLevel));
                    stringBuilder.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", item.m_shared.m_timedBlockBonus);
                }
                stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce);
                stringBuilder.AppendFormat("\n$item_backstab: <color=orange>{0}x</color>", item.m_shared.m_backstabBonus);
                string projectileTooltip = item.GetProjectileTooltip(qualityLevel);
                if (projectileTooltip.Length > 0)
                {
                    stringBuilder.Append("\n\n");
                    stringBuilder.Append(projectileTooltip);
                }
                string statusEffectTooltip2 = item.GetStatusEffectTooltip();
                if (statusEffectTooltip2.Length > 0)
                {
                    stringBuilder.Append("\n\n");
                    stringBuilder.Append(statusEffectTooltip2);
                }
                break;
            }

            case ItemDrop.ItemData.ItemType.Shield:
                stringBuilder.AppendFormat("\n$item_blockpower: <color=orange>{0}</color> <color=yellow>({1})</color>", item.GetBaseBlockPower(qualityLevel), item.GetBlockPowerTooltip(qualityLevel).ToString("0"));
                if (item.m_shared.m_timedBlockBonus > 1f)
                {
                    stringBuilder.AppendFormat("\n$item_deflection: <color=orange>{0}</color>", item.GetDeflectionForce(qualityLevel));
                    stringBuilder.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", item.m_shared.m_timedBlockBonus);
                }
                break;

            case ItemDrop.ItemData.ItemType.Helmet:
            case ItemDrop.ItemData.ItemType.Chest:
            case ItemDrop.ItemData.ItemType.Legs:
            case ItemDrop.ItemData.ItemType.Shoulder:
            {
                stringBuilder.AppendFormat("\n$item_armor: <color=orange>{0}</color>", item.GetArmor(qualityLevel));
                string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers);
                if (damageModifiersTooltipString.Length > 0)
                {
                    stringBuilder.Append(damageModifiersTooltipString);
                }
                string statusEffectTooltip3 = item.GetStatusEffectTooltip();
                if (statusEffectTooltip3.Length > 0)
                {
                    stringBuilder.Append("\n\n");
                    stringBuilder.Append(statusEffectTooltip3);
                }
                break;
            }

            case ItemDrop.ItemData.ItemType.Ammo:
                stringBuilder.Append(item.GetDamage(qualityLevel).GetTooltipString(item.m_shared.m_skillType));
                stringBuilder.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce);
                break;
            }
            if (item.m_shared.m_movementModifier != 0f && localPlayer != null)
            {
                float equipmentMovementModifier = localPlayer.GetEquipmentMovementModifier();
                stringBuilder.AppendFormat("\n$item_movement_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (item.m_shared.m_movementModifier * 100f).ToString("+0;-0"), (equipmentMovementModifier * 100f).ToString("+0;-0"));
            }
            string setStatusEffectTooltip = item.GetSetStatusEffectTooltip();

            if (setStatusEffectTooltip.Length > 0)
            {
                stringBuilder.AppendFormat("\n\n$item_seteffect (<color=orange>{0}</color> $item_parts):<color=orange>{1}</color>", item.m_shared.m_setSize, setStatusEffectTooltip);
            }
            return(stringBuilder.ToString());
        }
Esempio n. 5
0
        public static string GetTooltip(ItemDrop.ItemData item, int qualityLevel, bool crafting)
        {
            Player        localPlayer = Player.m_localPlayer;
            StringBuilder text        = new StringBuilder(256);

            text.Append(item.m_shared.m_description);
            text.Append("\n\n");
            if (item.m_shared.m_dlc.Length > 0)
            {
                text.Append("\n<color=aqua>$item_dlc</color>");
            }
            ItemDrop.ItemData.AddHandedTip(item, text);
            if (item.m_crafterID != 0L)
            {
                text.AppendFormat("\n$item_crafter: <color=orange>{0}</color>", (object)item.m_crafterName);
            }
            if (!item.m_shared.m_teleportable)
            {
                text.Append("\n<color=orange>$item_noteleport</color>");
            }
            if (item.m_shared.m_value > 0)
            {
                text.AppendFormat("\n$item_value: <color=orange>{0}  ({1})</color>", (object)item.GetValue(), (object)item.m_shared.m_value);
            }
            text.AppendFormat("\n$item_weight: <color=orange>{0}</color>", (object)item.GetWeight().ToString("0.0"));
            if (item.m_shared.m_maxQuality > 1)
            {
                text.AppendFormat("\n$item_quality: <color=orange>{0}</color>", (object)qualityLevel);
            }
            float num;

            if (item.m_shared.m_useDurability)
            {
                if (crafting)
                {
                    float maxDurability = item.GetMaxDurability(qualityLevel);
                    text.AppendFormat("\n$item_durability: <color=orange>{0}</color>", (object)maxDurability);
                }
                else
                {
                    float         maxDurability = item.GetMaxDurability(qualityLevel);
                    float         durability    = item.m_durability;
                    StringBuilder stringBuilder = text;
                    num = item.GetDurabilityPercentage() * 100f;
                    string str1 = num.ToString("0");
                    string str2 = durability.ToString("0");
                    string str3 = maxDurability.ToString("0");
                    stringBuilder.AppendFormat("\n$item_durability: <color=orange>{0}%</color> <color=yellow>({1}/{2})</color>", (object)str1, (object)str2, (object)str3);
                }
                if (item.m_shared.m_canBeReparied)
                {
                    Recipe recipe = ObjectDB.instance.GetRecipe(item);
                    if ((UnityEngine.Object)recipe != (UnityEngine.Object)null)
                    {
                        int minStationLevel = recipe.m_minStationLevel;
                        text.AppendFormat("\n$item_repairlevel: <color=orange>{0}</color>", (object)minStationLevel.ToString());
                    }
                }
            }
            switch (item.m_shared.m_itemType)
            {
            case ItemDrop.ItemData.ItemType.Consumable:
                if ((double)item.m_shared.m_food > 0.0)
                {
                    text.AppendFormat("\n$item_food_health: <color=orange>{0}</color>", (object)item.m_shared.m_food);
                    text.AppendFormat("\n$item_food_stamina: <color=orange>{0}</color>", (object)item.m_shared.m_foodStamina);
                    text.AppendFormat("\n$item_food_duration: <color=orange>{0}s</color>", (object)item.m_shared.m_foodBurnTime);
                    text.AppendFormat("\n$item_food_regen: <color=orange>{0} hp/tick</color>", (object)item.m_shared.m_foodRegen);
                }
                string statusEffectTooltip1 = item.GetStatusEffectTooltip();
                if (statusEffectTooltip1.Length > 0)
                {
                    text.Append("\n\n");
                    text.Append(statusEffectTooltip1);
                    break;
                }
                break;

            case ItemDrop.ItemData.ItemType.OneHandedWeapon:
            case ItemDrop.ItemData.ItemType.Bow:
            case ItemDrop.ItemData.ItemType.TwoHandedWeapon:
            case ItemDrop.ItemData.ItemType.Torch:
                text.Append(item.GetDamage(qualityLevel).GetTooltipString(item.m_shared.m_skillType));
                StringBuilder stringBuilder1 = text;
                // ISSUE: variable of a boxed type
                __Boxed <float> baseBlockPower1 = (ValueType)item.GetBaseBlockPower(qualityLevel);
                num = item.GetBlockPowerTooltip(qualityLevel);
                string str4 = num.ToString("0");
                stringBuilder1.AppendFormat("\n$item_blockpower: <color=orange>{0}</color> <color=yellow>({1})</color>", (object)baseBlockPower1, (object)str4);
                if ((double)item.m_shared.m_timedBlockBonus > 1.0)
                {
                    text.AppendFormat("\n$item_deflection: <color=orange>{0}</color>", (object)item.GetDeflectionForce(qualityLevel));
                    text.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", (object)item.m_shared.m_timedBlockBonus);
                }
                text.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", (object)item.m_shared.m_attackForce);
                text.AppendFormat("\n$item_backstab: <color=orange>{0}x</color>", (object)item.m_shared.m_backstabBonus);
                string projectileTooltip = item.GetProjectileTooltip(qualityLevel);
                if (projectileTooltip.Length > 0)
                {
                    text.Append("\n\n");
                    text.Append(projectileTooltip);
                }
                string statusEffectTooltip2 = item.GetStatusEffectTooltip();
                if (statusEffectTooltip2.Length > 0)
                {
                    text.Append("\n\n");
                    text.Append(statusEffectTooltip2);
                    break;
                }
                break;

            case ItemDrop.ItemData.ItemType.Shield:
                StringBuilder stringBuilder2 = text;
                // ISSUE: variable of a boxed type
                __Boxed <float> baseBlockPower2 = (ValueType)item.GetBaseBlockPower(qualityLevel);
                num = item.GetBlockPowerTooltip(qualityLevel);
                string str5 = num.ToString("0");
                stringBuilder2.AppendFormat("\n$item_blockpower: <color=orange>{0}</color> <color=yellow>({1})</color>", (object)baseBlockPower2, (object)str5);
                if ((double)item.m_shared.m_timedBlockBonus > 1.0)
                {
                    text.AppendFormat("\n$item_deflection: <color=orange>{0}</color>", (object)item.GetDeflectionForce(qualityLevel));
                    text.AppendFormat("\n$item_parrybonus: <color=orange>{0}x</color>", (object)item.m_shared.m_timedBlockBonus);
                    break;
                }
                break;

            case ItemDrop.ItemData.ItemType.Helmet:
            case ItemDrop.ItemData.ItemType.Chest:
            case ItemDrop.ItemData.ItemType.Legs:
            case ItemDrop.ItemData.ItemType.Shoulder:
                text.AppendFormat("\n$item_armor: <color=orange>{0}</color>", (object)item.GetArmor(qualityLevel));
                string modifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers);
                if (modifiersTooltipString.Length > 0)
                {
                    text.Append(modifiersTooltipString);
                }
                string statusEffectTooltip3 = item.GetStatusEffectTooltip();
                if (statusEffectTooltip3.Length > 0)
                {
                    text.Append("\n\n");
                    text.Append(statusEffectTooltip3);
                    break;
                }
                break;

            case ItemDrop.ItemData.ItemType.Ammo:
                text.Append(item.GetDamage(qualityLevel).GetTooltipString(item.m_shared.m_skillType));
                text.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", (object)item.m_shared.m_attackForce);
                break;
            }
            if ((double)item.m_shared.m_movementModifier != 0.0 && (UnityEngine.Object)localPlayer != (UnityEngine.Object)null)
            {
                float         movementModifier = localPlayer.GetEquipmentMovementModifier();
                StringBuilder stringBuilder3   = text;
                num = item.m_shared.m_movementModifier * 100f;
                string str1 = num.ToString("+0;-0");
                num = movementModifier * 100f;
                string str2 = num.ToString("+0;-0");
                stringBuilder3.AppendFormat("\n$item_movement_modifier: <color=orange>{0}%</color> ($item_total:<color=yellow>{1}%</color>)", (object)str1, (object)str2);
            }
            string statusEffectTooltip4 = item.GetSetStatusEffectTooltip();

            if (statusEffectTooltip4.Length > 0)
            {
                text.AppendFormat("\n\n$item_seteffect (<color=orange>{0}</color> $item_parts):<color=orange>{1}</color>", (object)item.m_shared.m_setSize, (object)statusEffectTooltip4);
            }
            return(text.ToString());
        }