Exemple #1
0
    public override void Update()
    {
        base.Update();

        if (BattleManager.main.isPaused)
        {
            return;
        }

        if (shielder.isReady())
        {
            Slot s = BattleManager.main.enemyParty.getRandomEmptySlot();

            if (s == null)
            {
                thinkingTimeLeft = Mathf.Infinity;
            }
            else if (thinkingTimeLeft == Mathf.Infinity)
            {
                thinkingTimeLeft = Random.Range(decisionTime[0], decisionTime[1]);
            }
            else if (thinkingTimeLeft > 0)
            {
                thinkingTimeLeft -= Time.deltaTime;
            }
            else
            {
                shielder.tryToUse(s);
            }
        }
        else
        {
            thinkingTimeLeft = Mathf.Infinity;
        }
    }
Exemple #2
0
    public override bool handleInput()
    {
        bool stillControlling = true;

        if (Input.GetMouseButtonDown(0))
        {
            Slot s = getPlayerSlotAtMouse();
            shielder.tryToUse(s);

            stillControlling = false;
        }

        stillControlling &= handleMove();

        return(stillControlling);
    }