Esempio n. 1
0
 public override void Update(GameTime gameTime)
 {
     UpdateMinionsID();
     VérifierÉtatMinions();
     VérifierÉtatHéros();
     Visible = (Vector3.Distance(Position, ScèneJeu.BaldorLeBrave.Position) < Caméra.DISTANCE_PLAN_ÉLOIGNÉ);
     if (PtsVie <= VieEntracte && Tampon)
     {
         CréérMinions();
         EstInvincible = true;
         Tampon        = false;
         PtsAttaque   *= 2;
         //Soundtrack.StartSoundCue(nomQuote)
     }
     if (ToRemove)
     {
         Soundtrack.StartSoundCue("boss_death");
         Jeu.GestionScènes.ChangerDeScène(Scènes.Credits);
     }
     if (HasAggroed && Soundtrack.IsSongCueStopped)
     {
         Soundtrack.StartSongCueWithDistanceEffect("boss_battle_loop", "Battle", ScèneJeu.BaldorLeBrave.Position, Position, (AggroRange * 3));
     }
     else
     {
         if (HasAggroed)
         {
             Soundtrack.UpdateSongCueDistanceEffect("Battle", ScèneJeu.BaldorLeBrave.Position, Position, AggroRange * 3);
         }
     }
     base.Update(gameTime);
 }
Esempio n. 2
0
 public override void DébuterAttaque(Combattant cible)
 {
     if (!HasAggroed)
     {
         HasAggroed = true;
         Soundtrack.StartSongCue("boss_battle_start");
     }
     base.DébuterAttaque(cible);
 }
Esempio n. 3
0
 protected override void GestionUnleash()
 {
     if (HasAggroed)
     {
         HasAggroed = false;
         Soundtrack.StopSong();
         ScèneJeu.MapManager.StartMusic();
     }
     base.GestionUnleash();
 }
Esempio n. 4
0
        public override void PerdrePointsDeVie(int Dégats)
        {
            base.PerdrePointsDeVie(Dégats);
            if (ToRemove && !Reset)
            {
                Reset = true;

                Soundtrack.StartSoundCue("nec_death");
            }
        }
Esempio n. 5
0
        public override void Update(GameTime gameTime)
        {
            // Easter egg!
            if (GestionInput.EstNouveauClicGauche() && (new Rectangle(50, 100, 50, 50).Contains(GestionInput.ÉtatSouris.X, GestionInput.ÉtatSouris.Y)))
            {
                Soundtrack.StartSoundCue("cain_cube");
            }

            base.Update(gameTime);
        }
Esempio n. 6
0
 private void CheckForProjectilesToRemove()
 {
     for (int i = ListeProjectiles.Count - 1; i >= 0; --i)
     {
         if (ListeProjectiles[i].ToRemove)
         {
             ListeProjectiles.RemoveAt(i);
             Soundtrack.StartSoundCue("proj_explosion");
         }
     }
 }
Esempio n. 7
0
        // Add() components
        public override void Initialize()
        {
            ListeDesÉléments.Add(new AfficheurFPS(Jeu, "Arial"));

            for (int i = 1; i < NB_CHOIX + 1; ++i)
            {
                ListeDesÉléments.Add(new BoutonTextuel(Jeu, new Vector2(Jeu.Window.ClientBounds.Width / 2, (float)((Jeu.Window.ClientBounds.Height * i + HAUTEUR_CHOIX) / (NB_CHOIX + 1))), "Baldor Le Brave - Magicien", "FuturaLT60", Color.Azure, Color.CadetBlue, Scènes.Jeu, SceneManager));
            }
            Soundtrack.StartSongCue("m_menu");

            base.Initialize();
        }
Esempio n. 8
0
        public void CréerProjectile(Combattant combattant, Vector3 posCible, int damage, float PortéeMax)
        {
            ProjectileBalistique newProj = new ProjectileBalistique(Jeu, ScèneJeu, combattant, damage, CptProj, combattant.Position, posCible, PortéeMax, ModelName, ModelScale, Vector3.Zero);

            ListeProjectiles.Add(newProj);
            newProj.Initialize();
            ++CptProj;

            if (combattant is Héros)
            {
                Soundtrack.StartSoundCue("proj_cast");
            }
        }
Esempio n. 9
0
        // Add() components
        public override void Initialize()
        {
            ListeDesÉléments.Add(new AfficheurFPS(Jeu, "Arial"));
            BoutonTextuel playbutton = new BoutonTextuel(Jeu, new Vector2(350, 450), "Débuter la partie", "TrajanusRomanBold60", Color.Black, Color.Red, Scènes.CharacterSelection, SceneManager);

            ListeDesÉléments.Add(playbutton);
            playbutton.Clicked += new ButtonClickedEventHandler(ChangePlayButton);
            ListeDesÉléments.Add(new BoutonTextuel(Jeu, new Vector2(300, 600), "Options", "TrajanusRomanBold60", Color.Black, Color.Red, Scènes.MenuOptions, SceneManager));

            Soundtrack.StartSongCue("m_menu");

            base.Initialize();
        }
Esempio n. 10
0
        protected override void AttaquerMelee()
        {
            Soundtrack.StartSoundCue("melee_swing");

            int Dégats = (PtsAttaque + Jeu.GénérateurAléatoire.Next(0, DeltaDamage + 1));

            Cible.PerdrePointsDeVie(Dégats);
            if (Cible.PtsVie <= 0)
            {
                Cible = null;
            }
            ActionActuelle = Action.ATTENDRE;
        }
Esempio n. 11
0
        public bool ThrowManaSpell(float cost)
        {
            bool hasBeenThrown = false;

            if (PtsRessource >= cost)
            {
                PtsRessource -= cost;
                hasBeenThrown = true;
            }
            else
            {
                Soundtrack.StartSoundCue("nec_moremana");
            }

            return(hasBeenThrown);
        }
Esempio n. 12
0
        private void UpdateButton()
        {
            if (IsMouseHover())
            {
                CurrentColor = AltColor;
                if (GestionInput.EstNouveauClicGauche())
                {
                    Soundtrack.StartSoundCue("button_click");

                    Valeur ^= true;
                }
            }
            else
            {
                CurrentColor = DefaultColor;
            }
        }
Esempio n. 13
0
        protected override void Update(GameTime gameTime)
        {
            //if (GestionInput.ÉtatSouris.RightButton == ButtonState.Pressed)
            //{
            //   Vector3 positionCible = GestionInput.GetPositionSouris3d();
            //   Vector2 positionCoordCible = new Vector2(positionCible.X, positionCible.Z);
            //   if ((positionCoordCible.X != 0 || positionCoordCible.Y != 0) && (positionCoordCible.X != Hurrnicorn.PositionCoord.X || positionCoordCible.Y != Hurrnicorn.PositionCoord.Y))
            //   {
            //      Hurrnicorn.DébuterDéplacement(positionCoordCible);
            //   }
            //   //Hurrnicorn.DébuterRotation(MathHelper.PiOver2);
            //}

            // Update Audio Engine
            Soundtrack.Update();
            base.Update(gameTime);
        }
Esempio n. 14
0
        private void GestionReset(float tempsÉcoulé)
        {
            TempsDepuisMAJRESET += tempsÉcoulé;
            if (TempsDepuisMAJRESET > INTERVALLE_MAJ_RESET)
            {
                PtsVie              = PtsVieMax;
                PtsRessource        = PtsRessourceMax;
                PositionCoord       = PositionCoordInitiale;
                PositionCible       = PositionCoordInitiale;
                Reset               = false;
                TempsDepuisMAJRESET = 0;

                Soundtrack.StartSoundCue("boss_win");

                Jeu.GestionScènes.ChangerDeScène(Scènes.Mort);
            }
        }
Esempio n. 15
0
        private void CréérMinions()
        {
            Soundtrack.StartSoundCue("boss_minion");

            for (int i = 0; i < NB_MINIONS; i++)
            {
                int id = ScèneJeu.MonstManager.GetID();
                ListeIDMinions.Add(id);
            }
            for (int i = 0; i < NB_MINIONS; ++i)
            {
                float   angle          = i * MathHelper.TwoPi / NB_MINIONS;
                Vector2 vDirection     = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
                Vector2 positionminion = PositionCoord + vDirection * DiSTANCE_MINIONS;
                ScèneJeu.MonstManager.CréerMonstre(Joueur, "Cyclops\\terrorwurm", 0.06f, ScèneDeJeu.ÉCHELLE_BOX_WURM, new Vector3(positionminion.X, positionminion.Y, Position.Z),
                                                   new Vector3(0, 0, 0), new Vector3(0, -MathHelper.PiOver2, 0), "Minion", 15f, MathHelper.Pi * 4, false, 21, 3, 6, 4, 1f, false, 15, 80, 6, ListeIDMinions[0]);
                //"unicorn", 8f, 1f,
            }
        }
Esempio n. 16
0
        private void VérifierNiveau()
        {
            if (PtsExp >= ExpProchainNiveau)
            {
                PtsExp                  = 0;
                PtsAttaque             += Jeu.GénérateurAléatoire.Next(INCRÉMENT_ATTAQUE_MIN, INCRÉMENT_ATTAQUE_MAX + 1);
                PtsDéfense             += Jeu.GénérateurAléatoire.Next(INCRÉMENT_DEFENSE_MIN, INCRÉMENT_DEFENSE_MAX + 1);
                PtsVieMax              += Jeu.GénérateurAléatoire.Next(INCRÉMENT_VIE_MIN, INCRÉMENT_VIE_MAX + 1);
                PtsVie                  = PtsVieMax;
                PtsRessourceMax        += Jeu.GénérateurAléatoire.Next(INCRÉMENT_RESSOURCE_MIN, INCRÉMENT_RESSOURCE_MAX + 1);
                PtsRessource            = PtsRessourceMax;
                ExpProchainNiveau       = CalculerExpProchainNiveau();
                IncrémentRegenVie       = PtsVieMax * POURCENTAGE_REGEN_VIE;
                IncrémentRegenRessource = PtsRessourceMax * POURCENTAGE_REGEN_MANA;
                ++Niveau;

                Soundtrack.StartSoundCue("levelup");
            }
        }
Esempio n. 17
0
        public override void Update(GameTime gameTime)
        {
            if (IsMouseHover())
            {
                CurrentColor = AltColor;
                Scale        = ALT_SCALE;

                if (GestionInput.EstNouveauClicGauche())
                {
                    Soundtrack.StartSoundCue("button_click");

                    SceneManager.ChangerDeScène(DestinationScene);
                    OnClick();
                }
            }
            else
            {
                CurrentColor = DefaultColor;
                Scale        = DEFAULT_SCALE;
            }

            base.Update(gameTime);
        }
Esempio n. 18
0
        private void GestionAttaqueMagique()
        {
            if (ScèneJeu.GestionInput3D.EstNouvelleTouche(Keys.D1))
            {
                Vector3 clickSouris = ScèneJeu.GestionInput3D.GetPositionSouris3d();
                if (clickSouris != Vector3.Zero && Vector3.Distance(Position, clickSouris) <= FIREBALL_RANGE)
                {
                    if (ThrowManaSpell(FIREBALL_MANA_COST))
                    {
                        ActionActuelle = Action.ATTENDRE;
                        PositionCible  = PositionCoord;
                        Vector2 vDirection = Vector2.Subtract(new Vector2(clickSouris.X, clickSouris.Z), PositionCoord);
                        vDirection = Vector2.Normalize(vDirection);
                        DébuterRotation(MathHelper.WrapAngle(vDirection.X == 0 ? MathHelper.PiOver2 * Math.Sign(-vDirection.Y) : ((float)Math.Atan(-vDirection.Y / vDirection.X) + (Math.Sign(vDirection.X) - 1) * MathHelper.Pi / 2)));

                        ScèneJeu.ProjManager.CréerProjectile(this, clickSouris, FIREBALL_DAMAGE, FIREBALL_RANGE);
                    }
                }
            }
            if (ScèneJeu.GestionInput3D.EstNouvelleTouche(Keys.D2))
            {
                if (NovaActuel == null)
                {
                    if (ThrowManaSpell(NOVA_MANA_COST))
                    {
                        ActionActuelle = Action.ATTENDRE;
                        PositionCible  = PositionCoord;

                        NovaActuel = ScèneJeu.NovManager.AjouterNova(new Vector3(Position.X, Position.Y + NOVA_HAUTEUR, Position.Z), NOVA_RAYON, new TimeSpan(0, 0, 0, 0, NOVA_DURÉE), NOVA_DAMAGE, NomTextureNova);
                        Soundtrack.StartSoundCue("sorc_nova");
                    }
                }
                else
                {
                    if (NovaActuel.ToRemove)
                    {
                        NovaActuel = null;
                    }
                }
            }
            if (!IsSlowingProj && ScèneJeu.GestionInput3D.EstNouvelleTouche(Keys.D3) && ThrowManaSpell(SLOW_PROJ_INSTANT_MANA_COST))  // Toggle slowing proj
            {
                IsSlowingProj = true;
                ScèneJeu.HeadsUpDisplay.Spells[2].Toggled = true;
                Soundtrack.StartSoundCue("chrono_start");
            }
            else
            {
                if (IsSlowingProj)
                {
                    if (ScèneJeu.GestionInput3D.EstNouvelleTouche(Keys.D3) || !ThrowManaSpell((float)SLOW_PROJ_TIME_MANA_COST * TempsDepuisMAJ))
                    {
                        IsSlowingProj = false;
                        ScèneJeu.HeadsUpDisplay.Spells[2].Toggled = false;
                        Soundtrack.StopSound();
                    }
                }
            }
            if (IsSlowingProj && Soundtrack.IsSoundCueStopped)
            {
                Soundtrack.StartSoundCue("chrono_loop");
            }



            if (ScèneJeu.GestionInput3D.EstNouvelleTouche(Keys.D4))
            {
                if (PtsRessource >= NOVA_MANA_COST)
                {
                    Monstre cibletemp = ScèneJeu.GestionInput3D.GetSourisBoxIntercept(ScèneJeu.MonstManager.ListeMonstres);
                    if (cibletemp != null && !(cibletemp is Boss))
                    {
                        cibletemp.BecomeCharmed(CHARM_DURÉE);
                        PtsRessource  -= CHARM_MANA_COST;
                        ActionActuelle = Action.ATTENDRE;
                        PositionCible  = PositionCoord;
                        Vector2 vDirection = Vector2.Subtract(cibletemp.PositionCoord, PositionCoord);
                        vDirection = Vector2.Normalize(vDirection);
                        DébuterRotation(MathHelper.WrapAngle(vDirection.X == 0 ? MathHelper.PiOver2 * Math.Sign(-vDirection.Y) : ((float)Math.Atan(-vDirection.Y / vDirection.X) + (Math.Sign(vDirection.X) - 1) * MathHelper.Pi / 2)));
                        Soundtrack.StartSoundCue("confusion");
                    }
                }
                else
                {
                    Soundtrack.StartSoundCue("nec_moremana");
                }
            }

            // For demonstration purpposes
        }
Esempio n. 19
0
 private void AjusterVolume()
 {
     Soundtrack.AdjustVolume("Music", BoutonMusique.Valeur);
     Soundtrack.AdjustVolume("Sounds", BoutonSons.Valeur);
 }
Esempio n. 20
0
 private void AjusterVolume(int volMusique, int volSons)
 {
     Soundtrack.AdjustVolume("Music", (float)volMusique / 100f);
     Soundtrack.AdjustVolume("Sounds", (float)volSons / 100f);
 }
Esempio n. 21
0
 // Appelée lorsque la scène est activée (Initialize, mais à chaque activation de la scène)
 public override void Activate()
 {
     GestionInput.Enabled = true; //(re)enable the InputManager
     Soundtrack.StartSongCue("m_credits");
     base.Activate();
 }
Esempio n. 22
0
 public void StartMusic()
 {
     Soundtrack.StartSongCue(ListeTerrains[(int)ZoneActuelle_].NomMusicSpécifique);
 }