Flying Stalfos Head

From TLoZ: ALTTP Hacking Resources
Jump to: navigation, search
This is a subpage of Sprites

Sprite $02: Flying Stalfos Head

Flying Stalfos Head

Description

The head of a stalfos which disconnects and moves independently.

Combat Strategy

Due to its high HP, it is unlikely the player will be able to kill it. Avoiding it is the best option.

Stats And Properties

See Sprite Properties

$06B082

Bit(s) Info Value
7 Harmless 0
6  ? 0
5  ? 0
4-0 OAM Slots 00001 ($01)

$06B175

Bit(s) Info Value
7-0 HP 1111 1111 ($FF)

$06B268

Bit(s) Info Value
7-4  ? 1000 ($80)
3-0 Damage Type 0001 ($01)

$06B35B

Bit(s) Info Value
7 No Death Animation 0
6 Invincible 0
5 Adjust Child coordinates 0
4 Draw Shadow 1
3-1 Palette 101 ($05)
0  ? 1

$06B44E

Bit(s) Info Value
7 Ignore Collision Settings 0
6 Statis 0
5 Persist 0
4-0 Hit Box Dimensions 00000 ($00)

$06B541

Bit(s) Info Value
7-4 Tile Interaction Hit Box 0000 ($00)
3  ? 0
2  ? 0
1 Dies Like A Boss 0
0 Falls In Holes 0

$06B634

Bit(s) Info Value
7 Disable Tile Interactions 1
6  ? 0
5 Is shield Blockable 0
4 Alternate Damage Sound 0
3-0 Prize Pack 0100 ($04)

$06B727

Bit(s) Info Value
7  ? 0
6  ? 1
5 Is Interactive 0
4 Deflect Projectiles 0
3 Collide With Less Tiles 0
2 Impervious To Sword/Hammer 1
1 Impervious To Arrows? 0
0  ? 0

Code

   ; $35DAF-$35DB6 DATA
   pool Sprite_StalfosHead:
   {
   
   .h_flip
       db $00, $00, $00, $40
   
   .animation_states
       db 0, 1, 2, 1
   }
==============================================================================
   ; *$35DB7-$35E4C JUMP LOCATION
   Sprite_StalfosHead:
   {
       ; Force the sprite's layer to be that of the player's.
       ; \note This is somewhat unusual.
       LDA $EE : STA $0F20, X
       
       LDA $0E00, X : BEQ .use_typical_oam_region
       
       LDA.b #$08 : JSL OAM_AllocateFromRegionC
   
   .use_typical_oam_region
   
       LDA $0E80, X : LSR #3 : AND.b #$03 : TAY
       
       LDA $0F50, X : AND.b #$BF : ORA .h_flip, Y : STA $0F50, X
       
       LDA .animation_states, Y : STA $0DC0, X
       
       LDA.b #$30 : STA $0B89, X
       
       JSR Sprite_PrepAndDrawSingleLarge
       JSR Sprite_CheckIfActive
       JSR Sprite_CheckIfRecoiling
       JSR Sprite_CheckDamage
       
       LDA $0EA0, X : BEQ .not_recoiling
       
       ; This sprite can't be recoiled by hitting it. That's part of why
       ; they're annoying.
       JSR Sprite_Zero_XY_Velocity
   
   .not_recoiling
   
       JSR Sprite_Move
       
       INC $0E80, X
       
       LDA $0DF0, X : BEQ .flee_from_player
       AND.b #$01   : BNE  .return
       
       LDA.b #$10 : JSR Sprite_ProjectSpeedTowardsPlayer
   
   .approach_target_speed
   
       LDA $0D40, X : CMP $00 : BEQ .at_target_x_speed
                                BPL .above_target_x_speed
       
       INC $0D40, X
       
       BRA .check_y_speed
   
   .above_target_x_speed
   
       DEC $0D40, X
   
   .at_target_x_speed
   .check_y_speed
   
       LDA $0D50, X : CMP $01 : BEQ  .return
                                BPL .above_target_y_speed
       
       INC $0D50, X
       
       BRA  .return
   
   .above_target_y_speed
   
       DEC $0D50, X
   
    .return
   
       RTS
   
   .flee_from_player
   
       TXA : EOR $1A : AND.b #$03 : BNE .return
       
       LDA.b #$10
       
       JSR Sprite_ProjectSpeedTowardsPlayer
       
       LDA $00 : EOR.b #$FF : INC A : STA $00
       LDA $01 : EOR.b #$FF : INC A : STA $01
       
       BRA .approach_target_speed
   }