Exemple #1
0
    public override bool HasParam(string pname)
    {
        MakeParametersIfNecessary();
        switch (mergeParameters)
        {
        case MergeModeList.UseOriginal:
            return(ReferredSkill.HasParam(pname));

        case MergeModeList.UseProxy:
            return(base.HasParam(pname));

        case MergeModeList.Combine:
        default:
            return(base.HasParam(pname) || ReferredSkill.HasParam(pname));
        }
    }
Exemple #2
0
    public override float GetParam(string pname, float fallback = float.NaN, SkillDef parentCtx = null)
    {
        MakeParametersIfNecessary();
        switch (mergeParameters)
        {
        case MergeModeList.UseOriginal:
            return(ReferredSkill.GetParam(pname, fallback, parentCtx ?? this));

        case MergeModeList.UseProxy:
            return(base.GetParam(pname, fallback, parentCtx));

        case MergeModeList.Combine:
        default:
            //use proxy if available, else referred
            return(runtimeParameters.ContainsKey(pname) ?
                   base.GetParam(pname, fallback, parentCtx) :
                   ReferredSkill.GetParam(pname, fallback, parentCtx ?? this));
        }
    }