Player Functions

From Danmakufu Wiki
Jump to: navigation, search

Return to Functions

GetPlayerObjectID

Returns: ID (real)

Gets player object ID.

GetPlayerScriptID

Returns the player's script ID. This function returns the same value as GetOwnScriptID when used inside the player script.

SetPlayerSpeed

Arguments:
 1) normal speed (real)
 2) focus speed (real)

Sets the normal speed and focus speed of the player.

Defaults are 4.0 (normal) and 1.6 (focus)

SetPlayerClip

Arguments:
 1) left limit (real)
 2) top limit (real)
 3) right limit (real)
 4) bottom limit (real)

Sets the area within which the player can move.

Defaults are 0 (left), 0 (top), 384 (right), 448 (bottom)

SetPlayerLife

Arguments:
 1) value (real)

Sets value as life points for the player (can be non integer).

Default is 2.

SetPlayerSpell

Arguments:
 1) value (real)

Sets the amount of bombs available for the player (can be non integer).

Default is 3.

SetPlayerPower

Arguments:
 1) value (real)

Sets the amount of power points (can be non integer).

Default is 1.

SetPlayerInvincibilityFrame

Arguments:
 1) invincibility frames (real)

Sets the amount of frames for player invincibility.

Default is 0.

SetPlayerDownStateFrame

Arguments:
    1) Player Downed Length (in frames)

Sets the amount of frames that will wait before respawning the player.

Default is 120.

SetPlayerRebirthFrame

Arguments:
 1) rebirth frames (real)

Sets the amount of frames the player can counter bomb.

Default is 15.

SetPlayerRebirthLossFrame

Arguments:
 1) rebirth loss frames (real)

Sets the amount of counter bomb frames the player loses per counter bomb.

Default value is 3.

SetPlayerAutoItemCollectLine

Arguments:
 1) y-coordinate

Sets the y-coordinate of the auto collect line.

A negative value removes the line.

Default is no line.

SetForbidPlayerShot

Arguments:
 1) bool

When set to true, the player cannot use normal shots.

Default is to allow normal shots.

SetForbidPlayerSpell

Arguments:
 1) bool

When set to true, the player cannot use bombs.

Default is to allow player bombs.

GetPlayerX

Returns: x-coordinate (real)

Gets the x-coordinate of the player.

GetPlayerY

Returns: y-coordinate (real)

Gets the y-coordinate of the player.

GetPlayerState

Returns: constant

Gets the player state:

  • STATE_NORMAL: the player is alive.
  • STATE_HIT: the player has been hit. This state returns true during the counter bomb frames for the player.
  • STATE_DOWN: after being killed, before reappearing.
  • STATE_END: the amount of remaining lives has become 0 (game over).

GetPlayerSpeed

Returns: speed (real)

Gets the player's speed in an array [unfocused, focused].

GetPlayerClip

Returns: clip (real)

Gets the player's clip in an array [left, top, right, bottom].

GetPlayerLife

Returns: life (real)

Gets the player's life points.

GetPlayerSpell

Returns: bombs (real)

Gets the amount of bombs remaining.

GetPlayerPower

Returns: power (real)

Gets the amount of power points.

GetPlayerInvincibilityFrame

Returns: invincibility frames (real)

Gets the amount of frames the player is invincible.

GetPlayerDownStateFrame

Returns the amount of frames that the player will spend in the down state.

GetPlayerRebirthFrame

Returns: rebirth frames (real)

Gets the amount of frames the player can counter bomb.

GetAngleToPlayer

Arguments:
 1) object ID (real)

Returns: angle to player (real)

Gets the angle from the object with specified ID to the player.

IsPermitPlayerShot

Returns: bool

Returns true if the player can use normal shots.

IsPermitPlayerSpell

Returns: bool

Returns true if the player can use bombs.

The returned value may differ from a previously set SetForbidPlayerSpell. For instance, it is forced to false during a LastSpell.

IsPlayerLastSpellWait

Returns: bool

Returns true if the player is in the state of being able to deathbomb. (The player is hit, and SetForbidPlayerSpell is set to false.)

IsPlayerSpellActive

Returns: bool

Returns true if the player is currently using a bomb (not only the button press).

GetPlayerID

Returns the system ID of the player script. This value is defined inside the player script in the #ID header.

GetPlayerReplayName

Returns the replay ID of the player. This value is defined inside the player script in the #ReplayName header.


Return to Functions