예제 #1
0
        public void ExecAction(ActionParameter action, Skill skill, BasePartsData target, int num, float starttime)
        {
            //int index = skill.ActionParmeters.FindIndex(a => a == action)+1;
            //int index2 = skill.ActionParmeters.Count;
            //string loging = Owner.UnitName + "执行技能" + skill.SkillName  + "(" + index + "/" + index2 + ")"
            //    + ",目标"  + target.Owner.UnitName;
            //Debug.Log(loging);
            //BattleUIManager.Instance.LogMessage(loging, Owner.IsOther);
            Dictionary <int, float> valueDic = new Dictionary <int, float>
            {
                { 1, 0 }, { 2, 0 }, { 3, 0 }, { 4, 0 }, { 5, 0 }, { 6, 0 }, { 7, 0 }
            };

            for (int i = 1; i < 8; i++)
            {
                float addValue  = 0;
                float multValue = 1;
                float divVale   = 1;
                if (action.AdditionalValue.TryGetValue(i, out float add))
                {
                    addValue = add;
                }
                if (action.MultipleValue.TryGetValue(i, out float mult))
                {
                    multValue = mult;
                }
                if (action.DivideValue.TryGetValue(i, out float div))
                {
                    divVale = div == 0 ? 1 : div;
                }
                valueDic[i] = (((action.Value.TryGetValue(i, out float value)?value:0) + addValue) * multValue) / divVale;
            }
            bool v52 = action.JudgeLastAndNotExeced(target.Owner, num);
            int  v34 = action.AlreadyExecedData[target.Owner][num].TargetPartsNumber;
            Dictionary <int, bool> enabledChildaction = new Dictionary <int, bool>();

            if (!target.ResistStatus(action.ActionType, action.ActionDetail1, this.Owner, v52, v34 == 1, target))
            {
                if (action.JudgeIsAlreadyExeced(target.Owner, num))
                {
                    //暂时忽略子技能
                    action.ExecAction(Owner, target, num, this, skill, 0, enabledChildaction, valueDic);
                }
            }
            if (action.ActionType != eActionType.REFLEXIVE)
            {
                if (action.HitOnceDic.ContainsKey(target))
                {
                    if (action.ExecTime.Length - 1 != num)
                    {
                        return;//技能还没执行完毕,返回
                    }
                    if (!action.HitOnceDic[target])
                    {
                        foreach (int i in action.ActionChildrenIndexes)
                        {
                            skill.ActionParmeters[action.ActionChildrenIndexes[i]].OnActionEnd?.Invoke();
                        }
                        return;
                    }
                }
                ExecChildrenAction(action, skill, target, num, starttime, enabledChildaction);
            }
        }