當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。