PachisiGameBotan::
	callasm SetBoardIDBotan
	jump PachisiMain

PachisiGameTorenia::
	callasm SetBoardIDTorenia

PachisiMain:
	opentext
	special PlaceMoneyTopRight
	writetext PachisiTextStartText
	yesorno
	iffalse .endPachisi
	checkmoney $0, 2000
	if_equal 2, .notenoughmoney
	takemoney $0, 2000
	waitsfx
	playsound SFX_TRANSACTION
	closetext
	applymovement 0, .playerMoveOutOfWay
	applymovement 2, .guardMoveDown
	applymovement 0, .playerEnterBoard
	applymovement 2, .guardMoveUp
	playmusic MUSIC_MOBILE_ADAPTER
	callasm InitRolls

.pachisiloop
	opentext
	callasm FacePlayerToNextTile
	applymovement 0, wPachisiPath
	callasm CheckRollCount
	if_equal 0, .outofrolls
	if_equal 1, .onlastroll
	writetext PachisiAskRollText
	yesorno
	iffalse .asktoend

.rolldice
	callasm RollDice
	writetext PachisiRolledDiceText
.moveplayer
	waitbutton
	closetext
	applymovement 0, wPachisiPath
	callasm GetPachisiTile
	if_greater_than PACHISI_WARP_BOTAN_SECTION_4, .pachisiloop
	anonjumptable
	dw .pachisiloop
	dw .grassTile
	dw .waterTile
	dw .caveTile
	dw .moneytile
	dw .healTile
	dw .itemTile
	dw .muncherTile
	dw .warpTile1
	dw .warpTile2
	dw .deathTile
	dw .diceTile
	dw .randomTile
	dw .finishTile
	dw .forwardsTile
	dw .backwardsTile
	dw .warpTileItems
	dw .warpTileBotanSection2
	dw .warpTileRandom
	dw .warpTileBotanSection3
	dw .warpTileBotanSection4
	dw .pachisiloop

.warpTileItems
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp BOTAN_PACHISI, 38, 2
	playmusic MUSIC_MOBILE_ADAPTER
	playsound SFX_WARP_TO
	applymovement 0, .warpTo
	writebyte $BC
	callasm JumpToSquare
	jump .pachisiloop

.warpTileRandom
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp BOTAN_PACHISI, 27, 30
	playsound SFX_WARP_TO
	playmusic MUSIC_MOBILE_ADAPTER
	applymovement 0, .warpTo
	writebyte $93
	callasm JumpToSquare
	jump .pachisiloop

.warpTileBotanSection4
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp BOTAN_PACHISI, 10, 30
	playsound SFX_WARP_TO
	playmusic MUSIC_MOBILE_ADAPTER
	applymovement 0, .warpTo
	writebyte $6e
	callasm JumpToSquare
	jump .pachisiloop

.warpTileBotanSection3
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp BOTAN_PACHISI, 17, 18
	playsound SFX_WARP_TO
	playmusic MUSIC_MOBILE_ADAPTER
	applymovement 0, .warpTo
	writebyte $4a
	callasm JumpToSquare
	jump .pachisiloop

.warpTileBotanSection2
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp BOTAN_PACHISI, 12, 8
	playsound SFX_WARP_TO
	playmusic MUSIC_MOBILE_ADAPTER
	applymovement 0, .warpTo
	writebyte $1c
	callasm JumpToSquare
	jump .pachisiloop

.onlastroll
	opentext
	writetext PachisiAskRollFinalText
	yesorno
	iffalse .asktoend
	jump .rolldice

.outofrolls
	opentext
	writetext PachisiOutOfRollsText
	playwaitsfx SFX_QUIT_SLOTS
	closetext
	jump .loseGame

.moneytile
	opentext
	playwaitsfx SFX_TRANSACTION
	writetext PachisiMoneyText
	givemoney $0, 500
	waitbutton
	closetext
	jump .pachisiloop

.grassTile
	setlasttalked 255
	writecode 3, BATTLETYPE_TRAP
	callasm PachisiGetGrassPokemon
	startbattle
	dontrestartmapmusic
	reloadmap
	iftrue .loseGame
	playmusic MUSIC_MOBILE_ADAPTER
	jump .pachisiloop

.caveTile
	setlasttalked 255
	writecode 3, BATTLETYPE_TRAP
	callasm PachisiGetCavePokemon
	startbattle
	dontrestartmapmusic
	reloadmap
	iftrue .loseGame
	playmusic MUSIC_MOBILE_ADAPTER
	jump .pachisiloop

.waterTile
	setlasttalked 255
	writecode 3, BATTLETYPE_TRAP
	callasm PachisiGetWaterPokemon
	startbattle
	dontrestartmapmusic
	reloadmap
	iftrue .loseGame
	playmusic MUSIC_MOBILE_ADAPTER
	jump .pachisiloop

.healTile
	special HealParty
	special Special_BattleTowerFade
	playwaitsfx SFX_HEAL_POKEMON
	special FadeInPalettes
	opentext
	writetext HealTileText
	waitbutton
	closetext
	jump .pachisiloop

.itemTile
	callasm GetPachisiItem
	opentext
	verbosegiveitem ITEM_FROM_MEM
	waitbutton
	jump .pachisiloop

.muncherTile
	opentext
	playwaitsfx SFX_BEAT_UP
	writetext PachisiMuncher
	takemoney $0, 500
	waitbutton
	closetext
	jump .pachisiloop

.warpTile1
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp TORENIA_PACHISI, 3, 12
	playmusic MUSIC_MOBILE_ADAPTER
	playsound SFX_WARP_TO
	applymovement 0, .warpTo
	callasm JumpToSquare69
	jump .pachisiloop

.warpTile2
	playsound SFX_WARP_FROM
	applymovement 0, .warpFrom
	special FadeOutPalettes
	warp TORENIA_PACHISI, 18, 2
	playmusic MUSIC_MOBILE_ADAPTER
	playsound SFX_WARP_TO
	applymovement 0, .warpTo
	callasm JumpToSquare42
	jump .pachisiloop

.warpFrom
	teleport_from
	step_end

.warpTo
	teleport_to
	step_end

.deathTile
	playmusic MUSIC_NONE
	playwaitsfx SFX_GS_INTRO_CHARIZARD_FIREBALL
	opentext
	writetext PachisiDeathText
	waitbutton
	closetext
	jump .loseGame

.diceTile
	callasm GiveAdditionalRolls
	playwaitsfx SFX_EGG_HATCH
	opentext
	writetext PachisiGetDiceRollsText
	waitbutton
	closetext
	jump .pachisiloop

.randomTile
	random 10
	if_equal PACHISI_GRASS, .grassTile
	if_equal PACHISI_CAVE, .caveTile
	if_equal PACHISI_WATER, .waterTile
	if_equal PACHISI_HEAL, .healTile
	if_equal PACHISI_ITEM, .itemTile
	if_equal PACHISI_MUNCHER, .muncherTile
	if_equal PACHISI_MONEY, .moneytile
	if_equal PACHISI_DEATH - 2, .deathTile
	if_equal PACHISI_DICE - 2, .diceTile
	if_equal PACHISI_FORWARDS - 4, .forwardsTile
	if_equal PACHISI_BACKWARDS - 4, .backwardsTile
	jump .pachisiloop

.forwardsTile
	opentext
	random 6
	callasm ForwardTile
	writetext PachisiMoveForwardText
	jump .moveplayer

.backwardsTile
	opentext
	random 6
	callasm BackwardsTile
	writetext PachisiMoveBackwardsText
	jump .moveplayer

.finishTile
	playwaitsfx SFX_DEX_FANFARE_230_PLUS
	scriptstartasm
	ld hl, wPachisiWinCount
	inc [hl]
	jr nz, .done_increasing_win_count
	inc hl
	inc [hl]
	jr nz, .done_increasing_win_count
	ld a, $ff
	ld [hld], a
	ld [hl], a
.done_increasing_win_count
	scriptstopasm
	callasm GetBoardID
	iftrue .botanWin

	warpfacing 1, TORENIA_PACHISI, $11, $1b
	opentext
	writetext PachisiCongratsText
	waitbutton
	checkevent EVENT_TORENIA_SHINY_BALL
	iftrue .giveBigNugget
	setevent EVENT_TORENIA_SHINY_BALL
.giveShinyBall
	verbosegiveitem SHINY_BALL
	waitbutton
	closetext
	end

.botanWin
	warpfacing 1, BOTAN_PACHISI, 15, 39
	opentext
	writetext PachisiCongratsText
	waitbutton
	checkevent EVENT_BOTAN_SHINY_BALL
	iftrue .giveBigNugget
	setevent EVENT_BOTAN_SHINY_BALL
	jump .giveShinyBall

.endPachisi
	closetext
	end

.giveBigNugget
	verbosegiveitem BIG_NUGGET
	waitbutton
	closetext
	end

.asktoend
	writetext AskLeaveText
	yesorno
	iftrue .loseGame
	jump .pachisiloop

.loseGame
	special HealParty

	callasm ForceMapMusicRestart
	callasm GetBoardID
	iftrue .botanLose
	warpfacing 1, TORENIA_PACHISI, $11, $1b
	jumptext LostGameText

.botanLose
	warpfacing 1, BOTAN_PACHISI, 15, 39
	jumptext LostGameText

.notenoughmoney
	jumptext PachisiTextNotEnoughMoney

.playerMoveOutOfWay
	step_left
	turn_head_right
	step_end

.guardMoveDown
	step_down
	step_down
	turn_head_up
	step_end

.playerEnterBoard
	step_right
	step_up
	step_up
	step_end

.guardMoveUp
	step_up
	step_up
	step_end

JumpToSquare:
	ld a, [hScriptVar]
	ld [wPachisiPosition], a
	ret

GetBoardID:
	ld a, [wPachisiBoardID]
	ld [hScriptVar], a
	ret

FacePlayerToNextTile:
	call GetPachisiDirection
	ld a, [wPachisiPosition]
	ld c, a
	ld b, 0
	add hl, bc
	ld a, [hl]
	and $3
	ld hl, wPachisiPath
	ld [hli], a
	ld a, movement_step_end
	ld [hl], a
	ret

ForwardTile:
	ld a, [hScriptVar]
	inc a
	ld [hScriptVar], a
	jp CreatePachisiPath

BackwardsTile:
	ld a, [hScriptVar]
	inc a
	ld [hScriptVar], a

	ld c, a
	push bc

	ld a, [wPachisiPosition]
	dec a

	ld e, a
	ld d, 0
	call GetPachisiDirection
	add hl, de
	ld de, wPachisiPath

.loop
	ld a, [hl]

	cp movement_step_end
	jr z, .endLoop

	bit 0, a
	jr z, .bitOff
	res 0, a
	jr .write

.bitOff
	set 0, a

.write
	ld [de], a
	dec hl
	inc de
	dec c
	jr nz, .loop

.endLoop
	ld a, movement_step_end
	ld [de], a

	pop bc
	ld a, [wPachisiPosition]
	sub c
	ld [wPachisiPosition], a
	ret

GiveAdditionalRolls:
	call Random
	and 3
	inc a
	cp 4
	jr nz, .notfour
	ld a, 2
.notfour
	ld [TempNumber], a
	ld c, a
	ld a, [wPachisiDiceRolls]
	add c
	ld [wPachisiDiceRolls], a
	ret

SetBoardIDBotan:
	ld a, 1
	jr SetBoardID

SetBoardIDTorenia:
	xor a
SetBoardID:
	ld [wPachisiBoardID], a
	ret

CheckRollCount:
	ld a, [wPachisiDiceRolls]
	ld [hScriptVar], a
	ret

JumpToSquare69:
	ld a, 69
	ld [wPachisiPosition], a
	ret

JumpToSquare42:
	ld a, 42
	ld [wPachisiPosition], a
	ret

PachisiGetCavePokemon:
	ld hl, PachisiCavePokemon
	jr PachisiGetPokemon

PachisiGetWaterPokemon:
	ld hl, PachisiWaterPokemon
	jr PachisiGetPokemon

PachisiGetGrassPokemon:
	ld hl, PachisiGrassPokemon

PachisiGetPokemon:
	ld a, (1 << 7) | 1
	ld [wBattleScriptFlags], a
	call Random
	and $f

	ld c, a
	ld b, 0
	add hl, bc
	ld a, [hl]
	ld [TempWildMonSpecies], a

	call Random
	and $7
	ld c, 25
	add c
	ld [CurPartyLevel], a
	ret

PachisiGrassPokemon:
	db PIDGEOTTO
	db PARAS
	db VULPIX
	db PARAS
	db GROWLITHE
	db EXEGGCUTE
	db EXEGGCUTE
	db WEEPINBELL
	db WEEPINBELL
	db PIDGEOTTO
	db LUXIO
	db TAILLOW
	db TAILLOW
	db TAILLOW
	db SCYTHER
	db ABSOL

PachisiWaterPokemon:
	db GOLDEEN
	db MAGIKARP
	db SLOWPOKE
	db LOTAD
	db GOLDEEN
	db MAGIKARP
	db SLOWPOKE
	db LOMBRE
	db TENTACOOL
	db TENTACOOL
	db SURSKIT
	db SURSKIT
	db SLOWPOKE
	db MAGIKARP
	db MAGIKARP
	db GYARADOS

PachisiCavePokemon:
	db ZUBAT
	db GEODUDE
	db VULPIX
	db KOFFING
	db ONIX
	db KOFFING
	db VULPIX
	db GEODUDE
	db ZUBAT
	db GEODUDE
	db ZUBAT
	db ZUBAT
	db ONIX
	db RHYHORN
	db RHYHORN
	db TORKOAL

GetPachisiItem:
	ld hl, PachisiItems
	call Random
	and $3f
	ld c, a
	ld b, 0
	add hl, bc
	ld a, [hl]
	ld [hScriptVar], a
	ret

PachisiItems:
	db POTION
	db POKE_BALL
	db POTION
	db POKE_BALL
	db POTION
	db POKE_BALL
	db POTION
	db POKE_BALL
	db ANTIDOTE
	db BURN_HEAL
	db ICE_HEAL
	db AWAKENING
	db PARLYZ_HEAL
	db FULL_HEAL
	db SUPER_POTION
	db X_ATTACK
	db X_DEFEND ;10
	db X_SPEED
	db X_SPECIAL
	db SUPER_POTION
	db SUPER_POTION
	db CHERI_BERRY
	db ASPEAR_BERRY
	db RAWST_BERRY
	db PERSIM_BERRY ;18
	db CHESTO_BERRY
	db LUM_BERRY
	db LEPPA_BERRY
	db ORAN_BERRY
	db SITRUS_BERRY
	db ULTRA_BALL
	db RARE_CANDY
	db POTION
	db POKE_BALL
	db SUPER_POTION
	db GREAT_BALL
	db SUPER_POTION
	db GREAT_BALL
	db SUPER_POTION
	db GREAT_BALL
	db ANTIDOTE
	db BURN_HEAL
	db ICE_HEAL
	db AWAKENING
	db PARLYZ_HEAL
	db THUNDERSTONE
	db WATER_STONE
	db X_ATTACK
	db X_DEFEND ;30
	db X_SPEED
	db X_SPECIAL
	db GOLD_DUST
	db GOLD_DUST
	db TIMER_BALL
	db DIVE_BALL
	db FAST_BALL
	db FRIEND_BALL ;38
	db QUICK_BALL
	db THUNDERSTONE
	db LEAF_STONE
	db FIRE_STONE
	db MOOMOO_MILK
	db ULTRA_BALL
	db SACRED_ASH

GetPachisiTile:
	ld hl, ToreniaTiles
	ld a, [wPachisiBoardID]
	and a
	jr z, .inTorenia
	ld hl, BotanTiles

.inTorenia
	ld a, [wPachisiPosition]
	ld c, a
	ld b, 0
	add hl, bc
	ld a, [hl]
	ld [hScriptVar], a
	ret

GetPachisiDirection:
	ld hl, ToreniaDirections
	ld a, [wPachisiBoardID]
	and a
	ret z
	ld hl, BotanDirections
	ret

CreatePachisiPath:
	ld c, a

	call GetPachisiDirection
	ld a, [wPachisiPosition]

	ld e, a
	ld d, 0
	add hl, de
	ld b, d
	ld de, wPachisiPath
	push bc
	rst CopyBytes
	ld a, movement_step_end
	ld [de], a

	pop bc
	ld a, [wPachisiPosition]
	add c
	ld [wPachisiPosition], a
	ret

RollDice:
	ld a, 6
	call RandomRange
	inc a

	call CreatePachisiPath

	ld a, c
	ld [hScriptVar], a

	ld hl, wPachisiDiceRolls
	ld a, [hl]
	dec a
	ld [hl], a
	ret

InitRolls:
	ld a, 25
	ld [wPachisiDiceRolls], a

	xor a
	ld [wPachisiPosition], a
	ret

PachisiMoveBackwardsText:
	db TX_COMPRESSED, $15, $08, $31, $c7, $30
	deciram hScriptVar, 1, 3
	db TX_COMPRESSED, $96, $3e, $9a
	db $1e, $57, $ac, $a9, $55, $ab, $ca, $38
	db $d3, $40

PachisiMoveForwardText:
	db TX_COMPRESSED, $15, $08, $31, $c7, $30
	deciram hScriptVar, 1, 3
	db TX_COMPRESSED, $96, $3e, $9a
	db $1e, $c0, $2b, $ab, $57, $9e
	db $34, $d0

PachisiOutOfRollsText:
	db TX_COMPRESSED, $72, $85, $a8, $9d, $06, $38, $bd, $24, $0b
	db $56, $f0, $70, $8b, $0f, $7a, $8f

	db $00, $29, $27, $39, $d7, $ce, $0d, $10, $20, $c6, $bf
	db $53, $40

HealTileText:
	db TX_COMPRESSED, $72, $85, $a5, $c0, $72, $be, $12, $41, $1a, $bb
	db $04, $f5, $5a, $89, $83, $5d, $e8, $28, $93, $de, $9e, $78
	db $d3, $40

LostGameText:
	db TX_COMPRESSED, $07, $8d, $93, $96, $b0, $5f, $8c, $85, $f3
	db $79, $5e, $b2, $a5, $10, $17, $ce, $06, $d2, $6b
	db $55, $63, $7c, $f8
	db $d3, $40

AskLeaveText:
	db TX_COMPRESSED, $ad, $67, $01, $05, $a8, $86, $96, $70, $10, $5a
	db $7a, $ad, $25, $cb, $0c, $e9, $e8, $31, $cb, $49
	db $aa, $e7, $5f, $3a
	db $5a, $68

PachisiRolledDiceText:
	db TX_COMPRESSED, $72, $85, $a8, $b0, $f7, $a7, $99, $b1, $cc, $00
	deciram hScriptVar, 1, 3
	db TX_COMPRESSED
	db $e3, $4d

PachisiAskRollFinalText:
	db TX_COMPRESSED, $c7, $d4, $5c, $58, $7b, $de
	db $2f, $39, $03, $de, $cb, $49, $cc, $8d, $93, $a5
	db $a6, $80

PachisiAskRollText:
	deciram wPachisiDiceRolls, 1, 2
	db TX_COMPRESSED, $8b, $0f, $7a, $89, $d3, $c2
	db $fc, $f3, $90, $3d, $ec, $b4, $9c, $c8, $d9, $3a
	db $5a, $68

PachisiTextNotEnoughMoney:
	db TX_COMPRESSED, $72, $85, $a9, $90, $92, $99, $13, $a0
	db $c6, $f1, $90, $2d, $72, $98, $f8, $48, $60, $a5
	db $85, $50, $8e, $e8, $2f
	db $53, $40

PachisiTextStartText:
	db TX_COMPRESSED, $6e, $7d, $64, $2f, $9c, $b0, $cb, $49
	db $bd, $c3, $ac, $a4, $68, $1c, $12, $0e, $af, $3c

	db $40, $3a, $b8, $c8, $51, $68, $82, $6b, $5c, $73, $45, $81, $60, $58
	db $7a, $c3, $04, $77, $41

	db $78, $03, $7d, $25, $cb, $0c, $e4, $60, $c7, $07
	db $6f, $6c, $e4, $34
	db $b4, $d0

PachisiMoneyText:
	db TX_COMPRESSED, $72, $85, $a9, $80, $5a, $26, $60, $9a, $d7, $05, $b1, $60, $58
	db $e3, $4d

PachisiMuncher:
	db TX_COMPRESSED, $29, $27, $05, $5a, $23, $29, $35, $c2, $0c, $40, $83
	db $cb, $c2, $6b, $5c, $16, $c5, $81, $62, $07, $0c, $20, $70, $80, $82, $d7
	db $1a, $68

PachisiDeathText:
	db TX_COMPRESSED, $73, $a6, $05, $3c

	db $40, $14, $93, $9c, $eb, $e7, $06, $88, $40
	db $d4, $f0, $41, $8d, $7e
	db $a6, $80

PachisiGetDiceRollsText:
	db TX_COMPRESSED, $61, $68, $c8, $79, $8e, $60
	deciram TempNumber, 1, 3

	db TX_COMPRESSED
	db $7b, $73, $91, $d8, $c2, $4d, $ec, $58, $7b, $d4
	db $7a, $9a

PachisiCongratsText:
	db TX_COMPRESSED, $6d, $09, $39, $5e, $db, $5d, $db, $18, $48, $8e

	db $2f, $39, $42, $d4, $4e, $83, $1c, $a8, $24, $a7
	db $82, $9a

ToreniaDirections:
	rept 9
		db movement_big_step_up
	endr
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_down
	rept 4
		db movement_big_step_right
	endr
	rept 7
		db movement_big_step_up
	endr
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	rept 7
		db movement_big_step_up
	endr
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_down
	rept 5
		db movement_big_step_left
	endr
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_right
	rept 4
		db movement_big_step_down
	endr
	db movement_big_step_right
	db movement_big_step_right
	rept 5
		db movement_big_step_down
	endr
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_right
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_down
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	rept 5
		db movement_step_end
	endr
	db -1

BotanDirections:
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_up
	rept 6
		db movement_big_step_left
	endr
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_left
	db movement_big_step_up
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_up
	db movement_big_step_up
	rept 4
		db movement_big_step_right
	endr
	rept 5
		db movement_step_end
	endr

	rept 4
		db movement_big_step_left
	endr
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	rept 5
		db movement_big_step_down
	endr
	rept 6
		db movement_big_step_left
	endr
	rept 5
		db movement_big_step_up
	endr
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	rept 6
		db movement_big_step_up
	endr
	rept 5
		db movement_big_step_right
	endr
	rept 5
		db movement_step_end
	endr

	rept 4
		db movement_big_step_right
	endr
	db movement_big_step_down
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_right
	rept 6
		db movement_big_step_up
	endr
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_down
	rept 7
		db movement_big_step_right
	endr
	db movement_big_step_up
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_down
	db movement_big_step_down
	rept 5
		db movement_step_end
	endr
	db movement_big_step_right
	db movement_big_step_right
	rept 8
		db movement_big_step_down
	endr
	rept 4
		db movement_big_step_left
	endr
	db movement_big_step_up
	rept 6
		db movement_big_step_left
	endr
	rept 8
		db movement_big_step_up
	endr
	rept 4
		db movement_big_step_right
	endr
	rept 5
		db movement_step_end
	endr

	db movement_big_step_up
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_up
	db movement_big_step_up
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_right
	db movement_big_step_up
	db movement_big_step_up
	rept 5
		db movement_big_step_right
	endr
	db movement_big_step_down
	db movement_big_step_right
	db movement_big_step_right
	db movement_big_step_right
	rept 7
		db movement_big_step_down
	endr
	db movement_big_step_left
	db movement_big_step_down
	db movement_big_step_left
	db movement_big_step_left
	db movement_big_step_left
	rept 5
		db movement_big_step_down
	endr
	rept 5
		db movement_step_end
	endr

	db movement_big_step_up
	rept 13
		db movement_big_step_left
	endr
	db movement_big_step_down
	rept 5
		db movement_step_end
	endr

ToreniaTiles:
	db PACHISI_NOTHING
	db PACHISI_GRASS
	db PACHISI_FORWARDS
	db PACHISI_NOTHING
	db PACHISI_NOTHING
	db PACHISI_NOTHING
	db PACHISI_MONEY
	db PACHISI_CAVE
	db PACHISI_FORWARDS
	db PACHISI_HEAL
	db PACHISI_GRASS
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	db PACHISI_MUNCHER
	db PACHISI_WATER
	db PACHISI_FORWARDS
	db PACHISI_BACKWARDS
	db PACHISI_NOTHING
	db PACHISI_DEATH
	db PACHISI_WATER
	db PACHISI_DICE
	db PACHISI_MUNCHER
	db PACHISI_GRASS
	db PACHISI_GRASS
	db PACHISI_CAVE
	db PACHISI_HEAL
	db PACHISI_NOTHING
	db PACHISI_NOTHING
	db PACHISI_WATER
	db PACHISI_FORWARDS
	db PACHISI_MUNCHER
	db PACHISI_MONEY
	db PACHISI_WATER
	db PACHISI_MUNCHER
	db PACHISI_DICE
	db PACHISI_NOTHING
	db PACHISI_RANDOM
	db PACHISI_CAVE
	db PACHISI_DEATH
	db PACHISI_WATER
	db PACHISI_ITEM
	db PACHISI_MONEY
	db PACHISI_WARP_TORENIA_1
	db PACHISI_CAVE
	db PACHISI_BACKWARDS
	db PACHISI_NOTHING
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	db PACHISI_DICE
	db PACHISI_CAVE
	db PACHISI_MONEY
	db PACHISI_NOTHING
	db PACHISI_RANDOM
	db PACHISI_WATER
	db PACHISI_BACKWARDS
	db PACHISI_HEAL
	db PACHISI_MUNCHER
	db PACHISI_CAVE
	db PACHISI_GRASS
	db PACHISI_ITEM
	db PACHISI_ITEM
	db PACHISI_DEATH
	db PACHISI_MONEY
	db PACHISI_HEAL
	db PACHISI_BACKWARDS
	db PACHISI_GRASS
	db PACHISI_NOTHING
	db PACHISI_GRASS
	db PACHISI_FORWARDS
	db PACHISI_WARP_TORENIA_2
	db PACHISI_MUNCHER
	db PACHISI_NOTHING
	db PACHISI_DICE
	db PACHISI_MONEY
	db PACHISI_GRASS
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	db PACHISI_NOTHING
	db PACHISI_NOTHING
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_BACKWARDS
	db PACHISI_MONEY
	db PACHISI_MONEY
	db PACHISI_RANDOM
	db PACHISI_MUNCHER
	db PACHISI_DICE
	db PACHISI_DEATH
	db PACHISI_BACKWARDS
	db PACHISI_DEATH
	db PACHISI_FORWARDS
	db PACHISI_HEAL
	db PACHISI_GRASS
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	db PACHISI_CAVE
	db PACHISI_RANDOM
	db PACHISI_DEATH
	db PACHISI_DEATH
	db PACHISI_DEATH
	rept 6
		db PACHISI_FINISH
	endr
	db -1

BotanTiles:
	db PACHISI_NOTHING
	db PACHISI_GRASS
	db PACHISI_ITEM
	db PACHISI_MONEY
	db PACHISI_WARP_BOTAN_RANDOM
	db PACHISI_WATER
	db PACHISI_BACKWARDS
	db PACHISI_MUNCHER
	db PACHISI_GRASS
	db PACHISI_MONEY
	db PACHISI_RANDOM
	db PACHISI_CAVE
	db PACHISI_RANDOM
	db PACHISI_MONEY
	db PACHISI_MONEY
	db PACHISI_ITEM
	db PACHISI_DICE
	db PACHISI_GRASS
	db PACHISI_NOTHING
	db PACHISI_GRASS
	db PACHISI_RANDOM
	db PACHISI_NOTHING
	rept 6
		db PACHISI_WARP_BOTAN_SECTION_2
	endr

	db PACHISI_NOTHING
	db PACHISI_HEAL
	db PACHISI_CAVE
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_BACKWARDS
	db PACHISI_MUNCHER
	db PACHISI_GRASS
	db PACHISI_GRASS
	db PACHISI_MUNCHER
	db PACHISI_DICE
	db PACHISI_DEATH
	db PACHISI_MONEY
	db PACHISI_WATER
	db PACHISI_BACKWARDS
	db PACHISI_NOTHING
	db PACHISI_RANDOM
	db PACHISI_MONEY
	db PACHISI_DEATH
	db PACHISI_WATER
	db PACHISI_GRASS
	db PACHISI_GRASS
	db PACHISI_ITEM
	db PACHISI_ITEM
	db PACHISI_GRASS
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_CAVE
	db PACHISI_FORWARDS
	db PACHISI_WARP_BOTAN_ITEMS
	db PACHISI_FORWARDS
	db PACHISI_NOTHING
	db PACHISI_DICE
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_HEAL
	db PACHISI_RANDOM
	db PACHISI_NOTHING
	db PACHISI_DICE
	db PACHISI_ITEM
	rept 6
		db PACHISI_WARP_BOTAN_SECTION_3
	endr

	db PACHISI_NOTHING
	db PACHISI_DICE
	db PACHISI_ITEM
	db PACHISI_WATER
	db PACHISI_GRASS
	db PACHISI_CAVE
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_CAVE
	db PACHISI_RANDOM
	db PACHISI_CAVE
	rept 4
		db PACHISI_GRASS
	endr
	db PACHISI_FORWARDS
	db PACHISI_WARP_BOTAN_SECTION_2
	db PACHISI_MUNCHER
	db PACHISI_DEATH
	db PACHISI_DEATH
	db PACHISI_ITEM
	db PACHISI_ITEM
	db PACHISI_DEATH
	db PACHISI_DEATH
	db PACHISI_NOTHING
	db PACHISI_FORWARDS
	db PACHISI_CAVE
	db PACHISI_GRASS
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	rept 6
		db PACHISI_WARP_BOTAN_SECTION_4
	endr
	db PACHISI_NOTHING
	db PACHISI_MONEY
	db PACHISI_ITEM
	db PACHISI_NOTHING
	db PACHISI_BACKWARDS
	db PACHISI_MUNCHER
	db PACHISI_ITEM
	db PACHISI_WATER
	db PACHISI_DEATH
	db PACHISI_HEAL
	db PACHISI_CAVE
	db PACHISI_ITEM
	db PACHISI_DICE
	db PACHISI_MONEY
	db PACHISI_DEATH
	db PACHISI_DEATH
	db PACHISI_WATER
	db PACHISI_MUNCHER
	db PACHISI_GRASS
	db PACHISI_ITEM
	db PACHISI_FORWARDS
	db PACHISI_HEAL
	db PACHISI_MONEY
	db PACHISI_CAVE
	db PACHISI_RANDOM
	db PACHISI_CAVE
	db PACHISI_GRASS
	db PACHISI_GRASS
	db PACHISI_ITEM
	db PACHISI_DEATH
	db PACHISI_DEATH
	db PACHISI_DEATH
	rept 6
		db PACHISI_FINISH
	endr

	rept 35
		db PACHISI_RANDOM
	endr
	rept 6
		db PACHISI_WARP_BOTAN_SECTION_2
	endr

	rept 15
		db PACHISI_ITEM
	endr
	rept 5
		db PACHISI_WARP_BOTAN_SECTION_3
	endr

