Wikia

Touhou Wiki

Touhou Danmakufu: Bullet Control Functions

7,297pages on
this wiki
Talk0

Bullet Control Functions

Functions controlling the bullets. There is no limit of the number of bullets, but too many bullets slow down the process. For the graphics passed to the functions as CreateShot01, refer to Touhou Danmakufu: Bullets and Touhou Danmakufu: User-defined Bullets.

SetShotDirectionType

Set the type of angle of the SetShotData-series functions.

1 Parameter
    1) type
        PLAYER  : angle to the player's direction
        ABSOLUTE: use absolute polar coordinates
        SEQUENCE: angle to the current direction of the bullet

SetShotKillTime

Set time to vanish the bullet. When this function is not called, the bullet is not vanished till it goes much out of the game frame.

2 Parameters
    1) ID which was passed to the CreateShot/Laser-series functions
    2) frames

CreateShot01

Fire a bullet in uniform linear motion. It is the simplest function to fire a bullet.

6 Parameters
    1) x-coordinate
    2) y-coordinate
    3) velocity
    4) angle
    5) graphic
    6) delay frames

CreateShot02

Fire a bullet in uniform accelerated motion.

8 Parameters
    1) x-coordinate
    2) y-coordinate
    3) velocity
    4) angle
    5) acceleration
    6) max. (or min.) velocity
    7) graphic
    8) delay frames

CreateShot11

Fire a bullet in uniform linear motion. The velocity is indicated for each component.

6 Parameters
    1) x-coordinate
    2) y-coordinate
    3) x-velocity
    4) y-velocity
    5) graphic
    6) delay frames

CreateShot12

Fire a bullet in uniform accelerated motion. The velocity and acceleration are indicated for each component.

10 Parameters
    1) x-coordinate
    2) y-coordinate
    3) x-velocity
    4) y-velocity
    5) x-acceleration
    6) y-acceleration
    7) max. (or min.) x-velocity
    8) max. (or min.) y-velocity
    9) graphic
   10) delay frames

CreateShotA

Create a controllable bullet. The behavior is set by SetShotDataA and fired by FireShot. The coordinate system is absolute when fired by FireShot and relative from a bullet when added to it by AddShot.

4 Parameters
    1) ID, non-negative integer
       The same number is used for SetShotDataA, etc.
    2) x-coordinate
    3) y-coordinate
    4) delay frames

SetShotDataA

Set the motion of the bullet distinguished by the ID. The motion of the 0th frame (2nd argument is 0) must be set. Must be called after CreateShotA.

8 Parameters
    1) ID which was passed to the CreateShotA function
    2) time to modify the motion (in frame)
    3) velocity (when NULL, maintain the current velocity)
    4) angle (when NULL, maintain the current angle)
    5) angular velocity
    6) acceleration
    7) max. (or min.) velocity
    8) graphic

SetShotDataA_XY

Set the motion of the bullet distinguished by the ID. The motion of the 0th frame (2nd argument is 0) must be set. Must be called after CreateShotA.

9 Parameters
    1) ID which was passed to the CreateShotA function
    2) time to modify the motion (in frame)
    3) x-velocity
    4) y-velocity
    5) x-acceleration
    6) y-acceleration
    7) max. (or min.) x-velocity
    8) max. (or min.) y-velocity
    9) graphic

CreateLaser01

Fire a projection laser in uniform linear motion. It is the simplest function to fire a laser.

8 Parameters
    1) x-coordinate
    2) y-coordinate
    3) velocity
    4) angle
    5) laser length
    6) laser width
    7) graphic
    8) delay frames

CreateLaserA

Create a controllable installation laser. The behavior is set by SetLaserDataA and fired by FireShot.

7 Parameters
    1) ID, non-negative integer
       The same number is used for SetLaserDataA, etc.
    2) x-coordinate
    3) y-coordinate
    4) laser length
    5) laser width
    6) graphic
    7) delay frames

SetLaserDataA

Set the motion of the installation laser distinguished by the ID. The motion of the 0th frame (2nd argument is 0) must be set.

7 Parameters
    1) ID which was passed to the CreateLaserA functions
    2) time to modify the motion (in frame)
    3) angle (when NULL, maintain the current angle)
    4) angular velocity
    5) variation of the laser length
    6) magnitude of velocity
    7) direction of velocity

CreateLaserB

Create a controllable laser installed on the enemy. The behavior is set by SetLaserDataB and fired by FireShot.

5 Parameters
    1) ID, non-negative integer
       The same number is used for SetLaserDataB, etc.
    2) laser length
    3) laser width
    4) graphic
    5) delay frames

SetLaserDataB

Set the motion of the enemy-installation laser distinguished by the ID. The motion of the 0th frame (2nd argument is 0) must be set.

9 Parameters
    1) ID which was passed to the CreateLaserB functions
    2) time to modify the motion (in frame)
    3) variation of the laser length
    4) distance between the enemy and the laser source
       (when NULL, maintain the current distance)
    5) variation of 4) per frame
    6) angle from the enemy to the laser source
       (when NULL, maintain the current angle)
    7) variation of 6) per frame
    8) laser angle
       (when NULL, maintain the current angle)
    9) variation of 8) per frame

CreateLaserC

Create a controllable curved projection laser. The behavior is set by SetLaserDataC and fired by FireShot.

This laser needs much computational cost. The longer it is, the heavier the process is.

7 Parameters
    1) ID, non-negative integer
       The same number is used for SetLaserDataC, etc.
    2) x-coordinate
    3) y-coordinate
    4) laser width
    5) laser length (in frame)
    6) graphic
    7) delay frames

SetLaserDataC

Set the motion of the curved projection laser distinguished by the ID. The motion of the 0th frame (2nd argument is 0) must be set.

7 Parameters
    1) ID which was passed to the CreateLaserC functions
    2) time to modify the motion (in frame)
    3) velocity (when NULL, maintain the current velocity)
    4) angle (when NULL, maintain the current angle)
    5) angular velocity
    6) acceleration
    7) max. (or min.) velocity

AddShot

Add the bullet (source) to the other bullet (target). Setting of the source bullet is finished here. This function is often used to split a bullet (e.g. 博愛の仏蘭西人形; Benevolent French Dolls) or to fire bullets from a bullet (e.g. 狐狸妖怪レーザー; Fox-Tanuki Youkai Laser). It can be used to fire bullets from a laser (e.g. レーヴァテイン; Lävatein).

4 Parameters
    1) time to fire the added bullet (in frame)
    2) ID of the target bullet
    3) ID of the source bullet
    4) distance from the target laser source
       (ignored when the target is not a laser)

FireShot

Fire a bullet created by the CreateShot/Laser-series functions. Setting of the bullet is finished here. The ID can be used for CreateShot/Laser-series functions to create another bullet.

1 Parameter
    1) ID which was passed to the CreateShot/Laser-series functions

CreateShotFromScript

Fire a scripted bullet.

7 Parameters
    1) bullet script name (string)
    2) x-coordinate
    3) y-coordinate
    4) velocity
    5) angle
    6) delay frames
    7) user-defined argument

DeleteEnemyShot

Vanish the enemy bullets. CHILD can be selected only in the enemy script.

1 Parameter
    1) which bullets are vanished
        ALL  : All the bullets
        SHOT : the bullets which don't have bomb-resistance
               (lasers and bomb-resistant bullets are not vanished)
        CHILD: the bullets which the enemy fired

DeleteEnemyShotInCircle

Causes enemy bullets in the given circle to vanish.

4 Parameters
    1) What type of shots to vanish
        ALL  : all enemy shots
        SHOT : all shots which are not bomb-resistant
    2) x coordinate
    3) y coordinate
    4) radius of the circle

DeleteEnemyShotImmediatelyInCircle

Causes enemy bullets in the given circle to vanish immedaitely.

4 Parameters
    1) What type of shots to vanish
        ALL  : all enemy shots
        SHOT : all shots which are not bomb-resistant
    2) x coordinate
    3) y coordinate
    4) radius of the circle

DeleteEnemyShotToItem

Change the enemy bullets into point items. CHILD can be selected only in the enemy script.

1 Parameter
    1) which bullets are vanished
        ALL  : All the bullets
        SHOT : the bullets which don't have bomb-resistance
               (lasers and bomb-resistant bullets are not vanished)
        CHILD: the bullets which the enemy fired

DeleteEnemyShotToItemInCircle

Change the enemy bullets in the circle into point items. CHILD can be selected only in the enemy script.

4 Parameters
    1) which bullets are vanished
        ALL  : All the bullets
        SHOT : the bullets which don't have bomb-resistance
               (lasers and bomb-resistant bullets are not vanished)
        CHILD: the bullets which the enemy fired
    2) x-coordinate of the center
    3) y-coordinate of the center
    4) radius

SetShotColor

Blend the color to the enemy bullets. SetShotColor(255, 255, 255); is the default setting.

The color is additively blended to lasers and xxx03 bullets (big bullets). Note that the lasers are invisible after SetShotColor(0, 0, 0);.

This function is not recommended to select the bullet colors.

3 Parameters
    1) red (0 ~ 255)
    2) green (0 ~ 255)
    3) blue (0 ~ 255)

LoadUserShotData

Add the bullet graphics from the bullet definition script. When this function is called twice, the older information is overwritten by the newer information.

1 Parameter
    1) path of the  bullet definition script (string)

SetShotAutoDeleteClip

Set the clip region of auto-deleting the bullets. When bullets goes out of the region, the bullets are deleted. The size is indicated by using the distance from the edge of the game field. All the default settings are 64 pixels.

Note that the bullets are hardly auto-deleted, if too huge value is indicated.

4 Parameters
    1) left bound
    2) top bound
    3) right bound
    4) bottom bound

Around Wikia's network

Random Wiki