public void Update()
        {
            if (this._isMovementPhase)
            {
                Raycaster.castRay(1 << 9);

                if (Input.GetKeyDown(KeyCode.Escape))
                {
                    this._isMovementPhase = false;
                    this._currentMovementRange.hideRange();
                    CombatUiStateKeeper.displayCommandStep();
                }

                if (Input.GetKeyDown(KeyCode.Mouse0))
                {
                    GameObject  clickedTile = GridController.getActiveTile();
                    GridElement gridElement = GridController.getActiveTile().GetComponent <GridElement>();
                    GameObject  currentCharacterOnThisTile = GridController.getActiveTile().GetComponent <GridElement>().getCharacterOnThisTile();

                    if (this._currentMovementRange.isTileWithinRange(GridController.getActiveTile()) &&
                        currentCharacterOnThisTile == null &&
                        gridElement.tileType.passable == true)
                    {
                        this._isMovementPhase = false;
                        TurnOrder.getActiveCharacter().GetComponent <CombatCharacterController>().setCharacterToTile(clickedTile);
                        CombatUiStateKeeper.displayCommandStep();
                        this.baseCommandPanelHandler.disableMove();
                        this._currentMovementRange.hideRange();
                        Camera.main.GetComponent <CameraController>().setNextTargetTileForCamera(TurnOrder.getActiveCharacter().GetComponent <CombatCharacterController>().getCurrentTileOfCharacter());
                    }

                    //play "wrong sound"
                }
            }
        }
        public void Update()
        {
            if (this._targetMode)
            {
                Raycaster.castRay(this.layerMask);

                if (Input.GetKeyDown(KeyCode.Escape))
                {
                    this._targetMode = false;
                    CombatUiStateKeeper.displayAbilitySelectionStep();
                    this.abilityRangeSelection.hideRange();
                    CombatUiStateKeeper.jumpBackEnabled = true;
                }

                if (Input.GetKeyDown(KeyCode.Mouse0))
                {
                    GameObject target = GridController.getActiveTile().GetComponent <GridElement>().getCharacterOnThisTile();
                    CombatController.handleAbilityUsage(this._ability, target);
                    this._targetMode = false;
                    CombatUiStateKeeper.displayCommandStep();
                    this.baseCommandPanelHandler.disableAction();
                    this.abilityRangeSelection.hideRange();
                }
            }
        }
        public void onClick()
        {
            CombatUiStateKeeper.hideCombatUi();

            this._ability = AbilityFactory.getAbility(this.name);

            this.abilityRangeSelection = new Range(Rangefinder.findAllTilesInRange(TurnOrder.getActiveCharacter().GetComponent <CharacterBase>().getCurrentTileOfCharacter(), this._ability.range), "ability");
            this.abilityRangeSelection.colorRange();
            this._targetMode = true;
            CombatUiStateKeeper.jumpBackEnabled = false;
        }
 private void jumpOneStepBack()
 {
     if (CombatUiStateKeeper.step == 3)
     {
         CombatUiStateKeeper.displayActionSelectionStep();
     }
     else if (CombatUiStateKeeper.step == 2)
     {
         CombatUiStateKeeper.displayCommandStep();
     }
 }
        public void onClick()
        {
            CombatCharacterController activeCharacter = TurnOrder.getActiveCharacter().GetComponent <CombatCharacterController>();
            HashSet <GameObject>      foundRange      = Rangefinder.findAllTilesInRange(
                activeCharacter.getCurrentTileOfCharacter(),
                activeCharacter.GetComponent <CombatCharacterController>().walkRange
                );

            CombatUiStateKeeper.hideCombatUi();
            this._currentMovementRange = new Range(foundRange, "movement");
            _currentMovementRange.colorRange();
            this._isMovementPhase = true;
        }
Exemple #6
0
        public static void displayAbilitySelectionStep()
        {
            CombatUiStateKeeper.step = 3;
            CombatUiStateKeeper.showCombatUi();
            CombatUiStateKeeper.BaseCommandPanel.GetComponent <CanvasGroup>().alpha          = 1;
            CombatUiStateKeeper.BaseCommandPanel.GetComponent <CanvasGroup>().blocksRaycasts = false;

            CombatUiStateKeeper.ActionSelectionPanel.GetComponent <CanvasGroup>().alpha          = 1;
            CombatUiStateKeeper.ActionSelectionPanel.GetComponent <CanvasGroup>().blocksRaycasts = false;

            CombatUiStateKeeper.AbilitySelectionPanel.GetComponent <CanvasGroup>().alpha          = 1;
            CombatUiStateKeeper.AbilitySelectionPanel.GetComponent <CanvasGroup>().blocksRaycasts = true;

            CombatUiStateKeeper.OverviewButton.GetComponent <CanvasGroup>().alpha = 0;
        }
 public void onClick()
 {
     CombatUiStateKeeper.displayCommandStep();
     CombatController.endTurnForCurrentCharacter();
     Camera.main.GetComponent <CameraController>().setNextTargetTileForCamera(TurnOrder.getActiveCharacter().GetComponent <CombatCharacterController>().getCurrentTileOfCharacter());
 }
Exemple #8
0
 public void onClick()
 {
     CombatUiStateKeeper.displayActionSelectionStep();
     CombatUiStateKeeper.step = 2;
     this.actionCommandPanelHandler.populatePanel();
 }
Exemple #9
0
 public void onClick()
 {
     this.abilityCommandPanelHandler.populatePanel(this.name);
     CombatUiStateKeeper.displayAbilitySelectionStep();
     CombatUiStateKeeper.step = 3;
 }