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


C# ActorController.GetPetInfoID方法代码示例

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


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

示例1: AddActorCombatLog

 private void AddActorCombatLog(ActorController actor)
 {
     if (actor == null || this.combatLog == null)
     {
         return;
     }
     if (actor.HighestDamage > this.combatLog.HighestDamage)
     {
         this.combatLog.HighestDamage = actor.HighestDamage;
     }
     if (actor.HighestHeal > this.combatLog.HighestHeal)
     {
         this.combatLog.HighestHeal = actor.HighestHeal;
     }
     for (int i = 0; i < this.combatLog.Data.Count; i++)
     {
         if (this.combatLog.Data[i].PetID == actor.GetPetInfoID() && this.combatLog.Data[i].SocketSlot == actor.SocketSlot)
         {
             this.combatLog.Data[i].HPPct = (int)actor.CurHP * 100 / (int)actor.MaxHP;
             this.combatLog.Data[i].DamageTaken += actor.DamageTaken;
             this.combatLog.Data[i].DamageTakenCount += actor.DamageTakenCount;
             this.combatLog.Data[i].HealTaken += actor.HealTaken;
             this.combatLog.Data[i].HealTakenCount += actor.HealTakenCount;
             this.combatLog.Data[i].Damage += actor.TotalDamage;
             this.combatLog.Data[i].Heal += actor.TotalHeal;
             for (int j = 0; j < actor.Skills.Length; j++)
             {
                 if (actor.Skills[j] != null && actor.Skills[j].Info != null)
                 {
                     bool flag = false;
                     for (int k = 0; k < this.combatLog.Data[i].Data.Count; k++)
                     {
                         if (actor.Skills[j].Info.ID == this.combatLog.Data[i].Data[k].SkillID)
                         {
                             this.combatLog.Data[i].Data[k].Count += actor.Skills[j].Count;
                             this.combatLog.Data[i].Data[k].Damage += actor.Skills[j].Damage;
                             this.combatLog.Data[i].Data[k].Heal += actor.Skills[j].Heal;
                             if (actor.Skills[j].HighDamage > this.combatLog.Data[i].Data[k].HighDamage)
                             {
                                 this.combatLog.Data[i].Data[k].HighDamage = actor.Skills[j].HighDamage;
                             }
                             flag = true;
                             break;
                         }
                     }
                     if (!flag)
                     {
                         SkillLog skillLog = new SkillLog();
                         skillLog.SkillID = actor.Skills[j].Info.ID;
                         skillLog.Count = actor.Skills[j].Count;
                         skillLog.Damage = actor.Skills[j].Damage;
                         skillLog.Heal = actor.Skills[j].Heal;
                         skillLog.HighDamage = actor.Skills[j].HighDamage;
                         this.combatLog.Data[i].Data.Add(skillLog);
                     }
                 }
             }
             return;
         }
     }
     ActorCombatLog actorCombatLog = new ActorCombatLog();
     actorCombatLog.PetID = actor.GetPetInfoID();
     actorCombatLog.HPPct = (int)actor.CurHP * 100 / (int)actor.MaxHP;
     actorCombatLog.DamageTaken += actor.DamageTaken;
     actorCombatLog.DamageTakenCount += actor.DamageTakenCount;
     actorCombatLog.HealTaken += actor.HealTaken;
     actorCombatLog.HealTakenCount += actor.HealTakenCount;
     actorCombatLog.Damage += actor.TotalDamage;
     actorCombatLog.Heal += actor.TotalHeal;
     actorCombatLog.SocketSlot = actor.SocketSlot;
     for (int l = 0; l < actor.Skills.Length; l++)
     {
         if (actor.Skills[l] != null && actor.Skills[l].Info != null)
         {
             SkillLog skillLog2 = new SkillLog();
             skillLog2.SkillID = actor.Skills[l].Info.ID;
             skillLog2.Count = actor.Skills[l].Count;
             skillLog2.Damage = actor.Skills[l].Damage;
             skillLog2.Heal = actor.Skills[l].Heal;
             skillLog2.HighDamage = actor.Skills[l].HighDamage;
             actorCombatLog.Data.Add(skillLog2);
         }
     }
     this.combatLog.Data.Add(actorCombatLog);
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:85,代码来源:ActorManager.cs


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