Move data structure (Generation III): Difference between revisions
Elaborate flags |
mNo edit summary |
||
(16 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
Each [[move]] in [[Pokémon Ruby and Sapphire Versions|Pokémon Ruby, Sapphire]], [[Pokémon FireRed and LeafGreen Versions|FireRed, LeafGreen]], and [[Pokémon Emerald Version|Emerald]] has a 12-byte data structure associated with it. All values except for [[#Priority| ''priority'']] are unsigned integers. | |||
{| align="center" style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em;" cellspacing="1" | ==Notes== | ||
{| align="center" style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; float: right; margin-right: 5px" cellspacing="1" | |||
|- | |- | ||
! colspan=" | ! colspan="3" style="text-align: center; background: #ccf;" | '''Move Data''' | ||
|- | |- | ||
| | ! || size<br>(bytes) || offset<br>(decimal) | ||
|- | |- | ||
| [[ | | [[Additional_effect|Effect]] || 1 || 0 | ||
|- | |- | ||
| [[ | | [[power|Base Power]] || 1 || 1 | ||
|- | |- | ||
| [[ | | [[Type#List of types|Type]] || 1 || 2 | ||
|- | |- | ||
| [[ | | [[Accuracy]] || 1 || 3 | ||
|- | |- | ||
| | | [[PP]] || 1 || 4 | ||
|- | |- | ||
| | | Effect accuracy || 1 || 5 | ||
|- | |- | ||
| | | Affects whom || 1 || 6 | ||
|- | |- | ||
| | | [[Priority]] || 1 || 7 | ||
|- | |- | ||
| Padding || 3 | | Flags || 1 || 8 | ||
|- | |||
| [[wp:Data_structure_alignment#Data_structure_padding|Padding]] || 3 || 9 | |||
|} | |} | ||
===Effect=== | |||
# | Index used internally to uniquely identify each possible [[Additional effect|effect]] (see [[#Links|battle_move_effects.h]] for labels). | ||
===Accuracy=== | |||
Determines the move's [[accuracy]]. Divide this value by 100 to get the actual accuracy of the move. In [[Generation I]], this value was 0-255 and divided by 256, which explains why sometimes attacks like {{M|Swift}} missed. This no longer happens in [[Generation III]]. This value is also set to 0 to reach 100% accuracy. | |||
===Effect accuracy=== | |||
Determines probability that the [[additional_effect|effect]] associated with a given move will happen. Divide this value by 100 to get the actual effect's accuracy. So that, for instance, a value of 100 gives the player 100% chances for the effect to trigger. For yet-unknown reasons, some moves have this value set to 0 which results in 100% accuracy as well. | |||
===Affects whom=== | |||
Determines who the move will hit on a 2 on 2 battle. It can be selected target, user, both foes, random foe, both foes and partner, field, opponent field (Spikes) and last opponent who moved. The following table indicates which value matches a certain target type. | |||
{| align="center" style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; margin: 0 0 0.5em 0.5em" cellspacing="1" | |||
{| align="center" style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em;" cellspacing="1" | |||
|- | |- | ||
| 0x00 || Selected target | | 0x00 || Selected target | ||
Line 58: | Line 57: | ||
|} | |} | ||
Please note that it is theoretically possible to combine those values. For example, the player could have a move with this value set to 0x18. This would mean it would affect everyone except partner. But, no move seems to use such a combination in the games. Also, the special case 0x01 has a different target depending on the move. Counter targets the last attacker, while Metronome could target anything. | Please note that it is theoretically possible to combine those values. For example, the player could have a move with this value set to 0x18. This would mean it would affect everyone except the partner. But, no move seems to use such a combination in the games. Also, the special case 0x01 has a different target depending on the move. Counter targets the last attacker, while Metronome could target anything. | ||
===Priority=== | |||
Determines the moves [[priority]]. For example, {{M|ExtremeSpeed}} is faster than most other moves. This byte is signed, i.e. this value can be either positive or negative. If it is strictly less than 0x80 (128), then the player got the actual value. If not, the actual value equals: -1 * (256 - Current Value). Thus, value 0xFE (254) must be treated as -2 instead. | |||
===Flags=== | |||
<code>--fedcba</code> | Determines additional properties of the move: <code inline>--fedcba</code> | ||
**'''a''' - This moves makes [[contact]] with the target. | **'''a''' - This moves makes [[contact]] with the target. | ||
**'''b''' - This move is affected by {{m|Protect}}. | **'''b''' - This move is affected by {{m|Protect}}. | ||
**'''c''' - This move is affected by {{m|Magic Coat}}. | **'''c''' - This move is affected by {{m|Magic Coat}}. | ||
**'''d''' - This move is affected by {{m|Snatch}} | **'''d''' - This move is affected by {{m|Snatch}}. | ||
**'''e''' - This move may be used with {{m|Mirror Move}} | **'''e''' - This move may be used with {{m|Mirror Move}} | ||
**'''f''' - This move is affected by the effects of [[King's Rock]]. The flinch effect is considered an additional effect for the purposes of {{a|Shield Dust}}, but not {{a|Serene Grace}}. | **'''f''' - This move is affected by the effects of [[King's Rock]]. The flinch effect is considered an additional effect for the purposes of {{a|Shield Dust}}, but not {{a|Serene Grace}}. | ||
*** Flags '''c''' and '''d''' are mutually exclusive. | |||
===Padding=== | |||
Consists of a sequence of 3 bytes to [[wp:Data_structure_alignment#Data_structure_padding|fill extra space]] (likely to pad out the structure to a multiple of 4). Each one of those bytes should be set to 0x00. | |||
==Storage== | |||
===Data location=== | |||
Move structures are stored at the following offsets in the GBA's RAM, according to the [[List of moves|move's index]] (starting at index 0). | |||
{| style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; border-spacing: 0 30px; margin: 0 0 0.5em 0.5em" cellpadding=2 | |||
! Game || Address | |||
|- | |||
| '''{{color2|{{ruby color}}|Pokémon Ruby and Sapphire Versions|Ruby}}'''<sup>US</sup> || 0x081FB12C | |||
|- | |||
| '''{{color2|{{sapphire color}}|Pokémon Ruby and Sapphire Versions|Sapphire}}'''<sup>US</sup> || 0x081FB0BC | |||
|- | |||
| '''{{color2|{{emerald color}}|Pokémon Emerald Version|Emerald}}'''<sup>US,EUR</sup> || 0x0831C898 | |||
|- | |||
| '''{{color2|{{firered color}}|Pokémon FireRed and LeafGreen Versions|FireRed}}'''<sup>US,EUR</sup> || 0x08250C04 | |||
|- | |||
| '''{{color2|{{leafgreen color}}|Pokémon FireRed and LeafGreen Versions|LeafGreen}}'''<sup>US,EUR</sup> || 0x08250BE0 | |||
|} | |||
==Fingerprint== | ===Fingerprint=== | ||
<pre> | <pre> | ||
Line 89: | Line 106: | ||
</pre> | </pre> | ||
==Links== | |||
* [https://github.com/pret/pokeemerald/blob/master/include/constants/battle_move_effects.h battle_move_effects.h | pokeemerald decomp] | |||
==Related articles== | |||
{{data structure}} | {{data structure}} | ||
{{Project Games notice|data structure}} | {{Project Games notice|data structure}} |
Latest revision as of 01:23, 1 February 2025
Each move in Pokémon Ruby, Sapphire, FireRed, LeafGreen, and Emerald has a 12-byte data structure associated with it. All values except for priority are unsigned integers.
Notes
Move Data | ||
---|---|---|
size (bytes) |
offset (decimal) | |
Effect | 1 | 0 |
Base Power | 1 | 1 |
Type | 1 | 2 |
Accuracy | 1 | 3 |
PP | 1 | 4 |
Effect accuracy | 1 | 5 |
Affects whom | 1 | 6 |
Priority | 1 | 7 |
Flags | 1 | 8 |
Padding | 3 | 9 |
Effect
Index used internally to uniquely identify each possible effect (see battle_move_effects.h for labels).
Accuracy
Determines the move's accuracy. Divide this value by 100 to get the actual accuracy of the move. In Generation I, this value was 0-255 and divided by 256, which explains why sometimes attacks like Swift missed. This no longer happens in Generation III. This value is also set to 0 to reach 100% accuracy.
Effect accuracy
Determines probability that the effect associated with a given move will happen. Divide this value by 100 to get the actual effect's accuracy. So that, for instance, a value of 100 gives the player 100% chances for the effect to trigger. For yet-unknown reasons, some moves have this value set to 0 which results in 100% accuracy as well.
Affects whom
Determines who the move will hit on a 2 on 2 battle. It can be selected target, user, both foes, random foe, both foes and partner, field, opponent field (Spikes) and last opponent who moved. The following table indicates which value matches a certain target type.
0x00 | Selected target |
0x01 | Depends on the attack |
0x02 | Unused |
0x04 | Random target |
0x08 | Both foes |
0x10 | User |
0x20 | Both foes and partner |
0x40 | Opponent field |
Please note that it is theoretically possible to combine those values. For example, the player could have a move with this value set to 0x18. This would mean it would affect everyone except the partner. But, no move seems to use such a combination in the games. Also, the special case 0x01 has a different target depending on the move. Counter targets the last attacker, while Metronome could target anything.
Priority
Determines the moves priority. For example, ExtremeSpeed is faster than most other moves. This byte is signed, i.e. this value can be either positive or negative. If it is strictly less than 0x80 (128), then the player got the actual value. If not, the actual value equals: -1 * (256 - Current Value). Thus, value 0xFE (254) must be treated as -2 instead.
Flags
Determines additional properties of the move: --fedcba
- a - This moves makes contact with the target.
- b - This move is affected by Protect.
- c - This move is affected by Magic Coat.
- d - This move is affected by Snatch.
- e - This move may be used with Mirror Move
- f - This move is affected by the effects of King's Rock. The flinch effect is considered an additional effect for the purposes of Shield Dust, but not Serene Grace.
- Flags c and d are mutually exclusive.
Padding
Consists of a sequence of 3 bytes to fill extra space (likely to pad out the structure to a multiple of 4). Each one of those bytes should be set to 0x00.
Storage
Data location
Move structures are stored at the following offsets in the GBA's RAM, according to the move's index (starting at index 0).
Game | Address |
---|---|
RubyUS | 0x081FB12C |
SapphireUS | 0x081FB0BC |
EmeraldUS,EUR | 0x0831C898 |
FireRedUS,EUR | 0x08250C04 |
LeafGreenUS,EUR | 0x08250BE0 |
Fingerprint
00 00 00 00 00 00 00 00 00 00 00 00 // - (used for unknown moves) 00 28 00 64 23 00 00 00 33 00 00 00 // POUND 2B 32 01 64 19 00 00 00 33 00 00 00 // KARATE CHOP 1D 0F 00 55 0A 00 00 00 33 00 00 00 // DOUBLESLAP 1D 12 00 55 0F 00 00 00 33 00 00 00 // COMET PUNCH 00 50 00 55 14 00 00 00 33 00 00 00 // MEGA PUNCH 22 28 00 64 14 64 00 00 32 00 00 00 // PAY DAY 04 4B 0A 64 0F 0A 00 00 13 00 00 00 // FIRE PUNCH 05 4B 0F 64 0F 0A 00 00 13 00 00 00 // ICE PUNCH 06 4B 0D 64 0F 0A 00 00 13 00 00 00 // THUNDERPUNCH ...
Links
Related articles
|
![]() |
This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games. |