Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dashAttack"></param>
        private void OnReceivingDashAttack(CharacterDashAttack dashAttack)
        {
            if (dashAttack.character.powerUpIds.Contains(PowerUpId.Katana))
            {
                return;
            }

            dashAttack.Accept();

            var input = GetComponent <CharacterInput>();

            if (input != null)
            {
                input.Vibrate(0.5f, 0.5f, 0.2f);
            }

            Push(dashAttack.orientation,
                 dashAttack.character.gameplayState == CharacterGameplayState.Dash ? 2500.0f : 4000.0f,
                 0.25f);

            var launchKeyStateHandler = gameplayStateHandler as CharacterGameplayState_LaunchKey;

            if (launchKeyStateHandler != null)
            {
                launchKeyStateHandler.DropInPlace();
                SetGameplayState(CharacterGameplayState.Default);
            }

            GetComponent <HitFlash>()?.Flash();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="dashAttack"></param>
        private void OnReceivingDashAttack(CharacterDashAttack dashAttack)
        {
            if (this.IsInConstruction())
            {
                return;
            }

            dashAttack.Accept();
            TakeDamagesInternal(dashAttack);
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        public override void Enter()
        {
            base.Enter();

            _dashProperties = character.statsDescriptor.dashProperties;

            if (_dashDeflectAbility.abilityData == null)
            {
                _dashDeflectAbility.abilityData = character.spawner.dashDeflectAbilityData;
            }

            if (character.moveOrientation == Vector2.zero)
            {
                moveOrientation = character.targetOrientation;
            }
            else
            {
                moveOrientation = character.moveOrientation;
            }

            character.SetTriggerState(CharacterTriggerState.None);
            character.SetCosmeticAlpha(0.5f);

            character.dashParticleSystem.Play();
            character.GetComponent <SpriteAnimator>().Play(character.skinDescriptor.dashAnimation, true);

            _hasKatana = character.powerUpIds.Contains(PowerUpId.Katana);
            if (_hasKatana)
            {
                _hasKatana      = true;
                _katana         = character.GetComponent <KatanaBuff>();
                _dashProperties = _katana.powerUpData.dashProperties;
                _katana.SlashBegin();
            }

            _elapsed        = 0.0f;
            isDeflectActive = false;

            dashAttack = new CharacterDashAttack(character, moveOrientation);

            character.EmitSound(DashSoundKey);

            Telemetry.game.Incr("dashes");
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="dashAttack"></param>
 private void OnReceivingDashAttack(CharacterDashAttack dashAttack)
 {
     dashAttack.Accept();
     transform.parent.SendMessage(nameof(OnReceivingDashAttack), dashAttack, SendMessageOptions.DontRequireReceiver);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="dashAttack"></param>
 private void OnReceivingDashAttack(CharacterDashAttack dashAttack)
 {
     PlayAnim();
     dashAttack.Accept();
 }