Exemple #1
0
    void HandleAttackInput()
    {
        HexCoordinates hexCoords = GetInput();

        if (hexCoords != new HexCoordinates(1000, 1000))
        {
            if (GameInformation.IndexOfCharacter(hexCoords) != -1)
            {
                currentCharacter = GameInformation.characters [GameInformation.IndexOfCharacter(hexCoords)];
                if (GameInformation.currentAttackPath.InPath(hexCoords))
                {
                    if (GameInformation.IndexOfCharacter(hexCoords) != -1)
                    {
                        Character tempCharacter = GameInformation.currentlySelectedCharacter;
                        if (GameInformation.characters [GameInformation.IndexOfCharacter(hexCoords)].team1 != tempCharacter.team1)
                        {
                            if (tempCharacter.team1 != currentCharacter.team1)
                            {
                                tempCharacter.charMovement.LookAt(currentCharacter.position);
                                tempCharacter.charAnimation.Attacking = true;
                                tempCharacter.attacked = true;
                                currentCharacter.TakeDamage(tempCharacter.damage);
                                GameInformation.attackButton.Attack();
                            }
                        }
                    }
                }
            }
        }
    }
Exemple #2
0
    void HandleFirstInput()
    {
        HexCoordinates hexCoords = GetInput();

        if (hexCoords != new HexCoordinates(1000, 1000))
        {
            if (GameInformation.IndexOfCharacter(hexCoords) != -1)
            {
                currentCharacter = GameInformation.characters [GameInformation.IndexOfCharacter(hexCoords)];
                if (currentCharacter.team1 == GameInformation.player1Turn)
                {
                    pathStarted = true;
                    if (!GameInformation.currentPath.InPath(hexCoords))
                    {
                        List <HexCoordinates> coordList = new List <HexCoordinates> ();
                        coordList.AddRange(GameInformation.currentPath.hexCoords);
                        coordList.Add(hexCoords);
                        GameInformation.currentPath = new CharacterPath(coordList.ToArray(), currentCharacter);
                    }
                }
            }
            else
            {
                pathStarted = false;
            }
        }
    }