Beispiel #1
0
        private void btnAjouter_Click(object sender, EventArgs e)
        {
            Champ nom = new Champ(NomTable.routepopoteroulante.ToString(), "rprNom", txtNouvelleRoute.Text);

            RequeteSelection reqSel = new RequeteSelection(NomTable.routepopoteroulante);

            reqSel.Condition = new ConditionRequete(Operateur.COMME, nom);

            if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel).EstVide&& !OutilsForms.PoserQuestion("Confirmation d'ajout", "Une route portant le même nom existe déjà. Voulez-vous quand même ajouter celle-ci?"))
            {
                return;
            }

            RequeteAjout reqAjout = new RequeteAjout(NomTable.routepopoteroulante, nom);
            int          nouvelIndex;

            if ((nouvelIndex = Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout)) < 0)
            {
                Journal.AfficherMessage("Une erreur est survenue lors de l'ajout d'une route. L'action a été annulée.", TypeMessage.ERREUR, true);
                return;
            }

            TreeNode nouveauNoeudRoute = new TreeNode(txtNouvelleRoute.Text);

            nouveauNoeudRoute.Tag = nouvelIndex;

            tvRoutesBeneficiaires.Nodes.Add(nouveauNoeudRoute);
            txtNouvelleRoute.Text = "";
        }
Beispiel #2
0
        private void gtEmployes_RowDoubleClick(object sender, RowDoubleClickEventArgs e)
        {
            Champ      indexEmploye = e.LigneCliquee.GetChamp("perId");
            Champ      nombreHeures = new Champ("employereunion", "erHeures", (int)nudNombreHeuresEmploye.Value);
            LigneTable reunion      = ((LigneTable)((ComboBoxItem)cmbReunion.SelectedItem).Value);
            string     infosEmploye = String.Format(FORMAT_PERSONNES_INCLUS, e.LigneCliquee.GetValeurChamp <string>("perNom"), e.LigneCliquee.GetValeurChamp <string>("perPrenom"), nombreHeures.Valeur);

            RequeteSelection reqSel = new RequeteSelection(NomTable.employereunion);

            reqSel.Condition = new ConditionRequete(Operateur.EGAL, indexEmploye);
            reqSel.Condition.LierCondition(new ConditionRequete(Operateur.EGAL, reunion.GetChamp("reuId")), true);

            if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel).EstVide)
            {
                Journal.AfficherMessage("Cet employé fait déjà partie de cette réunion. Retirez-le préalablement pour modifier son nombre d'heures.", TypeMessage.INFORMATION, false);
                return;
            }

            RequeteAjout reqAjout = new RequeteAjout(NomTable.employereunion, indexEmploye, reunion.GetChamp("reuId"), nombreHeures);

            if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0)
            {
                Journal.AfficherMessage("Une erreur est survenue lors de l'ajout de l'employé à la réunion. L'action a été annulée.", TypeMessage.ERREUR, true);
                return;
            }

            AjouterItem(lbEmployesInclus, new ComboBoxItem(infosEmploye, indexEmploye));
        }
Beispiel #3
0
        private void gtBeneficiaires_RowDoubleClick(object sender, Outils.RowDoubleClickEventArgs e)
        {
            Champ      indexBeneficiaire = e.LigneCliquee.GetChamp("perId");
            LigneTable action            = ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value);
            string     infosBeneficiaire = String.Format(FORMAT_BENEFICIAIRES_INCLUS, e.LigneCliquee.GetValeurChamp <string>("perNom"), e.LigneCliquee.GetValeurChamp <string>("perPrenom"));

            RequeteSelection reqSel = new RequeteSelection(NomTable.beneficiaireactionactivite);

            reqSel.Condition = new ConditionRequete(Operateur.EGAL, indexBeneficiaire);
            reqSel.Condition.LierCondition(new ConditionRequete(Operateur.EGAL, action.GetChamp("actaId")), true);

            if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel).EstVide)
            {
                Journal.AfficherMessage("Ce bénéficiaire fait déjà partie de cette action.", TypeMessage.INFORMATION, false);
                return;
            }

            RequeteAjout reqAjout = new RequeteAjout(NomTable.beneficiaireactionactivite, indexBeneficiaire, action.GetChamp("actaId"));

            if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0)
            {
                Journal.AfficherMessage("Une erreur est survenue lors de l'ajout du bénéficiaire à l'action. L'action a été annulée.", TypeMessage.ERREUR, true);
                return;
            }

            AjouterItem(lbBeneficiairesInclus, new ComboBoxItem(infosBeneficiaire, indexBeneficiaire));
        }
Beispiel #4
0
        bool IsJumping(Obj_AI_Hero champion, Champ champ, String animation)
        {
            if (ObjectManager.Player.Distance(champion) <= champ.Range)
            {
                switch (champion.ChampionName)
                {
                case "Rengar":
                    if (animation.Contains("Spell5"))
                    {
                        return(true);
                    }
                    break;

                case "Khazix":
                    if (animation.Contains("Spell3"))
                    {
                        return(true);
                    }
                    break;

                case "Zac":
                    if (animation.Contains("Spell3"))
                    {
                        return(true);
                    }
                    break;
                }
            }
            return(false);
        }
Beispiel #5
0
        private void frmPersonne_Load(object sender, EventArgs e)
        {
            RequeteSelection reqSelEtatsCivil = new RequeteSelection(NomTable.etatcivil);
            Table            etatsCivil       = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelEtatsCivil);

            foreach (LigneTable etat in etatsCivil.Lignes)
            {
                cmbEtatCivil.Items.Add(new ComboBoxItem(etat.GetValeurChamp <string>("etaNom"), etat.GetValeurChamp <int>("etaId")));
            }

            RequeteSelection reqSelLangues = new RequeteSelection(NomTable.langue);
            Table            langues       = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelLangues);

            foreach (LigneTable langue in langues.Lignes)
            {
                chklbLangues.Items.Add(new ComboBoxItem(langue.GetValeurChamp <string>("lanNom"), langue.GetValeurChamp <int>("lanId")));
            }

            RequeteSelection reqSelStatutActif = new RequeteSelection(NomTable.statut, "staId");

            reqSelStatutActif.Condition = new ConditionRequete(Operateur.COMME, "staNom", "'Actif'");

            Table tableStatutActif = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelStatutActif);

            if (!tableStatutActif.EstVide)
            {
                StatutActif = tableStatutActif.Lignes[0].GetChamp("staId");
            }
        }
Beispiel #6
0
        public override bool Supprimer()
        {
            if (!base.Supprimer())
            {
                return(false);
            }

            if (!ValiderDonnees())
            {
                return(false);
            }

            if (!OutilsForms.PoserQuestion("Confirmation suppression", "Voulez-vous vraiment supprimer ces livraisons?"))
            {
                return(false);
            }

            List <DateTime> datesASupprimer = new List <DateTime>();

            foreach (DateTime date in GetDatesConsiderees())
            {
                if (GetIndexLivraisonExistante(date) >= 0)
                {
                    datesASupprimer.Add(date);
                }
            }

            ConditionRequete   cond = new ConditionRequete(Operateur.EGAL, BeneficiaireCourant.GetChamp("perId"));
            RequeteSuppression reqSup;
            bool erreurAffichee = false;

            foreach (DateTime date in datesASupprimer)
            {
                Champ champDate = new Champ("livraisonpopoteroulante", "lprDate", date);

                ConditionRequete copieCond = new ConditionRequete(cond);
                copieCond.LierCondition(new ConditionRequete(Operateur.EGAL, champDate), true);

                reqSup = new RequeteSuppression(NomTable.livraisonpopoteroulante, copieCond);

                if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0 && !erreurAffichee)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de la suppression d'une ou plusieurs livraisons.", TypeMessage.ERREUR, true);
                    erreurAffichee = true;
                }
                else
                {
                    int indexLivraisonASupprimer = GetIndexLivraisonExistante(date);

                    if (indexLivraisonASupprimer >= 0)
                    {
                        Livraisons.Lignes.RemoveAt(indexLivraisonASupprimer);
                    }

                    SupprimerLivraisonCalendrier(date);
                }
            }

            return(true);
        }
 /// //////////////////////////////////////////////////
 public override void InsereDefinitionToObjetFinal(CDefinitionProprieteDynamique def)
 {
     if (Champ != null)
     {
         Champ.InsereParent(def);
     }
 }
Beispiel #8
0
        public override bool Enregistrer()
        {
            if (!base.Enregistrer())
            {
                return(false);
            }

            PersonneCourante.AjouterChamp("perDateDerniereMaj", DateTime.Now);

            Champ indexPersonne = PersonneCourante.GetChamp("perId");

            LigneTable personne = new LigneTable("Personne");

            personne.AjouterChamp("perDateDerniereMaj", PersonneCourante.GetValeurChamp <DateTime>("perDateDerniereMaj"));
            personne.AjouterChamp("perDateOuverture", PersonneCourante.GetValeurChamp <DateTime>("perDateOuverture"));
            personne.AjouterChamp("perDateFermeture", PersonneCourante.GetValeurChamp <DateTime>("perDateFermeture"));
            personne.AjouterChamp("perDateInactivite", PersonneCourante.GetValeurChamp <DateTime>("perDateInactivite"));
            personne.AjouterChamp("staId", PersonneCourante.GetValeurChamp <int>("staId"));

            RequeteModification reqModif = new RequeteModification(NomTable.personne, new ConditionRequete(Operateur.EGAL, indexPersonne), personne);

            if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) <= 0)
            {
                return(false);
            }

            return(true);
        }
Beispiel #9
0
        public void Generer(LigneTable donnees)
        {
            WordSDK.Application appWord = null;
            WordSDK.Document    doc     = null;

            try
            {
                appWord = new WordSDK.Application();
                appWord.DisplayAlerts = WordSDK.WdAlertLevel.wdAlertsNone;

                doc = appWord.Documents.Add(Directory.GetCurrentDirectory() + "\\" + NomFichier, Visible: false);
                doc.Activate();

                foreach (WordSDK.FormField field in doc.FormFields)
                {
                    Champ champ = donnees.GetChamp(field.Name);

                    if (champ != null)
                    {
                        switch (champ.Type)
                        {
                        case TypeChamp.BOOLEEN:
                            field.CheckBox.Value = (bool)champ.ValeurWord;
                            break;

                        default:
                            field.Range.Text = champ.ValeurWord.ToString();
                            break;
                        }
                    }
                }

                appWord.DisplayAlerts = WordSDK.WdAlertLevel.wdAlertsAll;
                appWord.Visible       = true;
            }
            catch (Exception ex)
            {
                Journal.AfficherException("Une erreur est survenue lors de la génération du fichier Word. L'action a été annulée.", ex);

                if (appWord != null && doc != null)
                {
                    doc.Close(false);
                    appWord.Quit();
                }
            }
            finally
            {
                if (doc != null)
                {
                    Marshal.ReleaseComObject(doc);
                }
                if (appWord != null)
                {
                    Marshal.ReleaseComObject(appWord);
                }
            }
        }
 private static void InfuseSilence()
 {
     Console.WriteLine("Calling Silence");
     foreach (Obj_AI_Hero Champ in ObjectManager.Get <Obj_AI_Hero>())
     {
         if ((Champ != null) && (E.IsReady()) && (Champ.IsEnemy) && (Champ.IsChannelingImportantSpell()) && (Champ.IsValidTarget(E.Range)))
         {
             E.CastOnUnit(Champ, packets);
         }
     }
 }
 private static void Starcall()
 {
     Console.WriteLine("Calling Starcall");
     foreach (Obj_AI_Hero Champ in ObjectManager.Get <Obj_AI_Hero>())
     {
         if ((Champ != null) && (Champ.IsValidTarget(Q.Range)))
         {
             Q.Cast(null, packets);
         }
     }
 }
Beispiel #12
0
        private void cbSuspendu_CheckedChanged(object sender, EventArgs e)
        {
            ConditionRequete condModif = new ConditionRequete(Operateur.EGAL, "perId", BeneficiaireCourant.GetChamp("perId").ValeurSQL);

            condModif.LierCondition(new ConditionRequete(Operateur.EGAL, "serId", (cmbService.SelectedItem as ComboBoxItem).Value.ToString()), true);

            Champ suspendu = new Champ("inscriptionservice", "insSuspendu", cbSuspendu.Checked);
            RequeteModification reqModif = new RequeteModification(NomTable.inscriptionservice, condModif, suspendu);

            if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) < 0)
            {
                Journal.AfficherMessage("Une erreur est survenue lors de la suspension du service. L'action a été annulée", TypeMessage.ERREUR, true);
                cbSuspendu.Checked = !cbSuspendu.Checked;
            }
        }
Beispiel #13
0
        public Contact NouveauContact()
        {
            if (this.contact == null)
            {
                this.contact = new Contact();
            }

            List <Donnee> donnees;

            contact.setIduser(template.getIduser());
            contact.setDtcreation(DateTime.Now);
            contact.setFavoris(false);
            contact.setActif(true);

            donnees = new List <Donnee>();

            foreach (Control ctrl in this.panel1.Controls)
            {
                if (ctrl.Tag != null && ctrl.Tag.GetType() == typeof(Champ))
                {
                    Champ c = (Champ)ctrl.Tag;

                    Donnee d = new Donnee();
                    d.setIdchamp(c.getIdchamp());

                    if (ctrl.GetType() == typeof(DateTimePicker))
                    {
                        if ((((DateTimePicker)ctrl).Value.ToShortDateString() != DateTime.Now.ToShortDateString()))
                        {
                            d.setValeur(((DateTimePicker)ctrl).Value.ToString("yyyy-MM-dd"));
                        }
                        else
                        {
                            d.setValeur(null);
                        }
                    }
                    else
                    {
                        d.setValeur(ctrl.Text);
                    }

                    donnees.Add(d);
                }
            }

            contact.setDonnees(donnees);
            return(contact);
        }
Beispiel #14
0
        private void btnListeReunions_Click(object sender, EventArgs e)
        {
            if (dtpDeActionsReunions.Value.Date > dtpAActionsReunions.Value.Date)
            {
                Journal.AfficherMessage("Veuillez entrer une période de temps valide.", TypeMessage.INFORMATION, false);
                return;
            }

            Champ indexActivite = (Champ)((ComboBoxItem)cmbActivite.SelectedItem).Value;

            Table benevoles = GetListe(REQ_REUNIONS_BENEVOLES, COND_DATE_REUNIONS, (int)indexActivite.Valeur, "actionactivite");
            Table employes  = GetListe(REQ_REUNIONS_EMPLOYES, COND_DATE_REUNIONS, (int)indexActivite.Valeur, "actionactivite");

            benevoles.Joindre("reuDate", employes, "reuDate");
            GenererListe(benevoles, "Réunions");
        }
Beispiel #15
0
        public frmFichesPersonnes()
            : base(true, true)
        {
            InitializeComponent();

            PersonneCourante = null;

            AncienIndexPersonneCouple = 0;
            IndexPersonneCouple       = 0;
            PersonneCouple            = null;

            Services    = null;
            StatutActif = null;

            cmbEtatCivil.MouseWheel += new MouseEventHandler(cmbEtatCivil_MouseWheel);
        }
Beispiel #16
0
        private bool FormIsValid()
        {
            bool b = true;
            int  i = 0;

            while (b && i < this.Controls.Count)
            {
                Control ctrl = this.panel1.Controls[i];

                if (ctrl.Tag != null && ctrl.Tag.GetType() == typeof(Champ))
                {
                    Champ c = (Champ)ctrl.Tag;
                    b = c.isValide;
                }
                i++;
            }

            return(b);
        }
Beispiel #17
0
    //функция старта турнира
    void StartChamp()
    {
        n = new Champ(my);

        int min = 30, max = 65;

        //определения уровня турнира (рейтинг команд, изменение коэффицента заработка за турнир)
        if (choose.value > 0)
        {
            warning.text = "";

            if (choose.value == 1)
            {
                min = 30;
                max = 45;
                n.y = 1;
            }
            else if (choose.value == 2)
            {
                min = 40;
                max = 55;
                n.y = 10;
            }
            else if (choose.value == 3)
            {
                min = 50;
                max = 73;
                n.y = 100;
            }

            Change_canvas(false, true, false, false); //открытие таблицы-турнира
            n.GenerateTeams(min, max);                //генерация команд соперников

            for (int i = 0; i < n.teams.Count; i++)
            {
                team_text[i].text = n.teams[i].name;//вывод списка комнад участников турнира
            }
        }
        else //если уровень не выбран, показать сообщение об ошибке
        {
            warning.text = "Choose level!";
        }
    }
Beispiel #18
0
        public void LoadChampInfo()
        {
            DataPull  pull = new DataPull();
            DataView  dv   = new DataView();
            ChampInfo ci   = new ChampInfo();

            dv = pull.PullChampInfo();

            foreach (DataRowView row in dv)
            {
                Champ cha = new Champ();

                cha.championId       = int.Parse(row["championId"].ToString());
                cha.banRate          = row["banRate"].ToString();
                cha.pickRate         = row["pickRate"].ToString();
                cha.winWithItems     = row["winWithItems"].ToString();
                cha.winWithoutItems  = row["winWithoutItems"].ToString();
                cha.bestItem         = row["bestItem"].ToString();
                cha.AvgAssist        = row["AvgAssist"].ToString();
                cha.AvgDeaths        = row["AvgDeaths"].ToString();
                cha.AvgGoldEarned    = row["AvgGoldEarned"].ToString();
                cha.AvgKills         = row["AvgKills"].ToString();
                cha.AvgMinionsKilled = row["AvgMinionsKilled"].ToString();
                cha.AvgTowerKills    = row["AvgTowerKills"].ToString();
                cha.AvgWardsPlaced   = row["AvgWardsPlaced"].ToString();
                cha.MaxAssist        = row["MaxAssist"].ToString();
                cha.MaxDeaths        = row["MaxDeaths"].ToString();
                cha.MaxGoldEarned    = row["MaxGoldEarned"].ToString();
                cha.MaxKills         = row["MaxKills"].ToString();
                cha.MaxMinionsKilled = row["MaxMinionsKilled"].ToString();
                cha.MaxTowerKills    = row["MaxTowerKills"].ToString();
                cha.MaxWardsPlaced   = row["MaxWardsPlaced"].ToString();

                ci.info.Add(cha);
            }

            string json = JsonConvert.SerializeObject(ci);
            var    path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "//RitoOutput//ChampInfo.json";

            File.WriteAllText(path, json);
        }
Beispiel #19
0
        public AntiJump()
        {
            switch (ObjectManager.Player.ChampionName)
            {
            case "Azir":
                Champion = new Champ("Azir", 250, SpellSlot.R, true);
                break;

            case "Cassiopeia":
                Champion = new Champ("Cassiopeia", 825, SpellSlot.R, true);
                break;

            case "Draven":
                Champion = new Champ("Draven", 1000, SpellSlot.E, true);
                break;

            case "Syndra":
                Champion = new Champ("Syndra", 700, SpellSlot.E, true);
                break;

            case "Thresh":
                Champion = new Champ("Thresh", 700, SpellSlot.E, true);
                break;

            case "Tristana":
                Champion = new Champ("Tristana", 500, SpellSlot.R, false);
                break;

            case "Quinn":
                Champion = new Champ("Quinn", 700, SpellSlot.E, false);
                break;

            case "Vayne":
                Champion = new Champ("Vayne", 500, SpellSlot.E, false);
                break;

            default:
                return;
            }
            Obj_AI_Hero.OnPlayAnimation += Obj_AI_Hero_OnPlayAnimation;
        }
Beispiel #20
0
        private void Ctrl_Leave(object sender, EventArgs e)
        {
            TextBox txtb = (TextBox)sender;

            if (txtb.Tag != null && txtb.Tag.GetType() == typeof(Champ))
            {
                Champ c = (Champ)txtb.Tag;
                if (!String.IsNullOrEmpty(c.getDatatype().getRegex()))
                {
                    Regex r = new Regex(c.getDatatype().getRegex());

                    if (!r.IsMatch(txtb.Text) && !string.IsNullOrEmpty(txtb.Text))
                    {
                        c.isValide = false;
                        toolStripLabelInfo.Text = "Erreur sur la saisie sur le champ: " + c.getLibelle();
                    }
                    else
                    {
                        c.isValide = true;
                    }
                }
            }
        }
Beispiel #21
0
        private void btnRetirerBeneficiaire_Click(object sender, EventArgs e)
        {
            if (!OutilsForms.PoserQuestion("Confirmation suppression", "Voulez-vous vraiment retirer ce bénéficiaire de cette action?"))
            {
                return;
            }

            Champ indexBeneficiaire = ((Champ)((ComboBoxItem)lbBeneficiairesInclus.SelectedItem).Value);

            ConditionRequete cond = new ConditionRequete(Operateur.EGAL, indexBeneficiaire);

            cond.LierCondition(new ConditionRequete(Operateur.EGAL, ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value).GetChamp("actaId")), true);

            RequeteSuppression reqSup = new RequeteSuppression(NomTable.beneficiaireactionactivite, cond);

            if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0)
            {
                Journal.AfficherMessage("Une erreur est survenue lors du retirement du bénéficiaire de l'action. L'action a été annulée.", TypeMessage.ERREUR, true);
                return;
            }

            SupprimerItem(lbBeneficiairesInclus);
        }
Beispiel #22
0
 public void SetChamp(Champ champ)
 {
     m_champ = champ;
 }
Beispiel #23
0
        public override bool Enregistrer()
        {
            if (!base.Enregistrer())
            {
                return(false);
            }

            Champ dateAction = new Champ("actionactivite", "actaDate", dtpDate.Value);
            Champ nbBenevolesNonInscritsAction = new Champ("actionactivite", "actaNbBenevolesNonInscrits", nudBenevolesNonInscrits.Value);

            LigneTable ligneAction = new LigneTable("actionactivite");

            ligneAction.AjouterChamp(dateAction);
            ligneAction.AjouterChamp(nbBenevolesNonInscritsAction);

            if (Mode == ModeFormulaire.AJOUT)
            {
                RequeteAjout reqAjout = new RequeteAjout(NomTable.actionactivite, (Champ)((ComboBoxItem)cmbActivite.SelectedItem).Value, dateAction, nbBenevolesNonInscritsAction);
                int          nouvelIndex;

                if ((nouvelIndex = Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout)) < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de l'ajout de l'action. L'action a été annulée", TypeMessage.ERREUR, true);
                    return(false);
                }

                ligneAction.AjouterChamp(new Champ("actionactivite", "actaId", nouvelIndex));
            }
            else if (Mode == ModeFormulaire.EDITION)
            {
                Champ indexAction            = ((LigneTable)((ComboBoxItem)cmbAction.SelectedItem).Value).GetChamp("actaId");
                RequeteModification reqModif = new RequeteModification(NomTable.actionactivite, new ConditionRequete(Operateur.EGAL, indexAction), dateAction, nbBenevolesNonInscritsAction);

                if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de la modification de l'action. L'action a été annulée.", TypeMessage.ERREUR, true);
                    return(false);
                }

                ligneAction.AjouterChamp(indexAction);
                cmbAction.Items.Remove(cmbAction.SelectedItem);
            }

            int indexInsertion = cmbAction.Items.Count;

            for (int i = 0; i < cmbAction.Items.Count; ++i)
            {
                LigneTable action = (LigneTable)((ComboBoxItem)cmbAction.Items[i]).Value;

                if (action.GetValeurChamp <DateTime>("actaDate") <= dtpDate.Value)
                {
                    indexInsertion = i;
                    break;
                }
            }

            cmbAction.Items.Insert(indexInsertion, new ComboBoxItem(dtpDate.Value.ToLongDateString(), ligneAction));
            cmbAction.SelectedIndex = indexInsertion;

            return(true);
        }
Beispiel #24
0
    // Update is called once per frame
    void Update()
    {
        if (m_champ == null)
        {
            GameObject obj = GameObject.Find("Champ");
            if (obj != null)
            {
                m_champ = obj.GetComponent<Champ>();
            }
        }

        Warehouse.Instance.GameBestStats.SetBestStats(Warehouse.Instance.NewGameStats);
        Warehouse.Instance.NewGameStats.Update();
    }
 private static void AstralBlessing()
 {
     Console.WriteLine("Calling Astral Blessing");
     foreach (Obj_AI_Hero Champ in ObjectManager.Get <Obj_AI_Hero>())
     {
         if ((Champ != null) && (!Champ.IsDead) && (W.IsReady()) && (Champ.IsAlly) && (Champ.Health < (Champ.MaxHealth) && (Champ.IsValidTarget(W.Range))))
         {
             Console.WriteLine("Trying to cast Astral Blessing");
             W.CastOnUnit(Champ, packets);
         }
     }
 }
Beispiel #26
0
    void Update()
    {
        if (m_champ == null)
        {
            GameObject obj = GameObject.Find("Champ");
            if (obj == null)
            {
                SetActiveGUI(false);
                return;
            }

            m_champ = obj.GetComponent<Champ>();

            SetActiveGUI(true);
        }

        m_level.Text.text = m_champ.GoldLevel.ToString();

        if (m_oldMobKills != Warehouse.Instance.AlienEssence.Item.Count)
        {
            m_oldMobKills = Warehouse.Instance.AlienEssence.Item.Count;
            m_mobKills.enabled = true;
            m_mobKills.shake = 2f;
            m_mobKills.Text = Warehouse.Instance.AlienEssence.Item.Count.ToString();
        }

        //m_mobKills.Text = System.String.Format("{0}/{1:00}:{2:00}", m_champ.MobKills, Warehouse.Instance.PlayTime / 60, Warehouse.Instance.PlayTime % 60);

        if (m_oldGold != Warehouse.Instance.Gold.Item.Count)
        {
            m_oldGold = Warehouse.Instance.Gold.Item.Count;
            m_gold.enabled = true;
            m_gold.shake = 2f;
            m_gold.Text = Warehouse.Instance.Gold.Item.Count.ToString();
        }
        if (m_oldGoldMedal != Warehouse.Instance.GoldMedal.Item.Count)
        {
            m_oldGoldMedal = Warehouse.Instance.GoldMedal.Item.Count;
            m_goldMedal.enabled = true;
            m_goldMedal.shake = 2f;
            m_goldMedal.Text = Warehouse.Instance.GoldMedal.Item.Count.ToString();
        }
        if (m_oldDNA != Warehouse.Instance.WeaponDNA.Item.Count)
        {
            m_oldDNA = Warehouse.Instance.WeaponDNA.Item.Count;
            m_dna.enabled = true;
            m_dna.shake = 2f;
            m_dna.Text = Warehouse.Instance.WeaponDNA.Item.Count.ToString();
        }
        if (m_oldGem != Warehouse.Instance.Gem.Item.Count)
        {
            m_oldGem = Warehouse.Instance.Gem.Item.Count;
            m_gem.enabled = true;
            m_gem.shake = 2f;
            m_gem.Text = Warehouse.Instance.Gem.Item.Count.ToString();
        }

        foreach(YGUISystem.GUIButton button in m_specialButtons)
        {
            button.Update();
        }

        for(int i = 0; i < m_guages.Length; ++i)
        {
            if (i == 3)
            {
                m_guages[i].RectTransform.gameObject.SetActive(m_champ != null && m_champ.m_creatureProperty.Shield > 0);
            }
            m_guages[i].Update();
        }

        m_autoEarnButton.Update();
    }
Beispiel #27
0
    public void StartWave(int wave, Champ champ)
    {
        GPlusPlatform.Instance.AnalyticsTrackScreen("StartWave");

        if (m_wave == 0)
            m_wave = wave;

        Warehouse.Instance.ResetNewGameStats();

        m_dropBuffItemTime = Time.time+90f;
        m_dropShip.SetChamp(champ);
        m_dropShip.GetComponent<Animator>().SetTrigger("Move");
        StartCoroutine(spawnMobPer());

        #if UNITY_EDITOR
        if (Const.CHEAT_MODE)
        {
            champ.RemainStatPoint = 10;
        }
        #endif
    }
Beispiel #28
0
        public AntiJump()
        {
            switch (ObjectManager.Player.ChampionName)
            {
                case "Ashe":
                    Champion = new Champ(1000, SpellSlot.R, true);
                    break;

                case "Ahri":
                    Champion = new Champ(925, SpellSlot.E, true, 1500, 0.25f, 100);
                    break;

                case "Alistar":
                    Champion = new Champ(600, SpellSlot.W, false);
                    break;

                case "Anivia":
                    Champion = new Champ(1100, SpellSlot.Q, true, 850, 250, 110);
                    break;

                case "Azir":
                    Champion = new Champ(200, SpellSlot.R, true);
                    break;

                case "Blitzcrank":
                    Champion = new Champ(950, SpellSlot.Q, true, 1800, 0.25f, 70);
                    break;

                case "Braum":
                    Champion = new Champ(200, SpellSlot.R, true, 2000, 0.25f, 500);
                    break;

                case "Cassiopeia":
                    Champion = new Champ(825, SpellSlot.R, true);
                    break;

                case "Caitlyn":
                    Champion = new Champ(500, SpellSlot.E, true);
                    break;

                case "Chogath":
                    Champion = new Champ(950, SpellSlot.Q, true, 450, 0.75f, 200);
                    break;

                case "Diana":
                    Champion = new Champ(450, SpellSlot.E, true);
                    break;

                case "Draven":
                    Champion = new Champ(1000, SpellSlot.E, true, 1400, 0.28f, 90);
                    break;

                case "Elise":
                    Champion = new Champ(1075, SpellSlot.E, true, 1300, 0.25f, 55);
                    break;

                case "FiddleSticks":
                    Champion = new Champ(525, SpellSlot.Q, false);
                    break;

                case "Galio":
                    Champion = new Champ(550, SpellSlot.R, false);
                    break;

                case "Gragas":
                    Champion = new Champ(1100, SpellSlot.R, true, 1000, 0.3f, 700);
                    break;

                case "Irelia":
                    Champion = new Champ(150, SpellSlot.E, false);
                    break;

                case "Janna":
                    Champion = new Champ(675, SpellSlot.R, false);
                    break;

                case "Jax":
                    Champion = new Champ(125, SpellSlot.E, false);
                    break;

                case "Jayce":
                    Champion = new Champ(240, SpellSlot.E, false);
                    break;

                case "Jinx":
                    Champion = new Champ(900, SpellSlot.E, true, 1750, 1.2f, 300);
                    break;

                case "Leona":
                    Champion = new Champ(1200, SpellSlot.R, true, int.MaxValue, 1, 300);
                    break;

                case "LeeSin":
                    Champion = new Champ(325, SpellSlot.R, false);
                    break;

                case "Lissandra":
                    Champion = new Champ(500, SpellSlot.R, false);
                    break;

                case "Lulu":
                    Champion = new Champ(600, SpellSlot.W, false);
                    break;

                case "Lux":
                    Champion = new Champ(1175, SpellSlot.Q, true, 1200, 0.25f, 70);
                    break;

                case "Malzahar":
                    Champion = new Champ(650, SpellSlot.R, false);
                    break;

                case "Maokai":
                    Champion = new Champ(525, SpellSlot.Q, true, 1200, 0.5f, 110);
                    break;

                case "MonkeyKing":
                    Champion = new Champ(160, SpellSlot.R, false);
                    break;

                case "Nami":
                    Champion = new Champ(875, SpellSlot.Q, true, int.MaxValue, 1f, 150);
                    break;

                case "Pantheon":
                    Champion = new Champ(550, SpellSlot.W, false);
                    break;

                case "Quinn":
                    Champion = new Champ(700, SpellSlot.E, false);
                    break;

                case "Rammus":
                    Champion = new Champ(200, SpellSlot.Q, false);
                    break;

                case "Riven":
                    Champion = new Champ(260, SpellSlot.W, false);
                    break;

                case "Ryze":
                    Champion = new Champ(550, SpellSlot.W, false);
                    break;

                case "Shaco":
                    Champion = new Champ(200, SpellSlot.R, false);
                    break;

                case "Skarner":
                    Champion = new Champ(300, SpellSlot.R, false);
                    break;

                case "Singed":
                    Champion = new Champ(100, SpellSlot.E, false);
                    break;

                case "Swain":
                    Champion = new Champ(900, SpellSlot.W, true, 1250, 0.5f, 275);
                    break;

                case "Syndra":
                    Champion = new Champ(650, SpellSlot.E, true, 2500, 0.25f, 22);
                    break;

                case "Teemo":
                    Champion = new Champ(550, SpellSlot.Q, false);
                    break;

                case "Thresh":
                    Champion = new Champ(700, SpellSlot.E, true);
                    break;

                case "Tristana":
                    Champion = new Champ(500, SpellSlot.R, false);
                    break;

                case "Vayne":
                    Champion = new Champ(500, SpellSlot.E, false);
                    break;

                case "Velkoz":
                    Champion = new Champ(800, SpellSlot.E, true, 1500, 0.5f, 100);
                    break;

                case "Viktor":
                    Champion = new Champ(700, SpellSlot.W, true, int.MaxValue, 0.5f, 300);
                    break;

                case "Warwick":
                    Champion = new Champ(650, SpellSlot.R, false);
                    break;

                case "Xerath":
                    Champion = new Champ(1150, SpellSlot.E, true, 1400, 0.25f, 60);
                    break;

                case "XinZhao":
                    Champion = new Champ(150, SpellSlot.R, false);
                    break;

                case "Zac":
                    Champion = new Champ(250, SpellSlot.R, false);
                    break;

                case "Zyra":
                    Champion = new Champ(1050, SpellSlot.E, true, 1400, 0.5f, 70);
                    break;

                default:
                    return;
            }
            Obj_AI_Hero.OnPlayAnimation += Obj_AI_Hero_OnPlayAnimation;
        }
    public void OnClickStart()
    {
        Warehouse.Instance.NewGameStats.Reset();

        GameObject champObj = Creature.InstanceCreature("Pref/Champ", Resources.Load<GameObject>("Pref/mon_skin/" + RefData.Instance.RefChamp.prefBody), m_spawnChamp.position, m_spawnChamp.localRotation);
        champObj.name = "Champ";

        Champ champ = champObj.GetComponent<Champ>();
        champ.Init(RefData.Instance.RefChamp, Warehouse.Instance.GameDataContext.m_level.Value, 0);

        m_champ = champ;

        foreach(ItemObject itemWeaponObject in Warehouse.Instance.Items[ItemData.Type.Weapon])
        {
            if (itemWeaponObject.Item.Level > 0)
            {
                //if (itemWeaponObject.Item.RefItem.id != Const.ChampTapRefItemId)
                    itemWeaponObject.Item.Equip(champ);

            }

        }

        foreach(ItemObject itemStatObject in Warehouse.Instance.Items[ItemData.Type.Stat])
        {
            if (itemStatObject.Item.Level > 0)
            {
                itemStatObject.Item.Equip(m_champ);
            }
        }

        foreach(ItemObject itemStatObject in Warehouse.Instance.Items[ItemData.Type.WeaponParts])
        {
            if (itemStatObject.Item.Level > 0)
            {
                itemStatObject.Item.Equip(m_champ);
            }
        }

        m_champ.EquipActiveSkillWeapon(Warehouse.Instance.FindItem(Const.ChampTapRefItemId).Item as ItemWeaponData, new RefMob.WeaponDesc());
        m_champ.WeaponHolder.EquipActiveSkillWeapon(m_champ.instanceWeapon(new ItemWeaponData(Const.NuclearRefItemId), new RefMob.WeaponDesc()));

        m_champ.m_creatureProperty.Exp = Warehouse.Instance.GameDataContext.m_xp.Value;
        m_champ.m_creatureProperty.HP = Warehouse.Instance.GameDataContext.m_hp.Value;
        m_champ.m_creatureProperty.SP = Warehouse.Instance.GameDataContext.m_sp.Value;

        if (m_champ.m_creatureProperty.HP == 0)
        {
            m_champ.m_creatureProperty.HP = m_champ.m_creatureProperty.MaxHP;
        }

        m_generalInfoPanel.SetChamp(m_champ);
        m_spawn.StartWave(Warehouse.Instance.CurrentWaveIndex, champ);

        GPlusPlatform.Instance.AnalyticsTrackEvent("InGame", "Play", "Retry:"+Warehouse.Instance.RetryCount, 0);

        champObj.SetActive(false);

        StartCoroutine(AutoGoldUpdate());
    }
Beispiel #30
0
 public MainWindowViewModel()
 {
     Champs = Champ.GetChamps();
 }
    void Start()
    {
        m_champ = GameObject.Find("Champ").GetComponent<Champ>();
        m_statusGUI = transform.parent.parent.Find("StatusGUI").GetComponent<ChampStatusGUI>();

        List<Ability> basicAbili = new List<Ability>();
        List<Ability> skillAbili = new List<Ability>();
        List<Ability> utilAbili = new List<Ability>();

        basicAbili.Add(new Ability(0.3f, "Damage",
        ()=>{
            m_backup.AlphaPhysicalAttackDamage+=3;
            int backup = m_champ.WeaponHolder.MainWeapon.GetDamage(m_backup);

            return m_champ.WeaponHolder.MainWeapon.GetDamage(m_champ.m_creatureProperty) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaPhysicalAttackDamage+=3;
            --m_champ.RemainStatPoint;
        }));
        /*
        m_abilities.Add(new Ability(0.3f, "Inc Defence",
        ()=>{
            m_backup.AlphaPhysicalDefencePoint+=3;
            return m_champ.m_creatureProperty.PhysicalDefencePoint + " -> " + "<color=yellow>" + (m_backup.PhysicalDefencePoint) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaPhysicalDefencePoint+=3;
            --m_champ.RemainStatPoint;
        }));
        */
        basicAbili.Add(new Ability(0.3f, "Health Max Up",
        ()=>{
            m_backup.AlphaMaxHP+=50;
            return m_champ.m_creatureProperty.MaxHP + " -> " + "<color=yellow>" + (m_backup.MaxHP) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaMaxHP+=50;
            //m_champ.m_creatureProperty.Heal((int)m_champ.m_creatureProperty.MaxHP);
            --m_champ.RemainStatPoint;
        }));
        /*
        basicAbili.Add(new Ability(0.3f, "SP Max Up",
                                        ()=>{
            m_backup.AlphaMaxSP+=30;
            return m_champ.m_creatureProperty.MaxSP + " -> " + "<color=yellow>" + (m_backup.MaxSP) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaMaxSP+=30;
            --m_champ.RemainStatPoint;
        }));

        basicAbili.Add(new Ability(0.3f, "SP Recovery Up",
                                        ()=>{
            m_backup.AlphaSPRecoveryPerSec+=1;
            return m_champ.m_creatureProperty.SPRecoveryPerSec + " -> " + "<color=yellow>" + (m_backup.SPRecoveryPerSec) + "/sec</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaSPRecoveryPerSec+=1;
            --m_champ.RemainStatPoint;
        }));
        */
        basicAbili.Add(new Ability(0.3f, "Move Speed Up",
                                        ()=>{
            m_backup.AlphaMoveSpeed+=1;
            return m_champ.m_creatureProperty.AlphaMoveSpeed + " -> " + "<color=yellow>" + (m_backup.AlphaMoveSpeed) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaMoveSpeed+=1;
            --m_champ.RemainStatPoint;
        },
        ()=>{
            return m_champ.m_creatureProperty.AlphaMoveSpeed < Const.MaxAlphaMoveSpeed;
        }
        ));

        basicAbili.Add(new Ability(0.3f, "Critical Pack",
        ()=>{
            m_backup.AlphaCriticalChance += 0.1f;
            m_backup.AlphaCriticalDamage += 0.5f;
            return "Chance:"+(m_champ.m_creatureProperty.CriticalChance*100) + " -> " + "<color=yellow>" + (m_backup.CriticalChance*100) + "%</color>" + "\n" +
                "Damage:"+(m_champ.m_creatureProperty.CriticalDamage*100) + " -> " + "<color=yellow>" + (m_backup.CriticalDamage*100) + "%</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaCriticalChance += 0.1f;
            m_champ.m_creatureProperty.AlphaCriticalDamage += 0.5f;
            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampFiregunRefItemId:
                return false;
            }

            return true;
        }
        ));

        /*
        m_abilities.Add(new Ability(0.1f, "Life Per Kill",
        ()=>{
            m_backup.AlphaLifeSteal += 1f;
            return (m_champ.m_creatureProperty.LifeSteal) + " -> " + "<color=yellow>" + (m_backup.LifeSteal) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.AlphaLifeSteal += 1f;
            --m_champ.RemainStatPoint;
        }));
        */

        /*
        basicAbili.Add(new Ability(0.01f, "Weapon Lv Up",
                                    ()=>{
            Weapon weapon = m_champ.WeaponHolder.MainWeapon;
            int backup = weapon.Level+1;
            int ori = weapon.Level;
            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            m_champ.WeaponHolder.MainWeapon.LevelUp();
            --m_champ.RemainStatPoint;
        }
        ));
        */
        skillAbili.Add(new Ability(0.3f, RefData.Instance.RefTexts(RefData.Instance.RefItems[Const.EmbersRefItemId].name),
                                    ()=>{
            Weapon weapon = m_champ.WeaponHolder.MainWeapon.GetSubWeapon();
            int backup = 1;
            int ori = 0;
            if (weapon != null)
            {
                backup = weapon.Level+1;
                ori = weapon.Level;
            }

            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
                //"SP:" + Weapon.GetSP(RefData.Instance.RefItems[132], ori) + " -> " + "<color=yellow>" +Weapon.GetSP(RefData.Instance.RefItems[132], backup)+ "</color>";
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.MainWeapon.GetSubWeapon();
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.SetSubWeapon(m_champ.WeaponHolder.MainWeapon, new ItemWeaponData(Const.EmbersRefItemId), new RefMob.WeaponDesc());
            }

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampGunRefItemId:
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampFiregunRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
                return false;
            }

            Weapon weapon = m_champ.WeaponHolder.MainWeapon.GetSubWeapon();
            if (weapon != null)
            {
                if (weapon.Level >= weapon.RefWeaponItem.maxLevel)
                    return false;
            }
            return true;
        }
        ));

        foreach (DamageDesc.BuffType buffType in System.Enum.GetValues(typeof(DamageDesc.BuffType)))
        {
            bool skip = false;
            switch(buffType)
            {
            case DamageDesc.BuffType.Count:
            case DamageDesc.BuffType.LevelUp:
            case DamageDesc.BuffType.Nothing:
            case DamageDesc.BuffType.Macho:
                skip = true;
                break;
            }

            if (skip == true)
                continue;

            string name = buffType.ToString() + " Chance";
            DamageDesc.BuffType capturedBuffType = buffType;

            utilAbili.Add(new Ability(0.3f, name,
                                        ()=>{
                float oriChance = m_champ.WeaponHolder.MainWeapon.WeaponStat.buffOnHitDesc.chance;
                float toChance = oriChance + 0.1f;
                return (oriChance*100) + " -> " + "<color=yellow>" + (toChance*100) + "%</color>";
            },
            ()=>{
                m_champ.WeaponHolder.MainWeapon.WeaponStat.buffOnHitDesc.chance += 0.1f;
                --m_champ.RemainStatPoint;
            },
            ()=>{

                return (m_champ.WeaponHolder.MainWeapon.WeaponStat.buffOnHitDesc.buffType == capturedBuffType &&
                        m_champ.WeaponHolder.MainWeapon.WeaponStat.buffOnHitDesc.chance < 100
                        );
            }
            ));
        }

        /*
        skillAbili.Add(new Ability(0.3f, "Fill " + (m_champ.WeaponHolder.MainWeapon.WeaponStat.skillId > 0 ? RefData.Instance.RefTexts(RefData.Instance.RefItems[m_champ.WeaponHolder.MainWeapon.WeaponStat.skillId].name) : ""),
                                   ()=>{
            int backup = m_champ.NuclearSkillStack+3;
            return (m_champ.NuclearSkillStack) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            m_champ.NuclearSkillStack += 3;
            --m_champ.RemainStatPoint;
        },
        ()=>{
            return m_champ.WeaponHolder.MainWeapon.WeaponStat.skillId > 0;
        }
        ));

        skillAbili.Add(new Ability(0.3f, "Fill Macho Skill",
                                   ()=>{
            int backup = m_champ.MachoSkillStack+3;
            return (m_champ.MachoSkillStack) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            m_champ.MachoSkillStack += 3;
            --m_champ.RemainStatPoint;
        }));
        */
        skillAbili.Add(new Ability(0.3f, RefData.Instance.RefTexts(RefData.Instance.RefItems[131].name),
                                    ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(131);
            int backup = 1;
            int ori = 0;
            if (weapon != null)
            {
                backup = weapon.Level+1;
                ori = weapon.Level;
            }

            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
                //"SP:" + Weapon.GetSP(RefData.Instance.RefItems[131], ori) + " -> " + "<color=yellow>" +Weapon.GetSP(RefData.Instance.RefItems[131], backup)+ "</color>";
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(131);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.EquipPassiveSkillWeapon(new ItemWeaponData(131), null);
            }

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampGunRefItemId:
                Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(131);
                if (weapon != null)
                {
                    if (weapon.Level >= weapon.RefWeaponItem.maxLevel)
                        return false;
                }
                return true;
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampFiregunRefItemId:
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
                break;
            }

            return false;
        }
        ));

        skillAbili.Add(new Ability(0.3f, RefData.Instance.RefTexts(RefData.Instance.RefItems[134].name),
                                   ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(134);
            int backup = 1;
            int ori = 0;
            if (weapon != null)
            {
                backup = weapon.Level+1;
                ori = weapon.Level;
            }

            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(134);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.EquipPassiveSkillWeapon(new ItemWeaponData(134), null);
            }

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampBoomerangLauncherRefItemId:
                Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(134);
                if (weapon != null)
                {
                    if (weapon.Level >= weapon.RefWeaponItem.maxLevel)
                        return false;
                }
                return true;
            case Const.ChampGunRefItemId:
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampFiregunRefItemId:
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
                break;
            }

            return false;
        }
        ));

        skillAbili.Add(new Ability(0.3f, RefData.Instance.RefTexts(RefData.Instance.RefItems[129].name),
                                   ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(129);
            int backup = 1;
            int ori = 0;
            if (weapon != null)
            {
                backup = weapon.Level+1;
                ori = weapon.Level;
            }

            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
                //"SP:" + Weapon.GetSP(RefData.Instance.RefItems[129], ori) + " -> " + "<color=yellow>" +Weapon.GetSP(RefData.Instance.RefItems[129], backup)+ "</color>";
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(129);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.EquipPassiveSkillWeapon(new ItemWeaponData(129), null);
            }

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampLightningLauncherRefItemId:
                Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(129);
                if (weapon != null)
                {
                    if (weapon.Level >= weapon.RefWeaponItem.maxLevel)
                        return false;
                }
                return true;
            case Const.ChampFiregunRefItemId:
            case Const.ChampGunRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
                break;
            }

            return false;
        }
        ));

        skillAbili.Add(new Ability(0.3f, RefData.Instance.RefTexts(RefData.Instance.RefItems[135].name),
                                   ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(135);
            int backup = 1;
            int ori = 0;
            if (weapon != null)
            {
                backup = weapon.Level+1;
                ori = weapon.Level;
            }

            return "Lv:" + (ori) + " -> " + "<color=yellow>" + (backup) + "</color>";
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(135);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.EquipPassiveSkillWeapon(new ItemWeaponData(135), null);
            }

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampFiregunRefItemId:

                Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(135);
                if (weapon != null)
                {
                    if (weapon.Level >= weapon.RefWeaponItem.maxLevel)
                        return false;
                }
                return true;
            case Const.ChampGunRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
                return false;
            }

            return false;

        }
        ));
        /*
        skillAbili.Add(new Ability(0.3f, "Charge to Nuclear Skill",
                                   ()=>{
            return (m_champ.NuclearSkillStack) + " -> " + "<color=yellow>" + (m_champ.NuclearSkillStack+1) + "</color>" + "\n" +
                    "SP:" + Weapon.GetSP(RefData.Instance.RefItems[133], 1);
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetActiveWeapon(133);
            if (weapon != null)
            {
                //weapon.LevelUp();
            }
            else
            {
                m_champ.EquipActiveWeapon(new ItemWeaponData(133, null));
            }
            ++m_champ.NuclearSkillStack;
            --m_champ.RemainStatPoint;
        }));
        */
        skillAbili.Add(new Ability(0.3f, "Fill " + RefData.Instance.RefItems[130].name,
                                   ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(130);
            m_backup.Shield += 10;
            return (m_champ.m_creatureProperty.Shield) + " -> " + "<color=yellow>" + (m_backup.Shield) + "</color>";
                //"SP:" + Weapon.GetSP(RefData.Instance.RefItems[130], 1);
        },
        ()=>{
            Weapon weapon = m_champ.WeaponHolder.GetPassiveSkillWeapon(130);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                m_champ.EquipPassiveSkillWeapon(new ItemWeaponData(130), null);
            }

            --m_champ.RemainStatPoint;
        }));

        utilAbili.Add(new Ability(0.3f, "Splash Radius",
                                  ()=>{

            m_backup.SplashRadius+=1;

            return (m_champ.m_creatureProperty.SplashRadius) + " -> " + "<color=yellow>" + (m_backup.SplashRadius) + "m</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.SplashRadius+=1;

            --m_champ.RemainStatPoint;
        },
        ()=>{
            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampFiregunRefItemId:
            case Const.ChampGunRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
                return false;
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
                return true;
            }

            return false;
        }
        ));

        utilAbili.Add(new Ability(0.3f, "Flamethrower Length",
                                  ()=>{

            m_backup.BulletAlphaLength+=0.25f;

            return (m_champ.m_creatureProperty.BulletLength) + " -> " + "<color=yellow>" + (m_backup.BulletLength) + "m</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.BulletAlphaLength+=0.25f;

            --m_champ.RemainStatPoint;
        },
        ()=>{
            if (m_champ.m_creatureProperty.BulletLength >= 1f)
                return false;

            switch(m_champ.WeaponHolder.MainWeapon.RefWeaponItem.id)
            {
            case Const.ChampFiregunRefItemId:
                return true;
            case Const.ChampLightningLauncherRefItemId:
            case Const.ChampGunRefItemId:
            case Const.ChampBoomerangLauncherRefItemId:
            case Const.ChampGuidedRocketLauncherRefItemId:
            case Const.ChampRocketLauncherRefItemId:
                return false;
            }

            return false;
        }
        ));

        utilAbili.Add(new Ability(0.3f, "Followers On Summoning",
                                  ()=>{

            m_backup.CallableFollowers+=1;

            return (m_champ.m_creatureProperty.CallableFollowers) + " -> " + "<color=yellow>" + (m_backup.CallableFollowers) + "</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.CallableFollowers+=1;

            --m_champ.RemainStatPoint;
        },
        ()=>{
            for(int i = 0; i < m_champ.AccessoryItems.Length; ++i)
            {
                if (m_champ.AccessoryItems[i] != null &&
                    m_champ.AccessoryItems[i].Item.RefItem.type == ItemData.Type.Follower &&
                    m_champ.m_creatureProperty.CallableFollowers < Const.MaxCallableFollowers
                    )
                    return true;
            }
            return false;
        }
        ));

        utilAbili.Add(new Ability(0.3f, "Gain Extra XP",
                                  ()=>{
            m_backup.GainExtraExp += 0.5f;
            return (m_champ.m_creatureProperty.GainExtraExp*100) + " -> " + "<color=yellow>" + (m_backup.GainExtraExp*100) + "%</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.GainExtraExp += 0.5f;
            --m_champ.RemainStatPoint;
        }));

        utilAbili.Add(new Ability(0.3f, "Gain Extra Gold",
                                  ()=>{
            m_backup.GainExtraGold += 0.5f;
            return (m_champ.m_creatureProperty.GainExtraGold*100) + " -> " + "<color=yellow>" + (m_backup.GainExtraGold*100) + "%</color>";
        },
        ()=>{
            m_champ.m_creatureProperty.GainExtraGold += 0.5f;
            --m_champ.RemainStatPoint;
        }));

        m_abilities.Add(AbilityCategory.ChampStat, basicAbili);
        m_abilities.Add(AbilityCategory.Skill, skillAbili);
        m_abilities.Add(AbilityCategory.Weapon, utilAbili);

        for(int i = 0; i < m_statButtons.Length; ++i)
            m_statButtons[i] = new YGUISystem.GUIButton(transform.Find("StatButton"+i).gameObject, ()=>{return true;});

        m_remainPointText = new YGUISystem.GUILable(transform.Find("Text/RemainPointText").gameObject);

        m_rollButton = new YGUISystem.GUIPriceButton(transform.Find("RollingButton").gameObject, Const.StartPosYOfPriceButtonImage, ()=>{
            return m_champ.RemainStatPoint > 0;
        });
        m_rollButton.Prices = RefData.Instance.RefItems[Const.RandomAbilityRefItemId].levelup.conds;

        transform.Find("RollingButton").gameObject.SetActive(Cheat.EnableAbilityRollButton);
        #if UNITY_EDITOR
        if (Const.CHEAT_MODE)
        {
            transform.Find("RollingButton").gameObject.SetActive(true);
        }
        #endif

        RandomAbility(!AutoAssigned);

        AutoAssignedAbillity();
    }
Beispiel #32
0
        public override bool Enregistrer()
        {
            Global.BaseDonneesCABS.CommencerTransaction();

            if (!base.Enregistrer() || !ValiderDonnees())
            {
                Global.BaseDonneesCABS.AnnulerTransaction();
                return(false);
            }

            Champ indexPersonne = null;

            if (PersonneCourante != null)
            {
                indexPersonne = PersonneCourante.GetChamp("perId");
            }

            LigneTable adresseModifiee = null;

            if (Mode == ModeFormulaire.AJOUT)
            {
                LigneTable nouvellePersonne = CreerNouvellePersonne();
                nouvellePersonne.AjouterChamp("perDateOuverture", DateTime.Now);

                RequeteSelection reqSelNom = new RequeteSelection(NomTable.personne, "perId");
                reqSelNom.Condition = new ConditionRequete(Operateur.EGAL, "perNom", nouvellePersonne.GetChamp("perNom").ValeurSQL);
                reqSelNom.Condition.LierCondition(new ConditionRequete(Operateur.EGAL, "perPrenom", nouvellePersonne.GetChamp("perPrenom").ValeurSQL), true);

                if (!Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelNom).EstVide&& !OutilsForms.PoserQuestion("Confirmation d'ajout", "Une autre personne porte les mêmes nom et prénom. Voulez-vous quand même ajouter celle-ci?"))
                {
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }

                if (StatutActif == null)
                {
                    Journal.AfficherMessage("La table des statuts est inexistante ou corrompue. L'action a été annulée.", TypeMessage.ERREUR, true);
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }

                nouvellePersonne.AjouterChamp(StatutActif);

                RequeteAjout reqAjout            = new RequeteAjout(NomTable.personne, nouvellePersonne);
                int          nouvelIndexPersonne = Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout);

                if (nouvelIndexPersonne == -1)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de l'ajout de la personne dans la base de données. L'action a été annulée.", TypeMessage.ERREUR, true);
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }

                indexPersonne = new Champ("Personne", "perId", nouvelIndexPersonne);
                nouvellePersonne.AjouterChamp(indexPersonne);
                PersonneCourante = nouvellePersonne;

                adresseModifiee = GetAdresseModifiee(PersonneCourante, new LigneTable("Personne"));
            }
            else if (Mode == ModeFormulaire.EDITION)
            {
                LigneTable personneModifiee = CreerNouvellePersonne();
                personneModifiee.AjouterChamp(PersonneCourante.GetChamp("staId"));

                RequeteModification reqModif = new RequeteModification(NomTable.personne, new ConditionRequete(Operateur.EGAL, indexPersonne), personneModifiee);
                int lignesModifiees          = Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif);

                if (lignesModifiees < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de la modification de la personne. L'action a été annulée.", TypeMessage.ERREUR, true);
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }

                RequeteSuppression reqSup = new RequeteSuppression(NomTable.languepersonne, new ConditionRequete(Operateur.EGAL, indexPersonne));

                if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de la suppression des langues parlées de la personne. L'action a été annulée.", TypeMessage.ERREUR, true);
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }

                personneModifiee.AjouterChamp(indexPersonne);
                PersonneCourante = personneModifiee;

                adresseModifiee = GetAdresseModifiee(PersonneCourante, personneModifiee);
            }

            if (IndexPersonneCouple != 0 && adresseModifiee != null &&
                OutilsForms.PoserQuestion("Modification adresse conjoint(e)", "Voulez-vous modifier l'adresse du conjoint(e) pour celle de la personne courante?"))
            {
                RequeteModification reqModif = new RequeteModification(NomTable.personne, new ConditionRequete(Operateur.EGAL, new Champ("Personne", "perId", IndexPersonneCouple)), adresseModifiee);
                int lignesModifiees          = Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif);

                if (lignesModifiees < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de la modification de l'adresse du conjoint(e). L'action a été annulée.", TypeMessage.ERREUR, true);
                }
            }

            if (!MettreAJourTypesPersonne(indexPersonne))
            {
                Journal.AfficherMessage("Une erreur est survenue lors de la mise à jour des types de la personne dans la base de données. L'action a été annulée.", TypeMessage.ERREUR, true);
                Global.BaseDonneesCABS.AnnulerTransaction();
                return(false);
            }

            foreach (ComboBoxItem langue in chklbLangues.CheckedItems)
            {
                Champ idLangue = new Champ("Langue", "lanId", langue.Value);

                RequeteAjout reqAjout = new RequeteAjout(NomTable.languepersonne, indexPersonne, idLangue);

                if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0)
                {
                    Journal.AfficherMessage("Une erreur est survenue lors de l'ajout d'une langue parlée dans la base de données. L'action a été annulée.", TypeMessage.ERREUR, true);
                    Global.BaseDonneesCABS.AnnulerTransaction();
                    return(false);
                }
            }

            if (AncienIndexPersonneCouple != IndexPersonneCouple)
            {
                Champ premier  = new Champ("Couple", "perIdPremier", indexPersonne.Valeur);
                Champ deuxieme = new Champ("Couple", "perIdDeuxieme", IndexPersonneCouple);

                ConditionRequete condCouple = new ConditionRequete(Operateur.EGAL, "perIdPremier", indexPersonne.ValeurSQL);
                condCouple.LierCondition(new ConditionRequete(Operateur.EGAL, "perIdDeuxieme", indexPersonne.ValeurSQL), false);

                if (AncienIndexPersonneCouple == 0)
                {
                    RequeteAjout reqAjout = new RequeteAjout(NomTable.couple, premier, deuxieme);
                    if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0)
                    {
                        Journal.AfficherMessage("Une erreur est survenue lors de l'ajout du couple de la personne. L'action a été annulée.", TypeMessage.ERREUR, true);
                        Global.BaseDonneesCABS.AnnulerTransaction();
                        return(false);
                    }
                }
                else if (IndexPersonneCouple == 0)
                {
                    RequeteSuppression reqSup = new RequeteSuppression(NomTable.couple, condCouple);
                    if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSup) < 0)
                    {
                        Journal.AfficherMessage("Une erreur est survenue lors de la suppression du couple de la personne. L'action a été annulée.", TypeMessage.ERREUR, true);
                        Global.BaseDonneesCABS.AnnulerTransaction();
                        return(false);
                    }
                }
                else
                {
                    RequeteModification reqModif = new RequeteModification(NomTable.couple, condCouple, premier, deuxieme);
                    if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) < 0)
                    {
                        Journal.AfficherMessage("Une erreur est survenue lors de la modification du couple de la personne. L'action a été annulée.", TypeMessage.ERREUR, true);
                        Global.BaseDonneesCABS.AnnulerTransaction();
                        return(false);
                    }
                }
            }

            Global.BaseDonneesCABS.ConfirmerTransaction();
            return(true);
        }
Beispiel #33
0
        private bool MettreAJourTypesPersonne(Champ indexPersonne)
        {
            LigneTable typePersonne = new LigneTable("");

            typePersonne.AjouterChamp(indexPersonne);

            RequeteSelection reqSelBeneficiaire = new RequeteSelection(NomTable.beneficiaire);

            reqSelBeneficiaire.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table beneficiaire = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelBeneficiaire);

            if (beneficiaire.EstVide && cbBeneficiaire.Checked)
            {
                RequeteAjout reqAjoutBeneficiaire = new RequeteAjout(NomTable.beneficiaire, typePersonne);
                if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjoutBeneficiaire) < 0)
                {
                    return(false);
                }
            }
            else if (!beneficiaire.EstVide && !cbBeneficiaire.Checked)
            {
                RequeteSuppression reqSupBeneficiaire = new RequeteSuppression(NomTable.beneficiaire, new ConditionRequete(Operateur.EGAL, indexPersonne));
                if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSupBeneficiaire) < 0)
                {
                    return(false);
                }
            }

            RequeteSelection reqSelEmploye = new RequeteSelection(NomTable.employe);

            reqSelEmploye.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table employe = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelEmploye);

            if (employe.EstVide && cbEmploye.Checked)
            {
                RequeteAjout reqAjoutEmploye = new RequeteAjout(NomTable.employe, typePersonne);
                if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjoutEmploye) < 0)
                {
                    return(false);
                }
            }
            else if (!employe.EstVide && !cbEmploye.Checked)
            {
                RequeteSuppression reqSupEmploye = new RequeteSuppression(NomTable.employe, new ConditionRequete(Operateur.EGAL, indexPersonne));
                if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSupEmploye) < 0)
                {
                    return(false);
                }
            }

            RequeteSelection reqSelBenevole = new RequeteSelection(NomTable.benevole);

            reqSelBenevole.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table benevole = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelBenevole);

            if (cbBenevole.Checked)
            {
                int temp;
                if (Int32.TryParse(txtNoCarte.Text, out temp))
                {
                    typePersonne.AjouterChamp("benvNoCarte", temp);
                }

                typePersonne.AjouterChamp("benvEnProbation", cbEnProbation.Checked);

                if (cbEnProbation.Checked)
                {
                    typePersonne.AjouterChamp("benvDebutProbation", dtpDebutProbation.Value.ToShortDateString());
                    typePersonne.AjouterChamp("benvFinProbation", dtpFinProbation.Value.ToShortDateString());
                }
                else
                {
                    typePersonne.AjouterChamp("benvDebutProbation", DBNull.Value);
                    typePersonne.AjouterChamp("benvFinProbation", DBNull.Value);
                }

                if (benevole.EstVide)
                {
                    RequeteAjout reqAjoutBenevole = new RequeteAjout(NomTable.benevole, typePersonne);
                    if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjoutBenevole) < 0)
                    {
                        return(false);
                    }
                }
                else
                {
                    RequeteModification reqModifBenevole = new RequeteModification(NomTable.benevole, new ConditionRequete(Operateur.EGAL, indexPersonne), typePersonne);
                    if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModifBenevole) < 0)
                    {
                        return(false);
                    }
                }
            }
            else if (!benevole.EstVide)
            {
                RequeteSuppression reqSupBenevole = new RequeteSuppression(NomTable.benevole, new ConditionRequete(Operateur.EGAL, indexPersonne));
                if (Global.BaseDonneesCABS.EnvoyerRequeteSuppression(reqSupBenevole) < 0)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #34
0
        public override bool Enregistrer()
        {
            if (!base.Enregistrer())
            {
                return(false);
            }

            if (!ValiderDonnees())
            {
                return(false);
            }

            List <DateTime> datesAAjouter  = new List <DateTime>();
            List <DateTime> datesAModifier = new List <DateTime>();

            foreach (DateTime date in GetDatesConsiderees())
            {
                if (GetIndexLivraisonExistante(date) < 0)
                {
                    datesAAjouter.Add(date);
                }
                else
                {
                    datesAModifier.Add(date);
                }
            }

            Champ champId        = new Champ("livraisonpopoteroulante", "perId", BeneficiaireCourant.GetValeurChamp <int>("perId"));
            Champ champNbRepas   = new Champ("livraisonpopoteroulante", "lprNombreRepas", (int)nudNombreRepas.Value);
            Champ champPrixRepas = new Champ("livraisonpopoteroulante", "lprPrixRepas", nudPrixRepas.Value);

            LigneTable livraison = new LigneTable("livraisonpopoteroulante");

            livraison.AjouterChamp(champId);
            livraison.AjouterChamp(champNbRepas);
            livraison.AjouterChamp(champPrixRepas);

            bool erreur = false;

            foreach (DateTime date in datesAAjouter)
            {
                LigneTable copieLivraison = new LigneTable(livraison);
                copieLivraison.AjouterChamp(new Champ("livraisonpopoteroulante", "lprDate", date));

                RequeteAjout reqAjout = new RequeteAjout(NomTable.livraisonpopoteroulante, copieLivraison);

                if (Global.BaseDonneesCABS.EnvoyerRequeteAjout(reqAjout) < 0)
                {
                    erreur = true;
                }
                else
                {
                    Livraisons.Lignes.Add(copieLivraison);
                    AjouterLivraisonCalendrier(date);
                }
            }

            ConditionRequete    cond     = new ConditionRequete(Operateur.EGAL, champId);
            RequeteModification reqModif = new RequeteModification(NomTable.livraisonpopoteroulante, cond, champNbRepas, champPrixRepas);

            foreach (DateTime date in datesAModifier)
            {
                ConditionRequete copieCond = new ConditionRequete(cond);
                copieCond.LierCondition(new ConditionRequete(Operateur.EGAL, new Champ("livraisonpopoteroulante", "lprDate", date)), true);

                reqModif.Condition = copieCond;

                if (Global.BaseDonneesCABS.EnvoyerRequeteModification(reqModif) < 0)
                {
                    erreur = true;
                }
                else
                {
                    int indexLivraisonAModifier = GetIndexLivraisonExistante(date);

                    if (indexLivraisonAModifier >= 0)
                    {
                        LigneTable copieLivraison = new LigneTable(livraison);
                        copieLivraison.AjouterChamp(new Champ("livraisonpopoteroulante", "lprDate", date));
                        Livraisons.Lignes[indexLivraisonAModifier] = copieLivraison;
                    }
                }
            }

            if (erreur)
            {
                Journal.AfficherMessage("Une erreur est survenue lors de la modification d'une ou plusieurs livraisons.", TypeMessage.ERREUR, true);
            }

            return(true);
        }
 private static void Wish()
 {
     Console.WriteLine("Calling Wish");
     foreach (Obj_AI_Hero Champ in ObjectManager.Get <Obj_AI_Hero>())
     {
         if ((Champ != null) && (!Champ.IsDead) && (R.IsReady()) && (Champ.IsAlly) && (Champ.Health <= (Champ.MaxHealth * 0.30)) && (Champ.IsValidTarget(R.Range)))
         {
             R.Cast(null, packets);
         }
     }
 }
        public static void SeedDatabase(IServiceProvider serviceProvider)
        {
            var scopeFactory = serviceProvider.GetRequiredService <IServiceScopeFactory>();

            using (var scope = scopeFactory.CreateScope())
            {
                var dbContext = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>();

                if (dbContext.Champ.SingleOrDefault(season => season.SeasonNum == 0) != null)
                {
                    return;
                }

                dbContext.Champ.Add(new Champ
                {
                    SeasonNum = 0
                });

                dbContext.SaveChanges();

                Champ champ = dbContext.Champ.Single(season => season.SeasonNum == 0);

                dbContext.Team.Add(new Team
                {
                    ChampID  = champ.ID,
                    Nickname = "I Rossoneri",
                    TeamName = "AC Milan"
                });

                dbContext.Team.Add(new Team
                {
                    ChampID  = champ.ID,
                    Nickname = "I nerazzurri",
                    TeamName = "FC Internazionale"
                });

                dbContext.Team.Add(new Team
                {
                    ChampID  = champ.ID,
                    Nickname = "I granata",
                    TeamName = "Torino FC"
                });

                dbContext.SaveChanges();

                Team Milan  = dbContext.Team.Single(team => team.TeamName == "AC Milan");
                Team Inter  = dbContext.Team.Single(team => team.TeamName == "FC Internazionale");
                Team Torino = dbContext.Team.Single(team => team.TeamName == "Torino FC");

                dbContext.Player.Add(new Player
                {
                    TeamID   = Milan.ID,
                    Name     = "Mateo Musacchio",
                    Birthday = GetDays(1990, 8, 26)
                });

                dbContext.Player.Add(new Player
                {
                    TeamID   = Milan.ID,
                    Name     = "Patrick Cutrone",
                    Birthday = GetDays(1998, 1, 3)
                });

                dbContext.Player.Add(new Player
                {
                    TeamID   = Inter.ID,
                    Name     = "Yuto Nagatomo",
                    Birthday = GetDays(1986, 9, 12)
                });

                dbContext.Player.Add(new Player
                {
                    TeamID   = Inter.ID,
                    Name     = "Ivan Perisic",
                    Birthday = GetDays(1989, 2, 2)
                });

                dbContext.Player.Add(new Player
                {
                    TeamID   = Torino.ID,
                    Name     = "Antonio Barreca",
                    Birthday = GetDays(1995, 3, 18)
                });

                dbContext.Player.Add(new Player
                {
                    TeamID   = Torino.ID,
                    Name     = "Andrea Belotti",
                    Birthday = GetDays(1993, 12, 20)
                });

                dbContext.SaveChanges();
            }
        }
Beispiel #37
0
        public AntiJump()
        {
            switch (ObjectManager.Player.ChampionName)
            {
                case "Ashe":
                    Champion = new Champ(1000, SpellSlot.R, true);
                    break;

                case "Ahri":
                    Champion = new Champ(925, SpellSlot.E, true, 1500, 0.25f, 100);
                    break;

                case "Alistar":
                    Champion = new Champ(600, SpellSlot.W, false);
                    break;

                case "Azir":
                    Champion = new Champ(250, SpellSlot.R, true);
                    break;

                case "Cassiopeia":
                    Champion = new Champ(825, SpellSlot.R, true);
                    break;

                case "Draven":
                    Champion = new Champ(1000, SpellSlot.E, true);
                    break;

                case "FiddleSticks":
                    Champion = new Champ(525, SpellSlot.Q, false);
                    break;

                case "LeeSin":
                    Champion = new Champ(325, SpellSlot.R, false);
                    break;

                case "Maokai":
                    Champion = new Champ(525, SpellSlot.Q, true);
                    break;

                case "Syndra":
                    Champion = new Champ(650, SpellSlot.E, true);
                    break;

                case "Thresh":
                    Champion = new Champ(700, SpellSlot.E, true);
                    break;

                case "Tristana":
                    Champion = new Champ(500, SpellSlot.R, false);
                    break;

                case "Quinn":
                    Champion = new Champ(700, SpellSlot.E, false);
                    break;

                case "Vayne":
                    Champion = new Champ(500, SpellSlot.E, false);
                    break;

                default:
                    return;
            }
            Obj_AI_Hero.OnPlayAnimation += Obj_AI_Hero_OnPlayAnimation;
        }
Beispiel #38
0
        private void ChargerDonneesPersonneCourante()
        {
            Champ indexPersonne = PersonneCourante.GetChamp("perId");

            lblDateDerniereMajValeur.Text = PersonneCourante.GetValeurChamp <DateTime>("perDateDerniereMaj").ToShortDateString();

            RequeteSelection reqSelStatut = new RequeteSelection(NomTable.statut, "staNom");

            reqSelStatut.Condition = new ConditionRequete(Operateur.EGAL, PersonneCourante.GetChamp("staId"));

            RequeteSelection reqSelBeneficiaire = new RequeteSelection(NomTable.beneficiaire);

            reqSelBeneficiaire.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table statut = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelStatut);

            lblStatutValeur.Text = !statut.EstVide ? statut.Lignes[0].GetValeurChamp <string>("staNom") : "";

            Table beneficiaire = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelBeneficiaire);

            cbBeneficiaire.Checked = !beneficiaire.EstVide;

            RequeteSelection reqSelBenevole = new RequeteSelection(NomTable.benevole);

            reqSelBenevole.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table benevole = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelBenevole);

            cbBenevole.Checked = !benevole.EstVide;

            if (cbBenevole.Checked)
            {
                LigneTable infosBenevole = benevole.Lignes[0];

                txtNoCarte.Text       = infosBenevole.GetValeurChamp <int>("benvNoCarte").ToString();
                cbEnProbation.Checked = infosBenevole.GetValeurChamp <bool>("benvEnProbation");

                if (cbEnProbation.Checked)
                {
                    dtpDebutProbation.Value = infosBenevole.GetValeurChamp <DateTime>("benvDebutProbation");
                    dtpFinProbation.Value   = infosBenevole.GetValeurChamp <DateTime>("benvFinProbation");
                }
                else
                {
                    dtpDebutProbation.Value = dtpFinProbation.Value = DateTime.Today;
                }
            }

            RequeteSelection reqSelEmploye = new RequeteSelection(NomTable.employe);

            reqSelEmploye.Condition = new ConditionRequete(Operateur.EGAL, indexPersonne);

            Table employe = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSelEmploye);

            cbEmploye.Checked = !employe.EstVide;

            AncienIndexPersonneCouple = 0;
            ViderDonneesCouple();
            Table couple = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("Couple", "SELECT p.* FROM Personne p INNER JOIN Couple c ON p.perId = c.perIdDeuxieme WHERE c.perIdPremier = " + indexPersonne.Valeur + ";");

            if (!couple.EstVide)
            {
                AncienIndexPersonneCouple = couple.Lignes[0].GetValeurChamp <int>("perId");
                RemplirDonneesCouple(couple.Lignes[0]);
            }
            else
            {
                couple = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("Couple", "SELECT p.* FROM Personne p INNER JOIN Couple c ON p.perId = c.perIdPremier WHERE c.perIdDeuxieme = " + indexPersonne.Valeur + ";");

                if (!couple.EstVide)
                {
                    AncienIndexPersonneCouple = couple.Lignes[0].GetValeurChamp <int>("perId");
                    RemplirDonneesCouple(couple.Lignes[0]);
                }
            }

            txtNom.Text          = PersonneCourante.GetValeurChamp <string>("perNom");
            txtPrenom.Text       = PersonneCourante.GetValeurChamp <string>("perPrenom");
            txtCourriel.Text     = PersonneCourante.GetValeurChamp <string>("perCourriel");
            mtxtTelephone1.Text  = PersonneCourante.GetValeurChamp <string>("perTelephone1");
            mtxtTelephone2.Text  = PersonneCourante.GetValeurChamp <string>("perTelephone2");
            mtxtTelephone3.Text  = PersonneCourante.GetValeurChamp <string>("perTelephone3");
            txtCommentaires.Text = PersonneCourante.GetValeurChamp <string>("perCommentaires");

            if (PersonneCourante.GetValeurChamp <bool>("perSexe"))
            {
                rbSexeF.Checked = true;
            }
            else
            {
                rbSexeM.Checked = true;
            }

            if (PersonneCourante.GetValeurChamp <bool>("perFumeur"))
            {
                rbFumeurOui.Checked = true;
            }
            else
            {
                rbFumeurNon.Checked = true;
            }

            foreach (ComboBoxItem etat in cmbEtatCivil.Items)
            {
                if (((int)etat.Value) == PersonneCourante.GetValeurChamp <int>("etaId"))
                {
                    cmbEtatCivil.SelectedItem = etat;
                    break;
                }
            }

            if (cbEchoBenevole.Checked = PersonneCourante.GetValeurChamp <bool>("perInfoCAB"))
            {
                cbParCourriel.Checked = PersonneCourante.GetValeurChamp <bool>("perInfoCABCourriel");
            }

            dtpDateNaissance.Value = PersonneCourante.GetValeurChamp <DateTime>("perDateNaissance");

            foreach (int indexLangue in chklbLangues.CheckedIndices)
            {
                chklbLangues.SetItemChecked(indexLangue, false);
            }

            RequeteSelection reqSel = new RequeteSelection(NomTable.languepersonne);

            reqSel.Condition = new ConditionRequete(Operateur.EGAL, PersonneCourante.GetChamp("perId"));

            Table langues = Global.BaseDonneesCABS.EnvoyerRequeteSelection(reqSel);

            foreach (LigneTable langue in langues.Lignes)
            {
                for (int i = 0; i < chklbLangues.Items.Count; ++i)
                {
                    if (((int)(chklbLangues.Items[i] as ComboBoxItem).Value) == langue.GetValeurChamp <int>("lanId"))
                    {
                        chklbLangues.SetItemChecked(i, true);
                    }
                }
            }

            lbServicesInscrits.Items.Clear();
            Services = Global.BaseDonneesCABS.EnvoyerRequeteSelectionDirect("Service", String.Format(FORMAT_REQ_SERVICES, indexPersonne.ValeurSQL));
            Services.Lignes.ForEach(l => lbServicesInscrits.Items.Add(l.GetValeurChamp <string>("serNom")));

            RemplirDonneesAdresse(PersonneCourante);
        }