Exemplo n.º 1
0
 public void UpdateBuffs(List <PartyBuff> p_buffs)
 {
     m_partyBuffs = p_buffs;
     if (m_buffAnchor != null)
     {
         HelperBuffs.UpdatePartyBuffs(m_buffAnchor.gameObject, p_buffs, m_buffViews, m_buffViewPrefab, new EventHandler(OnTooltip));
     }
 }
Exemplo n.º 2
0
        private void UpdateBuffs()
        {
            GameObject p_buffViewPrefab = Helper.ResourcesLoad <GameObject>("GuiPrefabs/MonsterBuffView");
            List <MonsterAbilityBase> passiveAbilities = ((Monster)MyController).AbilityHandler.PassiveAbilities;

            HelperBuffs.AddMonsterAbilities(m_BuffAnchor.gameObject, passiveAbilities, m_buffList, p_buffViewPrefab, OnTooltipEvent);
            List <MonsterBuff> buffList = ((Monster)MyController).BuffHandler.BuffList;

            m_buffCount        = buffList.Count + passiveAbilities.Count;
            m_buffLabelEnabled = false;
            if (m_buffCount > 0)
            {
                if (!m_movedByBuffs)
                {
                    Vector3 localPosition = m_dummyObject.transform.localPosition;
                    localPosition.y += 50f;
                    TweenPosition.Begin(m_dummyObject, 0.6f, localPosition);
                    m_movedByBuffs = true;
                }
            }
            else if (m_movedByBuffs)
            {
                Vector3 localPosition2 = m_dummyObject.transform.localPosition;
                localPosition2.y -= 50f;
                TweenPosition.Begin(m_dummyObject, 0.6f, localPosition2);
                m_movedByBuffs = false;
            }
            HelperBuffs.UpdateMonsterBuffs(m_BuffAnchor.gameObject, m_HPBarRoot.gameObject.activeSelf, buffList, m_buffList, p_buffViewPrefab, OnTooltipEvent, passiveAbilities.Count);
            foreach (MonsterBuffView monsterBuffView in m_buffList)
            {
                if (monsterBuffView.LabelEnabled)
                {
                    m_buffLabelEnabled = true;
                    break;
                }
            }
        }
Exemplo n.º 3
0
 private void Update()
 {
     if (MyController != null && m_HPBar != null)
     {
         if (m_isDeadAnimationFinished || m_recentDamage.cachedTransform.localScale.x == 0f)
         {
             SetVisible(true);
             UIWidget[] componentsInChildren = m_HPBar.transform.parent.GetComponentsInChildren <UIWidget>();
             foreach (UIWidget uiwidget in componentsInChildren)
             {
                 uiwidget.alpha -= Time.deltaTime;
             }
             if (m_buffList.Count > 0)
             {
                 HelperBuffs.DestroyAllBuffViews(m_buffList, OnTooltipEvent);
             }
         }
         SetVisible(IsMonsterInFrontOfParty() || IsMonsterLastHitRecently());
         Vector3 localScale  = m_HPBar.cachedTransform.localScale;
         Vector3 localScale2 = m_recentDamage.cachedTransform.localScale;
         if (m_timeStartUpdateDamagebar == 0f && localScale.x != localScale2.x)
         {
             m_timeStartUpdateDamagebar = Time.time + 0.5f;
         }
         else if (Time.time > m_timeStartUpdateDamagebar)
         {
             Single num;
             if (Mathf.Abs(m_targetHPBarScaleX - localScale.x) < 0.001f)
             {
                 num = -1f;
             }
             else
             {
                 num = 1f;
             }
             Single num2 = Mathf.Sign(localScale.x - localScale2.x);
             localScale2.x += num2 * (m_initialSize * Time.deltaTime) * 0.5f;
             if (Mathf.Sign(localScale.x - localScale2.x) != num2)
             {
                 m_timeStartUpdateDamagebar = 0f;
                 if (num < 0f)
                 {
                     m_recentDamage.cachedTransform.localScale = localScale;
                 }
                 else
                 {
                     m_HPBar.cachedTransform.localScale = m_recentDamage.cachedTransform.localScale;
                 }
             }
             else if (num < 0f)
             {
                 m_recentDamage.cachedTransform.localScale = localScale2;
             }
             else
             {
                 localScale.x -= num2 * (m_initialSize * Time.deltaTime) * 0.5f;
                 m_HPBar.cachedTransform.localScale = localScale;
             }
         }
         if (m_currentlyUsedOutlineSetting != ConfigManager.Instance.Options.EnemyOutlineOpacity)
         {
             m_currentlyUsedOutlineSetting = ConfigManager.Instance.Options.EnemyOutlineOpacity;
             OutlineGlowFX component = GetComponent <OutlineGlowFX>();
             if (component != null && !component.IsDestroyed)
             {
                 component.SetGlobalIntensity(m_currentlyUsedOutlineSetting);
                 ShowOutline(false, m_selectedColor);
             }
             else if (LegacyLogic.Instance.WorldManager.Party.SelectedMonster == MyController)
             {
                 ShowSelection();
             }
         }
         if (LegacyLogic.Instance.ConversationManager.IsOpen)
         {
             SetVisible(false);
         }
     }
 }