Beispiel #1
0
    public override void Start()
    {
        CurrentRotation = TROTATION.Front;
        initialState    = new State(STATE.Attack, this,
                                    () =>
        {
            GetTurretDamage();
            //SetAffectedCells(); //todo -> descomentar para nada más spawnear, causar daño
        },
                                    () =>
        {
        });

        FSMSystem.AddState(this, initialState);
        currentState       = states.Find((x) => x.stateName == STATE.Attack);
        currentTransitions = transitions.FindAll((x) => x.currentState == currentState);
        currentState.OnEnter();

        SetStates();
        SetTransitions();

        base.Start();

        executed = true; //todo -> esto sirve par saber si ha ejecutado la accion del turno, si esta a false, puede spawnear y realizar una acción
    }
Beispiel #2
0
    private void RotateLeft()
    {
        bool bloodEnough = this.owner == Owner.Player ? this.RotateBloodCost < _bloodController.GetCurrentPlayerBlood() : this.RotateBloodCost < _bloodController.GetCurrentAIBlood();

        if (bloodEnough)
        {
            this.transform.Rotate(Vector3.up * -90f);
            switch (CurrentRotation)
            {
            case TROTATION.Front:
                CurrentRotation = TROTATION.Left;
                break;

            case TROTATION.Right:
                CurrentRotation = TROTATION.Front;
                break;

            case TROTATION.Back:
                CurrentRotation = TROTATION.Right;
                break;

            case TROTATION.Left:
                CurrentRotation = TROTATION.Back;
                break;
            }
            UpdateAffectedCells();
        }
        else
        {
            Instantiate(Resources.Load <GameObject>("Prefabs/Popups/SimpleInfoPopup")).GetComponent <SimpleInfoPopupController>().SetPopup("PLAYER", "NOT ENOUGH\nBLOOD");
        }
    }