Ejemplo n.º 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 EnterAction(BoardEntity boardEntity, Tile leavingTile, Action callback)
 {
     if (this.boardEntity.Team != boardEntity.Team && !influenceTiles.Contains(leavingTile))
     {
         influenceSkill.Action(boardEntity.GetTile(), callback);
     }
     else
     {
         callback();
     }
 }
Ejemplo n.º 3
0
        public void AddAttackAction(Skill skill, Tile t, Action callBack)
        {
            SkillReport report = skill.TheoreticalAction(t);

            if (report.TargetAfter.MutableStats[AttributeStats.StatType.Health].Value == 0)
            {
                scoredKill = true;
            }
            targetScore = report.targetAfter.GetMutableStat(AttributeStats.StatType.Health).Value;
            apCost     += skill.GetAPCost();
            actions.Add(() => skill.Action(t, callBack));
        }
Ejemplo n.º 4
0
 private void ExecuteSkill(TileSelectOption tile)
 {
     profile.UpdateProfile(null);
     if (tile != null)
     {
         if (cancelButton != null)
         {
             cancelButton.GetComponent <Button>().interactable = false;
         }
         selectedSkill.Action((List <Tile>)tile.ReturnObject, ExecuteSkillCallback);
     }
     else
     {
         ExecuteSkillCallback();
     }
 }
Ejemplo n.º 5
0
    private IEnumerator Attack(Skill skill)
    {
        isAttacking = true;
        AttackAnimation();

        Vector3      mouseWorldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        LivingEntity targetTemp      = target;

        LookAtTarget((target != null)? target.transform.position : mouseWorldPoint);
        CastBarUI.Instance.PopCastBar(skill.Icon, skill.Name, skill.CastTime, skill.BarColor);

        yield return(new WaitForSeconds(skill.CastTime));

        Skill skilltemp = Instantiate(skill, weaponHolds[DirectionIndex].position, Quaternion.identity);

        skilltemp.Initialize(targetTemp, mouseWorldPoint);
        skilltemp.Action();

        StopAttack();
    }