Ejemplo n.º 1
0
 // Token: 0x060021E4 RID: 8676 RVA: 0x000A0758 File Offset: 0x0009E958
 private static void Recalculate()
 {
     HUDBossHealthBarController.totalBossHealth    = 0f;
     HUDBossHealthBarController.totalMaxBossHealth = 0f;
     if (BossGroup.instance)
     {
         ReadOnlyCollection <CharacterMaster> readOnlyMembersList = BossGroup.instance.readOnlyMembersList;
         for (int i = 0; i < readOnlyMembersList.Count; i++)
         {
             HUDBossHealthBarController.GetBossMemory(readOnlyMembersList[i]);
         }
     }
     for (int j = 0; j < HUDBossHealthBarController.bossMemoryList.Count; j++)
     {
         HUDBossHealthBarController.BossMemory bossMemory = HUDBossHealthBarController.bossMemoryList[j];
         bossMemory.UpdateLastKnownHealth();
         HUDBossHealthBarController.totalBossHealth    += bossMemory.lastKnownHealth;
         HUDBossHealthBarController.totalMaxBossHealth += bossMemory.lastKnownMaxHealth;
     }
     HUDBossHealthBarController.shouldBeActive = (HUDBossHealthBarController.totalBossHealth != 0f);
     if (HUDBossHealthBarController.shouldBeActive)
     {
         HUDBossHealthBarController.totalHealthFraction        = ((HUDBossHealthBarController.totalMaxBossHealth == 0f) ? 0f : Mathf.Clamp01(HUDBossHealthBarController.totalBossHealth / HUDBossHealthBarController.totalMaxBossHealth));
         HUDBossHealthBarController.delayedTotalHealthFraction = Mathf.SmoothDamp(HUDBossHealthBarController.delayedTotalHealthFraction, HUDBossHealthBarController.totalHealthFraction, ref HUDBossHealthBarController.healthFractionVelocity, 0.1f);
         HUDBossHealthBarController.healthString = Mathf.FloorToInt(HUDBossHealthBarController.totalBossHealth) + "/" + Mathf.FloorToInt(HUDBossHealthBarController.totalMaxBossHealth);
         return;
     }
     HUDBossHealthBarController.bossMemoryList.Clear();
 }
Ejemplo n.º 2
0
 // Token: 0x060021E2 RID: 8674 RVA: 0x000A0630 File Offset: 0x0009E830
 private static HUDBossHealthBarController.BossMemory GetBossMemory(CharacterMaster bossMaster)
 {
     if (!bossMaster)
     {
         return(null);
     }
     for (int i = 0; i < HUDBossHealthBarController.bossMemoryList.Count; i++)
     {
         if (HUDBossHealthBarController.bossMemoryList[i].master == bossMaster)
         {
             return(HUDBossHealthBarController.bossMemoryList[i]);
         }
     }
     HUDBossHealthBarController.BossMemory bossMemory = new HUDBossHealthBarController.BossMemory
     {
         master = bossMaster
     };
     HUDBossHealthBarController.bossMemoryList.Add(bossMemory);
     if (HUDBossHealthBarController.bossMemoryList.Count == 1)
     {
         HUDBossHealthBarController.bossNameString = Language.GetString(bossMaster.bodyPrefab.GetComponent <CharacterBody>().baseNameToken);
         string text = bossMaster.bodyPrefab.GetComponent <CharacterBody>().GetSubtitle();
         if (text.Length == 0)
         {
             text = Language.GetString("NULL_SUBTITLE");
         }
         HUDBossHealthBarController.bossSubtitleResolvedString = "<sprite name=\"CloudLeft\" tint=1> " + text + "<sprite name=\"CloudRight\" tint=1>";
         EliteIndex eliteIndex = EliteCatalog.IsEquipmentElite(bossMaster.inventory.currentEquipmentIndex);
         if (eliteIndex != EliteIndex.None)
         {
             HUDBossHealthBarController.bossNameString = EliteCatalog.GetEliteDef(eliteIndex).prefix + HUDBossHealthBarController.bossNameString;
         }
     }
     return(bossMemory);
 }