Esempio n. 1
0
    void BattleBlock_OnMovementFinished(BattleCharBlock battleCharBlock)
    {
        secondaryCounter--;
        if (currentAttacksCounter != 0 && secondaryCounter % currentAttacksCounter == 0)
        {
            currentAttacksCounter--;

            if (currentAttacksCounter == 0)
            {
                AttackingChar.AttackTarget(DefendingChar, BodyPartsToAttack[0]);
                AttackingCharBlock.MoveToPoint(AttackingCharBlock.InitialPosition);
                BodyPartsToAttack.RemoveAt(0);
                // EndTurn ();
                return;
            }

            BodyPartsToAttack.RemoveAt(0);

            AttackingCharBlock.MoveToPoint(DefendingCharBlock.Targets [(int)BodyPartsToAttack [0]].transform.position);
        }
        else
        {
            if (BodyPartsToAttack.Count == 0)
            {
                EndTurn();
                return;
            }
            AttackingChar.AttackTarget(DefendingChar, BodyPartsToAttack[0]);
            AttackingCharBlock.MoveToPoint(AttackingCharBlock.InitialPosition);
            return;
        }
    }