diff --git a/public/battle-anims/common-powder.json b/public/battle-anims/common-powder.json new file mode 100644 index 00000000000..698d68e7e81 --- /dev/null +++ b/public/battle-anims/common-powder.json @@ -0,0 +1,2496 @@ +{ + "graphic":"PRAS- Powder", + "frames":[ + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 21, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 22, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 0 , + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 23, + "opacity": 0 , + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 24, + "opacity": 0, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 17, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 18, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 8, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 19, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":16, + "y":2, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 9, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 20, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 10, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 11, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 12, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 13, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 14, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 15, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 155, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 150, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + }, + { + "x":-6, + "y":-3, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 155, + "focus":2 + }, + { + "x":12, + "y":0, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 255, + "priority": 1, + "focus":2 + }, + { + "x":-12, + "y":-20, + "zoomX":130, + "zoomY":120, + "visible":true, + "target": 2, + "graphicFrame": 16, + "opacity": 150, + "focus":2 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ], + [ + { + "x":0, + "y":0, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":0, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":2 + }, + { + "x":128, + "y":-64, + "zoomX":100, + "zoomY":100, + "visible":true, + "target":1, + "graphicFrame":0, + "opacity": 255, + "locked": true, + "priority":1, + "focus":1 + } + ] + ], + "frameTimedEvents":{ + "16":[{"frameIndex":16,"resourceName":"PRSFX- Powder common1.wav","volume":100,"pitch":100,"eventType":"AnimTimedSoundEvent"}], + "18":[{"frameIndex":18,"resourceName":"PRSFX- Powder common2.wav","volume":30,"pitch":120,"eventType":"AnimTimedSoundEvent"}] + }, + "position":3, + "hue":0 +} \ No newline at end of file diff --git a/public/images/battle_anims/PRAS- Powder.png b/public/images/battle_anims/PRAS- Powder.png index 3c4a4d2db55..9656c31e6c9 100644 Binary files a/public/images/battle_anims/PRAS- Powder.png and b/public/images/battle_anims/PRAS- Powder.png differ diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 5928a65b4e3..26ad65bd9b0 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -90,6 +90,7 @@ export enum CommonAnim { RAGING_BULL_FIRE, RAGING_BULL_WATER, SALT_CURE, + POWDER, SUNNY = 2100, RAIN, SANDSTORM, diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 75b7cddb904..5e6ee334db7 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -856,6 +856,57 @@ export class SeedTag extends BattlerTag { } } +/** + * BattlerTag representing the effects of {@link https://bulbapedia.bulbagarden.net/wiki/Powder_(move) | Powder}. + * When the afflicted Pokemon uses a Fire-type move, the move is cancelled, and the + * Pokemon takes damage equal to 1/4 of it's maximum HP (rounded down). + */ +export class PowderTag extends BattlerTag { + constructor() { + super(BattlerTagType.POWDER, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], 1); + } + + onAdd(pokemon: Pokemon): void { + super.onAdd(pokemon); + + // "{Pokemon} is covered in powder!" + pokemon.scene.queueMessage(i18next.t("battlerTags:powderOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) })); + } + + /** + * Applies Powder's effects before the tag owner uses a Fire-type move. + * Also causes the tag to expire at the end of turn. + * @param pokemon {@linkcode Pokemon} the owner of this tag + * @param lapseType {@linkcode BattlerTagLapseType} the type of lapse functionality to carry out + * @returns `true` if the tag should not expire after this lapse; `false` otherwise. + */ + lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { + if (lapseType === BattlerTagLapseType.PRE_MOVE) { + const movePhase = pokemon.scene.getCurrentPhase(); + if (movePhase instanceof MovePhase) { + const move = movePhase.move.getMove(); + if (pokemon.getMoveType(move) === Type.FIRE) { + movePhase.cancel(); + + pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.getBattlerIndex(), CommonAnim.POWDER)); + + const cancelDamage = new BooleanHolder(false); + applyAbAttrs(BlockNonDirectDamageAbAttr, pokemon, cancelDamage); + if (!cancelDamage.value) { + pokemon.damageAndUpdate(Math.floor(pokemon.getMaxHp() / 4), HitResult.OTHER); + } + + // "When the flame touched the powder\non the Pokémon, it exploded!" + pokemon.scene.queueMessage(i18next.t("battlerTags:powderLapse", { moveName: move.name })); + } + } + return true; + } else { + return super.lapse(pokemon, lapseType); + } + } +} + export class NightmareTag extends BattlerTag { constructor() { super(BattlerTagType.NIGHTMARE, BattlerTagLapseType.TURN_END, 1, Moves.NIGHTMARE); @@ -2955,6 +3006,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source return new InfatuatedTag(sourceMove, sourceId); case BattlerTagType.SEEDED: return new SeedTag(sourceId); + case BattlerTagType.POWDER: + return new PowderTag(); case BattlerTagType.NIGHTMARE: return new NightmareTag(); case BattlerTagType.FRENZY: diff --git a/src/data/move.ts b/src/data/move.ts index b4c519c5bcf..1283713ef30 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -9732,9 +9732,10 @@ export function initMoves() { .attr(StatStageChangeAttr, [ Stat.ATK, Stat.SPATK, Stat.SPD ], -1, false, { condition: (user, target, move) => target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC }) .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.POWDER, Type.BUG, 100, 20, -1, 1, 6) + .attr(AddBattlerTagAttr, BattlerTagType.POWDER, false, true) .ignoresSubstitute() .powderMove() - .unimplemented(), + .edgeCase(), // does not cancel Fire-type moves generated by Dancer new ChargingSelfStatusMove(Moves.GEOMANCY, Type.FAIRY, -1, 10, -1, 0, 6) .chargeText(i18next.t("moveTriggers:isChargingPower", { pokemonName: "{USER}" })) .attr(StatStageChangeAttr, [ Stat.SPATK, Stat.SPDEF, Stat.SPD ], 2, true) diff --git a/src/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts index bb969386630..f28ac37ae27 100644 --- a/src/enums/battler-tag-type.ts +++ b/src/enums/battler-tag-type.ts @@ -93,4 +93,5 @@ export enum BattlerTagType { GRUDGE = "GRUDGE", PSYCHO_SHIFT = "PSYCHO_SHIFT", ENDURE_TOKEN = "ENDURE_TOKEN", + POWDER = "POWDER", } diff --git a/src/test/moves/powder.test.ts b/src/test/moves/powder.test.ts new file mode 100644 index 00000000000..5c0f318d620 --- /dev/null +++ b/src/test/moves/powder.test.ts @@ -0,0 +1,205 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import Phaser from "phaser"; +import GameManager from "#test/utils/gameManager"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { BerryPhase } from "#app/phases/berry-phase"; +import { MoveResult } from "#app/field/pokemon"; +import { Type } from "#enums/type"; +import { MoveEffectPhase } from "#app/phases/move-effect-phase"; +import { StatusEffect } from "#enums/status-effect"; + +describe("Moves - Powder", () => { + let phaserGame: Phaser.Game; + let game: GameManager; + + beforeAll(() => { + phaserGame = new Phaser.Game({ + type: Phaser.HEADLESS, + }); + }); + + afterEach(() => { + game.phaseInterceptor.restoreOg(); + }); + + beforeEach(() => { + game = new GameManager(phaserGame); + game.override.battleType("single"); + + game.override + .enemySpecies(Species.SNORLAX) + .enemyLevel(100) + .enemyMoveset(Moves.EMBER) + .enemyAbility(Abilities.INSOMNIA) + .startingLevel(100) + .moveset([ Moves.POWDER, Moves.SPLASH, Moves.FIERY_DANCE ]); + }); + + it( + "should cancel the target's Fire-type move and damage the target", + async () => { + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + + await game.toNextTurn(); + + game.move.select(Moves.SPLASH); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should have no effect against Grass-type Pokemon", + async () => { + game.override.enemySpecies(Species.AMOONGUSS); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should have no effect against Pokemon with Overcoat", + async () => { + game.override.enemyAbility(Abilities.OVERCOAT); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should not damage the target if the target has Magic Guard", + async () => { + game.override.enemyAbility(Abilities.MAGIC_GUARD); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp()); + }); + + it( + "should not prevent the target from thawing out with Flame Wheel", + async () => { + game.override + .enemyMoveset(Array(4).fill(Moves.FLAME_WHEEL)) + .enemyStatusEffect(StatusEffect.FREEZE); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.status?.effect).not.toBe(StatusEffect.FREEZE); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + } + ); + + it( + "should not allow a target with Protean to change to Fire type", + async () => { + game.override.enemyAbility(Abilities.PROTEAN); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp()); + expect(enemyPokemon.summonData?.types).not.toBe(Type.FIRE); + }); + + // TODO: Implement this interaction to pass this test + it.skip( + "should cancel Fire-type moves generated by the target's Dancer ability", + async () => { + game.override + .enemySpecies(Species.BLASTOISE) + .enemyAbility(Abilities.DANCER); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const playerPokemon = game.scene.getPlayerPokemon()!; + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.FIERY_DANCE); + + await game.phaseInterceptor.to(MoveEffectPhase); + const enemyStartingHp = enemyPokemon.hp; + + await game.phaseInterceptor.to(BerryPhase, false); + // player should not take damage + expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp()); + // enemy should have taken damage from player's Fiery Dance + 2 Powder procs + expect(enemyPokemon.hp).toBe(enemyStartingHp - 2 * Math.floor(enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should cancel Revelation Dance if it becomes a Fire-type move", + async () => { + game.override + .enemySpecies(Species.CHARIZARD) + .enemyMoveset(Array(4).fill(Moves.REVELATION_DANCE)); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); + + it( + "should cancel Shell Trap and damage the target, even if the move would fail", + async () => { + game.override.enemyMoveset(Array(4).fill(Moves.SHELL_TRAP)); + + await game.classicMode.startBattle([ Species.CHARIZARD ]); + + const enemyPokemon = game.scene.getEnemyPokemon()!; + + game.move.select(Moves.POWDER); + + await game.phaseInterceptor.to(BerryPhase, false); + expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL); + expect(enemyPokemon.hp).toBe(Math.ceil(3 * enemyPokemon.getMaxHp() / 4)); + }); +});