コード例 #1
0
    public override IEnumerator ExecuteAction(Actor source, BoardManager bm)
    {
        bm.Selector.MoveTo(moveTarget.data.posX, moveTarget.data.posY);
        //move to the target tile
        int pathLeng = MoveToTarget(source, bm, moveTarget.data.posX, moveTarget.data.posY);

        // use skill
        Combat c = new Combat(source);

        yield return(new WaitForSeconds(waitTime * pathLeng));

        AnimationData data = AnimationData.NewAntionData(skillToUse,
                                                         Globals.GetBoardManager().pathfinding.GetTileNode(source),
                                                         skillTarget);


        bm.tileSelection.ClearAllRange();
        //AttackRange(bm, source);

        bm.tileSelection.PopulateMovementRange(
            bm.pathfinding.GetSkillRange(skillToUse, source, source.GetPosX(), source.GetPosY()));
        bm.ui.SkillInUseName.InitLabel(skillToUse.GetName());


        bm.Selector.MoveTo(skillTarget.data.posX, skillTarget.data.posY);
        yield return(new WaitForSeconds(.75f));

        bm.tileSelection.ClearAllRange();

        //targeted tiles
        List <TileNode> nodesInRange = skillToUse.GetTargetedTiles(source, skillTarget);

        bm.tileSelection.PopulateAttackRange(nodesInRange);
        yield return(new WaitForSeconds(.75f));

        //targeted tiles cleared
        bm.tileSelection.ClearAllRange();

        bm.ui.SkillInUseName.ToggleOff();
        c.animationDatas.Add(data);

        ///HACK
        ///This is hacked as f**k

        source.Wait();
        bm.inputFSM.SwitchState(new PlayingAnimationInputState(bm, c));
        bm.turnManager.CalculateFastest();

        /*
         * c.animationDatas.Add(data);
         *
         * c.UseSkill();
         * c.PayCostsCDAttack();
         * source.Wait();
         *
         *
         * bm.turnManager.CalculateFastest(); //this is when the state machine changes
         */
    }
コード例 #2
0
    public override void EnterState()
    {
        //show range
        range = pathfinding.GetSkillRange(currentSkill, currentActor, currentActor.GetPosX(), currentActor.GetPosY());
        //filter that

        //back to bool

        //pass to pupulation

        selection.PopulateMovementRange(range);

        label.InitLabel(currentSkill.GetName());
    }