Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split up and normalize monster_type_line #57

Open
kevinlul opened this issue Jul 18, 2023 · 4 comments
Open

Split up and normalize monster_type_line #57

kevinlul opened this issue Jul 18, 2023 · 4 comments

Comments

@kevinlul
Copy link
Contributor

monster_type_line should be broken up into an array of tokens kept in the same order.

monster_type_line as it currently exists, obtained from Yugipedia, has the following limitations:

  • Old monsters with abilities (e.g. Spirit) are missing the modern "Effect" at the end;
  • Old Tuners lack Normal or Effect classification;
  • Old Normal monsters lack the modern "Normal" at the end;

This is because the string as it exists on Yugipedia reflects the latest available physical print of the card (confirmed with admin). Normalization involves obtaining data from the official database, which has the modern representation regardless of recent prints, or a heuristic (PowerShell snippet from @NeilBeforeMemes):

            $types = $content.monster_type_line.Split(" / ")

            if($types.length -eq 1) {
                $types += "Normal"
            }

            if(($types[$types.length - 1] -eq "Sprit") -or 
                ($types[$types.length - 1] -eq "Gemini") -or 
                ($types[$types.length - 1] -eq "Toon") -or 
                ($types[$types.length - 1] -eq "Union") -or 
                ($types[$types.length - 1] -eq "Flip")) {
                $types += "Effect"
            }

            if($types[$types.length - 1] -eq "Tuner") {
                if(($data.name -eq "Water Spirit") -or
                ($data.name -eq "Dragon Core Hexer") -or
                ($data.name -eq "Angel Trumpeter") -or
                ($data.name -eq "Tune Warrior")) {
                    $types += "Normal"
                }
                else {
                    $types += "Effect"
                }
            }

This would fix DawnbrandBots/bastion-bot#174. Inferring the OCG "Special Summon" type (DawnbrandBots/bastion-bot#134) could also be done as part of the data here. This would help native language support for advanced queries (DawnbrandBots/bastion-bot#343) as the translations of these card properties can be added in the load step.

@NeilBeforeMemes
Copy link

just a note here as a heads up! You also need to check for pendulum along with the abilities! We had an issue come up because I forgot this one haha

@kevinlul
Copy link
Contributor Author

there's also a typo in "Spirit" in the snippet that I pasted verbatim

@kevinlul
Copy link
Contributor Author

Most of this seems no longer applicable due to https://yugipedia.com/wiki/Template:Unprinted_erratum being applied to affected cards.

@kevinlul
Copy link
Contributor Author

Gishki Natalia and Emilia are still affected, but now there's precedent to simply apply the edits to the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants