コード例 #1
0
        public override void Enter()
        {
            base.Enter();

            Vector2Int        target;
            List <Vector2Int> rangeList;

            parent.SelectedCharacter.GetSkillRange(out target, out rangeList);
            for (int i = 0; i < rangeList.Count; i++)
            {
                if (rangeList[i] == target)
                {
                    TilePainter.Instance.Painting("FrontSight", 4, rangeList[i]);
                }
                else
                {
                    TilePainter.Instance.Painting("YellowGrid", 2, rangeList[i]);
                }
            }

            _targetList.Clear();
            if (parent.SelectedCharacter.SelectedSkill is AttackSkill)
            {
                AttackSkill attackSkill = (AttackSkill)parent.SelectedCharacter.SelectedSkill;
                _targetList = attackSkill.GetTargetList();
                int damage;
                for (int i = 0; i < _targetList.Count; i++)
                {
                    damage = attackSkill.CalculateDamage(parent.SelectedCharacter.Info, _targetList[i].Info, false, false);
                    BattleUI.Instance.SetPredictionHP(_targetList[i], damage);
                }
            }
        }
コード例 #2
0
    public void CalculateOnClick()
    {
        CalculaterGroup[0].SetData();
        CalculaterGroup[1].SetData();
        //Skill skill = SkillFactory.GetNewSkill(int.Parse(SkillInputField.text), CalculaterGroup[0].Info, 1); //等級暫時填1
        AttackSkill skill  = new AttackSkill(Convert.ToBoolean(SkillTypeDropDown.value), int.Parse(SkillInputField.text));
        int         damage = skill.CalculateDamage(CalculaterGroup[0].Info, CalculaterGroup[1].Info, false, false);

        ResultLabel.text = CalculaterGroup[0].Info.Name + " 對 " + CalculaterGroup[1].Info.Name + " 造成了 " + damage + " 傷害";
    }