コード例 #1
0
    private void VisualTurn(WARLOCK_MOVE_TYPE type, int turn)
    {
        switch (type)
        {
        case WARLOCK_MOVE_TYPE.MOVE:
            anim.PlayAnimation("Warlock_Move");
            StartCoroutine(Move(cell.position, 0.2f));
            StartCoroutine(Rotate(Helper.QDIR(cell.position - transform.position), 0.1f));
            break;

        case WARLOCK_MOVE_TYPE.ATTACK:
            Debug.Log("Attack");
            anim.PlayAnimation("Warlock_Attack");
            StartCoroutine(Rotate(Helper.QDIR(targetCell.position - transform.position), 0.1f));
            break;

        case WARLOCK_MOVE_TYPE.SPELL1:
            anim.PlayAnimation("Warlock_Spell1");
            StartCoroutine(Rotate(Helper.QDIR(targetCell.position - transform.position), 0.1f));
            break;

        case WARLOCK_MOVE_TYPE.NOTHING:

            break;
        }
    }
コード例 #2
0
    public override void NextTurn(int turn)
    {
        WARLOCK_MOVE_TYPE type = DecideMove(turn);

        ExecuteMove(type, turn);
        VisualTurn(type, turn);
    }
コード例 #3
0
    private void ExecuteMove(WARLOCK_MOVE_TYPE type, int turn)
    {
        switch (type)
        {
        case WARLOCK_MOVE_TYPE.MOVE:
            cell.occupant = 0;
            cell.enemy    = null;
            cell          = targetCell;
            cell.occupant = 1;
            cell.enemy    = this;
            break;

        case WARLOCK_MOVE_TYPE.ATTACK:
            barbarian.Damage(5);
            break;

        case WARLOCK_MOVE_TYPE.SPELL1:
            GameObject go = FX.ShadowBolt(transform.position + Game.HALF_Y, Quaternion.LookRotation((targetCell.position - cell.position).normalized));
            go.AddComponent <ShadowBolt>().Init(targetCell);
            break;

        case WARLOCK_MOVE_TYPE.NOTHING:
            // Reset debuff to none
            if (status == CURRENT_STATUS.STUNNED)
            {
                status = CURRENT_STATUS.NONE;
            }
            break;
        }
    }