Pikifen/Object categories/Enemy

Enemies are any type of object that can attack or be attacked by the Pikmin.

Examples of enemy types include Red Bulborbs, Water Dumples, White Spectralids, etc.

To create a new type of enemy, please follow the creating object types tutorial.

Overview
An enemy is something that a Pikmin will consider an opponent, and will want to attack. Depending on how the enemy is scripted, it can also want to attack the Pikmin, run away from them, ignore them, etc. Once killed, an enemy can drop a corpse, which can then be carried to an Onion to give Pikmin seeds. Because enemies can have many varied behaviors, most of what they do is controlled by the script.

Attributes
Besides the global object type attributes, an enemy type has the following attributes.

Mandatory
None.

Recommended

 *  :  makes it so that Pikmin cannot attack it with grounded attacks; the only way to hurt it is by throwing Pikmin and letting them attack latched on. Defaults to true.
 *  :  if this enemy drops a corpse,   otherwise. Defaults to true.
 *  : How many seeds this enemy gives when the corpse is returned to the Onion. Defaults to 0.

Optional
None.

Animations
Enemy object types do not need any specific animations, only the ones that you call in the script.

Script
All of the enemy type object's behavior is defined by the user-made script. There are no recommended states, events, or actions.

Object spawn script variables
When an enemy type object is spawned, it will read the following script variables, if they're present:


 *  : A list of objects to spawn, separated by colon. These are spawned with a bit of momentum.
 *  : A list of pellet numbers to spawn, separated by colon. When the enemy dies, it will spawn a pellets of random types, but each one matching each of the specified numbers. For instance,  would make it spawn two 1 pellets and one 5 pellet. It will only pick Pikmin types from the ones that have an Onion in the current area.

Besides that, there are the global spawn script variables, and any other script variable that you write can be used by the enemy's script.