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


C# Creature.GetOwner方法代码示例

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


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

示例1: NoApplyOptions

    public void NoApplyOptions(Creature obj)
    {
        if (m_refItem.levelup == null || m_refItem.levelup.optionPerLevel == null)
            return;

        foreach(RefPriceCondition.RefOptionPerLevel op in m_refItem.levelup.optionPerLevel)
        {
            float optionValue = 0f;
            if (op.levelPer == false)
            {
                optionValue = -op.option.values[0];
            }
            else
            {
                optionValue = -op.option.values[0]*(RefItem.maxLevel/op.level);

            }

            switch(op.option.type)
            {
            case Option.DmgMultiplier:
                obj.m_creatureProperty.DamageMultiPlier += optionValue;

                break;
            case Option.MoveSpeed:
                obj.m_creatureProperty.AlphaMoveSpeed += optionValue;
                break;
            case Option.DmgReduction:
                obj.m_creatureProperty.DamageReduction += optionValue;
                break;
            case Option.Weapon:
                break;
            case Option.Strength:
                obj.m_creatureProperty.AlphaPhysicalAttackDamage += (int)optionValue;
                break;
            case Option.MaxHp:
                obj.m_creatureProperty.AlphaMaxHP += (int)optionValue;
                break;
            case Option.MaxSp:
                obj.m_creatureProperty.AlphaMaxSP += (int)optionValue;
                break;
            case Option.RegenSp:
                obj.m_creatureProperty.AlphaSPRegen += optionValue;
                break;
            case Option.TapDamage:
                obj.m_creatureProperty.TapDamage += (int)optionValue;
                break;
            case Option.Critical:
                obj.m_creatureProperty.AlphaCriticalChance += optionValue;
                break;
            case Option.CriticalDmg:
                obj.m_creatureProperty.AlphaCriticalDamage += optionValue;
                break;
            case Option.LifeSteal:
                obj.m_creatureProperty.AlphaLifeSteal += optionValue;
                break;
            case Option.Dodge:
                obj.m_creatureProperty.Dodge += optionValue;
                break;
            case Option.GainExtraGold:
                obj.m_creatureProperty.GainExtraGold += optionValue;
                Creature owner = obj.GetOwner();
                if (owner != null)
                {
                    owner.m_creatureProperty.GainExtraGold += optionValue;
                }
                break;
            }

        }
    }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:71,代码来源:ItemData.cs

示例2: ApplyOptions

    public void ApplyOptions(Creature obj, bool levelup)
    {
        if (m_refItem.levelup == null || m_refItem.levelup.optionPerLevel == null)
            return;

        foreach(RefPriceCondition.RefOptionPerLevel op in m_refItem.levelup.optionPerLevel)
        {
            float optionValue = 0f;
            if (op.levelPer == false)
            {
                if (levelup == false)
                {
                    if (Level >= op.level)
                        optionValue = op.option.values[0];
                }
                else
                {
                    if (Level == op.level)
                        optionValue = op.option.values[0];
                }
            }
            else
            {
                if (levelup == false)
                    optionValue = op.option.values[0]*(Level/op.level);
                else
                {
                    if (Level%op.level == 0)
                        optionValue = op.option.values[0];
                }
            }

            switch(op.option.type)
            {
            case Option.DmgMultiplier:
                obj.m_creatureProperty.DamageMultiPlier += optionValue;

                break;
            case Option.MoveSpeed:
                obj.m_creatureProperty.AlphaMoveSpeed += optionValue;
                break;
            case Option.DmgReduction:
                obj.m_creatureProperty.DamageReduction += optionValue;
                break;
            case Option.Weapon:
                int weaponRefItemId = (int)optionValue;
                if (weaponRefItemId == 0)
                    break;

                if (weaponRefItemId == Const.EmbersRefItemId)
                {
                    obj.SetSubWeapon(obj.WeaponHolder.MainWeapon, new ItemWeaponData(Const.EmbersRefItemId), new RefMob.WeaponDesc());
                }
                else
                {
                    ItemWeaponData weaponData = new ItemWeaponData((int)optionValue);

                    weaponData.Level = (int)op.option.values[1];
                    obj.EquipPassiveSkillWeapon(weaponData, new RefMob.WeaponDesc());
                }
                break;
            case Option.Strength:
                obj.m_creatureProperty.AlphaPhysicalAttackDamage += (int)optionValue;
                break;
            case Option.MaxHp:
                obj.m_creatureProperty.AlphaMaxHP += (int)optionValue;
                break;
            case Option.MaxSp:
                obj.m_creatureProperty.AlphaMaxSP += (int)optionValue;
                break;
            case Option.RegenSp:
                obj.m_creatureProperty.AlphaSPRegen += optionValue;
                break;
            case Option.TapDamage:
                obj.m_creatureProperty.TapDamage += (int)optionValue;
                break;
            case Option.Critical:
                obj.m_creatureProperty.AlphaCriticalChance += optionValue;
                break;
            case Option.CriticalDmg:
                obj.m_creatureProperty.AlphaCriticalDamage += optionValue;
                break;
            case Option.LifeSteal:
                obj.m_creatureProperty.AlphaLifeSteal += optionValue;
                break;
            case Option.Dodge:
                obj.m_creatureProperty.Dodge += optionValue;
                break;
            case Option.GainExtraGold:
                obj.m_creatureProperty.GainExtraGold += optionValue;
                Creature owner = obj.GetOwner();
                if (owner != null)
                {
                    owner.m_creatureProperty.GainExtraGold += optionValue;
                }
                break;
            }

        }
    }
开发者ID:yakolla,项目名称:MarineVsAlien,代码行数:100,代码来源:ItemData.cs


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