Exemple #1
0
        private void StartEffect(PlayerController player)
        {
            if (!zoomy.spawnShadows)
            {
                zoomy.spawnShadows = true;
            }
            if (!player.IsGunLocked)
            {
                player.IsGunLocked = true;
            }
            Rad = new RadialSlowInterface
            {
                RadialSlowHoldTime     = 6f,
                RadialSlowOutTime      = 1.2f,
                RadialSlowTimeModifier = 0.4f,
                DoesSepia            = false,
                UpdatesForNewEnemies = true,
                audioEvent           = "Play_OBJ_time_bell_01",
            };
            Rad.DoRadialSlow(player.CenterPosition, player.CurrentRoom);
            player.stats.RecalculateStats(player, false, false);
            player.sprite.usesOverrideMaterial = true;
            Material material = player.sprite.renderer.material;

            material.shader = ShaderCache.Acquire("Brave/Internal/HologramShader");
            material.SetFloat("_IsGreen", 0f);
        }
Exemple #2
0
        //This block of code allows us to change the reload sounds.
        protected override void Update()
        {
            if (gun.CurrentOwner)
            {
                if (!gun.PreventNormalFireAudio)
                {
                    this.gun.PreventNormalFireAudio = true;
                }
                if (!gun.IsReloading && !HasReloaded)
                {
                    this.HasReloaded = true;
                }

                if (this.gun.HasChargedProjectileReady)
                {
                    effects_controller = 1;
                    RadialSlowInterface the_little_slow = new RadialSlowInterface();
                    the_little_slow.RadialSlowHoldTime     = .0f;
                    the_little_slow.RadialSlowOutTime      = .25f;
                    the_little_slow.RadialSlowInTime       = 5;
                    the_little_slow.RadialSlowTimeModifier = .4f;
                    the_little_slow.DoesSepia            = false;
                    the_little_slow.UpdatesForNewEnemies = true;

                    the_little_slow.RadialSlowInTime = 0f;
                    the_little_slow.DoRadialSlow(this.Owner.CenterPosition, this.gun.CurrentOwner.GetAbsoluteParentRoom());


                    multiplier++;
                }
            }


            base.Update();
        }
Exemple #3
0
        public override DebrisObject Drop(PlayerController player)
        {
            RadialSlowInterface test = new RadialSlowInterface();

            base.Update();
            return(base.Drop(player));
        }
Exemple #4
0
        protected void activateSlow(PlayerController user)
        {
            var timeSlow = new RadialSlowInterface();

            timeSlow.DoesSepia              = false;
            timeSlow.RadialSlowHoldTime     = 3f;
            timeSlow.RadialSlowTimeModifier = 0.01f;
            timeSlow.DoRadialSlow(user.specRigidbody.UnitCenter, user.CurrentRoom); //or whatever
        }
Exemple #5
0
        private void FreezeTime()
        {
            var timeSlow = new RadialSlowInterface();

            timeSlow.DoesSepia              = false;
            timeSlow.RadialSlowHoldTime     = 5f;
            timeSlow.RadialSlowTimeModifier = 0.01f;
            timeSlow.UpdatesForNewEnemies   = false;
            timeSlow.DoRadialSlow(Owner.specRigidbody.UnitCenter, Owner.CurrentRoom);
        }
Exemple #6
0
        public override void OnFinishAttack(PlayerController player, Gun gun)
        {
            if (player.IsInCombat)
            {
                AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject);
                if (effects_controller == 1)
                {
                    RadialSlowInterface the_big_slow = new RadialSlowInterface();
                    the_big_slow.RadialSlowHoldTime     = .75f;
                    the_big_slow.RadialSlowOutTime      = .25f;
                    the_big_slow.RadialSlowTimeModifier = 0f;
                    the_big_slow.DoesSepia            = true;
                    the_big_slow.UpdatesForNewEnemies = true;
                    the_big_slow.RadialSlowInTime     = 0f;
                    the_big_slow.DoRadialSlow(this.Owner.CenterPosition, this.gun.CurrentOwner.GetAbsoluteParentRoom());
                    RoomHandler room = player.CurrentRoom;


                    foreach (var enemy in room.GetActiveEnemies(RoomHandler.ActiveEnemyType.All))
                    {
                        if (multiplier > 1500)
                        {
                            enemy.healthHaver.ApplyDamage(80, Vector2.zero, "bracer", CoreDamageTypes.Magic, DamageCategory.Unstoppable, true, null, true);
                            this.DoSafeExplosion(enemy.specRigidbody.UnitCenter);
                        }
                        else
                        {
                            enemy.healthHaver.ApplyDamage(2 * multiplier / 40, Vector2.zero, "bracer", CoreDamageTypes.Magic, DamageCategory.Unstoppable, true, null, true);
                            this.DoSafeExplosion(enemy.specRigidbody.UnitCenter);
                        }
                        if (enemy.healthHaver.IsBoss)
                        {
                            enemy.healthHaver.ApplyDamage(45, Vector2.zero, "bracer", CoreDamageTypes.Magic, DamageCategory.Unstoppable, true, null, true);
                            this.DoSafeExplosion(enemy.specRigidbody.UnitCenter);
                            this.DoSafeExplosion(enemy.specRigidbody.UnitCenter);
                        }
                    }

                    foreach (var projectile in GetBullets())
                    {
                        if (projectile.Owner.healthHaver.IsBoss)
                        {
                            PassiveReflectItem.ReflectBullet(projectile, true, this.Owner, 15f, 1f, 15f, 0f);
                        }
                        else
                        {
                            PassiveReflectItem.ReflectBullet(projectile, true, this.Owner, 15f, 1f, 3f, 0f);
                        }
                    }
                    effects_controller = 0;
                    multiplier         = 0;
                }
                base.OnFinishAttack(player, gun);
            }
        }
        protected override void DoEffect(PlayerController user)
        {
            RadialSlowInterface test = new RadialSlowInterface();

            test.RadialSlowHoldTime     = 12f;
            test.RadialSlowOutTime      = 5f;
            test.RadialSlowTimeModifier = 0f;
            test.DoesSepia            = true;
            test.UpdatesForNewEnemies = true;
            test.RadialSlowInTime     = 2.5f;
            test.DoRadialSlow(user.CenterPosition, user.CurrentRoom);
        }
        private void Destruction(Projectile self)
        {
            var timeSlow = new RadialSlowInterface();

            timeSlow.DoesSepia              = false;
            timeSlow.EffectRadius           = this.radius;
            timeSlow.RadialSlowHoldTime     = this.lengthOfEffect;
            timeSlow.RadialSlowTimeModifier = this.timeMultiplier;
            timeSlow.UpdatesForNewEnemies   = true;
            timeSlow.DoRadialSlow(self.specRigidbody.UnitCenter, self.GetAbsoluteRoom());
            MagicCircleDoer.DoMagicCircle(self.specRigidbody.UnitCenter, this.radius, lengthOfEffect, ExtendedColours.freezeBlue, false);
        }
Exemple #9
0
        public void Za_worldo()
        {
            RadialSlowInterface the_big_slow = new RadialSlowInterface();

            the_big_slow.RadialSlowHoldTime     = 1.75f;
            the_big_slow.RadialSlowOutTime      = .25f;
            the_big_slow.RadialSlowTimeModifier = 0f;
            the_big_slow.DoesSepia            = true;
            the_big_slow.UpdatesForNewEnemies = true;
            the_big_slow.RadialSlowInTime     = 0f;
            the_big_slow.DoRadialSlow(this.Owner.CenterPosition, this.Owner.CurrentRoom);
        }
Exemple #10
0
        public override void Pickup(PlayerController player)
        {
            base.Pickup(player);
            RadialSlowInterface test = new RadialSlowInterface();

            test.RadialSlowHoldTime     = 9999999999999f;
            test.RadialSlowOutTime      = 1f;
            test.RadialSlowTimeModifier = 1f;
            test.DoesSepia = true;

            test.RadialSlowInTime = 4f;
            test.DoRadialSlow(player.CenterPosition, player.CurrentRoom);
        }
Exemple #11
0
        protected override void Update()
        {
            RadialSlowInterface test = new RadialSlowInterface();

            test.RadialSlowHoldTime     = 99999f;
            test.RadialSlowOutTime      = 1f;
            test.RadialSlowTimeModifier = 1f;
            test.DoesSepia = true;

            test.RadialSlowInTime = 4f;
            test.DoRadialSlow(this.Owner.CenterPosition, this.Owner.CurrentRoom);
            base.Update();
        }
        private void Slow()
        {
            Rad = new RadialSlowInterface
            {
                RadialSlowHoldTime     = 5f,
                RadialSlowOutTime      = 2f,
                RadialSlowTimeModifier = 0.4f,
                DoesSepia            = false,
                UpdatesForNewEnemies = true,
                audioEvent           = "Play_OBJ_time_bell_01",
            };
            PlayerController player = this.Owner;

            Rad.DoRadialSlow(Owner.CenterPosition, Owner.CurrentRoom);
        }
        private IEnumerator CauseDeath(AIActor aiActor, PlayerController user)
        {
            //GameManager.Instance.PauseRaw(true);

            Pixelator.Instance.DoFinalNonFadedLayer = true;
            //int PreviousLayer = aiActor.gameObject.layer;
            float elapsed  = 0f;
            float duration = 0.8f;

            user.healthHaver.IsVulnerable = false;
            user.SetInputOverride("tiddy");
            RadialSlowInterface Rad;

            Rad = new RadialSlowInterface
            {
                RadialSlowHoldTime     = 6f,
                RadialSlowOutTime      = 2f,
                RadialSlowTimeModifier = 0f,
                DoesSepia            = false,
                UpdatesForNewEnemies = true,
                audioEvent           = "Play_OBJ_time_bell_01",
            };
            Rad.DoRadialSlow(user.CenterPosition, user.CurrentRoom);
            //aiActor.LocalTimeScale = 0;
            GameObject          clockhairObject = Instantiate(BraveResources.Load <GameObject>("Clockhair", ".prefab"));
            ClockhairController clockhair       = clockhairObject.GetComponent <ClockhairController>();

            elapsed  = 0f;
            duration = clockhair.ClockhairInDuration;
            Vector3 clockhairTargetPosition = aiActor.sprite.WorldCenter;
            Vector3 clockhairStartPosition  = clockhairTargetPosition + new Vector3(-20f, 5f, 0f);

            clockhair.renderer.enabled = false;
            clockhair.spriteAnimator.Play("clockhair_intro");
            clockhair.hourAnimator.Play("hour_hand_intro");
            clockhair.minuteAnimator.Play("minute_hand_intro");
            clockhair.secondAnimator.Play("second_hand_intro");
            bool hasWobbled = false;

            while (elapsed < duration)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                float   t2              = elapsed / duration;
                float   smoothT         = Mathf.SmoothStep(0f, 1f, t2);
                Vector3 currentPosition = Vector3.Slerp(clockhairStartPosition, clockhairTargetPosition, smoothT);
                clockhairObject.transform.position = currentPosition.WithZ(0f);
                if (t2 > 0.5f)
                {
                    clockhair.renderer.enabled = true;
                    clockhair.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                }
                if (t2 > 0.75f)
                {
                    clockhair.hourAnimator.GetComponent <Renderer>().enabled   = true;
                    clockhair.minuteAnimator.GetComponent <Renderer>().enabled = true;
                    clockhair.secondAnimator.GetComponent <Renderer>().enabled = true;
                    clockhair.hourAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                    clockhair.minuteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                    clockhair.secondAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                }
                if (!hasWobbled && clockhair.spriteAnimator.CurrentFrame == clockhair.spriteAnimator.CurrentClip.frames.Length - 1)
                {
                    clockhair.spriteAnimator.Play("clockhair_wobble");
                    hasWobbled = true;
                }
                clockhair.sprite.UpdateZDepth();
                //aiActor.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                yield return(null);
            }
            if (!hasWobbled)
            {
                clockhair.spriteAnimator.Play("clockhair_wobble");
            }
            clockhair.SpinToSessionStart(clockhair.ClockhairSpinDuration);
            elapsed  = 0f;
            duration = clockhair.ClockhairSpinDuration + clockhair.ClockhairPauseBeforeShot;
            while (elapsed < duration)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                clockhair.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                yield return(null);
            }
            elapsed  = 0f;
            duration = 0.1f;
            clockhairStartPosition  = clockhairObject.transform.position;
            clockhairTargetPosition = clockhairStartPosition + new Vector3(0f, 12f, 0f);
            clockhair.spriteAnimator.Play("clockhair_fire");
            clockhair.hourAnimator.GetComponent <Renderer>().enabled   = false;
            clockhair.minuteAnimator.GetComponent <Renderer>().enabled = false;
            clockhair.secondAnimator.GetComponent <Renderer>().enabled = false;
            while (elapsed < duration)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                clockhair.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                //aiActor.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                yield return(null);
            }
            aiActor.healthHaver.ApplyDamage(10000000f, Vector2.zero, "You Died.", CoreDamageTypes.None, DamageCategory.Unstoppable, false, null, true);
            elapsed  = 0f;
            duration = 1f;
            while (elapsed < duration)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                if (clockhair.spriteAnimator.CurrentFrame == clockhair.spriteAnimator.CurrentClip.frames.Length - 1)
                {
                    clockhair.renderer.enabled = false;
                }
                else
                {
                    clockhair.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                }
                //aiActor.spriteAnimator.UpdateAnimation(GameManager.INVARIANT_DELTA_TIME);
                yield return(null);
            }

            Pixelator.Instance.FadeToColor(0.25f, Pixelator.Instance.FadeColor, true);
            Pixelator.Instance.LerpToLetterbox(1f, 0.25f);
            Pixelator.Instance.DoFinalNonFadedLayer = false;
            // aiActor.gameObject.SetLayerRecursively(PreviousLayer);
            // GameManager.Instance.ForceUnpause();
            //GameManager.Instance.PreventPausing = false;
            BraveTime.ClearMultiplier(GameManager.Instance.gameObject);
            yield return(new WaitForSeconds(1f));

            //GameManager.Instance.PrimaryPlayer.CurrentInputState = PlayerInputState.AllInput;
            //if (GameManager.Instance.SecondaryPlayer) { GameManager.Instance.SecondaryPlayer.CurrentInputState = PlayerInputState.AllInput; }
            //GameManager.Instance.MainCameraController.SetManualControl(false, true);
            user.ClearInputOverride("tiddy");

            Destroy(clockhairObject);

            user.healthHaver.IsVulnerable = true;
            yield break;
        }
        public IEnumerator HandleClockhair(AIActor targetEnemy, PlayerController user)
        {
            RadialSlowInterface Rad;

            Rad = new RadialSlowInterface
            {
                RadialSlowHoldTime     = 6f,
                RadialSlowOutTime      = 2f,
                RadialSlowTimeModifier = 0f,
                DoesSepia            = false,
                UpdatesForNewEnemies = true,
                audioEvent           = "Play_OBJ_time_bell_01",
            };
            Rad.DoRadialSlow(user.CenterPosition, user.CurrentRoom);
            user.healthHaver.IsVulnerable = false;
            user.SetInputOverride("tiddy");
            Pixelator.Instance.DoFinalNonFadedLayer = false;
            Transform           clockhairTransform = ((GameObject)Instantiate(BraveResources.Load("Clockhair", ".prefab"))).transform;
            ClockhairController clockhair          = clockhairTransform.GetComponent <ClockhairController>();
            // clockhair.gameObject.SetLayerRecursively(LayerMask.NameToLayer("Unpixelated"));
            float   elapsed  = 0f;
            float   duration = clockhair.ClockhairInDuration;
            Vector3 clockhairTargetPosition = targetEnemy.CenterPosition;
            Vector3 clockhairStartPosition  = clockhairTargetPosition + new Vector3(-20f, 5f, 0f);

            clockhair.renderer.enabled = true;
            clockhair.spriteAnimator.alwaysUpdateOffscreen = true;
            clockhair.spriteAnimator.Play("clockhair_intro");
            clockhair.hourAnimator.Play("hour_hand_intro");
            clockhair.minuteAnimator.Play("minute_hand_intro");
            clockhair.secondAnimator.Play("second_hand_intro");

            while (elapsed < duration)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                float t       = elapsed / duration;
                float smoothT = Mathf.SmoothStep(0f, 1f, t);
                clockhairTargetPosition = targetEnemy.CenterPosition;
                Vector3 currentPosition = Vector3.Slerp(clockhairStartPosition, clockhairTargetPosition, smoothT);
                clockhairTransform.position = currentPosition.WithZ(0f);
                if (t > 0.5f)
                {
                    clockhair.renderer.enabled = true;
                }
                if (t > 0.75f)
                {
                    clockhair.hourAnimator.GetComponent <Renderer>().enabled   = true;
                    clockhair.minuteAnimator.GetComponent <Renderer>().enabled = true;
                    clockhair.secondAnimator.GetComponent <Renderer>().enabled = true;
                }
                clockhair.sprite.UpdateZDepth();
                yield return(null);
            }
            clockhair.SetMotionType(1f);
            float dur = 2;

            elapsed = 0;
            clockhair.BeginSpinningWildly();
            while (elapsed < dur)
            {
                if (GameManager.INVARIANT_DELTA_TIME == 0f)
                {
                    elapsed += 0.05f;
                }
                elapsed += GameManager.INVARIANT_DELTA_TIME;
                clockhairTransform.position = targetEnemy.CenterPosition;
                yield return(null);
            }
            AkSoundEngine.PostEvent("Play_ENV_time_shatter_01", gameObject);
            targetEnemy.healthHaver.ApplyDamage(10000, Vector2.zero, "die", CoreDamageTypes.None, DamageCategory.Normal, false, null, true);
            yield return(new WaitForSeconds(.2f));

            Destroy(clockhairTransform.gameObject);
            user.ClearInputOverride("tiddy");
            user.healthHaver.IsVulnerable = true;
            yield break;
        }