Beispiel #1
0
        internal static void MapSkill(ModSkill modSkill)
        {
            SerializableSkill skill = new GameObject().AddComponent <SerializableSkill>();

            skill.name = modSkill.name;
            skill.m_LocalizedDisplayName      = NameUtils.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     = NameUtils.CreateLocalizedStrings(modSkill.EffectsLevel1, modSkill.EffectsLevel2, modSkill.EffectsLevel3, modSkill.EffectsLevel4, modSkill.EffectsLevel5);
            skill.m_TierLocalizedDescriptions = NameUtils.CreateLocalizedStrings(modSkill.DescriptionLevel1, modSkill.DescriptionLevel2, modSkill.DescriptionLevel3, modSkill.DescriptionLevel4, modSkill.DescriptionLevel5);

            GameManager.GetSkillsManager().InstantiateSkillPrefab(skill.gameObject);
        }
Beispiel #2
0
        private static void ConfigureGearItem(ModComponent modComponent)
        {
            GearItem gearItem = ComponentUtils.GetOrCreateComponent <GearItem>(modComponent);

            gearItem.m_Type         = GetGearType(modComponent);
            gearItem.m_WeightKG     = modComponent.WeightKG;
            gearItem.m_MaxHP        = modComponent.MaxHP;
            gearItem.m_DailyHPDecay = GetDecayPerStep(modComponent.DaysToDecay, modComponent.MaxHP);
            gearItem.OverrideGearCondition(EnumUtils.TranslateEnumValue <GearStartCondition, InitialCondition>(modComponent.InitialCondition), false);
            // OverrideGearCondition wanted to know if the item had been picked up yet; since Awake hadn't been called yet, I put false

            gearItem.m_LocalizedDisplayName = NameUtils.CreateLocalizedString(modComponent.DisplayNameLocalizationId);
            gearItem.m_LocalizedDescription = NameUtils.CreateLocalizedString(modComponent.DescriptionLocalizatonId);

            gearItem.m_PickUpAudio  = modComponent.PickUpAudio;
            gearItem.m_StowAudio    = modComponent.StowAudio;
            gearItem.m_PutBackAudio = modComponent.PickUpAudio;
            gearItem.m_WornOutAudio = modComponent.WornOutAudio;

            gearItem.m_ConditionTableType = GetConditionTableType(modComponent);
            gearItem.m_ScentIntensity     = ScentMapper.GetScentIntensity(modComponent);

            gearItem.Awake();
        }