private void UpdateCountsAndExport(PokeTradeDetail <PB8> poke, PB8 received, PB8 toSend) { var counts = TradeSettings; if (poke.Type == PokeTradeType.Random) { counts.AddCompletedDistribution(); } else if (poke.Type == PokeTradeType.Clone) { counts.AddCompletedClones(); } else { counts.AddCompletedTrade(); } if (DumpSetting.Dump && !string.IsNullOrEmpty(DumpSetting.DumpFolder)) { var subfolder = poke.Type.ToString().ToLower(); DumpPokemon(DumpSetting.DumpFolder, subfolder, received); // received by bot if (poke.Type is PokeTradeType.Specific or PokeTradeType.Clone) { DumpPokemon(DumpSetting.DumpFolder, "traded", toSend); // sent to partner } } }
private void SaveMisc8(PB8 pk8) { pk8.StatNature = WinFormsUtil.GetIndex(CB_StatNature); pk8.DynamaxLevel = (byte)Math.Max(0, Stats.CB_DynamaxLevel.SelectedIndex); pk8.CanGigantamax = Stats.CHK_Gigantamax.Checked; pk8.HT_Language = WinFormsUtil.GetIndex(CB_HTLanguage); pk8.BattleVersion = WinFormsUtil.GetIndex(CB_BattleVersion); }
private void LoadMisc8(PB8 pk8) { CB_StatNature.SelectedValue = pk8.StatNature; Stats.CB_DynamaxLevel.SelectedIndex = pk8.DynamaxLevel; Stats.CHK_Gigantamax.Checked = pk8.CanGigantamax; CB_HTLanguage.SelectedValue = pk8.HT_Language; TB_HomeTracker.Text = pk8.Tracker.ToString("X16"); CB_BattleVersion.SelectedValue = pk8.BattleVersion; }
public static void CanLearnEggMoveBDSP(Species species, Move move) { MoveEgg.GetEggMoves(8, (int)species, 0, GameVersion.BD).Contains((int)move).Should().BeFalse(); var pb8 = new PB8 { Species = (int)species }; var encs = EncounterMovesetGenerator.GenerateEncounters(pb8, new[] { (int)move }, GameVersion.BD); encs.Any().Should().BeFalse("Unavailable until HOME update supports BD/SP."); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); PB1.Hide(); PB2.Hide(); PB3.Hide(); PB4.Hide(); PB5.Hide(); PB6.Hide(); PB7.Hide(); PB8.Hide(); PB9.Hide(); PB10.Hide(); PB11.Hide(); PB12.Hide(); ALbl.Hide(); BLbl.Hide(); CLbl.Hide(); DLbl.Hide(); ELbl.Hide(); FLbl.Hide(); GLbl.Hide(); HLbl.Hide(); ILbl.Hide(); JLbl.Hide(); KLbl.Hide(); LLbl.Hide(); consigneRep_Lbl.Show(); lettre1Lbl.Show(); lettre1TB.Show(); lettre2Lbl.Show(); lettre2TB.Show(); lettre3Lbl.Show(); lettre3TB.Show(); ValiderBtn.Show(); }
private void Perception_Load(object sender, EventArgs e) { //exo.deserialiserPerception(); string message = "Le but de cet exercice est de mémoriser des formes colorées dans un ensemble de formes ainsi que les chiffres qu'elles contiennent afin de les retranscrire. Le temps d'affichage des formes est limité, mais pas le temps de réponse."; MessageBox.Show(message, "Consigne de l'exercice"); if (exo.difficulte == 0) { timer1.Interval = 4000; } else if (exo.difficulte == 1) { timer1.Interval = 2000; } //Sélection de la consigne c = rnd.Next(0, 3); EnonceLbl.ResetText(); EnonceLbl.Visible = false; EnonceLbl.Text = consigne[c]; EnonceLbl.Visible = true; //Affichage des images fig = rnd.Next(0, 9); PB1.ImageLocation = imagesExo[3][fig]; PB1.Show(); reponses[0] = fig; fig = rnd.Next(0, 9); PB2.ImageLocation = imagesExo[0][fig]; PB2.Show(); reponses[1] = fig; fig = rnd.Next(0, 9); PB3.ImageLocation = imagesExo[2][fig]; PB3.Show(); reponses[2] = fig; fig = rnd.Next(0, 9); PB4.ImageLocation = imagesExo[1][fig]; PB4.Show(); reponses[3] = fig; fig = rnd.Next(0, 9); PB5.ImageLocation = imagesExo[3][fig]; PB5.Show(); reponses[4] = fig; fig = rnd.Next(0, 9); PB6.ImageLocation = imagesExo[1][fig]; PB6.Show(); reponses[5] = fig; fig = rnd.Next(0, 9); PB7.ImageLocation = imagesExo[2][fig]; PB7.Show(); reponses[6] = fig; fig = rnd.Next(0, 9); PB8.ImageLocation = imagesExo[0][fig]; PB8.Show(); reponses[7] = fig; fig = rnd.Next(0, 9); PB9.ImageLocation = imagesExo[3][fig]; PB9.Show(); reponses[8] = fig; fig = rnd.Next(0, 9); PB10.ImageLocation = imagesExo[2][fig]; PB10.Show(); reponses[9] = fig; fig = rnd.Next(0, 9); PB11.ImageLocation = imagesExo[1][fig]; PB11.Show(); reponses[10] = fig; fig = rnd.Next(0, 9); PB12.ImageLocation = imagesExo[0][fig]; PB12.Show(); reponses[11] = fig; if (c == 0) { lettre1Lbl.Text = alphabet[1]; lettre2Lbl.Text = alphabet[7]; lettre3Lbl.Text = alphabet[11]; bonneRep[0] = reponses[1]; bonneRep[1] = reponses[7]; bonneRep[2] = reponses[11]; } if (c == 1) { lettre1Lbl.Text = alphabet[3]; lettre2Lbl.Text = alphabet[5]; lettre3Lbl.Text = alphabet[10]; bonneRep[0] = reponses[3]; bonneRep[1] = reponses[5]; bonneRep[2] = reponses[10]; } if (c == 2) { lettre1Lbl.Text = alphabet[2]; lettre2Lbl.Text = alphabet[6]; lettre3Lbl.Text = alphabet[9]; bonneRep[0] = reponses[2]; bonneRep[1] = reponses[6]; bonneRep[2] = reponses[9]; } if (c == 3) { lettre1Lbl.Text = alphabet[0]; lettre2Lbl.Text = alphabet[4]; lettre3Lbl.Text = alphabet[8]; bonneRep[0] = reponses[0]; bonneRep[1] = reponses[4]; bonneRep[2] = reponses[8]; } timer1.Start(); }
private void ValiderBtn_Click(object sender, EventArgs e) { if (cpt < 9) { if (lettre1TB.Text != "") { if (lettre2TB.Text != "") { if (lettre3TB.Text != "") { cpt++; repUser[0] = int.Parse(lettre1TB.Text); repUser[1] = int.Parse(lettre2TB.Text); repUser[2] = int.Parse(lettre3TB.Text); score = exo.calculeScore(repUser, bonneRep); consigneRep_Lbl.Hide(); lettre1Lbl.Hide(); lettre1TB.Hide(); lettre2Lbl.Hide(); lettre2TB.Hide(); lettre3Lbl.Hide(); lettre3TB.Hide(); ValiderBtn.Hide(); lettre1Lbl.Text = ""; lettre2Lbl.Text = ""; lettre3Lbl.Text = ""; lettre1TB.Text = ""; lettre2TB.Text = ""; lettre3TB.Text = ""; c = rnd.Next(0, 3); EnonceLbl.ResetText(); EnonceLbl.Visible = false; EnonceLbl.Text = consigne[c]; EnonceLbl.Visible = true; fig = rnd.Next(0, 9); PB1.ImageLocation = imagesExo[3][fig]; PB1.Show(); reponses[0] = fig; fig = rnd.Next(0, 9); PB2.ImageLocation = imagesExo[0][fig]; PB2.Show(); reponses[1] = fig; fig = rnd.Next(0, 9); PB3.ImageLocation = imagesExo[2][fig]; PB3.Show(); reponses[2] = fig; fig = rnd.Next(0, 9); PB4.ImageLocation = imagesExo[1][fig]; PB4.Show(); reponses[3] = fig; fig = rnd.Next(0, 9); PB5.ImageLocation = imagesExo[3][fig]; PB5.Show(); reponses[4] = fig; fig = rnd.Next(0, 9); PB6.ImageLocation = imagesExo[1][fig]; PB6.Show(); reponses[5] = fig; fig = rnd.Next(0, 9); PB7.ImageLocation = imagesExo[2][fig]; PB7.Show(); reponses[6] = fig; fig = rnd.Next(0, 9); PB8.ImageLocation = imagesExo[0][fig]; PB8.Show(); reponses[7] = fig; fig = rnd.Next(0, 9); PB9.ImageLocation = imagesExo[3][fig]; PB9.Show(); reponses[8] = fig; fig = rnd.Next(0, 9); PB10.ImageLocation = imagesExo[2][fig]; PB10.Show(); reponses[9] = fig; fig = rnd.Next(0, 9); PB11.ImageLocation = imagesExo[1][fig]; PB11.Show(); reponses[10] = fig; fig = rnd.Next(0, 9); PB12.ImageLocation = imagesExo[0][fig]; PB12.Show(); reponses[11] = fig; if (c == 0) { lettre1Lbl.Text = alphabet[1]; lettre2Lbl.Text = alphabet[7]; lettre3Lbl.Text = alphabet[11]; bonneRep[0] = reponses[1]; bonneRep[1] = reponses[7]; bonneRep[2] = reponses[11]; } if (c == 1) { lettre1Lbl.Text = alphabet[3]; lettre2Lbl.Text = alphabet[5]; lettre3Lbl.Text = alphabet[10]; bonneRep[0] = reponses[3]; bonneRep[1] = reponses[5]; bonneRep[2] = reponses[10]; } if (c == 2) { lettre1Lbl.Text = alphabet[2]; lettre2Lbl.Text = alphabet[6]; lettre3Lbl.Text = alphabet[9]; bonneRep[0] = reponses[2]; bonneRep[1] = reponses[6]; bonneRep[2] = reponses[9]; } if (c == 3) { lettre1Lbl.Text = alphabet[0]; lettre2Lbl.Text = alphabet[4]; lettre3Lbl.Text = alphabet[8]; bonneRep[0] = reponses[0]; bonneRep[1] = reponses[4]; bonneRep[2] = reponses[8]; } PB1.Show(); PB2.Show(); PB3.Show(); PB4.Show(); PB5.Show(); PB6.Show(); PB7.Show(); PB8.Show(); PB9.Show(); PB10.Show(); PB11.Show(); PB12.Show(); ALbl.Show(); BLbl.Show(); CLbl.Show(); DLbl.Show(); ELbl.Show(); FLbl.Show(); GLbl.Show(); HLbl.Show(); ILbl.Show(); JLbl.Show(); KLbl.Show(); LLbl.Show(); timer1.Start(); } else { string message = "Veuillez remplir tous les champs !"; MessageBox.Show(message, "Erreur"); } } else { string message = "Veuillez remplir tous les champs !"; MessageBox.Show(message, "Erreur"); } } else { string message = "Veuillez remplir tous les champs !"; MessageBox.Show(message, "Erreur"); } } else { score = (score / 30) * 100; string message = "Vous avez " + score + "% de bonnes réponses !"; MessageBox.Show(message, "Score"); this.Close(); } }
protected virtual async Task <(PB8 toSend, PokeTradeResult check)> GetEntityToSend(SAV8BS sav, PokeTradeDetail <PB8> poke, PB8 offered, PB8 toSend, PartnerDataHolder partnerID, CancellationToken token) { return(poke.Type switch { PokeTradeType.Random => await HandleRandomLedy(sav, poke, offered, toSend, partnerID, token).ConfigureAwait(false), PokeTradeType.Clone => await HandleClone(sav, poke, offered, token).ConfigureAwait(false), _ => (toSend, PokeTradeResult.Success), });