Move data structure (Generation III): Difference between revisions
From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (→Format) |
Kyoufu Kawa (talk | contribs) (Slight edit to "affects whom" table) |
||
Line 44: | Line 44: | ||
| 0x00 || Selected target | | 0x00 || Selected target | ||
|- | |- | ||
| 0x01 || | | 0x01 || Depends on the attack | ||
|- | |- | ||
| 0x02 || Unused | | 0x02 || Unused | ||
|- | |- | ||
| 0x04 || Random target | | 0x04 || Random target | ||
Line 57: | Line 57: | ||
|- | |- | ||
| 0x40 || Opponent field | | 0x40 || Opponent field | ||
|} | |} | ||
Please note that it is theorically possible to combine those values. For example, you 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. | Please note that it is theorically possible to combine those values. For example, you 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. | ||
* '''Priority''' determines the moves speed, for example {{M|ExtremeSpeed}} is faster than any other move. This byte is signed, i.e. this value can be either positive or negative. If it is stricly less than 0x80 (128) then you got the actual value. If not, the actual value equals: -1 * (256 - Current Value). Thus, value 0xFE (254) must be treated as -2 instead. | * '''Priority''' determines the moves speed, for example {{M|ExtremeSpeed}} is faster than any other move. This byte is signed, i.e. this value can be either positive or negative. If it is stricly less than 0x80 (128) then you got the actual value. If not, the actual value equals: -1 * (256 - Current Value). Thus, value 0xFE (254) must be treated as -2 instead. | ||
* '''Contact''' determines whether there is physical contact during the attack or not, for determining effects of certain [[abilities]] such as {{A|Static}} and {{A|Rough Skin}}. This byte also determines whether this move is affected by items such as King's Rock or Brightpowder. | * '''Contact''' determines whether there is physical contact during the attack or not, for determining effects of certain [[abilities]] such as {{A|Static}} and {{A|Rough Skin}}. This byte also determines whether this move is affected by items such as King's Rock or Brightpowder. |
Revision as of 17:17, 13 September 2007
Format
Every move in Ruby, Sapphire, FireRed, LeafGreen, and Emerald has a 12-byte data structure.
Move Data | |
---|---|
Effect | byte |
Base power | byte |
Type | byte |
Accuracy | byte |
PP | byte |
Effect accuracy | byte |
Affects whom | byte |
Priority | byte |
Contact | byte |
Padding | 3 bytes |
Notes:
- All numbers are to be treated as unsigned unless otherwise specified.
- Numbers prefixed with "0x", "$" or suffixed with "h" are hexadecimal.
- Numbers prefixed with "0" are octal.
- Numbers with no specific prefix or suffix are decimal.
- Accuracy determines the move's accuracy. Divide this value by 100 to get the actual accuracy. 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 you 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 theorically possible to combine those values. For example, you 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.
- Priority determines the moves speed, for example ExtremeSpeed is faster than any other move. This byte is signed, i.e. this value can be either positive or negative. If it is stricly less than 0x80 (128) then you got the actual value. If not, the actual value equals: -1 * (256 - Current Value). Thus, value 0xFE (254) must be treated as -2 instead.
- Contact determines whether there is physical contact during the attack or not, for determining effects of certain abilities such as Static and Rough Skin. This byte also determines whether this move is affected by items such as King's Rock or Brightpowder.
- Padding consists of a sequence of 3 bytes. Each one of those bytes should be set to 0x00.