コード例 #1
0
    /** 计算一个变量值 */
    public static int calculateOneSkillVarValue(int[] args, UnitFightDataLogic self, UnitFightDataLogic target)
    {
        int key;

        if ((key = args[0]) == SkillVarSourceType.ConstValue)
        {
            return(args[1]);
        }

        if (BaseC.constlist.skillVarSource_isTarget(key))
        {
            if (target == null)
            {
                return(0);
            }

            return(target.getSkillVarSourceValue(args, false));
        }
        else
        {
            if (self == null)
            {
                return(0);
            }

            return(self.getSkillVarSourceValue(args, true));
        }
    }
コード例 #2
0
    private static int getOneSVar(int[][] args, int index, UnitFightDataLogic self, UnitFightDataLogic target, int[] selfValues, int start)
    {
        int[] arr = args[index];

        if (arr[0] == SkillVarSourceType.ConstValue)
        {
            return(arr[1]);
        }

        bool isTarget;

        if ((isTarget = BaseC.constlist.skillVarSource_isTarget(arr[0])) || selfValues == null)
        {
            if (isTarget)
            {
                if (target == null)
                {
                    return(0);
                }

                return(target.getSkillVarSourceValue(arr, false));
            }
            else
            {
                if (self == null)
                {
                    return(0);
                }

                return(self.getSkillVarSourceValue(arr, true));
            }
        }
        else
        {
            return(selfValues[start + index]);
        }
    }