From 105b5cd510b3146a6f84a0381b1d4ec4b61c2304 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 1 Jun 2023 13:54:52 -0400 Subject: [PATCH] Fix some bugs and add factory bg --- public/images/arenas/factory_a.png | Bin 0 -> 858 bytes public/images/arenas/factory_b.png | Bin 0 -> 1613 bytes public/images/arenas/factory_b_1.png | Bin 0 -> 713 bytes public/images/arenas/factory_b_2.png | Bin 0 -> 596 bytes public/images/arenas/factory_b_3.png | Bin 0 -> 756 bytes public/images/arenas/factory_bg.png | Bin 0 -> 634 bytes public/images/items.json | 2 +- .../{lum_berry,png.png => lum_berry.png} | Bin src/arena.ts | 3 +- src/battle-phases.ts | 30 +++++++----------- src/data/ability.ts | 2 +- src/modifier/modifier.ts | 13 ++++++++ 12 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 public/images/arenas/factory_a.png create mode 100644 public/images/arenas/factory_b.png create mode 100644 public/images/arenas/factory_b_1.png create mode 100644 public/images/arenas/factory_b_2.png create mode 100644 public/images/arenas/factory_b_3.png create mode 100644 public/images/arenas/factory_bg.png rename public/images/items/{lum_berry,png.png => lum_berry.png} (100%) diff --git a/public/images/arenas/factory_a.png b/public/images/arenas/factory_a.png new file mode 100644 index 0000000000000000000000000000000000000000..7752f08e93898e8f11fbd76ad777599abbee018b GIT binary patch literal 858 zcmeAS@N?(olHy`uVBq!ia0y~yU~~YoTR7N&5jgR z3=A9lx&I`xGB7Z`@^ov+TCp9l04le_u`a z=F`HiYDc%;+);WYuef-#OnQ3yX~W2fh>p!wZ{NHT@%HvE488lie0_KH&9%Au>gwu8 z&tJY=bnoAT#sFJ$-gA9S74XcMxZ^~$3HmcZNGi=)G4pEjog9K+iYgZ&(80D z`SRrsD}5LJ6aDS?@8;dne!kqWgPooI=%-IbmiO=7(>w0iQY=w-WI~{6q4Z|2FQ0C( z78e&kl`xroHYqt-dEG0)N7pk<9%We^x_`Iw>W#NvACAxeT>Si9^QVXjea{(r4%s)J z`&>{_5z+VZTipbWF2%(eNoJ2i@7w7b0*U@#s9VZNy{Aj(tUc2RIc4>F~B&X>u zKb{_%nsh@0#S47><*n zF+cxyYkhpJ#r!G;ZsKo!xKl(hp)fc=-PUpUO#VA-N)*$ zk0R&H-DznW+V@@FR`a-HPt+f)tx>v)DJs2pmr1+*XsX-Z-&`~M*4v+v>woO6{Q2jQ zzQ!TrUG4qzk6k_LW?N^en6gFWX#Ngq4QZ|4#tVT-lrJ^HGtJkRK?}&{fF{{X!IMEO MPgg&ebxsLQ08g7zD*ylh literal 0 HcmV?d00001 diff --git a/public/images/arenas/factory_b.png b/public/images/arenas/factory_b.png new file mode 100644 index 0000000000000000000000000000000000000000..eea4397eac63877b64f2222ce3be872057b49c28 GIT binary patch literal 1613 zcmb_c`#aMM82?si(P}!&)D*3oV@588h=!RRAtKjpZs9r6o~FocB-dn|JljqQ6~`lL z8d`0_5nJU}+0j(mj_nLPO>?Uai?g2R`~~MZ?+@?i^ZxLDKJPD|x8$TB7OcNh9{>O_ z&f7B(0M;GX@_dkq0Fu?mpH1xEY_b@|OHD|qe%IlwN{_l>H_cRSQFEpS2S1~}o-1qg z-aR2L1QfQEb@9_%vb|zaE?9lVe$f*rcp;^4On!6ztk3S3S(ew^Qf^Pvpd9F<;IfE_ zKx4salOiYM`}eJ4(xzYEAz#45The9yv>2tRQ%11+z)nVDg}aVrw3`h1Lxr2nkax<) zX1b=BlGUQGU=*w)bxy)#HL_*T3Jhe^To<~p2Pdq~JlFC;F(IFcQy|C_><=Wj41V(p#C=_y$KbZEhPI~x$+gOXgv?+xRXxL1ipVYD3?I>JFO3(T zd*R;Lqq8CB6=So5hr?tLeKP~C*@K94C~R9tj?zQc7~!_2&UR`#4ePFN2BjKyN9I2y z*=ePt8+a}9Ysz?pt-pEKszgvSFdG(6;hb@t3XzR-z8Ih{O7v4`!KJr>RtS7Ycd-W- zvGO&7Byz;UV8{_im(@S)WQpVTz>zX>Yt2Hb`Y?xR^BL`OUgF7dNTMOkb1$3=*K9F$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#G2>l)?3p^2^IyWn8C&Fx8tyOObN`TfMd@bNHrb9J zu0M?G1noYqp3f;zCBegX`-igf6ETZr`zCzsF1~23$HZY5jgR z3=A9lx&I`xGB7Z;c)B=-RK&f#X`3D5D8lyOBeU`%y>5Yk>c>r6GXxYnmQ9!tbyR*q zM8xjah&5YVU+4#9Z|qWHoamAx+`*OPU?MS*MO0dOV)0J%J2_?DTQ;9(K78iQnQi*d z?|1@jqZ)8nRyM`hK;fLf&${WS4|S*evzxKAD5R|6+O72@ss8b;uU|f2e}7|HGyAvY zzxm~JtokbhoB|n~maW>rEm*Wru5PLpi}T-q3M~s5T6jvst8QP7m3-#K;FPw?Y+LD` zspooobF<2=%dL-EnanzyWOpTFNw@IiqgF@uPQQFP^Wj~mjpr>{SQS#1-22v6_fY&5 zqr@x4h?9GT?nIt*a8vs6YwP~{Y1fY>>+Jm>*YoMQuF{{P` zC~4O0`QF;AS8IM-J8`0k$(HnFmm62lKd!6!etPdO?tP3-%U<1QUcJrY+eeR}@YdKh zufG@b?^j?*JaELjaHr0bUx&D<61%r2U#kBn@w5K3h>aJ}K)%!n&op0O1}z|)18Tvg Q;K?ACr>mdKI;Vst09PFr+W-In literal 0 HcmV?d00001 diff --git a/public/images/arenas/factory_bg.png b/public/images/arenas/factory_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..17fee13763e25d59e748df37fd21e63d77ffa2b3 GIT binary patch literal 634 zcmeAS@N?(olHy`uVBq!ia0y~yU~~YoTR7N&5jgR z3=A9lx&I`xGB7Z4dAc};RK&f#yHN0u1B2^9>nbi?g9HN!HYKG?Onj~n6J9)eD`i#j zS$(=pajo4xW`!3Y{;Gr?4y z)-;%q%E%PS#F0|T%XVTD(1dmchiR-FDVz!uR2v+oF@WU=ajx0ub^m5)RN)3&eR}E- zuo0FljGJ`OU9#@>I}r&Fphasc_ukcYP&f&93vTCwWUePNMuMDgr2}(*5eHLBB+!Y@ z0$>pvW)>vdp1uD2kw*YzkIwP~_&j9S$_&zWdU*j@RV5n-*wA#K!N5>}anXYzu7wS( ztNQ{zvw@*XDC95#xcF{aeGi`s&|_C5?6>YRH)GaW-v>-3e5nzhX}-P;T0k}j5QD&_ Q;K?A$)78&qol`;+0B7yB&j0`b literal 0 HcmV?d00001 diff --git a/public/images/items.json b/public/images/items.json index ed1e66698..133dd23ef 100644 --- a/public/images/items.json +++ b/public/images/items.json @@ -2194,7 +2194,7 @@ } }, { - "filename": "lum_berry,png", + "filename": "lum_berry", "rotated": false, "trimmed": true, "sourceSize": { diff --git a/public/images/items/lum_berry,png.png b/public/images/items/lum_berry.png similarity index 100% rename from public/images/items/lum_berry,png.png rename to public/images/items/lum_berry.png diff --git a/src/arena.ts b/src/arena.ts index 001002b54..d5f3d4f8c 100644 --- a/src/arena.ts +++ b/src/arena.ts @@ -316,8 +316,6 @@ export function getBiomeKey(biome: Biome): string { return 'wasteland'; case Biome.POWER_PLANT: return 'ruins'; - case Biome.FACTORY: - return 'wasteland'; case Biome.END: return 'wasteland'; } @@ -337,6 +335,7 @@ export function getBiomeHasProps(biomeType: Biome): boolean { case Biome.MEADOW: case Biome.VOLCANO: case Biome.GRAVEYARD: + case Biome.FACTORY: case Biome.WASTELAND: return true; } diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 51130b7fd..7c101f729 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -738,26 +738,17 @@ export class TurnInitPhase extends FieldPhase { start() { super.start(); - this.scene.getPlayerField().forEach(playerPokemon => { - if (playerPokemon.isActive()) - this.scene.currentBattle.addParticipant(playerPokemon); + this.scene.getField().forEach((pokemon, i) => { + if (pokemon?.isActive()) { + if (pokemon.isPlayer()) + this.scene.currentBattle.addParticipant(pokemon as PlayerPokemon); - playerPokemon.resetTurnData(); + pokemon.resetTurnData(); + + this.scene.pushPhase(pokemon.isPlayer() ? new CommandPhase(this.scene, i) : new EnemyCommandPhase(this.scene, i - BattlerIndex.ENEMY)); + } }); - this.scene.getEnemyField().forEach(enemyPokemon => { - if (enemyPokemon.isActive()) - enemyPokemon.resetTurnData() - }); - - const order = this.getOrder(); - for (let o of order) { - if (o < BattlerIndex.ENEMY) - this.scene.pushPhase(new CommandPhase(this.scene, o)); - else - this.scene.pushPhase(new EnemyCommandPhase(this.scene, o - BattlerIndex.ENEMY)); - } - this.scene.pushPhase(new TurnStartPhase(this.scene)); this.end(); @@ -2392,7 +2383,10 @@ export class AttemptRunPhase extends PokemonPhase { ease: 'Sine.easeIn' }); - enemyField.forEach(enemyPokemon => enemyPokemon.hp = 0); + enemyField.forEach(enemyPokemon => { + enemyPokemon.hideInfo(); + enemyPokemon.hp = 0; + }); this.scene.pushPhase(new BattleEndPhase(this.scene)); this.scene.pushPhase(new NewBattlePhase(this.scene)); diff --git a/src/data/ability.ts b/src/data/ability.ts index 2f20204e2..53f02ae71 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1224,7 +1224,7 @@ export function initAbilities() { new Ability(Abilities.FLAME_BODY, "Flame Body", "Contact with the POKéMON may burn the attacker.", 3) .attr(PostDefendContactApplyStatusEffectAbAttr, 30, StatusEffect.BURN), new Ability(Abilities.FLASH_FIRE, "Flash Fire", "It powers up FIRE-type moves if it's hit by one.", 3) - .attr(TypeImmunityAddBattlerTagAbAttr, Type.FIRE, 1, BattlerTagType.FIRE_BOOST, (pokemon: Pokemon) => !pokemon.status || pokemon.status.effect !== StatusEffect.FREEZE), + .attr(TypeImmunityAddBattlerTagAbAttr, Type.FIRE, BattlerTagType.FIRE_BOOST, 1, (pokemon: Pokemon) => !pokemon.status || pokemon.status.effect !== StatusEffect.FREEZE), new Ability(Abilities.FORECAST, "Forecast (N)", "Castform transforms with the weather.", 3), new Ability(Abilities.GUTS, "Guts (N)", "Boosts ATTACK if there is a status problem.", 3), new Ability(Abilities.HUGE_POWER, "Huge Power", "Raises the POKéMON's ATTACK stat.", 3) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 8a9a2245d..725e91110 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -225,6 +225,12 @@ export class DoubleBattleChanceBoosterModifier extends LapsingPersistentModifier super(type, battlesLeft, stackCount); } + match(modifier: Modifier): boolean { + if (modifier instanceof DoubleBattleChanceBoosterModifier) + return (modifier as DoubleBattleChanceBoosterModifier).battlesLeft === this.battlesLeft; + return false; + } + clone(): TempBattleStatBoosterModifier { return new TempBattleStatBoosterModifier(this.type as ModifierTypes.TempBattleStatBoosterModifierType, this.battlesLeft, this.stackCount); } @@ -250,6 +256,13 @@ export class TempBattleStatBoosterModifier extends LapsingPersistentModifier { this.tempBattleStat = tempBattleStat; } + match(modifier: Modifier): boolean { + if (modifier instanceof TempBattleStatBoosterModifier) + return (modifier as TempBattleStatBoosterModifier).tempBattleStat === this.tempBattleStat + && (modifier as TempBattleStatBoosterModifier).battlesLeft === this.battlesLeft; + return false; + } + clone(): TempBattleStatBoosterModifier { return new TempBattleStatBoosterModifier(this.type as ModifierTypes.TempBattleStatBoosterModifierType, this.tempBattleStat, this.battlesLeft, this.stackCount); }