Esempio n. 1
0
	public void OnTurnEnd(){
		if (EndTurnEvent != null)
			EndTurnEvent.Invoke ();
		manaThisTurn -= bonusManaThisTurn;
		bonusManaThisTurn = 0;
		GetComponent<TurnMaker> ().StopAllCoroutines ();
	}
Esempio n. 2
0
 public virtual void OnTurnEnd()
 {
     if (EndTurnEvent != null)
     {
         EndTurnEvent.Invoke();
     }
 }
Esempio n. 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();
     }
 }
Esempio n. 5
0
 public void OnTurnEnd()
 {
     if (EndTurnEvent != null)
     {
         EndTurnEvent.Invoke();
     }
     ManaThisTurn     -= bonusManaThisTurn;
     bonusManaThisTurn = 0;
     GetComponent <TurnMaker>().StopAllCoroutines();
     FindObjectOfType <AudioManager>().Play("End Turn");
 }
Esempio n. 6
0
    public void OnTurnEnd(int dicenum)
    {
        if (EndTurnEvent != null)
        {
            EndTurnEvent.Invoke();
        }


        //ManaThisTurn -= bonusManaThisTurn;
        //bonusManaThisTurn = 0;
        GetComponent <TurnMaker>().StopAllCoroutines();
    }
Esempio n. 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);
    }
Esempio n. 8
0
 public virtual void EndTurn()
 {
     EndTurnEvent?.Invoke();
 }
Esempio n. 9
0
 public void InvokeEndTurnEvent()
 {
     turnEvent.Invoke();
 }
Esempio n. 10
0
 public void OnEndPlayerTurnEvent()
 {
     EndTurnEvent?.Invoke();
 }