Move data structure (Generation III): Difference between revisions

Elaborate flags
(Elaborate flags)
Line 24: Line 24:
| [[Priority]] || byte
| [[Priority]] || byte
|-
|-
| [[Contact]] || byte
| Flags || byte
|-
|-
| Padding || 3 bytes
| Padding || 3 bytes
Line 60: Line 60:
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 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 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.
* '''Priority''' determines the moves speed. 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.
* '''Contact''' determines whether there is physical contact during the attack or not, for determining effects of certain [[Ability|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.
* '''Flags''' determine additional properties of the move:
 
<code>--fedcba</code>
 
**'''a''' - This moves makes [[contact]] with the target.
**'''b''' - This move is affected by {{m|Protect}}.
**'''c''' - This move is affected by {{m|Magic Coat}}.
**'''d''' - This move is affected by {{m|Snatch}}.  Note that this is mutually-exclusive with flag c.
**'''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}}.
 
* '''Padding''' consists of a sequence of 3 bytes. Each one of those bytes should be set to 0x00.
* '''Padding''' consists of a sequence of 3 bytes. Each one of those bytes should be set to 0x00.


222

edits