@pkmn/engine 0.1.0-dev.eaae4aa6 → 0.1.0-dev.f3aab252
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/LICENSE +0 -2
- package/README.md +15 -11
- package/build/pkg/addon.js +6 -7
- package/build/pkg/addon.js.map +1 -1
- package/build/pkg/data.d.ts +2 -3
- package/build/pkg/index.d.ts +1 -1
- package/build/pkg/index.js.map +1 -1
- package/build/pkg/protocol.js +4 -4
- package/build/pkg/protocol.js.map +1 -1
- package/build/test/display.js +8 -3
- package/build/test/display.js.map +1 -1
- package/build/tools/debug.js +2 -3
- package/build/tools/debug.js.map +1 -1
- package/build.zig +187 -72
- package/package.json +18 -16
- package/src/bin/install-pkmn-engine +17 -7
- package/src/lib/common/array.zig +77 -0
- package/src/lib/common/data.zig +8 -8
- package/src/lib/common/debug.zig +2 -2
- package/src/lib/common/js.zig +4 -2
- package/src/lib/common/optional.zig +13 -9
- package/src/lib/common/options.zig +2 -0
- package/src/lib/common/protocol.zig +51 -44
- package/src/lib/common/rational.zig +114 -24
- package/src/lib/common/rng.zig +10 -10
- package/src/lib/common/util.zig +50 -1
- package/src/lib/gen1/calc.zig +506 -128
- package/src/lib/gen1/chance.zig +383 -276
- package/src/lib/gen1/data/species.zig +1 -1
- package/src/lib/gen1/data.zig +31 -30
- package/src/lib/gen1/helpers.zig +95 -538
- package/src/lib/gen1/mechanics.zig +265 -162
- package/src/lib/gen2/calc.zig +34 -16
- package/src/lib/gen2/chance.zig +90 -502
- package/src/lib/gen2/data.zig +15 -14
- package/src/lib/gen2/helpers.zig +41 -13
- package/src/lib/gen2/mechanics.zig +158 -103
- package/src/lib/pkmn.zig +10 -16
- package/src/test/display/pkmn.html.tmpl +5 -5
- package/src/lib/gen1/README.md +0 -894
- package/src/lib/gen2/README.md +0 -329
package/src/lib/gen2/README.md
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
# Pokémon Generation II: GSC
|
|
2
|
-
|
|
3
|
-
## Data Structures
|
|
4
|
-
|
|
5
|
-
The following information is required to simulate a Generation II Pokémon battle:
|
|
6
|
-
|
|
7
|
-
==**TODO**==
|
|
8
|
-
|
|
9
|
-
| pkmn | Pokémon Crystal (pret) | Pokémon Showdown |
|
|
10
|
-
| ------------------------------ | --------------------------------- | ------------------------------------- |
|
|
11
|
-
| `battle.seed` | `Random{Add,Sub}` | `battle.seed` |
|
|
12
|
-
| `battle.turn` | | `battle.turn` |
|
|
13
|
-
| `field.weather.id` | `BattleWeather` | `field.weather` |
|
|
14
|
-
| `field.weather.duration` | `WeatherCount` | `field.weatherState.duration` |
|
|
15
|
-
| `side.{active,pokemon}` | `BattleMon` | `side.active` |
|
|
16
|
-
| `side.team` | `PartyMons`/`PartySpecies` | `side.pokemon` |
|
|
17
|
-
| `side.conditions` | `PlayerScreens` | `side.sideConditions` |
|
|
18
|
-
| `conditions.data.safeguard` | `PlayerSafeguardCount` | `sideConditions.safeguard.duration` |
|
|
19
|
-
| `conditions.data.light_screen` | `PlayerLightScreenCount` | `sideConditions.lightscreen.duration` |
|
|
20
|
-
| `conditions.data.reflect` | `PlayerReflectCount` | `sideConditions.reflect.duration` |
|
|
21
|
-
| `pokemon.stats` | `TODO unmodified` | `pokemon.baseStoredStats` |
|
|
22
|
-
| `pokemon.position` | `TODO` | `pokemon.position` |
|
|
23
|
-
| `pokemon.moves` | `party_struct.{Moves,PP}` | `pokemon.baseMoveSlots` |
|
|
24
|
-
| `{pokemon,active}.hp` | `{party,battle}_struct.HP` | `pokemon.hp` |
|
|
25
|
-
| `{pokemon,active}.status` | `{party,battle}_struct.Status` | `pokemon.status` |
|
|
26
|
-
| `{pokemon,active}.level` | `TODO unmodified` | `pokemon.level` |
|
|
27
|
-
| `{pokemon,active}.happiness` | `{box,battle}_struct.Happiness` | `pokemon.happiness` |
|
|
28
|
-
| `{pokemon,active}.ivs.gender` | `{box,battle}_struct.DVs` | `pokemon.gender` |
|
|
29
|
-
| `{pokemon,active}.ivs.type` | `{box,battle}_struct.DVs` | `pokemon.hpType` |
|
|
30
|
-
| `{pokemon,active}.ivs.power` | `{box,battle}_struct.DVs` | `pokemon.hpPower` |
|
|
31
|
-
| `{pokemon,active}.item` | `{box,battle}_struct.Item` | `pokemon.item` |
|
|
32
|
-
| `pokemon.species` | `party_struct.Species` | `pokemon.baseSpecies` |
|
|
33
|
-
| `active.species` | `battle_struct.Species` | `pokemon.species` |
|
|
34
|
-
| `active.stats` | `TODO modified` | `pokemon.storedStats` |
|
|
35
|
-
| `active.boosts` | `PlayerStatLevels` | `pokemon.boosts` |
|
|
36
|
-
| `active.volatiles` | `PlayerBattleStatus{1,2,3}` | `pokemon.volatiles` |
|
|
37
|
-
| `volatiles.bide` | `PlayerDamageTaken` | `volatiles.bide.totalDamage` |
|
|
38
|
-
| `volatiles.substitute` | `PlayerSubstituteHP` | `volatiles.substitute.hp` |
|
|
39
|
-
| `volatiles.rollout` | `PlayerRolloutCount` | `volatiles.rollout.hitCount` |
|
|
40
|
-
| `volatiles.confusion` | `PlayerConfuseCount` | `volatiles.confusion.duration` |
|
|
41
|
-
| `volatiles.toxic` | `PlayerToxicCount` | `volatiles.residualdmg.counter` |
|
|
42
|
-
| `volatiles.disable` | `PlayerDisableCount` | `moveSlots.disabled` |
|
|
43
|
-
| `volatiles.encore` | `PlayerEncoreCount` | `volatiles.encore.duration` |
|
|
44
|
-
| `volatiles.perish_song` | `PlayerPerishCount` | `volatiles.perishsong.duration` |
|
|
45
|
-
| `volatiles.fury_cutter` | `PlayerFuryCutterCount` | `volatiles.furycutter.multiplier` |
|
|
46
|
-
| `volatiles.protect` | `PlayerProtectCount` | `volatiles.stall.counter` |
|
|
47
|
-
| `volatiles.future_sight` | `PlayerFutureSight{Damage,Count}` | `slotConditions[i].futuremove` |
|
|
48
|
-
| `volatiles.rage` | `PlayerRageCounter` | **BUG** |
|
|
49
|
-
| `volatiles.bind` | `PlayerWrapCount` | `volatiles.partiallytrapped.duration` |
|
|
50
|
-
| `volatiles.bind_reason` | `PlayerTrappingMove` | `volatiles.effectState.sourceEffect` |
|
|
51
|
-
| | `PlayerCharging` | |
|
|
52
|
-
| `volatiles.switched` | `TODO` | `pokemon.switchFlag` |
|
|
53
|
-
| `volatiles.switching` | `PlayerIsSwitching` | `pokemon.switchFlag` |
|
|
54
|
-
| `volatiles.frozen` | `PlayerJustGotFrozen` | `volatiles.frozen` |
|
|
55
|
-
| | | |
|
|
56
|
-
| `active.last_used_move` | `PlayerUsedMove` | `side.lastMove` |
|
|
57
|
-
|
|
58
|
-
- Pokémon Showdown doesn't implement the correct Generation II RNG and as such its `seed` is
|
|
59
|
-
different
|
|
60
|
-
- `battle.turn` only needs to be tracked to be compatible with the Pokémon Showdown protocol
|
|
61
|
-
- Battle results (win, lose, draw) or request states are communicated via the return code of
|
|
62
|
-
`Battle.update`
|
|
63
|
-
- Nicknames (`BattleMonNick`/`pokemon.name`) aren't handled by the pkmn engine as they're expected
|
|
64
|
-
to be handled by driver code if required
|
|
65
|
-
|
|
66
|
-
==**TODO**==
|
|
67
|
-
|
|
68
|
-
wPlayerMinimized
|
|
69
|
-
|
|
70
|
-
### `Battle` / `Side`
|
|
71
|
-
|
|
72
|
-
`Battle` and `Side` are analogous to the classes of the
|
|
73
|
-
[same](https://github.com/smogon/pokemon-showdown/blob/master/sim/battle.ts)
|
|
74
|
-
[name](https://github.com/smogon/pokemon-showdown/blob/master/sim/side.ts) in Pokémon Showdown and
|
|
75
|
-
store general information about the battle. Unlike in Pokémon Showdown there is a distinction
|
|
76
|
-
between the data structure for the "active" Pokémon and its party members (see below).
|
|
77
|
-
|
|
78
|
-
### `Pokemon` / `ActivePokemon`
|
|
79
|
-
|
|
80
|
-
Similar to the cartridge, to save space different information is stored depending on whether a
|
|
81
|
-
[Pokémon](https://pkmn.cc/bulba/Pok%c3%a9mon_data_structure_%28Generation_II%29) is actively
|
|
82
|
-
participating in battle vs. is switched out (pret's [`battle_struct` vs.
|
|
83
|
-
`party_struct`](https://pkmn.cc/pokecrystal/macros/ram.asm)). In Pokémon Showdown, all the Pokemon
|
|
84
|
-
are represented by the same
|
|
85
|
-
[`Pokemon`](https://github.com/smogon/pokemon-showdown/blob/master/sim/pokemon.ts) class, and static
|
|
86
|
-
party information is saved in fields beginning with "`stored`" or "`base`".
|
|
87
|
-
|
|
88
|
-
==**TODO**==
|
|
89
|
-
|
|
90
|
-
#### `MoveSlot`
|
|
91
|
-
|
|
92
|
-
A `MoveSlot` is a data-type for a `(move, current pp)` pair. A pared down version of Pokémon
|
|
93
|
-
Showdown's `Pokemon#moveSlot`, it also stores data from the cartridge's `battle_struct::Move` macro
|
|
94
|
-
and can be used to replace the `PlayerMove*` data. Move PP is stored as a full byte instead of how
|
|
95
|
-
the cartridge (`battle_struct::PP`) stores it (6 bits for current PP and the remaining 2 bits used
|
|
96
|
-
to store the number of applied PP Ups). PP Up bits don't actually need to be stored on move slot
|
|
97
|
-
as max PP is never relevant in Generation II (the Mystery Berry always increases PP from 0 -> 5).
|
|
98
|
-
|
|
99
|
-
#### `Status`
|
|
100
|
-
|
|
101
|
-
Bitfield representation of a Pokémon's major [status
|
|
102
|
-
condition](https://pkmn.cc/bulba/Status_condition), mirroring how it's stored on the cartridge. A
|
|
103
|
-
value of `0x00` means that the Pokémon isn't affected by any major status, otherwise the lower 3
|
|
104
|
-
bits represent the remaining duration for Sleep. Other status are denoted by the presence of
|
|
105
|
-
individual bits - at most one status should be set at any given time.
|
|
106
|
-
|
|
107
|
-
In Generation I & II, the "badly poisoned" status (Toxic) is instead treated as a volatile (see
|
|
108
|
-
below).
|
|
109
|
-
|
|
110
|
-
#### `Volatile` / `VolatileData`
|
|
111
|
-
|
|
112
|
-
Active Pokémon can have ["volatile" status
|
|
113
|
-
conditions](https://pkmn.cc/bulba/Status_condition#Volatile_status) (called ['sub
|
|
114
|
-
status'](https://pkmn.cc/pokecrystal/constants/battle_constants.asm#L166-L212) bits in pret), all of
|
|
115
|
-
which are boolean flags that are cleared when the Pokémon faints or switches out:
|
|
116
|
-
|
|
117
|
-
| pkmn | Pokémon Crystal (pret) | Pokémon Showdown |
|
|
118
|
-
| ------------- | ----------------------- | ---------------- |
|
|
119
|
-
| `Bide` | `BIDE` | `bide` |
|
|
120
|
-
| `Thrashing` | `RAMPAGE` | `lockedmove` |
|
|
121
|
-
| `Flinch` | `FLINCHED` | `flinch` |
|
|
122
|
-
| `Charging` | `CHARGED` | `twoturnmove` |
|
|
123
|
-
| `Underground` | `UNDERGROUND` | `dig` |
|
|
124
|
-
| `Flying` | `FLYING` | `fly` |
|
|
125
|
-
| `Confusion` | `CONFUSED` | `confusion` |
|
|
126
|
-
| `Mist` | `MIST` | `mist` |
|
|
127
|
-
| `FocusEnergy` | `FOCUS_ENERGY` | `focusenergy` |
|
|
128
|
-
| `Substitute` | `SUBSTITUTE` | `substitute` |
|
|
129
|
-
| `Recharging` | `RECHARGE` | `mustrecharge` |
|
|
130
|
-
| `Rage` | `RAGE` | `rage` |
|
|
131
|
-
| `LeechSeed` | `LEECH_SEED` | `leechseed` |
|
|
132
|
-
| `Toxic` | `TOXIC` | `toxic` |
|
|
133
|
-
| `Transform` | `TRANSFORMED` | `transform` |
|
|
134
|
-
| | | |
|
|
135
|
-
| `Nightmare` | `NIGHTMARE` | `nightmare` |
|
|
136
|
-
| `Cure` | `CURSE` | `curse` |
|
|
137
|
-
| `Protect` | `PROTECT` | `protect` |
|
|
138
|
-
| `Foresight` | `IDENTIFIED` | `foresight` |
|
|
139
|
-
| `PerishSong` | `PERISH` | `perishsong` |
|
|
140
|
-
| `Endure` | `ENDURE` | `endure` |
|
|
141
|
-
| `Rollout` | `ROLLOUT` | `rollout` |
|
|
142
|
-
| `Attract` | `IN_LOVE` | `attract` |
|
|
143
|
-
| `DefenseCurl` | `CURLED` | `defensecurl` |
|
|
144
|
-
| `Encore` | `ENCORED` | `encore` |
|
|
145
|
-
| `LockOn` | `LOCK_ON` | `lockon` |
|
|
146
|
-
| `DestinyBond` | `DESTINY_BOND` | `destinybond` | |
|
|
147
|
-
|
|
148
|
-
==**TODO**==
|
|
149
|
-
|
|
150
|
-
- `IN_LOOP` (beatup)
|
|
151
|
-
|
|
152
|
-
#### `Stats` / `Boosts`
|
|
153
|
-
|
|
154
|
-
[Stats](https://pkmn.cc/bulba/Stat) and [boosts (stat
|
|
155
|
-
modifiers)](https://pkmn.cc/bulba/Stat#Stat_modifiers) are stored logically, with the exception that
|
|
156
|
-
boosts should always range from `-6`...`6` instead of `1`...`13` as on the cartridge.
|
|
157
|
-
|
|
158
|
-
==**TODO**==
|
|
159
|
-
|
|
160
|
-
### `Move` / `Moves`
|
|
161
|
-
|
|
162
|
-
`Moves` serves as an identifier for a unique [Pokémon move](https://pkmn.cc/bulba/Move) that can be
|
|
163
|
-
used to retrieve a `Move` with information regarding base power, accuracy and type. As covered
|
|
164
|
-
earlier, PP information isn't strictly necessary in Generation I, but fits neatly into the 4 bits of
|
|
165
|
-
padding after noticing that all PP values are multiples of 5. `Moves.None` exists as a special
|
|
166
|
-
sentinel value to indicate `null`.
|
|
167
|
-
|
|
168
|
-
### `Species`
|
|
169
|
-
|
|
170
|
-
`Species` just serves as an identifier for a unique [Pokémon
|
|
171
|
-
species](https://pkmn.cc/bulba/Pokémon_species_data_structure_(Generation_II)) as the base
|
|
172
|
-
stats of a species are already accounted for in the computed stats in the `Pokemon` structure and
|
|
173
|
-
nothing in battle requires these to be recomputed. Similarly, Type is unnecessary to include as it
|
|
174
|
-
is also already present in the `Pokemon` struct. `Species.None` exists as a special sentinel value
|
|
175
|
-
to indicate `null`.
|
|
176
|
-
|
|
177
|
-
### `Type` / `Types` / `Effectiveness`
|
|
178
|
-
|
|
179
|
-
The [Pokémon types](https://pkmn.cc/bulba/Type) are enumerated by `Type`. `Types` represents a tuple
|
|
180
|
-
of 2 types, which takes the form of a packed struct instead of `[2]Type` for symmetry with
|
|
181
|
-
Generation I. `Effectiveness` serves as an enum for tracking a moves effectiveness - like the
|
|
182
|
-
cartridge, effectiveness is stored as `0`, `5`, `10`, and `20` (technically only a 4-bit value is
|
|
183
|
-
required, but Zig only allows a minimum of a byte to be stored at each address of an array).
|
|
184
|
-
|
|
185
|
-
Type effectiveness modifiers are applied based off of the ordering of the effectiveness table as
|
|
186
|
-
opposed to first applying modifiers for a species's first type and then second type. The engine
|
|
187
|
-
maintains a `Type.PRECEDENCE` table to allow for reordering type effectiveness modifier application
|
|
188
|
-
where necessary.
|
|
189
|
-
|
|
190
|
-
## Information
|
|
191
|
-
|
|
192
|
-
The information of each field (in terms of [bits of
|
|
193
|
-
entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory))) is as follows:
|
|
194
|
-
|
|
195
|
-
==**TODO**==
|
|
196
|
-
|
|
197
|
-
| Data | Range | Bits | | Data | Range | Bits |
|
|
198
|
-
| -------------- | ------- | ---- | --- | ----------------- | -------- | ---- |
|
|
199
|
-
| **seed** | 0...255 | 8 | | **turn** | 1...1000 | 7 |
|
|
200
|
-
| **team index** | 1...6 | 3 | | **move index** | 1...4 | 2 |
|
|
201
|
-
| **species** | 1...251 | 8 | | **move** | 1...251 | 8 |
|
|
202
|
-
| **stat** | 1...999 | 10 | | **boost** | 0...13 | 4 |
|
|
203
|
-
| **level** | 1...100 | 7 | | **volatiles** | *27* | 27 |
|
|
204
|
-
| **bide** | 0...703 | 11 | | **substitute** | 0...179 | 8 |
|
|
205
|
-
| **multi hits** | 0...5 | 3 | | **base power** | 0...50 | 6 |
|
|
206
|
-
| **base PP** | 1...8 | 3 | | **PP Ups** | 0...3 | 2 |
|
|
207
|
-
| **PP** | 0...64 | 7 | | **HP / damage** | 0...704 | 10 |
|
|
208
|
-
| **status** | 0...10 | 4 | | **effectiveness** | 0...3 | 2 |
|
|
209
|
-
| **type** | 0...18 | 5 | | **accuracy** | 6...20 | 4 |
|
|
210
|
-
| **disabled** | 0...7 | 3 | | **DVs** | 0...15 | 4 |
|
|
211
|
-
| **rollout** | 0...5 | 3 | | **fury cutter** | 0..4 | 3 |
|
|
212
|
-
| **confusion** | 0...5 | 3 | | **toxic** | 0...15 | 4 |
|
|
213
|
-
| **encore** | 0...6 | 3 | | **future sight** | 0...2 | 2 |
|
|
214
|
-
| **protect** | 0...9 | 4 | | **rage** | 0...255 | 8 |
|
|
215
|
-
| **wrap** | 0...5 | 3 | | **perish song** | 0...4 | 3 |
|
|
216
|
-
| **item** | TODO | 5? | | **gender** | 0..1 | 1 |
|
|
217
|
-
|
|
218
|
-
From this one can determine the minimum bits required to store each data structure to determine how
|
|
219
|
-
much overhead the preceding representations have after taking into consideration [alignment &
|
|
220
|
-
padding](https://en.wikipedia.org/wiki/Data_structure_alignment) and
|
|
221
|
-
[denormalization](https://en.wikipedia.org/wiki/Denormalization):
|
|
222
|
-
|
|
223
|
-
## Details
|
|
224
|
-
|
|
225
|
-
| pkmn | Pokémon Crystal (pret) |
|
|
226
|
-
| ------------------------- | ------------------------------------------------- |
|
|
227
|
-
| `start` | `DoBattle` |
|
|
228
|
-
| `update` | `BattleTurn` |
|
|
229
|
-
| `selectMove` / `saveMove` | `CheckPlayerLockedIn` / `ParsePlayerAction` |
|
|
230
|
-
| `switchIn` | `SwitchPlayerMon` / `SendOutPlayerMon` |
|
|
231
|
-
| `turnOrder` | `DetermineMoveOrder` |
|
|
232
|
-
| `doTurn` | `DoTurn` |
|
|
233
|
-
| `executeMove` | `DoMove` |
|
|
234
|
-
| `beforeMove` | `CheckTurn` |
|
|
235
|
-
| `canMove` | |
|
|
236
|
-
| `decrementPP` | |
|
|
237
|
-
| `doMove` | |
|
|
238
|
-
| `checkCriticalHit` | `BattleCommand_Critical` |
|
|
239
|
-
| `calcDamage` | `BattleCommand_DamageCalc` / `PlayerAttackDamage` |
|
|
240
|
-
| `adjustDamage` | `BattleCommand_Stab` |
|
|
241
|
-
| `randomizeDamage` | `BattleCommand_DamageVariation` |
|
|
242
|
-
| `specialDamage` | `BattleCommand_ConstantDamage` |
|
|
243
|
-
| `applyDamage` | `BattleCommand_ApplyDamage` |
|
|
244
|
-
| `checkHit` | `BattleCommand_CheckHit` |
|
|
245
|
-
| `checkFaint` | `CheckFaint` |
|
|
246
|
-
| `handleResidual` | `ResidualDamage` |
|
|
247
|
-
| `endTurn` | `EndTurn` |
|
|
248
|
-
|
|
249
|
-
DoBattle
|
|
250
|
-
BattleTurn
|
|
251
|
-
- HandleBerserkGene
|
|
252
|
-
- CheckPlayerLockedIn
|
|
253
|
-
- BattleMenu
|
|
254
|
-
- ParsePlayerAction
|
|
255
|
-
- DetermineMoveOrder
|
|
256
|
-
- CompareMovePriority
|
|
257
|
-
- GetMovePriority
|
|
258
|
-
- Battle_*
|
|
259
|
-
- Handle*Switch
|
|
260
|
-
- SwitchPlayerMon
|
|
261
|
-
- BreakAttraction
|
|
262
|
-
- SendOutPlayerMon
|
|
263
|
-
- SpikesDamage
|
|
264
|
-
- *Turn_EndOpponentProtectEndureDestinyBond
|
|
265
|
-
- EndUserDestinyBond
|
|
266
|
-
- Do*Turn
|
|
267
|
-
- EndOpponentProtectEndureDestinyBond
|
|
268
|
-
- ResidualDamage
|
|
269
|
-
- CheckFaint_*
|
|
270
|
-
- HandleBetweenTurnEffects
|
|
271
|
-
- HandleFutureSight
|
|
272
|
-
- HandleWeather
|
|
273
|
-
- HandleWrap
|
|
274
|
-
- HandlePerishSong
|
|
275
|
-
- HandleLeftovers
|
|
276
|
-
- HandleMysteryBerry
|
|
277
|
-
- HandleDefrost
|
|
278
|
-
- HandleSafeguard
|
|
279
|
-
- HandleScreens
|
|
280
|
-
- HandleStatBoostingHeldItems
|
|
281
|
-
- HandleHealingItems
|
|
282
|
-
- HandleEncore
|
|
283
|
-
|
|
284
|
-
DoTurn
|
|
285
|
-
DoMove = executeMove
|
|
286
|
-
CheckTurn = beforeMove
|
|
287
|
-
BattleCommand_Critical = checkCriticalHit
|
|
288
|
-
BattleCommand_Stab = adjustDamage
|
|
289
|
-
BattleCommand_DamageVariation = randomizeDamage
|
|
290
|
-
BattleCommand_CheckHit = checkHit
|
|
291
|
-
BattleCommand_ApplyDamage = applyDamage
|
|
292
|
-
BattleCommand_CheckFaint
|
|
293
|
-
BattleCommand_BuildOpponentRage = buildRage
|
|
294
|
-
BattleCommand_DamageCalc (PlayerAttackDamage / EnemyAttackDamage) = calcDamage
|
|
295
|
-
BattleCommand_ConstantDamage = specialDamage
|
|
296
|
-
DoEnemyDamage / DoPlayerDamage / DoSubstituteDamage
|
|
297
|
-
|
|
298
|
-
==**TODO**==
|
|
299
|
-
|
|
300
|
-
## Protocol
|
|
301
|
-
|
|
302
|
-
TODO
|
|
303
|
-
|
|
304
|
-
```txt
|
|
305
|
-
-activate: _, move, name, number
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## Bugs
|
|
309
|
-
|
|
310
|
-
- TODO: randomChance rate different than gen 1?
|
|
311
|
-
- Twineedle shouldn't be able to inflict poison if it breaks a substitute
|
|
312
|
-
- Mail should not be stolen by Thief
|
|
313
|
-
- RNG for crit is 1/16 and not 17/256?
|
|
314
|
-
- Struggle recoil into Substitute only 1 HP
|
|
315
|
-
- Substitute "activates" even though doesnt take damage for jump crash damage
|
|
316
|
-
- Pokémon specific items after Transform
|
|
317
|
-
- OHKO moves that miss should be Counterable
|
|
318
|
-
- Defense lowering after breaking Substitute glitch
|
|
319
|
-
- Beserk Gene copies previous mons confusion counter
|
|
320
|
-
- Type boosting items w/ Confusion self-hit
|
|
321
|
-
- Spikes 0 HP glitch
|
|
322
|
-
- PP Up + Disable freeze
|
|
323
|
-
- Beat Up partyless should fail but should still be able to trigger Kings Rock
|
|
324
|
-
- Beat Up desync
|
|
325
|
-
- Lock-on accuracy should be 100 not true, should be passed
|
|
326
|
-
- Pain Split 100 accuracy not true
|
|
327
|
-
- Foresight ignoring accuracy/evasiveness stages
|
|
328
|
-
- Disable duration?
|
|
329
|
-
- type effectiveness precedence
|