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


C# Prefix.AddTip方法代码示例

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


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

示例1: InitAffixes

        public void InitAffixes()
        {
            combined = new Prefix("Combined");

            float avgRand = 0f;
            float totalRand = 0f;
            foreach (GPrefix prefix in prefixes)
            {
                combined.pAdd.defense += prefix.pAdd.defense;
                combined.pAdd.crit += prefix.pAdd.crit;
                combined.pAdd.mana += prefix.pAdd.mana;
                combined.pAdd.damage += prefix.pAdd.damage;
                combined.pAdd.moveSpeed += prefix.pAdd.moveSpeed;
                combined.pAdd.meleeSpeed += prefix.pAdd.meleeSpeed;
                combined.pAdd.meleeDamage += prefix.pAdd.meleeDamage;
                combined.pAdd.rangedDamage += prefix.pAdd.rangedDamage;
                combined.pAdd.magicDamage += prefix.pAdd.magicDamage;
                combined.pAdd.meleeCrit += prefix.pAdd.meleeCrit;
                combined.pAdd.rangedCrit += prefix.pAdd.rangedCrit;
                combined.pAdd.magicCrit += prefix.pAdd.magicCrit;
                combined.playerMods.AddRange(prefix.playerMods);
                combined.itemMods.AddRange(prefix.itemMods);
                combined.customRequirements.AddRange(prefix.customRequirements);
                combined.toolTips.AddRange(prefix.toolTips);
                combined.dynamicTips.AddRange(prefix.dynamicTips);

                //'register' delegates
                foreach (string name in prefix.delegates.Keys)
                {
                    Delegate curDel = null;
                    item.delegates.TryGetValue(name, out curDel);
                    if (curDel != null)
                    {
                        Delegate newDel = Delegate.Combine(curDel, prefix.delegates[name]);
                        item.delegates[name] = newDel;
                    }
                    else item.delegates[name] = prefix.delegates[name];
                }

                avgRand += prefix.rarity;
                totalRand += 1f;
            }
            if (totalRand > 0f)
            {
                combined.AddTip("Rarity: " + avgRand);
                avgRand = avgRand / totalRand;
                int rare = Rand.SkewedRand(0, 6, avgRand);
                item.rare += rare;
            }
            item.prefix = 0;

            combined.Apply(item);
            if (item.rare < -1)
            {
                item.rare = -1;
            }
            if (item.rare > 6)
            {
                item.rare = 6;
            }
        }
开发者ID:Surfpup,项目名称:tConfig-Mods,代码行数:61,代码来源:Item.cs


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