예제 #1
0
        public static void InitializeModSkill(ref GameObject prefab, ProxyObject dict, string className = "ModSkill")
        {
            if (prefab is null || prefab.GetComponent <ModSkill>() != null || !ModComponentUtils.JsonUtils.ContainsKey(dict, className))
            {
                return;
            }
            ModSkill newSkill = prefab.AddComponent <ModSkill>();

            newSkill.DisplayName = dict[className]["DisplayName"];
            newSkill.Icon        = dict[className]["Icon"];
            newSkill.Image       = dict[className]["Image"];

            newSkill.PointsLevel2      = dict[className]["PointsLevel2"];
            newSkill.PointsLevel3      = dict[className]["PointsLevel3"];
            newSkill.PointsLevel4      = dict[className]["PointsLevel4"];
            newSkill.PointsLevel5      = dict[className]["PointsLevel5"];
            newSkill.DescriptionLevel1 = dict[className]["DescriptionLevel1"];
            newSkill.DescriptionLevel2 = dict[className]["DescriptionLevel2"];
            newSkill.DescriptionLevel3 = dict[className]["DescriptionLevel3"];
            newSkill.DescriptionLevel4 = dict[className]["DescriptionLevel4"];
            newSkill.DescriptionLevel5 = dict[className]["DescriptionLevel5"];
            newSkill.EffectsLevel1     = dict[className]["EffectsLevel1"];
            newSkill.EffectsLevel2     = dict[className]["EffectsLevel2"];
            newSkill.EffectsLevel3     = dict[className]["EffectsLevel3"];
            newSkill.EffectsLevel4     = dict[className]["EffectsLevel4"];
            newSkill.EffectsLevel5     = dict[className]["EffectsLevel5"];
        }
예제 #2
0
        private static void MapSkill(GameObject prefab)
        {
            ModSkill modSkill = ModUtils.GetComponent <ModSkill>(prefab);

            if (modSkill != null)
            {
                Mapper.RegisterSkill(modSkill);
            }
        }
예제 #3
0
        private static void MapSkill(GameObject prefab)
        {
            SkillJson.InitializeModSkill(ref prefab);
            ModSkill modSkill = ModComponentUtils.ComponentUtils.GetComponent <ModSkill>(prefab);

            if (modSkill != null)
            {
                SkillsMapper.RegisterSkill(modSkill);
            }
        }
예제 #4
0
        internal static void MapSkill(ModSkill modSkill)
        {
            SerializableSkill skill = new GameObject().AddComponent <SerializableSkill>();

            skill.name = modSkill.name;
            skill.m_LocalizedDisplayName      = CreateLocalizedString(modSkill.DisplayName);
            skill.m_SkillType                 = (SkillType)GameManager.GetSkillsManager().GetNumSkills();
            skill.m_SkillIcon                 = modSkill.Icon;
            skill.m_SkillIconBackground       = modSkill.Image;
            skill.m_SkillImage                = modSkill.Image;
            skill.m_TierPoints                = new int[] { 0, modSkill.PointsLevel2, modSkill.PointsLevel3, modSkill.PointsLevel4, modSkill.PointsLevel5 };
            skill.m_TierLocalizedBenefits     = CreateLocalizedStrings(modSkill.EffectsLevel1, modSkill.EffectsLevel2, modSkill.EffectsLevel3, modSkill.EffectsLevel4, modSkill.EffectsLevel5);
            skill.m_TierLocalizedDescriptions = CreateLocalizedStrings(modSkill.DescriptionLevel1, modSkill.DescriptionLevel2, modSkill.DescriptionLevel3, modSkill.DescriptionLevel4, modSkill.DescriptionLevel5);

            ModUtils.ExecuteMethod(GameManager.GetSkillsManager(), "InstantiateSkillPrefab", skill.gameObject);
        }
예제 #5
0
 internal static void RegisterSkill(ModSkill modSkill)
 {
     skills.Add(modSkill);
 }