AzaleaKurt_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1
	dbw MAPCALLBACK_TILES, .open_basement

.open_basement
	checkevent EVENT_UNLOCK_KURT_CHAMBER
	sif true
		changeblock 14, 4, $1e
	return

AzaleaKurtBallMakingTools:
	farjump BallMakingScript

AzaleaKurtKurt:
	db TX_COMPRESSED, $62, $7d, $e8, $7f, $1d, $16, $41, $30, $d2, $ef

	db $c0, $0a, $0c, $65, $67, $b6, $73, $62, $bd, $ef
	db $7e, $f5, $38, $d2, $2e, $55, $bd, $52, $81, $06, $35
	db $80, $b0, $cb, $49, $c6, $57, $b8, $58, $c9
	db $cb, $d7, $aa, $fa, $70, $64, $96, $93, $8b, $1f, $29
	db $b0, $08, $1e, $4e, $07, $09, $69, $38, $b0, $85
	db $f7, $b4, $99, $83, $25, $9a, $f5, $9b, $95, $0e
	db $d2, $aa, $d2, $72, $c2, $1e, $a3
	db $d4, $d0

AzaleaKurtGranddaughter:
	faceplayer
	opentext
	copybytetovar BallMakingLevel
	sif <, 35
		jumptext .low_level_text
	checkevent EVENT_UNLOCK_KURT_CHAMBER
	sif true
		jumptext .already_unlocked_basement_text
	writetext .before_unlocking_basement_text
	follow 2, PLAYER
	closetext
	checkcode VAR_FACING
	sif =, UP, then
		applymovement 2, .movement_facing_up
	selse
		applymovement 2, .movement_not_facing_up
	sendif
	stopfollow
	playsound SFX_ENTER_DOOR
	changeblock 14, 4, $1e
	setevent EVENT_UNLOCK_KURT_CHAMBER
	jumptext .unlocked_basement_text

.movement_facing_up
	slow_step_right
	slow_step_down
	slow_step_right
	slow_step_right
	slow_step_right
	slow_step_right
	turn_head_left
	step_end

.movement_not_facing_up
	slow_step_down
	slow_step_right
	slow_step_right
	slow_step_right
	slow_step_right
	slow_step_right
	turn_head_left
	step_end

.low_level_text
	db TX_COMPRESSED, $61, $2f, $49, $91, $1b, $1a, $41, $e6, $58
	db $5e, $7f, $54, $8e, $03, $95, $5e, $f7, $a8, $98, $05
	db $60, $04, $18, $44, $74, $ff, $1a, $25, $8f, $b1, $23
	db $43, $c9, $39, $c8, $6e, $6a, $ed, $2b, $1d, $8d, $1e

	db $00, $0f, $0d, $51, $27, $2c, $f5, $94, $9a
	db $1e, $10, $61, $11, $d3, $89, $0d, $52
	db $c2, $a9, $fd, $52, $39, $69, $37
	db $fd, $4d

.before_unlocking_basement_text
	db TX_COMPRESSED, $6e, $1a, $bf, $01, $05, $a2, $e3, $9a, $af
	db $a6, $f5, $86, $3f, $aa, $47, $14, $d6, $33, $26
	db $55, $09, $6f, $7a, $8a

	db $50, $0e, $a2, $12, $16, $bb, $92, $53, $22, $12, $1a
	db $9e, $04, $16, $a5, $a4, $68, $a7, $82, $2b, $6a
	db $d5, $60, $1e, $f4, $35, $47, $cf
	db $d4, $f1, $00

.unlocked_basement_text
	db TX_COMPRESSED, $74, $49, $69, $38, $af, $50, $6f, $99, $2f
	db $ef, $5a, $4d, $67, $8a, $58, $43, $d4, $4b, $4e
	db $d8, $0a, $87, $de, $cd, $ef, $43, $54, $04, $16, $a5
	db $85, $e7, $f5, $48, $e2, $02, $f9, $c0, $e1, $2d
	db $26, $a9, $7a, $b3, $45, $c5, $7b, $de, $a3

	db $c0, $0a, $49, $82, $2e, $38, $0c, $6b, $05, $13, $ab
	db $cb, $d6, $18, $fe, $a9, $1f, $e2, $03, $01, $05
	db $a0, $15, $04, $94, $c9, $bd, $ab, $41
	db $21, $e4, $34, $cb, $26, $79

	db $f0, $01, $26, $af, $f2, $d2, $71, $f0, $ac
	db $de, $e9, $83, $1f, $51, $01, $05, $a9, $ce, $8c, $9f
	db $01, $69, $38, $7a, $81, $9a, $e0, $ee, $72, $76
	db $87, $ac, $31, $fd, $52, $39, $69, $37
	db $fd, $4d

.already_unlocked_basement_text
	db TX_COMPRESSED, $15, $d0, $4a, $ce, $02, $0b, $51, $9d
	db $23, $cc, $84, $96, $32, $34, $71, $f0
	db $4a, $98, $4b, $d2, $64, $46, $e2, $9d, $3e, $75, $90, $5e

	db $00, $ea, $2b, $3e, $8c, $c1, $8e, $0c, $90, $10, $5a
	db $e3, $4d

AzaleaKurt_MapEventHeader:: db 0, 0

.Warps
	db 3
	warp_def $7, $3, 3, AZALEA_TOWN
	warp_def $7, $4, 3, AZALEA_TOWN
	warp_def $5, $f, 1, AZALEA_KURT_BASEMENT

.CoordEvents
	db 0

.BGEvents
	db 1
	signpost 2, 14, SIGNPOST_READ, AzaleaKurtBallMakingTools

.ObjectEvents
	db 2
	person_event SPRITE_LASS, 4, 9, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, AzaleaKurtGranddaughter, -1
	person_event SPRITE_KURT, 2, 3, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, AzaleaKurtKurt, -1

