示例#1
0
文件: Groupe.cs 项目: Thino/Simu
 public Groupe(string nom, Plateau plateau, Isimon isi1, EntiteActive isi2)
     : base(nom, null, plateau)
 {
     _cptId++;
     _id = _cptId;
     _grp = new List<Isimon>();
     _grp.Add(isi1);
     _grp.Add((Isimon)isi2);
 }
示例#2
0
 public IsimonDetailsViewModel(Isimon i)
 {
     this.Id = i.Id;
     this.Nom = i.Nom;
     this.ImageSource = i.Image.Source;
     this.Atk = i.Atk;
     this.Def = i.Def;
     this.Vit = i.Vit;
     this.PvMax = i.PvMax;
     this.Type = i.Type;
     this.Sexe = i.Sexe;
     this.Exp = i.Experience;
     this.Niveau = i.Niveau;
     this.Statut = i.Statut;
     this.Pv = i.Pv;
 }
示例#3
0
文件: Plateau.cs 项目: Thino/Simu
 public List<Isimon> GetIsimonsAround(Isimon i)
 {
     List<Case>  cases = GetCasesAdjacentes(i.MyCase);
     List<Isimon> ret = new List<Isimon>();
     foreach (Case c in cases)
     {
         if (c.Acteur is Isimon)
             ret.Add((Isimon)c.Acteur);
     }
     return ret;
 }
示例#4
0
文件: Plateau.cs 项目: Thino/Simu
 public List<Dresseur> GetDresseursAround(Isimon i)
 {
     List<Case> cases = GetCasesAdjacentes(i.MyCase);
     List<Dresseur> ret = new List<Dresseur>();
     foreach (Case c in cases)
     {
         if (c.Acteur is Dresseur)
             ret.Add((Dresseur)c.Acteur);
     }
     return ret;
 }
示例#5
0
文件: Isimon.cs 项目: Thino/Simu
 private void SeReproduire(Isimon i)
 {
     if (this.Sexe == 'F')
     {
         this.Statut = IsiStatut.GESTATION;
         i.Statut = IsiStatut.DISPO;
         this.NbJourTotalGestation = (int)PseudoAlea.boxMuller(20, 3);
     }
     else
     {
         i.Statut = IsiStatut.GESTATION;
         this.Statut = IsiStatut.DISPO;
         i.NbJourTotalGestation = (int)PseudoAlea.boxMuller(20, 3);
     }
 }
示例#6
0
文件: Isimon.cs 项目: Thino/Simu
        private void Victoire(Isimon adversaire)
        {
            //Gestion de l'EXP et des niveaux
            float val = 0;
            float ratio = ConstantesCombats.Instance.GetRatio(Type, adversaire.Type);
            ratio = 2 - ratio; ;
            if (Niveau < adversaire.Niveau)
            {
                val = (adversaire.Niveau - Niveau) * 50;
                val *= ratio;
            }
            if (Niveau > adversaire.Niveau)
            {
                val = (Niveau - adversaire.Niveau) * 10;
                val *= ratio;
            }
            if (Niveau == adversaire.Niveau)
            {
                val = 20 * ratio;
            }
            Experience += (int)val;
            if (Experience > (Niveau + 1) * Niveau * 10 && Niveau < 100)
            {
                Niveau++;
                if (Niveau < 50)
                {
                    Atk += (int)(Atk * 0.045) + 1;
                    Def += (int)(Def * 0.045) + 1;
                    Vit += (int)(Vit * 0.045) + 1;
                    PvMax += (int)(PvMax * 0.04);
                }
                else
                {
                    Atk += (int)(Atk * 0.01);
                    Def += (int)(Def * 0.01);
                    Vit += (int)(Vit * 0.01);
                    PvMax += (int)(PvMax * 0.01);

                }
            }
        }
示例#7
0
文件: Isimon.cs 项目: Thino/Simu
 private bool LancerReproduction(Isimon i)
 {
     //retourne toujours vrai, ne pas oublier de faire la proba
     this.Statut = IsiStatut.REPRODUCTION;
     i.Statut = IsiStatut.REPRODUCTION;
     this.Interact = i;
     i.Interact = this;
     return true;
 }
示例#8
0
文件: Isimon.cs 项目: Thino/Simu
        private void Attaquer(Isimon i)
        {
            i.Pv = i.Pv - CalculerDegats(this, i);
            if (i.Pv <= 0)
            {
                i.Pv = 0;
                if(this.GrpId == -1)
                    this.Statut = IsiStatut.DISPO;
                else
                    this.Statut = IsiStatut.GROUPE;

                i.Statut = IsiStatut.KO;

                Victoire(i);
            }
        }
示例#9
0
文件: Isimon.cs 项目: Thino/Simu
 private bool LancerCombat(Isimon i)
 {
     //retourne toujours vrai, ne pas oublier de faire la proba
     i.Statut = IsiStatut.COMBAT_ISIMON;
     this.Statut = IsiStatut.COMBAT_ISIMON;
     this.Interact = i;
     i.Interact = this;
     return true;
 }
示例#10
0
文件: Isimon.cs 项目: Thino/Simu
 private bool LancerCreationGroupe(Isimon i)
 {
     //retourne toujours vrai, ne pas oublier de faire la proba
     this.Statut = IsiStatut.GROUPE;
     i.Statut = IsiStatut.GROUPE;
     this._interact = i;
     i._interact = this;
     return true;
 }
示例#11
0
文件: Isimon.cs 项目: Thino/Simu
 private void IntegrerGroupe(Isimon i)
 {
     this._grpId = i._grpId;
     _plateau.ListGrp[_grpId].Grp.Add(this);
 }
示例#12
0
文件: Isimon.cs 项目: Thino/Simu
 private void CreerGroupe(Isimon i)
 {
     //Changer nom grpe
     Groupe grp = new Groupe("nomPourTest", this._plateau, this, this._interact);
     _plateau.ListGrp.Add(grp);
     this._grpId =  i._grpId = grp.Id;
 }
示例#13
0
文件: Isimon.cs 项目: Thino/Simu
 private int CalculerDegats(Isimon frappeur, Isimon frappé)
 {
     float deg = frappeur.Atk - (frappé.Def / 2) + 1;
     deg *= ConstantesCombats.Instance.GetRatio(frappeur.Type, frappé.Type);
     return (int)deg;
 }
示例#14
0
文件: Plateau.cs 项目: Thino/Simu
        private void InitActeurs(int[] parametres)
        {
            int nbIsimons = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[3] / 100);
            int nbArbres = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[2] / 100);
            int nbDresseurs = (int)Math.Ceiling((double)parametres[0] * parametres[1] * parametres[4] / 100);

            for (int i = 0; i < nbArbres; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (! _matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Entite a = new Entite("Arbre", "Arbre.png");
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }

            for (int i = 0; i < nbIsimons; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (!_matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Isimon a = new Isimon(IsimonsDispos.Instance.getRandomProfil(),this);
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }

            for (int i = 0; i < nbDresseurs; i++)
            {
                int row = PseudoAlea.GetInt(0, _nbRow-1);
                int col = PseudoAlea.GetInt(0, _nbColumn-1);
                while (!_matrice[row, col].IsEmpty())
                {
                    row = PseudoAlea.GetInt(0, _nbRow-1);
                    col = PseudoAlea.GetInt(0, _nbColumn-1);
                }
                Dresseur a = new Dresseur("Dresseur", "Sacha.png",this);
                AddActeur(a);
                DeplacerActeur(a, _matrice[row, col]);
            }
        }
示例#15
0
文件: Isimon.cs 项目: Thino/Simu
        private void NaissanceIsimon()
        {
            Entite newIsimon;

            //Le place n'importe où (juste pour tester)
            int row = PseudoAlea.GetInt(0, _plateau.NbRow - 1);
            int col = PseudoAlea.GetInt(0, _plateau.NbColumn - 1);

            while (!_plateau.Matrice[row, col].IsEmpty())
            {
                row = PseudoAlea.GetInt(0, _plateau.NbRow - 1);
                col = PseudoAlea.GetInt(0, _plateau.NbColumn - 1);
            }
            this.Statut = IsiStatut.DISPO;
            newIsimon = new Isimon(new IsiProfil(this.Nom, this.Nom+".png", this.Type, 100, 1, 2, 3), this._plateau);
            this._plateau.AddActeur(newIsimon);
            this._plateau.DeplacerActeur(newIsimon, this._plateau.Matrice[row, col]);
        }
示例#16
0
 void Isimon_MouseUp(object sender, MouseButtonEventArgs e)
 {
     Isimon s = (Isimon)_plateau.GetActeurById(((Image)sender).Name);
     if (s != null)
     {
         ucDetails.DataContext = new IsimonDetailsViewModel(s);
         _selectedOne = s;
     }
 }
示例#17
0
文件: Isimon.cs 项目: Thino/Simu
 public void OnlyOneIsimonAround(Isimon i)
 {
     if (i.Statut == IsiStatut.DISPO || i.Statut == IsiStatut.GROUPE)
     {
         if (i.Nom == this.Nom)
         {
             if (i.Statut == IsiStatut.GROUPE && LancerIntegrationGroupe())
             {
                 IntegrerGroupe(i);
                 return;
             }
             if (i.Statut == IsiStatut.DISPO && LancerCreationGroupe(i))
             {
                 CreerGroupe(i);
                 return;
             }
            /* if (Math.Abs(i.Niveau - this.Niveau) <= 10)
             {
                 if (i._sexe != this._sexe && LancerReproduction(i))
                 {
                     GererReproduction();
                     return;
                 }
                /* if (i._sexe == this._sexe && LancerCombat(i))
                 {
                     GererCombatIsimon();
                     return;
                 }
             }*/
             else
                 SeDeplacer();
         }
         else
         {
             /*if (Math.Abs(i.Niveau - this.Niveau) <= 10 && LancerCombat(i))
                 GererCombatIsimon();
             else*/
                 SeDeplacer();
         }
     }
     else
         SeDeplacer();
 }