diff --git a/public/audio/bgm/bw/minor_fanfare.mp3 b/public/audio/bgm/bw/minor_fanfare.mp3 new file mode 100644 index 000000000..464a579a3 Binary files /dev/null and b/public/audio/bgm/bw/minor_fanfare.mp3 differ diff --git a/public/images/items.json b/public/images/items.json index 9e6ca53c3..6c17c12d9 100644 --- a/public/images/items.json +++ b/public/images/items.json @@ -4,8 +4,8 @@ "image": "items.png", "format": "RGBA8888", "size": { - "w": 321, - "h": 321 + "w": 327, + "h": 327 }, "scale": 1, "frames": [ @@ -199,7 +199,7 @@ } }, { - "filename": "grip_claw", + "filename": "gracidea", "rotated": false, "trimmed": true, "sourceSize": { @@ -220,7 +220,7 @@ } }, { - "filename": "lucky_punch", + "filename": "grip_claw", "rotated": false, "trimmed": true, "sourceSize": { @@ -241,7 +241,7 @@ } }, { - "filename": "lucky_punch_great", + "filename": "lucky_punch", "rotated": false, "trimmed": true, "sourceSize": { @@ -262,7 +262,7 @@ } }, { - "filename": "lucky_punch_master", + "filename": "lucky_punch_great", "rotated": false, "trimmed": true, "sourceSize": { @@ -283,7 +283,7 @@ } }, { - "filename": "lucky_punch_ultra", + "filename": "lucky_punch_master", "rotated": false, "trimmed": true, "sourceSize": { @@ -304,7 +304,7 @@ } }, { - "filename": "muscle_band", + "filename": "lucky_punch_ultra", "rotated": false, "trimmed": true, "sourceSize": { @@ -325,7 +325,7 @@ } }, { - "filename": "salac_berry", + "filename": "lustrous_globe", "rotated": false, "trimmed": true, "sourceSize": { @@ -346,7 +346,7 @@ } }, { - "filename": "scanner", + "filename": "muscle_band", "rotated": false, "trimmed": true, "sourceSize": { @@ -430,7 +430,7 @@ } }, { - "filename": "silk_scarf", + "filename": "salac_berry", "rotated": false, "trimmed": true, "sourceSize": { @@ -451,7 +451,7 @@ } }, { - "filename": "sun_stone", + "filename": "scanner", "rotated": false, "trimmed": true, "sourceSize": { @@ -472,7 +472,7 @@ } }, { - "filename": "clefairy_doll", + "filename": "silk_scarf", "rotated": false, "trimmed": true, "sourceSize": { @@ -481,19 +481,19 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, + "y": 4, "w": 24, - "h": 23 + "h": 24 }, "frame": { "x": 0, "y": 265, "w": 24, - "h": 23 + "h": 24 } }, { - "filename": "coin_case", + "filename": "sun_stone", "rotated": false, "trimmed": true, "sourceSize": { @@ -502,15 +502,36 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, + "y": 4, "w": 24, - "h": 23 + "h": 24 }, "frame": { "x": 0, - "y": 288, + "y": 289, "w": 24, - "h": 23 + "h": 24 + } + }, + { + "filename": "ability_capsule", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 9, + "w": 24, + "h": 14 + }, + "frame": { + "x": 0, + "y": 313, + "w": 24, + "h": 14 } }, { @@ -577,7 +598,7 @@ } }, { - "filename": "amulet_coin", + "filename": "adamant_crystal", "rotated": false, "trimmed": true, "sourceSize": { @@ -585,8 +606,8 @@ "h": 32 }, "spriteSourceSize": { - "x": 6, - "y": 5, + "x": 4, + "y": 6, "w": 23, "h": 21 }, @@ -723,279 +744,6 @@ "h": 24 } }, - { - "filename": "berry_pouch", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 24, - "y": 289, - "w": 23, - "h": 23 - } - }, - { - "filename": "ability_capsule", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 9, - "w": 24, - "h": 14 - }, - "frame": { - "x": 27, - "y": 22, - "w": 24, - "h": 14 - } - }, - { - "filename": "mega_bracelet", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 16 - }, - "frame": { - "x": 23, - "y": 36, - "w": 20, - "h": 16 - } - }, - { - "filename": "hp_up", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 33, - "y": 52, - "w": 16, - "h": 24 - } - }, - { - "filename": "iron", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 33, - "y": 76, - "w": 16, - "h": 24 - } - }, - { - "filename": "max_lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, - "h": 24 - }, - "frame": { - "x": 38, - "y": 100, - "w": 17, - "h": 24 - } - }, - { - "filename": "dawn_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 21 - }, - "frame": { - "x": 40, - "y": 124, - "w": 20, - "h": 21 - } - }, - { - "filename": "max_revive", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 4, - "w": 22, - "h": 24 - }, - "frame": { - "x": 41, - "y": 145, - "w": 22, - "h": 24 - } - }, - { - "filename": "black_belt", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 4, - "w": 22, - "h": 23 - }, - "frame": { - "x": 41, - "y": 169, - "w": 22, - "h": 23 - } - }, - { - "filename": "expert_belt", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 4, - "w": 24, - "h": 23 - }, - "frame": { - "x": 41, - "y": 192, - "w": 24, - "h": 23 - } - }, - { - "filename": "scope-lens", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 24, - "h": 23 - }, - "frame": { - "x": 41, - "y": 215, - "w": 24, - "h": 23 - } - }, - { - "filename": "rare_candy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 42, - "y": 238, - "w": 23, - "h": 23 - } - }, - { - "filename": "rarer_candy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 5, - "w": 23, - "h": 23 - }, - "frame": { - "x": 42, - "y": 261, - "w": 23, - "h": 23 - } - }, { "filename": "max_potion", "rotated": false, @@ -1011,8 +759,8 @@ "h": 24 }, "frame": { - "x": 47, - "y": 284, + "x": 24, + "y": 289, "w": 18, "h": 24 } @@ -1032,14 +780,14 @@ "h": 18 }, "frame": { - "x": 51, - "y": 24, + "x": 27, + "y": 22, "w": 24, "h": 18 } }, { - "filename": "dragon_scale", + "filename": "clefairy_doll", "rotated": false, "trimmed": true, "sourceSize": { @@ -1048,19 +796,40 @@ }, "spriteSourceSize": { "x": 4, - "y": 8, + "y": 5, "w": 24, - "h": 18 + "h": 23 + }, + "frame": { + "x": 51, + "y": 24, + "w": 24, + "h": 23 + } + }, + { + "filename": "coin_case", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, + "h": 23 }, "frame": { "x": 75, "y": 24, "w": 24, - "h": 18 + "h": 23 } }, { - "filename": "exp_balance", + "filename": "expert_belt", "rotated": false, "trimmed": true, "sourceSize": { @@ -1069,19 +838,19 @@ }, "spriteSourceSize": { "x": 4, - "y": 5, + "y": 4, "w": 24, - "h": 22 + "h": 23 }, "frame": { "x": 99, "y": 24, "w": 24, - "h": 22 + "h": 23 } }, { - "filename": "exp_share", + "filename": "scope-lens", "rotated": false, "trimmed": true, "sourceSize": { @@ -1092,13 +861,13 @@ "x": 4, "y": 5, "w": 24, - "h": 22 + "h": 23 }, "frame": { "x": 123, "y": 24, "w": 24, - "h": 22 + "h": 23 } }, { @@ -1123,7 +892,7 @@ } }, { - "filename": "stick", + "filename": "berry_pouch", "rotated": false, "trimmed": true, "sourceSize": { @@ -1143,6 +912,258 @@ "h": 23 } }, + { + "filename": "exp_balance", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, + "h": 22 + }, + "frame": { + "x": 194, + "y": 24, + "w": 24, + "h": 22 + } + }, + { + "filename": "exp_share", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 24, + "h": 22 + }, + "frame": { + "x": 218, + "y": 24, + "w": 24, + "h": 22 + } + }, + { + "filename": "griseous_core", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 242, + "y": 24, + "w": 23, + "h": 23 + } + }, + { + "filename": "rare_candy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 265, + "y": 24, + "w": 23, + "h": 23 + } + }, + { + "filename": "rarer_candy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 288, + "y": 24, + "w": 23, + "h": 23 + } + }, + { + "filename": "hp_up", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 311, + "y": 24, + "w": 16, + "h": 24 + } + }, + { + "filename": "razor_fang", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 6, + "w": 18, + "h": 20 + }, + "frame": { + "x": 33, + "y": 40, + "w": 18, + "h": 20 + } + }, + { + "filename": "max_revive", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 4, + "w": 22, + "h": 24 + }, + "frame": { + "x": 33, + "y": 60, + "w": 22, + "h": 24 + } + }, + { + "filename": "mega_bracelet", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 16 + }, + "frame": { + "x": 33, + "y": 84, + "w": 20, + "h": 16 + } + }, + { + "filename": "iron", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 38, + "y": 100, + "w": 16, + "h": 24 + } + }, + { + "filename": "amulet_coin", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 5, + "w": 23, + "h": 21 + }, + "frame": { + "x": 40, + "y": 124, + "w": 23, + "h": 21 + } + }, + { + "filename": "black_belt", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 4, + "w": 22, + "h": 23 + }, + "frame": { + "x": 41, + "y": 145, + "w": 22, + "h": 23 + } + }, { "filename": "fire_stone", "rotated": false, @@ -1158,8 +1179,8 @@ "h": 23 }, "frame": { - "x": 194, - "y": 24, + "x": 41, + "y": 168, "w": 22, "h": 23 } @@ -1179,96 +1200,12 @@ "h": 23 }, "frame": { - "x": 216, - "y": 24, + "x": 41, + "y": 191, "w": 22, "h": 23 } }, - { - "filename": "healing_charm", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 23, - "h": 22 - }, - "frame": { - "x": 238, - "y": 24, - "w": 23, - "h": 22 - } - }, - { - "filename": "charcoal", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 261, - "y": 24, - "w": 22, - "h": 22 - } - }, - { - "filename": "dire_hit", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 283, - "y": 24, - "w": 22, - "h": 22 - } - }, - { - "filename": "pp_max", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 305, - "y": 24, - "w": 16, - "h": 24 - } - }, { "filename": "never_melt_ice", "rotated": false, @@ -1284,8 +1221,8 @@ "h": 23 }, "frame": { - "x": 49, - "y": 42, + "x": 41, + "y": 214, "w": 22, "h": 23 } @@ -1305,369 +1242,12 @@ "h": 24 }, "frame": { - "x": 49, - "y": 65, + "x": 42, + "y": 237, "w": 21, "h": 24 } }, - { - "filename": "petaya_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 23 - }, - "frame": { - "x": 71, - "y": 42, - "w": 22, - "h": 23 - } - }, - { - "filename": "reaper_cloth", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 23 - }, - "frame": { - "x": 70, - "y": 65, - "w": 22, - "h": 23 - } - }, - { - "filename": "sacred_ash", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 24, - "h": 20 - }, - "frame": { - "x": 93, - "y": 46, - "w": 24, - "h": 20 - } - }, - { - "filename": "soft_sand", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 24, - "h": 20 - }, - "frame": { - "x": 117, - "y": 46, - "w": 24, - "h": 20 - } - }, - { - "filename": "dna_splicers", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 92, - "y": 66, - "w": 22, - "h": 22 - } - }, - { - "filename": "electirizer", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 114, - "y": 66, - "w": 22, - "h": 22 - } - }, - { - "filename": "binding_band", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 23, - "h": 20 - }, - "frame": { - "x": 141, - "y": 47, - "w": 23, - "h": 20 - } - }, - { - "filename": "moon_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 6, - "w": 23, - "h": 21 - }, - "frame": { - "x": 164, - "y": 47, - "w": 23, - "h": 21 - } - }, - { - "filename": "deep_sea_tooth", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 187, - "y": 47, - "w": 22, - "h": 21 - } - }, - { - "filename": "enigma_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 209, - "y": 47, - "w": 22, - "h": 22 - } - }, - { - "filename": "ganlon_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 136, - "y": 67, - "w": 22, - "h": 22 - } - }, - { - "filename": "guard_spec", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 158, - "y": 68, - "w": 22, - "h": 22 - } - }, - { - "filename": "ice_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 5, - "w": 22, - "h": 22 - }, - "frame": { - "x": 180, - "y": 68, - "w": 22, - "h": 22 - } - }, - { - "filename": "liechi_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 21 - }, - "frame": { - "x": 202, - "y": 69, - "w": 22, - "h": 21 - } - }, - { - "filename": "relic_gold", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 9, - "y": 11, - "w": 15, - "h": 11 - }, - "frame": { - "x": 49, - "y": 89, - "w": 15, - "h": 11 - } - }, - { - "filename": "pp_up", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 55, - "y": 100, - "w": 16, - "h": 24 - } - }, - { - "filename": "dusk_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 60, - "y": 124, - "w": 21, - "h": 21 - } - }, { "filename": "shiny_charm", "rotated": false, @@ -1683,8 +1263,8 @@ "h": 24 }, "frame": { - "x": 63, - "y": 145, + "x": 42, + "y": 261, "w": 21, "h": 24 } @@ -1704,12 +1284,453 @@ "h": 23 }, "frame": { - "x": 63, - "y": 169, + "x": 42, + "y": 285, "w": 21, "h": 23 } }, + { + "filename": "coupon", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 23, + "h": 19 + }, + "frame": { + "x": 42, + "y": 308, + "w": 23, + "h": 19 + } + }, + { + "filename": "stick", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 5, + "w": 23, + "h": 23 + }, + "frame": { + "x": 55, + "y": 47, + "w": 23, + "h": 23 + } + }, + { + "filename": "healing_charm", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 23, + "h": 22 + }, + "frame": { + "x": 78, + "y": 47, + "w": 23, + "h": 22 + } + }, + { + "filename": "charcoal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 101, + "y": 47, + "w": 22, + "h": 22 + } + }, + { + "filename": "dire_hit", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 123, + "y": 47, + "w": 22, + "h": 22 + } + }, + { + "filename": "dna_splicers", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 145, + "y": 47, + "w": 22, + "h": 22 + } + }, + { + "filename": "electirizer", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 167, + "y": 47, + "w": 22, + "h": 22 + } + }, + { + "filename": "binding_band", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 23, + "h": 20 + }, + "frame": { + "x": 55, + "y": 70, + "w": 23, + "h": 20 + } + }, + { + "filename": "moon_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 6, + "w": 23, + "h": 21 + }, + "frame": { + "x": 78, + "y": 69, + "w": 23, + "h": 21 + } + }, + { + "filename": "sacred_ash", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 24, + "h": 20 + }, + "frame": { + "x": 101, + "y": 69, + "w": 24, + "h": 20 + } + }, + { + "filename": "soft_sand", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 24, + "h": 20 + }, + "frame": { + "x": 125, + "y": 69, + "w": 24, + "h": 20 + } + }, + { + "filename": "reviver_seed", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 8, + "w": 23, + "h": 20 + }, + "frame": { + "x": 149, + "y": 69, + "w": 23, + "h": 20 + } + }, + { + "filename": "apicot_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 20 + }, + "frame": { + "x": 172, + "y": 69, + "w": 19, + "h": 20 + } + }, + { + "filename": "petaya_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 23 + }, + "frame": { + "x": 54, + "y": 90, + "w": 22, + "h": 23 + } + }, + { + "filename": "reaper_cloth", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 23 + }, + "frame": { + "x": 76, + "y": 90, + "w": 22, + "h": 23 + } + }, + { + "filename": "relic_gold", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 9, + "y": 11, + "w": 15, + "h": 11 + }, + "frame": { + "x": 54, + "y": 113, + "w": 15, + "h": 11 + } + }, + { + "filename": "dragon_scale", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 8, + "w": 24, + "h": 18 + }, + "frame": { + "x": 69, + "y": 113, + "w": 24, + "h": 18 + } + }, + { + "filename": "enigma_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 63, + "y": 131, + "w": 22, + "h": 22 + } + }, + { + "filename": "ganlon_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 63, + "y": 153, + "w": 22, + "h": 22 + } + }, + { + "filename": "guard_spec", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 63, + "y": 175, + "w": 22, + "h": 22 + } + }, + { + "filename": "ice_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 5, + "w": 22, + "h": 22 + }, + "frame": { + "x": 63, + "y": 197, + "w": 22, + "h": 22 + } + }, { "filename": "lansat_berry", "rotated": false, @@ -1725,8 +1746,8 @@ "h": 23 }, "frame": { - "x": 65, - "y": 192, + "x": 63, + "y": 219, "w": 21, "h": 23 } @@ -1746,12 +1767,201 @@ "h": 23 }, "frame": { - "x": 65, - "y": 215, + "x": 63, + "y": 242, "w": 21, "h": 23 } }, + { + "filename": "red_orb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 4, + "w": 20, + "h": 24 + }, + "frame": { + "x": 63, + "y": 265, + "w": 20, + "h": 24 + } + }, + { + "filename": "blunder_policy", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 19 + }, + "frame": { + "x": 63, + "y": 289, + "w": 22, + "h": 19 + } + }, + { + "filename": "golden_mystic_ticket", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 23, + "h": 19 + }, + "frame": { + "x": 65, + "y": 308, + "w": 23, + "h": 19 + } + }, + { + "filename": "max_lure", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 17, + "h": 24 + }, + "frame": { + "x": 85, + "y": 131, + "w": 17, + "h": 24 + } + }, + { + "filename": "super_lure", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 17, + "h": 24 + }, + "frame": { + "x": 85, + "y": 155, + "w": 17, + "h": 24 + } + }, + { + "filename": "hyper_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 85, + "y": 179, + "w": 17, + "h": 23 + } + }, + { + "filename": "big_mushroom", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 19 + }, + "frame": { + "x": 85, + "y": 202, + "w": 19, + "h": 19 + } + }, + { + "filename": "mystic_water", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 5, + "w": 20, + "h": 23 + }, + "frame": { + "x": 84, + "y": 221, + "w": 20, + "h": 23 + } + }, + { + "filename": "dawn_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 21 + }, + "frame": { + "x": 84, + "y": 244, + "w": 20, + "h": 21 + } + }, { "filename": "sharp_beak", "rotated": false, @@ -1767,12 +1977,96 @@ "h": 23 }, "frame": { - "x": 65, - "y": 238, + "x": 83, + "y": 265, "w": 21, "h": 23 } }, + { + "filename": "big_nugget", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 85, + "y": 288, + "w": 20, + "h": 20 + } + }, + { + "filename": "mystic_ticket", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 23, + "h": 19 + }, + "frame": { + "x": 88, + "y": 308, + "w": 23, + "h": 19 + } + }, + { + "filename": "relic_crown", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 23, + "h": 18 + }, + "frame": { + "x": 93, + "y": 113, + "w": 23, + "h": 18 + } + }, + { + "filename": "potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 98, + "y": 90, + "w": 17, + "h": 23 + } + }, { "filename": "magmarizer", "rotated": false, @@ -1788,8 +2082,8 @@ "h": 22 }, "frame": { - "x": 65, - "y": 261, + "x": 115, + "y": 89, "w": 22, "h": 22 } @@ -1809,54 +2103,12 @@ "h": 22 }, "frame": { - "x": 65, - "y": 283, + "x": 137, + "y": 89, "w": 22, "h": 22 } }, - { - "filename": "abomasite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 65, - "y": 305, - "w": 16, - "h": 16 - } - }, - { - "filename": "absolite", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 8, - "w": 16, - "h": 16 - }, - "frame": { - "x": 81, - "y": 305, - "w": 16, - "h": 16 - } - }, { "filename": "protector", "rotated": false, @@ -1872,12 +2124,33 @@ "h": 22 }, "frame": { - "x": 71, - "y": 88, + "x": 159, + "y": 89, "w": 22, "h": 22 } }, + { + "filename": "shell_bell", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 23, + "h": 20 + }, + "frame": { + "x": 116, + "y": 111, + "w": 23, + "h": 20 + } + }, { "filename": "shed_shell", "rotated": false, @@ -1893,159 +2166,12 @@ "h": 22 }, "frame": { - "x": 93, - "y": 88, + "x": 102, + "y": 131, "w": 22, "h": 22 } }, - { - "filename": "poison_barb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 115, - "y": 88, - "w": 21, - "h": 21 - } - }, - { - "filename": "deep_sea_scale", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 20 - }, - "frame": { - "x": 136, - "y": 89, - "w": 22, - "h": 20 - } - }, - { - "filename": "coupon", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 19 - }, - "frame": { - "x": 158, - "y": 90, - "w": 23, - "h": 19 - } - }, - { - "filename": "golden_mystic_ticket", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 19 - }, - "frame": { - "x": 181, - "y": 90, - "w": 23, - "h": 19 - } - }, - { - "filename": "big_nugget", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 204, - "y": 90, - "w": 20, - "h": 20 - } - }, - { - "filename": "protein", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 224, - "y": 69, - "w": 16, - "h": 24 - } - }, - { - "filename": "leftovers", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 15, - "h": 22 - }, - "frame": { - "x": 231, - "y": 47, - "w": 15, - "h": 22 - } - }, { "filename": "starf_berry", "rotated": false, @@ -2061,8 +2187,8 @@ "h": 22 }, "frame": { - "x": 246, - "y": 46, + "x": 102, + "y": 153, "w": 22, "h": 22 } @@ -2082,14 +2208,14 @@ "h": 22 }, "frame": { - "x": 268, - "y": 46, + "x": 102, + "y": 175, "w": 22, "h": 22 } }, { - "filename": "full_heal", + "filename": "deep_sea_scale", "rotated": false, "trimmed": true, "sourceSize": { @@ -2097,81 +2223,18 @@ "h": 32 }, "spriteSourceSize": { - "x": 9, - "y": 4, - "w": 15, - "h": 23 - }, - "frame": { - "x": 290, - "y": 46, - "w": 15, - "h": 23 - } - }, - { - "filename": "unknown", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 305, - "y": 48, - "w": 16, - "h": 24 - } - }, - { - "filename": "apicot_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, + "x": 5, "y": 6, - "w": 19, + "w": 22, "h": 20 }, "frame": { - "x": 224, - "y": 93, - "w": 19, + "x": 139, + "y": 111, + "w": 22, "h": 20 } }, - { - "filename": "super_lure", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 17, - "h": 24 - }, - "frame": { - "x": 240, - "y": 69, - "w": 17, - "h": 24 - } - }, { "filename": "tm_bug", "rotated": false, @@ -2187,54 +2250,12 @@ "h": 22 }, "frame": { - "x": 257, - "y": 68, + "x": 124, + "y": 131, "w": 22, "h": 22 } }, - { - "filename": "candy_jar", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 19, - "h": 20 - }, - "frame": { - "x": 243, - "y": 93, - "w": 19, - "h": 20 - } - }, - { - "filename": "hyper_potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 23 - }, - "frame": { - "x": 262, - "y": 90, - "w": 17, - "h": 23 - } - }, { "filename": "tm_dark", "rotated": false, @@ -2250,33 +2271,12 @@ "h": 22 }, "frame": { - "x": 279, - "y": 69, + "x": 124, + "y": 153, "w": 22, "h": 22 } }, - { - "filename": "mystic_water", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 5, - "w": 20, - "h": 23 - }, - "frame": { - "x": 301, - "y": 72, - "w": 20, - "h": 23 - } - }, { "filename": "tm_dragon", "rotated": false, @@ -2292,14 +2292,14 @@ "h": 22 }, "frame": { - "x": 279, - "y": 91, + "x": 124, + "y": 175, "w": 22, "h": 22 } }, { - "filename": "sitrus_berry", + "filename": "blue_orb", "rotated": false, "trimmed": true, "sourceSize": { @@ -2308,15 +2308,15 @@ }, "spriteSourceSize": { "x": 6, - "y": 5, + "y": 6, "w": 20, - "h": 22 + "h": 20 }, "frame": { - "x": 301, - "y": 95, + "x": 161, + "y": 111, "w": 20, - "h": 22 + "h": 20 } }, { @@ -2334,33 +2334,12 @@ "h": 22 }, "frame": { - "x": 81, - "y": 110, + "x": 146, + "y": 131, "w": 22, "h": 22 } }, - { - "filename": "metal_coat", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 5, - "w": 19, - "h": 22 - }, - "frame": { - "x": 103, - "y": 110, - "w": 19, - "h": 22 - } - }, { "filename": "tm_fairy", "rotated": false, @@ -2376,8 +2355,8 @@ "h": 22 }, "frame": { - "x": 122, - "y": 109, + "x": 146, + "y": 153, "w": 22, "h": 22 } @@ -2397,8 +2376,8 @@ "h": 22 }, "frame": { - "x": 144, - "y": 109, + "x": 146, + "y": 175, "w": 22, "h": 22 } @@ -2418,138 +2397,12 @@ "h": 22 }, "frame": { - "x": 166, - "y": 109, + "x": 104, + "y": 197, "w": 22, "h": 22 } }, - { - "filename": "zinc", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 4, - "w": 16, - "h": 24 - }, - "frame": { - "x": 188, - "y": 109, - "w": 16, - "h": 24 - } - }, - { - "filename": "gb", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 6, - "w": 20, - "h": 20 - }, - "frame": { - "x": 204, - "y": 110, - "w": 20, - "h": 20 - } - }, - { - "filename": "black_glasses", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 8, - "w": 23, - "h": 17 - }, - "frame": { - "x": 224, - "y": 113, - "w": 23, - "h": 17 - } - }, - { - "filename": "mystic_ticket", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 19 - }, - "frame": { - "x": 247, - "y": 113, - "w": 23, - "h": 19 - } - }, - { - "filename": "pair_of_tickets", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 19 - }, - "frame": { - "x": 270, - "y": 113, - "w": 23, - "h": 19 - } - }, - { - "filename": "silver_powder", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 11, - "w": 24, - "h": 15 - }, - "frame": { - "x": 293, - "y": 117, - "w": 24, - "h": 15 - } - }, { "filename": "tm_flying", "rotated": false, @@ -2565,8 +2418,8 @@ "h": 22 }, "frame": { - "x": 84, - "y": 132, + "x": 104, + "y": 219, "w": 22, "h": 22 } @@ -2586,33 +2439,12 @@ "h": 22 }, "frame": { - "x": 84, - "y": 154, + "x": 126, + "y": 197, "w": 22, "h": 22 } }, - { - "filename": "potion", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 8, - "y": 5, - "w": 17, - "h": 23 - }, - "frame": { - "x": 106, - "y": 132, - "w": 17, - "h": 23 - } - }, { "filename": "tm_grass", "rotated": false, @@ -2628,8 +2460,8 @@ "h": 22 }, "frame": { - "x": 123, - "y": 131, + "x": 104, + "y": 241, "w": 22, "h": 22 } @@ -2649,54 +2481,12 @@ "h": 22 }, "frame": { - "x": 145, - "y": 131, + "x": 126, + "y": 219, "w": 22, "h": 22 } }, - { - "filename": "shiny_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 21, - "h": 21 - }, - "frame": { - "x": 167, - "y": 131, - "w": 21, - "h": 21 - } - }, - { - "filename": "metronome", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 5, - "w": 17, - "h": 22 - }, - "frame": { - "x": 106, - "y": 155, - "w": 17, - "h": 22 - } - }, { "filename": "tm_ice", "rotated": false, @@ -2712,8 +2502,8 @@ "h": 22 }, "frame": { - "x": 123, - "y": 153, + "x": 104, + "y": 263, "w": 22, "h": 22 } @@ -2733,8 +2523,8 @@ "h": 22 }, "frame": { - "x": 145, - "y": 153, + "x": 126, + "y": 241, "w": 22, "h": 22 } @@ -2754,14 +2544,98 @@ "h": 22 }, "frame": { - "x": 167, - "y": 152, + "x": 126, + "y": 263, "w": 22, "h": 22 } }, { - "filename": "big_mushroom", + "filename": "super_potion", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 5, + "w": 17, + "h": 23 + }, + "frame": { + "x": 105, + "y": 285, + "w": 17, + "h": 23 + } + }, + { + "filename": "pair_of_tickets", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 7, + "w": 23, + "h": 19 + }, + "frame": { + "x": 111, + "y": 308, + "w": 23, + "h": 19 + } + }, + { + "filename": "full_heal", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 9, + "y": 4, + "w": 15, + "h": 23 + }, + "frame": { + "x": 122, + "y": 285, + "w": 15, + "h": 23 + } + }, + { + "filename": "dubious_disc", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 22, + "h": 19 + }, + "frame": { + "x": 134, + "y": 308, + "w": 22, + "h": 19 + } + }, + { + "filename": "sitrus_berry", "rotated": false, "trimmed": true, "sourceSize": { @@ -2770,15 +2644,15 @@ }, "spriteSourceSize": { "x": 6, - "y": 6, - "w": 19, - "h": 19 + "y": 5, + "w": 20, + "h": 22 }, "frame": { - "x": 188, - "y": 133, - "w": 19, - "h": 19 + "x": 148, + "y": 197, + "w": 20, + "h": 22 } }, { @@ -2796,8 +2670,8 @@ "h": 22 }, "frame": { - "x": 207, - "y": 130, + "x": 148, + "y": 219, "w": 22, "h": 22 } @@ -2817,96 +2691,12 @@ "h": 22 }, "frame": { - "x": 189, - "y": 152, + "x": 148, + "y": 241, "w": 22, "h": 22 } }, - { - "filename": "razor_fang", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 18, - "h": 20 - }, - "frame": { - "x": 229, - "y": 130, - "w": 18, - "h": 20 - } - }, - { - "filename": "relic_crown", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 7, - "w": 23, - "h": 18 - }, - "frame": { - "x": 247, - "y": 132, - "w": 23, - "h": 18 - } - }, - { - "filename": "reviver_seed", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 8, - "w": 23, - "h": 20 - }, - "frame": { - "x": 270, - "y": 132, - "w": 23, - "h": 20 - } - }, - { - "filename": "shell_bell", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 7, - "w": 23, - "h": 20 - }, - "frame": { - "x": 293, - "y": 132, - "w": 23, - "h": 20 - } - }, { "filename": "tm_steel", "rotated": false, @@ -2922,8 +2712,8 @@ "h": 22 }, "frame": { - "x": 211, - "y": 152, + "x": 148, + "y": 263, "w": 22, "h": 22 } @@ -2943,14 +2733,119 @@ "h": 22 }, "frame": { - "x": 233, - "y": 150, + "x": 137, + "y": 285, "w": 22, "h": 22 } }, { - "filename": "aerodactylite", + "filename": "fairy_feather", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 22, + "h": 20 + }, + "frame": { + "x": 156, + "y": 307, + "w": 22, + "h": 20 + } + }, + { + "filename": "metal_coat", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 5, + "w": 19, + "h": 22 + }, + "frame": { + "x": 159, + "y": 285, + "w": 19, + "h": 22 + } + }, + { + "filename": "pp_max", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 168, + "y": 131, + "w": 16, + "h": 24 + } + }, + { + "filename": "pp_up", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 168, + "y": 155, + "w": 16, + "h": 24 + } + }, + { + "filename": "protein", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 168, + "y": 179, + "w": 16, + "h": 24 + } + }, + { + "filename": "abomasite", "rotated": false, "trimmed": true, "sourceSize": { @@ -2964,14 +2859,77 @@ "h": 16 }, "frame": { - "x": 84, - "y": 176, + "x": 168, + "y": 203, "w": 16, "h": 16 } }, { - "filename": "super_potion", + "filename": "unknown", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 170, + "y": 219, + "w": 16, + "h": 24 + } + }, + { + "filename": "zinc", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 4, + "w": 16, + "h": 24 + }, + "frame": { + "x": 170, + "y": 243, + "w": 16, + "h": 24 + } + }, + { + "filename": "wl_ability_urge", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 18 + }, + "frame": { + "x": 170, + "y": 267, + "w": 20, + "h": 18 + } + }, + { + "filename": "leftovers", "rotated": false, "trimmed": true, "sourceSize": { @@ -2981,14 +2939,77 @@ "spriteSourceSize": { "x": 8, "y": 5, - "w": 17, - "h": 23 + "w": 15, + "h": 22 }, "frame": { - "x": 86, - "y": 192, + "x": 178, + "y": 285, + "w": 15, + "h": 22 + } + }, + { + "filename": "gb", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 20, + "h": 20 + }, + "frame": { + "x": 178, + "y": 307, + "w": 20, + "h": 20 + } + }, + { + "filename": "metronome", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 5, "w": 17, - "h": 23 + "h": 22 + }, + "frame": { + "x": 181, + "y": 89, + "w": 17, + "h": 22 + } + }, + { + "filename": "candy_jar", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 19, + "h": 20 + }, + "frame": { + "x": 181, + "y": 111, + "w": 19, + "h": 20 } }, { @@ -3006,8 +3027,8 @@ "h": 22 }, "frame": { - "x": 86, - "y": 215, + "x": 184, + "y": 131, "w": 17, "h": 22 } @@ -3027,8 +3048,8 @@ "h": 22 }, "frame": { - "x": 86, - "y": 237, + "x": 184, + "y": 153, "w": 22, "h": 22 } @@ -3048,8 +3069,8 @@ "h": 22 }, "frame": { - "x": 87, - "y": 259, + "x": 184, + "y": 175, "w": 22, "h": 22 } @@ -3069,138 +3090,12 @@ "h": 22 }, "frame": { - "x": 87, - "y": 281, + "x": 184, + "y": 197, "w": 22, "h": 22 } }, - { - "filename": "wl_ability_urge", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 18 - }, - "frame": { - "x": 97, - "y": 303, - "w": 20, - "h": 18 - } - }, - { - "filename": "prism_scale", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 9, - "y": 8, - "w": 15, - "h": 15 - }, - "frame": { - "x": 255, - "y": 150, - "w": 15, - "h": 15 - } - }, - { - "filename": "wise_glasses", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 4, - "y": 8, - "w": 23, - "h": 17 - }, - "frame": { - "x": 270, - "y": 152, - "w": 23, - "h": 17 - } - }, - { - "filename": "blunder_policy", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 6, - "w": 22, - "h": 19 - }, - "frame": { - "x": 293, - "y": 152, - "w": 22, - "h": 19 - } - }, - { - "filename": "dubious_disc", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 7, - "w": 22, - "h": 19 - }, - "frame": { - "x": 123, - "y": 175, - "w": 22, - "h": 19 - } - }, - { - "filename": "fairy_feather", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 5, - "y": 7, - "w": 22, - "h": 20 - }, - "frame": { - "x": 145, - "y": 175, - "w": 22, - "h": 20 - } - }, { "filename": "x_defense", "rotated": false, @@ -3216,8 +3111,8 @@ "h": 22 }, "frame": { - "x": 167, - "y": 174, + "x": 186, + "y": 219, "w": 22, "h": 22 } @@ -3237,8 +3132,8 @@ "h": 22 }, "frame": { - "x": 189, - "y": 174, + "x": 186, + "y": 241, "w": 22, "h": 22 } @@ -3258,8 +3153,8 @@ "h": 22 }, "frame": { - "x": 211, - "y": 174, + "x": 190, + "y": 263, "w": 22, "h": 22 } @@ -3279,8 +3174,8 @@ "h": 22 }, "frame": { - "x": 233, - "y": 172, + "x": 193, + "y": 285, "w": 22, "h": 22 } @@ -3300,14 +3195,77 @@ "h": 20 }, "frame": { - "x": 103, - "y": 177, + "x": 198, + "y": 307, "w": 20, "h": 20 } }, { - "filename": "zoom_lens", + "filename": "deep_sea_tooth", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 189, + "y": 47, + "w": 22, + "h": 21 + } + }, + { + "filename": "dusk_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 191, + "y": 68, + "w": 21, + "h": 21 + } + }, + { + "filename": "liechi_berry", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 22, + "h": 21 + }, + "frame": { + "x": 211, + "y": 46, + "w": 22, + "h": 21 + } + }, + { + "filename": "poison_barb", "rotated": false, "trimmed": true, "sourceSize": { @@ -3321,14 +3279,14 @@ "h": 21 }, "frame": { - "x": 103, - "y": 197, + "x": 212, + "y": 67, "w": 21, "h": 21 } }, { - "filename": "upgrade", + "filename": "shiny_stone", "rotated": false, "trimmed": true, "sourceSize": { @@ -3337,15 +3295,15 @@ }, "spriteSourceSize": { "x": 5, - "y": 7, - "w": 22, - "h": 19 + "y": 6, + "w": 21, + "h": 21 }, "frame": { - "x": 103, - "y": 218, - "w": 22, - "h": 19 + "x": 198, + "y": 89, + "w": 21, + "h": 21 } }, { @@ -3363,12 +3321,54 @@ "h": 21 }, "frame": { - "x": 108, - "y": 237, + "x": 200, + "y": 110, "w": 19, "h": 21 } }, + { + "filename": "zoom_lens", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 6, + "w": 21, + "h": 21 + }, + "frame": { + "x": 201, + "y": 131, + "w": 21, + "h": 21 + } + }, + { + "filename": "golden_egg", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 6, + "w": 17, + "h": 20 + }, + "frame": { + "x": 206, + "y": 152, + "w": 17, + "h": 20 + } + }, { "filename": "hard_stone", "rotated": false, @@ -3384,8 +3384,8 @@ "h": 20 }, "frame": { - "x": 109, - "y": 258, + "x": 206, + "y": 172, "w": 19, "h": 20 } @@ -3405,12 +3405,33 @@ "h": 20 }, "frame": { - "x": 109, - "y": 278, + "x": 206, + "y": 192, "w": 20, "h": 20 } }, + { + "filename": "lucky_egg", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 6, + "w": 17, + "h": 20 + }, + "frame": { + "x": 219, + "y": 88, + "w": 17, + "h": 20 + } + }, { "filename": "pb", "rotated": false, @@ -3426,33 +3447,12 @@ "h": 20 }, "frame": { - "x": 124, - "y": 194, + "x": 219, + "y": 108, "w": 20, "h": 20 } }, - { - "filename": "lum_berry", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 7, - "w": 20, - "h": 19 - }, - "frame": { - "x": 144, - "y": 195, - "w": 20, - "h": 19 - } - }, { "filename": "pb_gold", "rotated": false, @@ -3468,8 +3468,8 @@ "h": 20 }, "frame": { - "x": 125, - "y": 214, + "x": 222, + "y": 128, "w": 20, "h": 20 } @@ -3489,8 +3489,8 @@ "h": 20 }, "frame": { - "x": 145, - "y": 214, + "x": 223, + "y": 148, "w": 20, "h": 20 } @@ -3510,56 +3510,14 @@ "h": 20 }, "frame": { - "x": 127, - "y": 234, + "x": 225, + "y": 168, "w": 20, "h": 20 } }, { - "filename": "golden_egg", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 17, - "h": 20 - }, - "frame": { - "x": 147, - "y": 234, - "w": 17, - "h": 20 - } - }, - { - "filename": "wl_antidote", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 18 - }, - "frame": { - "x": 164, - "y": 196, - "w": 20, - "h": 18 - } - }, - { - "filename": "miracle_seed", + "filename": "lum_berry", "rotated": false, "trimmed": true, "sourceSize": { @@ -3569,16 +3527,79 @@ "spriteSourceSize": { "x": 6, "y": 7, - "w": 19, + "w": 20, "h": 19 }, "frame": { - "x": 165, - "y": 214, - "w": 19, + "x": 226, + "y": 188, + "w": 20, "h": 19 } }, + { + "filename": "upgrade", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 5, + "y": 7, + "w": 22, + "h": 19 + }, + "frame": { + "x": 233, + "y": 47, + "w": 22, + "h": 19 + } + }, + { + "filename": "black_glasses", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 8, + "w": 23, + "h": 17 + }, + "frame": { + "x": 255, + "y": 47, + "w": 23, + "h": 17 + } + }, + { + "filename": "wise_glasses", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 8, + "w": 23, + "h": 17 + }, + "frame": { + "x": 278, + "y": 47, + "w": 23, + "h": 17 + } + }, { "filename": "razor_claw", "rotated": false, @@ -3594,12 +3615,96 @@ "h": 19 }, "frame": { - "x": 184, - "y": 196, + "x": 233, + "y": 66, "w": 20, "h": 19 } }, + { + "filename": "miracle_seed", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 7, + "w": 19, + "h": 19 + }, + "frame": { + "x": 236, + "y": 85, + "w": 19, + "h": 19 + } + }, + { + "filename": "oval_stone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 7, + "y": 7, + "w": 18, + "h": 19 + }, + "frame": { + "x": 239, + "y": 104, + "w": 18, + "h": 19 + } + }, + { + "filename": "silver_powder", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 4, + "y": 11, + "w": 24, + "h": 15 + }, + "frame": { + "x": 301, + "y": 48, + "w": 24, + "h": 15 + } + }, + { + "filename": "wl_antidote", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 18 + }, + "frame": { + "x": 208, + "y": 212, + "w": 20, + "h": 18 + } + }, { "filename": "wl_awakening", "rotated": false, @@ -3615,12 +3720,33 @@ "h": 18 }, "frame": { - "x": 184, - "y": 215, + "x": 208, + "y": 230, "w": 20, "h": 18 } }, + { + "filename": "prism_scale", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 9, + "y": 8, + "w": 15, + "h": 15 + }, + "frame": { + "x": 208, + "y": 248, + "w": 15, + "h": 15 + } + }, { "filename": "wl_burn_heal", "rotated": false, @@ -3636,8 +3762,8 @@ "h": 18 }, "frame": { - "x": 204, - "y": 196, + "x": 228, + "y": 207, "w": 20, "h": 18 } @@ -3657,8 +3783,8 @@ "h": 18 }, "frame": { - "x": 204, - "y": 214, + "x": 228, + "y": 225, "w": 20, "h": 18 } @@ -3678,96 +3804,12 @@ "h": 18 }, "frame": { - "x": 128, - "y": 254, + "x": 212, + "y": 263, "w": 20, "h": 18 } }, - { - "filename": "lucky_egg", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 6, - "w": 17, - "h": 20 - }, - "frame": { - "x": 148, - "y": 254, - "w": 17, - "h": 20 - } - }, - { - "filename": "oval_stone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 7, - "y": 7, - "w": 18, - "h": 19 - }, - "frame": { - "x": 129, - "y": 272, - "w": 18, - "h": 19 - } - }, - { - "filename": "everstone", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 6, - "y": 8, - "w": 20, - "h": 17 - }, - "frame": { - "x": 147, - "y": 274, - "w": 20, - "h": 17 - } - }, - { - "filename": "revive", - "rotated": false, - "trimmed": true, - "sourceSize": { - "w": 32, - "h": 32 - }, - "spriteSourceSize": { - "x": 10, - "y": 8, - "w": 12, - "h": 17 - }, - "frame": { - "x": 255, - "y": 165, - "w": 12, - "h": 17 - } - }, { "filename": "wl_full_restore", "rotated": false, @@ -3783,8 +3825,8 @@ "h": 18 }, "frame": { - "x": 267, - "y": 169, + "x": 215, + "y": 281, "w": 20, "h": 18 } @@ -3804,8 +3846,8 @@ "h": 18 }, "frame": { - "x": 287, - "y": 171, + "x": 242, + "y": 123, "w": 20, "h": 18 } @@ -3825,8 +3867,8 @@ "h": 18 }, "frame": { - "x": 224, - "y": 196, + "x": 243, + "y": 141, "w": 20, "h": 18 } @@ -3846,8 +3888,8 @@ "h": 18 }, "frame": { - "x": 224, - "y": 214, + "x": 218, + "y": 299, "w": 20, "h": 18 } @@ -3867,8 +3909,8 @@ "h": 18 }, "frame": { - "x": 129, - "y": 291, + "x": 245, + "y": 159, "w": 20, "h": 18 } @@ -3888,12 +3930,33 @@ "h": 18 }, "frame": { - "x": 149, - "y": 291, + "x": 246, + "y": 177, "w": 20, "h": 18 } }, + { + "filename": "everstone", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 6, + "y": 8, + "w": 20, + "h": 17 + }, + "frame": { + "x": 228, + "y": 243, + "w": 20, + "h": 17 + } + }, { "filename": "wl_max_potion", "rotated": false, @@ -3909,8 +3972,8 @@ "h": 18 }, "frame": { - "x": 244, - "y": 194, + "x": 232, + "y": 260, "w": 20, "h": 18 } @@ -3930,8 +3993,8 @@ "h": 18 }, "frame": { - "x": 244, - "y": 212, + "x": 235, + "y": 278, "w": 20, "h": 18 } @@ -3951,8 +4014,8 @@ "h": 18 }, "frame": { - "x": 264, - "y": 187, + "x": 238, + "y": 296, "w": 20, "h": 18 } @@ -3972,8 +4035,8 @@ "h": 18 }, "frame": { - "x": 264, - "y": 205, + "x": 248, + "y": 195, "w": 20, "h": 18 } @@ -3993,8 +4056,8 @@ "h": 18 }, "frame": { - "x": 284, - "y": 189, + "x": 248, + "y": 213, "w": 20, "h": 18 } @@ -4014,8 +4077,8 @@ "h": 18 }, "frame": { - "x": 284, - "y": 207, + "x": 248, + "y": 231, "w": 20, "h": 18 } @@ -4035,12 +4098,75 @@ "h": 18 }, "frame": { - "x": 264, - "y": 223, + "x": 252, + "y": 249, "w": 20, "h": 18 } }, + { + "filename": "absolite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 255, + "y": 267, + "w": 16, + "h": 16 + } + }, + { + "filename": "revive", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 10, + "y": 8, + "w": 12, + "h": 17 + }, + "frame": { + "x": 253, + "y": 66, + "w": 12, + "h": 17 + } + }, + { + "filename": "aerodactylite", + "rotated": false, + "trimmed": true, + "sourceSize": { + "w": 32, + "h": 32 + }, + "spriteSourceSize": { + "x": 8, + "y": 8, + "w": 16, + "h": 16 + }, + "frame": { + "x": 265, + "y": 64, + "w": 16, + "h": 16 + } + }, { "filename": "aggronite", "rotated": false, @@ -4056,8 +4182,8 @@ "h": 16 }, "frame": { - "x": 284, - "y": 225, + "x": 281, + "y": 64, "w": 16, "h": 16 } @@ -4077,8 +4203,8 @@ "h": 16 }, "frame": { - "x": 300, - "y": 225, + "x": 255, + "y": 83, "w": 16, "h": 16 } @@ -4098,8 +4224,8 @@ "h": 16 }, "frame": { - "x": 304, - "y": 189, + "x": 271, + "y": 80, "w": 16, "h": 16 } @@ -4119,8 +4245,8 @@ "h": 16 }, "frame": { - "x": 304, - "y": 205, + "x": 287, + "y": 80, "w": 16, "h": 16 } @@ -4140,8 +4266,8 @@ "h": 16 }, "frame": { - "x": 244, - "y": 230, + "x": 297, + "y": 64, "w": 16, "h": 16 } @@ -4161,8 +4287,8 @@ "h": 16 }, "frame": { - "x": 204, - "y": 232, + "x": 303, + "y": 80, "w": 16, "h": 16 } @@ -4182,8 +4308,8 @@ "h": 16 }, "frame": { - "x": 220, - "y": 232, + "x": 257, + "y": 99, "w": 16, "h": 16 } @@ -4203,8 +4329,8 @@ "h": 16 }, "frame": { - "x": 260, - "y": 241, + "x": 273, + "y": 96, "w": 16, "h": 16 } @@ -4224,8 +4350,8 @@ "h": 16 }, "frame": { - "x": 276, - "y": 241, + "x": 289, + "y": 96, "w": 16, "h": 16 } @@ -4245,8 +4371,8 @@ "h": 16 }, "frame": { - "x": 292, - "y": 241, + "x": 305, + "y": 96, "w": 16, "h": 16 } @@ -4266,8 +4392,8 @@ "h": 16 }, "frame": { - "x": 164, - "y": 234, + "x": 262, + "y": 115, "w": 16, "h": 16 } @@ -4287,8 +4413,8 @@ "h": 16 }, "frame": { - "x": 180, - "y": 233, + "x": 278, + "y": 112, "w": 16, "h": 16 } @@ -4308,8 +4434,8 @@ "h": 16 }, "frame": { - "x": 165, - "y": 250, + "x": 294, + "y": 112, "w": 16, "h": 16 } @@ -4329,8 +4455,8 @@ "h": 16 }, "frame": { - "x": 181, - "y": 249, + "x": 310, + "y": 112, "w": 16, "h": 16 } @@ -4350,8 +4476,8 @@ "h": 16 }, "frame": { - "x": 197, - "y": 248, + "x": 263, + "y": 131, "w": 16, "h": 16 } @@ -4371,8 +4497,8 @@ "h": 16 }, "frame": { - "x": 213, - "y": 248, + "x": 279, + "y": 128, "w": 16, "h": 16 } @@ -4392,8 +4518,8 @@ "h": 16 }, "frame": { - "x": 229, - "y": 248, + "x": 295, + "y": 128, "w": 16, "h": 16 } @@ -4413,8 +4539,8 @@ "h": 16 }, "frame": { - "x": 167, - "y": 266, + "x": 311, + "y": 128, "w": 16, "h": 16 } @@ -4434,8 +4560,8 @@ "h": 16 }, "frame": { - "x": 183, - "y": 265, + "x": 279, + "y": 144, "w": 16, "h": 16 } @@ -4455,8 +4581,8 @@ "h": 16 }, "frame": { - "x": 199, - "y": 264, + "x": 295, + "y": 144, "w": 16, "h": 16 } @@ -4476,8 +4602,8 @@ "h": 16 }, "frame": { - "x": 215, - "y": 264, + "x": 311, + "y": 144, "w": 16, "h": 16 } @@ -4497,8 +4623,8 @@ "h": 16 }, "frame": { - "x": 231, - "y": 264, + "x": 265, + "y": 160, "w": 16, "h": 16 } @@ -4518,8 +4644,8 @@ "h": 16 }, "frame": { - "x": 169, - "y": 282, + "x": 281, + "y": 160, "w": 16, "h": 16 } @@ -4539,8 +4665,8 @@ "h": 16 }, "frame": { - "x": 185, - "y": 281, + "x": 297, + "y": 160, "w": 16, "h": 16 } @@ -4560,8 +4686,8 @@ "h": 16 }, "frame": { - "x": 201, - "y": 280, + "x": 266, + "y": 176, "w": 16, "h": 16 } @@ -4581,8 +4707,8 @@ "h": 16 }, "frame": { - "x": 217, - "y": 280, + "x": 282, + "y": 176, "w": 16, "h": 16 } @@ -4602,8 +4728,8 @@ "h": 16 }, "frame": { - "x": 233, - "y": 280, + "x": 298, + "y": 176, "w": 16, "h": 16 } @@ -4623,8 +4749,8 @@ "h": 16 }, "frame": { - "x": 169, - "y": 298, + "x": 268, + "y": 192, "w": 16, "h": 16 } @@ -4644,8 +4770,8 @@ "h": 16 }, "frame": { - "x": 185, - "y": 297, + "x": 268, + "y": 208, "w": 16, "h": 16 } @@ -4665,8 +4791,8 @@ "h": 16 }, "frame": { - "x": 201, - "y": 296, + "x": 284, + "y": 192, "w": 16, "h": 16 } @@ -4686,8 +4812,8 @@ "h": 16 }, "frame": { - "x": 217, - "y": 296, + "x": 268, + "y": 224, "w": 16, "h": 16 } @@ -4707,8 +4833,8 @@ "h": 16 }, "frame": { - "x": 233, - "y": 296, + "x": 284, + "y": 208, "w": 16, "h": 16 } @@ -4728,8 +4854,8 @@ "h": 16 }, "frame": { - "x": 247, - "y": 257, + "x": 284, + "y": 224, "w": 16, "h": 16 } @@ -4749,8 +4875,8 @@ "h": 16 }, "frame": { - "x": 263, - "y": 257, + "x": 300, + "y": 192, "w": 16, "h": 16 } @@ -4770,8 +4896,8 @@ "h": 16 }, "frame": { - "x": 279, - "y": 257, + "x": 300, + "y": 208, "w": 16, "h": 16 } @@ -4791,8 +4917,8 @@ "h": 16 }, "frame": { - "x": 295, - "y": 257, + "x": 300, + "y": 224, "w": 16, "h": 16 } @@ -4812,8 +4938,8 @@ "h": 16 }, "frame": { - "x": 249, - "y": 273, + "x": 272, + "y": 240, "w": 16, "h": 16 } @@ -4833,8 +4959,8 @@ "h": 16 }, "frame": { - "x": 249, - "y": 289, + "x": 288, + "y": 240, "w": 16, "h": 16 } @@ -4854,8 +4980,8 @@ "h": 16 }, "frame": { - "x": 249, - "y": 305, + "x": 304, + "y": 240, "w": 16, "h": 16 } @@ -4875,8 +5001,8 @@ "h": 16 }, "frame": { - "x": 265, - "y": 273, + "x": 272, + "y": 256, "w": 16, "h": 16 } @@ -4896,8 +5022,8 @@ "h": 16 }, "frame": { - "x": 265, - "y": 289, + "x": 288, + "y": 256, "w": 16, "h": 16 } @@ -4917,8 +5043,8 @@ "h": 16 }, "frame": { - "x": 265, - "y": 305, + "x": 304, + "y": 256, "w": 16, "h": 16 } @@ -4938,8 +5064,8 @@ "h": 16 }, "frame": { - "x": 281, - "y": 273, + "x": 271, + "y": 272, "w": 16, "h": 16 } @@ -4959,8 +5085,8 @@ "h": 16 }, "frame": { - "x": 281, - "y": 289, + "x": 287, + "y": 272, "w": 16, "h": 16 } @@ -4980,8 +5106,8 @@ "h": 16 }, "frame": { - "x": 281, - "y": 305, + "x": 303, + "y": 272, "w": 16, "h": 16 } @@ -5001,8 +5127,8 @@ "h": 16 }, "frame": { - "x": 297, - "y": 273, + "x": 258, + "y": 288, "w": 16, "h": 16 } @@ -5022,8 +5148,8 @@ "h": 16 }, "frame": { - "x": 297, - "y": 289, + "x": 274, + "y": 288, "w": 16, "h": 16 } @@ -5034,6 +5160,6 @@ "meta": { "app": "https://www.codeandweb.com/texturepacker", "version": "3.0", - "smartupdate": "$TexturePacker:SmartUpdate:add9eb8b8733956530a2c48ab73c92b3:e3840500ae12890f9d66a76a719ccd1d:110e074689c9edd2c54833ce2e4d9270$" + "smartupdate": "$TexturePacker:SmartUpdate:6633a2c1c8ba5a849b0ed9650d9ac5a0:c4256b2cc1ff3ba479deffde19dd262a:110e074689c9edd2c54833ce2e4d9270$" } } diff --git a/public/images/items.png b/public/images/items.png index 47807a206..f4146907b 100644 Binary files a/public/images/items.png and b/public/images/items.png differ diff --git a/public/images/items/adamant_crystal.png b/public/images/items/adamant_crystal.png new file mode 100644 index 000000000..d729c40ce Binary files /dev/null and b/public/images/items/adamant_crystal.png differ diff --git a/public/images/items/blue_orb.png b/public/images/items/blue_orb.png new file mode 100644 index 000000000..91094d821 Binary files /dev/null and b/public/images/items/blue_orb.png differ diff --git a/public/images/items/gracidea.png b/public/images/items/gracidea.png new file mode 100644 index 000000000..0552d11b0 Binary files /dev/null and b/public/images/items/gracidea.png differ diff --git a/public/images/items/griseous_core.png b/public/images/items/griseous_core.png new file mode 100644 index 000000000..fa131cccf Binary files /dev/null and b/public/images/items/griseous_core.png differ diff --git a/public/images/items/lustrous_globe.png b/public/images/items/lustrous_globe.png new file mode 100644 index 000000000..a16cf80c3 Binary files /dev/null and b/public/images/items/lustrous_globe.png differ diff --git a/public/images/items/red_orb.png b/public/images/items/red_orb.png new file mode 100644 index 000000000..b982649c9 Binary files /dev/null and b/public/images/items/red_orb.png differ diff --git a/public/images/pokemon/icons/658-ash.png b/public/images/pokemon/icons/658-ash.png new file mode 100644 index 000000000..bc3aa93eb Binary files /dev/null and b/public/images/pokemon/icons/658-ash.png differ diff --git a/src/battle-phases.ts b/src/battle-phases.ts index a664f27ae..122867f68 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -39,6 +39,8 @@ import { vouchers } from "./system/voucher"; import { loggedInUser, updateUserInfo } from "./account"; import { GameDataType } from "./system/game-data"; import { addPokeballCaptureStars, addPokeballOpenParticles } from "./anims"; +import { getPokemonSpecies } from "./data/pokemon-species"; +import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangeMoveUsedTrigger } from "./data/pokemon-forms"; export class LoginPhase extends BattlePhase { private showText: boolean; @@ -883,6 +885,8 @@ export class SummonPhase extends PartyMemberPokemonPhase { pokemon.resetTurnData(); + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); + this.queuePostSummon(); } @@ -938,6 +942,7 @@ export class SwitchSummonPhase extends SummonPhase { onComplete: () => { pokemon.setVisible(false); this.scene.field.remove(pokemon); + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); this.scene.time.delayedCall(750, () => this.switchAndSummon()); } }); @@ -974,6 +979,8 @@ export class SwitchSummonPhase extends SummonPhase { pokemon.transferSummon(this.lastPokemon); this.lastPokemon?.resetSummonData(); + + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); } queuePostSummon(): void { @@ -997,6 +1004,8 @@ export class ReturnPhase extends SwitchSummonPhase { pokemon.resetTurnData(); pokemon.resetSummonData(); + + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger); } } @@ -1844,6 +1853,8 @@ export class MoveEffectPhase extends PokemonPhase { const hitResult = !isProtected ? target.apply(user, this.move) : HitResult.NO_EFFECT; + this.scene.triggerPokemonFormChange(user, SpeciesFormChangeMoveUsedTrigger); + applyAttrs.push(new Promise(resolve => { applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.PRE_APPLY, user, target, this.move.getMove()).then(() => { @@ -2806,7 +2817,7 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { if (!pokemon.pauseEvolutions) { const evolution = pokemon.getEvolution(); if (evolution) - this.scene.unshiftPhase(new EvolutionPhase(this.scene, this.partyMemberIndex, evolution, this.lastLevel)); + this.scene.unshiftPhase(new EvolutionPhase(this.scene, pokemon as PlayerPokemon, evolution, this.lastLevel)); } } } @@ -2846,7 +2857,10 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase { .then(() => { this.scene.ui.setMode(messageMode).then(() => { this.scene.playSoundWithoutBgm('level_up_fanfare', 1500); - this.scene.ui.showText(`${pokemon.name} learned\n${move.name}!`, null, () => this.end(), messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true); + this.scene.ui.showText(`${pokemon.name} learned\n${move.name}!`, null, () => { + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeMoveLearnedTrigger, true); + this.end(); + }, messageMode === Mode.EVOLUTION_SCENE ? 1000 : null, true); }); }); }); diff --git a/src/battle-scene.ts b/src/battle-scene.ts index b135a0064..7f8bca88c 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -5,7 +5,7 @@ import { EncounterPhase, SummonPhase, NextEncounterPhase, NewBiomeEncounterPhase import Pokemon, { PlayerPokemon, EnemyPokemon } from './pokemon'; import PokemonSpecies, { PokemonSpeciesFilter, allSpecies, getPokemonSpecies, initSpecies, speciesStarters } from './data/pokemon-species'; import * as Utils from './utils'; -import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonHpRestoreModifier, HealingBoosterModifier, PersistentModifier, PokemonHeldItemModifier, ModifierPredicate, DoubleBattleChanceBoosterModifier, FusePokemonModifier } from './modifier/modifier'; +import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonHpRestoreModifier, HealingBoosterModifier, PersistentModifier, PokemonHeldItemModifier, ModifierPredicate, DoubleBattleChanceBoosterModifier, FusePokemonModifier, PokemonFormChangeItemModifier } from './modifier/modifier'; import { PokeballType } from './data/pokeball'; import { initAutoPlay } from './system/auto-play'; import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from './data/battle-anims'; @@ -43,6 +43,8 @@ import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin'; import { WindowVariant, getWindowVariantSuffix } from './ui/window'; import PokemonData from './system/pokemon-data'; import { Nature } from './data/nature'; +import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, getSpeciesFormChangeMessage, pokemonFormChanges } from './data/pokemon-forms'; +import { FormChangePhase, QuietFormChangePhase } from './form-change-phase'; const enableAuto = true; const quickStart = false; @@ -99,6 +101,7 @@ export default class BattleScene extends Phaser.Scene { private phaseQueuePrepend: BattlePhase[]; private phaseQueuePrependSpliceIndex: integer; private currentPhase: BattlePhase; + private standbyPhase: BattlePhase; public field: Phaser.GameObjects.Container; public fieldUI: Phaser.GameObjects.Container; public pbTray: PokeballTray; @@ -381,6 +384,7 @@ export default class BattleScene extends Phaser.Scene { this.loadBgm('level_up_fanfare', 'bw/level_up_fanfare.mp3'); this.loadBgm('item_fanfare', 'bw/item_fanfare.mp3'); + this.loadBgm('minor_fanfare', 'bw/minor_fanfare.mp3'); this.loadBgm('heal', 'bw/heal.mp3'); this.loadBgm('victory_trainer', 'bw/victory_trainer.mp3'); this.loadBgm('victory_gym', 'bw/victory_gym.mp3'); @@ -806,9 +810,12 @@ export default class BattleScene extends Phaser.Scene { this.arena.removeAllTags(); playerField.forEach((_, p) => this.unshiftPhase(new ReturnPhase(this, p))); this.unshiftPhase(new ShowTrainerPhase(this)); - for (let pokemon of this.getParty()) { - if (pokemon) + } + for (let pokemon of this.getParty()) { + if (pokemon) { + if (resetArenaState) pokemon.resetBattleData(); + this.triggerPokemonFormChange(pokemon, SpeciesFormChangeTimeOfDayTrigger); } } if (this.gameMode === GameMode.CLASSIC && !isNewBiome) @@ -843,7 +850,7 @@ export default class BattleScene extends Phaser.Scene { return this.arena; } - getSpeciesFormIndex(species: PokemonSpecies, gender?: Gender, ignoreArena?: boolean): integer { + getSpeciesFormIndex(species: PokemonSpecies, gender?: Gender, nature?: Nature, ignoreArena?: boolean): integer { if (!species.forms?.length) return 0; @@ -856,6 +863,11 @@ export default class BattleScene extends Phaser.Scene { case Species.MEOWSTIC: case Species.INDEEDEE: return gender === Gender.FEMALE ? 1 : 0; + case Species.TOXTRICITY: + const lowkeyNatures = [ Nature.LONELY, Nature.BOLD, Nature.RELAXED, Nature.TIMID, Nature.SERIOUS, Nature.MODEST, Nature.MILD, Nature.QUIET, Nature.BASHFUL, Nature.CALM, Nature.GENTLE, Nature.CAREFUL ]; + if (nature !== undefined && lowkeyNatures.indexOf(nature) > -1) + return 1; + return 0; } if (ignoreArena) { @@ -1292,6 +1304,10 @@ export default class BattleScene extends Phaser.Scene { return this.currentPhase; } + getStandbyPhase(): BattlePhase { + return this.standbyPhase; + } + pushPhase(phase: BattlePhase): void { this.phaseQueue.push(phase); } @@ -1316,6 +1332,12 @@ export default class BattleScene extends Phaser.Scene { } shiftPhase(): void { + if (this.standbyPhase) { + this.currentPhase = this.standbyPhase; + this.standbyPhase = null; + return; + } + if (this.phaseQueuePrependSpliceIndex > -1) this.clearPhaseQueueSplice(); if (this.phaseQueuePrepend.length) { @@ -1327,6 +1349,17 @@ export default class BattleScene extends Phaser.Scene { this.currentPhase = this.phaseQueue.shift(); this.currentPhase.start(); } + + overridePhase(phase: BattlePhase): boolean { + if (this.standbyPhase) + return false; + + this.standbyPhase = this.currentPhase; + this.currentPhase = phase; + phase.start(); + + return true; + } queueMessage(message: string, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer, defer?: boolean) { const phase = new MessagePhase(this, message, callbackDelay, prompt, promptDelay); @@ -1346,6 +1379,8 @@ export default class BattleScene extends Phaser.Scene { this.validateAchvs(ModifierAchv, modifier); if (modifier instanceof PersistentModifier) { if ((modifier as PersistentModifier).add(this.modifiers, !!virtual, this)) { + if (modifier instanceof PokemonFormChangeItemModifier) + modifier.apply([ this.getPokemonById(modifier.pokemonId) ]); if (playSound && !this.sound.get(soundName)) this.playSound(soundName); } else if (!virtual) { @@ -1587,6 +1622,28 @@ export default class BattleScene extends Phaser.Scene { return null; } + triggerPokemonFormChange(pokemon: Pokemon, formChangeTriggerType: { new(...args: any[]): SpeciesFormChangeTrigger }, delayed: boolean = false, modal: boolean = false): boolean { + if (pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId)) { + const matchingFormChange = pokemonFormChanges[pokemon.species.speciesId].find(fc => fc.findTrigger(formChangeTriggerType) && fc.canChange(pokemon)); + if (matchingFormChange) { + let phase: BattlePhase; + if (pokemon instanceof PlayerPokemon && !matchingFormChange.quiet) + phase = new FormChangePhase(this, pokemon, matchingFormChange, modal); + else + phase = new QuietFormChangePhase(this, pokemon, matchingFormChange); + if (!matchingFormChange.quiet && modal) + this.overridePhase(phase); + else if (delayed) + this.pushPhase(phase); + else + this.unshiftPhase(phase); + return true; + } + } + + return false; + } + validateAchvs(achvType: { new(...args: any[]): Achv }, ...args: any[]): void { const filteredAchvs = Object.values(achvs).filter(a => a instanceof achvType); for (let achv of filteredAchvs) diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index cdd2d07b3..99418619b 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -12,14 +12,14 @@ import { SpeciesFormKey } from "./pokemon-species"; import { WeatherType } from "./weather"; import { Biome } from "./biome"; import { TimeOfDay } from "../arena"; +import { Nature } from "./nature"; export enum SpeciesWildEvolutionDelay { NONE, SHORT, MEDIUM, LONG, - VERY_LONG, - MEGA + VERY_LONG } export enum EvolutionItem { @@ -34,56 +34,7 @@ export enum EvolutionItem { ICE_STONE, DUSK_STONE, DAWN_STONE, - SHINY_STONE, - - ABOMASITE = 100, - ABSOLITE, - AERODACTYLITE, - AGGRONITE, - ALAKAZITE, - ALTARIANITE, - AMPHAROSITE, - AUDINITE, - BANETTITE, - BEEDRILLITE, - BLASTOISINITE, - BLAZIKENITE, - CAMERUPTITE, - CHARIZARDITE_X, - CHARIZARDITE_Y, - DIANCITE, - GALLADITE, - GARCHOMPITE, - GARDEVOIRITE, - GENGARITE, - GLALITITE, - GYARADOSITE, - HERACRONITE, - HOUNDOOMINITE, - KANGASKHANITE, - LATIASITE, - LATIOSITE, - LOPUNNITE, - LUCARIONITE, - MANECTITE, - MAWILITE, - MEDICHAMITE, - METAGROSSITE, - MEWTWONITE_X, - MEWTWONITE_Y, - PIDGEOTITE, - PINSIRITE, - RAYQUAZITE, - SABLENITE, - SALAMENCITE, - SCEPTILITE, - SCIZORITE, - SHARPEDONITE, - SLOWBRONITE, - STEELIXITE, - SWAMPERTITE, - TYRANITARITE, - VENUSAURITE, + SHINY_STONE } export type EvolutionConditionPredicate = (p: Pokemon) => boolean; @@ -1068,7 +1019,9 @@ export const pokemonEvolutions: PokemonEvolutions = { new SpeciesEvolution(Species.BARRASKEWDA, 26, null, null) ], [Species.TOXEL]: [ - new SpeciesEvolution(Species.TOXTRICITY, 30, null, null) + new SpeciesFormEvolution(Species.TOXTRICITY, '', 'lowkey', 30, null, + new SpeciesEvolutionCondition(p => [ Nature.LONELY, Nature.BOLD, Nature.RELAXED, Nature.TIMID, Nature.SERIOUS, Nature.MODEST, Nature.MILD, Nature.QUIET, Nature.BASHFUL, Nature.CALM, Nature.GENTLE, Nature.CAREFUL ].indexOf(p.nature) > -1)), + new SpeciesFormEvolution(Species.TOXTRICITY, '', 'amped', 30, null, null) ], [Species.SIZZLIPEDE]: [ new SpeciesEvolution(Species.CENTISKORCH, 28, null, null) @@ -1618,146 +1571,6 @@ export const pokemonEvolutions: PokemonEvolutions = { ], [Species.GIMMIGHOUL]: [ new SpeciesEvolution(Species.GHOLDENGO, 1, null, new SpeciesFriendshipEvolutionCondition(70), SpeciesWildEvolutionDelay.VERY_LONG) - ], - [Species.VENUSAUR]: [ - new SpeciesFormEvolution(Species.VENUSAUR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.VENUSAURITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.BLASTOISE]: [ - new SpeciesFormEvolution(Species.BLASTOISE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.BLASTOISINITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.CHARIZARD]: [ - new SpeciesFormEvolution(Species.CHARIZARD, '', SpeciesFormKey.MEGA_X, 1, EvolutionItem.CHARIZARDITE_X, null, SpeciesWildEvolutionDelay.MEGA), - new SpeciesFormEvolution(Species.CHARIZARD, '', SpeciesFormKey.MEGA_Y, 1, EvolutionItem.CHARIZARDITE_Y, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.BEEDRILL]: [ - new SpeciesFormEvolution(Species.BEEDRILL, '', SpeciesFormKey.MEGA, 1, EvolutionItem.BEEDRILLITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.PIDGEOT]: [ - new SpeciesFormEvolution(Species.PIDGEOT, '', SpeciesFormKey.MEGA, 1, EvolutionItem.PIDGEOTITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.ALAKAZAM]: [ - new SpeciesFormEvolution(Species.ALAKAZAM, '', SpeciesFormKey.MEGA, 1, EvolutionItem.ALAKAZITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SLOWBRO]: [ - new SpeciesFormEvolution(Species.SLOWBRO, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SLOWBRONITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GENGAR]: [ - new SpeciesFormEvolution(Species.GENGAR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GENGARITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.KANGASKHAN]: [ - new SpeciesFormEvolution(Species.KANGASKHAN, '', SpeciesFormKey.MEGA, 1, EvolutionItem.KANGASKHANITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.PINSIR]: [ - new SpeciesFormEvolution(Species.PINSIR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.PINSIRITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GYARADOS]: [ - new SpeciesFormEvolution(Species.GYARADOS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GYARADOSITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.AERODACTYL]: [ - new SpeciesFormEvolution(Species.AERODACTYL, '', SpeciesFormKey.MEGA, 1, EvolutionItem.AERODACTYLITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.MEWTWO]: [ - new SpeciesFormEvolution(Species.MEWTWO, '', SpeciesFormKey.MEGA_X, 1, EvolutionItem.MEWTWONITE_X, null, SpeciesWildEvolutionDelay.MEGA), - new SpeciesFormEvolution(Species.MEWTWO, '', SpeciesFormKey.MEGA_Y, 1, EvolutionItem.MEWTWONITE_Y, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.AMPHAROS]: [ - new SpeciesFormEvolution(Species.AMPHAROS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.AMPHAROSITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.STEELIX]: [ - new SpeciesFormEvolution(Species.STEELIX, '', SpeciesFormKey.MEGA, 1, EvolutionItem.STEELIXITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SCIZOR]: [ - new SpeciesFormEvolution(Species.SCIZOR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SCIZORITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.HERACROSS]: [ - new SpeciesFormEvolution(Species.HERACROSS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.HERACRONITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.HOUNDOOM]: [ - new SpeciesFormEvolution(Species.HOUNDOOM, '', SpeciesFormKey.MEGA, 1, EvolutionItem.HOUNDOOMINITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.TYRANITAR]: [ - new SpeciesFormEvolution(Species.TYRANITAR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.TYRANITARITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SCEPTILE]: [ - new SpeciesFormEvolution(Species.SCEPTILE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SCEPTILITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.BLAZIKEN]: [ - new SpeciesFormEvolution(Species.BLAZIKEN, '', SpeciesFormKey.MEGA, 1, EvolutionItem.BLAZIKENITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SWAMPERT]: [ - new SpeciesFormEvolution(Species.SWAMPERT, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SWAMPERTITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GARDEVOIR]: [ - new SpeciesFormEvolution(Species.GARDEVOIR, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GARDEVOIRITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SABLEYE]: [ - new SpeciesFormEvolution(Species.SABLEYE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SABLENITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.MAWILE]: [ - new SpeciesFormEvolution(Species.MAWILE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.MAWILITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.AGGRON]: [ - new SpeciesFormEvolution(Species.AGGRON, '', SpeciesFormKey.MEGA, 1, EvolutionItem.AGGRONITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.MEDICHAM]: [ - new SpeciesFormEvolution(Species.MEDICHAM, '', SpeciesFormKey.MEGA, 1, EvolutionItem.MEDICHAMITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.MANECTRIC]: [ - new SpeciesFormEvolution(Species.MANECTRIC, '', SpeciesFormKey.MEGA, 1, EvolutionItem.MANECTITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SHARPEDO]: [ - new SpeciesFormEvolution(Species.SHARPEDO, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SHARPEDONITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.CAMERUPT]: [ - new SpeciesFormEvolution(Species.CAMERUPT, '', SpeciesFormKey.MEGA, 1, EvolutionItem.CAMERUPTITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.ALTARIA]: [ - new SpeciesFormEvolution(Species.ALTARIA, '', SpeciesFormKey.MEGA, 1, EvolutionItem.ALTARIANITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.BANETTE]: [ - new SpeciesFormEvolution(Species.BANETTE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.BANETTITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.ABSOL]: [ - new SpeciesFormEvolution(Species.ABSOL, '', SpeciesFormKey.MEGA, 1, EvolutionItem.ABSOLITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GLALIE]: [ - new SpeciesFormEvolution(Species.GLALIE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GLALITITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.SALAMENCE]: [ - new SpeciesFormEvolution(Species.SALAMENCE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.SALAMENCITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.METAGROSS]: [ - new SpeciesFormEvolution(Species.METAGROSS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.METAGROSSITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.LATIAS]: [ - new SpeciesFormEvolution(Species.LATIAS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.LATIASITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.LATIOS]: [ - new SpeciesFormEvolution(Species.LATIOS, '', SpeciesFormKey.MEGA, 1, EvolutionItem.LATIOSITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.RAYQUAZA]: [ - new SpeciesFormEvolution(Species.RAYQUAZA, '', SpeciesFormKey.MEGA, 1, EvolutionItem.RAYQUAZITE, new SpeciesEvolutionCondition(p => p.moveset.filter(m => m.moveId === Moves.DRAGON_ASCENT).length > 0), SpeciesWildEvolutionDelay.MEGA) - ], - [Species.LOPUNNY]: [ - new SpeciesFormEvolution(Species.LOPUNNY, '', SpeciesFormKey.MEGA, 1, EvolutionItem.LOPUNNITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GARCHOMP]: [ - new SpeciesFormEvolution(Species.GARCHOMP, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GARCHOMPITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.LUCARIO]: [ - new SpeciesFormEvolution(Species.LUCARIO, '', SpeciesFormKey.MEGA, 1, EvolutionItem.LUCARIONITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.ABOMASNOW]: [ - new SpeciesFormEvolution(Species.ABOMASNOW, '', SpeciesFormKey.MEGA, 1, EvolutionItem.ABOMASITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.GALLADE]: [ - new SpeciesFormEvolution(Species.GALLADE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.GALLADITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.AUDINO]: [ - new SpeciesFormEvolution(Species.AUDINO, '', SpeciesFormKey.MEGA, 1, EvolutionItem.AUDINITE, null, SpeciesWildEvolutionDelay.MEGA) - ], - [Species.DIANCIE]: [ - new SpeciesFormEvolution(Species.DIANCIE, '', SpeciesFormKey.MEGA, 1, EvolutionItem.DIANCITE, null, SpeciesWildEvolutionDelay.MEGA) ] }; diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts new file mode 100644 index 000000000..d9cf5bd3f --- /dev/null +++ b/src/data/pokemon-forms.ts @@ -0,0 +1,462 @@ +import { TimeOfDay } from "../arena"; +import { PokemonFormChangeItemModifier } from "../modifier/modifier"; +import Pokemon from "../pokemon"; +import { Moves } from "./move"; +import { SpeciesFormKey } from "./pokemon-species"; +import { Species } from "./species"; +import { StatusEffect } from "./status-effect"; + +export enum FormChangeItem { + NONE, + + ABOMASITE, + ABSOLITE, + AERODACTYLITE, + AGGRONITE, + ALAKAZITE, + ALTARIANITE, + AMPHAROSITE, + AUDINITE, + BANETTITE, + BEEDRILLITE, + BLASTOISINITE, + BLAZIKENITE, + CAMERUPTITE, + CHARIZARDITE_X, + CHARIZARDITE_Y, + DIANCITE, + GALLADITE, + GARCHOMPITE, + GARDEVOIRITE, + GENGARITE, + GLALITITE, + GYARADOSITE, + HERACRONITE, + HOUNDOOMINITE, + KANGASKHANITE, + LATIASITE, + LATIOSITE, + LOPUNNITE, + LUCARIONITE, + MANECTITE, + MAWILITE, + MEDICHAMITE, + METAGROSSITE, + MEWTWONITE_X, + MEWTWONITE_Y, + PIDGEOTITE, + PINSIRITE, + RAYQUAZITE, + SABLENITE, + SALAMENCITE, + SCEPTILITE, + SCIZORITE, + SHARPEDONITE, + SLOWBRONITE, + STEELIXITE, + SWAMPERTITE, + TYRANITARITE, + VENUSAURITE, + + BLUE_ORB = 50, + RED_ORB, + ADAMANT_CRYSTAL, + LUSTROUS_ORB, + GRISEOUS_CORE, + REVEAL_GLASS, + GRACIDEA +} + +export type SpeciesFormChangeConditionPredicate = (p: Pokemon) => boolean; +export type SpeciesFormChangeConditionEnforceFunc = (p: Pokemon) => void; + +export class SpeciesFormChange { + public speciesId: Species; + public preFormKey: string; + public formKey: string; + public trigger: SpeciesFormChangeTrigger; + public quiet: boolean; + + constructor(speciesId: Species, preFormKey: string, evoFormKey: string, trigger: SpeciesFormChangeTrigger, quiet: boolean = false) { + this.speciesId = speciesId; + this.preFormKey = preFormKey; + this.formKey = evoFormKey; + this.trigger = trigger; + this.quiet = quiet; + } + + canChange(pokemon: Pokemon): boolean { + if (pokemon.species.speciesId !== this.speciesId) + return false; + + if (!pokemon.species.forms.length) + return false; + + const formKeys = pokemon.species.forms.map(f => f.formKey); + if (formKeys[pokemon.formIndex] !== this.preFormKey) + return false; + + if (formKeys[pokemon.formIndex] === this.formKey) + return false; + + if (!this.trigger.canChange(pokemon)) + return false; + + return true; + } + + findTrigger(triggerType: { new(...args: any[]): SpeciesFormChangeTrigger }): SpeciesFormChangeTrigger { + if (!this.trigger.hasTriggerType(triggerType)) + return null; + + let trigger = this.trigger; + + if (trigger instanceof SpeciesFormChangeCompoundTrigger) + return trigger.triggers.find(t => t.hasTriggerType(triggerType)); + + return trigger; + } +} + +export class SpeciesFormChangeCondition { + public predicate: SpeciesFormChangeConditionPredicate; + public enforceFunc: SpeciesFormChangeConditionEnforceFunc; + + constructor(predicate: SpeciesFormChangeConditionPredicate, enforceFunc?: SpeciesFormChangeConditionEnforceFunc) { + this.predicate = predicate; + this.enforceFunc = enforceFunc; + } +} + +export abstract class SpeciesFormChangeTrigger { + canChange(pokemon: Pokemon): boolean { + return true; + } + + hasTriggerType(triggerType: { new(...args: any[]): SpeciesFormChangeTrigger }): boolean { + return this instanceof triggerType; + } +} + +export class SpeciesFormChangeCompoundTrigger { + public triggers: SpeciesFormChangeTrigger[]; + + constructor(...triggers: SpeciesFormChangeTrigger[]) { + this.triggers = triggers; + } + + canChange(pokemon: Pokemon): boolean { + for (let trigger of this.triggers) { + if (!trigger.canChange(pokemon)) + return false; + } + + return true; + } + + hasTriggerType(triggerType: { new(...args: any[]): SpeciesFormChangeTrigger }): boolean { + return !!this.triggers.find(t => t.hasTriggerType(triggerType)); + } +} + +export class SpeciesFormChangeItemTrigger extends SpeciesFormChangeTrigger { + public item: FormChangeItem; + public active: boolean; + + constructor(item: FormChangeItem, active: boolean = true) { + super(); + this.item = item; + this.active = active; + } + + canChange(pokemon: Pokemon): boolean { + return !!pokemon.scene.findModifier(m => m instanceof PokemonFormChangeItemModifier && m.pokemonId === pokemon.id && m.formChangeItem === this.item && m.active === this.active && (!pokemon.formIndex === this.active)); + } +} + +export class SpeciesFormChangeTimeOfDayTrigger extends SpeciesFormChangeTrigger { + public timesOfDay: TimeOfDay[]; + + constructor(...timesOfDay: TimeOfDay[]) { + super(); + this.timesOfDay = timesOfDay; + } + + canChange(pokemon: Pokemon): boolean { + return this.timesOfDay.indexOf(pokemon.scene.arena.getTimeOfDay()) > -1; + } +} + +export class SpeciesFormChangeActiveTrigger extends SpeciesFormChangeTrigger { + public active: boolean; + + constructor(active: boolean = false) { + super(); + this.active = active; + } + + canChange(pokemon: Pokemon): boolean { + return pokemon.isActive(true) === this.active; + } +} + +export class SpeciesFormChangeStatusEffectTrigger extends SpeciesFormChangeTrigger { + public statusEffects: StatusEffect[]; + public invert: boolean; + + constructor(statusEffects: StatusEffect | StatusEffect[], invert: boolean = false) { + super(); + if (!Array.isArray(statusEffects)) + statusEffects = [ statusEffects ]; + this.statusEffects = statusEffects; + this.invert = invert; + } + + canChange(pokemon: Pokemon): boolean { + return (this.statusEffects.indexOf(pokemon.status?.effect || StatusEffect.NONE) > -1) !== this.invert; + } +} + +export class SpeciesFormChangeMoveLearnedTrigger extends SpeciesFormChangeTrigger { + public move: Moves; + public known: boolean; + + constructor(move: Moves, known: boolean = true) { + super(); + this.move = move; + this.known = known; + } + + canChange(pokemon: Pokemon): boolean { + return (!!pokemon.moveset.filter(m => m.moveId === this.move).length) === this.known; + } +} + +export class SpeciesFormChangeMoveUsedTrigger extends SpeciesFormChangeTrigger { + public move: Moves; + public used: boolean; + + constructor(move: Moves, used: boolean = true) { + super(); + this.move = move; + this.used = used; + } + + canChange(pokemon: Pokemon): boolean { + return pokemon.summonData && !!pokemon.getLastXMoves(1).filter(m => m.move === this.move).length === this.used; + } +} + +export function getSpeciesFormChangeMessage(pokemon: Pokemon, formChange: SpeciesFormChange, preName: string): string { + const isMega = formChange.formKey.indexOf(SpeciesFormKey.MEGA) > -1; + const isRevert = !isMega && formChange.formKey === pokemon.species.forms[0].formKey; + const prefix = !pokemon.isPlayer() ? pokemon.hasTrainer() ? 'Foe ' : 'Wild ' : 'Your '; + if (isMega) + return `${prefix}${preName} mega-evolved\ninto ${pokemon.name}!`; + if (isRevert) + return `${prefix}${pokemon.name} reverted\nto its original form!`; + return `${prefix}${preName} changed form!`; +} + +interface PokemonFormChanges { + [key: string]: SpeciesFormChange[] +} + +export const pokemonFormChanges: PokemonFormChanges = { + [Species.VENUSAUR]: [ + new SpeciesFormChange(Species.VENUSAUR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.VENUSAURITE)) + ], + [Species.BLASTOISE]: [ + new SpeciesFormChange(Species.BLASTOISE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.BLASTOISINITE)) + ], + [Species.CHARIZARD]: [ + new SpeciesFormChange(Species.CHARIZARD, '', SpeciesFormKey.MEGA_X, new SpeciesFormChangeItemTrigger(FormChangeItem.CHARIZARDITE_X)), + new SpeciesFormChange(Species.CHARIZARD, '', SpeciesFormKey.MEGA_Y, new SpeciesFormChangeItemTrigger(FormChangeItem.CHARIZARDITE_Y)) + ], + [Species.BEEDRILL]: [ + new SpeciesFormChange(Species.BEEDRILL, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.BEEDRILLITE)) + ], + [Species.PIDGEOT]: [ + new SpeciesFormChange(Species.PIDGEOT, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.PIDGEOTITE)) + ], + [Species.ALAKAZAM]: [ + new SpeciesFormChange(Species.ALAKAZAM, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ALAKAZITE)) + ], + [Species.SLOWBRO]: [ + new SpeciesFormChange(Species.SLOWBRO, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SLOWBRONITE)) + ], + [Species.GENGAR]: [ + new SpeciesFormChange(Species.GENGAR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GENGARITE)) + ], + [Species.KANGASKHAN]: [ + new SpeciesFormChange(Species.KANGASKHAN, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.KANGASKHANITE)) + ], + [Species.PINSIR]: [ + new SpeciesFormChange(Species.PINSIR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.PINSIRITE)) + ], + [Species.GYARADOS]: [ + new SpeciesFormChange(Species.GYARADOS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GYARADOSITE)) + ], + [Species.AERODACTYL]: [ + new SpeciesFormChange(Species.AERODACTYL, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.AERODACTYLITE)) + ], + [Species.MEWTWO]: [ + new SpeciesFormChange(Species.MEWTWO, '', SpeciesFormKey.MEGA_X, new SpeciesFormChangeItemTrigger(FormChangeItem.MEWTWONITE_X)), + new SpeciesFormChange(Species.MEWTWO, '', SpeciesFormKey.MEGA_Y, new SpeciesFormChangeItemTrigger(FormChangeItem.MEWTWONITE_Y)) + ], + [Species.AMPHAROS]: [ + new SpeciesFormChange(Species.AMPHAROS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.AMPHAROSITE)) + ], + [Species.STEELIX]: [ + new SpeciesFormChange(Species.STEELIX, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.STEELIXITE)) + ], + [Species.SCIZOR]: [ + new SpeciesFormChange(Species.SCIZOR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SCIZORITE)) + ], + [Species.HERACROSS]: [ + new SpeciesFormChange(Species.HERACROSS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.HERACRONITE)) + ], + [Species.HOUNDOOM]: [ + new SpeciesFormChange(Species.HOUNDOOM, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.HOUNDOOMINITE)) + ], + [Species.TYRANITAR]: [ + new SpeciesFormChange(Species.TYRANITAR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.TYRANITARITE)) + ], + [Species.SCEPTILE]: [ + new SpeciesFormChange(Species.SCEPTILE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SCEPTILITE)) + ], + [Species.BLAZIKEN]: [ + new SpeciesFormChange(Species.BLAZIKEN, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.BLAZIKENITE)) + ], + [Species.SWAMPERT]: [ + new SpeciesFormChange(Species.SWAMPERT, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SWAMPERTITE)) + ], + [Species.GARDEVOIR]: [ + new SpeciesFormChange(Species.GARDEVOIR, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GARDEVOIRITE)) + ], + [Species.SABLEYE]: [ + new SpeciesFormChange(Species.SABLEYE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SABLENITE)) + ], + [Species.MAWILE]: [ + new SpeciesFormChange(Species.MAWILE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.MAWILITE)) + ], + [Species.AGGRON]: [ + new SpeciesFormChange(Species.AGGRON, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.AGGRONITE)) + ], + [Species.MEDICHAM]: [ + new SpeciesFormChange(Species.MEDICHAM, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.MEDICHAMITE)) + ], + [Species.MANECTRIC]: [ + new SpeciesFormChange(Species.MANECTRIC, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.MANECTITE)) + ], + [Species.SHARPEDO]: [ + new SpeciesFormChange(Species.SHARPEDO, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SHARPEDONITE)) + ], + [Species.CAMERUPT]: [ + new SpeciesFormChange(Species.CAMERUPT, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.CAMERUPTITE)) + ], + [Species.ALTARIA]: [ + new SpeciesFormChange(Species.ALTARIA, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ALTARIANITE)) + ], + [Species.BANETTE]: [ + new SpeciesFormChange(Species.BANETTE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.BANETTITE)) + ], + [Species.ABSOL]: [ + new SpeciesFormChange(Species.ABSOL, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ABSOLITE)) + ], + [Species.GLALIE]: [ + new SpeciesFormChange(Species.GLALIE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GLALITITE)) + ], + [Species.SALAMENCE]: [ + new SpeciesFormChange(Species.SALAMENCE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.SALAMENCITE)) + ], + [Species.METAGROSS]: [ + new SpeciesFormChange(Species.METAGROSS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.METAGROSSITE)) + ], + [Species.LATIAS]: [ + new SpeciesFormChange(Species.LATIAS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.LATIASITE)) + ], + [Species.LATIOS]: [ + new SpeciesFormChange(Species.LATIOS, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.LATIOSITE)) + ], + [Species.KYOGRE]: [ + new SpeciesFormChange(Species.KYOGRE, '', SpeciesFormKey.PRIMAL, new SpeciesFormChangeItemTrigger(FormChangeItem.BLUE_ORB)) + ], + [Species.GROUDON]: [ + new SpeciesFormChange(Species.GROUDON, '', SpeciesFormKey.PRIMAL, new SpeciesFormChangeItemTrigger(FormChangeItem.RED_ORB)) + ], + [Species.RAYQUAZA]: [ + new SpeciesFormChange(Species.RAYQUAZA, '', SpeciesFormKey.MEGA, new SpeciesFormChangeCompoundTrigger(new SpeciesFormChangeItemTrigger(FormChangeItem.RAYQUAZITE), new SpeciesFormChangeMoveLearnedTrigger(Moves.DRAGON_ASCENT))) + ], + [Species.LOPUNNY]: [ + new SpeciesFormChange(Species.LOPUNNY, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.LOPUNNITE)) + ], + [Species.GARCHOMP]: [ + new SpeciesFormChange(Species.GARCHOMP, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GARCHOMPITE)) + ], + [Species.LUCARIO]: [ + new SpeciesFormChange(Species.LUCARIO, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.LUCARIONITE)) + ], + [Species.ABOMASNOW]: [ + new SpeciesFormChange(Species.ABOMASNOW, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.ABOMASITE)) + ], + [Species.GALLADE]: [ + new SpeciesFormChange(Species.GALLADE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.GALLADITE)) + ], + [Species.AUDINO]: [ + new SpeciesFormChange(Species.AUDINO, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.AUDINITE)) + ], + [Species.DIALGA]: [ + new SpeciesFormChange(Species.DIALGA, '', SpeciesFormKey.ORIGIN, new SpeciesFormChangeItemTrigger(FormChangeItem.ADAMANT_CRYSTAL)) + ], + [Species.PALKIA]: [ + new SpeciesFormChange(Species.PALKIA, '', SpeciesFormKey.ORIGIN, new SpeciesFormChangeItemTrigger(FormChangeItem.LUSTROUS_ORB)) + ], + [Species.GIRATINA]: [ + new SpeciesFormChange(Species.GIRATINA, '', SpeciesFormKey.ORIGIN, new SpeciesFormChangeItemTrigger(FormChangeItem.GRISEOUS_CORE)) + ], + [Species.SHAYMIN]: [ + new SpeciesFormChange(Species.SHAYMIN, 'land', 'sky', new SpeciesFormChangeCompoundTrigger(new SpeciesFormChangeTimeOfDayTrigger(TimeOfDay.DAY, TimeOfDay.DUSK), + new SpeciesFormChangeItemTrigger(FormChangeItem.GRACIDEA), new SpeciesFormChangeStatusEffectTrigger(StatusEffect.FREEZE, true))), + new SpeciesFormChange(Species.SHAYMIN, 'sky', 'land', new SpeciesFormChangeTimeOfDayTrigger(TimeOfDay.DAWN, TimeOfDay.NIGHT)), + new SpeciesFormChange(Species.SHAYMIN, 'sky', 'land', new SpeciesFormChangeStatusEffectTrigger(StatusEffect.FREEZE)) + ], + [Species.TORNADUS]: [ + new SpeciesFormChange(Species.TORNADUS, SpeciesFormKey.INCARNATE, SpeciesFormKey.THERIAN, new SpeciesFormChangeItemTrigger(FormChangeItem.REVEAL_GLASS)) + ], + [Species.THUNDURUS]: [ + new SpeciesFormChange(Species.THUNDURUS, SpeciesFormKey.INCARNATE, SpeciesFormKey.THERIAN, new SpeciesFormChangeItemTrigger(FormChangeItem.REVEAL_GLASS)) + ], + [Species.LANDORUS]: [ + new SpeciesFormChange(Species.LANDORUS, SpeciesFormKey.INCARNATE, SpeciesFormKey.THERIAN, new SpeciesFormChangeItemTrigger(FormChangeItem.REVEAL_GLASS)) + ], + [Species.KELDEO]: [ + new SpeciesFormChange(Species.KELDEO, 'ordinary', 'resolute', new SpeciesFormChangeMoveLearnedTrigger(Moves.SACRED_SWORD)), + new SpeciesFormChange(Species.KELDEO, 'resolute', 'ordinary', new SpeciesFormChangeMoveLearnedTrigger(Moves.SACRED_SWORD, false)) + ], + [Species.MELOETTA]: [ + new SpeciesFormChange(Species.MELOETTA, 'aria', 'pirouette', new SpeciesFormChangeMoveUsedTrigger(Moves.RELIC_SONG), true), + new SpeciesFormChange(Species.MELOETTA, 'pirouette', 'aria', new SpeciesFormChangeMoveUsedTrigger(Moves.RELIC_SONG), true), + new SpeciesFormChange(Species.MELOETTA, 'pirouette', 'aria', new SpeciesFormChangeActiveTrigger(false), true) + ], + [Species.DIANCIE]: [ + new SpeciesFormChange(Species.DIANCIE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.DIANCITE)) + ], + [Species.ENAMORUS]: [ + new SpeciesFormChange(Species.ENAMORUS, SpeciesFormKey.INCARNATE, SpeciesFormKey.THERIAN, new SpeciesFormChangeItemTrigger(FormChangeItem.REVEAL_GLASS)) + ] +}; + +{ + const formChangeKeys = Object.keys(pokemonFormChanges); + formChangeKeys.forEach(pk => { + const formChanges = pokemonFormChanges[pk]; + let newFormChanges: SpeciesFormChange[] = []; + for (let fc of formChanges) { + const itemTrigger = fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger; + if (itemTrigger && !formChanges.find(c => fc.formKey === c.preFormKey && fc.preFormKey === c.formKey)) + newFormChanges.push(new SpeciesFormChange(fc.speciesId, fc.formKey, fc.preFormKey, new SpeciesFormChangeItemTrigger(itemTrigger.item, false))); + } + formChanges.push(...newFormChanges); + }); +} \ No newline at end of file diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index f996dd259..bd39d5503 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -510,7 +510,11 @@ export class PokemonForm extends PokemonSpeciesForm { export enum SpeciesFormKey { MEGA = "mega", MEGA_X = "mega-x", - MEGA_Y = "mega-y" + MEGA_Y = "mega-y", + PRIMAL = "primal", + ORIGIN = "origin", + INCARNATE = "incarnate", + THERIAN = "therian" } export const allSpecies: PokemonSpecies[] = []; @@ -1711,7 +1715,7 @@ export function initSpecies() { new PokemonSpecies(Species.SANDYGAST, "Sandygast", 7, false, false, false, "Sand Heap Pokémon", Type.GHOST, Type.GROUND, 0.5, 70, Abilities.WATER_COMPACTION, Abilities.NONE, Abilities.SAND_VEIL, 320, 55, 55, 80, 70, 45, 15, 140, 50, 64, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.PALOSSAND, "Palossand", 7, false, false, false, "Sand Castle Pokémon", Type.GHOST, Type.GROUND, 1.3, 250, Abilities.WATER_COMPACTION, Abilities.NONE, Abilities.SAND_VEIL, 480, 85, 75, 110, 100, 75, 35, 60, 50, 168, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.PYUKUMUKU, "Pyukumuku", 7, false, false, false, "Sea Cucumber Pokémon", Type.WATER, null, 0.3, 1.2, Abilities.INNARDS_OUT, Abilities.NONE, Abilities.UNAWARE, 410, 55, 60, 130, 30, 130, 5, 60, 50, 144, GrowthRate.FAST, 50, false), - new PokemonSpecies(Species.TYPE_NULL, "Type: Null", 7, false, false, false, "Synthetic Pokémon", Type.NORMAL, null, 1.9, 120.5, Abilities.BATTLE_ARMOR, Abilities.NONE, Abilities.NONE, 534, 95, 95, 95, 95, 95, 59, 3, 0, 107, GrowthRate.SLOW, null, false), + new PokemonSpecies(Species.TYPE_NULL, "Type: Null", 7, true, false, false, "Synthetic Pokémon", Type.NORMAL, null, 1.9, 120.5, Abilities.BATTLE_ARMOR, Abilities.NONE, Abilities.NONE, 534, 95, 95, 95, 95, 95, 59, 3, 0, 107, GrowthRate.SLOW, null, false), new PokemonSpecies(Species.SILVALLY, "Silvally", 7, true, false, false, "Synthetic Pokémon", Type.NORMAL, null, 2.3, 100.5, Abilities.RKS_SYSTEM, Abilities.NONE, Abilities.NONE, 570, 95, 95, 95, 95, 95, 95, 3, 0, 285, GrowthRate.SLOW, null, false, false, new PokemonForm("Type: Normal", "normal", Type.NORMAL, null, 2.3, 100.5, Abilities.RKS_SYSTEM, Abilities.NONE, Abilities.NONE, 570, 95, 95, 95, 95, 95, 95, 3, 0, 285, false, ""), new PokemonForm("Type: Fighting", "fighting", Type.FIGHTING, null, 2.3, 100.5, Abilities.RKS_SYSTEM, Abilities.NONE, Abilities.NONE, 570, 95, 95, 95, 95, 95, 95, 3, 0, 285), diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 8cc57ac6c..f047a6a72 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -444,12 +444,4 @@ export class EggHatchPhase extends BattlePhase { return ret; } -} - -export class EndEvolutionPhase extends BattlePhase { - start() { - super.start(); - - this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => this.end()); - } } \ No newline at end of file diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index 69f7d3fc5..3e5c0bdc0 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -6,39 +6,47 @@ import EvolutionSceneHandler from "./ui/evolution-scene-handler"; import * as Utils from "./utils"; import { Mode } from "./ui/ui"; import { LearnMovePhase } from "./battle-phases"; -import { SpeciesFormKey } from "./data/pokemon-species"; -import { achvs } from "./system/achv"; import { cos, sin } from "./anims"; +import { PlayerPokemon } from "./pokemon"; export class EvolutionPhase extends BattlePhase { - private partyMemberIndex: integer; + protected pokemon: PlayerPokemon; + protected lastLevel: integer; + private evolution: SpeciesEvolution; - private lastLevel: integer; - private evolutionContainer: Phaser.GameObjects.Container; - private evolutionBaseBg: Phaser.GameObjects.Image; - private evolutionBg: Phaser.GameObjects.Video; - private evolutionBgOverlay: Phaser.GameObjects.Rectangle; - private evolutionOverlay: Phaser.GameObjects.Rectangle; - private pokemonSprite: Phaser.GameObjects.Sprite; - private pokemonTintSprite: Phaser.GameObjects.Sprite; - private pokemonEvoSprite: Phaser.GameObjects.Sprite; - private pokemonEvoTintSprite: Phaser.GameObjects.Sprite; + protected evolutionContainer: Phaser.GameObjects.Container; + protected evolutionBaseBg: Phaser.GameObjects.Image; + protected evolutionBg: Phaser.GameObjects.Video; + protected evolutionBgOverlay: Phaser.GameObjects.Rectangle; + protected evolutionOverlay: Phaser.GameObjects.Rectangle; + protected pokemonSprite: Phaser.GameObjects.Sprite; + protected pokemonTintSprite: Phaser.GameObjects.Sprite; + protected pokemonEvoSprite: Phaser.GameObjects.Sprite; + protected pokemonEvoTintSprite: Phaser.GameObjects.Sprite; - constructor(scene: BattleScene, partyMemberIndex: integer, evolution: SpeciesEvolution, lastLevel: integer) { + constructor(scene: BattleScene, pokemon: PlayerPokemon, evolution: SpeciesEvolution, lastLevel: integer) { super(scene); - this.partyMemberIndex = partyMemberIndex; + this.pokemon = pokemon; this.evolution = evolution; this.lastLevel = lastLevel; } + validate(): boolean { + return !!this.evolution; + } + + setMode(): Promise { + return this.scene.ui.setModeForceTransition(Mode.EVOLUTION_SCENE); + } + start() { super.start(); - this.scene.ui.setModeForceTransition(Mode.EVOLUTION_SCENE).then(() => { + this.setMode().then(() => { - if (!this.evolution) + if (!this.validate()) return this.end(); this.scene.fadeOutBgm(null, false); @@ -75,181 +83,183 @@ export class EvolutionPhase extends BattlePhase { this.pokemonEvoTintSprite.setVisible(false); this.pokemonEvoTintSprite.setTintFill(0xFFFFFF); - this.evolutionOverlay = this.scene.add.rectangle(0, -this.scene.game.canvas.height / 6, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6, 0xFFFFFF); + this.evolutionOverlay = this.scene.add.rectangle(0, -this.scene.game.canvas.height / 6, this.scene.game.canvas.width / 6, (this.scene.game.canvas.height / 6) - 48, 0xFFFFFF); this.evolutionOverlay.setOrigin(0, 0); this.evolutionOverlay.setAlpha(0); - this.scene.fieldUI.add(this.evolutionOverlay); - - const pokemon = this.scene.getParty()[this.partyMemberIndex]; - const preName = pokemon.name; + this.scene.ui.add(this.evolutionOverlay); [ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { - sprite.play(pokemon.getSpriteKey(true)); + sprite.play(this.pokemon.getSpriteKey(true)); sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false }); sprite.pipelineData['ignoreTimeTint'] = true; [ 'spriteColors', 'fusionSpriteColors' ].map(k => { - if (pokemon.summonData?.speciesForm) + if (this.pokemon.summonData?.speciesForm) k += 'Base'; - sprite.pipelineData[k] = pokemon.getSprite().pipelineData[k]; + sprite.pipelineData[k] = this.pokemon.getSprite().pipelineData[k]; }); }); - this.scene.ui.showText(`What?\n${preName} is evolving!`, null, () => { - pokemon.cry(); + this.doEvolution(); + }); + } - pokemon.getPossibleEvolution(this.evolution).then(evolvedPokemon => { + doEvolution(): void { + const evolutionHandler = this.scene.ui.getHandler() as EvolutionSceneHandler; + const preName = this.pokemon.name; + + this.scene.ui.showText(`What?\n${preName} is evolving!`, null, () => { + this.pokemon.cry(); - [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { - sprite.play(evolvedPokemon.getSpriteKey(true)); - sprite.pipelineData['ignoreTimeTint'] = true; - [ 'spriteColors', 'fusionSpriteColors' ].map(k => { - if (evolvedPokemon.summonData?.speciesForm) - k += 'Base'; - sprite.pipelineData[k] = evolvedPokemon.getSprite().pipelineData[k]; - }); + this.pokemon.getPossibleEvolution(this.evolution).then(evolvedPokemon => { + + [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { + sprite.play(evolvedPokemon.getSpriteKey(true)); + sprite.pipelineData['ignoreTimeTint'] = true; + [ 'spriteColors', 'fusionSpriteColors' ].map(k => { + if (evolvedPokemon.summonData?.speciesForm) + k += 'Base'; + sprite.pipelineData[k] = evolvedPokemon.getSprite().pipelineData[k]; }); + }); - this.scene.time.delayedCall(1000, () => { - const evolutionBgm = this.scene.playSoundWithoutBgm('evolution'); - this.scene.tweens.add({ - targets: this.evolutionBgOverlay, - alpha: 1, - delay: 500, - duration: 1500, - ease: 'Sine.easeOut', - onComplete: () => { - this.scene.time.delayedCall(1000, () => { - this.scene.tweens.add({ - targets: this.evolutionBgOverlay, - alpha: 0, - duration: 250 - }); - this.evolutionBg.setVisible(true); - this.evolutionBg.play(); + this.scene.time.delayedCall(1000, () => { + const evolutionBgm = this.scene.playSoundWithoutBgm('evolution'); + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 1, + delay: 500, + duration: 1500, + ease: 'Sine.easeOut', + onComplete: () => { + this.scene.time.delayedCall(1000, () => { + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 0, + duration: 250 }); - this.scene.playSound('charge'); - this.doSpiralUpward(); - this.scene.tweens.addCounter({ - from: 0, - to: 1, - duration: 2000, - onUpdate: t => { - this.pokemonTintSprite.setAlpha(t.getValue()); - }, - onComplete: () => { - this.pokemonSprite.setVisible(false); - this.scene.time.delayedCall(1100, () => { - this.scene.playSound('beam'); - this.doArcDownward(); - this.scene.time.delayedCall(1500, () => { - this.pokemonEvoTintSprite.setScale(0.25); - this.pokemonEvoTintSprite.setVisible(true); - evolutionHandler.canCancel = true; - this.doCycle(1).then(success => { - if (!success) { + this.evolutionBg.setVisible(true); + this.evolutionBg.play(); + }); + this.scene.playSound('charge'); + this.doSpiralUpward(); + this.scene.tweens.addCounter({ + from: 0, + to: 1, + duration: 2000, + onUpdate: t => { + this.pokemonTintSprite.setAlpha(t.getValue()); + }, + onComplete: () => { + this.pokemonSprite.setVisible(false); + this.scene.time.delayedCall(1100, () => { + this.scene.playSound('beam'); + this.doArcDownward(); + this.scene.time.delayedCall(1500, () => { + this.pokemonEvoTintSprite.setScale(0.25); + this.pokemonEvoTintSprite.setVisible(true); + evolutionHandler.canCancel = true; + this.doCycle(1).then(success => { + if (!success) { - this.pokemonSprite.setVisible(true); - this.pokemonTintSprite.setScale(1); - this.scene.tweens.add({ - targets: [ this.evolutionBg, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ], - alpha: 0, - duration: 250, - onComplete: () => { - this.evolutionBg.setVisible(false); - } + this.pokemonSprite.setVisible(true); + this.pokemonTintSprite.setScale(1); + this.scene.tweens.add({ + targets: [ this.evolutionBg, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ], + alpha: 0, + duration: 250, + onComplete: () => { + this.evolutionBg.setVisible(false); + } + }); + + SoundFade.fadeOut(this.scene, evolutionBgm, 100); + + this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); + + this.scene.ui.showText(`${preName} stopped evolving.`, null, () => { + this.scene.ui.showText(`Would you like to pause evolutions for ${preName}?\nEvolutions can be re-enabled from the party screen.`, null, () => { + const end = () => { + this.scene.ui.showText(null, 0); + this.scene.playBgm(); + evolvedPokemon.destroy(); + this.end(); + }; + this.scene.ui.setOverlayMode(Mode.CONFIRM, () => { + this.scene.ui.revertMode(); + this.pokemon.pauseEvolutions = true; + this.scene.ui.showText(`Evolutions have been paused for ${preName}.`, null, end, 3000); + }, () => { + this.scene.ui.revertMode(); + this.scene.time.delayedCall(3000, end); + }); }); + }, null, true); + return; + } + + this.scene.playSound('sparkle'); + this.pokemonEvoSprite.setVisible(true); + this.doCircleInward(); + this.scene.time.delayedCall(900, () => { + evolutionHandler.canCancel = false; - SoundFade.fadeOut(this.scene, evolutionBgm, 100); - + this.pokemon.evolve(this.evolution).then(() => { + const levelMoves = this.pokemon.getLevelMoves(this.lastLevel + 1, true); + for (let lm of levelMoves) + this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this.pokemon), lm)); this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); - this.scene.ui.showText(`${preName} stopped evolving.`, null, () => { - this.scene.ui.showText(`Would you like to pause evolutions for ${preName}?\nEvolutions can be re-enabled from the party screen.`, null, () => { - const end = () => { - this.scene.ui.showText(null, 0); - this.scene.playBgm(); - evolvedPokemon.destroy(); - this.end(); - }; - this.scene.ui.setOverlayMode(Mode.CONFIRM, () => { - this.scene.ui.revertMode(); - pokemon.pauseEvolutions = true; - this.scene.ui.showText(`Evolutions have been paused for ${preName}.`, null, end, 3000); - }, () => { - this.scene.ui.revertMode(); - this.scene.time.delayedCall(3000, end); - }); - }); - }, null, true); - return; - } - - this.scene.playSound('sparkle'); - this.pokemonEvoSprite.setVisible(true); - this.doCircleInward(); - this.scene.time.delayedCall(900, () => { - evolutionHandler.canCancel = false; - - pokemon.evolve(this.evolution).then(() => { - const levelMoves = pokemon.getLevelMoves(this.lastLevel + 1, true); - for (let lm of levelMoves) - this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.partyMemberIndex, lm)); - this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); - - this.scene.playSound('shine'); - this.doSpray(); - this.scene.tweens.add({ - targets: this.evolutionOverlay, - alpha: 1, - duration: 250, - easing: 'Sine.easeIn', - onComplete: () => { - this.evolutionBgOverlay.setAlpha(1); - this.evolutionBg.setVisible(false); - this.scene.tweens.add({ - targets: [ this.evolutionOverlay, this.pokemonEvoTintSprite ], - alpha: 0, - duration: 2000, - delay: 150, - easing: 'Sine.easeIn', - onComplete: () => { - this.scene.tweens.add({ - targets: this.evolutionBgOverlay, - alpha: 0, - duration: 250, - onComplete: () => { - SoundFade.fadeOut(this.scene, evolutionBgm, 100); - this.scene.time.delayedCall(250, () => { - pokemon.cry(); - this.scene.time.delayedCall(1250, () => { - this.scene.playSoundWithoutBgm('evolution_fanfare'); - if (this.evolution.evoFormKey && this.evolution.evoFormKey.indexOf(SpeciesFormKey.MEGA) > -1) - this.scene.validateAchv(achvs.MEGA_EVOLVE); - - evolvedPokemon.destroy(); - this.scene.ui.showText(`Congratulations! Your ${preName}\nevolved into ${pokemon.name}!`, null, () => this.end(), null, true, 3000); - this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm()); - }); + this.scene.playSound('shine'); + this.doSpray(); + this.scene.tweens.add({ + targets: this.evolutionOverlay, + alpha: 1, + duration: 250, + easing: 'Sine.easeIn', + onComplete: () => { + this.evolutionBgOverlay.setAlpha(1); + this.evolutionBg.setVisible(false); + this.scene.tweens.add({ + targets: [ this.evolutionOverlay, this.pokemonEvoTintSprite ], + alpha: 0, + duration: 2000, + delay: 150, + easing: 'Sine.easeIn', + onComplete: () => { + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 0, + duration: 250, + onComplete: () => { + SoundFade.fadeOut(this.scene, evolutionBgm, 100); + this.scene.time.delayedCall(250, () => { + this.pokemon.cry(); + this.scene.time.delayedCall(1250, () => { + this.scene.playSoundWithoutBgm('evolution_fanfare'); + + evolvedPokemon.destroy(); + this.scene.ui.showText(`Congratulations! Your ${preName}\nevolved into ${this.pokemon.name}!`, null, () => this.end(), null, true, Utils.fixedInt(4000)); + this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm()); }); - } - }); - } - }); - } - }); + }); + } + }); + } + }); + } }); }); }); }); }); - } - }) - } - }); + }); + } + }) + } }); }); - }, 1000); - }); + }); + }, 1000); } doSpiralUpward() { @@ -288,10 +298,10 @@ export class EvolutionPhase extends BattlePhase { }); } - doCycle(l: number): Promise { + doCycle(l: number, lastCycle: integer = 15): Promise { return new Promise(resolve => { const evolutionHandler = this.scene.ui.getHandler() as EvolutionSceneHandler; - const isLastCycle = l === 15; + const isLastCycle = l === lastCycle; this.scene.tweens.add({ targets: this.pokemonTintSprite, scale: 0.25, @@ -308,8 +318,8 @@ export class EvolutionPhase extends BattlePhase { onComplete: () => { if (evolutionHandler.cancelled) return resolve(false); - if (l < 15) - this.doCycle(l + 0.5).then(success => resolve(success)); + if (l < lastCycle) + this.doCycle(l + 0.5, lastCycle).then(success => resolve(success)); else { this.pokemonTintSprite.setVisible(false); resolve(true); diff --git a/src/form-change-phase.ts b/src/form-change-phase.ts new file mode 100644 index 000000000..73886da5a --- /dev/null +++ b/src/form-change-phase.ts @@ -0,0 +1,188 @@ +import BattleScene from "./battle-scene"; +import * as Utils from "./utils"; +import { SpeciesFormKey } from "./data/pokemon-species"; +import { achvs } from "./system/achv"; +import { SpeciesFormChange, getSpeciesFormChangeMessage } from "./data/pokemon-forms"; +import { EndEvolutionPhase, EvolutionPhase } from "./evolution-phase"; +import Pokemon, { PlayerPokemon } from "./pokemon"; +import { Mode } from "./ui/ui"; +import PartyUiHandler from "./ui/party-ui-handler"; +import { BattlePhase } from "./battle-phase"; + +export class FormChangePhase extends EvolutionPhase { + private formChange: SpeciesFormChange; + private modal: boolean; + + constructor(scene: BattleScene, pokemon: PlayerPokemon, formChange: SpeciesFormChange, modal: boolean) { + super(scene, pokemon, null, 0); + + this.formChange = formChange; + this.modal = modal; + } + + validate(): boolean { + return !!this.formChange; + } + + setMode(): Promise { + if (!this.modal) + return super.setMode(); + return this.scene.ui.setOverlayMode(Mode.EVOLUTION_SCENE); + } + + doEvolution(): void { + const preName = this.pokemon.name; + + this.pokemon.getPossibleForm(this.formChange).then(transformedPokemon => { + + [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { + sprite.play(transformedPokemon.getSpriteKey(true)); + sprite.pipelineData['ignoreTimeTint'] = true; + [ 'spriteColors', 'fusionSpriteColors' ].map(k => { + if (transformedPokemon.summonData?.speciesForm) + k += 'Base'; + sprite.pipelineData[k] = transformedPokemon.getSprite().pipelineData[k]; + }); + }); + + this.scene.time.delayedCall(250, () => { + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 1, + delay: 500, + duration: 1500, + ease: 'Sine.easeOut', + onComplete: () => { + this.scene.time.delayedCall(1000, () => { + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 0, + duration: 250 + }); + this.evolutionBg.setVisible(true); + this.evolutionBg.play(); + }); + this.scene.playSound('charge'); + this.doSpiralUpward(); + this.scene.tweens.addCounter({ + from: 0, + to: 1, + duration: 2000, + onUpdate: t => { + this.pokemonTintSprite.setAlpha(t.getValue()); + }, + onComplete: () => { + this.pokemonSprite.setVisible(false); + this.scene.time.delayedCall(1100, () => { + this.scene.playSound('beam'); + this.doArcDownward(); + this.scene.time.delayedCall(1000, () => { + this.pokemonEvoTintSprite.setScale(0.25); + this.pokemonEvoTintSprite.setVisible(true); + this.doCycle(1, 1).then(_success => { + this.scene.playSound('sparkle'); + this.pokemonEvoSprite.setVisible(true); + this.doCircleInward(); + this.scene.time.delayedCall(900, () => { + this.pokemon.changeForm(this.formChange).then(() => { + if (!this.modal) + this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); + + this.scene.playSound('shine'); + this.doSpray(); + this.scene.tweens.add({ + targets: this.evolutionOverlay, + alpha: 1, + duration: 250, + easing: 'Sine.easeIn', + onComplete: () => { + this.evolutionBgOverlay.setAlpha(1); + this.evolutionBg.setVisible(false); + this.scene.tweens.add({ + targets: [ this.evolutionOverlay, this.pokemonEvoTintSprite ], + alpha: 0, + duration: 2000, + delay: 150, + easing: 'Sine.easeIn', + onComplete: () => { + this.scene.tweens.add({ + targets: this.evolutionBgOverlay, + alpha: 0, + duration: 250, + onComplete: () => { + this.scene.time.delayedCall(250, () => { + this.pokemon.cry(); + this.scene.time.delayedCall(1250, () => { + const isMega = this.formChange.formKey.indexOf(SpeciesFormKey.MEGA) > -1; + const isRevert = !isMega && this.formChange.formKey === this.pokemon.species.forms[0].formKey; + let playEvolutionFanfare = false; + if (isMega) { + this.scene.validateAchv(achvs.MEGA_EVOLVE); + playEvolutionFanfare = true; + } + + const delay = playEvolutionFanfare ? 4000 : 1750; + this.scene.playSoundWithoutBgm(playEvolutionFanfare ? 'evolution_fanfare' : 'minor_fanfare'); + + transformedPokemon.destroy(); + this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), null, true, Utils.fixedInt(delay)); + this.scene.time.delayedCall(Utils.fixedInt(delay + 250), () => this.scene.playBgm()); + }); + }); + } + }); + } + }); + } + }); + }); + }); + }); + }); + }); + } + }) + } + }); + }); + }); + } + + end(): void { + if (this.modal) { + this.scene.ui.revertMode().then(() => { + if (this.scene.ui.getMode() === Mode.PARTY) { + const partyUiHandler = this.scene.ui.getHandler() as PartyUiHandler; + partyUiHandler.clearPartySlots(); + partyUiHandler.populatePartySlots(); + } + + super.end(); + }); + } else + super.end(); + } +} + +export class QuietFormChangePhase extends BattlePhase { + protected pokemon: Pokemon; + protected formChange: SpeciesFormChange; + + constructor(scene: BattleScene, pokemon: Pokemon, formChange: SpeciesFormChange) { + super(scene); + this.pokemon = pokemon; + this.formChange = formChange; + } + + start(): void { + super.start(); + + if (this.pokemon.formIndex === this.pokemon.species.forms.findIndex(f => f.formKey === this.formChange.formKey)) + return this.end(); + + const preName = this.pokemon.name; + this.pokemon.changeForm(this.formChange).then(() => { + this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), Utils.fixedInt(1500)); + }); + } +} \ No newline at end of file diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 4a05eb85f..0fd086e72 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -16,6 +16,7 @@ import { StatusEffect, getStatusEffectDescriptor } from '../data/status-effect'; import { SpeciesFormKey } from '../data/pokemon-species'; import BattleScene from '../battle-scene'; import { VoucherType, getVoucherTypeIcon, getVoucherTypeName } from '../system/voucher'; +import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms'; type Modifier = Modifiers.Modifier; @@ -446,6 +447,26 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge } } +export class FormChangeItemModifierType extends PokemonModifierType implements GeneratedPersistentModifierType { + public formChangeItem: FormChangeItem; + + constructor(formChangeItem: FormChangeItem) { + super(Utils.toReadableString(FormChangeItem[formChangeItem]), `Causes certain Pokémon to change form`, (_type, args) => new Modifiers.PokemonFormChangeItemModifier(this, (args[0] as PlayerPokemon).id, formChangeItem, true), + (pokemon: PlayerPokemon) => { + if (pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) && !!pokemonFormChanges[pokemon.species.speciesId].find(fc => fc.trigger.hasTriggerType(SpeciesFormChangeItemTrigger))) + return null; + + return PartyUiHandler.NoEffectMessage; + }, FormChangeItem[formChangeItem].toLowerCase()); + + this.formChangeItem = formChangeItem; + } + + getPregenArgs(): any[] { + return [ this.formChangeItem ]; + } +} + export class FusePokemonModifierType extends PokemonModifierType { constructor(name: string, iconImage?: string) { super(name, 'Combines two Pokémon (transfers ability, splits base stats and types, shares move pool)', (_type, args) => new Modifiers.FusePokemonModifier(this, (args[0] as PlayerPokemon).id, (args[1] as PlayerPokemon).id), @@ -524,7 +545,7 @@ class TmModifierTypeGenerator extends ModifierTypeGenerator { } class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { - constructor(mega: boolean) { + constructor() { super((party: Pokemon[], pregenArgs?: any[]) => { if (pregenArgs) return new EvolutionItemModifierType(pregenArgs[0] as EvolutionItem); @@ -532,7 +553,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { const evolutionItemPool = party.filter(p => pokemonEvolutions.hasOwnProperty(p.species.speciesId)).map(p => { const evolutions = pokemonEvolutions[p.species.speciesId]; return evolutions.filter(e => e.item !== EvolutionItem.NONE && (e.evoFormKey === null || (e.preFormKey || '') === p.getFormKey()) && (!e.condition || e.condition.predicate(p))); - }).flat().filter(e => (e.item >= 100) === mega).flatMap(e => e.item); + }).flat().flatMap(e => e.item); if (!evolutionItemPool.length) return null; @@ -542,6 +563,26 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator { } } +class FormChangeItemModifierTypeGenerator extends ModifierTypeGenerator { + constructor() { + super((party: Pokemon[], pregenArgs?: any[]) => { + if (pregenArgs) + return new FormChangeItemModifierType(pregenArgs[0] as FormChangeItem); + + const formChangeItemPool = party.filter(p => pokemonFormChanges.hasOwnProperty(p.species.speciesId)).map(p => { + const formChanges = pokemonFormChanges[p.species.speciesId]; + return formChanges.filter(fc => fc.formKey.indexOf(SpeciesFormKey.MEGA) === -1 || party[0].scene.getModifiers(Modifiers.MegaEvolutionAccessModifier).length) + .map(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger).filter(t => t && t.active); + }).flat().flatMap(fc => fc.item); + + if (!formChangeItemPool.length) + return null; + + return new FormChangeItemModifierType(formChangeItemPool[Utils.randSeedInt(formChangeItemPool.length)]); + }); + } +} + export class ContactHeldItemTransferChanceModifierType extends PokemonHeldItemModifierType { constructor(name: string, chancePercent: integer, iconImage?: string, group?: string, soundName?: string) { super(name, `Upon attacking, there is a ${chancePercent}% chance the foe's held item will be stolen`, (type, args) => new Modifiers.ContactHeldItemTransferChanceModifier(type, (args[0] as Pokemon).id, chancePercent), iconImage, group, soundName); @@ -593,8 +634,8 @@ export const modifierTypes = { RARE_CANDY: () => new PokemonLevelIncrementModifierType('Rare Candy'), RARER_CANDY: () => new AllPokemonLevelIncrementModifierType('Rarer Candy'), - EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(false), - MEGA_EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(true), + EVOLUTION_ITEM: () => new EvolutionItemModifierTypeGenerator(), + FORM_CHANGE_ITEM: () => new FormChangeItemModifierTypeGenerator(), MEGA_BRACELET: () => new ModifierType('Mega Bracelet', 'Mega stones become available', (type, _args) => new Modifiers.MegaEvolutionAccessModifier(type)), @@ -838,7 +879,7 @@ const modifierPool = { new WeightedModifierType(modifierTypes.ABILITY_CHARM, 2), new WeightedModifierType(modifierTypes.IV_SCANNER, 2), new WeightedModifierType(modifierTypes.EXP_BALANCE, 1), - new WeightedModifierType(modifierTypes.MEGA_EVOLUTION_ITEM, (party: Pokemon[]) => party[0].scene.getModifiers(Modifiers.MegaEvolutionAccessModifier).length && !party.filter(p => p.getFormKey().indexOf(SpeciesFormKey.MEGA) > -1).length ? 1 : 0), + new WeightedModifierType(modifierTypes.FORM_CHANGE_ITEM, 1), new WeightedModifierType(modifierTypes.REVERSE_DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode !== GameMode.SPLICED_ENDLESS && party.filter(p => p.fusionSpecies).length ? 3 : 0), ].map(m => { m.setTier(ModifierTier.ULTRA); return m; }), [ModifierTier.MASTER]: [ diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 043fb66dd..00075b2b6 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -17,6 +17,7 @@ import { StatusEffect, getStatusEffectDescriptor } from '../data/status-effect'; import { MoneyAchv } from '../system/achv'; import { VoucherType } from '../system/voucher'; import { PreventBerryUseAbAttr, applyAbAttrs } from '../data/ability'; +import { FormChangeItem, SpeciesFormChangeItemTrigger } from '../data/pokemon-forms'; type ModifierType = ModifierTypes.ModifierType; export type ModifierPredicate = (modifier: Modifier) => boolean; @@ -990,7 +991,7 @@ export class EvolutionItemModifier extends ConsumablePokemonModifier { && (!e.condition || e.condition.predicate(pokemon))); if (matchingEvolution) { - pokemon.scene.unshiftPhase(new EvolutionPhase(pokemon.scene, pokemon.scene.getParty().indexOf(pokemon), matchingEvolution, pokemon.level - 1)); + pokemon.scene.unshiftPhase(new EvolutionPhase(pokemon.scene, pokemon, matchingEvolution, pokemon.level - 1)); return true; } @@ -1260,6 +1261,39 @@ export class PokemonNatureWeightModifier extends PokemonHeldItemModifier { } } +export class PokemonFormChangeItemModifier extends PokemonHeldItemModifier { + public formChangeItem: FormChangeItem; + public active: boolean; + + constructor(type: ModifierTypes.FormChangeItemModifierType, pokemonId: integer, formChangeItem: FormChangeItem, active: boolean, stackCount?: integer) { + super(type, pokemonId, stackCount); + this.formChangeItem = formChangeItem; + this.active = active; + } + + matchType(modifier: Modifier): boolean { + return modifier instanceof PokemonFormChangeItemModifier && modifier.formChangeItem === this.formChangeItem; + } + + clone(): PersistentModifier { + return new PokemonFormChangeItemModifier(this.type as ModifierTypes.FormChangeItemModifierType, this.pokemonId, this.formChangeItem, this.active, this.stackCount); + } + + getArgs(): any[] { + return super.getArgs().concat(this.formChangeItem, this.active); + } + + apply(args: any[]): boolean { + const pokemon = args[0] as Pokemon; + + return pokemon.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeItemTrigger); + } + + getMaxHeldItemCount(pokemon: Pokemon): integer { + return 1; + } +} + export class MoneyMultiplierModifier extends PersistentModifier { constructor(type: ModifierType, stackCount?: integer) { super(type, stackCount); diff --git a/src/pokemon.ts b/src/pokemon.ts index 0eb7ba7de..7594b1424 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -34,6 +34,7 @@ import { DamageAchv, achvs } from './system/achv'; import { DexAttr } from './system/game-data'; import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from '@material/material-color-utilities'; import { Nature, getNatureStatMultiplier } from './data/nature'; +import { SpeciesFormChange, SpeciesFormChangeMoveUsedTrigger, SpeciesFormChangeStatusEffectTrigger } from './data/pokemon-forms'; export enum FieldPosition { CENTER, @@ -145,10 +146,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { Utils.binToDec(Utils.decToBin(this.id).substring(20, 25)), Utils.binToDec(Utils.decToBin(this.id).substring(25, 30)) ]; - - this.nature = nature !== undefined - ? nature - : Utils.randSeedInt(25) as Nature; if (this.gender === undefined) { if (this.species.malePercent === null) @@ -163,11 +160,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } if (this.formIndex === undefined) - this.formIndex = this.scene.getSpeciesFormIndex(species, this.gender, this.isPlayer()); + this.formIndex = this.scene.getSpeciesFormIndex(species, this.gender, this.nature, this.isPlayer()); if (this.shiny === undefined) this.trySetShiny(); + if (nature !== undefined) + this.setNature(nature); + else + this.generateNature(); + this.friendship = species.baseFriendship; this.metLevel = level; this.metBiome = scene.currentBattle ? scene.arena.biomeType : -1; @@ -544,6 +546,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.calculateStats(); } + generateNature(naturePool?: Nature[]): void { + if (naturePool === undefined) + naturePool = Utils.getEnumValues(Nature); + const nature = naturePool[Utils.randSeedInt(naturePool.length)]; + this.setNature(nature); + } + getMaxHp(): integer { return this.getStat(Stat.HP); } @@ -796,7 +805,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.fusionGender = Gender.FEMALE; } - this.fusionFormIndex = this.scene.getSpeciesFormIndex(this.fusionSpecies, this.fusionGender, true); + this.fusionFormIndex = this.scene.getSpeciesFormIndex(this.fusionSpecies, this.fusionGender, this.nature, true); this.generateName(); } @@ -1227,6 +1236,22 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.summonData.moveQueue; } + changeForm(formChange: SpeciesFormChange): Promise { + return new Promise(resolve => { + this.formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === formChange.formKey), 0); + this.generateName(); + const abilityCount = this.getSpeciesForm().getAbilityCount(); + if (this.abilityIndex >= abilityCount) // Shouldn't happen + this.abilityIndex = abilityCount - 1; + this.scene.gameData.setPokemonSeen(this, true); + this.loadAssets().then(() => { + this.calculateStats(); + this.scene.updateModifiers(this.isPlayer(), true); + this.updateInfo().then(() => resolve()); + }); + }); + } + cry(soundConfig?: Phaser.Types.Sound.SoundConfig): AnySound { const cry = this.getSpeciesForm().cry(this.scene, soundConfig); let duration = cry.totalDuration * 1000; @@ -1430,6 +1455,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } this.status = new Status(effect, 0, cureTurn); + + if (effect !== StatusEffect.FAINT) + this.scene.triggerPokemonFormChange(this, SpeciesFormChangeStatusEffectTrigger, true); + return true; } @@ -1462,6 +1491,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.battleSummonData = new PokemonBattleSummonData(); if (this.getTag(BattlerTagType.SEEDED)) this.lapseTag(BattlerTagType.SEEDED); + this.scene.triggerPokemonFormChange(this, SpeciesFormChangeMoveUsedTrigger, true); } resetTurnData(): void { @@ -1876,6 +1906,33 @@ export class PlayerPokemon extends Pokemon { } } + getPossibleForm(formChange: SpeciesFormChange): Promise { + return new Promise(resolve => { + const formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === formChange.formKey), 0); + const ret = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, formIndex, this.gender, this.shiny, this.ivs, this.nature, this); + ret.loadAssets().then(() => resolve(ret)); + }); + } + + changeForm(formChange: SpeciesFormChange): Promise { + return new Promise(resolve => { + this.formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === formChange.formKey), 0); + this.generateName(); + const abilityCount = this.getSpeciesForm().getAbilityCount(); + if (this.abilityIndex >= abilityCount) // Shouldn't happen + this.abilityIndex = abilityCount - 1; + this.compatibleTms.splice(0, this.compatibleTms.length); + this.generateCompatibleTms(); + this.scene.gameData.setPokemonSeen(this, false); + this.scene.gameData.setPokemonCaught(this, false); + this.loadAssets().then(() => { + this.calculateStats(); + this.scene.updateModifiers(true, true); + this.updateInfo().then(() => resolve()); + }); + }); + } + isFusion(): boolean { return !!(this.fusionSpecies || (this.species.speciesId === Species.KYUREM && this.formIndex)); } @@ -2160,8 +2217,6 @@ export class EnemyPokemon extends Pokemon { if (this.isFainted()) return 0; - let clearedSegment = false; - if (!ignoreSegments && this.isBoss()) { const segmentSize = this.getMaxHp() / this.bossSegments; for (let s = this.bossSegments - 1; s > 0; s--) { @@ -2169,7 +2224,6 @@ export class EnemyPokemon extends Pokemon { if (this.hp > hpThreshold) { if (this.hp - damage < hpThreshold) { damage = this.hp - hpThreshold; - clearedSegment = true; this.handleBossSegmentCleared(s); } break; diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 4cabd1723..d50f66a0f 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene, { Button } from "../battle-scene"; import { addTextObject, TextStyle } from "./text"; -import UI, { Mode } from "./ui"; +import { Mode } from "./ui"; import * as Utils from "../utils"; import MessageUiHandler from "./message-ui-handler"; import { getStatName, Stat } from "../data/pokemon-stat"; diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index ce8d73699..b08a96a79 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -44,11 +44,18 @@ export default class CommandUiHandler extends UiHandler { this.commandsContainer.setVisible(true); + let commandPhase: CommandPhase; + let currentPhase = this.scene.getCurrentPhase(); + if (currentPhase instanceof CommandPhase) + commandPhase = currentPhase; + else + commandPhase = this.scene.getStandbyPhase() as CommandPhase; + const messageHandler = this.getUi().getMessageHandler(); messageHandler.commandWindow.setVisible(true); messageHandler.movesWindowContainer.setVisible(false); messageHandler.message.setWordWrapWidth(1110); - messageHandler.showText(`What will\n${(this.scene.getCurrentPhase() as CommandPhase).getPokemon().name} do?`, 0); + messageHandler.showText(`What will\n${commandPhase.getPokemon().name} do?`, 0); this.setCursor(this.getCursor()); return true; @@ -118,8 +125,6 @@ export default class CommandUiHandler extends UiHandler { } setCursor(cursor: integer): boolean { - const ui = this.getUi(); - const changed = this.getCursor() !== cursor; if (changed) { if (!this.fieldIndex) @@ -140,6 +145,7 @@ export default class CommandUiHandler extends UiHandler { clear(): void { super.clear(); + this.getUi().getMessageHandler().commandWindow.setVisible(false); this.commandsContainer.setVisible(false); this.getUi().getMessageHandler().clearText(); this.eraseCursor(); diff --git a/src/ui/evolution-scene-handler.ts b/src/ui/evolution-scene-handler.ts index baebdf752..6aa517770 100644 --- a/src/ui/evolution-scene-handler.ts +++ b/src/ui/evolution-scene-handler.ts @@ -1,48 +1,99 @@ import BattleScene, { Button } from "../battle-scene"; +import MessageUiHandler from "./message-ui-handler"; +import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; -import UiHandler from "./ui-handler"; -export default class EvolutionSceneHandler extends UiHandler { - public evolutionContainer: Phaser.GameObjects.Container; - public canCancel: boolean; - public cancelled: boolean; +export default class EvolutionSceneHandler extends MessageUiHandler { + public evolutionContainer: Phaser.GameObjects.Container; + public messageBg: Phaser.GameObjects.Image; + public messageContainer: Phaser.GameObjects.Container; + public canCancel: boolean; + public cancelled: boolean; - constructor(scene: BattleScene) { - super(scene, Mode.EVOLUTION_SCENE); - } - - setup() { - this.canCancel = false; - this.cancelled = false; + constructor(scene: BattleScene) { + super(scene, Mode.EVOLUTION_SCENE); + } - this.evolutionContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6); - this.scene.fieldUI.add(this.evolutionContainer); - } + setup() { + this.canCancel = false; + this.cancelled = false; - show(_args: any[]): boolean { - super.show(_args); - - this.scene.fieldUI.bringToTop(this.evolutionContainer); + const ui = this.getUi(); + this.evolutionContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6); + ui.add(this.evolutionContainer); + + const messageBg = this.scene.add.image(0, 0, 'bg'); + messageBg.setOrigin(0, 1); + messageBg.setVisible(false); + ui.add(messageBg); + + this.messageBg = messageBg; + + this.messageContainer = this.scene.add.container(12, -39); + this.messageContainer.setVisible(false); + ui.add(this.messageContainer); + + const message = addTextObject(this.scene, 0, 0, '', TextStyle.MESSAGE, { + maxLines: 2, + wordWrap: { + width: 1780 + } + }); + this.messageContainer.add(message); + + this.message = message; + + const prompt = this.scene.add.sprite(0, 0, 'prompt'); + prompt.setVisible(false); + prompt.setOrigin(0, 0); + this.messageContainer.add(prompt); + + this.prompt = prompt; + } + + show(_args: any[]): boolean { + super.show(_args); + + this.scene.ui.bringToTop(this.evolutionContainer); + this.scene.ui.bringToTop(this.messageBg); + this.scene.ui.bringToTop(this.messageContainer); + this.messageBg.setVisible(true); + this.messageContainer.setVisible(true); + + return true; + } + + processInput(button: Button): boolean { + if (this.canCancel && !this.cancelled && button === Button.CANCEL) { + this.cancelled = true; return true; } - - processInput(button: Button): boolean { - if (this.canCancel && !this.cancelled && button === Button.CANCEL) { - this.cancelled = true; - return true; + + const ui = this.getUi(); + if (this.awaitingActionInput) { + if (button === Button.CANCEL || button === Button.ACTION) { + if (this.onActionInput) { + ui.playSelect(); + const originalOnActionInput = this.onActionInput; + this.onActionInput = null; + originalOnActionInput(); + return true; + } } + } + } - return this.scene.ui.getMessageHandler().processInput(button); - } - - setCursor(_cursor: integer): boolean { - return false; - } + setCursor(_cursor: integer): boolean { + return false; + } - clear() { - this.canCancel = false; - this.cancelled = false; - this.evolutionContainer.removeAll(true); - } - } \ No newline at end of file + clear() { + this.clearText(); + this.canCancel = false; + this.cancelled = false; + this.evolutionContainer.removeAll(true); + this.messageContainer.setVisible(false); + this.messageBg.setVisible(false); + } +} \ No newline at end of file diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index e40f5a76b..1ebbf6df8 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -6,13 +6,14 @@ import { Command } from "./command-ui-handler"; import MessageUiHandler from "./message-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; -import { PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; +import { PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; import { Moves, allMoves } from "../data/move"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; import { pokemonEvolutions } from "../data/pokemon-evolutions"; import { addWindow } from "./window"; +import { SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; const defaultMessage = 'Choose a Pokémon.'; @@ -38,11 +39,12 @@ export enum PartyOption { TRANSFER, SPLICE, SUMMARY, - UNPAUSE_EVO, + UNPAUSE_EVOLUTION, RELEASE, SCROLL_UP = 1000, SCROLL_DOWN = 1001, - MOVE_1 = 2000, + FORM_CHANGE_ITEM = 2000, + MOVE_1 = 3000, MOVE_2, MOVE_3, MOVE_4 @@ -72,6 +74,7 @@ export default class PartyUiHandler extends MessageUiHandler { private optionsScrollCursor: integer = 0; private optionsScrollTotal: integer = 0; private optionsContainer: Phaser.GameObjects.Container; + private optionsBg: Phaser.GameObjects.NineSlice; private optionsCursorObj: Phaser.GameObjects.Image; private options: integer[]; @@ -228,7 +231,7 @@ export default class PartyUiHandler extends MessageUiHandler { } ui.playSelect(); return true; - } else if ((option !== PartyOption.SUMMARY && option !== PartyOption.UNPAUSE_EVO && option !== PartyOption.RELEASE && option !== PartyOption.CANCEL) + } else if ((option !== PartyOption.SUMMARY && option !== PartyOption.UNPAUSE_EVOLUTION && option !== PartyOption.RELEASE && option !== PartyOption.CANCEL) || (option === PartyOption.RELEASE && this.partyUiMode === PartyUiMode.RELEASE)) { let filterResult: string; if (option !== PartyOption.TRANSFER && option !== PartyOption.SPLICE) { @@ -262,8 +265,23 @@ export default class PartyUiHandler extends MessageUiHandler { this.selectCallback = null; selectCallback(this.cursor, option); } - } else if (this.cursor) - (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.cursor, option === PartyOption.PASS_BATON); + } else { + if (option >= PartyOption.FORM_CHANGE_ITEM && this.scene.getCurrentPhase() instanceof CommandPhase) { + switch (this.partyUiMode) { + case PartyUiMode.SWITCH: + case PartyUiMode.FAINT_SWITCH: + case PartyUiMode.POST_BATTLE_SWITCH: + let formChangeItemModifiers = this.scene.findModifiers(m => m instanceof PokemonFormChangeItemModifier && m.pokemonId === pokemon.id) as PokemonFormChangeItemModifier[]; + if (formChangeItemModifiers.find(m => m.active)) + formChangeItemModifiers = formChangeItemModifiers.filter(m => m.active); + const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM]; + modifier.active = !modifier.active; + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeItemTrigger, false, true); + break; + } + } else if (this.cursor) + (this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, this.cursor, option === PartyOption.PASS_BATON); + } if (this.partyUiMode !== PartyUiMode.MODIFIER && this.partyUiMode !== PartyUiMode.TM_MODIFIER && this.partyUiMode !== PartyUiMode.MOVE_MODIFIER) ui.playSelect(); return true; @@ -275,7 +293,7 @@ export default class PartyUiHandler extends MessageUiHandler { ui.playSelect(); ui.setModeWithoutClear(Mode.SUMMARY, pokemon).then(() => this.clearOptions()); return true; - } else if (option === PartyOption.UNPAUSE_EVO) { + } else if (option === PartyOption.UNPAUSE_EVOLUTION) { this.clearOptions(); ui.playSelect(); pokemon.pauseEvolutions = false; @@ -356,7 +374,7 @@ export default class PartyUiHandler extends MessageUiHandler { break; case Button.RIGHT: const battlerCount = this.scene.currentBattle.getBattlerCount(); - if (slotCount && this.cursor < battlerCount) + if (slotCount > battlerCount && this.cursor < battlerCount) success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount); break; } @@ -423,8 +441,7 @@ export default class PartyUiHandler extends MessageUiHandler { this.optionsCursorObj.setOrigin(0, 0); this.optionsContainer.add(this.optionsCursorObj); } - const wideOptions = this.partyUiMode === PartyUiMode.MODIFIER_TRANSFER; - this.optionsCursorObj.setPosition(-86 - (wideOptions ? 50 : 0), -19 - (16 * ((this.options.length - 1) - this.optionsCursor))); + this.optionsCursorObj.setPosition(8 - this.optionsBg.displayWidth, -19 - (16 * ((this.options.length - 1) - this.optionsCursor))); } else { changed = this.cursor !== cursor; if (changed) { @@ -485,9 +502,7 @@ export default class PartyUiHandler extends MessageUiHandler { this.updateOptions(); - const wideOptions = this.partyUiMode === PartyUiMode.MODIFIER_TRANSFER; - - this.partyMessageBox.setSize(262 - (wideOptions ? 88 : 38), 30); + this.partyMessageBox.setSize(262 - Math.max(this.optionsBg.displayWidth - 56, 0), 30); this.setCursor(0); } @@ -512,6 +527,8 @@ export default class PartyUiHandler extends MessageUiHandler { this.eraseOptionsCursor(); } + let formChangeItemModifiers: PokemonFormChangeItemModifier[]; + if (this.partyUiMode !== PartyUiMode.MOVE_MODIFIER && this.partyUiMode !== PartyUiMode.REMEMBER_MOVE_MODIFIER && (this.transferMode || this.partyUiMode !== PartyUiMode.MODIFIER_TRANSFER)) { switch (this.partyUiMode) { case PartyUiMode.SWITCH: @@ -524,6 +541,13 @@ export default class PartyUiHandler extends MessageUiHandler { && (m as SwitchEffectTransferModifier).pokemonId === this.scene.getPlayerField()[this.fieldIndex].id)) this.options.push(PartyOption.PASS_BATON); } + if (this.scene.getCurrentPhase() instanceof CommandPhase) { + formChangeItemModifiers = this.scene.findModifiers(m => m instanceof PokemonFormChangeItemModifier && m.pokemonId === pokemon.id) as PokemonFormChangeItemModifier[]; + if (formChangeItemModifiers.find(m => m.active)) + formChangeItemModifiers = formChangeItemModifiers.filter(m => m.active); + for (let i = 0; i < formChangeItemModifiers.length; i++) + this.options.push(PartyOption.FORM_CHANGE_ITEM + i); + } break; case PartyUiMode.MODIFIER: this.options.push(PartyOption.APPLY); @@ -549,7 +573,7 @@ export default class PartyUiHandler extends MessageUiHandler { this.options.push(PartyOption.SUMMARY); if (pokemon.pauseEvolutions && pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId)) - this.options.push(PartyOption.UNPAUSE_EVO); + this.options.push(PartyOption.UNPAUSE_EVOLUTION); if (this.partyUiMode === PartyUiMode.SWITCH) this.options.push(PartyOption.RELEASE); @@ -582,14 +606,17 @@ export default class PartyUiHandler extends MessageUiHandler { this.options.push(PartyOption.CANCEL); - const optionBg = addWindow(this.scene, 0, 0, wideOptions ? 144 : 94, 16 * this.options.length + 13); - optionBg.setOrigin(1, 1); + this.optionsBg = addWindow(this.scene, 0, 0, 0, 16 * this.options.length + 13); + this.optionsBg.setOrigin(1, 1); - this.optionsContainer.add(optionBg); + this.optionsContainer.add(this.optionsBg); optionStartIndex = 0; optionEndIndex = this.options.length; + let widestOptionWidth = 0; + let optionTexts: Phaser.GameObjects.Text[] = []; + for (let o = optionStartIndex; o < optionEndIndex; o++) { const option = this.options[this.options.length - (o + 1)]; let altText = false; @@ -602,11 +629,12 @@ export default class PartyUiHandler extends MessageUiHandler { case PartyOption.MOVE_4: optionName = pokemon.moveset[option - PartyOption.MOVE_1].getName(); break; - case PartyOption.UNPAUSE_EVO: - optionName = 'Unpause Evo.'; - break; default: - optionName = Utils.toReadableString(PartyOption[option]); + if (formChangeItemModifiers && option >= PartyOption.FORM_CHANGE_ITEM) { + const modifier = formChangeItemModifiers[option - PartyOption.FORM_CHANGE_ITEM]; + optionName = `${modifier.active ? 'Deactivate' : 'Activate'} ${modifier.type.name}`; + } else + optionName = Utils.toReadableString(PartyOption[option]); break; } } else if (option === PartyOption.SCROLL_UP) @@ -625,15 +653,23 @@ export default class PartyUiHandler extends MessageUiHandler { } const yCoord = -6 - 16 * o; - const optionText = addTextObject(this.scene, -79 - (wideOptions ? 50 : 0), yCoord - 16, optionName, TextStyle.WINDOW); + const optionText = addTextObject(this.scene, 0, yCoord - 16, optionName, TextStyle.WINDOW); if (altText) { optionText.setColor('#40c8f8'); optionText.setShadowColor('#006090') } optionText.setOrigin(0, 0); + optionTexts.push(optionText); + + widestOptionWidth = Math.max(optionText.displayWidth, widestOptionWidth); + this.optionsContainer.add(optionText); } + + this.optionsBg.width = Math.max(widestOptionWidth + 24, 94); + for (let optionText of optionTexts) + optionText.x = 15 - this.optionsBg.width; } startTransfer(): void { diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 9ab20669f..9a6e66eb9 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -345,6 +345,7 @@ export default class UI extends Phaser.GameObjects.Container { const touchControls = document.getElementById('touchControls'); if (touchControls) touchControls.dataset.uiMode = Mode[this.mode]; + resolve(true); }; if (noTransitionModes.indexOf(lastMode) === -1) { @@ -356,8 +357,6 @@ export default class UI extends Phaser.GameObjects.Container { }); } else doRevertMode(); - - resolve(true); }); }