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


C# ActorController.DoDamage方法代码示例

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


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

示例1: DoEffect

 private int DoEffect(SkillInfo info, ActorController caster, ActorController target)
 {
     long num = 0L;
     for (int i = 0; i < info.EffectType.Count; i++)
     {
         if (info.EffectType[i] != 0)
         {
             if (info.Rate[i] >= 10000 || UtilFunc.RangeRandom(0, 10000) <= info.Rate[i])
             {
                 switch (info.EffectType[i])
                 {
                 case 2:
                     target.AddBuff(info.Value3[i], caster);
                     goto IL_143;
                 case 4:
                     num += (long)caster.CalculateDamage(info.Value1[i], info.Value2[i], target);
                     goto IL_143;
                 case 5:
                     num += (long)caster.CalculateDamage(info.Value1[i], info.Value2[i], target);
                     goto IL_143;
                 }
                 global::Debug.LogError(new object[]
                 {
                     string.Concat(new object[]
                     {
                         "SkillID = [",
                         info.ID,
                         "] invalid EffectType = [",
                         info.EffectType[i],
                         "]"
                     })
                 });
             }
         }
         IL_143:;
     }
     Singleton<ActionMgr>.Instance.PlayHitAction(caster, info, target);
     int num2 = 0;
     float num3 = info.ThreatBase;
     if (num > 0L)
     {
         bool flag = caster.CanCrit(target);
         if (flag)
         {
             num = num * 150L / 100L;
         }
         num = num * (long)(10000 + caster.DamageMod) / 10000L;
         num2 = target.DoDamage(num, caster, ActorController.CanHitBack(info));
         if (target.UIText != null && num2 > 0)
         {
             if (target.FactionType == ActorController.EFactionType.ERed)
             {
                 if (flag)
                 {
                     GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_CriticalDamage, num2, null, 0);
                 }
                 else
                 {
                     GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_Damage, num2, null, 0);
                 }
             }
             else
             {
                 GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_Damage, -num2, null, 2);
             }
         }
         num3 += (float)num2 * info.ThreatCoef;
     }
     if (num3 > 0f && caster.IsHostileTo(target))
     {
         target.AiCtrler.ThreatMgr.AddThreat(caster, num3);
     }
     return num2;
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:74,代码来源:ArcaneMissilesAction.cs

示例2: DoEffectOnTarget


//.........这里部分代码省略.........
            Singleton<ActionMgr>.Instance.PlayHitAction(this, info, target);
        }
        else
        {
            Singleton<ActionMgr>.Instance.PlayAction(target, "Skill/hit_26", this);
        }
        float num8 = info.ThreatBase;
        if (num > 0L)
        {
            bool flag = this.CanCrit(target);
            if (flag)
            {
                num = num * 150L / 100L;
            }
            num = num * (long)(10000 + this.damageMod) / 10000L;
            num = num * (long)num5 / 10000L;
            if (this.talentEnhanceDamage != null)
            {
                int num9 = (int)(target.CurHP * 10000L / target.MaxHP);
                if (num9 <= this.talentEnhanceDamage.Value2)
                {
                    num = num * (long)(10000 + this.talentEnhanceDamage.Value1) / 10000L;
                }
            }
            if (!flag && info.TriggerDoubleDamage && this.doubleDamage != null && Time.time >= this.doubleDamage.Cooldown && UtilFunc.RangeRandom(0, 10000) < this.doubleDamage.Value1)
            {
                num = num * (long)this.doubleDamage.Value2 / 10000L;
                this.doubleDamage.Cooldown = Time.time + (float)this.doubleDamage.Value3;
            }
            if (target.shareDamage > 0)
            {
                num = Globals.Instance.ActorMgr.DoShareDamage(target, num, target.shareDamage);
            }
            num2 = target.DoDamage(num, this, ActorController.CanHitBack(info));
            if (num2 > 0 && target.damageReflect > 0)
            {
                long damage = (long)num2 * (long)target.damageReflect / 10000L;
                this.DoReflectDamage(damage, target);
            }
            if (num2 > 0 && target.reflexDamage != null && Time.time >= target.reflexDamage.Cooldown && UtilFunc.RangeRandom(0, 10000) < target.reflexDamage.Value1)
            {
                long num10 = (long)num2 * (long)target.reflexDamage.Value2 / 10000L;
                if (num10 > 0L)
                {
                    target.reflexDamage.Cooldown = Time.time + (float)target.reflexDamage.Value3;
                    this.DoReflectDamage(num10, target);
                }
            }
            if (target.uiText != null && num2 > 0)
            {
                if (target.factionType == ActorController.EFactionType.ERed)
                {
                    if (flag)
                    {
                        GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_CriticalDamage, num2, null, 0);
                    }
                    else if (this.actorType == ActorController.EActorType.EPlayer && this.Skills[0] != null && this.Skills[0].Info != info)
                    {
                        GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_SkillDamage, num2, null, 0);
                    }
                    else
                    {
                        GameUIManager.mInstance.HUDTextMgr.RequestShow(target, EShowType.EST_Damage, num2, null, 0);
                    }
                }
                else
开发者ID:floatyears,项目名称:Decrypt,代码行数:67,代码来源:ActorController.cs


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