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


C# GameData.GetType方法代码示例

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


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

示例1: damageStringForCharacter

        private string damageStringForCharacter(int characterIndex, GameData.Ability ability, TextBox damageField, ToolTip tooltip)
        {
            GameData.DataBuddyInformation character = characters[characterIndex];
            DataEquipmentInformation weapon = weapons[characterIndex];
            DataEquipmentInformation armor = armors[characterIndex];
            DataEquipmentInformation accessory = accessories[characterIndex];
            DataRecordMateriaInformation recordMateria = recordMaterias[characterIndex];

            int damage = (int)Math.Floor(damagePerHit(character, weapon, armor, accessory, recordMateria,
                Double.Parse(atkFields[characterIndex].Text), Double.Parse(magFields[characterIndex].Text),
                Double.Parse(mndFields[characterIndex].Text), ability));

            string damageString = damage.ToString("#,##0.##");
            if (ability.NumberOfHits > 1 || ability.GetType() == typeof(GameData.Abilities.ThiefsRevenge))
            {
                int hits = ability.NumberOfHits;
                if (ability.GetType() == typeof(GameData.Abilities.ThiefsRevenge))
                {
                    hits = Math.Max(1, (int)Math.Floor((Double.Parse(spdFields[characterIndex].Text) - 120) / 10));
                }
                else if (ability.GetType() == typeof(GameData.SoulBreaks.AeonsOfWingAndFlame))
                {
                    double mag = Double.Parse(magFields[characterIndex].Text);
                    if (mag >= 723)
                    {
                        hits = 9;
                    }
                    else if (mag >= 681)
                    {
                        hits = 8;
                    }
                    else if (mag >= 562)
                    {
                        hits = 7;
                    }
                }
                tooltip.SetToolTip(damageField, (Math.Min(damage, 9999) * hits).ToString("#,##0.##") + " total damage");
                damageString += " * " + hits;
            }
            else
            {
                tooltip.SetToolTip(damageField, "");
            }
            return damageString;
        }
开发者ID:KHShadowrunner,项目名称:ffrkx,代码行数:45,代码来源:FFRKViewPartyPlanner.cs


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