예제 #1
0
        public void SetSelectedSkill(Skill skill)
        {
            selectedSkill = skill;
            tileSelectionManager.CancelSelection();

            if (skill.SelfCasting())
            {
                selectedSkill.Action(new List <Tile>(), ExecuteSkillCallback);
            }
            else
            {
                ClearButtonList();
                buildCancelSkillButton();
                List <TileSelectOption> tileSelectOptions = skill.TileOptionSet();
                foreach (TileSelectOption option in tileSelectOptions)
                {
                    if (option.DisplayStats != null)
                    {
                        option.OnHoverAction = () =>
                        {
                            if (getHoverEntity() == null)
                            {
                                profile.UpdateProfile(option.DisplayStats.BoardEntity, skillReport: option.skillReport);
                            }
                        };
                    }
                }
                tileSelectionManager.SelectTile(boardEntity, tileSelectOptions, ExecuteSkill);
            }


            //tileSelectionManager.SelectTile(boardEntity, skill.TileSet(), ExecuteSkill, Color.blue, Color.cyan);
        }
        private void buildMoveOptions()
        {
            if (selectedBoardEntity is CharacterBoardEntity)
            {
                if (TurnManager.CurrentBoardEntity == selectedBoardEntity)
                {
                    List <Move>             moveSet = selectedBoardEntity.MoveSet();
                    List <TileSelectOption> options = new List <TileSelectOption>();
                    foreach (Move m in moveSet)
                    {
                        Stats displaystats = selectedBoardEntity.Stats.GetCopy();
                        displaystats.SubtractAPPoints(m.apCost);
                        displaystats.SetMutableStat(StatType.Movement, m.movementPointsAfterMove);
                        Color col = ApCostColors[0];
                        if (m.apCost < ApCostColors.Count)
                        {
                            col = ApCostColors[m.apCost];
                        }
                        options.Add(new TileSelectOption()
                        {
                            Selection      = m.destination,
                            OnHover        = m.path,
                            HighlightColor = col,
                            HoverColor     = hoverColor,
                            ReturnObject   = m,
                            OnHoverAction  = (
                                () => {
                                if (getHoverEntity() == null)
                                {
                                    profile.PreviewMove(selectedBoardEntity, m);
                                    //profile.UpdateProfile(selectedBoardEntity, displaystats);
                                }
                            }
                                )
                        });
                    }

                    options.Add(new TileSelectOption()
                    {
                        Selection      = selectedBoardEntity.GetTile(),
                        HighlightColor = SelectColor,
                        HoverColor     = SelectColor,
                        OnHoverAction  = (
                            () => {
                            if (getHoverEntity() == null)
                            {
                                profile.UpdateProfile(selectedBoardEntity);
                            }
                        })
                    });

                    tileSelectionManager.SelectTile(selectedBoardEntity, options, sendMoveToBoardEntity, isMovement: true,
                                                    hoverExit: () => { if (hoverBoardEntity == null)
                                                                       {
                                                                           profile.UpdateProfile(selectedBoardEntity);
                                                                       }
                                                    }
                                                    );
                    skillSelector.SetBoardEntity((CharacterBoardEntity)selectedBoardEntity);
                    skillSelector.SetSkills(((CharacterBoardEntity)selectedBoardEntity).Skills);
                }
                else
                {
                    tileSelectionManager.SelectTile(selectedBoardEntity, new List <Move>(), sendMoveToBoardEntity, null, null);
                }
            }
        }