; SpinBoostBlock.asm
;			by Maddy, allegedly

; Created for 'Me, Reaping' in Super "Sonic Saves the World" World
; When the player touches this block, it vanishes and puts the player in a fly state as though they just took off
; It also refills the player's flight timer.

; Feel free to reuse this code however you want. Credit is appreciated :)

; Usage: This is a GPS block file

db $42 
JMP Mario : JMP Mario : JMP Mario
JMP Return : JMP Return : JMP Return : JMP Return
JMP Mario : JMP Mario : JMP Mario

Mario:
	; set cape phase
	LDA #$00
	STA $1407
	
	; set p-speed
	LDA #$0C
	STA $72
	
	; set not spinning
	STZ $140D
	
	; set cape rise timer
	LDA #$50
	STA $149F
	
	; set x speed
	LDA #$32
	STA $7B
	
	; set y speed
	LDA #$A4
	STA $7D
	
	; set facing
	LDA #$01
	STA $76
	
	; sfx
	LDA #$25
	STA $1DFC

	%create_smoke()
	%erase_block()
	
	; in my hack I disable some buttons for a short time after hitting the block
	; this is to prevent accidental turn-arounds immediately after hitting the block
	; but that requires some extra UberASM setup as well, so this version doesn't do it
	; LDA #$2D
	; STA $0F5F
	
Return:
	RTL

print "Puts the player in a rightward fly state as though they just took off."
