From 124f69f1ec68a44718214b1aace4c91bdc5c591d Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 31 Mar 2023 20:19:57 -0400 Subject: [PATCH] Various changes --- public/images/statuses.json | 146 ++++++++++ public/images/statuses.png | Bin 0 -> 395 bytes public/images/statuses/burn.png | Bin 0 -> 174 bytes public/images/statuses/faint.png | Bin 0 -> 175 bytes public/images/statuses/freeze.png | Bin 0 -> 176 bytes public/images/statuses/paralysis.png | Bin 0 -> 177 bytes public/images/statuses/poison.png | Bin 0 -> 183 bytes public/images/statuses/sleep.png | Bin 0 -> 174 bytes public/images/types.json | 398 +++++++++++++++++++++++++++ public/images/types.png | Bin 0 -> 1657 bytes public/images/types/bug.png | Bin 0 -> 256 bytes public/images/types/dark.png | Bin 0 -> 274 bytes public/images/types/dragon.png | Bin 0 -> 276 bytes public/images/types/electric.png | Bin 0 -> 274 bytes public/images/types/fighting.png | Bin 0 -> 270 bytes public/images/types/fire.png | Bin 0 -> 249 bytes public/images/types/flying.png | Bin 0 -> 295 bytes public/images/types/ghost.png | Bin 0 -> 295 bytes public/images/types/grass.png | Bin 0 -> 298 bytes public/images/types/ground.png | Bin 0 -> 279 bytes public/images/types/ice.png | Bin 0 -> 252 bytes public/images/types/normal.png | Bin 0 -> 269 bytes public/images/types/poison.png | Bin 0 -> 293 bytes public/images/types/psychic.png | Bin 0 -> 296 bytes public/images/types/rock.png | Bin 0 -> 261 bytes public/images/types/steel.png | Bin 0 -> 273 bytes public/images/types/unknown.png | Bin 0 -> 247 bytes public/images/types/water.png | Bin 0 -> 256 bytes src/battle-phase.ts | 12 +- src/battle-scene.ts | 6 +- src/biome.ts | 102 +++---- src/modifier.ts | 4 +- src/pokemon.ts | 10 +- src/ui/fight-ui-handler.ts | 32 ++- 34 files changed, 649 insertions(+), 61 deletions(-) create mode 100644 public/images/statuses.json create mode 100644 public/images/statuses.png create mode 100644 public/images/statuses/burn.png create mode 100644 public/images/statuses/faint.png create mode 100644 public/images/statuses/freeze.png create mode 100644 public/images/statuses/paralysis.png create mode 100644 public/images/statuses/poison.png create mode 100644 public/images/statuses/sleep.png create mode 100644 public/images/types.json create mode 100644 public/images/types.png create mode 100644 public/images/types/bug.png create mode 100644 public/images/types/dark.png create mode 100644 public/images/types/dragon.png create mode 100644 public/images/types/electric.png create mode 100644 public/images/types/fighting.png create mode 100644 public/images/types/fire.png create mode 100644 public/images/types/flying.png create mode 100644 public/images/types/ghost.png create mode 100644 public/images/types/grass.png create mode 100644 public/images/types/ground.png create mode 100644 public/images/types/ice.png create mode 100644 public/images/types/normal.png create mode 100644 public/images/types/poison.png create mode 100644 public/images/types/psychic.png create mode 100644 public/images/types/rock.png create mode 100644 public/images/types/steel.png create mode 100644 public/images/types/unknown.png create mode 100644 public/images/types/water.png diff --git a/public/images/statuses.json b/public/images/statuses.json new file mode 100644 index 00000000000..b893554b148 --- /dev/null +++ b/public/images/statuses.json @@ -0,0 +1,146 @@ +{ + "textures": [ + { + "image": "statuses.png", + "format": "RGBA8888", + "size": { + "w": 44, + "h": 30 + }, + "scale": 1, + "frames": [ + { + "filename": "burn", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 1, + "y": 1, + "w": 20, + "h": 8 + } + }, + { + "filename": "faint", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 1, + "y": 11, + "w": 20, + "h": 8 + } + }, + { + "filename": "freeze", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 1, + "y": 21, + "w": 20, + "h": 8 + } + }, + { + "filename": "paralysis", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 23, + "y": 1, + "w": 20, + "h": 8 + } + }, + { + "filename": "poison", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 23, + "y": 11, + "w": 20, + "h": 8 + } + }, + { + "filename": "sleep", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 20, + "h": 8 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 20, + "h": 8 + }, + "frame": { + "x": 23, + "y": 21, + "w": 20, + "h": 8 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:34eb38966145af4ef9cffbaaa8d07ea3:fba056f9a49345436b0820757c78f418:e6649238c018d3630e55681417c698ca$" + } +} diff --git a/public/images/statuses.png b/public/images/statuses.png new file mode 100644 index 0000000000000000000000000000000000000000..8820b55689490e22d80bbf70ecb6fccab3060f79 GIT binary patch literal 395 zcmV;60d)R}P)(XNCb3`Dz#fGhp~-@To- zuv$0S>w^;nI+)1d z8TudCxPcGYJ790)1e@_Oc@4>*0p}NEzyP;K&)qZ8{tnu4T1!y93-4fYL2s5FmC$}gGM^~++S*+$fgeXPKbT8!>Ts-{@QM06%{2HECo7%!PC{xWt~$(69A8FMFs!> literal 0 HcmV?d00001 diff --git a/public/images/statuses/faint.png b/public/images/statuses/faint.png new file mode 100644 index 0000000000000000000000000000000000000000..12297bdab22e6da3bd140391ad70efba15baf027 GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W+!3HFM&b|K@NR@fIIEHAPPfkflNca&r@x%Ya zz0y2W7#MkZ+4}ledwO29ajvmwSoFcUg}M1a7c-B%lFWlo28Jo72F^1#?0f?hmU+CH zV`dsid%Kl z6PB`;OO=-!d=oh~@9+%%Tb!H%F9Tj(+&CwqkKsV&%eAW_7(HdIU86Qj)Tn#yEQvXF z^h#*3d0be#u^wCh6z}DkXG2AAd!5;}pmlcVF>l?xX~!Zz-cyQBV|d{4$ouf-O&(7F b>SnXEJobF+I*&UO=mZ8&S3j3^P66uN@Ue8u`Q5t zzx(%{ZQ&WtgZay(7D~BK_Sju%%*Swsi%Bf|b6fv&<$Z;h8|8lNinaF)Pw+ea$VmOd ctL>JIcITWKV>I+Tfo@>%boFyt=akR{0QI6ly#N3J literal 0 HcmV?d00001 diff --git a/public/images/statuses/poison.png b/public/images/statuses/poison.png new file mode 100644 index 0000000000000000000000000000000000000000..b9ed12adcfc700ee24bed28f028c1478be62d9ed GIT binary patch literal 183 zcmV;o07(CdP)nBkz0ETqL6;1)~CpVhaEuxphb6UhA-m8kRn7QOsez) znzhgFyC+q`nG<81lWA6H)(-Itqc=b9vS!$xs*Ip9^_3Q&R5{g{p?6*g^m@_$BESOV l#IGvPsiPHeV$k2;<^V>CQ4NLdM?wGq002ovPDHLkV1jL9N%H^z literal 0 HcmV?d00001 diff --git a/public/images/statuses/sleep.png b/public/images/statuses/sleep.png new file mode 100644 index 0000000000000000000000000000000000000000..8a54bbab71732e4b6a07cb9d9293c6e092022baf GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W+!3HFM&b|K@NR@iJIEHAPUmLWM_kaP1@d{@* zzt=O2i@eSyoXPCDc}p|2yJOXguP!Q&6POttvcDR<{=qb{rB>f1PUkrjL%`bW)mP>f zKj#hnmb6NA)z^z6ijQWNZczWp8Gi8M`TWbg=7BOYshg8-CJTE?Sf0~4KTRNa)<3)1 Z!W*CaluK0Z{tk2igQu&X%Q~loCII|JL_Yuk literal 0 HcmV?d00001 diff --git a/public/images/types.json b/public/images/types.json new file mode 100644 index 00000000000..c348d426f62 --- /dev/null +++ b/public/images/types.json @@ -0,0 +1,398 @@ +{ + "textures": [ + { + "image": "types.png", + "format": "RGBA8888", + "size": { + "w": 612, + "h": 16 + }, + "scale": 1, + "frames": [ + { + "filename": "bug", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 1, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "dark", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 35, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "dragon", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 69, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "electric", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 103, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "fighting", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 137, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "fire", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 171, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "flying", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 205, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "ghost", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 239, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "grass", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 273, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "ground", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 307, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "ice", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 341, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "normal", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 375, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "poison", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 409, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "psychic", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 443, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "rock", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 477, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "steel", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 511, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "water", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 545, + "y": 1, + "w": 32, + "h": 14 + } + }, + { + "filename": "unknown", + "rotated": false, + "trimmed": false, + "sourceSize": { + "w": 32, + "h": 14 + }, + "spriteSourceSize": { + "x": 0, + "y": 0, + "w": 32, + "h": 14 + }, + "frame": { + "x": 579, + "y": 1, + "w": 32, + "h": 14 + } + } + ] + } + ], + "meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "3.0", + "smartupdate": "$TexturePacker:SmartUpdate:487be8bed12f0ec062283a698524f491:d47bd2a8523f360e898c134601ed66bd:5961efbfbf4c56b8745347e7a663a32f$" + } +} diff --git a/public/images/types.png b/public/images/types.png new file mode 100644 index 0000000000000000000000000000000000000000..fa705e341954b111acdbdffb3ebe08153c438641 GIT binary patch literal 1657 zcmV-<28Q{GP)bY0001ZP)t-s0000W zXkbV00001bW%=J06^y0W&i*H32;bRa{vGf6951U69E94oEQKA z1)51jK~!ko?V9OQDlrg+5fK5Ukxc{_7!dOQZ+O#7l1^smP`Ao|oa$+^G%(0#9|rC9 zdIwWIueB+x_%MYP7gJbqG=&vsQ&{n33M*Eou;SCyZLj6q6jtm_Va1OrtoSvB6^*Ie z&SPN;D_%@t#T~LcWPc6W;qY$ia9FR$rq=6^kCCa5kITgd0nvJQZ+3&Ze z_WQ+RXlk)|d3iSFF?+9ST-B(mb5*;lj#aIynp8Eds;O#G)w-%>Ri~;pRc)&pR`py} zg3LJw?-KrKL5BO7fkzwxGF;*`$`c1d=5X6V7@hg>OO6&9Bo|h8bYRd-Ll$fB;8}u9 zo&`rBRj|UKHG#}eCKCSODUBjzem2D=9;w8T`C)_GGQ!|QYYH-4Snz>aLFRyh4jIc7 z0%W*>8F-Xt6bKovV}=u+fDBGDijZLyW=R|xGQYZ&A81IBLFRyhj#LIEWPVAfF314i z6@-jNZOC{(r3|uiGbX%c$N)ef4xk*LiXO($&f0YB4Y&Eh-gYlnwW;HOaPcUB4m<%NGFpu4Vh$$*v0~6Da9T} z!_>(mr}ouNlhbUOTsAz@JvI- zEi7P0gRrC^+Xz}d31&HDTL8?2R!S|%hB1cmHiPULt3tBvl3vCY$U>(i-z*^$&vdba z$tc(*oP%A;=q#40?GkpuCi&UgkdZ&KQ%cJ05(>y5oKS)+xx$2d-K2y}Ugng_a5jZx zmvK8I&0U8~d^5L87pRJMDd(i^GC>B>De11!F6rz}0vRpID7VW1nfRuL3?G2FaxSJW z$jBkZGKU>@35Zro|7Vxuyy1+vmEp|Hz!mt8IsWNx{PkSV+L>2yjT_#vfkyOg_UcDdcUid}Mh ztk|XRWqInhOKQEGISj*Aik z8C^)?_KpvU3^KAueh|4)kP%9>wxUp@^c9AmOhUjUB>g>^Uz$?HTV9i|F#NCy0cr{~ z)mNA3l5*r%mjE2$MkTyO$N(W*qGy7nFrzKxi#~gaXYwF~`U(Sp12&X6a=Qdf+u|)s zka>H=g<%K?v$B&xmfDcrzl^-0$0n_4{vcHezpYvzd+9 zYzAN>Mjgu(z{7)$*uz7w=P|Q{e*hhr!iq;zSYf~1+n&Y75G!niu%d4YE1pbY#mp2| z%uQj1{fm3snZB92?M%VcZ50ou=)W-Tkli8sTgd(aVs{(AAFTDO00000NkvXXu0mjf Dh|3|1 literal 0 HcmV?d00001 diff --git a/public/images/types/bug.png b/public/images/types/bug.png new file mode 100644 index 0000000000000000000000000000000000000000..72681086ec6bc9653ab36383acf2259079ecf7e7 GIT binary patch literal 256 zcmV+b0ssDqP)EPUmr%G_|-NqwnFa_n}GlIl3Al1}#e;v0$(E>$4?J7LqUl0Eh*`0K&e} zEzgJB@d}iIF^FZJFq!!#1H@7?tO>`UAQp2QI%^Ar$t0ZH@UtQOrUjow^%=&XyV(&- z6|~o^*kJ>I|A<YP){hH&d25S;?K@LbD&0cQaY;QEdp2T0!Ro%CC;^wiG_uYvS@GoSx>ytINT@M8Sr(==Ch3l^C~`c0Cm(;1ayk9v?VmhEt#HEt0RX+cG;zUQ amAC_xf8%xj=CA7j0000YP)of4ZlTl#TLd&atgWAXJjzpKCi==j}wq(iI=TtCMc zjoSOf{5&tjNtv7g0FW|=NYrqoOe(_8xBOfJ&#XH3b)h#nQf9M>nCH9yodgv*Y9#(H z!8dtbF(Ss6#$&PY!+kQvVDTN;(|xZio*%jlF@C=G+do9c%4Wrll@I_h-7ih1Fx+PG Y0`>BajqaT9KmY&$07*qoM6N<$f|ulXk^lez literal 0 HcmV?d00001 diff --git a/public/images/types/fighting.png b/public/images/types/fighting.png new file mode 100644 index 0000000000000000000000000000000000000000..0fd87f3dbd9205c0958e4b866ecedbf67c93f952 GIT binary patch literal 270 zcmV+p0rCEcP)Ci#p>B(kz{pM#9d=S(7zm3&I&TxUivWze!s@b0)v-X$TtOr!0hf)BHL0cd%I U6TH9k+5i9m07*qoM6N<$g1RAdbpQYW literal 0 HcmV?d00001 diff --git a/public/images/types/fire.png b/public/images/types/fire.png new file mode 100644 index 0000000000000000000000000000000000000000..08a550fcaff08da95b8fd0525327190db45a4635 GIT binary patch literal 249 zcmVJC1u7)`JGcC5s3$6Mdm7a-SNktKmh<}dtw2M z%}Q~$Cr2!Sc>>$2<^aGE&|Qag{Op4#kPqFxGpVU_CN+ELk;~wzX`-%|b*WQBCqd7U zB=>c_#gTM1wh@7RfT05~-iMre)HAwE5%f5>M=;|2B?9SXkPlO_jABq9FaLr?Sl>iC z%$d|}Bu%4h;0|m#^0MYRG86zL`&crCJ-^i#+7f4%niTl+00000NkvXXu0mjf+D~Kc literal 0 HcmV?d00001 diff --git a/public/images/types/flying.png b/public/images/types/flying.png new file mode 100644 index 0000000000000000000000000000000000000000..3a13e051222b03d7a82dc97685e6766a8dd274b5 GIT binary patch literal 295 zcmV+?0oeYDP)iDVp@xGZ{#_%9G`DZ?bfoinnnuG3;Us&OD(*N4$QQl34j-e!kl4UQN&%kFKfKe t!w*mj+*(u2+*$($0FV2#ND8fy>P?+WidjSAsnQC+;Xleie002ovPDHLkV1fdKf}j8Z literal 0 HcmV?d00001 diff --git a/public/images/types/grass.png b/public/images/types/grass.png new file mode 100644 index 0000000000000000000000000000000000000000..35dfecfc2d25c9fa29a27b397e459f26e2d0bb89 GIT binary patch literal 298 zcmV+_0oDGAP)T&zL5yF;jtDiKTP@s2(VaQl_RI1N7IhBwe$oGoY8P z*Ls=0rLuLGd7Q;wQs5oAi(%um9q1LS7EnlLyjjh935X2ES&QXn{sXy8sf)`x_g~pp wbu3mb;9ozYIL^(I$8p91oaERz>%07*qoM6N<$g1`uZIsgCw literal 0 HcmV?d00001 diff --git a/public/images/types/ground.png b/public/images/types/ground.png new file mode 100644 index 0000000000000000000000000000000000000000..0df975559b6d092359cc85f00a637d2377e3b167 GIT binary patch literal 279 zcmV+y0qFjTP)qnGvG)bP}ZRl29)LlcuA+8_jUxZs<^4+d{3R10Y|*4X6FHNL3pnW2vH48Z^Z002ovPDHLkV1m7{c#r@9 literal 0 HcmV?d00001 diff --git a/public/images/types/ice.png b/public/images/types/ice.png new file mode 100644 index 0000000000000000000000000000000000000000..57ea33f9b16650d96537b0631c34f0051030badb GIT binary patch literal 252 zcmVtcILhT> zEE+^o7tB%F&4yXxT$s9A}qQ{2pBCK38Z2*wW0=UE!>nv|9mRric6T1u8id> zt~(-ZM^f8Z?fAAMRK~CmTRMzAa(*fIPb|&1|A^MfHWObb3k3kL=cCChyv?k>#$uAo T;d(r-00000NkvXXu0mjfCYNqr literal 0 HcmV?d00001 diff --git a/public/images/types/poison.png b/public/images/types/poison.png new file mode 100644 index 0000000000000000000000000000000000000000..c898b4d14a9387642cd92d4480dddd33381f8e13 GIT binary patch literal 293 zcmV+=0owkFP)|}5cE)+Avsy8V@JEwbZI=Sx^2_~c(=c~;fUt4O^zr7J z%#W+V z8}k1sCXZnCHIw6(CQx8ES{kHcE;(nvFexrlfDA`UI28Z@d&gJBWvweNIf4+9vO$a{ zB{PYV!kj{8$7lnQ%Sj uhq>h+qM@FPZ9dd96ae&HS40JEt@;9cxuTsWv}w`+0000C$7kbE-oq;b$ufPePyv$35Pm69BNU z^N9u+rbUQ-ozHD|E%HMSBgE^en!KLTr8cI=>WAIb7oX!&>lpf+I->~yK-$1)@^gus ze&GN^Nn6dakkA>UDSE!j0n)}hk-H=&jNK^3b)^!p&AB>;FXnT#akolPiy9IAoeRSc z8sn~rPxb*;t)z{v!vvpPD)y3qzcnIfk7mi8Js<$U%wrQ5XmR2Vsy>7H4Mho>00000 LNkvXXu0mjfOHys@ literal 0 HcmV?d00001 diff --git a/public/images/types/steel.png b/public/images/types/steel.png new file mode 100644 index 0000000000000000000000000000000000000000..34e2ad73db8e822b5443f26dd32e0eb11936ca20 GIT binary patch literal 273 zcmV+s0q*{ZP)ki z!Oy4wrAUYn{2XIjV?Mg>30Z460L0ir<_?Gyh!iG2EOO@3e2e2AYiM%AoizXeV;!6| znEW?pq;ZMcLbGcWU`wE`=D!$ImaA7P2DdH1&seyyZ~#0{?_Oqvk9oKR^J0HMc4*Sa%mM Xct&`gOOwIw00000NkvXXu0mjfVODC- literal 0 HcmV?d00001 diff --git a/public/images/types/unknown.png b/public/images/types/unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..607111adefbd360df1fd8d9a4cd36725bb0547de GIT binary patch literal 247 zcmV-_6q)Qsn1a7G$ZC159He6Sb<+G?gabh?TNfTqMbzH2@gvaMrA6 zjJ?VtDj<_8{dSp@9TKoq^$R;?1WQHRQAn92lx`c*4#>x_Yp;}@;sImb&fQXWS_eK& xCS`{_@b_2H`ytsT?EQcODD)%AXB3{TdIN>eaTA3PXLJAn002ovPDHLkV1h4sVE6z4 literal 0 HcmV?d00001 diff --git a/public/images/types/water.png b/public/images/types/water.png new file mode 100644 index 0000000000000000000000000000000000000000..eb618008d00ed8864192b667a68e70196233b8dd GIT binary patch literal 256 zcmV+b0ssDqP)CFU3764$$!I6cd z7iUPGY8)Fi?Ki-X$vwQL?KWV^b;rm`bJ|-5WGh=SAAdpVky6?#m3XNuGPY{q?~ADB{MXQtpa6jEWk?sudG!D(oqaDf2yJly0000 this.end(), 500); + this.move.ppUsed++; if (this.move.getMove().category !== MOVE_CATEGORY.STATUS) this.scene.unshiftPhase(this.getEffectPhase()); } @@ -863,10 +864,13 @@ export class AttemptCapturePhase extends BattlePhase { this.scene.unshiftPhase(new VictoryPhase(this.scene)); this.scene.ui.showText(`${pokemon.name} was caught!`, null, () => { pokemon.hideInfo(); - pokemon.addToParty(); + const newPokemon = pokemon.addToParty(); this.scene.field.remove(pokemon, true); - this.removePb(); - this.end(); + newPokemon.loadAssets().then(() => { + this.removePb(); + this.end(); + }); + this.scene.load.start(); }, 0, true); } @@ -893,7 +897,7 @@ export class SelectModifierPhase extends BattlePhase { regenerateModifierPoolThresholds(this.scene.getParty()); const modifierCount = new Utils.IntegerHolder(3); this.scene.applyModifiers(ExtraModifierModifier, modifierCount); - const types: Array = getModifierTypesForWave(this.scene.currentBattle.waveIndex, modifierCount.value); + const types: Array = getModifierTypesForWave(this.scene.currentBattle.waveIndex - 1, modifierCount.value); this.scene.ui.setMode(Mode.MODIFIER_SELECT, types, (cursor: integer) => { if (cursor < 0) { diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 3481e77ad04..f0efa7566c5 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -5,7 +5,7 @@ import { BattlePhase, EncounterPhase, SummonPhase, CommandPhase, NextEncounterPh import { PlayerPokemon, EnemyPokemon } from './pokemon'; import PokemonSpecies, { allSpecies, getPokemonSpecies } from './pokemon-species'; import * as Utils from './utils'; -import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonModifier } from './modifier'; +import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonModifier, ExpBoosterModifier, ExpBoosterModifierType } from './modifier'; import { PokeballType } from './pokeball'; import { Species } from './species'; import { initAutoPlay } from './auto-play'; @@ -138,6 +138,8 @@ export default class BattleScene extends Phaser.Scene { this.loadAtlas('pb', ''); this.loadAtlas('items', ''); + this.loadAtlas('types', ''); + this.loadAtlas('statuses', ''); for (let i = 0; i < 6; i++) this.loadAtlas(`pokemon_icons_${i}`, 'ui'); @@ -351,7 +353,7 @@ export default class BattleScene extends Phaser.Scene { if (this.bgm && this.bgm.isPlaying) this.bgm.stop(); this.bgm = this.sound.add(bgmName, { loop: true }); - this.bgm.play(); + //this.bgm.play(); } pauseBgm(): void { diff --git a/src/biome.ts b/src/biome.ts index a862dd48449..2dbbf328134 100644 --- a/src/biome.ts +++ b/src/biome.ts @@ -121,10 +121,6 @@ export class BiomeArena { } fadeOutBgm(duration: integer) { - console.log(this.scene) - console.log(this.bgm) - console.log(this.scene.sound.get(this.bgm)) - console.log(duration) SoundFade.fadeOut(this.scene, this.scene.sound.get(this.bgm), duration); } } @@ -564,8 +560,14 @@ const biomePools = { { 1: [ Species.PHANPY ], 25: [ Species.DONPHAN ] }, { 1: [ Species.DRILBUR ], 31: [ Species.EXCADRILL ] } ], - [PoolTier.UNCOMMON]: [ Species.ONIX, { 1: [ Species.CUBONE ], 28: [ Species.MAROWAK ] }, Species.GLIGAR, { 1: [ Species.NUMEL ], 33: [ Species.CAMERUPT ] }, { 1: [ Species.ROGGENROLA ], 25: [ Species.BOLDORE ] } ], - [PoolTier.RARE]: [ Species.TORKOAL ], + [PoolTier.UNCOMMON]: [ + { 1: [ Species.SANDSHREW ], 22: [ Species.SANDSLASH ] }, + { 1: [ Species.CUBONE ], 28: [ Species.MAROWAK ] }, + Species.GLIGAR, + { 1: [ Species.NUMEL ], 33: [ Species.CAMERUPT ] }, + { 1: [ Species.ROGGENROLA ], 25: [ Species.BOLDORE ] } + ], + [PoolTier.RARE]: [ Species.ONIX ], [PoolTier.SUPER_RARE]: [], [PoolTier.ULTRA_RARE]: [ Species.TERRAKION, Species.LANDORUS ], [PoolTier.BOSS]: [ Species.DUGTRIO, Species.GOLEM, Species.MAROWAK, Species.DONPHAN, Species.RHYPERIOR, Species.GLISCOR, Species.EXCADRILL ], @@ -644,8 +646,8 @@ const biomePools = { { 1: [ Species.ELECTRIKE ], 26: [ Species.MANECTRIC ] }, { 1: [ Species.SHINX ], 15: [ Species.LUXIO ], 30: [ Species.LUXRAY ] } ], - [PoolTier.UNCOMMON]: [ Species.PLUSLE, Species.MINUN, Species.PACHIRISU, Species.EMOLGA ], - [PoolTier.RARE]: [ Species.ELECTABUZZ ], + [PoolTier.UNCOMMON]: [ Species.ELECTABUZZ, Species.PLUSLE, Species.MINUN, Species.PACHIRISU, Species.EMOLGA ], + [PoolTier.RARE]: [], [PoolTier.SUPER_RARE]: [ Species.JOLTEON ], [PoolTier.ULTRA_RARE]: [ Species.RAIKOU, Species.ROTOM, Species.THUNDURUS ], [PoolTier.BOSS]: [ Species.RAICHU, Species.MANECTRIC, Species.LUXRAY, Species.MAGNEZONE, Species.ELECTIVIRE ], @@ -654,11 +656,10 @@ const biomePools = { [PoolTier.BOSS_ULTRA_RARE]: [ Species.ZEKROM ] }, [Biome.VOLCANO]: { - [PoolTier.COMMON]: [ Species.VULPIX, { 1: [ Species.PONYTA ], 40: [ Species.RAPIDASH ] }, { 1: [ Species.SLUGMA ], 38: [ Species.MAGCARGO ] }, { 1: [ Species.NUMEL ], 33: [ Species.CAMERUPT ] } ], - [PoolTier.UNCOMMON]: [ Species.GROWLITHE, Species.TORKOAL, { 1: [ Species.PANSEAR ], 20: [ Species.SIMISEAR ] }, Species.HEATMOR ], + [PoolTier.COMMON]: [ Species.VULPIX, Species.GROWLITHE, { 1: [ Species.PONYTA ], 40: [ Species.RAPIDASH ] }, { 1: [ Species.SLUGMA ], 38: [ Species.MAGCARGO ] }, { 1: [ Species.NUMEL ], 33: [ Species.CAMERUPT ] } ], + [PoolTier.UNCOMMON]: [ Species.MAGMAR, Species.TORKOAL, { 1: [ Species.PANSEAR ], 20: [ Species.SIMISEAR ] }, Species.HEATMOR ], [PoolTier.RARE]: [ { 1: [ Species.CHARMANDER ], 16: [ Species.CHARMELEON ], 36: [ Species.CHARIZARD ] }, - Species.MAGMAR, { 1: [ Species.CYNDAQUIL ], 14: [ Species.QUILAVA ], 36: [ Species.TYPHLOSION ] }, { 1: [ Species.TORCHIC ], 16: [ Species.COMBUSKEN ], 36: [ Species.BLAZIKEN ] }, { 1: [ Species.CHIMCHAR ], 14: [ Species.MONFERNO ], 36: [ Species.INFERNAPE ] }, @@ -699,17 +700,15 @@ const biomePools = { { 1: [ Species.MACHOP ], 28: [ Species.MACHOKE ] }, { 1: [ Species.MAKUHITA ], 24: [ Species.HARIYAMA ] }, { 1: [ Species.MEDITITE ], 37: [ Species.MEDICHAM ] }, - { 1: [ Species.TIMBURR ], 25: [ Species.GURDURR ] }, - { 1: [ Species.SCRAGGY ], 39: [ Species.SCRAFTY ] }, - { 1: [ Species.MIENFOO ], 50: [ Species.MIENSHAO ] } + { 1: [ Species.TIMBURR ], 25: [ Species.GURDURR ] } ], - [PoolTier.UNCOMMON]: [ { 1: [ Species.CROAGUNK ], 37: [ Species.TOXICROAK ] } ], - [PoolTier.RARE]: [ { 1: [ Species.TYROGUE ], 20: [ Species.HITMONLEE ] }, Species.HITMONCHAN, Species.LUCARIO, Species.THROH, Species.SAWK ], + [PoolTier.UNCOMMON]: [ { 1: [ Species.CROAGUNK ], 37: [ Species.TOXICROAK ] }, { 1: [ Species.SCRAGGY ], 39: [ Species.SCRAFTY ] }, { 1: [ Species.MIENFOO ], 50: [ Species.MIENSHAO ] } ], + [PoolTier.RARE]: [ { 1: [ Species.TYROGUE ], 20: [ Species.HITMONLEE, Species.HITMONCHAN ] }, Species.LUCARIO, Species.THROH, Species.SAWK ], [PoolTier.SUPER_RARE]: [ Species.HITMONTOP, Species.GALLADE ], - [PoolTier.ULTRA_RARE]: [], + [PoolTier.ULTRA_RARE]: [ Species.COBALION, Species.TERRAKION, Species.VIRIZION, Species.KELDEO ], [PoolTier.BOSS]: [ Species.PRIMEAPE, Species.MACHAMP, Species.HITMONLEE, Species.HITMONCHAN, Species.HARIYAMA, Species.MEDICHAM, Species.LUCARIO, Species.TOXICROAK, Species.CONKELDURR, Species.THROH, Species.SAWK, Species.SCRAFTY, Species.MIENSHAO ], [PoolTier.BOSS_RARE]: [ Species.HITMONTOP, Species.GALLADE ], - [PoolTier.BOSS_SUPER_RARE]: [], + [PoolTier.BOSS_SUPER_RARE]: [ Species.COBALION, Species.TERRAKION, Species.VIRIZION, Species.KELDEO ], [PoolTier.BOSS_ULTRA_RARE]: [] }, [Biome.RUINS]: { @@ -743,24 +742,23 @@ const biomePools = { { 1: [ Species.VIBRAVA ], 45: [ Species.FLYGON ] }, { 1: [ Species.BAGON ], 30: [ Species.SHELGON ], 50: [ Species.SALAMENCE ] }, { 1: [ Species.GIBLE ], 24: [ Species.GABITE ], 48: [ Species.GARCHOMP ] }, - { 1: [ Species.AXEW ], 38: [ Species.FRAXURE ] }, - { 1: [ Species.DEINO ], 50: [ Species.ZWEILOUS ], 64: [ Species.HYDREIGON ] } + { 1: [ Species.AXEW ], 38: [ Species.FRAXURE ] } ], - [PoolTier.RARE]: [ { 1: [ Species.DRATINI ], 30: [ Species.DRAGONAIR ], 55: [ Species.DRAGONITE ] }, Species.DRUDDIGON ], - [PoolTier.SUPER_RARE]: [ Species.AERODACTYL ], + [PoolTier.RARE]: [ { 1: [ Species.DRATINI ], 30: [ Species.DRAGONAIR ], 55: [ Species.DRAGONITE ] }, { 1: [ Species.DEINO ], 50: [ Species.ZWEILOUS ], 64: [ Species.HYDREIGON ] } ], + [PoolTier.SUPER_RARE]: [ Species.AERODACTYL, Species.DRUDDIGON ], [PoolTier.ULTRA_RARE]: [], - [PoolTier.BOSS]: [ Species.DRAGONITE, Species.TYRANITAR, Species.FLYGON, Species.ALTARIA, Species.SALAMENCE, Species.GARCHOMP, Species.HAXORUS, Species.DRUDDIGON, Species.HYDREIGON ], - [PoolTier.BOSS_RARE]: [ Species.AERODACTYL ], + [PoolTier.BOSS]: [ Species.DRAGONITE, Species.TYRANITAR, Species.FLYGON, Species.ALTARIA, Species.SALAMENCE, Species.GARCHOMP, Species.HAXORUS ], + [PoolTier.BOSS_RARE]: [ Species.AERODACTYL, Species.DRUDDIGON ], [PoolTier.BOSS_SUPER_RARE]: [], [PoolTier.BOSS_ULTRA_RARE]: [ Species.DIALGA ] }, [Biome.ABYSS]: { [PoolTier.COMMON]: [ { 1: [ Species.HOUNDOUR ], 24: [ Species.HOUNDOOM ] }, { 1: [ Species.POOCHYENA ], 18: [ Species.MIGHTYENA ] }, Species.SABLEYE, { 1: [ Species.PURRLOIN ], 20: [ Species.LIEPARD ] } ], - [PoolTier.UNCOMMON]: [ Species.MURKROW, { 1: [ Species.PAWNIARD ], 52: [ Species.BISHARP ] } ], + [PoolTier.UNCOMMON]: [ Species.MURKROW, { 1: [ Species.PAWNIARD ], 52: [ Species.BISHARP ] }, { 1: [ Species.DEINO ], 50: [ Species.ZWEILOUS ], 64: [ Species.HYDREIGON ] } ], [PoolTier.RARE]: [ Species.ABSOL, Species.SPIRITOMB, { 1: [ Species.ZORUA ], 30: [ Species.ZOROARK ] } ], [PoolTier.SUPER_RARE]: [ Species.UMBREON ], [PoolTier.ULTRA_RARE]: [ Species.DARKRAI ], - [PoolTier.BOSS]: [ Species.HOUNDOOM, Species.MIGHTYENA, Species.SABLEYE, Species.ABSOL, Species.HONCHKROW, Species.SPIRITOMB, Species.LIEPARD, Species.ZOROARK, Species.BISHARP ], + [PoolTier.BOSS]: [ Species.HOUNDOOM, Species.MIGHTYENA, Species.SABLEYE, Species.ABSOL, Species.HONCHKROW, Species.SPIRITOMB, Species.LIEPARD, Species.ZOROARK, Species.BISHARP, Species.HYDREIGON ], [PoolTier.BOSS_RARE]: [ Species.UMBREON ], [PoolTier.BOSS_SUPER_RARE]: [ Species.DARKRAI ], [PoolTier.BOSS_ULTRA_RARE]: [ Species.PALKIA ] @@ -918,10 +916,12 @@ const biomePools = { ] ], [ Species.SANDSHREW, Type.GROUND, -1, [ + [ Biome.LAND, PoolTier.UNCOMMON ], [ Biome.DESERT, PoolTier.COMMON ] ] ], [ Species.SANDSLASH, Type.GROUND, -1, [ + [ Biome.LAND, PoolTier.UNCOMMON ], [ Biome.DESERT, PoolTier.COMMON ], [ Biome.DESERT, PoolTier.BOSS ] ] @@ -1073,7 +1073,7 @@ const biomePools = { ], [ Species.GROWLITHE, Type.FIRE, -1, [ [ Biome.GRASS, PoolTier.RARE ], - [ Biome.VOLCANO, PoolTier.UNCOMMON ] + [ Biome.VOLCANO, PoolTier.COMMON ] ] ], [ Species.ARCANINE, Type.FIRE, -1, [ @@ -1248,7 +1248,7 @@ const biomePools = { ] ], [ Species.ONIX, Type.ROCK, Type.GROUND, [ - [ Biome.LAND, PoolTier.UNCOMMON ], + [ Biome.LAND, PoolTier.RARE ], [ Biome.CAVE, PoolTier.RARE ], [ Biome.CAVE, PoolTier.BOSS ] ] @@ -1397,11 +1397,11 @@ const biomePools = { ] ], [ Species.ELECTABUZZ, Type.ELECTRIC, -1, [ - [ Biome.POWER_PLANT, PoolTier.RARE ] + [ Biome.POWER_PLANT, PoolTier.UNCOMMON ] ] ], [ Species.MAGMAR, Type.FIRE, -1, [ - [ Biome.VOLCANO, PoolTier.RARE ] + [ Biome.VOLCANO, PoolTier.UNCOMMON ] ] ], [ Species.PINSIR, Type.BUG, -1, [ @@ -2338,7 +2338,6 @@ const biomePools = { ] ], [ Species.TORKOAL, Type.FIRE, -1, [ - [ Biome.LAND, PoolTier.RARE ], [ Biome.VOLCANO, PoolTier.UNCOMMON ], [ Biome.VOLCANO, PoolTier.BOSS ] ] @@ -3443,11 +3442,11 @@ const biomePools = { ] ], [ Species.SCRAGGY, Type.DARK, Type.FIGHTING, [ - [ Biome.DOJO, PoolTier.COMMON ] + [ Biome.DOJO, PoolTier.UNCOMMON ] ] ], [ Species.SCRAFTY, Type.DARK, Type.FIGHTING, [ - [ Biome.DOJO, PoolTier.COMMON ], + [ Biome.DOJO, PoolTier.UNCOMMON ], [ Biome.DOJO, PoolTier.BOSS ] ] ], @@ -3724,17 +3723,17 @@ const biomePools = { ] ], [ Species.MIENFOO, Type.FIGHTING, -1, [ - [ Biome.DOJO, PoolTier.COMMON ] + [ Biome.DOJO, PoolTier.UNCOMMON ] ] ], [ Species.MIENSHAO, Type.FIGHTING, -1, [ - [ Biome.DOJO, PoolTier.COMMON ], + [ Biome.DOJO, PoolTier.UNCOMMON ], [ Biome.DOJO, PoolTier.BOSS ] ] ], [ Species.DRUDDIGON, Type.DRAGON, -1, [ - [ Biome.WASTELAND, PoolTier.RARE ], - [ Biome.WASTELAND, PoolTier.BOSS ] + [ Biome.WASTELAND, PoolTier.SUPER_RARE ], + [ Biome.WASTELAND, PoolTier.BOSS_RARE ] ] ], [ Species.GOLETT, Type.GROUND, Type.GHOST, [ @@ -3790,16 +3789,19 @@ const biomePools = { ] ], [ Species.DEINO, Type.DARK, Type.DRAGON, [ - [ Biome.WASTELAND, PoolTier.UNCOMMON ] + [ Biome.WASTELAND, PoolTier.RARE ], + [ Biome.ABYSS, PoolTier.UNCOMMON ] ] ], [ Species.ZWEILOUS, Type.DARK, Type.DRAGON, [ - [ Biome.WASTELAND, PoolTier.UNCOMMON ] + [ Biome.WASTELAND, PoolTier.RARE ], + [ Biome.ABYSS, PoolTier.UNCOMMON ] ] ], [ Species.HYDREIGON, Type.DARK, Type.DRAGON, [ - [ Biome.WASTELAND, PoolTier.UNCOMMON ], - [ Biome.WASTELAND, PoolTier.BOSS ] + [ Biome.WASTELAND, PoolTier.RARE ], + [ Biome.ABYSS, PoolTier.UNCOMMON ], + [ Biome.ABYSS, PoolTier.BOSS ] ] ], [ Species.LARVESTA, Type.BUG, Type.FIRE, [ @@ -3813,17 +3815,23 @@ const biomePools = { ], [ Species.COBALION, Type.STEEL, Type.FIGHTING, [ [ Biome.CAVE, PoolTier.ULTRA_RARE ], - [ Biome.CAVE, PoolTier.BOSS_SUPER_RARE ] + [ Biome.CAVE, PoolTier.BOSS_SUPER_RARE ], + [ Biome.DOJO, PoolTier.ULTRA_RARE ], + [ Biome.DOJO, PoolTier.BOSS_SUPER_RARE ] ] ], [ Species.TERRAKION, Type.ROCK, Type.FIGHTING, [ [ Biome.LAND, PoolTier.ULTRA_RARE ], - [ Biome.LAND, PoolTier.BOSS_SUPER_RARE ] + [ Biome.LAND, PoolTier.BOSS_SUPER_RARE ], + [ Biome.DOJO, PoolTier.ULTRA_RARE ], + [ Biome.DOJO, PoolTier.BOSS_SUPER_RARE ] ] ], [ Species.VIRIZION, Type.GRASS, Type.FIGHTING, [ [ Biome.FOREST, PoolTier.ULTRA_RARE ], - [ Biome.FOREST, PoolTier.BOSS_SUPER_RARE ] + [ Biome.FOREST, PoolTier.BOSS_SUPER_RARE ], + [ Biome.DOJO, PoolTier.ULTRA_RARE ], + [ Biome.DOJO, PoolTier.BOSS_SUPER_RARE ] ] ], [ Species.TORNADUS, Type.FLYING, -1, [ @@ -3855,7 +3863,9 @@ const biomePools = { ], [ Species.KELDEO, Type.WATER, Type.FIGHTING, [ [ Biome.SWAMP, PoolTier.ULTRA_RARE ], - [ Biome.SWAMP, PoolTier.BOSS_SUPER_RARE ] + [ Biome.SWAMP, PoolTier.BOSS_SUPER_RARE ], + [ Biome.DOJO, PoolTier.ULTRA_RARE ], + [ Biome.DOJO, PoolTier.BOSS_SUPER_RARE ] ] ], [ Species.MELOETTA, Type.NORMAL, Type.PSYCHIC, [ @@ -3976,7 +3986,7 @@ const biomePools = { console.log(beautify(output, null, 2, 180).replace(/( | (?:\{ "\d+": \[ )?| "(?:.*?)": \[ |, (?:(?:\{ )?"\d+": \[ )?)"(.*?)"/g, '$1Species.$2').replace(/"(\d+)": /g, '$1: ').replace(/( )"(.*?)"/g, '$1[PoolTier.$2]').replace(/( )"(.*?)"/g, '$1[Biome.$2]')); } - //outputPools(); + outputPools(); /*for (let pokemon of allSpecies) { if (pokemon.speciesId >= Species.XERNEAS) diff --git a/src/modifier.ts b/src/modifier.ts index 680bac31602..9ae12f0cb1e 100644 --- a/src/modifier.ts +++ b/src/modifier.ts @@ -88,7 +88,7 @@ export abstract class Modifier { if (this.stackCount <= 1) return null; - const text = addTextObject(scene, 16, 12, this.stackCount.toString(), TextStyle.PARTY, { fontSize: '66px', color: this.stackCount < this.getMaxStackCount() ? '#484848' : '#e64a18' }); + const text = addTextObject(scene, 16, 12, this.stackCount.toString(), TextStyle.PARTY, { fontSize: '66px', color: this.stackCount < this.getMaxStackCount() ? '#f8f8f8' : '#e64a18' }); text.setStroke('#424242', 16) text.setOrigin(1, 0); @@ -424,7 +424,7 @@ class AllPokemonFullReviveModifierType extends AllPokemonFullHpRestoreModifierTy } } -class ExpBoosterModifierType extends ModifierType { +export class ExpBoosterModifierType extends ModifierType { constructor(name: string, boostPercent: integer, iconImage?: string) { super(name, `Increases gain of EXP. Points by ${boostPercent}%`, () => new ExpBoosterModifier(this, boostPercent), iconImage); } diff --git a/src/pokemon.ts b/src/pokemon.ts index e613feec93b..81a3460821d 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -600,10 +600,16 @@ export class EnemyPokemon extends Pokemon { addToParty() { const party = (this.scene as BattleScene).getParty(); + let ret: PlayerPokemon = null; - if (party.length < 6) - party.push(new PlayerPokemon(this.scene as BattleScene, this.species, this.level, this)); + if (party.length < 6) { + const newPokemon = new PlayerPokemon(this.scene as BattleScene, this.species, this.level, this); + party.push(newPokemon); + ret = newPokemon; + } this.hp = 0; + + return ret; } } diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index e1117e004ac..f9639489723 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -1,13 +1,16 @@ import { CommandPhase } from "../battle-phase"; import BattleScene from "../battle-scene"; import { addTextObject, TextStyle } from "../text"; +import { Type } from "../type"; import { Command } from "./command-ui-handler"; -import BattleMessageUiHandler from "./battle-message-ui-handler"; -import UI, { Mode } from "./ui"; +import { Mode } from "./ui"; import UiHandler from "./uiHandler"; +import * as Utils from "../utils"; export default class FightUiHandler extends UiHandler { private movesContainer: Phaser.GameObjects.Container; + private typeIcon: Phaser.GameObjects.Sprite; + private ppText: Phaser.GameObjects.Text; private cursorObj: Phaser.GameObjects.Image; constructor(scene: BattleScene) { @@ -17,10 +20,17 @@ export default class FightUiHandler extends UiHandler { setup() { const ui = this.getUi(); - const movesContainer = this.scene.add.container(18, -38.7); - ui.add(movesContainer); + this.movesContainer = this.scene.add.container(18, -38.7); + ui.add(this.movesContainer); - this.movesContainer = movesContainer; + this.typeIcon = this.scene.add.sprite((this.scene.game.canvas.width / 6) - 33, -31, 'types', 'unknown'); + this.typeIcon.setVisible(false); + ui.add(this.typeIcon); + + this.ppText = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 18, -15.5, ' / ', TextStyle.WINDOW); + this.ppText.setOrigin(1, 0.5); + this.ppText.setVisible(false); + ui.add(this.ppText); } show(args: any[]) { @@ -29,6 +39,8 @@ export default class FightUiHandler extends UiHandler { const messageHandler = this.getUi().getMessageHandler(); messageHandler.bg.setTexture('bg_fight'); this.setCursor(this.cursor); + this.typeIcon.setVisible(true); + this.ppText.setVisible(true); this.displayMoves(); } @@ -80,6 +92,14 @@ export default class FightUiHandler extends UiHandler { ui.add(this.cursorObj); } + const pokemonMove = (this.scene as BattleScene).getPlayerPokemon().moveset[cursor]; + this.typeIcon.setTexture('types', Type[pokemonMove.getMove().type].toLowerCase()); + + const maxPP = pokemonMove.getMove().pp + pokemonMove.ppUp; + const pp = maxPP - pokemonMove.ppUsed; + + this.ppText.setText(`${Utils.padInt(pp, 2, ' ')}/${Utils.padInt(maxPP, 2, ' ')}`); + this.cursorObj.setPosition(13 + (cursor % 2 === 1 ? 100 : 0), -31 + (cursor >= 2 ? 15 : 0)); return ret; @@ -98,6 +118,8 @@ export default class FightUiHandler extends UiHandler { clear() { super.clear(); this.clearMoves(); + this.typeIcon.setVisible(false); + this.ppText.setVisible(false); this.eraseCursor(); }