From 5d676e7e1c91e649450ea73a324da19e11ad7b34 Mon Sep 17 00:00:00 2001 From: Megan Edwards Date: Mon, 30 Oct 2023 03:18:09 -0400 Subject: [PATCH] Grab bag of unstaged changes --- library/Structures/Pokemon4.cs | 5 +++ library/Support/ValidationSummary.cs | 3 ++ library/Wfc/GtsRecordBase.cs | 7 ++++ pokedex/Shiny lock generations.txt | 31 +++++++++++++++ web/Default.aspx | 16 ++------ web/Default.aspx.designer.cs | 57 ++++------------------------ web/gts/Pokemon.aspx | 5 +++ web/gts/Pokemon.aspx.cs | 1 + web/gts/Pokemon.aspx.designer.cs | 9 +++++ 9 files changed, 71 insertions(+), 63 deletions(-) create mode 100644 pokedex/Shiny lock generations.txt diff --git a/library/Structures/Pokemon4.cs b/library/Structures/Pokemon4.cs index ccdce6e5..8dfe9afb 100644 --- a/library/Structures/Pokemon4.cs +++ b/library/Structures/Pokemon4.cs @@ -333,6 +333,11 @@ namespace PkmnFoundations.Structures { return new ValidationSummary() { IsValid = false }; // form not in pokedex } + // todo: Hardcoded checks don't belong here, but in the database. + // We need a Form.Generation and Form.CompatibleGeneration field + // to denote which generation a form was introduced in, and which + // generation it's broadly compatible with for trading. + //if (thePokemon.Form.CompatibleGeneration > Generations.Generation4) return new ValidationSummary() { IsValid = false }; if (thePokemon.SpeciesID == 479 && thePokemon.FormID != 0) return new ValidationSummary() { IsValid = false }; // rotoms if (thePokemon.SpeciesID == 487 && thePokemon.FormID != 0) return new ValidationSummary() { IsValid = false }; // origin giratina if (thePokemon.SpeciesID == 492 && thePokemon.FormID != 0) return new ValidationSummary() { IsValid = false }; // sky shaymin diff --git a/library/Support/ValidationSummary.cs b/library/Support/ValidationSummary.cs index 3fb6e4df..a4810379 100644 --- a/library/Support/ValidationSummary.cs +++ b/library/Support/ValidationSummary.cs @@ -8,5 +8,8 @@ namespace PkmnFoundations.Support public struct ValidationSummary { public bool IsValid { get; set; } + + // todo: Put reasons validation failed here, such as out-of-range values, bad egg, EVs > 510, etc. + // public bool TooMuchEvs {get; set;} } } diff --git a/library/Wfc/GtsRecordBase.cs b/library/Wfc/GtsRecordBase.cs index 55fc3d18..42998e85 100644 --- a/library/Wfc/GtsRecordBase.cs +++ b/library/Wfc/GtsRecordBase.cs @@ -110,6 +110,13 @@ namespace PkmnFoundations.Wfc ValidationSummary summary = Pokemon.Validate(); if (!summary.IsValid) return false; + // pkhex check: + // https://github.com/mm201/pkmn-classic-framework/pull/71 + //var decrypted = PKX.DecryptArray45(DataActual); + //var la = new LegalityAnalysis(decrypted); + //report = la.Report(); + //if (report != "Legal!") return false; + return true; } diff --git a/pokedex/Shiny lock generations.txt b/pokedex/Shiny lock generations.txt new file mode 100644 index 00000000..2ec3adec --- /dev/null +++ b/pokedex/Shiny lock generations.txt @@ -0,0 +1,31 @@ +NatDex Name No ribbon including Wiimmfi events No ribbon full legal Any including ribbons +251 Celebi 7 7 7 +493 Arceus 4 8 6 +494 Victini x x x +643 Reshiram 6 6 6 +644 Zekrom 6 6 6 +647 Keldeo x x x +648 Meloetta x x x +649 Genesect x x 5 +716 Xerneas 7 7 6 +717 Yveltal 7 7 6 +718 Zygarde 8 8 7 +719 Diancie x x 6 +720 Hoopa x x x +721 Volcanion x x x +785 Tapu Koko 8 8 7 +786 Tapu Lele 8 8 7 +787 Tapu Bulu 8 8 7 +788 Tapu Fini 8 8 7 +789 Cosmog x x x +790 Cosmoem x x x +791 Solgaleo 8 8 7 +792 Lunala 8 8 7 +800 Necrozma 8 8 7 +801 Magearna x x 8 +802 Marshadow x x x +807 Zeraora x x 8 + +Cap pikas other than Partner Cap are shiny locked. +Ash Greninja is shiny locked. +Event Vivillons are shiny locked until Fancy in SV. diff --git a/web/Default.aspx b/web/Default.aspx index 515a5d14..a8979782 100644 --- a/web/Default.aspx +++ b/web/Default.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="Poké Classic Network" Language="C#" MasterPageFile="~/masters/ThreeColumn.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PkmnFoundations.GTS.Default" %> +<%@ Page Title="Poké Classic Network" Language="C#" MasterPageFile="~/masters/MasterPage.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PkmnFoundations.GTS.Default" %> <%@ Register TagPrefix="pf" Namespace="PkmnFoundations.Web" Assembly="PkmnFoundations.Web" %> <%@ Register TagPrefix="pf" TagName="LabelTextBox" Src="~/controls/LabelTextBox.ascx" %> <%@ Register TagPrefix="pf" TagName="DnsAddress" Src="~/controls/DnsAddress.ascx" %> @@ -7,9 +7,7 @@ - - - +<%--   @@ -26,15 +24,7 @@ - - - -
- - -
- -
+ %--%> diff --git a/web/Default.aspx.designer.cs b/web/Default.aspx.designer.cs index 1be1745a..3d21ac9d 100644 --- a/web/Default.aspx.designer.cs +++ b/web/Default.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace PkmnFoundations.GTS { - - - public partial class Default { - +namespace PkmnFoundations.GTS +{ + + + public partial class Default + { + /// /// HeaderColour1 control. /// @@ -20,50 +22,5 @@ namespace PkmnFoundations.GTS { /// To modify move field declaration from designer file to code-behind file. /// protected global::PkmnFoundations.Web.HeaderColour HeaderColour1; - - /// - /// theForm control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm theForm; - - /// - /// txtUsername control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::PkmnFoundations.GTS.controls.LabelTextBox txtUsername; - - /// - /// txtPassword control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::PkmnFoundations.GTS.controls.LabelTextBox txtPassword; - - /// - /// btnSubmit control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnSubmit; - - /// - /// hlRegister control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HyperLink hlRegister; } } diff --git a/web/gts/Pokemon.aspx b/web/gts/Pokemon.aspx index 1ef4ceeb..bf322b9b 100644 --- a/web/gts/Pokemon.aspx +++ b/web/gts/Pokemon.aspx @@ -119,6 +119,11 @@ + + Hax check + + + diff --git a/web/gts/Pokemon.aspx.cs b/web/gts/Pokemon.aspx.cs index 2188df4e..88efbccf 100644 --- a/web/gts/Pokemon.aspx.cs +++ b/web/gts/Pokemon.aspx.cs @@ -139,6 +139,7 @@ namespace PkmnFoundations.Web.gts litNature.Text = pkmn.Nature.ToString(); // todo: i18n litAbility.Text = pkmn.Ability == null ? "" : pkmn.Ability.Name.ToString(); litVersion.Text = pkmn.Version.ToString(); + litHaxCheck.Text = pkmn.Validate().IsValid ? "Pass" : "Fail"; // xxx: loop litHpCurr.Text = pkmn.HP.ToString(); diff --git a/web/gts/Pokemon.aspx.designer.cs b/web/gts/Pokemon.aspx.designer.cs index 0bc898d7..22555a91 100644 --- a/web/gts/Pokemon.aspx.designer.cs +++ b/web/gts/Pokemon.aspx.designer.cs @@ -248,6 +248,15 @@ namespace PkmnFoundations.Web.gts /// protected global::System.Web.UI.WebControls.Literal litVersion; + /// + /// litHaxCheck control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litHaxCheck; + /// /// litHpIv control. ///