- 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.
3.5 KiB
3.5 KiB
Vampire Bat Mini-Boss Sprite Analysis
Overview
The vampire_bat sprite is a mini-boss, a specialized enemy that utilizes the generic Keese sprite ID ($11) but differentiates its behavior through SprSubtype = 02. It features more complex movement patterns and attacks compared to a standard Keese, including ascending, flying around, descending, and spawning other Keese.
Key Properties:
- Sprite ID:
0x11(Custom Keese Subtype 02) - Description: A mini-boss variant of the Keese, with enhanced movement and attack capabilities.
- Number of Tiles: 8 (Inherited from the base Keese sprite.)
- Health:
32(decimal, set inSprite_Keese_Prepbased on subtype.) - Damage:
00(Damage dealt to Link is likely handled by its attacks.) - Special Properties:
!Boss = 00(Not marked as a boss, but functions as a mini-boss/special enemy.)!Shadow = 01(Draws a shadow.)
Main Logic Flow (Sprite_VampireBat_Main):
The Vampire Bat's behavior is governed by a state machine:
VampireBat_Idle(0x00): Waits for Link to approach within a specified distance ($24). Transitions toVampireBat_Ascend.VampireBat_Ascend(0x01): Plays an ascending animation, increases itsSprHeightto$50, and randomly spawns a Fire Keese (Sprite_SpawnFireKeese). Transitions toVampireBat_FlyAround.VampireBat_FlyAround(0x02): Plays a flying animation, moves towards Link (Sprite_ProjectSpeedTowardsPlayer), and randomly selects new directions (Sprite_SelectNewDirection). Transitions toVampireBat_Descendafter a timer.VampireBat_Descend(0x03): Plays a descending animation, decreases itsSprHeightuntil it's on the ground, and randomly usesSprite_Twinrova_FireAttack. Transitions back toVampireBat_Idleafter a timer.
Initialization (from Sprite_Keese_Prep in keese.asm):
The Vampire Bat does not have its own _Prep routine and relies on the generic Sprite_Keese_Prep routine in keese.asm. When SprSubtype = 02:
SprHealthis set to$20(32 decimal).SprDeflis set to$80.SprTimerCis set to$30.
Drawing (Sprite_VampireBat_Draw):
- This routine is called from
Sprite_Keese_Longinkeese.asmwhenSprSubtype = 02. - Uses standard OAM allocation routines.
- Handles animation frames, x/y offsets, character data, properties, and sizes specific to the Vampire Bat's appearance.
Attack Spawning (Sprite_SpawnFireKeese, Sprite_SpawnIceKeese):
Sprite_SpawnFireKeese: Spawns a Keese sprite ($11) withSprSubtype = $01(Fire Keese).Sprite_SpawnIceKeese: Spawns a Keese sprite ($11) withSprSubtype = $00(Ice Keese).
Interactions:
- Damage: Responds to damage from Link, including flashing and bouncing from tile collisions.
- Attacks: Can spawn Fire Keese and utilize
Sprite_Twinrova_FireAttack(a shared attack function).
Discrepancies/Notes:
- Shared Sprite ID: The Vampire Bat efficiently reuses the generic Keese sprite ID (
$11), withSprSubtype = 02serving as the primary differentiator for its unique behavior. - Health Management: Its health is configured within the generic
Sprite_Keese_Preproutine based on its subtype. - Code Reuse: It reuses
Sprite_Twinrova_FireAttack, demonstrating efficient code sharing across different boss/mini-boss sprites. - Hardcoded Values: Many numerical values for timers, speeds, and offsets are hardcoded. Replacing these with named constants would improve readability and maintainability.