FANDOM


For defining a move, see Defining a move.
For a list of existing move effects, see Function codes.
For animating a move used in battle, see Attack animations.
For things that some moves can do in the overworld, see Using moves outside battle.

This page describes the kinds of in-battle move effects that exist in Essentials.

Move effects

Moves can have special effects or properties that govern what they do and how they interact with other moves/abilities/etc. Even a move like Tackle, which just deals damage, has some properties that indicate that it can be blocked by Protect and that the user makes physical contact with the target.

Generally speaking, a function code defines what a move does, and effect flags define how it interacts with other things.

Effect flags

An effect flag is a simple "yes or no". There are a number of possible effect flags, each a different letter, each of which means a different thing. Flag "c" indicates whether the move can be bounced back at the user by a target using Magic Coat/having Magic Bounce, while flag "k" indicates whether the move is based on the use of sound.

Effect flags are assigned to moves by including the appropriate letter(s) in its definition in the PBS file "moves.txt". See Defining a move for a list of them.

Sound-based moves

Some moves are sound-based, and thus Pokémon with the ability Soundproof are immune to them.

The main bit of script relating to sound-based moves is def pbChangeTarget in the script section PokeBattle_Battler. In here it checks whether the move is a sound-based move (i.e. it has flag "k"), and if so and it is used against a Pokémon with Soundproof, the move will fail with the message "Whismur's Soundproof blocks Growl!" (or similar).

The above misses out the moves Heal Bell and Perish Song, as well as the lingering part of Uproar's effect.

  • Heal Bell is dealt with in its function code, because the message "A bell chimed!" should appear before it fails - this message would not appear if it were included in the list mentioned above.
  • Perish Song affects all Pokémon in battle, except those with Soundproof. It is also a lingering effect which shows up at several points in the scripts, and so it being sound-based needs to be considered at each of those points individually.
  • Uproar is included in the check mentioned above because its entire effect should fail if used against a Soundproof foe. However, if it is successfully used, then it has a lingering effect just like Perish Song.

To find all points in the scripts where a move's sound-based nature is considered, simply search for the ability name "Soundproof".

Sound-based moves also have some other special interactions and effects, which are not detailed here.

Function codes

Main article: Function codes

Most damaging moves, and all status moves, have a special effect beyond simply dealing damage. This effect can range from simple ones like poisoning the foe, to complex and/or unique ones like Transform. To describe what a particular move does, it is assigned a function code. Note that even "just deals damage" has its own function code, although this more accurately means "has no special effect beyond dealing damage".

A function code describes a particular move effect (e.g. "moves with this function code may poison the foe"). Several moves can share the same function code, although a move can only have exactly one function code. Each function code is written as a 3-digit hexadecimal number (e.g. 001, 02A, 0E3, 0DF, 12A), although they can go all the way up to FFFF.

The various effects associated with a particular function code are (mostly) defined in the script section PokeBattle_MoveEffects, with each function code having its own class called PokeBattle_Move_XXX (where "XXX" is the function code). A function code's class typically contains all the information about that function code's effect. The contained methods can be any of the methods found in the class PokeBattle_Move (of which the function code's class is a sub-class), and can either replace or supplement them. The names of the methods are usually self-explanatory.

Some function code classes are empty, because their effects have to be handled elsewhere in the scripts (e.g. "0E9" for Endure). See below for more information.

See Function codes for a list of all existing function codes and their effects.

Function codes in other scripts

Some move effects, or parts thereof, exist outside of the script section PokeBattle_MoveEffects. These effects are referred to by their function codes (because one function code is one effect regardless of which particular move has it), and the function code will appear in the form 0x02A, where the "0x" means "this is a hexadecimal number".

Function codes which appear elsewhere include the ones for:

  • Curse, Endure, False Swipe, Jump Kick, Rage, Self-Destruct, Sky Uppercut, several others.

These effects (or parts of effects) exist elsewhere because they cannot be extracted from where they are and put neatly into the function code's class as described above.

Priority

A move's priority is a number between -6 (lowest) and +6 (highest) which helps to determine in which order moves should be used. A full description of what this number does can be found on the Internet, as it is a fundamental Pokémon mechanic.

In Essentials, a move's priority is defined separately from its effect. For example, Quick Attack has the function code 000 (no special effect) yet it has a priority of +1 (higher than normal).

Causing a lingering effect

A lingering effect is one which applies to the battle even after the move causing it has been used (even if it is just part of/a result of that move's effect). Such effects include Leech Seed, Reflect, weather-creating effects, Bide, Disable, Ingrain, toxic poisoning, and so forth. That is, they can perform a wide range of functions.

A number of variables are defined at the start of a battle, either for each battler or for each side or for the whole field. They usually start in their "off" state. Using a move with a lingering effect will change the appropriate variable. Various things will depend on the values of these variables (e.g. if a battler's effects[PBEffects::Confusion] value is greater than 0, then it is confused and should behave accordingly). A full list of these variables is available in the script section PBEffects. They are typically named after the move that has the lingering effect.

Some lingering effects have multiple variables associated with them. For example, Bide has 3: one to state that it is being used, one which records the damage taken, and one which remembers the last Pokémon to attack it (which will be Bide's target). On the other hand, some variables are used by multiple moves. For example, the variable TwoTurnAttack is used by several different moves with several different function codes; no more than 1 of them can ever be used at once so they don't clash, and this particular part of the effect is the same for all of them.

As mentioned earlier, some effects are battler-specific while some are side-specific, and some apply only to the whole field. All kinds are listed in the script section PBEffects. The side-specific and field-specific effects are defined (i.e. set to their "off" values) in the script section PokeBattle_ActiveSideField, while the battler-specific effects are defined in the script section PokeBattle_Battler.

All lingering effects will always be referred to in the form effects[PBEffects::Confusion], with the actual name of the effect being the only difference. This makes them easy to search for.

Any further details about lingering effects are unnecessary and would be overly specific. You will likely not need to know even this much. If you are creating your own move effect with a lingering effect, this information shows how they are defined and how to find them; you can look at relevant examples yourself.

Tips

  • If you are making a new move which is similar to an existing move, look at how the existing move works and copy it.
Community content is available under CC-BY-SA unless otherwise noted.