示例#1
0
	public void OnTurnEnd(){
		if (EndTurnEvent != null)
			EndTurnEvent.Invoke ();
		manaThisTurn -= bonusManaThisTurn;
		bonusManaThisTurn = 0;
		GetComponent<TurnMaker> ().StopAllCoroutines ();
	}
示例#2
0
 public virtual void OnTurnEnd()
 {
     if (EndTurnEvent != null)
     {
         EndTurnEvent.Invoke();
     }
 }
示例#3
0
 public void OnTurnEnd()
 {
     if (EndTurnEvent != null)
     {
         EndTurnEvent.Invoke();
     }
     GetComponent <TurnMaker>().StopAllCoroutines();
 }
 public override void RelinquishPower()
 {
     if (IsMyTurn())
     {
         ResetUnits();
         EndTurnEvent.Invoke(this);
         //UI.GetComponent<UI_Operator>().SetPhaseText(playerID);
         //UI.GetComponent<UI_Operator>().PhaseTextDisplay();
     }
 }
示例#5
0
 public void OnTurnEnd()
 {
     if (EndTurnEvent != null)
     {
         EndTurnEvent.Invoke();
     }
     ManaThisTurn     -= bonusManaThisTurn;
     bonusManaThisTurn = 0;
     GetComponent <TurnMaker>().StopAllCoroutines();
     FindObjectOfType <AudioManager>().Play("End Turn");
 }
示例#6
0
    public void OnTurnEnd(int dicenum)
    {
        if (EndTurnEvent != null)
        {
            EndTurnEvent.Invoke();
        }


        //ManaThisTurn -= bonusManaThisTurn;
        //bonusManaThisTurn = 0;
        GetComponent <TurnMaker>().StopAllCoroutines();
    }
示例#7
0
    public void HandleDragFinnish()
    {
        bool currentPlayerColor = Constants.COLOR_MAPPING[piece.GetColor()];

        if (destinationSquare)
        {
            destinationSquare.ResetSprite();
            Piece destinationSquarePiece = destinationSquare.GetPiece();

            if (destinationSquare.CanMoveTo == true)
            {
                BoardConfiguration.Instance.MovePiece(currentSquare.GetAlgebraicCoordinates(), destinationSquare.GetAlgebraicCoordinates());

                if (MovesManager.Instance.IsCheckForPlayer(currentPlayerColor))
                {
                    //Debug.Log("You put yourself in check");
                    BoardConfiguration.Instance.MovePiece(destinationSquare.GetAlgebraicCoordinates(), currentSquare.GetAlgebraicCoordinates());
                    piece.RevertToPreviousPosition(parentTransform);
                    if (destinationSquarePiece != null)
                    {
                        destinationSquarePiece.AddPieceToBoardConfiguration();
                    }
                }
                else
                {
                    if (destinationSquarePiece != null)
                    {
                        Debug.Log("Found piece on the destination square");
                        destinationSquarePiece.RemoveFromGame();
                    }
                    piece.PlaceOnSquare(destinationSquare, parentTransform);
                    currentSquare = piece.GetSquare();
                    EndTurnEvent.Invoke(FindObjectOfType <GameManager>().AtMove, MovesManager.Instance.IsCheckForPlayer(!currentPlayerColor));
                }
            }
            else
            {
                piece.RevertToPreviousPosition(parentTransform);
            }
        }

        Board.ClearGreenSquares();
        Board.SetGreenSquares(null);
    }
示例#8
0
 public virtual void EndTurn()
 {
     EndTurnEvent?.Invoke();
 }
示例#9
0
 public void InvokeEndTurnEvent()
 {
     turnEvent.Invoke();
 }
示例#10
0
 public void OnEndPlayerTurnEvent()
 {
     EndTurnEvent?.Invoke();
 }