Module yareio::spirit[][src]

Expand description

Spirits are the game’s units. They carry energy which is used for creating new spirits, fighting, and capturing outposts.

Constants

Maximum range of energy transfer.

The amount of damage given to enemy spirits in the EXPLODE_RADIUS once a spirit explodes.

Radius from the exploding spirit where enemy spirits take damage.

The cost of a jump for squares per unit distance. Cost is then rounded up.

Maximum size that circles can reach through merging.

Maximum merge distance for circles. See spirit::merge for more information.

Movement speed of spirits in units per tick.

Functions

Get the number of spirits in the game.

Divides spirit back into all the spirits that were merged into it.

Transfer energy to another spirit* equal to the spirit’s size. Maximum distance for energy transfer is 200 units.

Transfer energy to a base equal to the spirit’s size. Maximum distance for energy transfer is 200 units.

Transfer energy to an outpost. Maximum distance for energy transfer is 200 units.

Transfer energy to a star. Maximum distance for energy transfer is 200 units.

Get the current energy of the spirit.

The energy capacity of a spirit is the maximum amount of energy is can hold. It is equal to ten times its size.

Spirit explodes, killing itself and dealing 10 damage to all enemy spirits within 100 radius.

Moves spirit to target (x, y) with a speed of 20 units per tick.

Get the spirit’s hp. This is equal to 1 when the spirit is alive and 0 when it is dead.

Get the spirit’s id. This is a combination of its player_id and number.

Teleports the spirit into a new location up to 300 units away. Costs half of spirit’s energy capacity.

Get the id of the last energized spirit by the spirit. If the last energized object was not a spirit, then blame @l0laapk3.

Get the number of the last energized spirit by the spirit. If the last energized object was not a spirit, then blame @l0laapk3.

Get the player id of the last energized spirit by the spirit. If the last energized object was not a spirit, then blame @l0laapk3.

Merge the spirit into another friendly spirit. Target spirit needs to be within a 10 unit radius.

numberDeprecated

Get the number of the spirit.

player_idDeprecated

Get the index of the player who controls the spirit.

Get the position of the spirit.

Get the shape of the spirit. This is 0 for circles, 1 for squares.

Show a message above the spirit as a light-weight in-game communication. Useful for some debugging as well.

Get the size of the spirit. Circles can be 1-100, squares have 10, triangles have 3. Circles increase their size by merging. The size determines the rate of energy transfer.