Esempio n. 1
0
        private static void AddUnlockedAbility(AvatarActor avatarActor, ConfigAvatarAbilityUnlock unlockConfig, Dictionary <string, bool> defaultReplaceMap, float skillParam1 = 0, float skillParam2 = 0, float skillParam3 = 0)
        {
            ConfigAbility abilityConfig            = AbilityData.GetAbilityConfig(unlockConfig.AbilityName, unlockConfig.AbilityOverride);
            Dictionary <string, object> dictionary = null;
            bool flag = false;

            for (int i = 0; i < avatarActor.appliedAbilities.Count; i++)
            {
                if (avatarActor.appliedAbilities[i].Item1.AbilityName == unlockConfig.AbilityName)
                {
                    dictionary = avatarActor.appliedAbilities[i].Item2;
                    if (avatarActor.appliedAbilities[i].Item1 != abilityConfig)
                    {
                        avatarActor.appliedAbilities[i] = Tuple.Create <ConfigAbility, Dictionary <string, object> >(abilityConfig, dictionary);
                    }
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                dictionary = avatarActor.CreateAppliedAbility(abilityConfig);
                if (unlockConfig.AbilityReplaceID != null)
                {
                    defaultReplaceMap[unlockConfig.AbilityReplaceID]        = true;
                    avatarActor.abilityIDMap[unlockConfig.AbilityReplaceID] = unlockConfig.AbilityName;
                }
            }
            if (unlockConfig.ParamSpecial1 != null)
            {
                AbilityData.SetupParamSpecial(abilityConfig, dictionary, unlockConfig.ParamSpecial1, unlockConfig.ParamMethod1, skillParam1);
            }
            if (unlockConfig.ParamSpecial2 != null)
            {
                AbilityData.SetupParamSpecial(abilityConfig, dictionary, unlockConfig.ParamSpecial2, unlockConfig.ParamMethod2, skillParam2);
            }
            if (unlockConfig.ParamSpecial3 != null)
            {
                AbilityData.SetupParamSpecial(abilityConfig, dictionary, unlockConfig.ParamSpecial3, unlockConfig.ParamMethod3, skillParam3);
            }
        }
Esempio n. 2
0
 public static void ApplyGalTouchBuffEntry(AvatarActor avatarActor, int buffId, float calculatedParam1, float calculatedParam2, float calculatedParam3)
 {
     if (buffId > 0)
     {
         ConfigGalTouchBuffEntry     galTouchBuffEntry = GetGalTouchBuffEntry(buffId);
         ConfigAbility               abilityConfig     = AbilityData.GetAbilityConfig(galTouchBuffEntry.AbilityName, galTouchBuffEntry.AbilityOverride);
         Dictionary <string, object> overrideMap       = avatarActor.CreateAppliedAbility(abilityConfig);
         if (galTouchBuffEntry.ParamSpecial1 != null)
         {
             AbilityData.SetupParamSpecial(abilityConfig, overrideMap, galTouchBuffEntry.ParamSpecial1, galTouchBuffEntry.ParamMethod1, calculatedParam1);
         }
         if (galTouchBuffEntry.ParamSpecial2 != null)
         {
             AbilityData.SetupParamSpecial(abilityConfig, overrideMap, galTouchBuffEntry.ParamSpecial2, galTouchBuffEntry.ParamMethod2, calculatedParam2);
         }
         if (galTouchBuffEntry.ParamSpecial3 != null)
         {
             AbilityData.SetupParamSpecial(abilityConfig, overrideMap, galTouchBuffEntry.ParamSpecial3, galTouchBuffEntry.ParamMethod3, calculatedParam3);
         }
     }
 }