String place[42] ,pName[42]
String charimg[4]
int placeKind[42]
int i , p ,nowPlace , PNAME , PCELL , BOARD , CHAR, slct[10]

midiLoad(sound/midi00.mid)
midiplay()

charimg[0] = img/char0010.png ;
charimg[1] = img/char0011.png ;
charimg[2] = img/char0012.png ;
charimg[3] = img/char0013.png ;


//եȾ̾ΰե
load(temp/backlist.txt,place,pName,placeKind)

SetCellNumber(5) //0-4֤ޤǤ5Υ

PCELL = 0 //طʥ0֥Ȥ
CHAR = 1 //ɽ1֥Ȥ
PNAME = 3 //٥륻3֥Ȥ
BOARD = 4 //ƥ΢Ĥ4֥Ȥ

//ɽĤ
SetCellCanvas(PNAME,180,50,0xddffdd) //180x50Ĥ
SetCellPosition(PNAME,20,20) //Ĥκɸ
SetCellTextParam(PNAME,"Default",BOLD,20,0x000055) //Ĥ˽񤯥ƥȤΥեȤȿꤹ
SetCellTransColor(PNAME,0,0,192) //ĤƩ
SetShiftHide(PNAME) //ĤSHIFT򲡤줿Ȥ˱

//ƥ΢Ĥ
SetCellCanvas(BOARD,600,200,0x7777dd) //600x200Ĥ
SetCellPosition(BOARD,100,380) //Ĥκɸ
SetCellTransColor(BOARD,0,0,128) //ĤƩ
SetShiftHide(BOARD) //ĤSHIFT򲡤줿Ȥ˱
SetTextArea(120,400,560,160)


//ư
setSelectArea(600,100,180,300,1,10)
setSelectColor(0x80FFFFFF,0x80AAAAAA,0x80FFAAAA,0x111111)

nowPlace = 02

LOOP:
GoSub(SHOWPCELL)
Goto(LOOP)

SHOWPCELL:
SetCellImage(PCELL,place[nowPlace])
SetCellText(PNAME,pName[nowPlace])
Random(i,4)
SetCellImage(CHAR,charimg[i])
SetCellPosition(CHAR,_RIGHT,_LOWER)
SetCellTransColor(CHAR,0,0,0) //ĤƩ
viewDisplay(11X11,_fadein)
ʤϺ+pName[nowPlace]+פˤޤ
WaitText(ɤ˰ưޤ,10)

//ξ
if (nowPlace == 02) {
  slct[0] = 01
  slct[1] = 29
  slct[2] = 22
  slct[3] = 40
  slct[4] = 24
  slct[5] = 23
  slct[6] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 29) {
  slct[0] = 02
  slct[1] = 30
  slct[2] = 22
  slct[3] = 40
  slct[4] = 24
  slct[5] = 23
  slct[6] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 22) {
  slct[0] = 02
  slct[1] = 29
  slct[2] = 40
  slct[3] = 24
  slct[4] = 23
  slct[5] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//Ͳξ
if (nowPlace == 40) {
  slct[0] = 02
  slct[1] = 29
  slct[2] = 22
  slct[3] = 24
  slct[4] = 23
  slct[5] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//ƻϩξ
if (nowPlace == 24) {
  slct[0] = 02
  slct[1] = 29
  slct[2] = 22
  slct[3] = 40
  slct[4] = 23
  slct[5] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//Хξ
if (nowPlace == 23) {
  slct[0] = 02
  slct[1] = 29
  slct[2] = 22
  slct[3] = 40
  slct[4] = 24
  slct[5] = 27
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 27) {
  slct[0] = 02
  slct[1] = 29
  slct[2] = 22
  slct[3] = 40
  slct[4] = 24
  slct[5] = 23
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//ॲȤξ
if (nowPlace == 01) {
  slct[0] = 02
  slct[1] = 03
  slct[2] = 06
  slct[3] = 07
  slct[4] = 16
  slct[5] = 08
  slct[6] = 10
  slct[7] = 12
  slct[8] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]],pName[slct[8]])
  nowPlace = slct[p]
  return();
}

//ХåȥȤξ
if (nowPlace == 03) {
  slct[0] = 01
  slct[1] = 06
  slct[2] = 07
  slct[3] = 16
  slct[4] = 08
  slct[5] = 10
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//֥ϥξ
if (nowPlace == 06) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 07
  slct[3] = 16
  slct[4] = 08
  slct[5] = 10
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 07) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 06
  slct[3] = 16
  slct[4] = 08
  slct[5] = 10
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//΢ξ
if (nowPlace == 16) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 06
  slct[3] = 07
  slct[4] = 08
  slct[5] = 10
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 08) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 06
  slct[3] = 07
  slct[4] = 16
  slct[5] = 10
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//饦ɤξ
if (nowPlace == 10) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 06
  slct[3] = 07
  slct[4] = 16
  slct[5] = 08
  slct[6] = 12
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 12) {
  slct[0] = 01
  slct[1] = 03
  slct[2] = 06
  slct[3] = 07
  slct[4] = 16
  slct[5] = 08
  slct[6] = 10
  slct[7] = 13
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ͷƻξ
if (nowPlace == 13) {
  slct[0] = 01
  slct[1] = 05
  slct[2] = 04
  slct[3] = 11
  slct[4] = 14
  slct[5] = 15
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}


//ξ
if (nowPlace == 05) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 04
  slct[3] = 11
  slct[4] = 14
  slct[5] = 15
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//٥ξ
if (nowPlace == 04) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 05
  slct[3] = 11
  slct[4] = 14
  slct[5] = 15
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ڱξ
if (nowPlace == 11) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 05
  slct[3] = 04
  slct[4] = 14
  slct[5] = 15
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}


//ơξ
if (nowPlace == 14) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 05
  slct[3] = 04
  slct[4] = 11
  slct[5] = 15
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//ơξ
if (nowPlace == 15) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 05
  slct[3] = 04
  slct[4] = 11
  slct[5] = 14
  slct[6] = 09
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//Ťξ
if (nowPlace == 09) {
  slct[0] = 01
  slct[1] = 13
  slct[2] = 05
  slct[3] = 04
  slct[4] = 11
  slct[5] = 14
  slct[6] = 15
  slct[7] = 12
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]],pName[slct[6]],pName[slct[7]])
  nowPlace = slct[p]
  return();
}

//Ļξ
if (nowPlace == 30) {
  slct[0] = 29
  slct[1] = 31
  slct[2] = 32
  slct[3] = 33
  slct[4] = 34
  slct[5] = 39
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//Ҷξ
if (nowPlace == 31) {
  slct[0] = 30
  slct[1] = 32
  slct[2] = 33
  slct[3] = 34
  slct[4] = 39
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]])
  nowPlace = slct[p]
  return();
}

//ڤξ
if (nowPlace == 32) {
  slct[0] = 30
  slct[1] = 31
  slct[2] = 33
  slct[3] = 34
  slct[4] = 39
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 33) {
  slct[0] = 30
  slct[1] = 31
  slct[2] = 32
  slct[3] = 34
  slct[4] = 39
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]])
  nowPlace = slct[p]
  return();
}

//΢ξ
if (nowPlace == 34) {
  slct[0] = 30
  slct[1] = 31
  slct[2] = 32
  slct[3] = 33
  slct[4] = 39
  slct[5] = 35
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]],pName[slct[5]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 39) {
  slct[0] = 30
  slct[1] = 31
  slct[2] = 32
  slct[3] = 34
  slct[4] = 33
  Select(p,pName[slct[0]],pName[slct[1]],pName[slct[2]],pName[slct[3]],pName[slct[4]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 35) {
  slct[0] = 34
  slct[1] = 36
  Select(p,pName[slct[0]],pName[slct[1]])
  nowPlace = slct[p]
  return();
}

//㬤ξ
if (nowPlace == 36) {
  slct[0] = 35
  slct[1] = 37
  Select(p,pName[slct[0]],pName[slct[1]])
  nowPlace = slct[p]
  return();
}

//ξ
if (nowPlace == 37) {
  slct[0] = 36
  Select(p,pName[slct[0]])
  nowPlace = slct[p]
  return();
}


