Пример #1
0
        // Token: 0x060000CA RID: 202 RVA: 0x00004E74 File Offset: 0x00003074
        public virtual void PlayAttackSlash(Vector3 target, HitInfo hit)
        {
            Player.NailStrikePool.Instantiate(target, Quaternion.identity);

            GameObject gameObject = Player.SlashImpactPool.Instantiate(target, Quaternion.identity);

            switch (DirectionUtilities.DegreesToDirection(hit.Direction))
            {
            case CardinalDirection.Up:
                this.SetRotation2D(gameObject.transform, (float)UnityEngine.Random.Range(70, 110));
                gameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1f);
                break;

            case CardinalDirection.Down:
                this.SetRotation2D(gameObject.transform, (float)UnityEngine.Random.Range(70, 110));
                gameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1f);
                break;

            case CardinalDirection.Left:
                this.SetRotation2D(gameObject.transform, (float)UnityEngine.Random.Range(340, 380));
                gameObject.transform.localScale = new Vector3(-1.5f, 1.5f, 1f);
                break;

            case CardinalDirection.Right:
                this.SetRotation2D(gameObject.transform, (float)UnityEngine.Random.Range(340, 380));
                gameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1f);
                break;
            }
        }
Пример #2
0
        public void RecoilByDamage(HitInfo hit)
        {
            int attackDirection = 0;
            CardinalDirection cardinalDirection = DirectionUtilities.DegreesToDirection(hit.Direction);

            if (cardinalDirection != CardinalDirection.Up)
            {
                if (cardinalDirection != CardinalDirection.Down)
                {
                    if (cardinalDirection == CardinalDirection.Left)
                    {
                        attackDirection = 2;
                    }
                }
                else
                {
                    attackDirection = 3;
                }
            }
            else
            {
                attackDirection = 1;
            }
            base.RecoilByDirection(attackDirection, hit.AttackStrength);
        }
Пример #3
0
        public void PlayHitEffect(HitInfo hit, Vector3 effectsOffset = default(Vector3))
        {
            if (!firedOnCurrentFrame)
            {
                firedOnCurrentFrame = true;

                WeaverAudio.PlayAtPoint(DamageSound, transform.position, channel: AudioChannel.Sound);

                if (doFlashEffects)
                {
                    flasher.FlashNormalHit();
                }

                GameObject hitParticles = Instantiate(Assets.EffectAssets.UninfectedHitPrefab, transform.position + effectsOffset, Quaternion.identity);
                //GameObject hitParticles = Pooling.Instantiate(Assets.EffectAssets.UninfectedHitPrefab, transform.position + effectsOffset, Quaternion.identity);

                var direction = DirectionUtilities.DegreesToDirection(hit.Direction);

                switch (direction)
                {
                case CardinalDirection.Up:
                    SetRotation2D(hitParticles.transform, 45f);
                    break;

                case CardinalDirection.Down:
                    SetRotation2D(hitParticles.transform, 225f);
                    break;

                case CardinalDirection.Left:
                    SetRotation2D(hitParticles.transform, -225f);
                    break;

                case CardinalDirection.Right:
                    SetRotation2D(hitParticles.transform, -45f);
                    break;
                }

                Flings.SpawnFlings(NormalFlings, transform.position + effectsOffset, direction);
            }
        }
Пример #4
0
        public void PlayHitEffect(HitInfo hit, Vector3 effectsOffset = default(Vector3))
        {
            if (!firedOnCurrentFrame)
            {
                firedOnCurrentFrame = true;

                var audio = WeaverAudio.PlayAtPoint(DamageSound, transform.position, channel: AudioChannel.Sound);
                audio.AudioSource.pitch = UnityEngine.Random.Range(audioPitchMin, audioPitchMax);

                //DamageFlashPool.Instantiate(transform.position + effectsOffset, Quaternion.identity);
                Pooling.Instantiate(DamageFlash, transform.position + effectsOffset, Quaternion.identity);

                if (doFlashEffects)
                {
                    flasher.flashInfected();
                }

                switch (DirectionUtilities.DegreesToDirection(hit.Direction))
                {
                case CardinalDirection.Up:
                    if (doBlood)
                    {
                        Blood.SpawnDirectionalBlood(transform.position + effectsOffset, CardinalDirection.Up);
                    }
                    //HitPuffPool.Instantiate(transform.position, Quaternion.Euler(270f, 90f, 270f));
                    Pooling.Instantiate(HitPuff, transform.position, Quaternion.Euler(270f, 90f, 270f));
                    break;

                case CardinalDirection.Down:
                    if (doBlood)
                    {
                        Blood.SpawnDirectionalBlood(transform.position + effectsOffset, CardinalDirection.Down);
                    }
                    Pooling.Instantiate(HitPuff, transform.position, Quaternion.Euler(-72.5f, -180f, -180f));
                    break;

                case CardinalDirection.Left:
                    if (doBlood)
                    {
                        Blood.SpawnDirectionalBlood(transform.position + effectsOffset, CardinalDirection.Left);
                    }
                    Pooling.Instantiate(HitPuff, transform.position, Quaternion.Euler(180f, 90f, 270f));
                    break;

                case CardinalDirection.Right:
                    if (doBlood)
                    {
                        Blood.SpawnDirectionalBlood(transform.position + effectsOffset, CardinalDirection.Right);
                    }
                    Pooling.Instantiate(HitPuff, transform.position, Quaternion.Euler(0f, 90f, 270f));
                    break;
                }

                //GameObject hitParticles = Instantiate(Assets.EffectAssets.UninfectedHitPrefab, transform.position + effectsOffset, Quaternion.identity);
                //GameObject hitParticles = InfectedHitPool.Instantiate(transform.position + effectsOffset, Quaternion.identity);

                /*var direction = DirectionUtilities.DegreesToDirection(hit.Direction);
                 *
                 * switch (direction)
                 * {
                 *      case CardinalDirection.Up:
                 *              SetRotation2D(hitParticles.transform, 45f);
                 *              break;
                 *      case CardinalDirection.Down:
                 *              SetRotation2D(hitParticles.transform, 225f);
                 *              break;
                 *      case CardinalDirection.Left:
                 *              SetRotation2D(hitParticles.transform, -225f);
                 *              break;
                 *      case CardinalDirection.Right:
                 *              SetRotation2D(hitParticles.transform, -45f);
                 *              break;
                 * }
                 *
                 * Flings.SpawnFlings(NormalFlings, transform.position + effectsOffset, direction);*/
            }
        }