unitNum[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = Uselected->C.chipNumb;
loadNum[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = Uselected->CL.chipNumb;
- unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = Uselected->team;
+ if(Uselected->team == 0){
+ if(Uselected->joinArmyFromNext){
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 1;
+ }else{
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 0;
+ }
+ }else if(Uselected->team == 1){
+ if(Uselected->joinArmyFromNext){
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 5;
+ }else{
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 4;
+ }
+ }else if(Uselected->team == 2){
+ if(Uselected->joinArmyFromNext){
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 3;
+ }else{
+ unitTeam[g_moveRoute[i0][1]][g_moveRoute[i0][0]] = 2;
+ }
+ }
submitFlag = true;
unitMoveEndFlag = true;
i0 = leftPow - g_moveCost[pieceType][g_map[startY-1][startX]]; // 上
- if(unitNum[startY-1][startX] > -1 && unitTeam[startY-1][startX] != chipTeam){
+
+ if(unitNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 1 || unitTeam[startY-1][startX] == 4 || unitTeam[startY-1][startX] == 5) && chipTeam == 0){
+ }else if(unitNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 0 || unitTeam[startY-1][startX] == 4 || unitTeam[startY-1][startX] == 5) && chipTeam == 1){
+ }else if(unitNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 3) && chipTeam == 2){
+ }else if(unitNum[startY-1][startX] > -1 && unitTeam[startY-1][startX] != chipTeam){
i0 = 0;
}
if( aMap[startY-1][startX] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY+1][startX]]; // 下
- if(unitNum[startY+1][startX] > -1 && unitTeam[startY+1][startX] != chipTeam){
+
+
+ if(unitNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 1 || unitTeam[startY+1][startX] == 4 || unitTeam[startY+1][startX] == 5) && chipTeam == 0){
+ }else if(unitNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 0 || unitTeam[startY+1][startX] == 4 || unitTeam[startY+1][startX] == 5) && chipTeam == 1){
+ }else if(unitNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 3) && chipTeam == 2){
+ }else if(unitNum[startY+1][startX] > -1 && unitTeam[startY+1][startX] != chipTeam){
i0 = 0;
}
if( aMap[startY+1][startX] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY][startX-1]]; // 右
- if(unitNum[startY][startX-1] > -1 && unitTeam[startY][startX-1] != chipTeam){
+
+
+ if(unitNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 1 || unitTeam[startY][startX-1] == 4 || unitTeam[startY][startX-1] == 5) && chipTeam == 0){
+ }else if(unitNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 0 || unitTeam[startY][startX-1] == 4 || unitTeam[startY][startX-1] == 5) && chipTeam == 1){
+ }else if(unitNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 3) && chipTeam == 2){
+ }else if(unitNum[startY][startX-1] > -1 && unitTeam[startY][startX-1] != chipTeam){
i0 = 0;
}
if( aMap[startY][startX-1] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY][startX+1]]; // 左
- if(unitNum[startY][startX+1] > -1 && unitTeam[startY][startX+1] != chipTeam){
+ if(unitNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 1 || unitTeam[startY][startX+1] == 4 || unitTeam[startY][startX+1] == 5) && chipTeam == 0){
+ }else if(unitNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 0 || unitTeam[startY][startX+1] == 4 || unitTeam[startY][startX+1] == 5) && chipTeam == 1){
+ }else if(unitNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 3) && chipTeam == 2){
+ }else if(unitNum[startY][startX+1] > -1 && unitTeam[startY][startX+1] != chipTeam){
i0 = 0;
}
if( aMap[startY][startX+1] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY-1][startX]]; // 上
- if(loadNum[startY-1][startX] > -1 && unitTeam[startY-1][startX] != chipTeam){
+ if(loadNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 1 || unitTeam[startY-1][startX] == 4 || unitTeam[startY-1][startX] == 5) && chipTeam == 0){
+ }else if(loadNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 0 || unitTeam[startY-1][startX] == 4 || unitTeam[startY-1][startX] == 5) && chipTeam == 1){
+ }else if(loadNum[startY-1][startX] > -1 && (unitTeam[startY-1][startX] == 3) && chipTeam == 2){
+ }else if(loadNum[startY-1][startX] > -1 && unitTeam[startY-1][startX] != chipTeam){
i0 = 0;
}
if( aMap[startY-1][startX] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY+1][startX]]; // 下
- if(loadNum[startY+1][startX] > -1 && unitTeam[startY+1][startX] != chipTeam){
+
+
+ if(loadNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 1 || unitTeam[startY+1][startX] == 4 || unitTeam[startY+1][startX] == 5) && chipTeam == 0){
+ }else if(loadNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 0 || unitTeam[startY+1][startX] == 4 || unitTeam[startY+1][startX] == 5) && chipTeam == 1){
+ }else if(loadNum[startY+1][startX] > -1 && (unitTeam[startY+1][startX] == 3) && chipTeam == 2){
+ }else if(loadNum[startY+1][startX] > -1 && unitTeam[startY+1][startX] != chipTeam){
i0 = 0;
}
if( aMap[startY+1][startX] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY][startX-1]]; // 右
- if(loadNum[startY][startX-1] > -1 && unitTeam[startY][startX-1] != chipTeam){
+
+
+ if(loadNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 1 || unitTeam[startY][startX-1] == 4 || unitTeam[startY][startX-1] == 5) && chipTeam == 0){
+ }else if(loadNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 0 || unitTeam[startY][startX-1] == 4 || unitTeam[startY][startX-1] == 5) && chipTeam == 1){
+ }else if(loadNum[startY][startX-1] > -1 && (unitTeam[startY][startX-1] == 3) && chipTeam == 2){
+ }else if(loadNum[startY][startX-1] > -1 && unitTeam[startY][startX-1] != chipTeam){
i0 = 0;
}
if( aMap[startY][startX-1] < i0 ){
i0 = leftPow - g_moveCost[pieceType][g_map[startY][startX+1]]; // 左
- if(loadNum[startY][startX+1] > -1 && unitTeam[startY][startX+1] != chipTeam){
+
+
+ if(loadNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 1 || unitTeam[startY][startX+1] == 4 || unitTeam[startY][startX+1] == 5) && chipTeam == 0){
+ }else if(loadNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 0 || unitTeam[startY][startX+1] == 4 || unitTeam[startY][startX+1] == 5) && chipTeam == 1){
+ }else if(loadNum[startY][startX+1] > -1 && (unitTeam[startY][startX+1] == 3) && chipTeam == 2){
+ }else if(loadNum[startY][startX+1] > -1 && unitTeam[startY][startX+1] != chipTeam){
i0 = 0;
}
if( aMap[startY][startX+1] < i0 ){
UT = 0;
}else if(unitBreak->team == 2){
UT = 1;
- }else if(unitBreak->team == 1){
+ }else if(unitBreak->team == 4){
UT = 2;
}
UT = 0;
}else if(unitBreak->team == 2){
UT = 1;
- }else if(unitBreak->team == 1){
+ }else if(unitBreak->team == 4){
UT = 2;
}