- Created detailed documentation for the Minecart sprite, outlining its properties, constants, collision setup, main logic, and design patterns. - Added documentation for the Pedestal sprite, including its vanilla overrides, custom logic for item interaction, and event triggering based on area context. - Introduced documentation for the Portal sprite, detailing its two-way warping system, initialization, main logic, and helper routines for seamless transitions. - Documented the Switch Track sprite, explaining its interactive behavior, state-based animation, and integration with external switches for dynamic track manipulation.
5.2 KiB
5.2 KiB
Kydreeok Head Sprite Analysis
Overview
The kydreeok_head sprite (ID: Sprite_KydreeokHead, which is $CF) is a child sprite of the main Kydreeok boss. It represents one of the multi-headed boss's individual heads, possessing independent movement, attack patterns, and damage handling. Its primary role is to move, rotate, and attack Link, contributing to the overall boss encounter.
Key Properties:
- Sprite ID:
Sprite_KydreeokHead($CF) - Description: Child sprite of the Kydreeok boss, responsible for individual head behavior.
- Number of Tiles: 7
- Health:
$C8(200 decimal) - This high health value indicates it's a significant component of the boss fight. - Damage:
00(Damage is likely applied through its spawned attacks.) - Special Properties:
!Boss = 00(Not marked as a boss itself, as it's a component of a larger boss.)!Hitbox = 09
Subtypes:
The SprSubtype, X register is crucial for differentiating the heads and their behavior:
- Subtype
$00: Controls the "Left Head" viaNeck1_Control. - Subtype
$01: Controls the "Right Head" viaNeck2_Control. This allows the same sprite ID to manage multiple distinct heads.
Main States/Actions (Sprite_KydreeokHead_Main Jump Table):
The head's behavior is governed by a state machine:
KydreeokHead_ForwardAnim(0x00): Default state, plays forward animation, handles damage, performs rotational movement, and randomly attacks. Transitions to other directional states based on Link's position.KydreeokHead_RightAnim(0x01): Plays right-facing animation, handles damage, rotation, and attacks.KydreeokHead_LeftAnim(0x02): Plays left-facing animation, handles damage, rotation, and attacks.KydreeokHead_FarRight(0x03): Plays far-right animation, moves towards Link, handles damage, rotation, and attacks.KydreeokHead_FarLeft(0x04): Plays far-left animation, moves towards Link, handles damage, rotation, and attacks.KydreeokHead_SummonFire(0x05): Moves towards Link, checks damage, and utilizesJSL Sprite_Twinrova_FireAttackto deal damage. The head sprite is then killed after a timer.
Initialization (Sprite_KydreeokHead_Prep):
- Sets initial health to
$FF(255 decimal), though the!Healthproperty is$C8. This discrepancy might be overridden by the parentKydreeoksprite or is a temporary value. - Sets
SprBump = $09(bump damage type). - Initializes
SprMiscE, Xto0.
Drawing (Sprite_KydreeokHead_Draw):
- Uses standard OAM allocation routines.
- The main drawing routine calls
JMP Sprite_KydreeokHead_DrawNeck, indicating that the neck segments are drawn after the head. - Includes logic for flashing when damaged.
Neck Control (KydreeokHead_NeckControl, Neck1_Control, Neck2_Control, Sprite_KydreeokHead_DrawNeck, DrawNeckPart):
This is a sophisticated system for managing the multi-segmented neck:
KydreeokHead_NeckControldispatches toNeck1_Control(for the left head) orNeck2_Control(for the right head) based onSprSubtype, X.Neck1_ControlandNeck2_Controlmanage the movement and positioning of three neck segments, ensuring they follow the head while maintaining specific distances.Sprite_KydreeokHead_DrawNeckandDrawNeckParthandle the rendering of these segments.
Movement and Rotation (KydreeokHead_RotationMove, RotateHeadUsingSpeedValues, MoveWithBody):
KydreeokHead_RotationMove: Generates random speeds, dispatches to neck control, moves with the main body, and applies rotational movement.RotateHeadUsingSpeedValues: Uses sine/cosine tables (XSpeedSin,YSpeedSin) to apply smooth rotational movement.MoveWithBody: Ensures the head's position is correctly offset and relative to the mainKydreeokboss, adjusting for left or right heads.
Attacks (RandomlyAttack, KydreeokHead_SummonFire):
RandomlyAttack: Randomly spawns a fire-based projectile (which is actually theSprite_KydreeokHeaditself entering theSummonFirestate).KydreeokHead_SummonFire: This state is entered when a fire projectile is spawned. It moves towards Link and usesJSL Sprite_Twinrova_FireAttackto deal damage, after which the head sprite is killed.
Key Macros/Functions Used:
%Set_Sprite_Properties,%GotoAction,%StartOnFrame,%PlayAnimation,%MoveTowardPlayerJSL JumpTableLocal,JSL Sprite_CheckDamageFromPlayer,JSL Sprite_CheckDamageToPlayer,JSL Sprite_DamageFlash_LongJSL GetRandomInt,JSL Sprite_MoveLong,JSL Sprite_IsToRightOfPlayerJSL Sprite_SpawnDynamically,JSL Sprite_SetSpawnedCoordsJSL Sprite_Twinrova_FireAttack,JSL Fireball_SpawnTrailGarnishJSR GetDistance8bit
Discrepancies/Notes:
- The
!Healthproperty is$C8, butSprite_KydreeokHead_PrepsetsSprHealth, Xto$FF. This needs clarification. - The reuse of
JSL Sprite_Twinrova_FireAttackfor Kydreeok's head is an example of code reuse, but it's important to ensure it fits the thematic design of Kydreeok. - The neck control system is quite intricate, highlighting advanced sprite design.
- Several hardcoded addresses for
JSLcalls could be replaced with named labels for better maintainability.