예제 #1
0
    IEnumerator EnemyThinkingRoutine(float puseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(puseDuration));

        // look to see if there are any slimes in play
        _slimeToAttack = GameObject.Find("Slime");

        // if a slime is not found target player
        if (_slimeToAttack = null)
        {
            targetToAttack = player;
        }
        // if a slime is found target that slime
        else
        {
            targetToAttack = _slimeToAttack;
        }

        // creature chooses its attack and preforms it
        creatue.ChooseAttack();
        Debug.Log("Enemy performs action");

        // at end of turn, end dragonRage if it was activated
        creatue.isRaging = false;

        EnemyTurnEnded?.Invoke();
        // turn over. Go back to Player
        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }
예제 #2
0
    IEnumerator EnemyThinkingRoutine(float pauseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(pauseDuration));

        Debug.Log("Enemy performs action");
        EnemyTurnEnded?.Invoke();
        //turn over. Go back to Player.
        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }
    IEnumerator EnemyThinkingRoutine(float pauseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(pauseDuration));

        Debug.Log("Enemy swipes at the player for 3 damage");
        _player.TakeDamage(3);
        EnemyTurnEnded?.Invoke();

        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }
    IEnumerator EnemyThinkingRoutine(float puseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(puseDuration));

        if (player != null)
        {
            player._currentHealth -= 10;
        }

        Debug.Log("Enemy performs action");
        EnemyTurnEnded?.Invoke();
        // turn over. Go back to Player
        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }
    IEnumerator EnemyThinkingRoutine(float pauseDuration)
    {
        Debug.Log("Enemy thinking...");
        yield return(new WaitForSeconds(pauseDuration));

        int       rand       = UnityEngine.Random.Range(0, 2);
        Transform randomCard = EnemyArea.transform.GetChild(rand);

        randomCard.transform.SetParent(dropZone.transform, false);
        AudioHelper.PlayClip2D(endDragSound, 1f);

        Debug.Log("Enemy performs action");
        yield return(new WaitForSeconds(pauseDuration));

        _dropZone.Discard();
        EnemyTurnEnded?.Invoke();
        playerCover.gameObject.SetActive(false);

        //turn over. Go back to Player.
        StateMachine.ChangeState <PlayerTurnCardGameState>();
    }
 public override void Exit()
 {
     EnemyTurnEnded?.Invoke();
 }
 public void EnemyWins()
 {
     EnemyTurnEnded?.Invoke();
     StateMachine.ChangeState <EnemyWinCardGameState>();
     Debug.Log("Enemy wins!");
 }