@pkmn/engine 0.1.0-dev.53335a32 → 0.1.0-dev.545e0ef3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/gen1/README.md +14 -18
- package/src/lib/gen1/mechanics.zig +4 -2
package/package.json
CHANGED
package/src/lib/gen1/README.md
CHANGED
|
@@ -467,7 +467,7 @@ Documentation of the wire protocol used for logging traces when `-Dtrace` is ena
|
|
|
467
467
|
|
|
468
468
|
In addition to its alternative [RNG semantics](#rng), Pokémon Showdown's implementation of the first
|
|
469
469
|
generation of Pokémon contains a number bugs, [many of which are known and have been documented on
|
|
470
|
-
Smogon](https://www.smogon.com/forums/
|
|
470
|
+
Smogon](https://www.smogon.com/forums/posts/5933177/show):
|
|
471
471
|
|
|
472
472
|
- moves on Pokémon Showdown can do 0 damage instead of failing or causing a [division-by-zero
|
|
473
473
|
freeze](https://pkmn.cc/bulba-glitch-1#Division_by_0).
|
|
@@ -554,7 +554,7 @@ called out in the `|rule|` section at the beginning of a battle's log):
|
|
|
554
554
|
`|rule|` section** in Generation I (or II) as the actual order of switches here does not have
|
|
555
555
|
competitive implications like it does in Generation III, but it is still contrary to how the games
|
|
556
556
|
work where the [host (Player 1)'s Pokemon would switch
|
|
557
|
-
first](https://www.smogon.com/forums/
|
|
557
|
+
first](https://www.smogon.com/forums/posts/5989318/show).
|
|
558
558
|
|
|
559
559
|
Pokémon Showdown enforces several clauses *before* the battle: **Cleric Clause** (all Pokémon must
|
|
560
560
|
have full HP and PP, and not have any status conditions prior to the battle), **Stat Tradeback
|
|
@@ -575,13 +575,12 @@ left up to a client to support.
|
|
|
575
575
|
|
|
576
576
|
Numerous moves on Pokémon Showdown are broken not simply due to local issues in the implementation
|
|
577
577
|
of their effects but instead due to **global issues** related to fundamental mechanics such as
|
|
578
|
-
[broken move
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
changes or dramatically deviating from the correct control flow):
|
|
578
|
+
[broken move selection](https://www.smogon.com/forums/posts/8655897/show), using move name instead
|
|
579
|
+
of slot to determine move identity, implementing volatile statuses incorrectly or not understanding
|
|
580
|
+
how moves which call other moves work means that it isn't possible to completely implement Pokémon
|
|
581
|
+
Showdown's behavior for the following moves (the pkmn engine attempts to reproduce as much of the
|
|
582
|
+
behavior that can be reproduced without making data structure changes or dramatically deviating from
|
|
583
|
+
the correct control flow):
|
|
585
584
|
|
|
586
585
|
- **Wrap**: Binding moves like Wrap are implemented on Pokémon Showdown with an artificial
|
|
587
586
|
`partialtrappinglock` volatile as opposed to how it works on the cartridge which simply relies on
|
|
@@ -670,10 +669,10 @@ compatibility mode, the implications of these differences are outlined below:
|
|
|
670
669
|
Finally, the **initial 10-byte seed for link battles on Pokémon Red cannot include bytes larger than
|
|
671
670
|
the `SERIAL_PREAMBLE_BYTE`**, so must be in the range $\left[0, 252\right]$. This has implications
|
|
672
671
|
on the first 10 random numbers generated during the battle and has [**non-trivial competitive
|
|
673
|
-
implications**](https://www.smogon.com/forums/
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
672
|
+
implications**](https://www.smogon.com/forums/posts/9068411/show) (at the start of the battle move
|
|
673
|
+
effects become more likely, the ["1/256-miss" glitch](https://glitchcity.wiki/1/256_miss_glitch)
|
|
674
|
+
cannot happen, Player 1 is more likely to win speed ties, etc) that Pokémon Showdown cannot
|
|
675
|
+
replicate due to everything described above.
|
|
677
676
|
|
|
678
677
|
All of places in the link battle code where randomness is required are outlined below:
|
|
679
678
|
|
|
@@ -772,11 +771,8 @@ The pkmn engine attempts to adhere to certain naming conventions:
|
|
|
772
771
|
## Resources
|
|
773
772
|
|
|
774
773
|
- [pret/pokered](https://github.com/pret/pokered/) disassembly
|
|
775
|
-
- [Gen I Main Battle
|
|
776
|
-
Function](https://www.smogon.com/forums/threads/past-gens-research-thread.3506992/#post-5878612) -
|
|
777
|
-
Crystal_
|
|
774
|
+
- [Gen I Main Battle Function](https://www.smogon.com/forums/posts/5878612/show) - Crystal_
|
|
778
775
|
- [Pokemon Showdown!](https://github.com/smogon/pokemon-showdown)
|
|
779
776
|
- [List of glitches (Generation
|
|
780
777
|
I)](https://bulbapedia.bulbagarden.net/wiki/List_of_glitches_(Generation_I))
|
|
781
|
-
- [Pokémon Showdown RBY
|
|
782
|
-
Bugs](https://www.smogon.com/forums/threads/rby-tradebacks-bug-report-thread.3524844/#post-5933177)
|
|
778
|
+
- [Pokémon Showdown RBY Bugs](https://www.smogon.com/forums/posts/5933177/show)
|
|
@@ -2758,8 +2758,10 @@ pub fn choices(battle: anytype, player: Player, request: Choice.Type, out: []Cho
|
|
|
2758
2758
|
const m = active.moves[slot - 1];
|
|
2759
2759
|
if (m.id == .None) break;
|
|
2760
2760
|
if (m.id == side.last_selected_move) {
|
|
2761
|
-
// Pokémon Showdown displays Struggle if limited to Bide
|
|
2762
|
-
const
|
|
2761
|
+
// Pokémon Showdown displays Struggle if limited to Bide but unable to pick
|
|
2762
|
+
const struggle =
|
|
2763
|
+
m.id == .Bide and (m.pp == 0 or active.volatiles.disabled_move == slot);
|
|
2764
|
+
const s = if (struggle) 0 else slot;
|
|
2763
2765
|
out[n] = .{ .type = .Move, .data = s };
|
|
2764
2766
|
n += 1;
|
|
2765
2767
|
return n;
|