[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-
|
|
|
|
|
|
|
|
/// Pattern type components
|
|
|
|
/// -----------------------
|
|
|
|
// 0° angle definition, relative to the bullet origin.
|
|
|
|
#define BPC0_STATIC 0 /* 0° = right */
|
|
|
|
#define BPC0_AIMED 1 /* 0° = current player position */
|
|
|
|
|
|
|
|
// Circular distribution of a number of bullets, given in [spread].
|
|
|
|
#define BPCC_SPREAD 2 /* [spread]-way arc centered around 0°, with
|
|
|
|
[spread_delta_angle]° between each bullet */
|
|
|
|
#define BPCC_RING 4 /* Full circle, ignoring [spread_delta_angle] */
|
|
|
|
|
|
|
|
// Turns every bullet that would already be fired into a multi-bullet stack
|
|
|
|
// with varying speeds. Number of bullets in [stack], with each subsequent
|
|
|
|
// bullet getting faster by [stack_delta_speed].
|
|
|
|
#define BPCS_STACK 6
|
|
|
|
/// -----------------------
|
|
|
|
// Will always fire a single bullet, regardless of rank or playperf.
|
|
|
|
#define BPCF_SINGLE 14
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
// Turned into a stack on Hard, and into a spread on Lunatic.
|
|
|
|
BP_SINGLE = (BPC0_STATIC),
|
|
|
|
BP_SINGLE_AIMED = (BPC0_AIMED),
|
|
|
|
|
|
|
|
BP_SPREAD = (BPCC_SPREAD + BPC0_STATIC),
|
|
|
|
BP_SPREAD_AIMED = (BPCC_SPREAD + BPC0_AIMED),
|
|
|
|
BP_RING = (BPCC_RING),
|
|
|
|
BP_RING_AIMED = (BPCC_RING + BPC0_AIMED),
|
|
|
|
BP_STACK = (BPCS_STACK),
|
|
|
|
BP_STACK_AIMED = (BPCS_STACK + BPC0_AIMED),
|
|
|
|
BP_SPREAD_STACK = (BPCS_STACK + BPCC_SPREAD + BPC0_STATIC),
|
|
|
|
BP_SPREAD_STACK_AIMED = (BPCS_STACK + BPCC_SPREAD + BPC0_AIMED),
|
|
|
|
BP_RING_STACK = (BPCS_STACK + BPCC_RING + BPC0_STATIC),
|
|
|
|
BP_RING_STACK_AIMED = (BPCS_STACK + BPCC_RING + BPC0_AIMED),
|
|
|
|
|
|
|
|
// Number of bullets taken from [spread]. Both angle and speed are added
|
|
|
|
// to the template's [angle] and [speed] values, respectively.
|
|
|
|
BP_RANDOM_ANGLE = 12,
|
|
|
|
BP_RANDOM_ANGLE_AND_SPEED = 13,
|
|
|
|
|
|
|
|
BP_FORCESINGLE = (BPCF_SINGLE),
|
|
|
|
BP_FORCESINGLE_AIMED = (BPCF_SINGLE + BPC0_AIMED),
|
|
|
|
} bullet_pattern_t;
|
|
|
|
|
2020-02-16 16:54:04 +00:00
|
|
|
/// Spawn types
|
|
|
|
/// -----------
|
|
|
|
// Spawns special-moving bullets with BST_NORMAL after the gather animation.
|
|
|
|
// Effectively becomes BST_NORMAL when used outside a gather_t.
|
|
|
|
#define BST_GATHER_NORMAL_SPECIAL_MOVE 0xFE
|
|
|
|
|
|
|
|
#define BST_NORMAL 0x00
|
|
|
|
#define BST_GATHER_PELLET 0x01
|
|
|
|
#define BST_CLOUD_FORWARDS 0x02
|
|
|
|
#define BST_CLOUD_BACKWARDS 0x03
|
|
|
|
|
|
|
|
#define BST_SLOWDOWN 0x10 /* can be OR'd into any of the above */
|
|
|
|
/// -----------
|
|
|
|
|
[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
|