Beispiel #1
0
    /// <summary>
    /// Effectively passes the turn from the perspective of the battle units.
    /// Their counter values will now reflect the last performed action in-game
    /// </summary>
    private void UpdateCounterValues()
    {
        List <GameCharacter> battleUnits = battleMap.battleUnits_;
        int  index     = 0;
        bool turnFound = false;

        // remember to check isActive
        while (!turnFound)
        {
            for (int i = 0; i < battleUnits.Count; i++)
            {
                if (battleUnits[i].IsActive && battleUnits[i].CounterValue <= 0 && !turnFound)
                {
                    turnFound = true;
                    index     = i;
                }

                battleUnits[i].CounterValue--;
            }
        }

        battleUnits[index].CounterValue = StatCalculator.CalculateCounter(
            battleUnits[index].TickSpeed,
            battleUnits[index].LastSkillRank,
            battleUnits[index].GetStatusEffectByName("HASTE")
            );
    }
Beispiel #2
0
    /// <summary>
    /// Calculate ICV of each battleUnit. Method meant to be called from the BattleMap at the start of each episode
    /// </summary>
    /// <param name="battleUnits_"></param>
    public void CalculateICVs()
    {
        List <GameCharacter> battleUnits = battleMap.battleUnits_;

        int   tickspeed, lastskillR;
        float hasteStatus;

        for (int i = 0; i < battleUnits.Count; i++)
        {
            tickspeed   = battleUnits[i].TickSpeed;
            lastskillR  = battleUnits[i].LastSkillRank;
            hasteStatus = battleUnits[i].GetStatusEffectByName("HASTE");

            counterValues[i] = battleUnits[i].CounterValue = StatCalculator.CalculateCounter(tickspeed, lastskillR, hasteStatus);
        }
    }
Beispiel #3
0
    private void SetNextTurn(Pair <int, int> index_rank)
    {
        Transform  contentPanel = transform.GetChild(0).transform;
        GameObject go           = Instantiate(entryPrefab, contentPanel);

        go.GetComponent <ICarousselEntry>().SetTurnOwner(index_rank.First, battleMap.battleUnits_[index_rank.First].Name);

        entries_.Enqueue(go.GetComponent <ICarousselEntry>());

        counterValues[index_rank.First] = StatCalculator.CalculateCounter(
            battleMap.battleUnits_[index_rank.First].TickSpeed,
            index_rank.Second,
            hasteCounters[index_rank.First].First
            );

        // Decrease Forward Haste Counter after assignment
        DecreaseForwardHasteCounter(index_rank.First);
    }