Esempio n. 1
0
    /*
     *  1: petite explo (mine qui pete, small smoke trail only, no fire)
     *  2: med/Large explo orange / rouge + etincelles (pas vraiment explo)
     *  3: redish fire, flamme rouge montante + bcp black smoke
     *  4: redish idem, larger
     *  5: yellow/orange expl, +bcp black smoke
     *  6 :idem
     *  7: vomit, 8: gore block explo
     *  9: like 6
     *
     *  10: molotov (fire ball when in the air)
     *  11-12: yellow etincelles only, no smoke
     *  13: orange boom no smoke, like 1
     *  14-19: crée un bout de bidons détruit
     *  14: le bout part en l'air avec une trainée de flamme ("napalm")
     *  15/ 16: additionnal "napalm"
     */

    public override void Execute(List <string> _params, CommandSenderInfo _senderInfo)
    {
        Printer.Print("ConsoleCmdExplShowExplo", _params);
        EntityPlayerLocal player = GameManager.Instance.World.GetLocalPlayers()[0];

        if (_params[0] == "p")
        {
            Color color = Color.white;
            if (_params.Count >= 3)
            {
                string[] split = _params[2].Split(',');
                float[]  def   = new float[] { 0, 0, 0, 1 };
                for (int k = 0; k < split.Length; k++)
                {
                    def[k] = float.Parse(split[k]);
                }
                color = new Color(def[0], def[1], def[2], def[3]);
            }
            Printer.Print(color);
            ExecuteParticle(_params[1], player.GetPosition() + new Vector3(0, 0, 6), color);
            return;
        }
        else if (_params[0] == "pa")
        {
            ExecuteParticleAttach(_params[1], player.GetPosition());
            return;
        }
        else if (_params[0] == "pg")
        {
            ExecuteParticleGhost(_params[1], player.GetPosition());
            return;
        }
        else if (_params[0] == "s")
        {
            float intens = 1f;
            if (_params.Count > 0)
            {
                intens = float.Parse(_params[1]);
            }
            ExecuteScreenEffect(_params[1]);
            return;
        }
        int ei = int.Parse(_params[0]);

        Emplacement place = Emplacement.At(player.GetPosition() + new Vector3(0, 1, 10), Vectors.Float.Zero); // N

        ItemClass         itemClass = ItemClass.GetItemClass("thrownAmmoMolotovCocktail", false);
        DynamicProperties baseProps = itemClass.Properties;
        ExplosionData     ed        = new ExplosionData(baseProps);

        ed.ParticleIndex = ei;
        GameManager.Instance.ExplosionServer(0, place.position, place.ipos, Quaternion.identity, ed, player.entityId, 0.1f, false, null); // try -1
    }
Esempio n. 2
0
 public override void Update(GameTime gameTime)
 {
     TempsDepuisMAJ += (float)gameTime.ElapsedGameTime.TotalSeconds;
     if (TempsDepuisMAJ >= Jeu.INTERVALLE_MAJ)
     {
         DisplayText = (Emplacement.Contains(ScèneJeu.GestionInput3D.ÉtatSouris.X, ScèneJeu.GestionInput3D.ÉtatSouris.Y));
     }
     if (DisplayText)
     {
     }
     base.Update(gameTime);
 }
        public ActionResult Create([Bind(Include = "code,capacite,terrasse,categorie_id")] Emplacement emplacement)
        {
            if (ModelState.IsValid)
            {
                db.Emplacement.Add(emplacement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.categorie_id = new SelectList(db.Categorie, "id", "libelle", emplacement.categorie_id);
            return(View(emplacement));
        }
Esempio n. 4
0
        public ActionResult Create([Bind(Include = "codeEmplacement,codeTarif,capacite,terrasse")] Emplacement emplacement)
        {
            if (ModelState.IsValid)
            {
                db.Emplacements.Add(emplacement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.codeTarif = new SelectList(db.Tarifs, "codeTarif", "libelleTarif", emplacement.codeTarif);
            return(View(emplacement));
        }
Esempio n. 5
0
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="largeur"></param>
        /// <param name="hauteur"></param>
        public PixelList(int largeur, int hauteur)
        {
            Largeur = largeur;
            Hauteur = hauteur;
            NbrLed  = Largeur * Hauteur;

            Emplacement = new Emplacement(Largeur, Hauteur);

            for (int i = 0; i < Largeur * Hauteur; i++)
            {
                Add(new Pixel(i + 1, Emplacement.Convertion(i), new Coordonnee(Largeur, Hauteur, i)));
            }
        }
Esempio n. 6
0
        public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
        {
            Printer.Log(46, "SingleChunked Effect1", place.position, place.ipos, opt.OptionItem.item);
            Vector3i where = Vectors.ToInt(player.GetPosition());
            int y0 = Geo3D.Surface(where).y;

            Vector3i nw4 = ZChunk.TL4(place.ipos);

            Zombiome.Routines.Start(Regen(player, nw4, y0), name + "-SingleChunked0");
            Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(1, 0, 0), y0), name + "-SingleChunked1");
            Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(0, 0, 1), y0), name + "-SingleChunked2");
            Zombiome.Routines.Start(Regen(player, nw4 + new Vector3i(1, 0, 1), y0), name + "-SingleChunked3");
        }
Esempio n. 7
0
        public override IEnumerator Apply(EntityPlayer player, EntityAlive target, OptionEffect opt)
        {
            Vector3     pos   = target.GetPosition();
            Emplacement place = Emplacement.At(pos, Placer.directions.Generate(pos));

            Printer.Log(40, "Peak Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
            Zombiome.Routines.Named("PeakAt").Start(
                Routines.Call(biome.groundParticleEffect, place.ipos),
                new WaitForSeconds(1f),
                EffectsGround.Peak(player, place, opt)
                );
            yield break;
        }
Esempio n. 8
0
        public ActionResult Create([Bind(Include = "Id,Intitule,Description,Latitude,Longitude")] Emplacement emplacement)
        {
            if (ModelState.IsValid)
            {
                db.Emplacements.Add(emplacement);
                var user = db.Users.Find(currentUser.Id);
                user.EmplacementsFavoris.Add(emplacement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(emplacement));
        }
Esempio n. 9
0
        public void Equiper(int indexPokemon, Emplacement emplacement)
        {
            Pokemon pokemon = Depot.PokemonsAchetes[indexPokemon];

            if (pokemon.Equipe)
            {
                Echanger(pokemon.Emplacement, emplacement);
            }
            else
            {
                Desequiper(emplacement);
                Depot.EquiperPokemon(emplacement, indexPokemon);
            }
        }
Esempio n. 10
0
        // GET: Coordonnees/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Emplacement adresse = db.Coordonnees.Find(id);

            if (adresse == null)
            {
                return(HttpNotFound());
            }
            return(View(adresse));
        }
Esempio n. 11
0
        // GET: Emplacements/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Emplacement emplacement = db.Emplacements.Find(id);

            if (emplacement == null)
            {
                return(HttpNotFound());
            }
            return(View(emplacement));
        }
Esempio n. 12
0
        private void Action(string parametre)
        {
            int         position    = int.Parse(parametre);
            Emplacement emplacement = (Emplacement)position;

            if (EmplacementEstEquipe(emplacement))
            {
                Desequiper(emplacement);
            }
            else
            {
                Equiper(emplacement);
            }
        }
        // GET: Emplacements/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Emplacement emplacement = db.Emplacement.Find(id);

            if (emplacement == null)
            {
                return(HttpNotFound());
            }
            ViewBag.categorie_id = new SelectList(db.Categorie, "id", "libelle", emplacement.categorie_id);
            return(View(emplacement));
        }
Esempio n. 14
0
        private IEnumerator PeakProj(EntityPlayer player, Emplacement place, OptionEffect opt)
        {
            yield return(EffectsGround.Peak(player, place, opt));

            for (int k = 0; k < 10; k++)
            {
                Vector3 pos = place.position + (opt.OptionShape.shape.y + 2) * Vectors.Float.UnitY;
                yield return(EffectsItem.spawnItemGhost(opt.OptionItem.item,
                                                        pos,
                                                        3 * (Vectors.Float.UnitY + Placer.directions.Generate(pos).normalized)
                                                        ));

                yield return(new WaitForSeconds(0.5f));
            }
        }
Esempio n. 15
0
        // GET: Emplacements/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Emplacement emplacement = db.Emplacements.Find(id);

            if (emplacement == null)
            {
                return(HttpNotFound());
            }
            ViewBag.codeTarif = new SelectList(db.Tarifs, "codeTarif", "libelleTarif", emplacement.codeTarif);
            return(View(emplacement));
        }
Esempio n. 16
0
        private void LocationPicked(int locationId)
        {
            _homeUserControl.StartClientsFromLocations();
            BringToFront();
            Emplacement locationToAdd = _db.Emplacement.First(a => a.Code_Emplacement == locationId);

            if (locationsListBox.Items.Cast <LocationItem>().Any(locationItem => locationItem.Location.Code_Emplacement == locationToAdd.Code_Emplacement))
            {
                return;
            }
            locationsListBox.Items.Add(new LocationItem
            {
                Location = locationToAdd,
                Lodgers  = new HashSet <Lodger>()
            });
        }
        public void Echanger(Emplacement emplacement1, Emplacement emplacement2)
        {
            int position1 = (int)emplacement1;
            int position2 = (int)emplacement2;

            if (emplacement1 != emplacement2)
            {
                EmplacementPokemon pokemon1 = Emplacements[position1];

                Emplacements[position1] = Emplacements[position2];
                Emplacements[position2] = pokemon1;

                SetPokemon(emplacement1, Emplacements[position1]);
                SetPokemon(emplacement2, Emplacements[position2]);
            }
        }
Esempio n. 18
0
        public void EmplacementCoordonnee()
        {
            Emplacement temp = new Emplacement();

            temp._coordonnee.SetNull();
            temp._coordonnee.SetCoordonnee(3, 3);
            temp._tuileFantome = true;

            Emplacement test = new Emplacement();

            test._coordonnee.SetCoordonnee(3, 3);

            Assert.AreEqual(test._coordonnee._x, temp._coordonnee._x);
            Assert.AreEqual(test._coordonnee._y, temp._coordonnee._y);
            Assert.AreEqual(test._tuilePiece, temp._tuilePiece);
            Assert.AreNotEqual(test._tuileFantome, temp._tuileFantome);
        }
Esempio n. 19
0
        public override IEnumerator Regen(EntityPlayer player, Vector3i zchunk, int iniguess)
        {
            Bounds        bounds   = ZChunk.Bounds4(zchunk, iniguess);
            List <Entity> existing = GameManager.Instance.World.GetEntitiesInBounds(
                EntityGhost.Concretes[this.concreteIdx],
                bounds,
                new List <Entity>()
                );

            yield return(Iterating.Repeater.Frame); // listent may be costly

            Vector3i min = Vectors.ToInt(bounds.min);
            Vector3i max = Vectors.ToInt(bounds.max);

            int current = existing.Count;
            int gen     = ZChunk.Size(this.gen);
            // gen = 1; // DEBUG
            int regen = ZChunk.Size(this.regen);
            int iniy  = (int)Math.Floor(player.GetPosition().y);

            Zombiome.Routines.Start(Routines.IfNotRunning(
                                        LockRenew,
                                        EffectExisting(player, existing)
                                        ), "Ghost-Existing");

            int nnew = Math.Min(limit_new, gen - current);

            Entity[] Tracker = new Entity[] { null };
            if (current < regen)
            {
                Printer.Log(45, "Ghost regen", regen, current, gen, "=>", gen - current);
                for (int k = 0; k < nnew; k++)
                {
                    Vector3i pos = new Vector3i(rand.RandomRange(min.x, max.x), 0, rand.RandomRange(min.z, max.z));
                    pos = Geo3D.Surface(pos, iniy);
                    if (GameManager.Instance.World.GetTerrainHeight(pos.x, pos.z) > 2)
                    {
                        Printer.Log(40, "Ghost", pos, opt.OptionEntity.entity, opt.OptionEntity.buff);
                        Emplacement place = Emplacement.At(Vectors.ToFloat(pos) + 2f * Vectors.Float.UnitY, Vectors.Float.UnitY);
                        GhostData   gdata = (ghost_type == "") ? this.GhostData : GhostData.Ghosts[ghost_type];
                        yield return(EntityGhost.Create(gdata, place, opt.OptionEntity.entity));
                    }
                    yield return(Repeater.Yield);
                }
            }
        }
Esempio n. 20
0
    public override void Effect1(EntityPlayer player, Emplacement place,  OptionEffect opt) {
        DecoSearch.Search(player, 20, 3);

        int nsteps = Math.Min(3, DecoSearch.Count);
        for (int k=0; k<nsteps; k++) {
            BlockPos deco = DecoSearch.Dequeue();
            if (deco == null) continue;
            Vector3i ppos = Vectors.ToInt(player.GetPosition());
            if (Math.Abs(ppos.x - deco.Pos.x) + Math.Abs(ppos.z - deco.Pos.z) > DecoSearch.radius){
                Printer.Log(85, "MovingDeco: too far !", deco, ppos);
                continue;
            }
            string item = Deco2Proj(deco.Value.Block);
            if (item == "") continue;
            Zombiome.Routines.Start(Fly(deco, item), "FlyDeco");
        }
    }
    public void ajouterPays(string pays)
    {
        pays = "'" + pays.Replace("'", "''") + "'";
        Connexion   c        = new Connexion();
        OdbcCommand commande = new OdbcCommand();

        commande.CommandText = "SELECT * FROM Pays WHERE Titre_Pays like " + pays;
        DataRow dr = c.exeRequetteParametree(commande).Tables[0].Rows[0];

        Emplacement cont = new Emplacement(false, dr["Titre_Pays"].ToString().ToUpper(), false, false, dr["Id_Pays"].ToString(), new ListeEmplacementRecherche());

        cont.IsPays = true;

        emplacementAffiche.Add(cont);

        rafraichirEmplacementAffiche();
    }
        /// <summary>
        /// Récupèration des données des zones de saisies pour constituer un emplacment
        /// </summary>
        /// <returns>Toutes les données d'un emplacement</returns>
        Emplacement Reccupere_données()
        {
            //Affichage de l'emplacment COURANT (celui selectionné dans le combobox)
            Emplacement resultat = new Emplacement();

            resultat.CodeBiblio = TXTBX_CodeBiblio.Text;               //Code biblio
            resultat.CodeTheme  = TXTBX_CodeTheme.Text;                //Code thème
            resultat.Etage      = Convert.ToDecimal(NUMRC_Etage.Text); //Etage
            resultat.Allee      = Convert.ToDecimal(NUMRC_Allee.Text); //Allée
            resultat.Rayon      = Convert.ToDecimal(NUMRC_Rayon.Text); //Rayon
            // Nouveau code emplacment
            TXTBX_CodeEmplacement.Text = resultat.New_Code_Empl();
            resultat.CodeEmplacement   = TXTBX_CodeEmplacement.Text; //Code emplacement

            resultat.Libelle = "Etage" + emp_infos.Etage + "-Allée" + emp_infos.Allee + "-Rayon" + emp_infos.Rayon;
            return(resultat);
        }
Esempio n. 23
0
        public override IEnumerator _Next(EntityPlayer player)
        {
            /* Over should keep some memory (position), and regenerate toward player
             */
            long        start_time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
            Emplacement placeBase  = new Emplacement(player, opt);

            placeBase.direction = Vectors.Float.Randomize(this.rand, 1f); // useless for peak
            Printer.Log(46, "MultiEffect._Next() placeBase", player, placeBase.position, placeBase.direction);
            foreach (int p in Cycler.Over())
            {
                if (Cycler.dt >= 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() - start_time > (long)(Cycler.dt * 1000))
                {
                    yield break;
                }
                Printer.Log(41, "_Next iterating Over");
                Vector3 maybeFollowing = (this.isFollowing) ? player.GetPosition() : placeBase.position;
                int     q = -1;
                foreach (Emplacement place in Iter.On(Placer.Get(maybeFollowing)))
                {
                    q = q + 1;
                    if (q >= Repeater.n)
                    {
                        break;
                    }
                    if (place.valid)
                    {
                        Printer.Log(40, "MultiEffect._Next iterating Clones", place); // last before null (firestorm)
                        // float state = ((float) q) / Repeater.copies;
                        OptionEffect rdm = Randomize();
                        Printer.Log(40, "_Next Randomized", p, q, opt);
                        Printer.Log(40, "_Next Place", p, q, place);
                        this.Effect1(player, place, rdm);
                    }
                    else
                    {
                        Printer.Log(40, "Invalid place:", q, place, place.valid_msg);
                    }
                    yield return(Repeater.Yield);
                }
                yield return(Cycler.Yield);
            }
        }
 private void emplacementDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     // Supprimer
     if (e.ColumnIndex == emplacementDataGridView.Columns["Supprimer"].Index && e.RowIndex >= 0)
     {
         if (DialogResult.Yes == MessageBox.Show(
                 "Voullez-vous vraimment supprimer ce stagiaire",
                 "Confirmation de supprision", MessageBoxButtons.YesNo))
         {
             Emplacement a = (Emplacement)emplacementBindingSource.Current;
             new ServiceEmplacement().Supprimer(a.id);
             this.Actualiser();
         }
     }
     // Editer
     if (e.ColumnIndex == emplacementDataGridView.Columns["Modifier"].Index && e.RowIndex >= 0)
     {
         EditerStagiaireEvent(sender, e);
     }
 }
Esempio n. 25
0
        public static bool getUpdateEmplacement(Emplacement a)
        {
            NpgsqlConnection con = Connexion.Connection();

            try
            {
                string        update = "";
                NpgsqlCommand Ucmd   = new NpgsqlCommand(update, con);
                Ucmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception e)
            {
                Messages.Exception(e);
                return(false);
            }
            finally
            {
                Connexion.Deconnection(con);
            }
        }
        public void RechargerEmplacements()
        {
            for (int i = 0; i < 3; i++)
            {
                Emplacement emplacement = (Emplacement)i;

                if (!Equipe(emplacement))
                {
                    SetPokemon(emplacement, new EmplacementPokemon(emplacement));
                }
                else
                {
                    int     indexPokemonEquipe = IndexPokemonsEquipes[i];
                    Pokemon pokemon            = PokemonsAchetes[indexPokemonEquipe];

                    EmplacementPokemon pokemonEquipe = new EmplacementPokemon(emplacement);
                    pokemonEquipe.Pokemon = pokemon;
                    SetPokemon(emplacement, pokemonEquipe);
                }
            }
        }
Esempio n. 27
0
        public static Emplacement getAjoutEmplacement(Emplacement a)
        {
            NpgsqlConnection con = Connexion.Connection();

            try
            {
                string        insert = "";
                NpgsqlCommand cmd    = new NpgsqlCommand(insert, con);
                cmd.ExecuteNonQuery();
                a.Id = getCurrent();
                return(a);
            }
            catch
            {
                return(null);
            }
            finally
            {
                Connexion.Deconnection(con);
            }
        }
Esempio n. 28
0
        public ActionResult Reservation(int?id)
        {
            using (IDal dal = new Dal())
            {
                int nbrEnfants;
                int.TryParse(Request.Form["nbrEnfants"], out nbrEnfants);

                int nbrAdultes;
                int.TryParse(Request.Form["nbrAdultes"], out nbrAdultes);

                bool supParking = (Request.Form["supParking"] == "false" ? false : true);
                bool supElec    = (Request.Form["supElectricite"] == "false" ? false : true);
                bool tente      = (Request.Form["tente"] == "tente");


                DateTime arrivee = DateTime.Parse(Request.Form["Check-in"]);
                DateTime depart  = DateTime.Parse(Request.Form["Check-out"]);



                //test s'il reste un emplacement libre
                Emplacement e = dal.obtenirEmplacementLibre(tente);


                if (e != null)
                {
                    //creer la reservation et l'ajouter à l'utilisateur courant
                    if (HttpContext.User.Identity.IsAuthenticated)
                    {
                        int idUtilisateur = int.Parse(HttpContext.User.Identity.Name);
                        dal.creerReservation(e.Id, idUtilisateur, tente, arrivee, depart, nbrAdultes, nbrEnfants, supParking, supElec, false);
                        dal.reserverEmplacement(e);
                    }
                }

                //TODO page d'erreur pour plus d'emplacements disponibles et gérer l'id client ici

                return(RedirectToAction("Index"));
            }
        }
Esempio n. 29
0
        public override IEnumerator Regen(EntityPlayer player, Vector3i zchunk, int iniguess)
        {
            yield return(ZBActivity.Environment.ZBSounds.Play(ZBiomeInfo.NoiseWater, player.GetPosition(), player, World, 2, 0, 0.5f));

            int gen = ZChunk.Size(this.gen);

            Vector3[] positions = ZChunk.Positions(Zombiome.worldSeed, zchunk, gen);

            foreach (Vector3 pos in positions)
            {
                Printer.Log(40, "Flood regen", zchunk, pos);
                Vector3i    surfaced = Geo3D.Surface(Vectors.ToInt(pos), iniguess);
                Emplacement place    = Emplacement.At(Vectors.ToFloat(surfaced), Vectors.Float.UnitY);
                /* Generate Emplacement => apply filter from gth */
                int  th = GameManager.Instance.World.GetTerrainHeight(surfaced.x, surfaced.z);
                bool go = th > 5;
                if (go)
                {
                    go = surfaced.y < th + Placer.pOffSurface;
                }
                if (go)
                {
                    go = surfaced.y > th - Placer.nOffSurface;
                }
                if (go)
                {
                    go = !(IsWater(World.GetBlock(surfaced + Vectors.Up).Block) &&
                           IsWater(World.GetBlock(surfaced + 2 * Vectors.Up).Block));
                }
                if (go)
                {
                    Printer.Log(40, "Flood at", place);
                    // Dont do it if already water, surtout qu'on affaisse la surface !!
                    // Cave allows to bound water by ground
                    yield return(EffectsCollapse.Cave(player, place, opt));
                }
                yield return(Repeater.Yield);
            }
        }
    public void ajouterContinent(string continent)
    {
        string codeContinent = "";

        switch (continent)
        {
        case "Europe": codeContinent = "eu"; break;

        case "Afrique": codeContinent = "af"; break;

        case "Asie": codeContinent = "as"; break;

        case "AmériqueN": codeContinent = "na"; break;

        case "AmériqueS": codeContinent = "sa"; break;

        case "Océanie": codeContinent = "oc"; break;
        }

        Connexion   c        = new Connexion();
        OdbcCommand commande = new OdbcCommand();

        commande.CommandText = "SELECT DISTINCT Continent FROM Pays WHERE Continent = ?";
        OdbcParameter paramContinent = new OdbcParameter("", DbType.String);

        paramContinent.Value = continent;
        commande.Parameters.Add(paramContinent);

        DataRow dr = c.exeRequetteParametree(commande).Tables[0].Rows[0];

        Emplacement cont = new Emplacement(false, dr["Continent"].ToString().ToUpper(), false, false, codeContinent, new ListeEmplacementRecherche());

        cont.IsContinent = true;

        emplacementAffiche.Add(cont);

        rafraichirEmplacementAffiche();
    }