diff --git a/.github/workflows/docker-compose-complete.yml b/.github/workflows/docker-compose-complete.yml new file mode 100644 index 0000000..135c486 --- /dev/null +++ b/.github/workflows/docker-compose-complete.yml @@ -0,0 +1,18 @@ +name: Complete Docker Compose of App + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker-compose build diff --git a/.gitignore b/.gitignore index d9a11e4..53e2c27 100644 --- a/.gitignore +++ b/.gitignore @@ -402,3 +402,7 @@ server/venv/ .DS_Store server/egglocke/db.sqlite3 + +server/server-venv/ + +*.sqlite3 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7619707 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + pkhex: + build: ./pkhex + container_name: pkhex_container + hostname: pkhex_host + ports: + - "1234:1234" + networks: + app_network: + + server: + build: ./server + container_name: server_container + hostname: server_host + ports: + - "8443:8443" + networks: + app_network: + +networks: + app_network: + driver: bridge + diff --git a/pkhex/dockerfile b/pkhex/dockerfile index 13bc053..2e929b9 100644 --- a/pkhex/dockerfile +++ b/pkhex/dockerfile @@ -9,7 +9,6 @@ WORKDIR /source # copy pkhex-egglocke folder to the container COPY pkhex-egglocke . - # Install pkhex dependency RUN dotnet restore pkhex-egglocke @@ -24,4 +23,4 @@ ENV PORT 1234 EXPOSE 1234 WORKDIR /source/pkhex-egglocke -ENTRYPOINT ["dotnet", "run"] \ No newline at end of file +ENTRYPOINT ["dotnet", "run", "-api"] \ No newline at end of file diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/EggCreatorTests.cs b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/EggCreatorTests.cs index 82ba435..7bc0c87 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/EggCreatorTests.cs +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/EggCreatorTests.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using PKHeX.Core; namespace pkhexEgglockeTests { diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/SaveWriterTest.cs b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/SaveWriterTest.cs index 78b79ee..59fda37 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/SaveWriterTest.cs +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/SaveWriterTest.cs @@ -1,3 +1,4 @@ +using PKHeX.Core; using pkhexEgglocke; using System.Reflection; @@ -60,6 +61,60 @@ public void TestMassAddWorks() } + [TestMethod] + public void TestNaturesSetCorrectifNotShiny() + { + SaveWriter sw = new SaveWriter(testConstants.JOHTO_PLUS_SOUL_SILVER_SAVE); + + EggCreator ec = EggCreator.decodeJSON(testConstants.BLANK_GEN4_MAREEP_VALID, true); + + sw.addEgg(ec, 1); + + // get egg at box index 1 + IList boxData = sw.getBox(); + + Nature expectedNature = Nature.Adamant; + + Assert.AreEqual(expectedNature, boxData[1].Nature); + + } + + [TestMethod] + public void TestNaturesSetCorrectifShiny() + { + SaveWriter sw = new SaveWriter(testConstants.JOHTO_PLUS_SOUL_SILVER_SAVE); + + EggCreator ec = EggCreator.decodeJSON(testConstants.BLANK_GEN4_SHINY_MAREEP_VALID, true); + + sw.addEgg(ec, 1); + + // get egg at box index 1 + IList boxData = sw.getBox(); + + Nature expectedNature = Nature.Adamant; + + Assert.AreEqual(expectedNature, boxData[1].Nature); + + } + + [TestMethod] + public void TestShinyCorrect() + { + SaveWriter sw = new SaveWriter(testConstants.JOHTO_PLUS_SOUL_SILVER_SAVE); + + EggCreator ec = EggCreator.decodeJSON(testConstants.BLANK_GEN4_SHINY_MAREEP_VALID, true); + + sw.addEgg(ec, 1); + + // get egg at box index 1 + IList boxData = sw.getBox(); + + bool isShiny = boxData[1].IsShiny; + + Assert.IsTrue(isShiny); + + } + } } \ No newline at end of file diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/pkhexEgglockeTests.csproj b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/pkhexEgglockeTests.csproj index 71b3f02..2f389bf 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/pkhexEgglockeTests.csproj +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/pkhexEgglockeTests.csproj @@ -16,6 +16,7 @@ + @@ -26,10 +27,6 @@ - - - - Always @@ -37,6 +34,9 @@ Always + + Always + Always diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testConstants.cs b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testConstants.cs index d6a1cfa..659f9d3 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testConstants.cs +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testConstants.cs @@ -16,7 +16,7 @@ public static class testConstants // Gen 4 - Egg JSONs public static string BLANK_GEN4_MAREEP_VALID => Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"testSources"), "Mareep.json"); public static string BLANK_GEN4_LEGENDARY_TRIO => Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"testSources"), "LegendaryTrio.json"); - + public static string BLANK_GEN4_SHINY_MAREEP_VALID => Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"testSources"), "MareepShiny.json"); // Gen 6 - Omega Ruby Save File public static string BLANK_OMEGARUBY_SAVE => Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"testSources"), "emptyOmegaRuby.sav"); diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/LegendaryTrio.json b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/LegendaryTrio.json index b17a451..0ca5c31 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/LegendaryTrio.json +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/LegendaryTrio.json @@ -1,47 +1,50 @@ [ - { - "dexNumber": 483, - "ball": 2, - "language": 1, - "ability": 28, - "nature": 1, - "OT": "Dawn", - "OTGender": 1, - "nickname": "Dialga", - "IV": [ 31, 31, 31, 31, 31, 31 ], - "EV": [ 0, 0, 0, 0, 0, 0 ], - "moves": [ 425, 262 ], - "movespp": [ 30, 40 ] - - }, - { - "dexNumber": 484, - "ball": 2, - "language": 1, - "ability": 30, - "nature": 1, - "OT": "Dawn", - "OTGender": 1, - "nickname": "Palkia", - "IV": [ 31, 31, 31, 31, 31, 31 ], - "EV": [ 0, 0, 0, 0, 0, 0 ], - "moves": [ 425, 262 ], - "movespp": [ 30, 40 ] - - }, - { - "dexNumber": 487, - "ball": 2, - "language": 1, - "ability": 5, - "nature": 1, - "OT": "Dawn", - "OTGender": 1, - "nickname": "Giratina", - "IV": [ 31, 31, 31, 31, 31, 31 ], - "EV": [ 0, 0, 0, 0, 0, 0 ], - "moves": [ 425, 262 ], - "movespp": [ 30, 40 ] - - } + { + "dexNumber": 483, + "ball": 2, + "language": 1, + "ability": 28, + "nature": 3, + "heldItem": 135, + "OT": "Dawn", + "OTGender": 1, + "nickname": "Dialga", + "IV": [ 31, 31, 31, 31, 31, 31 ], + "EV": [ 252, 252, 0, 0, 0, 0 ], + "moves": [ 425, 262 ], + "movespp": [ 30, 40 ], + "isShiny": true + }, + { + "dexNumber": 484, + "ball": 2, + "language": 1, + "ability": 28, + "nature": 3, + "heldItem": 135, + "OT": "Dawn", + "OTGender": 1, + "nickname": "Palkia", + "IV": [ 31, 31, 31, 31, 31, 31 ], + "EV": [ 252, 252, 0, 0, 0, 0 ], + "moves": [ 425, 262 ], + "movespp": [ 30, 40 ], + "isShiny": true + }, + { + "dexNumber": 487, + "ball": 2, + "language": 1, + "ability": 28, + "nature": 3, + "heldItem": 135, + "OT": "Dawn", + "OTGender": 1, + "nickname": "Giratina", + "IV": [ 31, 31, 31, 31, 31, 31 ], + "EV": [ 252, 252, 0, 0, 0, 0 ], + "moves": [ 425, 262 ], + "movespp": [ 30, 40 ], + "isShiny": true + } ] \ No newline at end of file diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/Mareep.json b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/Mareep.json index 7500fb5..9594ba2 100644 --- a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/Mareep.json +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/Mareep.json @@ -1,15 +1,16 @@ { - "dexNumber": 179, - "ball": 2, - "language": 1, - "ability":9, - "nature": 1, - "OT": "Dawn", - "OTGender": 1, - "nickname": "WLW", - "IV": [ 31, 31, 31, 31, 31, 31 ], - "EV": [ 0, 0, 0, 0, 0, 0 ], - "moves": [ 425, 262 ], - "movespp": [ 30, 40 ] - + "dexNumber": 179, + "ball": 2, + "language": 1, + "ability": 99, + "nature": 3, + "OT": "Red", + "OTGender": 1, + "nickname": "sheepy2", + "IV": [ 31, 31, 31, 31, 31, 31 ], + "EV": [ 252, 252, 0, 0, 0, 0 ], + "moves": [ 344, 1, 124, 26 ], + "movespp": [ 0, 0, 0, 0 ], + "heldItem": 135, + "isShiny": false } \ No newline at end of file diff --git a/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/MareepShiny.json b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/MareepShiny.json new file mode 100644 index 0000000..70fa354 --- /dev/null +++ b/pkhex/pkhex-egglocke-tests/pkhex-egglocke-tests/testSources/MareepShiny.json @@ -0,0 +1,16 @@ +{ + "dexNumber": 179, + "ball": 2, + "language": 1, + "ability": 99, + "nature": 3, + "OT": "Red", + "OTGender": 1, + "nickname": "sheepy2", + "IV": [ 31, 31, 31, 31, 31, 31 ], + "EV": [ 252, 252, 0, 0, 0, 0 ], + "moves": [ 344, 1, 124, 26 ], + "movespp": [ 0, 0, 0, 0 ], + "heldItem": 135, + "isShiny": true +} \ No newline at end of file diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/EggCreator.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/EggCreator.cs index 862b450..6dae9be 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/EggCreator.cs +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/EggCreator.cs @@ -24,6 +24,7 @@ namespace pkhexEgglocke internal class EggCreator { + // TODO: refactor to get/set protected bool allowUserIVs => true; protected bool allowUserShiny => true; @@ -45,7 +46,7 @@ internal class EggCreator public int Language = 1; public int Ability = 2; public Nature Nature = Nature.Adamant; - + public int heldItem = 0; //Misc creator stuff @@ -56,11 +57,13 @@ internal class EggCreator public int[] IV = [31, 31, 31, 31, 31, 31]; public int[] EV = [0, 0, 0, 0, 0, 0]; - public ushort [] moves = {425, 262}; + public ushort [] moves = {425, 262 }; public ushort[] movespp = { 30, 40 }; + public bool isShiny = true; + - public EggCreator(byte ball, ushort dexNumber, int language, int ability, Nature Nature, string OT, byte OTGender, string nickname, int[] IV, int[] EV, ushort[] moves, ushort[] movespp) { + public EggCreator(byte ball, ushort dexNumber, int language, int ability, Nature Nature, string OT, byte OTGender, string nickname, int[] IV, int[] EV, ushort[] moves, ushort[] movespp, int HeldItem, bool isShiny) { this.ball = ball; this.dexNumber = dexNumber; @@ -74,6 +77,8 @@ public EggCreator(byte ball, ushort dexNumber, int language, int ability, Nature this.EV = EV; this.moves = moves; this.movespp = movespp; + this.heldItem = HeldItem; + this.isShiny = isShiny; } @@ -85,6 +90,9 @@ public static EggCreator decodeJSON(string filepath, bool is_filepath) { /// /// + Console.WriteLine("filepath: "); + Console.WriteLine(filepath); + string json; if (is_filepath) { @@ -94,42 +102,70 @@ public static EggCreator decodeJSON(string filepath, bool is_filepath) { json = filepath; } - + dynamic newObject = JsonConvert.DeserializeObject(json); - Nature nature = lookupNatureInt((int) newObject.nature.Value); + Console.WriteLine("Successfully deserialized JSON!"); + + + Console.WriteLine("Nature: "); + Console.WriteLine((byte) newObject.nature.Value); + + Nature nature = natureEnumGrab((byte) newObject.nature.Value); + + Console.WriteLine(nature); int[] IV = newObject.IV.ToObject(); int[] EV = newObject.EV.ToObject(); int[] moves = newObject.moves.ToObject(); int[] movespp = newObject.movespp.ToObject(); + bool isShiny = newObject.isShiny; + + + byte ball = (byte) newObject.ball; + ushort dexNumber = (ushort) newObject.dexNumber; + int language = (int) newObject.language; + int ability = (int) newObject.ability; + int heldItem = (int) newObject.heldItem; + + string OT = newObject.OT; + byte OTGender = (byte) newObject.OTGender; + string nickname = newObject.nickname; + + // Print EggCreator args + return new EggCreator( - newObject.ball, - newObject.dexNumber, - newObject.language, - newObject.ability, + ball, + dexNumber, + language, + ability, nature, - newObject.OT, - newObject.OTGender, - newObject.nickname, + OT, + OTGender, + nickname, IV, EV, convertIntArrayViaCast(moves), - convertIntArrayViaCast(movespp) + convertIntArrayViaCast(movespp), + heldItem, + isShiny ); } - public static Nature lookupNatureInt(int nature) + public static Nature natureEnumGrab(byte value) { - if (nature == 1) { - return Nature.Adamant; + if (Enum.IsDefined(typeof(Nature), value)) + { + return (Nature)value; + } + else + { + throw new ArgumentOutOfRangeException(nameof(value), "Value is out of range for the Nature enum."); } - - return Nature.Bashful; } public static ushort[] convertIntArrayViaCast(int[] array) diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPModels.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPModels.cs index 7ae0686..f10f591 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPModels.cs +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPModels.cs @@ -11,5 +11,7 @@ public class SaveFileGeneratorModel public int generation { get; set; } = 4; public string jsonRaw { get; set; } = ""; public dynamic[] eggs { get; set; } =Array.Empty(); + public uint gamecode { get; set; } = 0; + } } diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPRoutes.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPRoutes.cs index da278ec..ff4c27e 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPRoutes.cs +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/HTTPRoutes.cs @@ -28,7 +28,7 @@ public async Task StartFile(IHttpContext context) [RestRoute("Get", "/api/file1")] public async Task DownloadFile(IHttpContext context) { - string filePath = "C:\\Users\\Evin Jaff\\Downloads\\Pokemon.mp3"; + string filePath = @"support/Pokemon.mp3"; context.Response.ContentType = "audio/mpeg"; context.Response.AddHeader("Content-Disposition", "attachment; filename=blank.mp3"); @@ -38,14 +38,34 @@ public async Task DownloadFile(IHttpContext context) } - [RestRoute("Post", "/api/buildSaveFile")] + public string getGameSavPath(uint gamecode) { + + switch (gamecode) + { + case 8: + return @"support/Complete_SoulSilver.sav"; + case 10: + return @"support/Blank_Diamond.sav"; + case 11: + return @"support/Blank_Pearl.sav"; + case 12: + return @"support/Blank_Platinum.sav"; + + default: + throw new Exception("Invalid game code"); + } + } + + [RestRoute("POST", "/api/buildSaveFile")] public async Task BuildSaveFile(IHttpContext context) { // Decode the input stream var model = await DeserializeAsync(context.Request.InputStream, context.CancellationToken); + string gamePath = getGameSavPath(model.gamecode); + // yields array of dynamic objects - SaveWriter sw = new SaveWriter("C:\\Users\\Evin Jaff\\Downloads\\Blank_SoulSilver.sav"); + SaveWriter sw = new SaveWriter(gamePath); EggCreator[] eggArray = new EggCreator[model.eggs.Length]; for (int i = 0; i < model.eggs.Length; i++) { diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/PokemonPorter.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/PokemonPorter.cs new file mode 100644 index 0000000..1d5d47e --- /dev/null +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/PokemonPorter.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace pkhex_egglocke +{ + internal class PokemonPorter + { + } +} diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/Program.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/Program.cs index 70d2115..f2f048e 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/Program.cs +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/Program.cs @@ -14,24 +14,68 @@ class Program { public static void Main(string[] args) { - RestServerBuilder restServerBuilder = RestServerBuilder.UseDefaults(); + // See if there is an -api flag in the args + // If there is, start the API server + // If not, start the CLI + if (args.Length == 0) + { + Console.WriteLine("No mode set, provide one of the following flags: -api, -cli"); - + args = new string[] { Console.ReadLine() }; + } + // host on - // Spin up the REST server - using (var server = RestServerBuilder.UseDefaults().Build()) + // + if (args.Length > 0 && args[0] == "-api") { - server.Start(); + Console.WriteLine("Starting API server"); + + RestServerBuilder restServerBuilder = RestServerBuilder.UseDefaults(); + + // host on 0.0.0.0 + // Spin up the REST server + using (var server = RestServerBuilder.UseDefaults().Build()) + { + server.Prefixes.Add("http://*:1234/"); - Console.WriteLine("Press enter to stop the server"); - Console.ReadLine(); + server.Start(); - // block the main thread forever - while (true) { } + Console.WriteLine("Press enter to stop the server"); + Console.ReadLine(); + + // block the main thread forever + while (true) { } + + } } + else + { + Console.WriteLine("Starting CLI"); + + + // yields array of dynamic objects + SaveWriter sw = new SaveWriter(@"support/Complete_SoulSilver.sav"); - var BLANK_SOULSILVER_SAVE = @"C:\Users\Evin Jaff\Downloads\johtocomplete.sav"; + String test = "{\r\n \"dexNumber\": 483,\r\n \"ball\": 2,\r\n \"language\": 1,\r\n \"ability\": 28,\r\n \"nature\": 12,\r\n \"OT\": \"Dawn\",\r\n \"OTGender\": 1,\r\n \"nickname\": \"Dialga\",\r\n \"IV\": [ 31, 31, 31, 31, 31, 31 ],\r\n \"EV\": [ 0, 0, 0, 0, 0, 0 ],\r\n \"moves\": [ 425, 262 ],\r\n \"movespp\": [ 30, 40 ],\r\n \"heldItem\": 12,\r\n \"isShiny\": false\r\n\r\n }"; + + EggCreator[] eggArray = new EggCreator[1]; + for (int i = 0; i < eggArray.Length; i++) + { + EggCreator constructed_egg_creator = EggCreator.decodeJSON(test, false); + sw.addEgg(constructed_egg_creator, i + 1); + } + + byte[] saveFile = sw.exportRawBytes(); + + // dump to file + sw.export("testPROG.sav"); + + + } + + + // SaveWriter sw = new SaveWriter(BLANK_SOULSILVER_SAVE); diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/SaveWriter.cs b/pkhex/pkhex-egglocke/pkhex-egglocke/SaveWriter.cs index 41bfc5e..0268ec6 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/SaveWriter.cs +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/SaveWriter.cs @@ -71,13 +71,75 @@ public void massAddEggs(string JSONPath) { } + internal void MakeShiny(PK4 pokemon) { + // Get IDs + ushort trainer_id = pokemon.TID16; + ushort secret_id = pokemon.SID16; + uint pid = ShinyUtil.GetShinyPID(trainer_id, secret_id, pokemon.PID, 0); + pokemon.PID = pid; + + + } + + internal static bool IsShinyPID(uint pid, uint trainer_id, uint secret_id) { + return ((trainer_id ^ secret_id ^ (pid & 0xFFFF) ^ (pid >> 16)) < 8); + } + + + internal uint GenerateShinyPID(uint trainer_id, uint secret_id) { + Random rand = new Random(); + uint pid; + do + { + pid = (uint)rand.Next(0, 0x1000000); + } while (!IsShinyPID(pid, trainer_id, secret_id)); + + return pid; + + } + + private static PK4 createDefaultEgg(uint tid, uint sid) { + + return new PK4 + { + TrainerTID7 = tid, + TrainerSID7 = sid, + IsEgg = true, + MetLevel = 1, + Ball = 4, + Species = 1, + Nickname = "Egg", + Language = 1, + OriginalTrainerName = "PKHeX", + OriginalTrainerGender = 0, + HeldItem = 0, + Ability = 0, + Nature = 0, + Move1 = 0, + Move1_PP = 0, + Move2 = 0, + Move2_PP = 0, + Move3 = 0, + Move3_PP = 0, + Move4 = 0, + Move4_PP = 0, + IVs = new int[] { 31, 31, 31, 31, 31, 31 } + }; + + + } public void addEgg( EggCreator pokemon, int boxIndex) { - // hacky start - hardcoded to box 1 + - var mew = new PK4(); + // hacky start - hardcoded to gen 4 pokemon + PK4 mew = createDefaultEgg(this.currentSave.TrainerTID7, this.currentSave.TrainerSID7); + + // Set the trainer ID according to the save file + mew.TrainerTID7 = this.currentSave.TrainerTID7; + mew.TrainerSID7 = this.currentSave.TrainerSID7; // Standard Egg attributes mew.IsEgg = pokemon.IsEgg; @@ -85,7 +147,7 @@ public void addEgg( EggCreator pokemon, int boxIndex) { mew.MetLevel = pokemon.MetLevel; mew.Ball = pokemon.ball; - + // Pokemon Info mew.Species = pokemon.dexNumber; mew.Nickname = pokemon.nickname; @@ -93,37 +155,53 @@ public void addEgg( EggCreator pokemon, int boxIndex) { mew.OriginalTrainerName = pokemon.OT; mew.OriginalTrainerGender = pokemon.OTGender; - mew.HeldItem = + mew.HeldItem = pokemon.heldItem; + mew.Version = GameVersion.HG; mew.Ability = pokemon.Ability; - mew.Nature = pokemon.Nature; + Console.WriteLine(pokemon.moves); // Moveset - mew.Move1 = (int)Move.ShadowSneak; - mew.Move1_PP = 30; - mew.Move2 = (int)Move.Memento; - mew.Move2_PP = 20; + // Based on number of moves, set the moves + for (int i = 0; i < pokemon.moves.Length; i++) { + mew.SetMove(i, pokemon.moves[i]); + } mew.IVs = pokemon.IV; var box = this.currentSave.BoxData; - // Check legality of the pokemon + // Logic to confirm that the PID matches the nature and shininess + for (; !( (Nature)(mew.PID % 25) == pokemon.Nature) && (pokemon.isShiny == pokemon.isShiny); ) + { + // Attempt to set the nature + mew.SetPIDNature(pokemon.Nature); + MakeShiny(mew); - LegalityAnalysis legalitychecker = new LegalityAnalysis(mew); + } - #if DEBUG + + + + Console.WriteLine("Nature after setting"); + Console.WriteLine(mew.Nature); + +#if DEBUG + // Check legality of the pokemon + LegalityAnalysis legalitychecker = new LegalityAnalysis(mew); + if (legalitychecker.Valid) { Console.WriteLine("Legal Egg created!"); } - else { + else + { Console.WriteLine("Illegal Egg Created!"); } - #endif +#endif box[boxIndex] = mew; @@ -133,7 +211,9 @@ public void addEgg( EggCreator pokemon, int boxIndex) { // this.currentSave.AddBoxData( , 1, 1 ); - + + + } @@ -162,11 +242,20 @@ public byte[] exportRawBytes() { public string getOTString() { if (currentSave == null) { - throw new Exception("OT field in save file is null- possibly corrupted?"); + throw new Exception("Save file is null- possibly corrupted?"); } return this.currentSave.OT; } + public IList getBox() { + // return the box data + if (currentSave == null) + { + throw new Exception("Save File is null- possibly corrupted?"); + } + return this.currentSave.BoxData; + } + // Other utility functions public void validateConstructor(string filePath) { diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/pkhexEgglocke.csproj b/pkhex/pkhex-egglocke/pkhex-egglocke/pkhexEgglocke.csproj index dbb7f34..109a0bd 100644 --- a/pkhex/pkhex-egglocke/pkhex-egglocke/pkhexEgglocke.csproj +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/pkhexEgglocke.csproj @@ -10,8 +10,34 @@ - - + + + + + + support\PKHeX.Core.dll + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + diff --git a/pkhex/pkhex-egglocke/pkhex-egglocke/support/Blank_Diamond.sav b/pkhex/pkhex-egglocke/pkhex-egglocke/support/Blank_Diamond.sav new file mode 100644 index 0000000..1e23d31 --- /dev/null +++ b/pkhex/pkhex-egglocke/pkhex-egglocke/support/Blank_Diamond.sav @@ -0,0 +1,32 @@ + "39" .BE/KKbi ? &|.RkܤdmrNdžxApsado"XjJQ#wӒ; +3C,4Ov0n  J-s O#KR LjK#qUꆬZ? Y +4~׻S}w?ۨ +Z(Lqwj]OY~i.4zMFIީR0 L[~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($- _@A" 쀀T  p@hxJJK ~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄dddddddddd +ddddddddddddddddddddddddddd ddddd +dd dddddd +ddd @ dddddddddddddd +ddddd d ddd dddd dd d ddd +dddddddddddddddddddddddd @ ddddddddldldldld !d.dx0d!d-idsd,EVV]1  a a  $a   $Aa] + +Is04444444444444444 + + + + + + + + + + + + + + + + + + + +YxGXlYZYs{SRx}_L?LkX̾.N̥1Xh/(/3AeaG`EB:zę]->ic+I7Eudl3*:0>h5+ DW.nB{E [uO0HFL_IHwFśaW8ChQS2/IGf={);cuUA*=+Špqg0gי3^ΕЩLeQa*&{DL  ǐ(6.sS"Hh%o.SfOʽW Q d؎A9xAc0Z2DBƈՂي}껬Ai0 v?O5ps/;<XE׃qdpT-Lc2Lo|Y_6%Ys{S._?hiZl@ )f{sJADA!?!(~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($῎{@Hѿ8;##}4jp߄~qR1Bůg3,^=z]x'a]70|@H2i=c)bhIn1ق\;N_Z($@ |BQsrOSKo;d- ysV^ response.json()) - .then(data => data.name) -} \ No newline at end of file diff --git a/server/egglocke/requirements.txt b/server/egglocke/requirements.txt deleted file mode 100644 index 62302d5..0000000 --- a/server/egglocke/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -django -mysqlclient -django-ratelimit -gunicorn diff --git a/server/egglocke/egglocke/settings.py b/server/egglocke/settings.py similarity index 97% rename from server/egglocke/egglocke/settings.py rename to server/egglocke/settings.py index fbf6d1c..49509dd 100644 --- a/server/egglocke/egglocke/settings.py +++ b/server/egglocke/settings.py @@ -49,6 +49,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'captcha', ] MIDDLEWARE = [ @@ -148,4 +149,6 @@ POKEMON_GENERATION = 4 # For building save files, we need to know how to contact the PKHeX microservice - eventually we may just iptable map this to an internal domain (pokepoll.pkhex) -ADDRESS_OF_PKHEX_MICROSERVICE = "http://10.0.0.2" \ No newline at end of file +MICROSERVICE_URLS = { + "savefile": "http://pkhex_container:1234/" +} \ No newline at end of file diff --git a/server/egglocke/egglocke/tests.py b/server/egglocke/tests.py similarity index 100% rename from server/egglocke/egglocke/tests.py rename to server/egglocke/tests.py diff --git a/server/egglocke/egglocke/urls.py b/server/egglocke/urls.py similarity index 95% rename from server/egglocke/egglocke/urls.py rename to server/egglocke/urls.py index 4112dde..f8428bb 100644 --- a/server/egglocke/egglocke/urls.py +++ b/server/egglocke/urls.py @@ -22,4 +22,5 @@ path("pokepoll/", include("pokepoll.urls")), path('admin/', admin.site.urls), path("robots.txt", robots_txt_view), + path('captcha/', include('captcha.urls')), ] \ No newline at end of file diff --git a/server/egglocke/egglocke/wsgi.py b/server/egglocke/wsgi.py similarity index 100% rename from server/egglocke/egglocke/wsgi.py rename to server/egglocke/wsgi.py diff --git a/server/egglocke/manage.py b/server/manage.py similarity index 100% rename from server/egglocke/manage.py rename to server/manage.py diff --git a/server/egglocke/pokepoll/__init__.py b/server/pokepoll/__init__.py similarity index 100% rename from server/egglocke/pokepoll/__init__.py rename to server/pokepoll/__init__.py diff --git a/server/egglocke/pokepoll/admin.py b/server/pokepoll/admin.py similarity index 100% rename from server/egglocke/pokepoll/admin.py rename to server/pokepoll/admin.py diff --git a/server/egglocke/pokepoll/apps.py b/server/pokepoll/apps.py similarity index 100% rename from server/egglocke/pokepoll/apps.py rename to server/pokepoll/apps.py diff --git a/server/egglocke/pokepoll/migrations/0001_initial.py b/server/pokepoll/migrations/0001_initial.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0001_initial.py rename to server/pokepoll/migrations/0001_initial.py diff --git a/server/egglocke/pokepoll/migrations/0002_rename_question_pokemon.py b/server/pokepoll/migrations/0002_rename_question_pokemon.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0002_rename_question_pokemon.py rename to server/pokepoll/migrations/0002_rename_question_pokemon.py diff --git a/server/egglocke/pokepoll/migrations/0003_submitter_and_more.py b/server/pokepoll/migrations/0003_submitter_and_more.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0003_submitter_and_more.py rename to server/pokepoll/migrations/0003_submitter_and_more.py diff --git a/server/egglocke/pokepoll/migrations/0004_alter_submitter_email.py b/server/pokepoll/migrations/0004_alter_submitter_email.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0004_alter_submitter_email.py rename to server/pokepoll/migrations/0004_alter_submitter_email.py diff --git a/server/egglocke/pokepoll/migrations/0005_pokemon_pokemon_ev_pokemon_pokemon_iv_and_more.py b/server/pokepoll/migrations/0005_pokemon_pokemon_ev_pokemon_pokemon_iv_and_more.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0005_pokemon_pokemon_ev_pokemon_pokemon_iv_and_more.py rename to server/pokepoll/migrations/0005_pokemon_pokemon_ev_pokemon_pokemon_iv_and_more.py diff --git a/server/egglocke/pokepoll/migrations/0006_alter_pokemon_pokemon_ev_alter_pokemon_pokemon_iv.py b/server/pokepoll/migrations/0006_alter_pokemon_pokemon_ev_alter_pokemon_pokemon_iv.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0006_alter_pokemon_pokemon_ev_alter_pokemon_pokemon_iv.py rename to server/pokepoll/migrations/0006_alter_pokemon_pokemon_ev_alter_pokemon_pokemon_iv.py diff --git a/server/egglocke/pokepoll/migrations/0007_alter_pokemon_pokemon_moves_and_more.py b/server/pokepoll/migrations/0007_alter_pokemon_pokemon_moves_and_more.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0007_alter_pokemon_pokemon_moves_and_more.py rename to server/pokepoll/migrations/0007_alter_pokemon_pokemon_moves_and_more.py diff --git a/server/egglocke/pokepoll/migrations/0008_alter_pokemon_pokemon_moves_and_more.py b/server/pokepoll/migrations/0008_alter_pokemon_pokemon_moves_and_more.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0008_alter_pokemon_pokemon_moves_and_more.py rename to server/pokepoll/migrations/0008_alter_pokemon_pokemon_moves_and_more.py diff --git a/server/egglocke/pokepoll/migrations/0009_alter_pokemon_pokemon_moves_and_more.py b/server/pokepoll/migrations/0009_alter_pokemon_pokemon_moves_and_more.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0009_alter_pokemon_pokemon_moves_and_more.py rename to server/pokepoll/migrations/0009_alter_pokemon_pokemon_moves_and_more.py diff --git a/server/egglocke/pokepoll/migrations/0010_pokemon_pokemon_held_item.py b/server/pokepoll/migrations/0010_pokemon_pokemon_held_item.py similarity index 100% rename from server/egglocke/pokepoll/migrations/0010_pokemon_pokemon_held_item.py rename to server/pokepoll/migrations/0010_pokemon_pokemon_held_item.py diff --git a/server/pokepoll/migrations/0011_pokemon_pokemon_is_shiny_alter_pokemon_pokemon_moves_and_more.py b/server/pokepoll/migrations/0011_pokemon_pokemon_is_shiny_alter_pokemon_pokemon_moves_and_more.py new file mode 100644 index 0000000..45b6b01 --- /dev/null +++ b/server/pokepoll/migrations/0011_pokemon_pokemon_is_shiny_alter_pokemon_pokemon_moves_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.6 on 2024-06-20 04:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pokepoll', '0010_pokemon_pokemon_held_item'), + ] + + operations = [ + migrations.AddField( + model_name='pokemon', + name='pokemon_is_shiny', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='pokemon', + name='pokemon_moves', + field=models.JSONField(default=[1]), + ), + migrations.AlterField( + model_name='pokemon', + name='pokemon_movespp', + field=models.JSONField(default=[0]), + ), + ] diff --git a/server/pokepoll/migrations/0012_pokemon_pokemon_generations_and_more.py b/server/pokepoll/migrations/0012_pokemon_pokemon_generations_and_more.py new file mode 100644 index 0000000..6d13b6b --- /dev/null +++ b/server/pokepoll/migrations/0012_pokemon_pokemon_generations_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-06-24 00:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pokepoll', '0011_pokemon_pokemon_is_shiny_alter_pokemon_pokemon_moves_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='pokemon', + name='pokemon_generations', + field=models.JSONField(default=[4]), + ), + migrations.AddField( + model_name='pokemon', + name='pokemon_intended_generation', + field=models.IntegerField(default=1), + ), + ] diff --git a/server/pokepoll/migrations/0013_rename_pokemon_generations_pokemon_pokemon_compatible_generations.py b/server/pokepoll/migrations/0013_rename_pokemon_generations_pokemon_pokemon_compatible_generations.py new file mode 100644 index 0000000..ff233ff --- /dev/null +++ b/server/pokepoll/migrations/0013_rename_pokemon_generations_pokemon_pokemon_compatible_generations.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-06-24 00:22 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pokepoll', '0012_pokemon_pokemon_generations_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='pokemon', + old_name='pokemon_generations', + new_name='pokemon_compatible_generations', + ), + ] diff --git a/server/pokepoll/migrations/0014_alter_pokemon_pokemon_intended_generation.py b/server/pokepoll/migrations/0014_alter_pokemon_pokemon_intended_generation.py new file mode 100644 index 0000000..98a01c8 --- /dev/null +++ b/server/pokepoll/migrations/0014_alter_pokemon_pokemon_intended_generation.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2024-06-24 00:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pokepoll', '0013_rename_pokemon_generations_pokemon_pokemon_compatible_generations'), + ] + + operations = [ + migrations.AlterField( + model_name='pokemon', + name='pokemon_intended_generation', + field=models.IntegerField(choices=[(1, 'Gen 1'), (2, 'Gen 2'), (3, 'Gen 3'), (4, 'Gen 4'), (5, 'Gen 5'), (6, 'Gen 6'), (7, 'Gen 7'), (8, 'Gen 8')], default=4), + ), + ] diff --git a/server/egglocke/pokepoll/migrations/__init__.py b/server/pokepoll/migrations/__init__.py similarity index 100% rename from server/egglocke/pokepoll/migrations/__init__.py rename to server/pokepoll/migrations/__init__.py diff --git a/server/egglocke/pokepoll/models.py b/server/pokepoll/models.py similarity index 80% rename from server/egglocke/pokepoll/models.py rename to server/pokepoll/models.py index 3a82c2c..6e8ef34 100644 --- a/server/egglocke/pokepoll/models.py +++ b/server/pokepoll/models.py @@ -31,9 +31,12 @@ class Pokemon(models.Model): pokemon_OTGender = models.IntegerField(default=1) pokemon_IV = models.JSONField(default=list([31, 31, 31, 31, 31, 31])) pokemon_EV = models.JSONField(default=list([0, 0, 0, 0, 0, 0])) - pokemon_moves = models.JSONField(default=dict) - pokemon_movespp = models.JSONField(default=dict) + pokemon_moves = models.JSONField(default=list([1])) + pokemon_movespp = models.JSONField(default=list([0])) pokemon_held_item = models.IntegerField(default=0) + pokemon_is_shiny = models.BooleanField(default=False) + pokemon_intended_generation = models.IntegerField(default=4, choices=[(1, "Gen 1"), (2, "Gen 2"), (3, "Gen 3"), (4, "Gen 4"), (5, "Gen 5"), (6, "Gen 6"), (7, "Gen 7"), (8, "Gen 8")]) + pokemon_compatible_generations = models.JSONField(default=list([4])) pub_date = models.DateTimeField("date published") diff --git a/server/egglocke/pokepoll/pokemondomainknowledge.py b/server/pokepoll/pokemondomainknowledge.py similarity index 100% rename from server/egglocke/pokepoll/pokemondomainknowledge.py rename to server/pokepoll/pokemondomainknowledge.py diff --git a/server/egglocke/pokepoll/static/pokepoll/all_pokemon_names.json b/server/pokepoll/static/pokepoll/all_pokemon_names.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/all_pokemon_names.json rename to server/pokepoll/static/pokepoll/all_pokemon_names.json diff --git a/server/pokepoll/static/pokepoll/autocomplete_form_ui.js b/server/pokepoll/static/pokepoll/autocomplete_form_ui.js new file mode 100644 index 0000000..67e784d --- /dev/null +++ b/server/pokepoll/static/pokepoll/autocomplete_form_ui.js @@ -0,0 +1,97 @@ + +function autocomplete(inp, arr) { + /*the autocomplete function takes two arguments, + the text field element and an array of possible autocompleted values:*/ + var currentFocus; + /*execute a function when someone writes in the text field:*/ + inp.addEventListener("input", function(e) { + var a, b, i, val = this.value; + /*close any already open lists of autocompleted values*/ + closeAllLists(); + if (!val) { return false;} + currentFocus = -1; + /*create a DIV element that will contain the items (values):*/ + a = document.createElement("DIV"); + a.setAttribute("id", this.id + "autocomplete-list"); + a.setAttribute("class", "autocomplete-items"); + /*append the DIV element as a child of the autocomplete container:*/ + this.parentNode.appendChild(a); + /*for each item in the array...*/ + for (i = 0; i < arr.length; i++) { + /*check if the item starts with the same letters as the text field value:*/ + if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) { + /*create a DIV element for each matching element:*/ + b = document.createElement("DIV"); + /*make the matching letters bold:*/ + b.innerHTML = "" + arr[i].substr(0, val.length) + ""; + b.innerHTML += arr[i].substr(val.length); + /*insert a input field that will hold the current array item's value:*/ + b.innerHTML += ""; + /*execute a function when someone clicks on the item value (DIV element):*/ + b.addEventListener("click", function(e) { + /*insert the value for the autocomplete text field:*/ + inp.value = this.getElementsByTagName("input")[0].value; + /*close the list of autocompleted values, + (or any other open lists of autocompleted values:*/ + closeAllLists(); + }); + a.appendChild(b); + } + } + }); + /*execute a function presses a key on the keyboard:*/ + inp.addEventListener("keydown", function(e) { + var x = document.getElementById(this.id + "autocomplete-list"); + if (x) x = x.getElementsByTagName("div"); + if (e.keyCode == 40) { + /*If the arrow DOWN key is pressed, + increase the currentFocus variable:*/ + currentFocus++; + /*and and make the current item more visible:*/ + addActive(x); + } else if (e.keyCode == 38) { //up + /*If the arrow UP key is pressed, + decrease the currentFocus variable:*/ + currentFocus--; + /*and and make the current item more visible:*/ + addActive(x); + } else if (e.keyCode == 13) { + /*If the ENTER key is pressed, prevent the form from being submitted,*/ + e.preventDefault(); + if (currentFocus > -1) { + /*and simulate a click on the "active" item:*/ + if (x) x[currentFocus].click(); + } + } + }); + function addActive(x) { + /*a function to classify an item as "active":*/ + if (!x) return false; + /*start by removing the "active" class on all items:*/ + removeActive(x); + if (currentFocus >= x.length) currentFocus = 0; + if (currentFocus < 0) currentFocus = (x.length - 1); + /*add class "autocomplete-active":*/ + x[currentFocus].classList.add("autocomplete-active"); + } + function removeActive(x) { + /*a function to remove the "active" class from all autocomplete items:*/ + for (var i = 0; i < x.length; i++) { + x[i].classList.remove("autocomplete-active"); + } + } + function closeAllLists(elmnt) { + /*close all autocomplete lists in the document, + except the one passed as an argument:*/ + var x = document.getElementsByClassName("autocomplete-items"); + for (var i = 0; i < x.length; i++) { + if (elmnt != x[i] && elmnt != inp) { + x[i].parentNode.removeChild(x[i]); + } + } + } + /*execute a function when someone clicks in the document:*/ + document.addEventListener("click", function (e) { + closeAllLists(e.target); + }); + } \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/gen3_nature_enum.json b/server/pokepoll/static/pokepoll/gen3_nature_enum.json new file mode 100644 index 0000000..469de33 --- /dev/null +++ b/server/pokepoll/static/pokepoll/gen3_nature_enum.json @@ -0,0 +1 @@ +{"Brave": 2, "Adamant": 3, "Naughty": 4, "Bold": 5, "Relaxed": 7, "Impish": 8, "Lax": 9, "Timid": 10, "Hasty": 11, "Jolly": 13, "Naive": 14, "Modest": 15, "Mild": 16, "Quiet": 17, "Rash": 19, "Calm": 20, "Gentle": 21, "Sassy": 22, "Careful": 23, "Random": 25} \ No newline at end of file diff --git a/server/egglocke/pokepoll/static/pokepoll/held_items_to_id_gen_4.json b/server/pokepoll/static/pokepoll/held_items_to_id_gen_4.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/held_items_to_id_gen_4.json rename to server/pokepoll/static/pokepoll/held_items_to_id_gen_4.json diff --git a/server/egglocke/pokepoll/static/pokepoll/homepage-style.css b/server/pokepoll/static/pokepoll/homepage-style.css similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/homepage-style.css rename to server/pokepoll/static/pokepoll/homepage-style.css diff --git a/server/egglocke/pokepoll/static/pokepoll/img/astarion.png b/server/pokepoll/static/pokepoll/img/astarion.png similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/astarion.png rename to server/pokepoll/static/pokepoll/img/astarion.png diff --git a/server/egglocke/pokepoll/static/pokepoll/img/loading.gif b/server/pokepoll/static/pokepoll/img/loading.gif similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/loading.gif rename to server/pokepoll/static/pokepoll/img/loading.gif diff --git a/server/egglocke/pokepoll/static/pokepoll/img/negative.gif b/server/pokepoll/static/pokepoll/img/negative.gif similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/negative.gif rename to server/pokepoll/static/pokepoll/img/negative.gif diff --git a/server/egglocke/pokepoll/static/pokepoll/img/placeholdersprite.png b/server/pokepoll/static/pokepoll/img/placeholdersprite.png similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/placeholdersprite.png rename to server/pokepoll/static/pokepoll/img/placeholdersprite.png diff --git a/server/egglocke/pokepoll/static/pokepoll/img/positive.gif b/server/pokepoll/static/pokepoll/img/positive.gif similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/positive.gif rename to server/pokepoll/static/pokepoll/img/positive.gif diff --git a/server/egglocke/pokepoll/static/pokepoll/img/strawberi.png b/server/pokepoll/static/pokepoll/img/strawberi.png similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/img/strawberi.png rename to server/pokepoll/static/pokepoll/img/strawberi.png diff --git a/server/pokepoll/static/pokepoll/nature_enum.json b/server/pokepoll/static/pokepoll/nature_enum.json new file mode 100644 index 0000000..66a870b --- /dev/null +++ b/server/pokepoll/static/pokepoll/nature_enum.json @@ -0,0 +1 @@ +{"Hardy": 0, "Lonley": 1, "Brave": 2, "Adamant": 3, "Naughty": 4, "Bold": 5, "Docile": 6, "Relaxed": 7, "Impish": 8, "Lax": 9, "Timid": 10, "Hasty": 11, "Serious": 12, "Jolly": 13, "Naive": 14, "Modest": 15, "Mild": 16, "Quiet": 17, "Bashful": 18, "Rash": 19, "Calm": 20, "Gentle": 21, "Sassy": 22, "Careful": 23, "Quirky": 24, "Random": 25} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokeapifunctions.js b/server/pokepoll/static/pokepoll/pokeapifunctions.js new file mode 100644 index 0000000..a77e0bf --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokeapifunctions.js @@ -0,0 +1,17 @@ + + +function getPokemonSpriteURL(pokemonID, isShiny) { + base_url = `https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/` + + if (isShiny) { + return `${base_url}shiny/${pokemonID}.png` + } + + return `${base_url}${pokemonID}.png` +} + +async function getPokemonNameFromID(pokemonID) { + return fetch(`https://pokeapi.co/api/v2/pokemon/${pokemonID}`) + .then(response => response.json()) + .then(data => data.name) +} \ No newline at end of file diff --git a/server/egglocke/pokepoll/static/pokepoll/pokedex.json b/server/pokepoll/static/pokepoll/pokedex.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokedex.json rename to server/pokepoll/static/pokepoll/pokedex.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_3.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_3.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_3.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_3.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json similarity index 98% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json index d4d05d8..8b1180c 100644 --- a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json +++ b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_4.json @@ -1 +1 @@ -{"None": 0, "Stench": 1, "Drizzle": 2, "Speed Boost": 3, "Battle Armor": 4, "Sturdy": 5, "Damp": 6, "Limber": 7, "Sand Veil": 8, "Static": 9, "Volt Absorb": 10, "Water Absorb": 11, "Oblivious": 12, "Cloud Nine": 13, "Compound Eyes": 14, "Insomnia": 15, "Color Change": 16, "Immunity": 17, "Flash Fire": 18, "Shield Dust": 19, "Own Tempo": 20, "Suction Cups": 21, "Intimidate": 22, "Shadow Tag": 23, "Rough Skin": 24, "Wonder Guard": 25, "Levitate": 26, "Effect Spore": 27, "Synchronize": 28, "Clear Body": 29, "Natural Cure": 30, "Lightning Rod": 31, "Serene Grace": 32, "Swift Swim": 33, "Chlorophyll": 34, "Illuminate": 35, "Trace": 36, "Huge Power": 37, "Poison Point": 38, "Inner Focus": 39, "Magma Armor": 40, "Water Veil": 41, "Magnet Pull": 42, "Soundproof": 43, "Rain Dish": 44, "Sand Stream": 45, "Pressure": 46, "Thick Fat": 47, "Early Bird": 48, "Flame Body": 49, "Run Away": 50, "Keen Eye": 51, "Hyper Cutter": 52, "Pickup": 53, "Truant": 54, "Hustle": 55, "Cute Charm": 56, "Plus": 57, "Minus": 58, "Forecast": 59, "Sticky Hold": 60, "Shed Skin": 61, "Guts": 62, "Marvel Scale": 63, "Liquid Ooze": 64, "Overgrow": 65, "Blaze": 66, "Torrent": 67, "Swarm": 68, "Rock Head": 69, "Drought": 70, "Arena Trap": 71, "Vital Spirit": 72, "White Smoke": 73, "Pure Power": 74, "Shell Armor": 75, "Air Lock": 76, "Tangled Feet": 77, "Motor Drive": 78, "Rivalry": 79, "Steadfast": 80, "Snow Cloak": 81, "Gluttony": 82, "Anger Point": 83, "Unburden": 84, "Heatproof": 85, "Simple": 86, "Dry Skin": 87, "Download": 88, "Iron Fist": 89, "Poison Heal": 90, "Adaptability": 91, "Skill Link": 92, "Hydration": 93, "Solar Power": 94, "Quick Feet": 95, "Normalize": 96, "Sniper": 97, "Magic Guard": 98, "No Guard": 99, "Stall": 100, "Technician": 101, "Leaf Guard": 102, "Klutz": 103, "Mold Breaker": 104, "Super Luck": 105, "Aftermath": 106, "Anticipation": 107, "Forewarn": 108, "Unaware": 109, "Tinted Lens": 110, "Filter": 111, "Slow Start": 112, "Scrappy": 113, "Storm Drain": 114, "Ice Body": 115, "Solid Rock": 116, "Snow Warning": 117, "Honey Gather": 118, "Frisk": 119, "Reckless": 120, "Multitype": 121, "Flower Gift": 122} \ No newline at end of file +{"None": 0, "Stench": 1, "Drizzle": 2, "Speed Boost": 3, "Battle Armor": 4, "Sturdy": 5, "Damp": 6, "Limber": 7, "Sand Veil": 8, "Static": 9, "Volt Absorb": 10, "Water Absorb": 11, "Oblivious": 12, "Cloud Nine": 13, "Compound Eyes": 14, "Insomnia": 15, "Color Change": 16, "Immunity": 17, "Flash Fire": 18, "Shield Dust": 19, "Own Tempo": 20, "Suction Cups": 21, "Intimidate": 22, "Shadow Tag": 23, "Rough Skin": 24, "Wonder Guard": 25, "Levitate": 26, "Effect Spore": 27, "Synchronize": 28, "Clear Body": 29, "Natural Cure": 30, "Lightning Rod": 31, "Serene Grace": 32, "Swift Swim": 33, "Chlorophyll": 34, "Illuminate": 35, "Trace": 36, "Huge Power": 37, "Poison Point": 38, "Inner Focus": 39, "Magma Armor": 40, "Water Veil": 41, "Magnet Pull": 42, "Soundproof": 43, "Rain Dish": 44, "Sand Stream": 45, "Pressure": 46, "Thick Fat": 47, "Early Bird": 48, "Flame Body": 49, "Run Away": 50, "Keen Eye": 51, "Hyper Cutter": 52, "Pickup": 53, "Truant": 54, "Hustle": 55, "Cute Charm": 56, "Plus": 57, "Minus": 58, "Forecast": 59, "Sticky Hold": 60, "Shed Skin": 61, "Guts": 62, "Marvel Scale": 63, "Liquid Ooze": 64, "Overgrow": 65, "Blaze": 66, "Torrent": 67, "Swarm": 68, "Rock Head": 69, "Drought": 70, "Arena Trap": 71, "Vital Spirit": 72, "White Smoke": 73, "Pure Power": 74, "Shell Armor": 75, "Air Lock": 76, "Tangled Feet": 77, "Motor Drive": 78, "Rivalry": 79, "Steadfast": 80, "Snow Cloak": 81, "Gluttony": 82, "Anger Point": 83, "Unburden": 84, "Heatproof": 85, "Simple": 86, "Dry Skin": 87, "Download": 88, "Iron Fist": 89, "Poison Heal": 90, "Adaptability": 91, "Skill Link": 92, "Hydration": 93, "Solar Power": 94, "Quick Feet": 95, "Normalize": 96, "Sniper": 97, "Magic Guard": 98, "No Guard": 99, "Stall": 100, "Technician": 101, "Leaf Guard": 102, "Klutz": 103, "Mold Breaker": 104, "Super Luck": 105, "Aftermath": 106, "Anticipation": 107, "Forewarn": 108, "Unaware": 109, "Tinted Lens": 110, "Filter": 111, "Slow Start": 112, "Scrappy": 113, "Storm Drain": 114, "Ice Body": 115, "Solid Rock": 116, "Snow Warning": 117, "Honey Gather": 118, "Frisk": 119, "Reckless": 120, "Multitype": 121, "Flower Gift": 122, "Bad Dreams": 123} \ No newline at end of file diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_5.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_5.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_5.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_5.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_6.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_6.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_6.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_6.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_7.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_7.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_7.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_7.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_8.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_8.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_8.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_8.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_9.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_9.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_9.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_9.json diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_full.json b/server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_full.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_full.json rename to server/pokepoll/static/pokepoll/pokemon_ability_to_id_gen_full.json diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_1.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_1.json new file mode 100644 index 0000000..aed264f --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_1.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_2.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_2.json new file mode 100644 index 0000000..26a89ed --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_2.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165, "Sketch": 166, "Triple Kick": 167, "Thief": 168, "Spider Web": 169, "Mind Reader": 170, "Nightmare": 171, "Flame Wheel": 172, "Snore": 173, "Curse": 174, "Flail": 175, "Conversion2": 176, "Aeroblast": 177, "Cotton Spore": 178, "Reversal": 179, "Spite": 180, "Powder Snow": 181, "Protect": 182, "Mach Punch": 183, "Scary Face": 184, "Feint Attack": 185, "Sweet Kiss": 186, "Belly Drum": 187, "Sludge Bomb": 188, "Mud Slap": 189, "Octazooka": 190, "Spikes": 191, "Zap Cannon": 192, "Foresight": 193, "Destiny Bond": 194, "Perish Song": 195, "Icy Wind": 196, "Detect": 197, "Bone Rush": 198, "Lock On": 199, "Outrage": 200, "Sandstorm": 201, "Giga Drain": 202, "Endure": 203, "Charm": 204, "Rollout": 205, "False Swipe": 206, "Swagger": 207, "Milk Drink": 208, "Spark": 209, "Fury Cutter": 210, "Steel Wing": 211, "Mean Look": 212, "Attract": 213, "Sleep Talk": 214, "Heal Bell": 215, "Return": 216, "Present": 217, "Frustration": 218, "Safeguard": 219, "Pain Split": 220, "Sacred Fire": 221, "Magnitude": 222, "Dynamic Punch": 223, "Megahorn": 224, "Dragon Breath": 225, "Baton Pass": 226, "Encore": 227, "Pursuit": 228, "Rapid Spin": 229, "Sweet Scent": 230, "Iron Tail": 231, "Metal Claw": 232, "Vital Throw": 233, "Morning Sun": 234, "Synthesis": 235, "Moonlight": 236, "Hidden Power": 237, "Cross Chop": 238, "Twister": 239, "Rain Dance": 240, "Sunny Day": 241, "Crunch": 242, "Mirror Coat": 243, "Psych Up": 244, "Extreme Speed": 245, "Ancient Power": 246, "Shadow Ball": 247, "Future Sight": 248, "Rock Smash": 249, "Whirlpool": 250, "Beat Up": 251} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_3.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_3.json new file mode 100644 index 0000000..cb9fb23 --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_3.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165, "Sketch": 166, "Triple Kick": 167, "Thief": 168, "Spider Web": 169, "Mind Reader": 170, "Nightmare": 171, "Flame Wheel": 172, "Snore": 173, "Curse": 174, "Flail": 175, "Conversion2": 176, "Aeroblast": 177, "Cotton Spore": 178, "Reversal": 179, "Spite": 180, "Powder Snow": 181, "Protect": 182, "Mach Punch": 183, "Scary Face": 184, "Feint Attack": 185, "Sweet Kiss": 186, "Belly Drum": 187, "Sludge Bomb": 188, "Mud Slap": 189, "Octazooka": 190, "Spikes": 191, "Zap Cannon": 192, "Foresight": 193, "Destiny Bond": 194, "Perish Song": 195, "Icy Wind": 196, "Detect": 197, "Bone Rush": 198, "Lock On": 199, "Outrage": 200, "Sandstorm": 201, "Giga Drain": 202, "Endure": 203, "Charm": 204, "Rollout": 205, "False Swipe": 206, "Swagger": 207, "Milk Drink": 208, "Spark": 209, "Fury Cutter": 210, "Steel Wing": 211, "Mean Look": 212, "Attract": 213, "Sleep Talk": 214, "Heal Bell": 215, "Return": 216, "Present": 217, "Frustration": 218, "Safeguard": 219, "Pain Split": 220, "Sacred Fire": 221, "Magnitude": 222, "Dynamic Punch": 223, "Megahorn": 224, "Dragon Breath": 225, "Baton Pass": 226, "Encore": 227, "Pursuit": 228, "Rapid Spin": 229, "Sweet Scent": 230, "Iron Tail": 231, "Metal Claw": 232, "Vital Throw": 233, "Morning Sun": 234, "Synthesis": 235, "Moonlight": 236, "Hidden Power": 237, "Cross Chop": 238, "Twister": 239, "Rain Dance": 240, "Sunny Day": 241, "Crunch": 242, "Mirror Coat": 243, "Psych Up": 244, "Extreme Speed": 245, "Ancient Power": 246, "Shadow Ball": 247, "Future Sight": 248, "Rock Smash": 249, "Whirlpool": 250, "Beat Up": 251, "Fake Out": 252, "Uproar": 253, "Stockpile": 254, "Spit Up": 255, "Swallow": 256, "Heat Wave": 257, "Hail": 258, "Torment": 259, "Flatter": 260, "Will O Wisp": 261, "Memento": 262, "Facade": 263, "Focus Punch": 264, "Smelling Salts": 265, "Follow Me": 266, "Nature Power": 267, "Charge": 268, "Taunt": 269, "Helping Hand": 270, "Trick": 271, "Role Play": 272, "Wish": 273, "Assist": 274, "Ingrain": 275, "Superpower": 276, "Magic Coat": 277, "Recycle": 278, "Revenge": 279, "Brick Break": 280, "Yawn": 281, "Knock Off": 282, "Endeavor": 283, "Eruption": 284, "Skill Swap": 285, "Imprison": 286, "Refresh": 287, "Grudge": 288, "Snatch": 289, "Secret Power": 290, "Dive": 291, "Arm Thrust": 292, "Camouflage": 293, "Tail Glow": 294, "Luster Purge": 295, "Mist Ball": 296, "Feather Dance": 297, "Teeter Dance": 298, "Blaze Kick": 299, "Mud Sport": 300, "Ice Ball": 301, "Needle Arm": 302, "Slack Off": 303, "Hyper Voice": 304, "Poison Fang": 305, "Crush Claw": 306, "Blast Burn": 307, "Hydro Cannon": 308, "Meteor Mash": 309, "Astonish": 310, "Weather Ball": 311, "Aromatherapy": 312, "Fake Tears": 313, "Air Cutter": 314, "Overheat": 315, "Odor Sleuth": 316, "Rock Tomb": 317, "Silver Wind": 318, "Metal Sound": 319, "Grass Whistle": 320, "Tickle": 321, "Cosmic Power": 322, "Water Spout": 323, "Signal Beam": 324, "Shadow Punch": 325, "Extrasensory": 326, "Sky Uppercut": 327, "Sand Tomb": 328, "Sheer Cold": 329, "Muddy Water": 330, "Bullet Seed": 331, "Aerial Ace": 332, "Icicle Spear": 333, "Iron Defense": 334, "Block": 335, "Howl": 336, "Dragon Claw": 337, "Frenzy Plant": 338, "Bulk Up": 339, "Bounce": 340, "Mud Shot": 341, "Poison Tail": 342, "Covet": 343, "Volt Tackle": 344, "Magical Leaf": 345, "Water Sport": 346, "Calm Mind": 347, "Leaf Blade": 348, "Dragon Dance": 349, "Rock Blast": 350, "Shock Wave": 351, "Water Pulse": 352, "Doom Desire": 353, "Psycho Boost": 354} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_4.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_4.json new file mode 100644 index 0000000..44e073e --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_4.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165, "Sketch": 166, "Triple Kick": 167, "Thief": 168, "Spider Web": 169, "Mind Reader": 170, "Nightmare": 171, "Flame Wheel": 172, "Snore": 173, "Curse": 174, "Flail": 175, "Conversion2": 176, "Aeroblast": 177, "Cotton Spore": 178, "Reversal": 179, "Spite": 180, "Powder Snow": 181, "Protect": 182, "Mach Punch": 183, "Scary Face": 184, "Feint Attack": 185, "Sweet Kiss": 186, "Belly Drum": 187, "Sludge Bomb": 188, "Mud Slap": 189, "Octazooka": 190, "Spikes": 191, "Zap Cannon": 192, "Foresight": 193, "Destiny Bond": 194, "Perish Song": 195, "Icy Wind": 196, "Detect": 197, "Bone Rush": 198, "Lock On": 199, "Outrage": 200, "Sandstorm": 201, "Giga Drain": 202, "Endure": 203, "Charm": 204, "Rollout": 205, "False Swipe": 206, "Swagger": 207, "Milk Drink": 208, "Spark": 209, "Fury Cutter": 210, "Steel Wing": 211, "Mean Look": 212, "Attract": 213, "Sleep Talk": 214, "Heal Bell": 215, "Return": 216, "Present": 217, "Frustration": 218, "Safeguard": 219, "Pain Split": 220, "Sacred Fire": 221, "Magnitude": 222, "Dynamic Punch": 223, "Megahorn": 224, "Dragon Breath": 225, "Baton Pass": 226, "Encore": 227, "Pursuit": 228, "Rapid Spin": 229, "Sweet Scent": 230, "Iron Tail": 231, "Metal Claw": 232, "Vital Throw": 233, "Morning Sun": 234, "Synthesis": 235, "Moonlight": 236, "Hidden Power": 237, "Cross Chop": 238, "Twister": 239, "Rain Dance": 240, "Sunny Day": 241, "Crunch": 242, "Mirror Coat": 243, "Psych Up": 244, "Extreme Speed": 245, "Ancient Power": 246, "Shadow Ball": 247, "Future Sight": 248, "Rock Smash": 249, "Whirlpool": 250, "Beat Up": 251, "Fake Out": 252, "Uproar": 253, "Stockpile": 254, "Spit Up": 255, "Swallow": 256, "Heat Wave": 257, "Hail": 258, "Torment": 259, "Flatter": 260, "Will O Wisp": 261, "Memento": 262, "Facade": 263, "Focus Punch": 264, "Smelling Salts": 265, "Follow Me": 266, "Nature Power": 267, "Charge": 268, "Taunt": 269, "Helping Hand": 270, "Trick": 271, "Role Play": 272, "Wish": 273, "Assist": 274, "Ingrain": 275, "Superpower": 276, "Magic Coat": 277, "Recycle": 278, "Revenge": 279, "Brick Break": 280, "Yawn": 281, "Knock Off": 282, "Endeavor": 283, "Eruption": 284, "Skill Swap": 285, "Imprison": 286, "Refresh": 287, "Grudge": 288, "Snatch": 289, "Secret Power": 290, "Dive": 291, "Arm Thrust": 292, "Camouflage": 293, "Tail Glow": 294, "Luster Purge": 295, "Mist Ball": 296, "Feather Dance": 297, "Teeter Dance": 298, "Blaze Kick": 299, "Mud Sport": 300, "Ice Ball": 301, "Needle Arm": 302, "Slack Off": 303, "Hyper Voice": 304, "Poison Fang": 305, "Crush Claw": 306, "Blast Burn": 307, "Hydro Cannon": 308, "Meteor Mash": 309, "Astonish": 310, "Weather Ball": 311, "Aromatherapy": 312, "Fake Tears": 313, "Air Cutter": 314, "Overheat": 315, "Odor Sleuth": 316, "Rock Tomb": 317, "Silver Wind": 318, "Metal Sound": 319, "Grass Whistle": 320, "Tickle": 321, "Cosmic Power": 322, "Water Spout": 323, "Signal Beam": 324, "Shadow Punch": 325, "Extrasensory": 326, "Sky Uppercut": 327, "Sand Tomb": 328, "Sheer Cold": 329, "Muddy Water": 330, "Bullet Seed": 331, "Aerial Ace": 332, "Icicle Spear": 333, "Iron Defense": 334, "Block": 335, "Howl": 336, "Dragon Claw": 337, "Frenzy Plant": 338, "Bulk Up": 339, "Bounce": 340, "Mud Shot": 341, "Poison Tail": 342, "Covet": 343, "Volt Tackle": 344, "Magical Leaf": 345, "Water Sport": 346, "Calm Mind": 347, "Leaf Blade": 348, "Dragon Dance": 349, "Rock Blast": 350, "Shock Wave": 351, "Water Pulse": 352, "Doom Desire": 353, "Psycho Boost": 354, "Roost": 355, "Gravity": 356, "Miracle Eye": 357, "Wake Up Slap": 358, "Hammer Arm": 359, "Gyro Ball": 360, "Healing Wish": 361, "Brine": 362, "Natural Gift": 363, "Feint": 364, "Pluck": 365, "Tailwind": 366, "Acupressure": 367, "Metal Burst": 368, "Uturn": 369, "Close Combat": 370, "Payback": 371, "Assurance": 372, "Embargo": 373, "Fling": 374, "Psycho Shift": 375, "Trump Card": 376, "Heal Block": 377, "Wring Out": 378, "Power Trick": 379, "Gastro Acid": 380, "Lucky Chant": 381, "Me First": 382, "Copycat": 383, "Power Swap": 384, "Guard Swap": 385, "Punishment": 386, "Last Resort": 387, "Worry Seed": 388, "Sucker Punch": 389, "Toxic Spikes": 390, "Heart Swap": 391, "Aqua Ring": 392, "Magnet Rise": 393, "Flare Blitz": 394, "Force Palm": 395, "Aura Sphere": 396, "Rock Polish": 397, "Poison Jab": 398, "Dark Pulse": 399, "Night Slash": 400, "Aqua Tail": 401, "Seed Bomb": 402, "Air Slash": 403, "X Scissor": 404, "Bug Buzz": 405, "Dragon Pulse": 406, "Dragon Rush": 407, "Power Gem": 408, "Drain Punch": 409, "Vacuum Wave": 410, "Focus Blast": 411, "Energy Ball": 412, "Brave Bird": 413, "Earth Power": 414, "Switcheroo": 415, "Giga Impact": 416, "Nasty Plot": 417, "Bullet Punch": 418, "Avalanche": 419, "Ice Shard": 420, "Shadow Claw": 421, "Thunder Fang": 422, "Ice Fang": 423, "Fire Fang": 424, "Shadow Sneak": 425, "Mud Bomb": 426, "Psycho Cut": 427, "Zen Headbutt": 428, "Mirror Shot": 429, "Flash Cannon": 430, "Rock Climb": 431, "Defog": 432, "Trick Room": 433, "Draco Meteor": 434, "Discharge": 435, "Lava Plume": 436, "Leaf Storm": 437, "Power Whip": 438, "Rock Wrecker": 439, "Cross Poison": 440, "Gunk Shot": 441, "Iron Head": 442, "Magnet Bomb": 443, "Stone Edge": 444, "Captivate": 445, "Stealth Rock": 446, "Grass Knot": 447, "Chatter": 448, "Judgment": 449, "Bug Bite": 450, "Charge Beam": 451, "Wood Hammer": 452, "Aqua Jet": 453, "Attack Order": 454, "Defend Order": 455, "Heal Order": 456, "Head Smash": 457, "Double Hit": 458, "Roarof Time": 459, "Spacial Rend": 460, "Lunar Dance": 461, "Crush Grip": 462, "Magma Storm": 463, "Dark Void": 464, "Seed Flare": 465, "Ominous Wind": 466, "Shadow Force": 467} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_5.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_5.json new file mode 100644 index 0000000..9ed234f --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_5.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165, "Sketch": 166, "Triple Kick": 167, "Thief": 168, "Spider Web": 169, "Mind Reader": 170, "Nightmare": 171, "Flame Wheel": 172, "Snore": 173, "Curse": 174, "Flail": 175, "Conversion2": 176, "Aeroblast": 177, "Cotton Spore": 178, "Reversal": 179, "Spite": 180, "Powder Snow": 181, "Protect": 182, "Mach Punch": 183, "Scary Face": 184, "Feint Attack": 185, "Sweet Kiss": 186, "Belly Drum": 187, "Sludge Bomb": 188, "Mud Slap": 189, "Octazooka": 190, "Spikes": 191, "Zap Cannon": 192, "Foresight": 193, "Destiny Bond": 194, "Perish Song": 195, "Icy Wind": 196, "Detect": 197, "Bone Rush": 198, "Lock On": 199, "Outrage": 200, "Sandstorm": 201, "Giga Drain": 202, "Endure": 203, "Charm": 204, "Rollout": 205, "False Swipe": 206, "Swagger": 207, "Milk Drink": 208, "Spark": 209, "Fury Cutter": 210, "Steel Wing": 211, "Mean Look": 212, "Attract": 213, "Sleep Talk": 214, "Heal Bell": 215, "Return": 216, "Present": 217, "Frustration": 218, "Safeguard": 219, "Pain Split": 220, "Sacred Fire": 221, "Magnitude": 222, "Dynamic Punch": 223, "Megahorn": 224, "Dragon Breath": 225, "Baton Pass": 226, "Encore": 227, "Pursuit": 228, "Rapid Spin": 229, "Sweet Scent": 230, "Iron Tail": 231, "Metal Claw": 232, "Vital Throw": 233, "Morning Sun": 234, "Synthesis": 235, "Moonlight": 236, "Hidden Power": 237, "Cross Chop": 238, "Twister": 239, "Rain Dance": 240, "Sunny Day": 241, "Crunch": 242, "Mirror Coat": 243, "Psych Up": 244, "Extreme Speed": 245, "Ancient Power": 246, "Shadow Ball": 247, "Future Sight": 248, "Rock Smash": 249, "Whirlpool": 250, "Beat Up": 251, "Fake Out": 252, "Uproar": 253, "Stockpile": 254, "Spit Up": 255, "Swallow": 256, "Heat Wave": 257, "Hail": 258, "Torment": 259, "Flatter": 260, "Will O Wisp": 261, "Memento": 262, "Facade": 263, "Focus Punch": 264, "Smelling Salts": 265, "Follow Me": 266, "Nature Power": 267, "Charge": 268, "Taunt": 269, "Helping Hand": 270, "Trick": 271, "Role Play": 272, "Wish": 273, "Assist": 274, "Ingrain": 275, "Superpower": 276, "Magic Coat": 277, "Recycle": 278, "Revenge": 279, "Brick Break": 280, "Yawn": 281, "Knock Off": 282, "Endeavor": 283, "Eruption": 284, "Skill Swap": 285, "Imprison": 286, "Refresh": 287, "Grudge": 288, "Snatch": 289, "Secret Power": 290, "Dive": 291, "Arm Thrust": 292, "Camouflage": 293, "Tail Glow": 294, "Luster Purge": 295, "Mist Ball": 296, "Feather Dance": 297, "Teeter Dance": 298, "Blaze Kick": 299, "Mud Sport": 300, "Ice Ball": 301, "Needle Arm": 302, "Slack Off": 303, "Hyper Voice": 304, "Poison Fang": 305, "Crush Claw": 306, "Blast Burn": 307, "Hydro Cannon": 308, "Meteor Mash": 309, "Astonish": 310, "Weather Ball": 311, "Aromatherapy": 312, "Fake Tears": 313, "Air Cutter": 314, "Overheat": 315, "Odor Sleuth": 316, "Rock Tomb": 317, "Silver Wind": 318, "Metal Sound": 319, "Grass Whistle": 320, "Tickle": 321, "Cosmic Power": 322, "Water Spout": 323, "Signal Beam": 324, "Shadow Punch": 325, "Extrasensory": 326, "Sky Uppercut": 327, "Sand Tomb": 328, "Sheer Cold": 329, "Muddy Water": 330, "Bullet Seed": 331, "Aerial Ace": 332, "Icicle Spear": 333, "Iron Defense": 334, "Block": 335, "Howl": 336, "Dragon Claw": 337, "Frenzy Plant": 338, "Bulk Up": 339, "Bounce": 340, "Mud Shot": 341, "Poison Tail": 342, "Covet": 343, "Volt Tackle": 344, "Magical Leaf": 345, "Water Sport": 346, "Calm Mind": 347, "Leaf Blade": 348, "Dragon Dance": 349, "Rock Blast": 350, "Shock Wave": 351, "Water Pulse": 352, "Doom Desire": 353, "Psycho Boost": 354, "Roost": 355, "Gravity": 356, "Miracle Eye": 357, "Wake Up Slap": 358, "Hammer Arm": 359, "Gyro Ball": 360, "Healing Wish": 361, "Brine": 362, "Natural Gift": 363, "Feint": 364, "Pluck": 365, "Tailwind": 366, "Acupressure": 367, "Metal Burst": 368, "Uturn": 369, "Close Combat": 370, "Payback": 371, "Assurance": 372, "Embargo": 373, "Fling": 374, "Psycho Shift": 375, "Trump Card": 376, "Heal Block": 377, "Wring Out": 378, "Power Trick": 379, "Gastro Acid": 380, "Lucky Chant": 381, "Me First": 382, "Copycat": 383, "Power Swap": 384, "Guard Swap": 385, "Punishment": 386, "Last Resort": 387, "Worry Seed": 388, "Sucker Punch": 389, "Toxic Spikes": 390, "Heart Swap": 391, "Aqua Ring": 392, "Magnet Rise": 393, "Flare Blitz": 394, "Force Palm": 395, "Aura Sphere": 396, "Rock Polish": 397, "Poison Jab": 398, "Dark Pulse": 399, "Night Slash": 400, "Aqua Tail": 401, "Seed Bomb": 402, "Air Slash": 403, "X Scissor": 404, "Bug Buzz": 405, "Dragon Pulse": 406, "Dragon Rush": 407, "Power Gem": 408, "Drain Punch": 409, "Vacuum Wave": 410, "Focus Blast": 411, "Energy Ball": 412, "Brave Bird": 413, "Earth Power": 414, "Switcheroo": 415, "Giga Impact": 416, "Nasty Plot": 417, "Bullet Punch": 418, "Avalanche": 419, "Ice Shard": 420, "Shadow Claw": 421, "Thunder Fang": 422, "Ice Fang": 423, "Fire Fang": 424, "Shadow Sneak": 425, "Mud Bomb": 426, "Psycho Cut": 427, "Zen Headbutt": 428, "Mirror Shot": 429, "Flash Cannon": 430, "Rock Climb": 431, "Defog": 432, "Trick Room": 433, "Draco Meteor": 434, "Discharge": 435, "Lava Plume": 436, "Leaf Storm": 437, "Power Whip": 438, "Rock Wrecker": 439, "Cross Poison": 440, "Gunk Shot": 441, "Iron Head": 442, "Magnet Bomb": 443, "Stone Edge": 444, "Captivate": 445, "Stealth Rock": 446, "Grass Knot": 447, "Chatter": 448, "Judgment": 449, "Bug Bite": 450, "Charge Beam": 451, "Wood Hammer": 452, "Aqua Jet": 453, "Attack Order": 454, "Defend Order": 455, "Heal Order": 456, "Head Smash": 457, "Double Hit": 458, "Roarof Time": 459, "Spacial Rend": 460, "Lunar Dance": 461, "Crush Grip": 462, "Magma Storm": 463, "Dark Void": 464, "Seed Flare": 465, "Ominous Wind": 466, "Shadow Force": 467, "Hone Claws": 468, "Wide Guard": 469, "Guard Split": 470, "Power Split": 471, "Wonder Room": 472, "Psyshock": 473, "Venoshock": 474, "Autotomize": 475, "Rage Powder": 476, "Telekinesis": 477, "Magic Room": 478, "Smack Down": 479, "Storm Throw": 480, "Flame Burst": 481, "Sludge Wave": 482, "Quiver Dance": 483, "Heavy Slam": 484, "Synchronoise": 485, "Electro Ball": 486, "Soak": 487, "Flame Charge": 488, "Coil": 489, "Low Sweep": 490, "Acid Spray": 491, "Foul Play": 492, "Simple Beam": 493, "Entrainment": 494, "After You": 495, "Round": 496, "Echoed Voice": 497, "Chip Away": 498, "Clear Smog": 499, "Stored Power": 500, "Quick Guard": 501, "Ally Switch": 502, "Scald": 503, "Shell Smash": 504, "Heal Pulse": 505, "Hex": 506, "Sky Drop": 507, "Shift Gear": 508, "Circle Throw": 509, "Incinerate": 510, "Quash": 511, "Acrobatics": 512, "Reflect Type": 513, "Retaliate": 514, "Final Gambit": 515, "Bestow": 516, "Inferno": 517, "Water Pledge": 518, "Fire Pledge": 519, "Grass Pledge": 520, "Volt Switch": 521, "Struggle Bug": 522, "Bulldoze": 523, "Frost Breath": 524, "Dragon Tail": 525, "Work Up": 526, "Electroweb": 527, "Wild Charge": 528, "Drill Run": 529, "Dual Chop": 530, "Heart Stamp": 531, "Horn Leech": 532, "Sacred Sword": 533, "Razor Shell": 534, "Heat Crash": 535, "Leaf Tornado": 536, "Steamroller": 537, "Cotton Guard": 538, "Night Daze": 539, "Psystrike": 540, "Tail Slap": 541, "Hurricane": 542, "Head Charge": 543, "Gear Grind": 544, "Searing Shot": 545, "Techno Blast": 546, "Relic Song": 547, "Secret Sword": 548, "Glaciate": 549, "Bolt Strike": 550, "Blue Flare": 551, "Fiery Dance": 552, "Freeze Shock": 553, "Ice Burn": 554, "Snarl": 555, "Icicle Crash": 556, "Vcreate": 557, "Fusion Flare": 558, "Fusion Bolt": 559} \ No newline at end of file diff --git a/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_6.json b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_6.json new file mode 100644 index 0000000..6e6b21f --- /dev/null +++ b/server/pokepoll/static/pokepoll/pokemon_move_to_id_gen_6.json @@ -0,0 +1 @@ +{"None": 0, "Pound": 1, "Karate Chop": 2, "Double Slap": 3, "Comet Punch": 4, "Mega Punch": 5, "Pay Day": 6, "Fire Punch": 7, "Ice Punch": 8, "Thunder Punch": 9, "Scratch": 10, "Vise Grip": 11, "Guillotine": 12, "Razor Wind": 13, "Swords Dance": 14, "Cut": 15, "Gust": 16, "Wing Attack": 17, "Whirlwind": 18, "Fly": 19, "Bind": 20, "Slam": 21, "Vine Whip": 22, "Stomp": 23, "Double Kick": 24, "Mega Kick": 25, "Jump Kick": 26, "Rolling Kick": 27, "Sand Attack": 28, "Headbutt": 29, "Horn Attack": 30, "Fury Attack": 31, "Horn Drill": 32, "Tackle": 33, "Body Slam": 34, "Wrap": 35, "Take Down": 36, "Thrash": 37, "Double Edge": 38, "Tail Whip": 39, "Poison Sting": 40, "Twineedle": 41, "Pin Missile": 42, "Leer": 43, "Bite": 44, "Growl": 45, "Roar": 46, "Sing": 47, "Supersonic": 48, "Sonic Boom": 49, "Disable": 50, "Acid": 51, "Ember": 52, "Flamethrower": 53, "Mist": 54, "Water Gun": 55, "Hydro Pump": 56, "Surf": 57, "Ice Beam": 58, "Blizzard": 59, "Psybeam": 60, "Bubble Beam": 61, "Aurora Beam": 62, "Hyper Beam": 63, "Peck": 64, "Drill Peck": 65, "Submission": 66, "Low Kick": 67, "Counter": 68, "Seismic Toss": 69, "Strength": 70, "Absorb": 71, "Mega Drain": 72, "Leech Seed": 73, "Growth": 74, "Razor Leaf": 75, "Solar Beam": 76, "Poison Powder": 77, "Stun Spore": 78, "Sleep Powder": 79, "Petal Dance": 80, "String Shot": 81, "Dragon Rage": 82, "Fire Spin": 83, "Thunder Shock": 84, "Thunderbolt": 85, "Thunder Wave": 86, "Thunder": 87, "Rock Throw": 88, "Earthquake": 89, "Fissure": 90, "Dig": 91, "Toxic": 92, "Confusion": 93, "Psychic": 94, "Hypnosis": 95, "Meditate": 96, "Agility": 97, "Quick Attack": 98, "Rage": 99, "Teleport": 100, "Night Shade": 101, "Mimic": 102, "Screech": 103, "Double Team": 104, "Recover": 105, "Harden": 106, "Minimize": 107, "Smokescreen": 108, "Confuse Ray": 109, "Withdraw": 110, "Defense Curl": 111, "Barrier": 112, "Light Screen": 113, "Haze": 114, "Reflect": 115, "Focus Energy": 116, "Bide": 117, "Metronome": 118, "Mirror Move": 119, "Self Destruct": 120, "Egg Bomb": 121, "Lick": 122, "Smog": 123, "Sludge": 124, "Bone Club": 125, "Fire Blast": 126, "Waterfall": 127, "Clamp": 128, "Swift": 129, "Skull Bash": 130, "Spike Cannon": 131, "Constrict": 132, "Amnesia": 133, "Kinesis": 134, "Soft Boiled": 135, "High Jump Kick": 136, "Glare": 137, "Dream Eater": 138, "Poison Gas": 139, "Barrage": 140, "Leech Life": 141, "Lovely Kiss": 142, "Sky Attack": 143, "Transform": 144, "Bubble": 145, "Dizzy Punch": 146, "Spore": 147, "Flash": 148, "Psywave": 149, "Splash": 150, "Acid Armor": 151, "Crabhammer": 152, "Explosion": 153, "Fury Swipes": 154, "Bonemerang": 155, "Rest": 156, "Rock Slide": 157, "Hyper Fang": 158, "Sharpen": 159, "Conversion": 160, "Tri Attack": 161, "Super Fang": 162, "Slash": 163, "Substitute": 164, "Struggle": 165, "Sketch": 166, "Triple Kick": 167, "Thief": 168, "Spider Web": 169, "Mind Reader": 170, "Nightmare": 171, "Flame Wheel": 172, "Snore": 173, "Curse": 174, "Flail": 175, "Conversion2": 176, "Aeroblast": 177, "Cotton Spore": 178, "Reversal": 179, "Spite": 180, "Powder Snow": 181, "Protect": 182, "Mach Punch": 183, "Scary Face": 184, "Feint Attack": 185, "Sweet Kiss": 186, "Belly Drum": 187, "Sludge Bomb": 188, "Mud Slap": 189, "Octazooka": 190, "Spikes": 191, "Zap Cannon": 192, "Foresight": 193, "Destiny Bond": 194, "Perish Song": 195, "Icy Wind": 196, "Detect": 197, "Bone Rush": 198, "Lock On": 199, "Outrage": 200, "Sandstorm": 201, "Giga Drain": 202, "Endure": 203, "Charm": 204, "Rollout": 205, "False Swipe": 206, "Swagger": 207, "Milk Drink": 208, "Spark": 209, "Fury Cutter": 210, "Steel Wing": 211, "Mean Look": 212, "Attract": 213, "Sleep Talk": 214, "Heal Bell": 215, "Return": 216, "Present": 217, "Frustration": 218, "Safeguard": 219, "Pain Split": 220, "Sacred Fire": 221, "Magnitude": 222, "Dynamic Punch": 223, "Megahorn": 224, "Dragon Breath": 225, "Baton Pass": 226, "Encore": 227, "Pursuit": 228, "Rapid Spin": 229, "Sweet Scent": 230, "Iron Tail": 231, "Metal Claw": 232, "Vital Throw": 233, "Morning Sun": 234, "Synthesis": 235, "Moonlight": 236, "Hidden Power": 237, "Cross Chop": 238, "Twister": 239, "Rain Dance": 240, "Sunny Day": 241, "Crunch": 242, "Mirror Coat": 243, "Psych Up": 244, "Extreme Speed": 245, "Ancient Power": 246, "Shadow Ball": 247, "Future Sight": 248, "Rock Smash": 249, "Whirlpool": 250, "Beat Up": 251, "Fake Out": 252, "Uproar": 253, "Stockpile": 254, "Spit Up": 255, "Swallow": 256, "Heat Wave": 257, "Hail": 258, "Torment": 259, "Flatter": 260, "Will O Wisp": 261, "Memento": 262, "Facade": 263, "Focus Punch": 264, "Smelling Salts": 265, "Follow Me": 266, "Nature Power": 267, "Charge": 268, "Taunt": 269, "Helping Hand": 270, "Trick": 271, "Role Play": 272, "Wish": 273, "Assist": 274, "Ingrain": 275, "Superpower": 276, "Magic Coat": 277, "Recycle": 278, "Revenge": 279, "Brick Break": 280, "Yawn": 281, "Knock Off": 282, "Endeavor": 283, "Eruption": 284, "Skill Swap": 285, "Imprison": 286, "Refresh": 287, "Grudge": 288, "Snatch": 289, "Secret Power": 290, "Dive": 291, "Arm Thrust": 292, "Camouflage": 293, "Tail Glow": 294, "Luster Purge": 295, "Mist Ball": 296, "Feather Dance": 297, "Teeter Dance": 298, "Blaze Kick": 299, "Mud Sport": 300, "Ice Ball": 301, "Needle Arm": 302, "Slack Off": 303, "Hyper Voice": 304, "Poison Fang": 305, "Crush Claw": 306, "Blast Burn": 307, "Hydro Cannon": 308, "Meteor Mash": 309, "Astonish": 310, "Weather Ball": 311, "Aromatherapy": 312, "Fake Tears": 313, "Air Cutter": 314, "Overheat": 315, "Odor Sleuth": 316, "Rock Tomb": 317, "Silver Wind": 318, "Metal Sound": 319, "Grass Whistle": 320, "Tickle": 321, "Cosmic Power": 322, "Water Spout": 323, "Signal Beam": 324, "Shadow Punch": 325, "Extrasensory": 326, "Sky Uppercut": 327, "Sand Tomb": 328, "Sheer Cold": 329, "Muddy Water": 330, "Bullet Seed": 331, "Aerial Ace": 332, "Icicle Spear": 333, "Iron Defense": 334, "Block": 335, "Howl": 336, "Dragon Claw": 337, "Frenzy Plant": 338, "Bulk Up": 339, "Bounce": 340, "Mud Shot": 341, "Poison Tail": 342, "Covet": 343, "Volt Tackle": 344, "Magical Leaf": 345, "Water Sport": 346, "Calm Mind": 347, "Leaf Blade": 348, "Dragon Dance": 349, "Rock Blast": 350, "Shock Wave": 351, "Water Pulse": 352, "Doom Desire": 353, "Psycho Boost": 354, "Roost": 355, "Gravity": 356, "Miracle Eye": 357, "Wake Up Slap": 358, "Hammer Arm": 359, "Gyro Ball": 360, "Healing Wish": 361, "Brine": 362, "Natural Gift": 363, "Feint": 364, "Pluck": 365, "Tailwind": 366, "Acupressure": 367, "Metal Burst": 368, "Uturn": 369, "Close Combat": 370, "Payback": 371, "Assurance": 372, "Embargo": 373, "Fling": 374, "Psycho Shift": 375, "Trump Card": 376, "Heal Block": 377, "Wring Out": 378, "Power Trick": 379, "Gastro Acid": 380, "Lucky Chant": 381, "Me First": 382, "Copycat": 383, "Power Swap": 384, "Guard Swap": 385, "Punishment": 386, "Last Resort": 387, "Worry Seed": 388, "Sucker Punch": 389, "Toxic Spikes": 390, "Heart Swap": 391, "Aqua Ring": 392, "Magnet Rise": 393, "Flare Blitz": 394, "Force Palm": 395, "Aura Sphere": 396, "Rock Polish": 397, "Poison Jab": 398, "Dark Pulse": 399, "Night Slash": 400, "Aqua Tail": 401, "Seed Bomb": 402, "Air Slash": 403, "X Scissor": 404, "Bug Buzz": 405, "Dragon Pulse": 406, "Dragon Rush": 407, "Power Gem": 408, "Drain Punch": 409, "Vacuum Wave": 410, "Focus Blast": 411, "Energy Ball": 412, "Brave Bird": 413, "Earth Power": 414, "Switcheroo": 415, "Giga Impact": 416, "Nasty Plot": 417, "Bullet Punch": 418, "Avalanche": 419, "Ice Shard": 420, "Shadow Claw": 421, "Thunder Fang": 422, "Ice Fang": 423, "Fire Fang": 424, "Shadow Sneak": 425, "Mud Bomb": 426, "Psycho Cut": 427, "Zen Headbutt": 428, "Mirror Shot": 429, "Flash Cannon": 430, "Rock Climb": 431, "Defog": 432, "Trick Room": 433, "Draco Meteor": 434, "Discharge": 435, "Lava Plume": 436, "Leaf Storm": 437, "Power Whip": 438, "Rock Wrecker": 439, "Cross Poison": 440, "Gunk Shot": 441, "Iron Head": 442, "Magnet Bomb": 443, "Stone Edge": 444, "Captivate": 445, "Stealth Rock": 446, "Grass Knot": 447, "Chatter": 448, "Judgment": 449, "Bug Bite": 450, "Charge Beam": 451, "Wood Hammer": 452, "Aqua Jet": 453, "Attack Order": 454, "Defend Order": 455, "Heal Order": 456, "Head Smash": 457, "Double Hit": 458, "Roarof Time": 459, "Spacial Rend": 460, "Lunar Dance": 461, "Crush Grip": 462, "Magma Storm": 463, "Dark Void": 464, "Seed Flare": 465, "Ominous Wind": 466, "Shadow Force": 467, "Hone Claws": 468, "Wide Guard": 469, "Guard Split": 470, "Power Split": 471, "Wonder Room": 472, "Psyshock": 473, "Venoshock": 474, "Autotomize": 475, "Rage Powder": 476, "Telekinesis": 477, "Magic Room": 478, "Smack Down": 479, "Storm Throw": 480, "Flame Burst": 481, "Sludge Wave": 482, "Quiver Dance": 483, "Heavy Slam": 484, "Synchronoise": 485, "Electro Ball": 486, "Soak": 487, "Flame Charge": 488, "Coil": 489, "Low Sweep": 490, "Acid Spray": 491, "Foul Play": 492, "Simple Beam": 493, "Entrainment": 494, "After You": 495, "Round": 496, "Echoed Voice": 497, "Chip Away": 498, "Clear Smog": 499, "Stored Power": 500, "Quick Guard": 501, "Ally Switch": 502, "Scald": 503, "Shell Smash": 504, "Heal Pulse": 505, "Hex": 506, "Sky Drop": 507, "Shift Gear": 508, "Circle Throw": 509, "Incinerate": 510, "Quash": 511, "Acrobatics": 512, "Reflect Type": 513, "Retaliate": 514, "Final Gambit": 515, "Bestow": 516, "Inferno": 517, "Water Pledge": 518, "Fire Pledge": 519, "Grass Pledge": 520, "Volt Switch": 521, "Struggle Bug": 522, "Bulldoze": 523, "Frost Breath": 524, "Dragon Tail": 525, "Work Up": 526, "Electroweb": 527, "Wild Charge": 528, "Drill Run": 529, "Dual Chop": 530, "Heart Stamp": 531, "Horn Leech": 532, "Sacred Sword": 533, "Razor Shell": 534, "Heat Crash": 535, "Leaf Tornado": 536, "Steamroller": 537, "Cotton Guard": 538, "Night Daze": 539, "Psystrike": 540, "Tail Slap": 541, "Hurricane": 542, "Head Charge": 543, "Gear Grind": 544, "Searing Shot": 545, "Techno Blast": 546, "Relic Song": 547, "Secret Sword": 548, "Glaciate": 549, "Bolt Strike": 550, "Blue Flare": 551, "Fiery Dance": 552, "Freeze Shock": 553, "Ice Burn": 554, "Snarl": 555, "Icicle Crash": 556, "Vcreate": 557, "Fusion Flare": 558, "Fusion Bolt": 559, "Flying Press": 560, "Mat Block": 561, "Belch": 562, "Rototiller": 563, "Sticky Web": 564, "Fell Stinger": 565, "Phantom Force": 566, "Trickor Treat": 567, "Noble Roar": 568, "Ion Deluge": 569, "Parabolic Charge": 570, "Forests Curse": 571, "Petal Blizzard": 572, "Freeze Dry": 573, "Disarming Voice": 574, "Parting Shot": 575, "Topsy Turvy": 576, "Draining Kiss": 577, "Crafty Shield": 578, "Flower Shield": 579, "Grassy Terrain": 580, "Misty Terrain": 581, "Electrify": 582, "Play Rough": 583, "Fairy Wind": 584, "Moonblast": 585, "Boomburst": 586, "Fairy Lock": 587, "Kings Shield": 588, "Play Nice": 589, "Confide": 590, "Diamond Storm": 591, "Steam Eruption": 592, "Hyperspace Hole": 593, "Water Shuriken": 594, "Mystical Fire": 595, "Spiky Shield": 596, "Aromatic Mist": 597, "Eerie Impulse": 598, "Venom Drench": 599, "Powder": 600, "Geomancy": 601, "Magnetic Flux": 602, "Happy Hour": 603, "Electric Terrain": 604, "Dazzling Gleam": 605, "Celebrate": 606, "Hold Hands": 607, "Baby Doll Eyes": 608, "Nuzzle": 609, "Hold Back": 610, "Infestation": 611, "Power Up Punch": 612, "Oblivion Wing": 613, "Thousand Arrows": 614, "Thousand Waves": 615, "Lands Wrath": 616, "Lightof Ruin": 617, "Origin Pulse": 618, "Precipice Blades": 619, "Dragon Ascent": 620} \ No newline at end of file diff --git a/server/egglocke/pokepoll/static/pokepoll/pokemon_name_to_id.json b/server/pokepoll/static/pokepoll/pokemon_name_to_id.json similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/pokemon_name_to_id.json rename to server/pokepoll/static/pokepoll/pokemon_name_to_id.json diff --git a/server/egglocke/pokepoll/static/pokepoll/style.css b/server/pokepoll/static/pokepoll/style.css similarity index 100% rename from server/egglocke/pokepoll/static/pokepoll/style.css rename to server/pokepoll/static/pokepoll/style.css diff --git a/server/pokepoll/static/pokepoll/uifunctions.js b/server/pokepoll/static/pokepoll/uifunctions.js new file mode 100644 index 0000000..7a63c04 --- /dev/null +++ b/server/pokepoll/static/pokepoll/uifunctions.js @@ -0,0 +1,27 @@ + + +async function populateIcons() { + let icons = document.getElementsByClassName("pokemon-icon"); + for (let i = 0; i < icons.length; i++) { + let dexNumber = icons[i].getAttribute("pokemon-dex"); + let isShiny = icons[i].getAttribute("pokemon_is_shiny"); + console.log(dexNumber, isShiny) + // convert to boolean + isShiny = isShiny === "true" || isShiny === "True"; + + console.log(isShiny); + let spriteURL = await getPokemonSpriteURL(dexNumber, isShiny); + + icons[i].src = spriteURL; + } +} + +function getMultiSelectToolForOS() { + let OS = navigator.platform; + if (OS.includes("Mac")) { + return "⌘ Command"; + } else { + return "^ Control"; + } +} + diff --git a/server/egglocke/pokepoll/support/ability_enum.cs b/server/pokepoll/support/ability_enum.cs similarity index 100% rename from server/egglocke/pokepoll/support/ability_enum.cs rename to server/pokepoll/support/ability_enum.cs diff --git a/server/egglocke/pokepoll/support/cachedconstants.py b/server/pokepoll/support/cachedconstants.py similarity index 75% rename from server/egglocke/pokepoll/support/cachedconstants.py rename to server/pokepoll/support/cachedconstants.py index d4d56b3..3a1974c 100644 --- a/server/egglocke/pokepoll/support/cachedconstants.py +++ b/server/pokepoll/support/cachedconstants.py @@ -14,10 +14,12 @@ ## Filepahs POKEDEX_FILEPATH = '../static/pokepoll/pokedex.json' ABILITY_ENUM_PATH = 'ability_enum.cs' +MOVE_ENUM_PATH = 'move_enum.cs' FILE_1_EXPORT_PATH = '../static/pokepoll/pokemon_name_to_id.json' FILE_2_EXPORT_PATH = '../static/pokepoll/all_pokemon_names.json' FILE_3_EXPORT_PATH_FORMAT_STRING = '../static/pokepoll/pokemon_ability_to_id_gen_{}.json' +FILE_4_EXPORT_PATH_FORMAT_STRING = '../static/pokepoll/pokemon_move_to_id_gen_{}.json' ALL_POKEMON_NAMES = [ ] @@ -35,7 +37,7 @@ MAX_ABILITY_DICT = { 3: 75, - 4: 123, + 4: 124, 5: 164, 6: 191, 7: 233, @@ -43,6 +45,16 @@ 9: 305 } +MAX_MOVE_DICT = { + 1: 166, + 2: 252, + 3: 355, + 4: 468, + 5: 560, + 6: 621 +} + + POKEMON_NAME_TO_ID = { } @@ -64,6 +76,34 @@ def get_pokemon_name_to_id(pokedex): return pokemon_name_to_id + +def generate_nature_enum(): + post_gen_3_natures = ["Hardy", "Lonley", "Brave", "Adamant", "Naughty", "Bold", "Docile", "Relaxed", "Impish", "Lax", "Timid", "Hasty", "Serious", "Jolly", "Naive", "Modest", "Mild", "Quiet", "Bashful", "Rash", "Calm", "Gentle", "Sassy", "Careful", "Quirky"] + gen_3_natures = ["Lonely", "Brave", "Adamant", "Naughty", "Bold", "Relaxed", "Impish", "Lax", "Timid", "Hasty", "Jolly", "Naive", "Modest", "Mild", "Quiet", "Rash", "Calm", "Gentle", "Sassy", "Careful"] + + # create a dictionary that maps the nature to the index, using post_gen_3_natures as the key + post_gen_3_nature_enum = {} + gen3_nature_enum = {} + + counter = 0 + for nature in post_gen_3_natures: + + if nature in gen_3_natures: + gen3_nature_enum[nature] = counter + + post_gen_3_nature_enum[nature] = counter + + + counter += 1 + + # Also add random nature + post_gen_3_nature_enum["Random"] = counter + gen3_nature_enum["Random"] = counter + + return post_gen_3_nature_enum, gen3_nature_enum + + + def decode_c_sharp_enum(ENUM_PATH): ''' @@ -188,6 +228,9 @@ def main(): # file 3: ability lookup of ability_id to ability_name ability_lookup = decode_c_sharp_enum(ABILITY_ENUM_PATH) + # file 4: move lookup of move_id to move_name + move_lookup = decode_c_sharp_enum(MOVE_ENUM_PATH) + with open(FILE_1_EXPORT_PATH, 'w') as f: json.dump(pokemon_name_to_id, f) @@ -209,6 +252,18 @@ def main(): with open(FILE_3_EXPORT_PATH_FORMAT_STRING.format(terminating_index), 'w') as f: json.dump(ability_lookup_export, f) + for terminating_index in MAX_MOVE_DICT: + move_slice = move_lookup[:MAX_MOVE_DICT[terminating_index]] + move_lookup_export = {} + + counter = 0 + for move in move_slice: + move_lookup_export[move] = counter + counter += 1 + + with open(FILE_4_EXPORT_PATH_FORMAT_STRING.format(terminating_index), 'w') as f: + json.dump(move_lookup_export, f) + # Also dump the full ability lookup master_ability_lookup = {} counter = 0 @@ -218,6 +273,21 @@ def main(): with open(FILE_3_EXPORT_PATH_FORMAT_STRING.format("full"), 'w') as f: json.dump(master_ability_lookup, f) + + + # get nature enums and dump them + post_gen_3_nature_enum, gen3_nature_enum = generate_nature_enum() + + with open('../static/pokepoll/nature_enum.json', 'w') as f: + json.dump(post_gen_3_nature_enum, f) + + with open('../static/pokepoll/gen3_nature_enum.json', 'w') as f: + json.dump(gen3_nature_enum, f) + + + + + diff --git a/server/pokepoll/support/move_enum.cs b/server/pokepoll/support/move_enum.cs new file mode 100644 index 0000000..b68ae26 --- /dev/null +++ b/server/pokepoll/support/move_enum.cs @@ -0,0 +1,929 @@ +namespace PKHeX.Core; + +/// +/// Move IDs for the corresponding English move name. +/// +public enum Move : ushort +{ + None, + Pound, + KarateChop, + DoubleSlap, + CometPunch, + MegaPunch, + PayDay, + FirePunch, + IcePunch, + ThunderPunch, + Scratch, + ViseGrip, + Guillotine, + RazorWind, + SwordsDance, + Cut, + Gust, + WingAttack, + Whirlwind, + Fly, + Bind, + Slam, + VineWhip, + Stomp, + DoubleKick, + MegaKick, + JumpKick, + RollingKick, + SandAttack, + Headbutt, + HornAttack, + FuryAttack, + HornDrill, + Tackle, + BodySlam, + Wrap, + TakeDown, + Thrash, + DoubleEdge, + TailWhip, + PoisonSting, + Twineedle, + PinMissile, + Leer, + Bite, + Growl, + Roar, + Sing, + Supersonic, + SonicBoom, + Disable, + Acid, + Ember, + Flamethrower, + Mist, + WaterGun, + HydroPump, + Surf, + IceBeam, + Blizzard, + Psybeam, + BubbleBeam, + AuroraBeam, + HyperBeam, + Peck, + DrillPeck, + Submission, + LowKick, + Counter, + SeismicToss, + Strength, + Absorb, + MegaDrain, + LeechSeed, + Growth, + RazorLeaf, + SolarBeam, + PoisonPowder, + StunSpore, + SleepPowder, + PetalDance, + StringShot, + DragonRage, + FireSpin, + ThunderShock, + Thunderbolt, + ThunderWave, + Thunder, + RockThrow, + Earthquake, + Fissure, + Dig, + Toxic, + Confusion, + Psychic, + Hypnosis, + Meditate, + Agility, + QuickAttack, + Rage, + Teleport, + NightShade, + Mimic, + Screech, + DoubleTeam, + Recover, + Harden, + Minimize, + Smokescreen, + ConfuseRay, + Withdraw, + DefenseCurl, + Barrier, + LightScreen, + Haze, + Reflect, + FocusEnergy, + Bide, + Metronome, + MirrorMove, + SelfDestruct, + EggBomb, + Lick, + Smog, + Sludge, + BoneClub, + FireBlast, + Waterfall, + Clamp, + Swift, + SkullBash, + SpikeCannon, + Constrict, + Amnesia, + Kinesis, + SoftBoiled, + HighJumpKick, + Glare, + DreamEater, + PoisonGas, + Barrage, + LeechLife, + LovelyKiss, + SkyAttack, + Transform, + Bubble, + DizzyPunch, + Spore, + Flash, + Psywave, + Splash, + AcidArmor, + Crabhammer, + Explosion, + FurySwipes, + Bonemerang, + Rest, + RockSlide, + HyperFang, + Sharpen, + Conversion, + TriAttack, + SuperFang, + Slash, + Substitute, + Struggle, + Sketch, + TripleKick, + Thief, + SpiderWeb, + MindReader, + Nightmare, + FlameWheel, + Snore, + Curse, + Flail, + Conversion2, + Aeroblast, + CottonSpore, + Reversal, + Spite, + PowderSnow, + Protect, + MachPunch, + ScaryFace, + FeintAttack, + SweetKiss, + BellyDrum, + SludgeBomb, + MudSlap, + Octazooka, + Spikes, + ZapCannon, + Foresight, + DestinyBond, + PerishSong, + IcyWind, + Detect, + BoneRush, + LockOn, + Outrage, + Sandstorm, + GigaDrain, + Endure, + Charm, + Rollout, + FalseSwipe, + Swagger, + MilkDrink, + Spark, + FuryCutter, + SteelWing, + MeanLook, + Attract, + SleepTalk, + HealBell, + Return, + Present, + Frustration, + Safeguard, + PainSplit, + SacredFire, + Magnitude, + DynamicPunch, + Megahorn, + DragonBreath, + BatonPass, + Encore, + Pursuit, + RapidSpin, + SweetScent, + IronTail, + MetalClaw, + VitalThrow, + MorningSun, + Synthesis, + Moonlight, + HiddenPower, + CrossChop, + Twister, + RainDance, + SunnyDay, + Crunch, + MirrorCoat, + PsychUp, + ExtremeSpeed, + AncientPower, + ShadowBall, + FutureSight, + RockSmash, + Whirlpool, + BeatUp, + FakeOut, + Uproar, + Stockpile, + SpitUp, + Swallow, + HeatWave, + Hail, + Torment, + Flatter, + WillOWisp, + Memento, + Facade, + FocusPunch, + SmellingSalts, + FollowMe, + NaturePower, + Charge, + Taunt, + HelpingHand, + Trick, + RolePlay, + Wish, + Assist, + Ingrain, + Superpower, + MagicCoat, + Recycle, + Revenge, + BrickBreak, + Yawn, + KnockOff, + Endeavor, + Eruption, + SkillSwap, + Imprison, + Refresh, + Grudge, + Snatch, + SecretPower, + Dive, + ArmThrust, + Camouflage, + TailGlow, + LusterPurge, + MistBall, + FeatherDance, + TeeterDance, + BlazeKick, + MudSport, + IceBall, + NeedleArm, + SlackOff, + HyperVoice, + PoisonFang, + CrushClaw, + BlastBurn, + HydroCannon, + MeteorMash, + Astonish, + WeatherBall, + Aromatherapy, + FakeTears, + AirCutter, + Overheat, + OdorSleuth, + RockTomb, + SilverWind, + MetalSound, + GrassWhistle, + Tickle, + CosmicPower, + WaterSpout, + SignalBeam, + ShadowPunch, + Extrasensory, + SkyUppercut, + SandTomb, + SheerCold, + MuddyWater, + BulletSeed, + AerialAce, + IcicleSpear, + IronDefense, + Block, + Howl, + DragonClaw, + FrenzyPlant, + BulkUp, + Bounce, + MudShot, + PoisonTail, + Covet, + VoltTackle, + MagicalLeaf, + WaterSport, + CalmMind, + LeafBlade, + DragonDance, + RockBlast, + ShockWave, + WaterPulse, + DoomDesire, + PsychoBoost, + Roost, + Gravity, + MiracleEye, + WakeUpSlap, + HammerArm, + GyroBall, + HealingWish, + Brine, + NaturalGift, + Feint, + Pluck, + Tailwind, + Acupressure, + MetalBurst, + Uturn, + CloseCombat, + Payback, + Assurance, + Embargo, + Fling, + PsychoShift, + TrumpCard, + HealBlock, + WringOut, + PowerTrick, + GastroAcid, + LuckyChant, + MeFirst, + Copycat, + PowerSwap, + GuardSwap, + Punishment, + LastResort, + WorrySeed, + SuckerPunch, + ToxicSpikes, + HeartSwap, + AquaRing, + MagnetRise, + FlareBlitz, + ForcePalm, + AuraSphere, + RockPolish, + PoisonJab, + DarkPulse, + NightSlash, + AquaTail, + SeedBomb, + AirSlash, + XScissor, + BugBuzz, + DragonPulse, + DragonRush, + PowerGem, + DrainPunch, + VacuumWave, + FocusBlast, + EnergyBall, + BraveBird, + EarthPower, + Switcheroo, + GigaImpact, + NastyPlot, + BulletPunch, + Avalanche, + IceShard, + ShadowClaw, + ThunderFang, + IceFang, + FireFang, + ShadowSneak, + MudBomb, + PsychoCut, + ZenHeadbutt, + MirrorShot, + FlashCannon, + RockClimb, + Defog, + TrickRoom, + DracoMeteor, + Discharge, + LavaPlume, + LeafStorm, + PowerWhip, + RockWrecker, + CrossPoison, + GunkShot, + IronHead, + MagnetBomb, + StoneEdge, + Captivate, + StealthRock, + GrassKnot, + Chatter, + Judgment, + BugBite, + ChargeBeam, + WoodHammer, + AquaJet, + AttackOrder, + DefendOrder, + HealOrder, + HeadSmash, + DoubleHit, + RoarofTime, + SpacialRend, + LunarDance, + CrushGrip, + MagmaStorm, + DarkVoid, + SeedFlare, + OminousWind, + ShadowForce, + HoneClaws, + WideGuard, + GuardSplit, + PowerSplit, + WonderRoom, + Psyshock, + Venoshock, + Autotomize, + RagePowder, + Telekinesis, + MagicRoom, + SmackDown, + StormThrow, + FlameBurst, + SludgeWave, + QuiverDance, + HeavySlam, + Synchronoise, + ElectroBall, + Soak, + FlameCharge, + Coil, + LowSweep, + AcidSpray, + FoulPlay, + SimpleBeam, + Entrainment, + AfterYou, + Round, + EchoedVoice, + ChipAway, + ClearSmog, + StoredPower, + QuickGuard, + AllySwitch, + Scald, + ShellSmash, + HealPulse, + Hex, + SkyDrop, + ShiftGear, + CircleThrow, + Incinerate, + Quash, + Acrobatics, + ReflectType, + Retaliate, + FinalGambit, + Bestow, + Inferno, + WaterPledge, + FirePledge, + GrassPledge, + VoltSwitch, + StruggleBug, + Bulldoze, + FrostBreath, + DragonTail, + WorkUp, + Electroweb, + WildCharge, + DrillRun, + DualChop, + HeartStamp, + HornLeech, + SacredSword, + RazorShell, + HeatCrash, + LeafTornado, + Steamroller, + CottonGuard, + NightDaze, + Psystrike, + TailSlap, + Hurricane, + HeadCharge, + GearGrind, + SearingShot, + TechnoBlast, + RelicSong, + SecretSword, + Glaciate, + BoltStrike, + BlueFlare, + FieryDance, + FreezeShock, + IceBurn, + Snarl, + IcicleCrash, + Vcreate, + FusionFlare, + FusionBolt, + FlyingPress, + MatBlock, + Belch, + Rototiller, + StickyWeb, + FellStinger, + PhantomForce, + TrickorTreat, + NobleRoar, + IonDeluge, + ParabolicCharge, + ForestsCurse, + PetalBlizzard, + FreezeDry, + DisarmingVoice, + PartingShot, + TopsyTurvy, + DrainingKiss, + CraftyShield, + FlowerShield, + GrassyTerrain, + MistyTerrain, + Electrify, + PlayRough, + FairyWind, + Moonblast, + Boomburst, + FairyLock, + KingsShield, + PlayNice, + Confide, + DiamondStorm, + SteamEruption, + HyperspaceHole, + WaterShuriken, + MysticalFire, + SpikyShield, + AromaticMist, + EerieImpulse, + VenomDrench, + Powder, + Geomancy, + MagneticFlux, + HappyHour, + ElectricTerrain, + DazzlingGleam, + Celebrate, + HoldHands, + BabyDollEyes, + Nuzzle, + HoldBack, + Infestation, + PowerUpPunch, + OblivionWing, + ThousandArrows, + ThousandWaves, + LandsWrath, + LightofRuin, + OriginPulse, + PrecipiceBlades, + DragonAscent, + HyperspaceFury, + BreakneckBlitzP, + BreakneckBlitzS, + AllOutPummelingP, + AllOutPummelingS, + SupersonicSkystrikeP, + SupersonicSkystrikeS, + AcidDownpourP, + AcidDownpourS, + TectonicRageP, + TectonicRageS, + ContinentalCrushP, + ContinentalCrushS, + SavageSpinOutP, + SavageSpinOutS, + NeverEndingNightmareP, + NeverEndingNightmareS, + CorkscrewCrashP, + CorkscrewCrashS, + InfernoOverdriveP, + InfernoOverdriveS, + HydroVortexP, + HydroVortexS, + BloomDoomP, + BloomDoomS, + GigavoltHavocP, + GigavoltHavocS, + ShatteredPsycheP, + ShatteredPsycheS, + SubzeroSlammerP, + SubzeroSlammerS, + DevastatingDrakeP, + DevastatingDrakeS, + BlackHoleEclipseP, + BlackHoleEclipseS, + TwinkleTackleP, + TwinkleTackleS, + Catastropika, + ShoreUp, + FirstImpression, + BanefulBunker, + SpiritShackle, + DarkestLariat, + SparklingAria, + IceHammer, + FloralHealing, + HighHorsepower, + StrengthSap, + SolarBlade, + Leafage, + Spotlight, + ToxicThread, + LaserFocus, + GearUp, + ThroatChop, + PollenPuff, + AnchorShot, + PsychicTerrain, + Lunge, + FireLash, + PowerTrip, + BurnUp, + SpeedSwap, + SmartStrike, + Purify, + RevelationDance, + CoreEnforcer, + TropKick, + Instruct, + BeakBlast, + ClangingScales, + DragonHammer, + BrutalSwing, + AuroraVeil, + SinisterArrowRaid, + MaliciousMoonsault, + OceanicOperetta, + GuardianofAlola, + SoulStealing7StarStrike, + StokedSparksurfer, + PulverizingPancake, + ExtremeEvoboost, + GenesisSupernova, + ShellTrap, + FleurCannon, + PsychicFangs, + StompingTantrum, + ShadowBone, + Accelerock, + Liquidation, + PrismaticLaser, + SpectralThief, + SunsteelStrike, + MoongeistBeam, + TearfulLook, + ZingZap, + NaturesMadness, + MultiAttack, + TenMVoltThunderbolt, + MindBlown, + PlasmaFists, + PhotonGeyser, + LightThatBurnstheSky, + SearingSunrazeSmash, + MenacingMoonrazeMaelstrom, + LetsSnuggleForever, + SplinteredStormshards, + ClangorousSoulblaze, + ZippyZap, + SplishySplash, + FloatyFall, + PikaPapow, + BouncyBubble, + BuzzyBuzz, + SizzlySlide, + GlitzyGlow, + BaddyBad, + SappySeed, + FreezyFrost, + SparklySwirl, + VeeveeVolley, + DoubleIronBash, + MaxGuard, + DynamaxCannon, + SnipeShot, + JawLock, + StuffCheeks, + NoRetreat, + TarShot, + MagicPowder, + DragonDarts, + Teatime, + Octolock, + BoltBeak, + FishiousRend, + CourtChange, + MaxFlare, + MaxFlutterby, + MaxLightning, + MaxStrike, + MaxKnuckle, + MaxPhantasm, + MaxHailstorm, + MaxOoze, + MaxGeyser, + MaxAirstream, + MaxStarfall, + MaxWyrmwind, + MaxMindstorm, + MaxRockfall, + MaxQuake, + MaxDarkness, + MaxOvergrowth, + MaxSteelspike, + ClangorousSoul, + BodyPress, + Decorate, + DrumBeating, + SnapTrap, + PyroBall, + BehemothBlade, + BehemothBash, + AuraWheel, + BreakingSwipe, + BranchPoke, + Overdrive, + AppleAcid, + GravApple, + SpiritBreak, + StrangeSteam, + LifeDew, + Obstruct, + FalseSurrender, + MeteorAssault, + Eternabeam, + SteelBeam, + ExpandingForce, + SteelRoller, + ScaleShot, + MeteorBeam, + ShellSideArm, + MistyExplosion, + GrassyGlide, + RisingVoltage, + TerrainPulse, + SkitterSmack, + BurningJealousy, + LashOut, + Poltergeist, + CorrosiveGas, + Coaching, + FlipTurn, + TripleAxel, + DualWingbeat, + ScorchingSands, + JungleHealing, + WickedBlow, + SurgingStrikes, + ThunderCage, + DragonEnergy, + FreezingGlare, + FieryWrath, + ThunderousKick, + GlacialLance, + AstralBarrage, + EerieSpell, + DireClaw, + PsyshieldBash, + PowerShift, + StoneAxe, + SpringtideStorm, + MysticalPower, + RagingFury, + WaveCrash, + Chloroblast, + MountainGale, + VictoryDance, + HeadlongRush, + BarbBarrage, + EsperWing, + BitterMalice, + Shelter, + TripleArrows, + InfernalParade, + CeaselessEdge, + BleakwindStorm, + WildboltStorm, + SandsearStorm, + LunarBlessing, + TakeHeart, + TeraBlast, + SilkTrap, + AxeKick, + LastRespects, + LuminaCrash, + OrderUp, + JetPunch, + SpicyExtract, + SpinOut, + PopulationBomb, + IceSpinner, + GlaiveRush, + RevivalBlessing, + SaltCure, + TripleDive, + MortalSpin, + Doodle, + FilletAway, + KowtowCleave, + FlowerTrick, + TorchSong, + AquaStep, + RagingBull, + MakeItRain, + Psyblade, + HydroSteam, + Ruination, + CollisionCourse, + ElectroDrift, + ShedTail, + ChillyReception, + TidyUp, + Snowscape, + Pounce, + Trailblaze, + ChillingWater, + HyperDrill, + TwinBeam, + RageFist, + ArmorCannon, + BitterBlade, + DoubleShock, + GigatonHammer, + Comeuppance, + AquaCutter, + BlazingTorque, + WickedTorque, + NoxiousTorque, + CombatTorque, + MagicalTorque, + BloodMoon, + MatchaGotcha, + SyrupBomb, + IvyCudgel, + ElectroShot, + TeraStarstorm, + FickleBeam, + BurningBulwark, + Thunderclap, + MightyCleave, + TachyonCutter, + HardPress, + DragonCheer, + AlluringVoice, + TemperFlare, + SupercellSlam, + PsychicNoise, + UpperHand, + MalignantChain, + MAX_COUNT, +} diff --git a/server/egglocke/pokepoll/support/robots.txt b/server/pokepoll/support/robots.txt similarity index 100% rename from server/egglocke/pokepoll/support/robots.txt rename to server/pokepoll/support/robots.txt diff --git a/server/egglocke/pokepoll/templates/pokepoll/detail.html b/server/pokepoll/templates/pokepoll/detail.html similarity index 80% rename from server/egglocke/pokepoll/templates/pokepoll/detail.html rename to server/pokepoll/templates/pokepoll/detail.html index 8a355fe..849f08f 100644 --- a/server/egglocke/pokepoll/templates/pokepoll/detail.html +++ b/server/pokepoll/templates/pokepoll/detail.html @@ -11,6 +11,20 @@

Submissime owo

+

IVs and EVs

+

IVs: {{ pokemon.pokemon_IV }}

+

EVs: {{ pokemon.pokemon_EV }}

+ +

Nature

+

{{ pokemon.pokemon_nature }}

+ +

Moves

+
    + {% for move in moves_pretty %} +
  • {{ move }}
  • + {% endfor %} +
+ diff --git a/server/egglocke/pokepoll/templates/pokepoll/home.html b/server/pokepoll/templates/pokepoll/home.html similarity index 84% rename from server/egglocke/pokepoll/templates/pokepoll/home.html rename to server/pokepoll/templates/pokepoll/home.html index 678a138..0a96676 100644 --- a/server/egglocke/pokepoll/templates/pokepoll/home.html +++ b/server/pokepoll/templates/pokepoll/home.html @@ -14,7 +14,8 @@

Evii's Egglocke Maker

  • Home
  • Submit an egg!
  • View Submissions!
  • -
  • Read the Blog Post
  • +
  • Request a save file
  • +
  • Read the Blog Post
  • GitHub Repo
  • @@ -41,7 +42,7 @@

    Most Recent Submission:


    - + {{ most_recent_pokemon.pokemon_nickname }} (submitted by {{ most_recent_pokemon.submitter.name }}) {% else %} @@ -58,19 +59,11 @@

    + diff --git a/server/egglocke/pokepoll/templates/pokepoll/master_submit.html b/server/pokepoll/templates/pokepoll/master_submit.html similarity index 60% rename from server/egglocke/pokepoll/templates/pokepoll/master_submit.html rename to server/pokepoll/templates/pokepoll/master_submit.html index fd255fd..dcf4f0d 100644 --- a/server/egglocke/pokepoll/templates/pokepoll/master_submit.html +++ b/server/pokepoll/templates/pokepoll/master_submit.html @@ -75,18 +75,41 @@

    Hewwo

    placeholder="Pokemon Species"> +
    + +

    Intended Pokemon Generation

    -

    Nickname (Limit 10 characters)

    + {{ pokemon_form.pokemon_intended_generation }} - +

    Other Generations this Pokemon can be used in

    + +

    + + + + +

    Nickname (Limit {{nickname_character_limit}} characters)

    + +
    + +

    Ability

    @@ -98,6 +121,8 @@

    Hewwo

    placeholder="Pokemon Ability"> + Shiny +

    Held Item

    @@ -109,6 +134,17 @@

    Hewwo

    +
    + +

    Stats:

    + +

    Nature:

    + + + +

    IVs/EVs

    @@ -171,24 +207,46 @@
    Existing user not found, enter your name below and we will create a record a

    Moveset

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + @@ -197,6 +255,11 @@
    Existing user not found, enter your name below and we will create a record a + + + + + - + + + + + + \ No newline at end of file diff --git a/server/egglocke/pokepoll/templates/pokepoll/submissions.html b/server/pokepoll/templates/pokepoll/submissions.html similarity index 66% rename from server/egglocke/pokepoll/templates/pokepoll/submissions.html rename to server/pokepoll/templates/pokepoll/submissions.html index ee063ee..6177454 100644 --- a/server/egglocke/pokepoll/templates/pokepoll/submissions.html +++ b/server/pokepoll/templates/pokepoll/submissions.html @@ -6,7 +6,7 @@ {% if latest_pokemon_list %} @@ -16,19 +16,11 @@ + \ No newline at end of file diff --git a/server/egglocke/pokepoll/templates/pokepoll/submit.html b/server/pokepoll/templates/pokepoll/submit.html similarity index 100% rename from server/egglocke/pokepoll/templates/pokepoll/submit.html rename to server/pokepoll/templates/pokepoll/submit.html diff --git a/server/egglocke/pokepoll/tests.py b/server/pokepoll/tests.py similarity index 100% rename from server/egglocke/pokepoll/tests.py rename to server/pokepoll/tests.py diff --git a/server/egglocke/pokepoll/urls.py b/server/pokepoll/urls.py similarity index 77% rename from server/egglocke/pokepoll/urls.py rename to server/pokepoll/urls.py index 6ce2b0e..aefca94 100644 --- a/server/egglocke/pokepoll/urls.py +++ b/server/pokepoll/urls.py @@ -1,4 +1,5 @@ from django.urls import path +from django.urls.conf import include from . import views @@ -10,8 +11,9 @@ path("/results/", views.ResultsView.as_view(), name="results"), path("/vote/", views.vote, name="vote"), path("submit/", views.MasterPokemonAndSubmitterView.as_view(), name="submit"), - # path("submitAuthor/", views.SubmitterFormView.as_view(), name="submitAuthor"), - # path("submitPokemon/", views.PokemonFormView.as_view(), name="submitPokemon"), path("validateSubmitter/", views.validate_submitter, name="validateSubmitter"), + path("downloadSaveFile/", views.saveGenView, name="downloadSaveFile"), + + ] \ No newline at end of file diff --git a/server/egglocke/pokepoll/views.py b/server/pokepoll/views.py similarity index 57% rename from server/egglocke/pokepoll/views.py rename to server/pokepoll/views.py index 6340396..fcaa10a 100644 --- a/server/egglocke/pokepoll/views.py +++ b/server/pokepoll/views.py @@ -10,16 +10,25 @@ import json # import variables in settings.py from django.conf import settings +import requests from .support.cachedconstants import MAX_POKEDEX_DICT from django.views.decorators.http import require_GET, require_POST from django.core.cache import cache from django_ratelimit.decorators import ratelimit from django.utils.decorators import method_decorator +from captcha.fields import CaptchaField # Create your views here. from django.urls import reverse from .models import Pokemon, Submitter +PKHEX_GAMECODES = { + "Pokemon SoulSilver": 8, + "Pokemon Diamond": 10, + "Pokemon Pearl": 11, + "Pokemon Platinum": 12, +} + @require_GET def robots_txt_view(request): robots_txt_path = "pokepoll/support/robots.txt" @@ -59,7 +68,7 @@ class IndexView(generic.ListView): def get_queryset(self): """ - Return the last five published questions (not including those set to be + Return the last fifty published questions (not including those set to be published in the future). """ return Pokemon.objects.filter(pub_date__lte=timezone.now()).order_by("-pub_date")[ @@ -72,6 +81,21 @@ class DetailView(generic.DetailView): template_name = "pokepoll/detail.html" context_object_name = "pokemon" + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + + context["moves_pretty"] = [] + with open(os.path.join(settings.BASE_DIR, 'pokepoll/static/pokepoll/pokemon_move_to_id_gen_{}.json'.format(settings.POKEMON_GENERATION))) as f: + move_dex = json.load(f) + # find the keys that match the values in the pokemon_moves list + for move in context['pokemon'].pokemon_moves: + for key, value in move_dex.items(): + if value == move: + context["moves_pretty"].append(key) + break + + return context + class ResultsView(generic.DetailView): model = Pokemon @@ -81,7 +105,22 @@ class ResultsView(generic.DetailView): class PokemonForm(forms.ModelForm): class Meta: model = Pokemon - fields = ['pokemon_nickname', 'pokemon_species', 'pokemon_ball', 'pokemon_language', 'pokemon_ability', 'pokemon_held_item', 'pokemon_nature', 'pokemon_OT', 'pokemon_OTGender', 'pokemon_IV', 'pokemon_EV', 'pokemon_moves', 'pokemon_movespp'] + fields = ['pokemon_nickname', + 'pokemon_species', + 'pokemon_ball', + 'pokemon_language', + 'pokemon_ability', + 'pokemon_held_item', + 'pokemon_nature', + 'pokemon_OT', + 'pokemon_OTGender', + 'pokemon_IV', + 'pokemon_EV', + 'pokemon_moves', + 'pokemon_movespp', + 'pokemon_is_shiny', + 'pokemon_intended_generation', + 'pokemon_compatible_generations'] class SubmitterForm(forms.ModelForm): class Meta: @@ -100,18 +139,96 @@ class Meta: }) } -class SaveGenView(generic.TemplateView): - # WIP view +class CaptchaTestForm(forms.Form): + captcha = CaptchaField() + + pokemon_choices = () - # eventually, this view will call the PkHex microservice I wrote to generate a save file - template_name = "pokepoll/save_gen.html" + for game in PKHEX_GAMECODES: + pokemon_choices += ((PKHEX_GAMECODES[game], game),) - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - return context + pokemon_game = forms.ChoiceField(choices=pokemon_choices, required=True, label="Game") + + num_eggs = forms.IntegerField(min_value=1, max_value=50) + +import random +from django.db.models import Max, Min + +def get_random_objects(model, count): + max_id = model.objects.aggregate(max_id=Max("id"))['max_id'] + min_id = model.objects.aggregate(min_id=Min("id"))['min_id'] + + if max_id is None or min_id is None: + return model.objects.none() # No objects in the model + + random_ids = set() + while len(random_ids) < count: + random_id = random.randint(min_id, max_id) + if model.objects.filter(id=random_id).exists(): + random_ids.add(random_id) + + return model.objects.filter(id__in=random_ids) + + + +def saveGenView(request): + if request.POST: + form = CaptchaTestForm(request.POST) + + # Validate the form: the captcha field will automatically + # check the input + if form.is_valid(): + # get 5 eggs from the database + five_eggs = get_random_objects(Pokemon, 3) + + # create a list of dictionaries to hold the egg data + egg_data = [] + for egg in five_eggs: + egg_data.append( + { + "dexNumber": egg.pokemon_species, + "ball": 2, + "language": 1, + "ability": egg.pokemon_ability, + "nature": egg.pokemon_nature, + "OT": egg.pokemon_OT, + "OTGender": 1, + "nickname": egg.pokemon_nickname, + "IV": egg.pokemon_IV, + "EV": egg.pokemon_EV, + "moves": egg.pokemon_moves, + "movespp": [0] * len(egg.pokemon_moves), + "heldItem": egg.pokemon_held_item, + "isShiny": egg.pokemon_is_shiny, + + }) + + print("POST {}".format(settings.MICROSERVICE_URLS['savefile'])) + api_endpoint = settings.MICROSERVICE_URLS['savefile'] + "api/buildSaveFile" + request_body = { + "generation": 4, + "eggs": egg_data, + "gamecode": int(form.cleaned_data['pokemon_game']), + } + + with open("DEBUG_post.json", "w") as f: + json.dump(request_body, f) + + print("Calling {}".format(api_endpoint)) + print("Request data: {}".format(request_body)) + # call the microservice internally + savefile_results = requests.post(api_endpoint, json=request_body) + + print("Response: {}".format(savefile_results.text)) + # return the save file, with the filename set to the user's email + return HttpResponse(savefile_results.content, content_type='application/octet-stream', headers={'Content-Disposition': 'attachment; filename="savefile.sav"'}) + + + else: + form = CaptchaTestForm() + + return render(request, 'pokepoll/save_gen.html', {'form': form}) - def post(self, request, *args, **kwargs): - return HttpResponseRedirect(reverse('pokepoll:home')) @method_decorator(ratelimit(key='ip', rate='3/m', method='POST', block=True), name='dispatch') @method_decorator(ratelimit(key='ip', rate='20/m', method='GET', block=True), name='dispatch') @@ -120,16 +237,19 @@ class MasterPokemonAndSubmitterView(generic.TemplateView): def get(self, request, *args, **kwargs): submitter_form = SubmitterForm() - song_form = PokemonForm() + pokemon_form = PokemonForm() + + return render(request, self.template_name, { 'submitter_form': submitter_form, - 'pokemon_form': song_form, + 'pokemon_form': pokemon_form, 'max_pokedex_entry': MAX_POKEDEX_DICT[settings.POKEMON_GENERATION], - 'pokemon_generation': str(settings.POKEMON_GENERATION) + 'pokemon_generation': str(settings.POKEMON_GENERATION), + 'nickname_character_limit': 10 if settings.POKEMON_GENERATION < 6 else 12 }) def post(self, request, *args, **kwargs): - + print("POST of Proposed Pokemon to add") print(request.POST) submitter_form = SubmitterForm(request.POST) @@ -195,10 +315,36 @@ def post(self, request, *args, **kwargs): with open(os.path.join(settings.BASE_DIR, 'pokepoll/static/pokepoll/held_items_to_id_gen_{}.json'.format(settings.POKEMON_GENERATION))) as f: item_dex = json.load(f) if pokemon_held_item in item_dex: - pokemon_held_item = pokedex[request.POST.get('pokemon_species')] + pokemon_held_item = item_dex[request.POST.get('pokemon_held_item')] else: pokemon_held_item = 0 + pokemon_moves = [] + # populate moves with the values from the form + with open(os.path.join(settings.BASE_DIR, 'pokepoll/static/pokepoll/pokemon_move_to_id_gen_{}.json'.format(settings.POKEMON_GENERATION))) as f: + move_dex = json.load(f) + for i in range(4): + move = request.POST.get('pokemon_move' + str(i + 1)) + if move in move_dex: + pokemon_moves.append(move_dex[move]) + + + # TODO: validate moves and provide a base case if a move is not found + + # Set shiny status + pokemon_is_shiny = request.POST.get('pokemon_is_shiny') + if pokemon_is_shiny is None: + pokemon_is_shiny = False + elif "Yes" in pokemon_is_shiny or "yes" in pokemon_is_shiny or "True" in pokemon_is_shiny or "true" in pokemon_is_shiny or "On" in pokemon_is_shiny or "on" in pokemon_is_shiny: + pokemon_is_shiny = True + else: + pokemon_is_shiny = False + + + # Get pokemon nature + pokemon_nature = request.POST.get('pokemon_nature') + pokemon_nature = int(pokemon_nature) + @@ -206,10 +352,14 @@ def post(self, request, *args, **kwargs): 'pokemon_species': pokemon_species, 'pub_date': timezone.now(), 'submitter_id': foreign_key, + 'pokemon_is_shiny': pokemon_is_shiny, 'pokemon_IV': IVs, 'pokemon_EV': EVs, 'pokemon_ability': pokemon_ability, 'pokemon_held_item': pokemon_held_item, + 'pokemon_moves': pokemon_moves, + 'pokemon_nature': pokemon_nature, + } print(kw_args) diff --git a/server/requirements.txt b/server/requirements.txt new file mode 100644 index 0000000..2ccd325 --- /dev/null +++ b/server/requirements.txt @@ -0,0 +1,5 @@ +django +#mysqlclient +requests +django-ratelimit +django-simple-captcha