Enemy Object Functions

From Danmakufu Wiki
Jump to: navigation, search

ObjEnemy_Create

Arguments:
 1) object type (constant)

Returns: object ID (real)

Creates an Enemy object and returns its ID. Object types are:

  • OBJ_ENEMY
  • OBJ_ENEMY_BOSS

In order to draw the enemy object and have it listed as an existing enemy, you have to register it using ObjEnemy_Regist. If you want to create a boss enemy object, you have to create a boss scene object first.

ObjEnemy_Regist

Arguments:
 1) object ID (real)

Makes the specified enemy object active.

ObjEnemy_GetInfo

Arguments:
 1) object ID (real)
 2) info type (constant)
  • INFO_LIFE: Returns the life points of the enemy (real).
  • INFO_DAMAGE_RATE_SHOT: Returns the damage rate percentage of normal player shots set by ObjEnemy_SetDamageRate (real: 1-100)
  • INFO_DAMAGE_RATE_SPELL: Returns the damage rate percentage of player bombs set by ObjEnemy_SetDamageRate (real: 1-100)
  • INFO_SHOT_HIT_COUNT: Returns the amount of times the enemy was hit by player bullets in the previous frame

ObjEnemy_SetLife

Arguments:
 1) object ID (real)
 2) life (real)

Sets the amount of life points for the specified enemy object.

ObjEnemy_AddLife

Arguments:
 1) object ID (real)
 2) life (real)

Adds the specified amount of life points to the enemy's life.

ObjEnemy_SetDamageRate

Arguments:
 1) object ID (real)
 2) shot damage rate (real)
 3) spell damage rate (real)

Sets the damage rate of the player's attacks against the specified enemy. Setting to 0 will cause the enemy to take no damage, 100 is the default (100%) value. Values above 100 are possible. Values below 0 are also possible, but may cause the boss health to overflow.

ObjEnemy_SetIntersectionCircleToShot

Arguments:
 1) object ID (real)
 2) collision detection x-coordinate (real)
 3) collision detection y-coordinate (real)
 4) collision detection radius (real)

Sets the position and size of the enemy hitbox. Any collision with player shots or spells with the circle will damage the enemy.

ObjEnemy_SetIntersectionCircleToPlayer

Arguments:
 1) object ID (real)
 2) collision detection x-coordinate (real)
 3) collision detection y-coordinate (real)
 4) collision detection radius (real)

Sets the enemy hitbox for player collision. Any collision with the circle will kill the player.