OwsauriGameCorner_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

OwsauriGameCorner_GoldToken:
	dw EVENT_OWSAURI_GAME_CORNER_HIDDENITEM_GOLD_TOKEN
	db GOLD_TOKEN

OwsauriGameCornerMonExchange:
	faceplayer
	opentext
	special Special_DisplayCoinCaseBalance
	writetext GameCorner_Text_ExchangeGameCoins
	writetext GameCornerMonExchange_Text_WhichMon
	menuanonjumptable .menu
	dw .done
	dw .sneasel
	dw .absol
	dw .spiritomb
.done
	farjump GameCorner_SaveYourCoinsComeAgain

.menu
	db $40 ; flags
	db 03, 00 ; start coords
	db 11, 19 ; end coords
	dw .options
	db 1 ; default option

.options
	db $80
	db $3
	db "Sneasel      2500@"
	db "Absol        5000@"
	db "Spiritomb    7500@"

.sneasel
	writebyte SNEASEL
	copyvartobyte wScriptTemp
	checkcoins 2500
	farscall GameCornerMonExchange_GetMon
	copybytetovar wScriptTemp + 1
	sif true
		takecoins 2500
	end

.absol
	writebyte ABSOL
	copyvartobyte wScriptTemp
	checkcoins 5000
	farscall GameCornerMonExchange_GetMon
	copybytetovar wScriptTemp + 1
	sif true
		takecoins 5000
	end

.spiritomb
	writebyte SPIRITOMB
	copyvartobyte wScriptTemp
	checkcoins 7500
	farscall GameCornerMonExchange_GetMon
	copybytetovar wScriptTemp + 1
	sif true
		takecoins 7500
	end

GameCornerMonExchange_Text_WhichMon::
	db TX_COMPRESSED, $6e, $91, $b2, $98, $0e, $57, $c2
	db $47, $aa, $0b, $5d, $cc, $04, $16, $a7, $46, $a4, $74
	db $b4, $d0

OwsauriGameCornerTMExchange:
	faceplayer
	opentext
	special Special_DisplayCoinCaseBalance
	writetext GameCorner_Text_ExchangeGameCoins
	writetext GameCornerTMExchange_Text_WhichTM
	menuanonjumptable .menu
	dw .done
	dw .tm84
	dw .tm85
	dw .tm86
.done
	farjump GameCorner_SaveYourCoinsComeAgain

.menu
	db $40 ; flags
	db 03, 05 ; start coords
	db 11, 19 ; end coords
	dw .options
	db 1 ; default option

.options
	db $80
	db $3
	db "TM84    3000@"
	db "TM85    3000@"
	db "TM86    3000@"

.tm84
	writebyte 84
	jump OwsauriGameCorner_TMExchange_DoExchange

.tm85
	writebyte 85
	jump OwsauriGameCorner_TMExchange_DoExchange

.tm86
	writebyte 86
	; fallthrough

OwsauriGameCorner_TMExchange_DoExchange::
	scriptstartasm
	ld a, [hScriptVar]
	ld [TempNumber], a
	ld [wCurTMHM], a
	ld hl, TMsHMs
	ld c, a
	dec c
	ld b, CHECK_FLAG
	call FlagAction
	ld hl, .got_TM
	ret nz
	callba GetTMHMMove
	call GetMoveName
	scriptstopasm
	writetext OwsauriGameCorner_TMExchange_Text_ThisTMIs
	yesorno
	iffalse .done
	checkcoins 3000
	sif =, 2
		jumptext GameCorner_Text_NeedMoreCoins
	takecoins 3000
	writetext GameCorner_Text_HereYouGo
	copybytetovar TempNumber
	givetm 0 + RECEIVED_TM
.done
	closetext
	end
.got_TM
	jumptext OwsauriGameCorner_Text_AlreadyGotTM

GameCornerTMExchange_Text_WhichTM::
	db TX_COMPRESSED, $6e, $91, $b2, $98, $50, $ac, $a8, $2d, $77
	db $2f, $02, $0b, $53, $a3, $52, $3a
	db $5a, $68

GameCorner_Text_ExchangeGameCoins::
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9f

	db $10, $0d, $ce, $1d, $3a, $ca, $74, $9c, $9c, $04, $16
	db $96, $f7, $3a, $f9, $c6, $42, $32, $22, $60, $15
	db $aa, $c3, $55, $b5, $d0, $b4, $88, $21, $63, $13, $66, $8e
	db $34, $f1, $00

GameCornerSlots::
	random 6
	sif >, 1
		writebyte 0
	refreshscreen 0
	special Special_SlotMachine
	closetext
	end

OwsauriCardFlip:
	random 6
	sif >, 1
		writebyte 0
	refreshscreen 0
	special Special_CardFlip
	closetext
	end

OwsauriBlackjack:
	farjump GameCornerBlackjack

OwsauriPoker:
	farjump GameCornerPoker

OwsauriMemoryGame:
	farjump GameCornerMemoryGame

OwsauriGameCornerNPC1:
	db TX_COMPRESSED, $75, $1f, $d5, $23, $9b, $3a, $30, $61, $93
	db $97, $aa, $1d, $a6, $5a, $46, $8e

	db $20, $1d, $4c, $02, $d1, $33, $36, $72, $d0
	db $27, $aa, $48, $5c, $3d, $87, $4e, $b2, $9d, $27
	db $26, $01, $90, $8c, $88, $98, $05, $71, $67, $bd
	db $79, $f0, $90, $c1

	db $78, $01, $49, $30, $58, $d1, $48, $6c, $a9, $47
	db $cd, $e0, $b5, $70, $38, $44, $9a, $ce, $0f
	db $00, $16, $93, $05, $14, $88, $75, $47, $53, $23
	db $cb, $d6, $9d, $b9, $69, $0b, $5c, $a7
	db $d4, $d0

OwsauriGameCornerNPC2:
	db TX_COMPRESSED, $ae, $2c, $20, $b7, $b3, $0e, $b4, $84
	db $bd, $50, $fb, $d9, $c8, $c1, $8e, $02, $0b
	db $4a, $9c, $d1, $6c, $58, $16, $23, $21, $19, $11

	db $e0, $0e, $b0, $80, $82, $d4, $b4, $8c, $8a, $50, $10, $5a
	db $79, $3a, $0c, $73, $62, $12, $1b, $9b, $73
	db $40, $2c, $20, $b7, $b3, $0e, $b4, $84
	db $fd, $ee, $43, $30, $0a, $e5, $a7, $6e, $10
	db $2a, $9f, $db, $b3, $5c, $a9, $3b, $7e
	db $a6, $80

OwsauriGameCornerNPC3:
	db TX_COMPRESSED, $75, $84, $04, $16, $a6, $42, $4a, $64, $4e, $83
	db $1b, $db, $1b, $42, $32, $46, $dd, $41
	db $80, $de, $ac, $f7, $20, $bf, $39, $3b, $81, $21
	db $bc, $32, $45, $02, $1a, $5f, $27, $1b, $47, $60
	db $95, $0c, $90, $1f, $bd, $a7, $03

	db $e0, $0a, $02, $f9, $c4, $27, $72, $0a, $72, $d0
	db $27, $90, $7d, $ea, $25, $a4, $df, $96, $93, $59
	db $fa, $9a

OwsauriGameCornerNPC4:
	db TX_COMPRESSED, $6f, $b6, $ca, $46, $4e, $65, $a4, $e2, $cc, $fa
	db $87, $99, $e8, $50, $70, $c8, $16, $b9, $4c, $a8, $7d
	db $e8, $04, $9f, $44, $40, $41, $6a, $2c, $f5, $94
	db $bc, $08, $2d, $2e, $72, $1d, $ef
	db $a9, $a0

OwsauriGameCornerNPC5:
	db TX_COMPRESSED, $29, $26, $83, $84, $3a, $a3, $3a, $bc
	db $bd, $ce, $be, $68, $9a, $b3, $88
	db $0a, $ad, $ce, $46, $cd, $8c, $9c, $f1

	db $00, $ea, $f1, $4d, $56, $80, $f5, $ab, $3e, $82
	db $79, $95, $e8, $9b, $05
	db $c6, $9a

OwsauriGameCornerNPC6:
	db TX_COMPRESSED, $50, $17, $ce, $08, $30, $88, $e9, $c4, $68
	db $27, $ad, $3b, $73, $23, $c3, $03, $59, $92
	db $c0, $73, $af, $9c, $64, $2b, $21, $ad, $11, $3a, $0c
	db $6f, $64, $78, $60, $6b, $32, $5c, $0e, $72, $8f
	db $80, $56, $d5, $c7, $53, $21, $25, $32, $2b, $3e, $8c, $c1
	db $8d, $e1, $df
	db $a9, $a0

GameCorner_Text_HereYouGo::
	db TX_COMPRESSED, $62, $6b, $38, $08, $2d, $4e, $43
	db $c6, $9e, $20

OwsauriGameCorner_TMExchange_Text_ThisTMIs:
	db TX_COMPRESSED, $29, $23, $44, $28, $56, $0d
	db $0f, $03, $91

	db $c4, $03, $7d, $25, $c1, $dd
	db $2d, $34

GameCorner_Text_NeedMoreCoins::
	db TX_COMPRESSED, $c7, $08, $54, $91, $3a, $35, $23, $80, $82
	db $d3, $c4, $33, $cc, $7c, $2b, $38, $c8, $46, $44
	db $2a, $c0, $2b, $96, $9d, $bf
	db $53, $40

OwsauriGameCorner_Text_AlreadyGotTM:
	db TX_COMPRESSED, $72, $85, $a9, $bd, $59, $ee, $41, $44, $e8, $31
	db $bd, $69, $1a, $21, $42, $bc
	db $69, $a0

GameCorner_Text_NoRoomInParty::
	db TX_COMPRESSED, $53, $59, $9c, $68, $44, $40, $5f
	db $37, $90, $23, $59, $38, $32, $40, $41, $69
	db $6a, $84, $6a, $ec, $14, $c0, $6b, $45, $f1
	db $a6, $80

OwsauriGameCorner_MapEventHeader:: db 0, 0

.Warps
	db 2
	warp_def $11, $2, 7, OWSAURI_CITY
	warp_def $11, $3, 7, OWSAURI_CITY

.CoordEvents
	db 0

.BGEvents
	db 48
	signpost 8, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 9, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 10, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 11, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 12, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 13, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 14, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 15, 1, SIGNPOST_READ, OwsauriMemoryGame
	signpost 8, 6, SIGNPOST_READ, GameCornerSlots
	signpost 9, 6, SIGNPOST_READ, GameCornerSlots
	signpost 10, 6, SIGNPOST_READ, GameCornerSlots
	signpost 11, 6, SIGNPOST_READ, GameCornerSlots
	signpost 12, 6, SIGNPOST_READ, GameCornerSlots
	signpost 13, 6, SIGNPOST_READ, GameCornerSlots
	signpost 14, 6, SIGNPOST_READ, GameCornerSlots
	signpost 15, 6, SIGNPOST_READ, GameCornerSlots
	signpost 8, 7, SIGNPOST_READ, GameCornerSlots
	signpost 9, 7, SIGNPOST_READ, GameCornerSlots
	signpost 10, 7, SIGNPOST_READ, GameCornerSlots
	signpost 11, 7, SIGNPOST_READ, GameCornerSlots
	signpost 12, 7, SIGNPOST_READ, GameCornerSlots
	signpost 13, 7, SIGNPOST_READ, GameCornerSlots
	signpost 14, 7, SIGNPOST_READ, GameCornerSlots
	signpost 15, 7, SIGNPOST_READ, GameCornerSlots
	signpost 8, 12, SIGNPOST_READ, OwsauriPoker
	signpost 9, 12, SIGNPOST_READ, OwsauriPoker
	signpost 10, 12, SIGNPOST_READ, OwsauriPoker
	signpost 11, 12, SIGNPOST_READ, OwsauriPoker
	signpost 12, 12, SIGNPOST_READ, OwsauriPoker
	signpost 13, 12, SIGNPOST_READ, OwsauriPoker
	signpost 14, 12, SIGNPOST_READ, OwsauriPoker
	signpost 15, 12, SIGNPOST_READ, OwsauriPoker
	signpost 8, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 9, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 11, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 12, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 13, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 14, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 15, 13, SIGNPOST_READ, OwsauriBlackjack
	signpost 8, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 9, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 10, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 11, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 12, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 13, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 14, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 15, 18, SIGNPOST_READ, OwsauriCardFlip
	signpost 10, 13, SIGNPOST_ITEM, OwsauriGameCorner_GoldToken

.ObjectEvents
	db 9
	person_event SPRITE_RECEPTIONIST, 4, 16, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, OwsauriGameCornerMonExchange, -1
	person_event SPRITE_RECEPTIONIST, 4, 14, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, OwsauriGameCornerTMExchange, -1
	person_event SPRITE_CLERK, 4, 2, SPRITEMOVEDATA_00, 0, 0, -1, -1, PAL_OW_BROWN, PERSONTYPE_JUMPSTD, 0, gamecornercoinvendor, -1
	person_event SPRITE_BUENA, 14, 2, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC1, -1
	person_event SPRITE_TEACHER, 11, 14, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC2, -1
	person_event SPRITE_LASS, 10, 11, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC3, -1
	person_event SPRITE_COOLTRAINER_M, 13, 17, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC4, -1
	person_event SPRITE_FISHER, 12, 5, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC5, -1
	person_event SPRITE_ROCKER, 9, 2, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_TEXTFP, 0, OwsauriGameCornerNPC6, -1

