当前位置: 首页>>代码示例>>C#>>正文


C# SimDescription.HasTrait方法代码示例

本文整理汇总了C#中SimDescription.HasTrait方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.HasTrait方法的具体用法?C# SimDescription.HasTrait怎么用?C# SimDescription.HasTrait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimDescription的用法示例。


在下文中一共展示了SimDescription.HasTrait方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Satisfies

        public bool Satisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (!inspecting)
            {
                Occupation career = CareerManager.GetStaticOccupation(mCareer);
                if (career == null) return false;

                if ((GameUtils.IsFutureWorld()) && (!career.AvailableInFutureWorld)) return false;

                if (sim.IsEP11Bot)
                {
                    if (!sim.HasTrait(TraitNames.ProfessionalChip))
                    {
                        return false;
                    }
                }

                if (sim.CreatedSim != null)
                {
                    if ((sim.Occupation == null) || (sim.Occupation.Guid != mCareer))
                    {
                        GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                        if (!career.CanAcceptCareer(sim.CreatedSim.ObjectId, ref greyedOutTooltipCallback)) return false;
                    }
                }
            }

            return PrivateSatisfies(manager, sim, newLot, inspecting);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:29,代码来源:DreamJob.cs

示例2: Run

        protected override bool Run(SimDescription me, bool singleSelection)
        {
            List<SimTrait.Item> allOptions = new List<SimTrait.Item>();
            foreach (Sims3.Gameplay.ActorSystems.Trait trait in TraitManager.GetDictionaryTraits)
            {
                if (trait.IsReward) continue;

                if (!trait.TraitValidForAgeSpecies(me.GetCASAGSAvailabilityFlags())) continue;

                int count = 0;
                if (me.TraitManager.mUniversityGraduateTraitGuid == trait.Guid)
                {
                    count = 1;
                }
                else if (me.HasTrait(trait.Guid))
                {
                    continue;
                }

                allOptions.Add(new SimTrait.Item (trait.Guid, count));
            }

            SimTrait.Item selection = new CommonSelection<SimTrait.Item>(Name, me.FullName, allOptions, new SimTrait.AuxillaryColumn()).SelectSingle();
            if (selection == null) return false;

            TraitNames traitName = selection.Value;

            me.RemoveUniversityGraduateTrait();

            if (traitName != me.TraitManager.mUniversityGraduateTraitGuid)
            {
                Sims3.Gameplay.ActorSystems.Trait selTrait = TraitManager.GetTraitFromDictionary(traitName);
                if (selTrait != null)
                {
                    me.TraitManager.mUniversityGraduateTraitEnabled = true;
                    me.AddUniversityGraduateTrait(selTrait);
                }
            }

            if ((me.CreatedSim != null) && (me.CreatedSim.SocialComponent != null))
            {
                me.CreatedSim.SocialComponent.UpdateTraits();
            }

            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:46,代码来源:ChangeGraduationlTrait.cs

示例3: GetNumForBirth

        public override int GetNumForBirth(SimDescription dadDescription, Random pregoRandom, int numSimMembers, int numPetMembers)
        {
            try
            {
                int desiredNumChilderen = 0x1;
                SimDescription simDescription = Mom.SimDescription;
                if (simDescription.Species != CASAgeGenderFlags.Horse)
                {
                    double num2 = pregoRandom.NextDouble();
                    float multiplier = Math.Min(mMultipleBabiesMultiplier, kMaxBabyMultiplier);

                    if (mMom.HasTrait(TraitNames.FertilityTreatmentPet))
                    {
                        multiplier += TraitTuning.kFertilityLargeLitterMultiplier;
                    }

                    if ((dadDescription != null) && dadDescription.HasTrait(TraitNames.FertilityTreatmentPet))
                    {
                        multiplier += TraitTuning.kFertilityLargeLitterMultiplier;
                    }

                    if (num2 < (kChanceOfTwoOffspring * multiplier))
                    {
                        desiredNumChilderen++;
                        if (num2 < (kChanceOfThreeOffspring * multiplier))
                        {
                            desiredNumChilderen++;
                            if (num2 < (kChanceOfFourOffspring * multiplier))
                            {
                                desiredNumChilderen++;
                            }
                        }
                    }
                }

                return desiredNumChilderen;

                // Greater than Eight check
                //return Household.GetAllowableNumChildren(simDescription, desiredNumChilderen, numSimMembers, numPetMembers);
            }
            catch (Exception e)
            {
                Common.Exception(Mom.SimDescription, dadDescription, e);
                return 1;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:46,代码来源:PetPregnancyProxy.cs

示例4: RestoreFutureTrait

        public static void RestoreFutureTrait(SimDescription desc)
        {
            if (desc == null)
            {
                return;
            }

            if (Register.Settings.mFutureSims.Contains(desc.SimDescriptionId) && desc.TraitManager != null && !desc.HasTrait(TraitNames.FutureSim))
            {
                Trait trait = TraitManager.GetTraitFromDictionary(TraitNames.FutureSim);
                if (trait != null)
                {
                    desc.AddTrait(trait);
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:16,代码来源:RoleTouristEx.cs

示例5: Allow

        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return false;
            }
            else if (sim.LotHome == null)
            {
                IncStat("Not Resident");
                return false;
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return false;
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skills Denied");
                return false;
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Push Denied");
                return false;
            }
            else if (sim.CreatedSim.BuffManager == null)
            {
                IncStat("No Manager");
                return false;
            }
            else if ((sim.CreatedSim.BuffManager.HasElement(BuffNames.Singed)) ||
                     (sim.CreatedSim.BuffManager.HasElement(BuffNames.SingedElectricity)))
            {
                IncStat("Singed");
                return false;
            }
            else if ((sim.IsEP11Bot) && (!sim.HasTrait(TraitNames.HandiBotChip)))
            {
                IncStat("Chip Denied");
                return false;
            }

            return base.Allow(sim);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:46,代码来源:RepairScenario.cs

示例6: GetNumForBirth

        public override int GetNumForBirth(SimDescription dadDescription, Random pregoRandom, int numSimMembers, int numPetMembers)
        {
            try
            {
                int desiredNumChilderen = 0x1;
                if (mMom.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    mMom.TraitManager.RemoveElement(TraitNames.WishedForLargeFamily);
                    desiredNumChilderen = 0x4;
                }

                if ((dadDescription != null) && (dadDescription.TraitManager.HasElement(TraitNames.WishedForLargeFamily)))
                {
                    dadDescription.TraitManager.RemoveElement(TraitNames.WishedForLargeFamily);
                    desiredNumChilderen = 0x4;
                }

                if (desiredNumChilderen != 4)
                {
                    mMultipleBabiesMultiplier = Math.Min(mMultipleBabiesMultiplier, kMaxBabyMultiplier);

                    if (mMom.HasTrait(TraitNames.FertilityTreatment))
                    {
                        mMultipleBabiesMultiplier *= TraitTuning.kFertilityMultipleBabiesMultiplier;
                    }
                    else if ((mMom.BuffManager != null) && mMom.BuffManager.HasElement(BuffNames.ATwinkleInTheEye))
                    {
                        mMultipleBabiesMultiplier *= TraitTuning.kFertilityMultipleBabiesMultiplier;
                    }

                    if (dadDescription != null)
                    {
                        if (dadDescription.HasTrait(TraitNames.FertilityTreatment))
                        {
                            mMultipleBabiesMultiplier *= TraitTuning.kFertilityMultipleBabiesMultiplier;
                        }
                        else if ((dadDescription.CreatedSim != null) && (dadDescription.CreatedSim.BuffManager != null) && dadDescription.CreatedSim.BuffManager.HasElement(BuffNames.ATwinkleInTheEye))
                        {
                            mMultipleBabiesMultiplier *= TraitTuning.kFertilityMultipleBabiesMultiplier;
                        }
                    }

                    double num2 = pregoRandom.NextDouble();
                    if (num2 < (kChanceOfTwins * mMultipleBabiesMultiplier))
                    {
                        desiredNumChilderen++;
                        if (num2 < (kChanceOfTriplets * mMultipleBabiesMultiplier))
                        {
                            desiredNumChilderen++;
                            if (num2 < (Woohooer.Settings.mChanceOfQuads * mMultipleBabiesMultiplier))
                            {
                                desiredNumChilderen++;
                            }
                        }
                    }
                }

                return desiredNumChilderen;

                // Greater than Eight check
                //return Household.GetAllowableNumChildren(simDescription, desiredNumChilderen, numSimMembers, numPetMembers);
            }
            catch (Exception e)
            {
                Common.Exception(Mom.SimDescription, dadDescription, e);
                return 1;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:68,代码来源:PregnancyProxy.cs


注:本文中的SimDescription.HasTrait方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。