Ejemplo n.º 1
0
        private void CompanionOnDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
        {
            m_healthRemaining    = resultValue;
            m_maxHealthRemaining = maxValue;

            if (m_canSpawnRings && RingDropChance > UnityEngine.Random.value)
            {
                if (m_extantCompanion)
                {
                    m_extantCompanion.GetComponent <AIActor>().behaviorSpeculator.Stun(1);
                    m_extantCompanion.GetComponent <AIAnimator>().PlayUntilFinished(HitAnimation);
                    int RingCount = UnityEngine.Random.Range(3, 10);
                    ExpandUtility.SpawnCustomCurrency(m_extantCompanion.GetComponent <SpeculativeRigidbody>().GetUnitCenter(ColliderType.HitBox), RingCount, SonicRing.RingID);
                    AkSoundEngine.PostEvent("Play_EX_SonicLoseRings_01", m_extantCompanion);
                }
            }
            m_canSpawnRings = false;
        }