[Reverse-engineering] [th04/th05] Bullet pattern types
uth05win TL note: "n-way all-around" means "ring"… yep, let's better
improve on the naming here, once again using established terminology
from Sparen's Danmaku Design Guide at
https://sparen.github.io/ph3tutorials/ddsga3.html
Since TH04 only supports rings *or* spreads *or* stacks, overloading
[delta] to store both spread angle and stack speed, that enum does
serve kind of a purpose in TH04. Unlike TH05, where it could be vastly
simplified to a bitfield with 4 flags: aim to player, randomize angle,
randomize speed, force single. Which could then actually create *more*
types of patterns than these uselessly defined 14 distinct types, all
of which can already be derived from the other values of the upcoming
template structure:
• Set [stack] to 1 if you don't want a stack
• Set [spread] to 1 if you don't want a spread
• Set [spread_delta_angle] to 0 to turn a N-way spread into a ring
Easy.
Part of P0075, funded by Myles and -Tom-.
2020-02-14 16:34:06 +00:00
|
|
|
#pragma option -b-
|
|
|
|
|
2020-02-15 20:13:31 +00:00
|
|
|
typedef union {
|
|
|
|
unsigned char spread_angle;
|
|
|
|
// In subpixels, obviously, but pre-C++11 doesn't let us use any of the
|
|
|
|
// Subpixel classes with their custom assignment operators in a union...
|
|
|
|
unsigned char stack_speed;
|
|
|
|
} bullet_template_delta_t;
|
|
|
|
|
[Reverse-engineering] [th04/th05] Bullet pattern types
uth05win TL note: "n-way all-around" means "ring"… yep, let's better
improve on the naming here, once again using established terminology
from Sparen's Danmaku Design Guide at
https://sparen.github.io/ph3tutorials/ddsga3.html
Since TH04 only supports rings *or* spreads *or* stacks, overloading
[delta] to store both spread angle and stack speed, that enum does
serve kind of a purpose in TH04. Unlike TH05, where it could be vastly
simplified to a bitfield with 4 flags: aim to player, randomize angle,
randomize speed, force single. Which could then actually create *more*
types of patterns than these uselessly defined 14 distinct types, all
of which can already be derived from the other values of the upcoming
template structure:
• Set [stack] to 1 if you don't want a stack
• Set [spread] to 1 if you don't want a spread
• Set [spread_delta_angle] to 0 to turn a N-way spread into a ring
Easy.
Part of P0075, funded by Myles and -Tom-.
2020-02-14 16:34:06 +00:00
|
|
|
// All _AIMED patterns define the 0° [angle] as the current player position,
|
|
|
|
// relative to the bullet origin.
|
|
|
|
typedef enum {
|
|
|
|
// Ignoring [count]. Turned into a stack on Hard, and into a spread on
|
|
|
|
// Lunatic.
|
|
|
|
BP_SINGLE = 0x00,
|
|
|
|
BP_SINGLE_AIMED = 0x01,
|
|
|
|
|
|
|
|
// Multiple random bullets, number in [count]. Both angle and speed are
|
|
|
|
// added to the template's [angle] and [speed] values, respectively.
|
|
|
|
BP_RANDOM_ANGLE = 0x1B,
|
|
|
|
BP_RANDOM_ANGLE_AND_SPEED = 0x1C,
|
|
|
|
|
|
|
|
// Ring out of [count] bullets, ignoring [delta].
|
|
|
|
BP_RING = 0x26,
|
|
|
|
BP_RING_AIMED = 0x2C,
|
|
|
|
|
|
|
|
// [count]-way arc centered around 0°, with [delta.spread_angle]° between
|
|
|
|
// each bullet.
|
|
|
|
BP_SPREAD = 0x2D,
|
|
|
|
BP_SPREAD_RANDOM_ANGLE_AIMED = 0x1D,
|
|
|
|
BP_SPREAD_AIMED = 0x2E,
|
|
|
|
|
|
|
|
// Multi-bullet stack with varying speeds. Number of bullets in [count],
|
|
|
|
// with each subsequent bullet getting faster by [delta.stack_speed].
|
|
|
|
BP_STACK = 0x2F,
|
|
|
|
BP_STACK_AIMED = 0x30,
|
|
|
|
|
|
|
|
// Will always fire a single bullet, regardless of rank or playperf.
|
|
|
|
BP_FORCESINGLE = 0x40,
|
|
|
|
BP_FORCESINGLE_RANDOM_ANGLE = 0x1A,
|
|
|
|
BP_FORCESINGLE_AIMED = 0x41,
|
|
|
|
} bullet_pattern_t;
|
|
|
|
|
2020-02-16 16:54:04 +00:00
|
|
|
/// Spawn types
|
|
|
|
/// -----------
|
|
|
|
/// Not an enum for consistency with TH05, which uses two components OR'd
|
|
|
|
/// together.
|
|
|
|
|
|
|
|
// Won't spawn bullets at the end of a gather animation. Effectively becomes
|
|
|
|
// BST_BULLET16 when used outside a gather_t. (Mugetsu's 4th phase actually
|
|
|
|
// relies on this!)
|
|
|
|
#define BST_GATHER_ONLY 0
|
|
|
|
|
|
|
|
#define BST_PELLET 1 /* ignoring [patnum] */
|
|
|
|
#define BST_BULLET16 2
|
|
|
|
#define BST_GATHER_PELLET 3
|
|
|
|
#define BST_BULLET16_CLOUD_FORWARDS 4
|
|
|
|
#define BST_BULLET16_CLOUD_BACKWARDS 5
|
|
|
|
/// -----------
|
|
|
|
|
[Reverse-engineering] [th04/th05] Bullet pattern types
uth05win TL note: "n-way all-around" means "ring"… yep, let's better
improve on the naming here, once again using established terminology
from Sparen's Danmaku Design Guide at
https://sparen.github.io/ph3tutorials/ddsga3.html
Since TH04 only supports rings *or* spreads *or* stacks, overloading
[delta] to store both spread angle and stack speed, that enum does
serve kind of a purpose in TH04. Unlike TH05, where it could be vastly
simplified to a bitfield with 4 flags: aim to player, randomize angle,
randomize speed, force single. Which could then actually create *more*
types of patterns than these uselessly defined 14 distinct types, all
of which can already be derived from the other values of the upcoming
template structure:
• Set [stack] to 1 if you don't want a stack
• Set [spread] to 1 if you don't want a spread
• Set [spread_delta_angle] to 0 to turn a N-way spread into a ring
Easy.
Part of P0075, funded by Myles and -Tom-.
2020-02-14 16:34:06 +00:00
|
|
|
#pragma option -b
|