示例#1
0
 public override void SettingsChanged()
 {
     AttractionCalculation  = settingAttractionCalculation.Value;
     genderMode             = settingGenderMode.Value;
     averageKinseyFemale    = settingAverageKinseyFemale.Value;
     extraspeciesRomance    = settingExtraspeciesRomance.Value;
     averageKinseyMale      = settingAverageKinseyMale.Value;
     baseRomanceChance      = settingBaseRomanceChance.Value;
     baseBreakupChance      = settingBaseBreakupChance.Value;
     baseFlirtChance        = settingBaseFlirtChance.Value;
     romanticSuccessRate    = settingRomanticSuccessRate.Value;
     decayRate              = settingDecayRate.Value;
     numberOfRelationships  = settingNumberOfRelationships.Value;
     polygamousWorld        = settingPolygamousWorld.Value;
     rerollBeautyTraits     = settingRerollBeautyTraits.Value;
     informalRomanceLetters = settingInformalRomanceLetters.Value;
     detailedDebugLogs      = settingDetailedDebugLogs.Value;
     detailedAttractionLogs = settingDetailedAttractionLogs.Value;
 }
示例#2
0
        public override void DefsLoaded()
        {
            settingAttractionCalculation     = Settings.GetHandle("GRAttractionCalculationSetting", "AttractionCalculationSetting_title".Translate(), "AttractionCalculationSetting_desc".Translate(), AttractionCalculationSetting.Complex, null, "AttractionCalculationSetting_");
            settingGenderMode                = Settings.GetHandle("GRGenderModeSetting", "GenderModeSetting_title".Translate(), "GenderModeSetting_desc".Translate(), GenderModeSetting.Vanilla, null, "GenderModeSetting_");
            settingAverageKinseyFemale       = Settings.GetHandle("GRaverageKinseyFemale", "AverageKinseyFemale_title".Translate(), "AverageKinseyFemale_desc".Translate(), KinseyDescriptor.ExclusivelyHeterosexual, null, "KinseyDescriptor_");
            settingAverageKinseyMale         = Settings.GetHandle("GRaverageKinseyMale", "AverageKinseyMale_title".Translate(), "AverageKinseyMale_desc".Translate(), KinseyDescriptor.ExclusivelyHeterosexual, null, "KinseyDescriptor_");
            settingSeductionMode             = Settings.GetHandle("GRseductionModeSetting", "SeductionModeSetting_title".Translate(), "SeductionModeSetting_desc".Translate(), SeductionModeSetting.OnlyRelationship, null, "SeductionModeDescriptor_");
            settingExtraspeciesRomance       = Settings.GetHandle("GRextraspeciesRomance", "ExtraspeciesRomance_title".Translate(), "ExtraspeciesRomance_desc".Translate(), ExtraspeciesRomanceSetting.OnlyXenophobesNever, null, "ExtraspeciesRomanceDescriptor_");
            settingBaseRomanceChance         = Settings.GetHandle <int>("GRbaseRomanceChance", "BaseRomanceChance_title".Translate(), "BaseRomanceChance_desc".Translate(), 100);
            settingBaseBreakupChance         = Settings.GetHandle <int>("GRbaseBreakupChance", "BaseBreakupChance_title".Translate(), "BaseBreakupChance_desc".Translate(), 100);
            settingBaseFlirtChance           = Settings.GetHandle <int>("GRbaseFlirtChance", "BaseFlirtChance_title".Translate(), "BaseFlirtChance_desc".Translate(), 100);
            settingBaseSeductionChance       = Settings.GetHandle <int>("GRbaseSeductionChance", "BaseSeductionChance_title".Translate(), "BaseSeductionChance_desc".Translate(), 100);
            settingRomanticSuccessRate       = Settings.GetHandle <int>("GRromanticSuccessRate", "RomanceSuccessRate_title".Translate(), "RomanceSuccessRate_desc".Translate(), 100);
            settingDecayRate                 = Settings.GetHandle <int>("GRdecayRate", "DecayRate_title".Translate(), "DecayRate_desc".Translate(), 25);
            settingMinAttractionForSeduction = Settings.GetHandle <int>("GRminAttractionForSeduction", "MinAttraction_title".Translate(), "MinAttraction_desc".Translate(), 90);
            settingNumberOfRelationships     = Settings.GetHandle <int>("GRnumberOfRelationships", "NumberOfRelationships_title".Translate(), "NumberOfRelationships_desc".Translate(), 3);
            settingPolygamousWorld           = Settings.GetHandle <bool>("GRpolygamousWorld", "PolygamousWorld_title".Translate(), "PolygamousWorld_desc".Translate(), false);
            settingRerollBeautyTraits        = Settings.GetHandle <bool>("GRrerollBeautyTraits", "RerollBeautyTraits_title".Translate(), "RerollBeautyTraits_desc".Translate(), false);
            settingInformalRomanceLetters    = Settings.GetHandle <bool>("GRinformalRomanceLetters", "InformalLetters_title".Translate(), "InformalLetters_desc".Translate(), true);
            //useFacialAttractiveness = Settings.GetHandle<bool>("GRuseFacialAttractiveness", "UseFacialAttractiveness_title".Translate(), "UseFacialAttractiveness_desc".Translate(), false);
            settingDetailedDebugLogs      = Settings.GetHandle <bool>("GRdetailedDebugLogs", "DetailedDebugLog_title".Translate(), "DetailedDebugLog_desc".Translate(), false);
            settingDetailedAttractionLogs = Settings.GetHandle <bool>("GRdetailedAttractionLogs", "DetailedAttractionLog_title".Translate(), "DetailedAttractionLog_desc".Translate(), false);

            AttractionCalculation  = settingAttractionCalculation.Value;
            genderMode             = settingGenderMode.Value;
            averageKinseyFemale    = settingAverageKinseyFemale.Value;
            extraspeciesRomance    = settingExtraspeciesRomance.Value;
            averageKinseyMale      = settingAverageKinseyMale.Value;
            baseRomanceChance      = settingBaseRomanceChance.Value;
            baseBreakupChance      = settingBaseBreakupChance.Value;
            baseFlirtChance        = settingBaseFlirtChance.Value;
            baseSeductionChance    = settingBaseSeductionChance.Value;
            romanticSuccessRate    = settingRomanticSuccessRate.Value;
            decayRate              = settingDecayRate.Value;
            numberOfRelationships  = settingNumberOfRelationships.Value;
            polygamousWorld        = settingPolygamousWorld.Value;
            rerollBeautyTraits     = settingRerollBeautyTraits.Value;
            informalRomanceLetters = settingInformalRomanceLetters.Value;
            detailedDebugLogs      = settingDetailedDebugLogs.Value;
            detailedAttractionLogs = settingDetailedAttractionLogs.Value;


            List <FlirtStyleDef> allDefsListForReading = DefDatabase <FlirtStyleDef> .AllDefsListForReading;

            Logger.Message("Gradual Romance loaded with " + allDefsListForReading.Count().ToString() + " flirt styles.");

            //Only give GRPawnComp to pawns that have a psychecomp
            foreach (ThingDef def in DefDatabase <ThingDef> .AllDefs)
            {
                bool addComp = false;
                if (def.comps != null)
                {
                    for (int i = 0; i < def.comps.Count(); i++)
                    {
                        if (def.comps[i] is Psychology.CompProperties_Psychology)
                        {
                            addComp = true;
                            break;
                        }
                    }
                    if (addComp == true)
                    {
                        def.comps.Add(new GRPawnComp_Properties());
                        if (def.modExtensions == null)
                        {
                            def.modExtensions = new List <DefModExtension> {
                            };
                        }
                        if (!def.HasModExtension <XenoRomanceExtension>())
                        {
                            Logger.Message("Autopatching " + def.defName);
                            def.modExtensions.Add(CreateXenoRomanceExtensionFor(def));
                        }

                        maleSexDriveCurves.Add(def, CreateCurveFrom(def.GetModExtension <XenoRomanceExtension>().sexDriveByAgeCurveMale));
                        femaleSexDriveCurves.Add(def, CreateCurveFrom(def.GetModExtension <XenoRomanceExtension>().sexDriveByAgeCurveFemale));
                        maleMaturityCurves.Add(def, CreateCurveFrom(def.GetModExtension <XenoRomanceExtension>().maturityByAgeCurveMale));
                        femaleMaturityCurves.Add(def, CreateCurveFrom(def.GetModExtension <XenoRomanceExtension>().maturityByAgeCurveFemale));
                    }
                }
            }

            //Patches
        }