PostEvent() public static method

public static PostEvent ( string in_pszEventName, UnityEngine in_gameObjectID ) : uint
in_pszEventName string
in_gameObjectID UnityEngine
return uint
Ejemplo n.º 1
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     AkSoundEngine.PostEvent("Play_WPN_unicornhorn_shot_01", base.gameObject);
 }
 public void NewMessage()
 {
     AkSoundEngine.PostEvent("not_moving", gameObject);
 }
Ejemplo n.º 3
0
 public static void PlayerJumpSFX(this PlayerController player)
 {
     AkSoundEngine.PostEvent(Tags.SFXTags.JUMP, player.gameObject);
 }
Ejemplo n.º 4
0
 public override void OnPostFired(PlayerController owner, Gun gun)
 {
     AkSoundEngine.PostEvent("Play_BOSS_Punchout_Punch_Hit_01", gameObject);
     gun.PreventNormalFireAudio = true;
 }
 public void EndOfLevel()
 {
     AkSoundEngine.PostEvent("end_of_level", gameObject);
 }
Ejemplo n.º 6
0
 //Methode pour jouer un event Wwise ayant une durée finie, en appelant une methode de callback quand il se termine
 // eventName : le nom de l'event
 // gObject : l'objet sur lequel il sera positionné dans l'espace ( si il s'agit  d'un son 3d )
 // callBackFunction : la fonction a appellé à la fin de l'event
 public static void PlayFiniteEvent(string eventName, GameObject gObject, AkCallbackManager.EventCallback callBackFunction)
 {
     AkSoundEngine.PostEvent(eventName, gObject, (uint)AkCallbackType.AK_EndOfEvent, callBackFunction, gObject);
 }
Ejemplo n.º 7
0
 public override void PlayChase()
 {
     AkSoundEngine.PostEvent(GameManager.instance.ChaseSpiderAmbPlay, player.modelTransform.gameObject);
 }
Ejemplo n.º 8
0
        private static void explode(Main main, Voxel map, Voxel.Coord coord, Vector3 pos, int radius, float physicsRadius)
        {
            // Kaboom
            AkSoundEngine.PostEvent(AK.EVENTS.PLAY_EXPLOSION, pos);

            Entity lightEntity = Factory.Get <PointLightFactory>().CreateAndBind(main);

            lightEntity.Serialize = false;
            PointLight light = lightEntity.Get <PointLight>();

            light.Color.Value       = new Vector3(1.3f, 1.1f, 0.9f);
            light.Attenuation.Value = 20.0f;
            light.Position.Value    = pos;
            lightEntity.Add(new Animation
                            (
                                new Animation.FloatMoveTo(light.Attenuation, 0.0f, 1.0f),
                                new Animation.Execute(light.Delete)
                            ));
            main.Add(lightEntity);

            SmokeFactory smokeFactory = Factory.Get <SmokeFactory>();

            for (int i = 0; i < 5; i++)
            {
                Entity smoke = smokeFactory.CreateAndBind(main);
                smoke.Get <Transform>().Position.Value = pos;
                main.Add(smoke);
            }

            ParticleEmitter.Emit(main, "Smoke", pos, physicsRadius * 0.4f, 250);

            Entity player = PlayerFactory.Instance;

            if (player != null && player.Active)
            {
                player.Get <CameraController>().Shake.Execute(pos, 50.0f);
            }

            const float physicsImpulse         = 70.0f;
            const float minPlayerDamage        = 0.1f;
            const float playerDamageMultiplier = 2.0f;

            // Remove the cells
            BlockFactory blockFactory = Factory.Get <BlockFactory>();

            foreach (Voxel m in Voxel.ActiveVoxels.ToList())
            {
                List <Voxel.Coord> removals = new List <Voxel.Coord>();

                Voxel.Coord c           = m.GetCoordinate(pos);
                Vector3     relativePos = m.GetRelativePosition(c);

                Quaternion quat = m.Entity.Get <Transform>().Quaternion;

                for (Voxel.Coord x = c.Move(Direction.NegativeX, radius - 1); x.X < c.X + radius; x.X++)
                {
                    for (Voxel.Coord y = x.Move(Direction.NegativeY, radius - 1); y.Y < c.Y + radius; y.Y++)
                    {
                        for (Voxel.Coord z = y.Move(Direction.NegativeZ, radius - 1); z.Z < c.Z + radius; z.Z++)
                        {
                            Voxel.State s = m[z];
                            if (s.ID == 0 || s.Permanent)
                            {
                                continue;
                            }

                            Vector3 cellPos = m.GetRelativePosition(z);
                            if ((cellPos - relativePos).Length() < radius - 1)
                            {
                                removals.Add(z);
                                if (random.NextDouble() > 0.5)
                                {
                                    Entity    block          = blockFactory.CreateAndBind(main);
                                    Transform blockTransform = block.Get <Transform>();
                                    blockTransform.Position.Value   = m.GetAbsolutePosition(cellPos);
                                    blockTransform.Quaternion.Value = quat;
                                    s.ApplyToBlock(block);
                                    main.Add(block);
                                }
                            }
                        }
                    }
                }
                if (removals.Count > 0)
                {
                    m.Empty(removals);
                    m.Regenerate();
                }
            }

            // Damage the player
            if (player != null && player.Active)
            {
                Vector3 toPlayer = player.Get <Transform>().Position - pos;
                float   d        = toPlayer.Length();
                if (d < physicsRadius)
                {
                    float attenuation = 1.0f;
                    if (d > 0)
                    {
                        Voxel.GlobalRaycast(pos, toPlayer / d, d, delegate(int x, Voxel.t c)
                        {
                            Voxel.State s = Voxel.States.All[c];
                            if (s.Permanent)
                            {
                                attenuation = 0.0f;
                                return(true);
                            }
                            else if (s.Hard)
                            {
                                attenuation -= 0.6f;
                            }
                            else
                            {
                                attenuation -= 0.35f;
                            }
                            return(false);
                        });
                        attenuation = Math.Max(0, attenuation);
                    }
                    player.Get <Agent>().Damage.Execute(attenuation * (minPlayerDamage + (1.0f - (d / physicsRadius)) * playerDamageMultiplier));
                }
            }

            // Apply impulse to dynamic maps
            foreach (Voxel m in Voxel.ActiveVoxels)
            {
                DynamicVoxel dm = m as DynamicVoxel;
                if (dm == null)
                {
                    continue;
                }

                Vector3 toMap         = dm.Transform.Value.Translation - pos;
                float   distanceToMap = toMap.Length();
                toMap /= distanceToMap;

                toMap *= Math.Max(0.0f, 1.0f - (distanceToMap / physicsRadius)) * Math.Min(200.0f, dm.PhysicsEntity.Mass) * physicsImpulse;

                dm.PhysicsEntity.ApplyImpulse(dm.Transform.Value.Translation + new Vector3(((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f), toMap);
            }

            // Apply impulse to physics blocks
            foreach (Entity b in main.Get("Block"))
            {
                PhysicsBlock block         = b.Get <PhysicsBlock>();
                Vector3      fromExplosion = b.Get <Transform>().Position.Value - pos;
                float        distance      = fromExplosion.Length();
                if (distance > 0.0f && distance < physicsRadius)
                {
                    float blend = 1.0f - (distance / physicsRadius);
                    block.LinearVelocity.Value  += fromExplosion * blend * 10.0f / distance;
                    block.AngularVelocity.Value += new Vector3(((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f, ((float)random.NextDouble() - 0.5f) * 2.0f) * blend;
                }
            }
        }
Ejemplo n.º 9
0
        protected override void DoEffect(PlayerController user)
        {
            AkSoundEngine.PostEvent("Play_WPN_deck4rd_shot_01", base.gameObject);
            float curHealth = user.healthHaver.GetCurrentHealth();

            if (user.healthHaver.NextShotKills == true)
            {
                user.healthHaver.NextShotKills = false;
                if (user.HasPickupID(564))
                {
                    for (int i = 0; i < user.activeItems.Count; i++)
                    {
                        if (user.activeItems[i].PickupObjectId == (499) && !user.activeItems[i].IsOnCooldown)
                        {
                            user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        }

                        else if (user.Blanks > 0)
                        {
                            user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        }

                        else if (user.healthHaver.Armor >= 1f || user.healthHaver.HasCrest)
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.Armor += 1f;
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.Armor += 1f;
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            }
                        }

                        else if (curHealth == 0.5f)
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);

                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            }
                        }

                        else
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                float curHealth2 = user.healthHaver.GetCurrentHealth();
                                user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                float curHealth2 = user.healthHaver.GetCurrentHealth();
                                user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                            }
                        }
                    }
                }

                else if (user.healthHaver.Armor >= 1f || user.healthHaver.HasCrest)
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.Armor += 1f;
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.Armor += 1f;
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                    }
                }

                else if (curHealth == 0.5f)
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);

                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                    }
                }

                else
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        float curHealth2 = user.healthHaver.GetCurrentHealth();
                        user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        float curHealth2 = user.healthHaver.GetCurrentHealth();
                        user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                    }
                }
            }

            else
            {
                if (user.HasPickupID(564))
                {
                    for (int i = 0; i < user.activeItems.Count; i++)
                    {
                        if (user.activeItems[i].PickupObjectId == (499) && !user.activeItems[i].IsOnCooldown)
                        {
                            user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        }

                        else if (user.Blanks > 0)
                        {
                            user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        }

                        else if (user.healthHaver.Armor >= 1f || user.healthHaver.HasCrest)
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.Armor += 1f;
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.Armor += 1f;
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            }
                        }

                        else if (curHealth == 0.5f)
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);

                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                            }
                        }

                        else
                        {
                            if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                            {
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                float curHealth2 = user.healthHaver.GetCurrentHealth();
                                user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                                GameManager.Instance.StartCoroutine(this.SaveFlawless());
                            }

                            else
                            {
                                user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                                float curHealth2 = user.healthHaver.GetCurrentHealth();
                                user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                            }
                        }
                    }
                }

                else if (user.healthHaver.Armor >= 1f || user.healthHaver.HasCrest)
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.Armor += 1f;
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.Armor += 1f;
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                    }
                }

                else if (curHealth == 0.5f)
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);

                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.ForceSetCurrentHealth(curHealth + 0.5f);
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                    }
                }

                else
                {
                    if (user.CurrentRoom != null && user.CurrentRoom.PlayerHasTakenDamageInThisRoom == false)
                    {
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        float curHealth2 = user.healthHaver.GetCurrentHealth();
                        user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                        GameManager.Instance.StartCoroutine(this.SaveFlawless());
                    }

                    else
                    {
                        user.healthHaver.ApplyDamage(0.5f, Vector2.zero, "Invoker... how?", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
                        float curHealth2 = user.healthHaver.GetCurrentHealth();
                        user.healthHaver.ForceSetCurrentHealth(curHealth2 + 0.5f);
                    }
                }
            }


            if (user.HasPickupID(489) || user.HasPickupID(198) || user.HasPickupID(528))
            {
                Projectile projectile = ((Gun)ETGMod.Databases.Items[198]).DefaultModule.projectiles[0];
                GameObject gameObject = SpawnManager.SpawnProjectile(projectile.gameObject, user.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (user.CurrentGun == null) ? 0f : user.CurrentGun.CurrentAngle), true);
                Projectile component  = gameObject.GetComponent <Projectile>();
                if (component != null)
                {
                    component.Owner            = user;
                    component.baseData.range  *= 20f;
                    component.baseData.damage *= 2f;
                }
            }

            if (user.HasPickupID(ETGMod.Databases.Items["Icy Skull"].PickupObjectId))
            {
                RoomHandler    absoluteRoom  = base.transform.position.GetAbsoluteRoom();
                List <AIActor> activeEnemies = absoluteRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                if (activeEnemies != null)
                {
                    for (int i = 0; i < activeEnemies.Count; i++)
                    {
                        this.FreezeAll(activeEnemies[i]);
                    }
                }
            }
        }
Ejemplo n.º 10
0
        private void animate()
        {
            Animation.Sequence sequence = new Animation.Sequence();

            bool originalCanPause = false;

            sequence.Add(new Animation.Execute(delegate()
            {
                Entity p = PlayerFactory.Instance;
                if (p != null)
                {
                    p.Get <Model>("FirstPersonModel").Enabled.Value = false;
                    p.Get <Model>("Model").Enabled.Value            = false;
                    p.Get <CameraController>().Enabled.Value        = false;
                    p.Get <FPSInput>().Enabled.Value       = false;
                    p.Get <UIRenderer>("UI").Enabled.Value = false;
                    AkSoundEngine.PostEvent(AK.EVENTS.STOP_PLAYER_BREATHING_SOFT, p);
                }
                CameraStop.CinematicActive.Value = true;
                originalCanPause = this.main.Menu.CanPause;
#if !DEVELOPMENT
                this.main.Menu.CanPause.Value = false;
#endif
            }));

            sequence.Add(new Animation.Set <Matrix>(this.main.Camera.RotationMatrix, Matrix.CreateFromQuaternion(this.Entity.Get <Transform>().Quaternion)));
            sequence.Add(new Animation.Set <Vector3>(this.main.Camera.Position, Vector3.Transform(new Vector3(0, 0, this.Offset), this.Entity.Get <Transform>().Matrix)));

            Animation.Ease.EaseType lastEase = Animation.Ease.EaseType.None;
            BSpline spline        = null;
            Entity  current       = this.Entity;
            float   totalDuration = 0.0f;
            while (current != null)
            {
                CameraStop currentStop      = current.Get <CameraStop>();
                Transform  currentTransform = current.Get <Transform>();

                Entity     next     = currentStop.Next.Value.Target;
                CameraStop nextStop = next == null ? null : next.Get <CameraStop>();

                if (!lastEase.BlendsInto(currentStop.Blend) || next == null)
                {
                    if (spline != null)
                    {
                        spline.Add(currentTransform.Position, currentTransform.Quaternion, currentStop.Offset, currentStop.FieldOfView);
                    }
                    spline = new BSpline();
                }

                float currentTime = spline.Duration;
                spline.Duration += currentStop.Duration;
                totalDuration   += currentStop.Duration;

                if (currentStop.Blend != Animation.Ease.EaseType.None && next != null)
                {
                    BSpline currentSpline = spline;
                    currentSpline.Add(currentTransform.Position, currentTransform.Quaternion, currentStop.Offset, currentStop.FieldOfView);
                    Transform nextTransform = next.Get <Transform>();
                    sequence.Add
                    (
                        new Animation.Ease
                        (
                            new Animation.Custom
                            (
                                delegate(float x)
                    {
                        float lerpValue                       = (currentTime + x * currentStop.Duration) / currentSpline.Duration;
                        BSpline.ControlPoint point            = currentSpline.Evaluate(lerpValue);
                        Matrix rotationMatrix                 = Matrix.CreateFromQuaternion(point.Orientation);
                        this.main.Camera.FieldOfView.Value    = MathHelper.Clamp(point.FieldOfView, 0.01f, (float)Math.PI * 0.99f);
                        this.main.Camera.RotationMatrix.Value = rotationMatrix;
                        Matrix m = rotationMatrix * Matrix.CreateTranslation(point.Position);
                        this.main.Camera.Position.Value = Vector3.Transform(new Vector3(0, 0, point.Offset), m);
                    },
                                currentStop.Duration
                            ),
                            currentStop.Blend
                        )
                    );
                }
                else
                {
                    sequence.Add
                    (
                        new Animation.Custom
                        (
                            delegate(float x)
                    {
                        this.main.Camera.RotationMatrix.Value = Matrix.CreateFromQuaternion(currentTransform.Quaternion);
                        this.main.Camera.Position.Value       = Vector3.Transform(new Vector3(0, 0, currentStop.Offset), currentTransform.Matrix);
                        this.main.Camera.FieldOfView.Value    = MathHelper.ToRadians(currentStop.FieldOfView);
                    },
                            currentStop.Duration
                        )
                    );
                }

                sequence.Add(new Animation.Execute(currentStop.OnDone));

                lastEase = currentStop.Blend;
                current  = next;
            }

            Action done = delegate()
            {
                Entity p = PlayerFactory.Instance;
                if (p != null)
                {
                    p.Get <Model>("FirstPersonModel").Enabled.Value = true;
                    p.Get <Model>("Model").Enabled.Value            = true;
                    p.Get <CameraController>().Enabled.Value        = true;
                    p.Get <FPSInput>().Enabled.Value       = true;
                    p.Get <UIRenderer>("UI").Enabled.Value = true;
                }
                this.main.Camera.FieldOfView.Value = this.main.Settings.FieldOfView;
                CameraStop.CinematicActive.Value   = false;
                this.main.Menu.CanPause.Value      = originalCanPause;
            };

            Animation anim;
            if (PlayerFactory.Instance != null && totalDuration > 0.0f)             // Fade in and out
            {
                anim = new Animation
                       (
                    new Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.Zero, 0.5f),
                    new Animation.Parallel(sequence, new Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.One, 0.5f)),
                    new Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.Zero, 0.5f),
                    new Animation.Execute(done),
                    new Animation.Vector3MoveTo(this.main.Renderer.Tint, Vector3.One, 0.5f)
                       );
            }
            else
            {
                // Just do it
                anim = new Animation
                       (
                    sequence,
                    new Animation.Execute(done)
                       );
            }
            anim.EnabledWhenPaused = false;
            WorldFactory.Instance.Add(anim);
        }
        //update is used as the mount state controller so the code can interact with player item code and interact code at the same time
        //the isOnTurret bool is the interact press state.
        public override void Update()
        {
            if (m_Gun != null && m_Gun_position != null)
            {
                TurretController turrrret = m_Gun.GetComponent <TurretController>();

                //initializes on turret state
                if (turrrret.isOnTurret && startup == false)
                {
                    user.MovementModifiers += this.NoMotionModifier;
                    user.IsStationary       = true;
                    user.OnPreDodgeRoll    += this.HandleDodgeRollStarted;
                    Gun sheila = user.inventory.AddGunToInventory(PickupObjectDatabase.GetByEncounterName("Sheila LMG") as Gun, true);
                    sheila.CanBeDropped = false;
                    sheila.CanBeSold    = false;
                    onturretgun         = sheila;
                    user.inventory.GunLocked.SetOverride("on turret", true, null);
                    startup = true;
                }

                //three sections to control ways to get off turret.

                //knock off mechanic for explosives and rubberkin
                if (turrrret.isOnTurret && startup == true)
                {
                    // calculates knock off by distance from turretbase to player
                    if (Vector2.Distance(user.CenterPosition, m_Gun_position) > 1)
                    {
                        dismount = true;
                    }
                }

                // special dodgeroll case for mounted state
                BraveInput instanceForPlayer = BraveInput.GetInstanceForPlayer(user.PlayerIDX);
                if (instanceForPlayer.ActiveActions.DodgeRollAction.IsPressed && turrrret.isOnTurret && startup)
                {
                    user.IsStationary = false;

                    user.MovementModifiers -= this.NoMotionModifier;
                    dismount = true;
                }

                //secondary interact controller that allows for player to use E to exit turret
                if (turrrret.isOnTurret == false && startup == true)
                {
                    dismount = true;
                    startup  = false;
                }

                // essentally a method to control dismount procedures
                if (dismount)
                {
                    // dismount controller
                    user.IsStationary       = false;
                    user.MovementModifiers -= this.NoMotionModifier;
                    user.OnPreDodgeRoll    -= this.HandleDodgeRollStarted;
                    turrrret.isOnTurret     = false;
                    dismount = false;
                    if (onturretgun != null)
                    {
                        user.inventory.GunLocked.RemoveOverride("on turret");
                        user.inventory.DestroyGun(onturretgun);
                        AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject);
                        AkSoundEngine.PostEvent("Play_tur_dismount", base.gameObject);
                        AkSoundEngine.PostEvent("Play_tur_dismount", base.gameObject);
                        AkSoundEngine.PostEvent("Play_tur_dismount", base.gameObject);
                        AkSoundEngine.PostEvent("Play_tur_dismount", base.gameObject);
                    }
                }
            }
            base.Update();
        }
        private void TransitionToDepart(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip)
        {
            if (!m_depatureIsPlayerless)
            {
                if (OverrideTargetFloor == GlobalDungeonData.ValidTilesets.PHOBOSGEON)
                {
                    Pixelator.Instance.RegisterAdditionalRenderPass(ChaosShaders.GlitchScreenShader);
                }
            }

            GameManager.Instance.MainCameraController.DoDelayedScreenShake(departureShake, 0.25f, null);
            if (!m_depatureIsPlayerless)
            {
                for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
                {
                    GameManager.Instance.AllPlayers[i].PrepareForSceneTransition();
                }
                // float delay = 0.5f;
                float delay = 0.7f;
                Pixelator.Instance.FadeToBlack(delay, false, 0f);
                GameUIRoot.Instance.HideCoreUI(string.Empty);
                GameUIRoot.Instance.ToggleLowerPanels(false, false, string.Empty);
                if (GameManager.Instance.CurrentGameMode == GameManager.GameMode.SUPERBOSSRUSH)
                {
                    GameManager.Instance.DelayedLoadBossrushFloor(delay);
                }
                else if (GameManager.Instance.CurrentGameMode == GameManager.GameMode.BOSSRUSH)
                {
                    GameManager.Instance.DelayedLoadBossrushFloor(delay);
                }
                else
                {
                    if (!GameManager.Instance.IsFoyer && GameManager.Instance.CurrentLevelOverrideState == GameManager.LevelOverrideState.NONE)
                    {
                        GlobalDungeonData.ValidTilesets nextTileset = GameManager.Instance.GetNextTileset(GameManager.Instance.Dungeon.tileIndices.tilesetId);
                        GameManager.DoMidgameSave(nextTileset);
                    }
                    if (UsesOverrideTargetFloor)
                    {
                        GlobalDungeonData.ValidTilesets overrideTargetFloor = OverrideTargetFloor;
                        if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.CATACOMBGEON)
                        {
                            GameManager.Instance.DelayedLoadCustomLevel(delay, "tt_catacombs");
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.FORGEGEON)
                        {
                            GameManager.Instance.DelayedLoadCustomLevel(delay, "tt_forge");
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.OFFICEGEON)
                        {
                            ChaosConsole.elevatorHasBeenUsed = true;
                            if (BraveUtility.RandomBool())
                            {
                                string[] flowPath = new string[] { "custom_glitchchest_flow", "custom_glitchchestalt_flow", "custom_glitch_flow" };
                                ChaosUtility.PrepareGlitchFlow(BraveUtility.RandomElement(flowPath));
                                GameManager.Instance.DelayedLoadNextLevel(delay);
                            }
                            else
                            {
                                string[] flows = new string[] { "custom_glitchchest_flow", "custom_glitchchestalt_flow" };
                                GameManager.Instance.StartCoroutine(ChaosUtility.DelayedGlitchLevelLoad(delay, BraveUtility.RandomElement(flows), useNakatomiTileset: BraveUtility.RandomBool()));
                            }
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.PHOBOSGEON)
                        {
                            ChaosUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                            ChaosUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
                            // ChaosUtility.RatDungeon.tileIndices.tilesetId = GlobalDungeonData.ValidTilesets.PHOBOSGEON;
                            // ChaosUtility.RatDungeon.tileIndices.tilesetId = GlobalDungeonData.ValidTilesets.JUNGLEGEON;
                            ChaosPrefabs.InitCanyonTileSet(ChaosUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
                            GameManager.Instance.StartCoroutine(ChaosUtility.DelayedGlitchLevelLoad(delay, "SecretGlitchFloor_Flow", true));
                        }
                        else
                        {
                            GameManager.Instance.DelayedLoadNextLevel(delay);
                        }
                    }
                    else
                    {
                        GameManager.Instance.DelayedLoadNextLevel(delay);
                    }
                    AkSoundEngine.PostEvent("Stop_MUS_All", gameObject);
                }
            }
            elevatorFloor.SetActive(false);
            animator.AnimationCompleted = (Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Remove(animator.AnimationCompleted, new Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>(TransitionToDepart));
            animator.PlayAndDisableObject(elevatorDepartAnimName, null);
        }
Ejemplo n.º 13
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     AkSoundEngine.PostEvent("Stop_Ambiance_Calme", animator.gameObject);
 }
Ejemplo n.º 14
0
        public static void ReflectBullet(this Projectile p, bool retargetReflectedBullet, GameActor newOwner, float minReflectedBulletSpeed, bool doPostProcessing = false, float scaleModifier = 1f, float baseDamage = 10f, float spread = 0f, string sfx = null)
        {
            p.RemoveBulletScriptControl();
            if (sfx != null)
            {
                AkSoundEngine.PostEvent(sfx, GameManager.Instance.gameObject);
            }
            if (retargetReflectedBullet && p.Owner && p.Owner.specRigidbody)
            {
                p.Direction = (p.Owner.specRigidbody.GetUnitCenter(ColliderType.HitBox) - p.specRigidbody.UnitCenter).normalized;
            }
            if (spread != 0f)
            {
                p.Direction = p.Direction.Rotate(UnityEngine.Random.Range(-spread, spread));
            }
            if (p.Owner && p.Owner.specRigidbody)
            {
                p.specRigidbody.DeregisterSpecificCollisionException(p.Owner.specRigidbody);
            }

            p.Owner = newOwner;
            p.SetNewShooter(newOwner.specRigidbody);
            p.allowSelfShooting = false;
            if (newOwner is AIActor)
            {
                p.collidesWithPlayer  = true;
                p.collidesWithEnemies = false;
            }
            else if (newOwner is PlayerController)
            {
                p.collidesWithPlayer  = false;
                p.collidesWithEnemies = true;
            }

            if (scaleModifier != 1f)
            {
                SpawnManager.PoolManager.Remove(p.transform);
                p.RuntimeUpdateScale(scaleModifier);
            }
            if (p.Speed < minReflectedBulletSpeed)
            {
                p.Speed = minReflectedBulletSpeed;
            }
            p.baseData.damage = baseDamage;
            if (doPostProcessing && newOwner is PlayerController)
            {
                PlayerController player = (newOwner as PlayerController);
                if (player != null)
                {
                    p.baseData.damage *= player.stats.GetStatValue(PlayerStats.StatType.Damage);
                    p.baseData.speed  *= player.stats.GetStatValue(PlayerStats.StatType.ProjectileSpeed);
                    p.UpdateSpeed();
                    p.baseData.force       *= player.stats.GetStatValue(PlayerStats.StatType.KnockbackMultiplier);
                    p.baseData.range       *= player.stats.GetStatValue(PlayerStats.StatType.RangeMultiplier);
                    p.BossDamageMultiplier *= player.stats.GetStatValue(PlayerStats.StatType.DamageToBosses);
                    p.RuntimeUpdateScale(player.stats.GetStatValue(PlayerStats.StatType.PlayerBulletScale));
                    player.DoPostProcessProjectile(p);
                }
            }
            if (newOwner is AIActor)
            {
                p.baseData.damage = 0.5f;
                p.baseData.SetAll((newOwner as AIActor).bulletBank.GetBullet("default").ProjectileData);
                p.specRigidbody.CollideWithTileMap = false;
                p.ResetDistance();
                p.collidesWithEnemies = (newOwner as AIActor).CanTargetEnemies;
                p.collidesWithPlayer  = true;
                p.UpdateCollisionMask();
                p.sprite.color = new Color(1f, 0.1f, 0.1f);
                p.MakeLookLikeEnemyBullet(true);
                p.RemovePlayerOnlyModifiers();
                if ((newOwner as AIActor).IsBlackPhantom)
                {
                    p.baseData.damage = 1;
                    p.BecomeBlackBullet();
                }
            }
            p.UpdateCollisionMask();
            p.Reflected();
            p.SendInDirection(p.Direction, true, true);
        }
Ejemplo n.º 15
0
    // -------------------------------------------------------------------------
    // Application methods
    // -------------------------------------------------------------------------

    public void quit()
    {
        AkSoundEngine.PostEvent("fx_select", gameObject);

        Application.Quit();
    }
Ejemplo n.º 16
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_ENV_puddle_zap_01", gameObject);
 }
Ejemplo n.º 17
0
 //Methode pour jouer un event Wwise ayant une durée finie, sans callback
 // eventName : le nom de l'event
 // gObject : l'objet sur lequel il sera positionné dans l'espace ( si il s'agit  d'un son 3d )
 public static void PlayFiniteEvent(string eventName, GameObject gObject)
 {
     AkSoundEngine.PostEvent(eventName, gObject);
 }
Ejemplo n.º 18
0
    void Update()
    {
        if (navigating)
        {
            journeyTarget.y = boat.transform.position.y;
            Vector3 journey = journeyTarget - boat.transform.position;

            // End of journey
            if (journey.sqrMagnitude <= 0.0005f)
            {
                navigating = false;

                // If typhoon at end of journey
                if (boatScript.inATyphoon && !fromTyphoon)
                {
                    Debug.Log("Boat in typhoon!");
                    AkSoundEngine.PostEvent("Play_Typhon", gameObject);
                    StartCoroutine(WaitBeforeGoingToInitialPos(boatScript.typhoon));
                }
                // If correct position
                else if (!lastZone)
                {
                    AkSoundEngine.PostEvent("Play_Arrival", gameObject);
                    AkSoundEngine.PostEvent("Stop_Typhon", gameObject);
                    lightScript.rotateDegreesPerSecond.value.y = -0.1f;

                    // Save position
                    lastValidPosition.transform.position = boat.transform.position;
                    lastValidPositionZone = map.currentZone;

                    // Berth on island if needed
                    if (boatScript.onAnIsland && boatScript.currentIsland.islandNumber != screenManager.currentIslandNumber && !fromTyphoon &&
                        (tutorialManager.step == ETutorialStep.NO_TUTORIAL || tutorialManager.step == ETutorialStep.GO_TO_ISLAND))
                    {
                        BerthOnIsland((goalCollider != null));
                    }
                    else
                    {
                        //EndJourneyAtSea
                        screenManager.EndNavigationAtSea();
                        telescope.RefreshElements(journeyTarget, map.GetCurrentPanorama(), map.GetCurrentRain());
                        EventManager.Instance.Raise(new BlockInputEvent()
                        {
                            block = false, navigation = false
                        });

                        if (goalCollider && insideGoal)
                        {
                            tutorialManager.CompleteStep();
                        }
                    }

                    fromTyphoon = false;
                    if (goalCollider && insideGoal)
                    {
                        goalCollider = null;
                        insideGoal   = false;
                    }
                }
                else if (lastZone)
                {
                    lightScript.rotateDegreesPerSecond.value.y = 0;
                }
            }
            // Still journeying
            else
            {
                float distCovered = (Time.time - journeyBeginTime) * currentSpeed;
                float fracJourney = distCovered / journeyLength;
                boat.transform.position = Vector3.Lerp(boat.transform.position, journeyTarget, fracJourney);

                // Typhoon
                if (boatScript.inATyphoon && !fromTyphoon)
                {
                    Debug.Log("Boat in typhoon!");
                    AkSoundEngine.PostEvent("Play_Typhon", gameObject);
                    StartCoroutine(WaitBeforeGoingToInitialPos(boatScript.typhoon));
                }
            }
        }
    }
Ejemplo n.º 19
0
 public void Dead()
 {
     AkSoundEngine.PostEvent("Muerte", gameObject);
     transform.position = initPos;
 }
Ejemplo n.º 20
0
 public override void OnPostFired(PlayerController player, Gun flakcannon)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_WPN_golddoublebarrelshotgun_shot_01", gameObject);
 }
Ejemplo n.º 21
0
 public override void OnPostFired(PlayerController player, Gun chaosgun)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_BOSS_dragun_shot_01", gameObject);
 }
Ejemplo n.º 22
0
    private void Spawn()
    {
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray.origin, ray.direction, out hit, 999, Mask))
        {
            if (hit.transform.gameObject.tag != "turret" && hit.transform.gameObject.tag != "radius")
            {
                if (spawnedTurrets.Count <= GameManager.Get().maxTurrets - 1)
                {
                    //newTurretPreview.SetActive(false);
                    newTurretPreview.GetComponent <Turret>().enteredZones.Clear();
                    newTurretPreview.GetComponent <Turret>().canBePlaced = false;

                    GameManager.Get().towersPlaced++;

                    GameObject newTurret = Instantiate(turretTemplate, hit.point + (hit.normal * -5), newTurretPreview.transform.rotation);
                    newTurret.SetActive(true);
                    spawnedTurrets.Add(newTurret);

                    if (OnSpawnerSpawnTurret != null)
                    {
                        OnSpawnerSpawnTurret();
                        if (secondTime)
                        {
                            if (OnSpawnerSpawnTurretSecond != null)
                            {
                                OnSpawnerSpawnTurretSecond();
                            }
                        }
                    }
                    //
                    Turret currentTurretProperties = newTurret.GetComponent <Turret>();
                    List <UITowersState> state     = GameManager.Get().towersUI;

                    currentTurretProperties.zone         = newTurretPreview.GetComponent <Turret>().zone;
                    currentTurretProperties.zone.isUsed  = true;
                    currentTurretProperties.isSpawned    = true;
                    currentTurretProperties.OnTurretDead = DeleteTurretTimer;
                    currentTurretProperties.fireRate     = fireRate;
                    currentTurretProperties.attachedModel.material.shader = spawnShader;
                    currentTurretProperties.lifespanTimer = 0;
                    Debug.Log("messi mode");
                    currentTurretProperties.attachedParticles.SetActive(true);
                    currentTurretProperties.attachedParticles2.SetActive(true);

                    for (int i = state.Count - 1; i >= 0; i--)
                    {
                        if (!state[i].isBeingUsed)
                        {
                            currentTurretProperties.stateUI = state[i];
                            state[i].assignedTurret         = currentTurretProperties;
                            state[i].isBeingUsed            = true;
                            state[i].doOnce = false;
                            i = -1;
                        }
                    }

                    //newTurretPreview.SetActive(true);
                    secondTime = true;
                }
                else
                {
                    AkSoundEngine.PostEvent("torre_no", turretUnavailableSound);
                    Debug.Log("CANT SPAWN, MAX TOWERS");
                }
            }
        }
    }
Ejemplo n.º 23
0
 // Token: 0x060004F2 RID: 1266 RVA: 0x0002A553 File Offset: 0x00028753
 protected override void DoEffect(PlayerController user)
 {
     this.daboomer();
     AkSoundEngine.PostEvent("Play_OBJ_power_up_01", base.gameObject);
     this.StartEffect(user);
 }
Ejemplo n.º 24
0
        protected override void DoEffect(PlayerController user)
        {
            ScrapCount += 1;

            AkSoundEngine.PostEvent("Play_OBJ_chest_open_01", base.gameObject);

            user.CurrentGun.ammo = 0;
            user.inventory.DestroyCurrentGun();

            if (ScrapCount == 1)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                //   LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(821).gameObject, user);
            }

            if (ScrapCount == 2)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
            }

            if (ScrapCount == 3)
            {
                PickupObject byId = PickupObjectDatabase.GetById(78);
                LootEngine.SpawnItem(byId.gameObject, user.specRigidbody.UnitCenter, Vector2.up, 1f, false, true, false);
                LootEngine.SpawnItem(byId.gameObject, user.specRigidbody.UnitCenter, Vector2.up, 1.5f, false, true, false);
            }

            if (ScrapCount == 4)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
            }

            if (ScrapCount == 5)
            {
                if (this.GunRando == FiGun.NONE)
                {
                    Gun fallout = PickupObjectDatabase.GetByName(this.falloutGun) as Gun;
                    Gun tesla   = PickupObjectDatabase.GetByName(this.teslaGun) as Gun;
                    Gun phazor  = PickupObjectDatabase.GetByName(this.phazorGun) as Gun;

                    this.GunRando = (DwarvenHammer.FiGun)UnityEngine.Random.Range(1, 4);

                    if (this.GunRando == FiGun.TESLA)
                    {
                        this.m_player.inventory.AddGunToInventory(tesla, true);
                    }
                    if (this.GunRando == FiGun.PHAZOR)
                    {
                        this.m_player.inventory.AddGunToInventory(phazor, true);
                    }
                    if (GunRando == FiGun.FALLOUT)
                    {
                        this.m_player.inventory.AddGunToInventory(fallout, true);
                    }
                }
            }
            if (ScrapCount >= 6)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
            }
        }
 public void Objective()
 {
     AkSoundEngine.PostEvent("objective_event", gameObject);
 }
Ejemplo n.º 26
0
    void Laser()
    {
        if (!laserSound)
        {
            laserSound = true;
            AkSoundEngine.PostEvent("play_boss_laser", Camera.main.gameObject);
        }
        bossAnimation.SetBool("FireLeftPhase1", false);
        bossAnimation.SetBool("FireRightPhase1", false);

        if (line_Collider == null)
        {
            line.gameObject.AddComponent <PolygonCollider2D>();
            line_Collider           = line.GetComponent <PolygonCollider2D>();
            line_Collider.isTrigger = true;
        }
        else
        {
            myPoints = line_Collider.points;
            myPoints[1].Set(x, y);
            line_Collider.points = myPoints;
        }

        line.enabled = true;

        if (a < numberCycleLaser)
        {
            for (int i = 0; i < (segments + 1); i++)
            {
                x = Mathf.Sin(Mathf.Deg2Rad * angle) * xradius;
                y = Mathf.Cos(Mathf.Deg2Rad * angle) * yradius;

                myPoints = line_Collider.points;

                myPoints[1].Set(x, y);
                line_Collider.points = myPoints;

                line.SetPosition(0, new Vector3(x, y, 0));
                if (aller)
                {
                    angle += ennemyLaserSpeed * Time.deltaTime;
                }
                else
                {
                    angle -= ennemyLaserSpeed * Time.deltaTime;
                }
            }
            if (angle < 90)
            {
                aller  = true;
                a     += 1;
                retour = false;
            }
            else if (angle > 270)
            {
                aller  = false;
                a     += 1;
                retour = true;
            }
        }
        else
        {
            line.enabled        = false;
            a                   = 0;
            i                   = 0;
            checkBeforeNewPhase = true;
            bossAnimation.SetBool("Laser", false);
            bossAnimation.SetBool("Laser2", false);
            laserSound = false;
            AkSoundEngine.PostEvent("play_boss_laser_stop", Camera.main.gameObject);

            StopAllCoroutines();
            i        = 0;
            a        = 0;
            x        = 0;
            y        = 0;
            angle    = 90;
            retour   = false;
            aller    = true;
            canSpawn = true;
        }
    }
 public void StartMainLoop()
 {
     //AkSoundEngine.StopAll(gameObject);
     AkSoundEngine.PostEvent("main_loop", gameObject);
 }
Ejemplo n.º 28
0
    // Update is called once per frame
    void Update()
    {
        if (!isEnd)
        {
            if (isPromptFinish)
            {
                fryTime += Time.deltaTime;
            }
            if (fryTime >= 4)
            {
                FindObjectOfType <PanShake>().enabled = true;
                Replace();
                if (fryTime >= 4 && fryTime < 6)
                {
                    if (fryState != FRY_STATE.WAIT)
                    {
                        fryState = FRY_STATE.WAIT;
                        Debug.Log("WaitForIt");
                        AkSoundEngine.PostEvent("WaitForIt", gameObject);
                        AkSoundEngine.SetRTPCValue("SizzleVolume", 80f, null, 200);
                        AkSoundEngine.SetRTPCValue("SizzlePitch", 100f, null, 200);
                    }
                    ////Light.GetComponent<SpriteRenderer>().color = new Color(1.0f, 0.0f, 0.0f, 1.0f);
                    FindObjectOfType <PanShake>().deltaRotation = 20;
                }
                else if (fryTime >= 6 && fryTime < 7)
                {
                    if (fryState != FRY_STATE.DO_IT)
                    {
                        fryState = FRY_STATE.DO_IT;
                        Debug.Log("FlipIT");
                        AkSoundEngine.PostEvent("FlipIt", gameObject);
                    }
                    //Light.GetComponent<SpriteRenderer>().color = new Color(0.0f, 1.0f, 0.0f, 1.0f);
                    FindObjectOfType <PanShake>().deltaRotation = 100;
                }
                else if (fryTime >= 7)
                {
                    if (fryState != FRY_STATE.THE_OTHER_ONE)
                    {
                        fryState = FRY_STATE.THE_OTHER_ONE;
                        //Light.GetComponent<SpriteRenderer>().color = new Color(0.0f, 1.0f, 0.0f, 1.0f);
                        FindObjectOfType <PanShake>().deltaRotation = 200;
                    }
                }

                if (!FindObjectOfType <VibrateControl>().enabled)
                {
                    ReplaceSprites();
                    fryTime = 0;
                    checkPancakeReplaceTimes = 0;
                    FindObjectOfType <PanShake>().enabled = false;
                    FindObjectOfType <PanShake>().GetComponent <Transform>().rotation = Quaternion.Euler(0, 0, 0);
                    if (pancake.GetComponentInChildren <SpriteRenderer>().sprite == pancakel4)
                    {
                        End();
                    }
                }
            }
            else
            {
                //Light.GetComponent<SpriteRenderer>().color = new Color(1.0f, 0.0f, 0.0f, 1.0f);
            }
        }
        if (quit)
        {
            ScreenFadeOut("ResultScreen");
        }
    }
Ejemplo n.º 29
0
 // Start is called before the first frame update
 void Start()
 {
     AkSoundEngine.PostEvent("MenuStop", gameObject);
 }
Ejemplo n.º 30
0
 // private int MalRounds = Gungeon.Game.Items["rtr:malediction_rounds"].PickupObjectId;
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_WPN_crossbow_shot_01", gameObject);
 }