示例#1
0
        private static void DamageModifiers()
        {
            string damageModifiersTooltipString = SE_Stats.GetDamageModifiersTooltipString(_item.m_shared.m_damageModifiers);

            if (damageModifiersTooltipString.Length > 0)
            {
                _sb.Append(damageModifiersTooltipString);
            }
        }
示例#2
0
 private static void Postfix(ref SE_Stats __instance)
 {
     if (Configuration.Current.Player.IsEnabled)
     {
         if (__instance.m_addMaxCarryWeight != null && __instance.m_addMaxCarryWeight > 0)
         {
             __instance.m_addMaxCarryWeight = (__instance.m_addMaxCarryWeight - 150) + Configuration.Current.Player.baseMegingjordBuff;
         }
     }
 }
示例#3
0
            static void Postfix(ref ItemDrop.ItemData item, int qualityLevel, ref string __result)
            {
                if (!modEnabled.Value || item.m_shared.m_itemType != ItemDrop.ItemData.ItemType.Utility)
                {
                    return;
                }

                __result += string.Format("\n\n$item_armor: <color=orange>{0}</color>", item.GetArmor(qualityLevel));
                if (item.m_shared.m_damageModifiers.Count > 0)
                {
                    __result += SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers);
                }
            }
示例#4
0
    // Token: 0x060003D5 RID: 981 RVA: 0x000201F8 File Offset: 0x0001E3F8
    public override string GetTooltipString()
    {
        string text = "";

        if (this.m_tooltip.Length > 0)
        {
            text = text + this.m_tooltip + "\n";
        }
        if (this.m_jumpStaminaUseModifier != 0f)
        {
            text = text + "$se_jumpstamina: " + (this.m_jumpStaminaUseModifier * 100f).ToString("+0;-0") + "%\n";
        }
        if (this.m_runStaminaDrainModifier != 0f)
        {
            text = text + "$se_runstamina: " + (this.m_runStaminaDrainModifier * 100f).ToString("+0;-0") + "%\n";
        }
        if (this.m_healthOverTime != 0f)
        {
            text = text + "$se_health: " + this.m_healthOverTime.ToString() + "\n";
        }
        if (this.m_staminaOverTime != 0f)
        {
            text = text + "$se_stamina: " + this.m_staminaOverTime.ToString() + "\n";
        }
        if (this.m_healthRegenMultiplier != 1f)
        {
            text = text + "$se_healthregen " + ((this.m_healthRegenMultiplier - 1f) * 100f).ToString("+0;-0") + "%\n";
        }
        if (this.m_staminaRegenMultiplier != 1f)
        {
            text = text + "$se_staminaregen " + ((this.m_staminaRegenMultiplier - 1f) * 100f).ToString("+0;-0") + "%\n";
        }
        if (this.m_addMaxCarryWeight != 0f)
        {
            text = text + "$se_max_carryweight " + this.m_addMaxCarryWeight.ToString("+0;-0") + "\n";
        }
        if (this.m_mods.Count > 0)
        {
            text += SE_Stats.GetDamageModifiersTooltipString(this.m_mods);
        }
        if (this.m_noiseModifier != 0f)
        {
            text = text + "$se_noisemod " + (this.m_noiseModifier * 100f).ToString("+0;-0") + "%\n";
        }
        if (this.m_stealthModifier != 0f)
        {
            text = text + "$se_sneakmod " + (-this.m_stealthModifier * 100f).ToString("+0;-0") + "%\n";
        }
        return(text);
    }
示例#5
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());
        }
        private static bool Prefix(ref string __result, ItemDrop.ItemData item, int qualityLevel, bool crafting)
        {
            if (!item.IsMagic())
            {
                return(true);
            }

            Player        localPlayer = Player.m_localPlayer;
            StringBuilder text        = new StringBuilder(256);

            var magicItem   = item.GetMagicItem();
            var magicColor  = magicItem.GetColorString();
            var displayName = magicItem.GetDisplayName(item.Extended());

            text.Append($"<color={magicColor}>{magicItem.GetRarityDisplay()} {displayName}</color>\n");
            text.Append(item.m_shared.m_description);

            text.Append("\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>", 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>", item.GetValue(), item.m_shared.m_value);
            }

            var weightColor = magicItem.HasEffect(MagicEffectType.ReduceWeight) || magicItem.HasEffect(MagicEffectType.Weightless) ? magicColor : "orange";

            text.Append($"\n$item_weight: <color={weightColor}>{item.GetWeight():0.0}</color>");

            if (item.m_shared.m_maxQuality > 1)
            {
                text.AppendFormat("\n$item_quality: <color=orange>{0}</color>", qualityLevel);
            }

            var indestructible = magicItem.HasEffect(MagicEffectType.Indestructible);

            if (!indestructible && item.m_shared.m_useDurability)
            {
                var maxDurabilityColor1 = magicItem.HasEffect(MagicEffectType.ModifyDurability) ? magicColor : "orange";
                var maxDurabilityColor2 = magicItem.HasEffect(MagicEffectType.ModifyDurability) ? magicColor : "yellow";

                float  maxDurability = item.GetMaxDurability(qualityLevel);
                float  durability    = item.m_durability;
                float  currentDurabilityPercentage = item.GetDurabilityPercentage() * 100f;
                string durabilityPercentageString  = currentDurabilityPercentage.ToString("0");
                string durabilityValueString       = durability.ToString("0");
                string durabilityMaxString         = maxDurability.ToString("0");
                text.Append($"\n$item_durability: <color={maxDurabilityColor1}>{durabilityPercentageString}%</color> <color={maxDurabilityColor2}>({durabilityValueString}/{durabilityMaxString})</color>");

                if (item.m_shared.m_canBeReparied)
                {
                    Recipe recipe = ObjectDB.instance.GetRecipe(item);
                    if (recipe != null)
                    {
                        int minStationLevel = recipe.m_minStationLevel;
                        text.AppendFormat("\n$item_repairlevel: <color=orange>{0}</color>", minStationLevel.ToString());
                    }
                }
            }
            else if (indestructible)
            {
                text.Append($"\n$item_durability: <color={magicColor}>Indestructible</color>");
            }

            var magicBlockPower    = magicItem.HasEffect(MagicEffectType.ModifyBlockPower);
            var magicBlockColor1   = magicBlockPower ? magicColor : "orange";
            var magicBlockColor2   = magicBlockPower ? magicColor : "yellow";
            var magicParry         = magicItem.HasEffect(MagicEffectType.ModifyParry);
            var totalParryBonusMod = magicItem.GetTotalEffectValue(MagicEffectType.ModifyParry, 0.01f);
            var magicParryColor    = magicParry ? magicColor : "orange";

            switch (item.m_shared.m_itemType)
            {
            case ItemDrop.ItemData.ItemType.Consumable:
                if (item.m_shared.m_food > 0.0)
                {
                    text.AppendFormat("\n$item_food_health: <color=orange>{0}</color>", item.m_shared.m_food);
                    text.AppendFormat("\n$item_food_stamina: <color=orange>{0}</color>", item.m_shared.m_foodStamina);
                    text.AppendFormat("\n$item_food_duration: <color=orange>{0}s</color>", item.m_shared.m_foodBurnTime);
                    text.AppendFormat("\n$item_food_regen: <color=orange>{0} hp/tick</color>", item.m_shared.m_foodRegen);
                }

                string consumeStatusEffectTooltip = item.GetStatusEffectTooltip();
                if (consumeStatusEffectTooltip.Length > 0)
                {
                    text.Append("\n\n");
                    text.Append(consumeStatusEffectTooltip);
                }

                break;

            case ItemDrop.ItemData.ItemType.OneHandedWeapon:
            case ItemDrop.ItemData.ItemType.Bow:
            case ItemDrop.ItemData.ItemType.TwoHandedWeapon:
            case ItemDrop.ItemData.ItemType.Torch:
                text.Append(GetDamageTooltipString(magicItem, item.GetDamage(qualityLevel), item.m_shared.m_skillType, magicColor));
                float  baseBlockPower1            = item.GetBaseBlockPower(qualityLevel);
                float  blockPowerTooltipValue     = item.GetBlockPowerTooltip(qualityLevel);
                string blockPowerPercentageString = blockPowerTooltipValue.ToString("0");
                text.Append($"\n$item_blockpower: <color={magicBlockColor1}>{baseBlockPower1}</color> <color={magicBlockColor2}>({blockPowerPercentageString})</color>");
                if (item.m_shared.m_timedBlockBonus > 1.0)
                {
                    text.Append($"\n$item_deflection: <color={magicParryColor}>{item.GetDeflectionForce(qualityLevel)}</color>");

                    var timedBlockBonus = item.m_shared.m_timedBlockBonus;
                    if (magicParry)
                    {
                        timedBlockBonus *= 1.0f + totalParryBonusMod;
                    }

                    text.Append($"\n$item_parrybonus: <color={magicParryColor}>{timedBlockBonus:0.#}x</color>");
                }

                text.AppendFormat("\n$item_knockback: <color=orange>{0}</color>", item.m_shared.m_attackForce);

                var magicBackstab         = magicItem.HasEffect(MagicEffectType.ModifyBackstab);
                var totalBackstabBonusMod = magicItem.GetTotalEffectValue(MagicEffectType.ModifyBackstab, 0.01f);
                var magicBackstabColor    = magicBackstab ? magicColor : "orange";
                var backstabValue         = item.m_shared.m_backstabBonus * (1.0f + totalBackstabBonusMod);
                text.Append($"\n$item_backstab: <color={magicBackstabColor}>{backstabValue:0.#}x</color>");

                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;

            case ItemDrop.ItemData.ItemType.Shield:
                float baseBlockPower2 = item.GetBaseBlockPower(qualityLevel);
                blockPowerTooltipValue = item.GetBlockPowerTooltip(qualityLevel);
                string str5 = blockPowerTooltipValue.ToString("0");
                text.Append($"\n$item_blockpower: <color={magicBlockColor1}>{baseBlockPower2}</color> <color={magicBlockColor2}>({str5})</color>");
                if (item.m_shared.m_timedBlockBonus > 1.0)
                {
                    text.Append($"\n$item_deflection: <color={magicParryColor}>{item.GetDeflectionForce(qualityLevel)}</color>");

                    var timedBlockBonus = item.m_shared.m_timedBlockBonus;
                    if (magicParry)
                    {
                        timedBlockBonus *= 1.0f + totalParryBonusMod;
                    }

                    text.Append($"\n$item_parrybonus: <color={magicParryColor}>{timedBlockBonus:0.#}x</color>");
                }

                break;

            case ItemDrop.ItemData.ItemType.Helmet:
            case ItemDrop.ItemData.ItemType.Chest:
            case ItemDrop.ItemData.ItemType.Legs:
            case ItemDrop.ItemData.ItemType.Shoulder:
                var magicArmorColor = magicItem.HasEffect(MagicEffectType.ModifyArmor) ? magicColor : "orange";
                text.Append($"\n$item_armor: <color={magicArmorColor}>{item.GetArmor(qualityLevel):0.#}</color>");
                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");
                    text.Append(statusEffectTooltip3);
                }

                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>", item.m_shared.m_attackForce);
                break;
            }

            var magicMovement = magicItem.HasEffect(MagicEffectType.ModifyMovementSpeed);

            if ((magicMovement || item.m_shared.m_movementModifier != 0) && localPlayer != null)
            {
                var removePenalty = magicItem.HasEffect(MagicEffectType.RemoveSpeedPenalty);

                var itemMovementModifier = removePenalty ? 0 : item.m_shared.m_movementModifier * 100f;
                if (magicMovement)
                {
                    itemMovementModifier += magicItem.GetTotalEffectValue(MagicEffectType.ModifyMovementSpeed);
                }

                var itemMovementModDisplay = (itemMovementModifier == 0) ? "0%" : $"{itemMovementModifier:+0;-0}%";

                float movementModifier      = localPlayer.GetEquipmentMovementModifier();
                var   totalMovementModifier = movementModifier * 100f;
                var   color = (removePenalty || magicMovement) ? magicColor : "orange";
                text.Append($"\n$item_movement_modifier: <color={color}>{itemMovementModDisplay}</color> ($item_total:<color=yellow>{totalMovementModifier:+0;-0}%</color>)");
            }

            // Add magic item effects here
            text.Append(magicItem.GetTooltip());

            // Set stuff
            if (!string.IsNullOrEmpty(item.m_shared.m_setName))
            {
                AddSetTooltip(item, text);
            }

            __result = text.ToString();
            return(false);
        }
示例#7
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());
        }
示例#8
0
 private static void ModifyMaxCarryWeight_Prefix(SE_Stats __instance, ref float limit)
 {
     // 重量上限の効果をさらに追加
     limit += __instance.m_addMaxCarryWeight;
 }
示例#9
0
        private static bool CheckToggle(ItemDrop.ItemData item, int qualityLevel, bool crafting, string check, ref string replace)
        {
            switch (check)
            {
            case "dlc":
                return(item.m_shared.m_dlc.Length > 0);

            case "!dlc":
                return(item.m_shared.m_dlc.Length == 0);

            case "handed":
                string handed = GetHanded(item);
                if (handed != null)
                {
                    replace = replace.Replace("{itemHanded}", handed);
                    return(true);
                }
                return(false);

            case "!handed":
                return(GetHanded(item) == null);

            case "crafting":
                return(crafting);

            case "!crafting":
                return(!crafting);

            case "crafted":
                return(item.m_crafterID != 0);

            case "!crafted":
                return(item.m_crafterID == 0);

            case "teleport":
                return(item.m_shared.m_teleportable);

            case "!teleport":
                return(!item.m_shared.m_teleportable);

            case "value":
                return(item.m_shared.m_value > 0);

            case "!value":
                return(item.m_shared.m_value == 0);

            case "quality":
                return(item.m_shared.m_maxQuality > 1);

            case "!quality":
                return(item.m_shared.m_maxQuality == 1);

            case "durability":
                return(item.m_shared.m_useDurability);

            case "!durability":
                return(!item.m_shared.m_useDurability);

            case "repairable":
                return(item.m_shared.m_useDurability && item.m_shared.m_canBeReparied && ObjectDB.instance.GetRecipe(item) != null);

            case "!repairable":
                return(!item.m_shared.m_useDurability || !item.m_shared.m_canBeReparied || ObjectDB.instance.GetRecipe(item) == null);

            case "movement":
                return(item.m_shared.m_movementModifier != 0 && Player.m_localPlayer != null);

            case "!movement":
                return(item.m_shared.m_movementModifier == 0);

            case "setStatus":
                if (item.m_shared.m_setStatusEffect != null)
                {
                    string setStatus = item.m_shared.m_setStatusEffect.GetTooltipString();
                    replace = replace.Replace("{itemSetStatusInfo}", setStatus);
                    return(true);
                }
                return(false);

            case "!setStatus":
                return(item.m_shared.m_setStatusEffect == null);

            case "timedBlock":
                return(item.m_shared.m_timedBlockBonus > 1);

            case "!timedBlock":
                return(item.m_shared.m_timedBlockBonus > 1);

            case "projectile":
                string projectile = Traverse.Create(item).Method("GetProjectileTooltip", new object[] { qualityLevel }).GetValue <string>();
                if (projectile.Length > 0)
                {
                    replace = replace.Replace("{itemProjectileInfo}", projectile);
                    return(true);
                }
                return(false);

            case "!projectile":
                return(Traverse.Create(item).Method("GetProjectileTooltip", new object[] { qualityLevel }).GetValue <string>().Length == 0);

            case "damageMod":
                string damageMod = SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers);
                if (damageMod.Length > 0)
                {
                    replace = replace.Replace("{itemDamageModInfo}", damageMod);
                    return(true);
                }
                return(false);

            case "!damageMod":
                return(SE_Stats.GetDamageModifiersTooltipString(item.m_shared.m_damageModifiers).Length == 0);

            case "food":
                return(item.m_shared.m_food > 0);

            case "!food":
                return(item.m_shared.m_food == 0);

            case "status":
                if (item.m_shared.m_attackStatusEffect)
                {
                    replace = replace.Replace("{itemStatusInfo}", item.m_shared.m_attackStatusEffect.GetTooltipString());
                    return(true);
                }
                if (item.m_shared.m_consumeStatusEffect)
                {
                    replace = replace.Replace("{itemStatusInfo}", item.m_shared.m_consumeStatusEffect.GetTooltipString());
                    return(true);
                }
                return(false);

            case "!status":
                return(!item.m_shared.m_attackStatusEffect && !item.m_shared.m_consumeStatusEffect);
            }
            if (check == "itemType" + item.m_shared.m_itemType)
            {
                return(true);
            }
            if (check.StartsWith("!itemType") && check != "!itemType" + item.m_shared.m_itemType)
            {
                return(true);
            }
            return(false);
        }