예제 #1
0
        public void SetTargetDestination(IntVector2 targetIndex, int distance)
        {
            InputHandler.instance.tacticsXInput = false;
            GridCell cell = mapAdapter.GetCellByIndex(targetIndex);

            moveLocation = cell.transform.position;

            if (cell.isStairs)
            {
                moveLocation += Vector3.up * .75f;
            }

            characterStats.UseAP(distance);
            stateManager.characterAction   = CharacterAction.Moving;
            stateManager.characterState    = CharacterState.IsInteracting;
            characterRigidBody.constraints = RigidbodyConstraints.FreezeRotation;
            currentPathIndex = 1;

            SetNextPos(path[currentPathIndex]);
            //Debug.Log(characterStats.characterName + " Setting Destination");
        }
예제 #2
0
        public static void Activate(CharacterStats characterStats, AnimationHandler animationHandler, TaticalMovement taticalMovement, Skill skill, float delta)
        {
            IntVector2 index = taticalMovement.GetMouseIndex();

            GridManager.Instance.HighlightCastableRange(taticalMovement.currentIndex, index, skill);
            int distance = taticalMovement.GetRequiredMoves(index, taticalMovement.path);

            if (index.x >= 0 && characterStats.currentAP >= skill.APcost)
            {
                if (Input.GetMouseButtonDown(0) || InputHandler.instance.tacticsXInput)
                {
                    InputHandler.instance.tacticsXInput = false;

                    animationHandler.PlayTargetAnimation("Attack");
                    characterStats.UseAP(skill.APcost);
                    GridManager.Instance.RemoveAllHighlights();
                    List <GridCell> cells = CastableShapes.GetCastableCells(skill, index);
                    foreach (GridCell cell in cells)
                    {
                        AlchemyManager.Instance.ApplyLiquid(cell.alchemyState, LiquidPhaseState.Oil);
                    }
                }
            }
        }