private void OnTriggerProjectile(BaseEventParameters baseParams)
    {
        float      ownerLocalScaleX = m_Owner.transform.localScale.x;
        GameObject projectile       = GameObject.Instantiate(m_Config.m_ProjectilePrefab, m_ProjectileHook.position, Quaternion.AngleAxis(m_Config.m_ProjectileAngle, Vector3.forward * ownerLocalScaleX));

        projectile.transform.localScale = new Vector3(ownerLocalScaleX, projectile.transform.localScale.y, projectile.transform.localScale.z);

        ProjectileComponent projectileComponent = projectile.GetComponentInChildren <ProjectileComponent>();

        if (projectileComponent)
        {
            projectileComponent.OnInit(this, m_Config);
            m_MyProjectile = projectileComponent;
        }
        else
        {
            KakutoDebug.LogError("ProjectileComponent could not be found on " + projectile);
            GameObject.Destroy(projectile);
        }

        if (m_IsGuardCrush)
        {
            SetNextNonSuperProjectileGuardCrush(m_InfoComponent.GetPlayerIndex(), false);
            PlayerGuardCrushTriggerAttackLogic.SetTriggerPointStatus(m_InfoComponent, PlayerGuardCrushTriggerAttackLogic.ETriggerPointStatus.Inactive);
        }
    }
Пример #2
0
    void OnParrySuccess(BaseEventParameters baseParams)
    {
        IncreaseSuperGauge(m_Config.m_SuperGaugeParrySuccessBonus);
        m_ParryState = EParryState.Counter;
        m_HasTouched = true; // Set it to true in order to allow unblock attack and cancelling this one by another one if needed (parry success is considered as a regular attack hit)
        if (PlayerGuardCrushTriggerAttackLogic.GetTriggerPointStatus(GetPlayerIndex()) == PlayerGuardCrushTriggerAttackLogic.ETriggerPointStatus.Inactive)
        {
            PlayerGuardCrushTriggerAttackLogic.SetTriggerPointStatus(m_InfoComponent, PlayerGuardCrushTriggerAttackLogic.ETriggerPointStatus.Active); // Successfully parrying a hit activate the trigger
        }

        m_Animator.Play(K_PARRY_COUNTER_ANIM, 0, 0);

        ChronicleManager.AddChronicle(m_Owner, EChronicleCategory.Attack, "ParrySuccess: Freeze time");
        m_TimeScaleManager.FreezeTime(m_Animator);
    }