Pikifen/Creating hazards

This page will guide you on how to create hazards for Pikifen. For clarity, know that a hazard is just an abstract danger, not a physical object. Poison, fire, water, electricity, are all hazards. Gas pipes and fire geysers are obstacles, bodies of water are a type of sector, and electrical attacks from enemies are a property given to an attack; all of these use a hazard, but are not hazards.

Introduction
Pikmin can be vulnerable or invulnerable to a certain hazard. If they are invulnerable, they will be completely invulnerable to any attack hitboxes that use that property, and will act as if it doesn't exist. If not, it will suffer from some status effect. Being on fire, flailing on the surface of the water, or choking on poison are all status effects. Before you implement hazards, you must have some status effects, otherwise the hazards will be pointless if they can't cause problems. Please read the status effects guide for information on how to declare status effects.

The text file  specifies what hazards exist, as well as their properties. Each main block in that file is one hazard, and the block's name is the hazard's name, which is what must be used to refer to it by.

Standard hazard
To create a normal hazard, simply specify the following properties on its block:


 *  : A color that represents the hazard, in the format  or.
 *  : Status effects to apply to any Pikmin that is not invulnerable. This list is separated by semicolons.
 *  : If this hazard has an associated liquid (read the next section), specify its name here.

Water and other liquids
As is stated at the start of the page, a hazard is an abstract danger. This means that a body of water is not a hazard, but the concept of "water" is. The thing is, hazards like water and other liquids, like acid or lava, are meant to be used on sectors and have a liquid appearance, with an animated water surface. Simply stating that a water hazard applies the "drowning" effect to non-Blue Pikmin, and having a sector use the "water" hazard is not enough. How can the engine know what color the water is, how opaque it is, and what its surface animation is? For this, we'll need a different file.

Open. This contains data about all liquids. Liquids will bridge the gap between a water body sector and the water hazard, for instance. Much like, this is a text file in which each block is one liquid definition; the block's name is the liquid's name.

Each liquid has the following properties:


 *  : Color of the liquid, in the format  or  . In-game, the terrain below the liquid's surface will be tinted with this color.
 *  : Name of the animation text file in, with extension included (e.g.  ). The water's surface will have this animated texture on it. Note: Since the sprites used for the animation are tiled over and over across the water's surface, you will not be able to have multiple frames of animation in the same image file. When making its animation, make sure to have each frame on its own file.
 *  : Liquids have the surface animation drawn twice, one layer on top of the other. The fact that they scroll at different speeds is what gives the full surface a dynamic look. This property sets the scrolling speed of the top layer, in pixels per second.
 *  : Like, but for the bottom layer.
 *  : Opacity (0 - 255) of the entire surface.