//駒の移動範囲取得と強調 private void ChangeMovePoint() { selectAllRelativePieceMoveRange = GameManager.ManagerStore.piecesManager.GetMoveRange(selectPiece.GetKind()); selectRelativePieceMoveRange = selectAllRelativePieceMoveRange[selectPiece.GetShape()]; //絶対位置に変換し、移動可能なマス(敵の駒が存在するか、駒がない)をハイライト selectAbsolutePieceMoveRange = new List <int>(); selectedPieceDirection = selectPiece.GetForwardDirection(); int absFaceId; foreach (int moveFace in selectRelativePieceMoveRange) { absFaceId = GameManager.ManagerStore.fieldManager.ConvertRelative2AbsId(selectPiece.GetFaceId(), moveFace, selectedPieceDirection); //Queenの二週目の挙動を無理やり矯正(kisuke) if (selectPiece.GetKind() == PieceKind.Queen && moveFace == (selectPiece.GetShape())) { var fFaceId_ = selectPiece.GetForwardFaceId(); var ffFace_ = ManagerStore.fieldManager.GetFace2Face(fFaceId_, selectPiece.GetFaceId()); absFaceId = ffFace_.GetComponent <Field.SurfaceInfo>().FaceId; } int returnPieceId = ManagerStore.fieldManager.IsPieceOnFace(absFaceId); if (returnPieceId == -1 || (returnPieceId > -1 && ManagerStore.cp.HasPiece(returnPieceId) == true)) { selectAbsolutePieceMoveRange.Add(absFaceId); } } GameManager.ManagerStore.fieldManager.PointMovableFace(selectAbsolutePieceMoveRange); }
/// <summary> /// マスのIDから駒のポイントを取得 /// </summary> /// <param name="squareId"></param> /// <returns></returns> /// public int PiecePoint(int squareId) { int point = 0; int pieceId = -1; PieceKind pieceKind = 0; if (squareId >= 0) { pieceId = ManagerStore.fieldManager.IsPieceOnFace(squareId); if (pieceId != -1) { Piece.Pieces piece = ManagerStore.humanPlayer.GetPieceById(pieceId); pieceKind = piece.GetKind(); point = (int)ManagerStore.piecesManager.GetSummonCost(pieceKind); } } else if (squareId < -1) { if (squareId == -2) { pieceKind = global::PieceKind.Pawn; } else if (squareId == -5) { pieceKind = global::PieceKind.Queen; } point = (int)ManagerStore.piecesManager.GetSummonCost(pieceKind); } return(point); }
//移動できるか確認 移動先に存在する駒の種類を確認する private bool CanMoveCollision(bool isPlyerTurn, int faceId, Piece.Pieces moveingPiece) { bool returnValue = true; if (faceId > -1) { int pieceONFace = ManagerStore.fieldManager.IsPieceOnFace(faceId); if (pieceONFace != -1) { //移動先が自分の駒なら移動出来ない if (isPlyerTurn == true && ManagerStore.humanPlayer.HasPiece(pieceONFace)) { return(false); } if (isPlyerTurn == false && ManagerStore.cp.HasPiece(pieceONFace)) { return(false); } Piece.Pieces beatedPiece = null; //移動先が相手の駒なら消滅させる if (ManagerStore.cp.HasPiece(pieceONFace)) { effectHumanPiece = pieceONFace; beatedPiece = ManagerStore.cp.GetPieceById(pieceONFace); beatedPiece.BeatedEffect(); StartCoroutine(DelayMethod(40, () => { ManagerStore.cp.DeleteMyPieces(pieceONFace); })); } //自分の駒ならviewカメラに切り替える if (ManagerStore.humanPlayer.HasPiece(pieceONFace)) { viewCamera.transform.position = ManagerStore.humanPlayer.GetPieceById(pieceONFace).PieceCamera.GetCameraPosition(); viewCamera.transform.rotation = Quaternion.Euler(ManagerStore.humanPlayer.GetPieceById(pieceONFace).PieceCamera.GetCameraAngle()); viewCamera.SetActive(true); PCM.CameraOff(); effectHumanPiece = pieceONFace; beatedPiece = ManagerStore.humanPlayer.GetPieceById(pieceONFace); beatedPiece.BeatedEffect(); } //Move.ReversibleMove rm = new Move.ReversibleMove(); //if (pieceONFace == -1) { // rm.InitNotCapturedMove(moveingPiece.GetFaceId(),faceId); //} //else { // //caputure Piece forward face Id移動後か?? // rm.InitCapturedMove(moveingPiece.GetFaceId(),faceId,beatedPiece.GetKind(),ManagerStore.fieldManager.GetFace2Face(moveingPiece.GetFaceId(),faceId).GetComponent<Field.SurfaceInfo>().FaceId); //} pieceKindforRecord = beatedPiece.GetKind(); } } return(returnValue); }