Esempio n. 1
0
        public override void Action()
        {
            base.Action();
            RPGCharacter target = Target();

            if (target == null)
            {
                return;
            }
            EquipWeapon(target.Logic);

            var side      = PositionMath.GetSidewayTilePos(target.GetTileCoord());
            var avSidePos = PositionMath.MoveableAreaPoints.Intersect(side).ToList();

            if (avSidePos.Count == 0)
            {
                return;
            }
            Vector2Int        bestPos  = PositionMath.GetBestTilePos(avSidePos);
            List <Vector2Int> routines = PositionMath.GetMoveRoutine(bestPos);
            var move = AddSequenceEvent <MoveCharacter>();

            move.CameraFollow      = true;
            move.Routine           = routines;
            move.CharacterID       = -1;
            move.WaitUntilFinished = true;
            move.Speed             = EModeSpeed.Normal;

            BattlePlayer.AssembleAttackSequenceEvent(AddSequenceEvent <AttackAnimation>, logic, target.Logic);
        }
Esempio n. 2
0
    public void MoveUnitAfterAction(EnumCharacterCamp camp, Vector2Int srcPos, Vector2Int destPos, float speed, UnityAction onComplete)
    {
        List <Vector2Int> routine = PositionMath.GetMoveRoutine(destPos);

        gameMode.unitShower.MoveUnit(routine, onComplete, speed);
        PositionMath.ResetTileOccupyStatus(srcPos);

        if (camp == EnumCharacterCamp.Enemy)
        {
            PositionMath.SetTileEnemyOccupied(destPos);
        }
        else
        {
            PositionMath.SetTilePlayerOccupied(destPos);
        }
    }