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


C# Sim.ShowTNSIfSelectable方法代码示例

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


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

示例1: AdoptFrankenSim

        public static bool AdoptFrankenSim(Sim creator, Sim frankenSim)
        {
            //if (creator.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.Human))
            {
                string str = "AdoptFrankenSim";
                InventingSkill skill = creator.SkillManager.GetSkill<InventingSkill>(SkillNames.Inventing);
                if ((skill != null) && skill.OppKnowFrankensimRecipeCompleted)
                {
                    str = "AdoptFrankenSimAgain";
                }

                SimDescription simDescription = frankenSim.SimDescription;
                if (TwoButtonDialog.Show(Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:" + str, new object[] { creator }), Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:AdoptFrankenSimYes", new object[0x0]), Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:AdoptFrankenSimNo", new object[0x0])))
                {
                    VisitSituation situation = VisitSituation.FindVisitSituationInvolvingGuest(frankenSim);
                    if (situation != null)
                    {
                        situation.Exit();
                    }

                    Household.NpcHousehold.Remove(simDescription);
                    creator.Household.Add(simDescription);
                    string str2 = StringInputDialog.Show(Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:AdoptFrankenSimNameTitle", new object[0x0]), Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:AdoptFrankenSimNamePrompt", new object[] { creator }), frankenSim.FirstName);
                    if (!string.IsNullOrEmpty(str2))
                    {
                        simDescription.FirstName = str2;
                    }

                    frankenSim.OnBecameSelectable();
                    return true;
                }

                Household.NpcHousehold.Remove(simDescription);
                Household household = Household.Create();
                household.Name = simDescription.LastName;
                household.Add(simDescription);
                household.FindSuitableVirtualHome();
                creator.ShowTNSIfSelectable(Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:SimBotNotAdopted", new object[] { creator }), StyledNotification.NotificationStyle.kGameMessagePositive, frankenSim.ObjectId);
                Sim.MakeSimGoHome(frankenSim, false);
                return false;
            }

            /*
            string message = Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/Inventing/InventionWorkbench:AdoptFrankenFullHousehold", new object[] { creator });
            creator.ShowTNSIfSelectable(message, StyledNotification.NotificationStyle.kGameMessageNegative);
            Sim.MakeSimGoHome(frankenSim, false);
            return false;
            */
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:49,代码来源:MakeFrankensimEx.cs

示例2: TravelToFuture

        public static bool TravelToFuture(TimePortal ths, Sim Actor, List<Sim> Followers, List<ulong> SimGuids)
        {
            // Custom
            string reason = null;
            if (TravelUtilEx.FinalBoardingCall(Actor.Household, Followers, WorldName.FutureWorld, false, ref reason))
            {
                new TravelControl(ths, Actor, Followers, SimGuids);

                Traveler.SaveGame();

                return true;
            }

            Actor.ShowTNSIfSelectable(Localization.LocalizeString(Actor.IsFemale, "Gameplay/Visa/TravelUtil:CantTravelFutureTNS", new object[0x0]) + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
            return false;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:16,代码来源:TimePortalEx.cs

示例3: DoHarvest

        private static bool DoHarvest(HarvestPlant ths, Sim actor, bool hasHarvested, BurglarSituation burglarSituation)
        {
            Slot[] containmentSlots = ths.GetContainmentSlots();
            List<GameObject> objectsHarvested = new List<GameObject>();
            foreach (Slot slot in containmentSlots)
            {
                GameObject containedObject = ths.GetContainedObject(slot) as GameObject;
                if ((containedObject != null) && HarvestHarvestable(ths, containedObject, actor, burglarSituation))
                {
                    objectsHarvested.Add(containedObject);
                }
            }

            if (actor.TraitManager.HasElement(TraitNames.GathererTrait) && RandomUtil.RandomChance01(TraitTuning.GathererTraitExtraHarvestablesChance))
            {
                int gathererTraitNumberOfExtraHarvestables = TraitTuning.GathererTraitNumberOfExtraHarvestables;
                for (int i = 0; i < gathererTraitNumberOfExtraHarvestables; i++)
                {
                    GameObject item = ths.Seed.Copy(false) as GameObject;
                    if (item != null)
                    {
                        objectsHarvested.Add(item);
                    }
                }
            }

            if (objectsHarvested.Count <= 0x0)
            {
                return false;
            }
            Gardening skill = actor.SkillManager.GetSkill<Gardening>(SkillNames.Gardening);
            Collecting collecting = actor.SkillManager.GetSkill<Collecting>(SkillNames.Collecting);

            int skillDifficulty = ths.PlantDef.GetSkillDifficulty();
            if (skill != null)
            {
                if (skill.SkillLevel <= skillDifficulty)
                {
                    if (actor.SimDescription.IsFairy && skill.IsFairySkill())
                    {
                        skill.AddPoints(ths.PlantDef.SkillPointsHarvest * Skill.SkillLevelBumpMultiplierForFairies);
                    }
                    else
                    {
                        skill.AddPoints(ths.PlantDef.SkillPointsHarvest);
                    }
                }

                if ((ths is MoneyTree) || (ths is OmniPlant))
                {
                    ths.UpdateGardeningSkillJournal(skill, ths.PlantDef, objectsHarvested);
                }
                else
                {
                    // Custom
                    UpdateGardeningSkillJournal(ths, skill, ths.PlantDef, objectsHarvested);
                }
            }
            if (!hasHarvested)
            {
                actor.ShowTNSIfSelectable(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Objects/Gardening/HarvestPlant/Harvest:FirstHarvest", new object[] { actor, ths.PlantDef.Name }), StyledNotification.NotificationStyle.kGameMessagePositive, ths.ObjectId, actor.ObjectId);
            }

            if (collecting == null)
            {
                collecting = (Collecting)actor.SkillManager.AddElement(SkillNames.Collecting);
            }
            collecting.CollectedFromHarvest(objectsHarvested);

            ths.PostHarvest();
            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:72,代码来源:HarvestEx.cs

示例4: AfterMoochMoney

        public static void AfterMoochMoney(Sim actor, Sim target, float moochSkillPoints, int moochSkillLevel)
        {
            try
            {
                Skill skill = actor.SkillManager.AddElement(SkillNames.Mooch);
                if (actor.SimDescription.Child)
                {
                    skill.AddSkillPointsLevelClamped(moochSkillPoints, TraitTuning.MoochTraitChildSkill);
                }
                else if (actor.SimDescription.Teen)
                {
                    skill.AddSkillPointsLevelClamped(moochSkillPoints, TraitTuning.MoochTraitTeenSkill);
                }
                else
                {
                    skill.AddPoints(moochSkillPoints);
                }

                int delta = Mooch.MoochAmounts[moochSkillLevel];
                if (RandomUtil.RandomChance01(TraitTuning.MoochTraitMoneyQuadChance))
                {
                    delta *= 0x4;
                }
                else if (RandomUtil.RandomChance01(TraitTuning.MoochTraitMoneyDoubleChance))
                {
                    delta *= 0x2;
                }
                delta = (int)(delta * RandomUtil.RandomFloatGaussianDistribution(TraitTuning.MoochTraitMoneyRandomBegin, TraitTuning.MoochTraitMoneyRandomEnd));

                NRaas.StoryProgression.Main.Money.AdjustFunds(target.SimDescription, "GiveAway", -delta);

                NRaas.StoryProgression.Main.Money.AdjustFunds(actor.SimDescription, "GiveAway", delta);

                actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(actor.IsFemale, "MoochMoney", new object[] { actor, delta, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, target.ObjectId);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:44,代码来源:MoochSocials.cs

示例5: DoAcceptReject

        public new static void DoAcceptReject(Sim actor, Sim target, Sim.GiveGift inst)
        {
            GameObject gift = inst.Gift;
            string message = "";
            string stingName = null;
            if (inst.RejectFromSpoiled)
            {
                if (DoesSimAlreadyOwnObject(target, gift))
                {
                    message = GiveGiftLocalizeString(target.IsFemale, "SpoiledAlreadyHave", new object[0x0]);
                }
                else
                {
                    message = GiveGiftLocalizeString(target.IsFemale, "SpoiledTooCheap", new object[0x0]);
                }
                InteractionInstance instance = Sim.GiveGiftTantrum.Singleton.CreateInstance(target, target, target.InheritedPriority(), false, true);
                target.InteractionQueue.PushAsContinuation(instance, true);
            }
            else
            {
                Relationship relationship = actor.GetRelationship(target, false);
                float liking = relationship.LTR.Liking;
                float num2 = 0f;
                List<TraitNames> randomList = new List<TraitNames>();
                TraitNames unknown = TraitNames.Unknown;
                GiveGiftTraitData data = null;
                InformationLearnedAboutSim sim = relationship.InformationAbout(target);
                foreach (Trait trait in target.TraitManager.List)
                {
                    if (sTraitToTraitDataMap.TryGetValue(trait.Guid, out data) && data.DoesTraitCareAboutObject(gift))
                    {
                        randomList.Add(trait.Guid);
                        num2 += data.Score;
                        if ((unknown == TraitNames.Unknown) && !sim.KnowsTrait(trait.Guid))
                        {
                            unknown = trait.Guid;
                        }
                    }
                }

                if (randomList.Count > 0x0)
                {
                    if (unknown == TraitNames.Unknown)
                    {
                        unknown = RandomUtil.GetRandomObjectFromList<TraitNames>(randomList);
                    }
                    else
                    {
                        sim.LearnTrait(unknown, actor.SimDescription, target.SimDescription);
                    }
                    message = sTraitToTraitDataMap[unknown].GetTNS(target);
                }

                float num3 = liking + num2;
                if (num3 >= Sim.GiveGiftTuning.kLTRToAcceptGift)
                {
                    stingName = "sting_give_gift_accept";
                    if (num3 >= Sim.GiveGiftTuning.kLTRToSuperAcceptGift)
                    {
                        message = GiveGiftLocalizeString(target.IsFemale, "UberAcceptGiftTNS", new object[0x0]);
                        stingName = "sting_give_gift_accept_super";
                    }
                    else if (liking >= Sim.GiveGiftTuning.kLTRToAcceptGift)
                    {
                        message = GiveGiftLocalizeString(target.IsFemale, "AcceptGiftTNS", new object[0x0]);
                    }
                    TransferGiftFromActorToTarget(actor, target, gift);
                }
                else
                {
                    if (liking < Sim.GiveGiftTuning.kLTRToAcceptGift)
                    {
                        message = GiveGiftLocalizeString(target.IsFemale, "RejectGiftTNS", new object[0x0]);
                    }
                    EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, actor, target, "PillowFight", false, false, false, CommodityTypes.Undefined));
                }
            }
            if (stingName != null)
            {
                actor.ShowTNSAndPlayStingIfSelectable(message, StyledNotification.NotificationStyle.kSimTalking, target.ObjectId, gift.ObjectId, stingName);
            }
            else
            {
                actor.ShowTNSIfSelectable(message, StyledNotification.NotificationStyle.kSimTalking, target.ObjectId, gift.ObjectId);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:86,代码来源:GiveGiftEx.cs

示例6: OnTrickOrTreatAccept

        public static void OnTrickOrTreatAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            IGameObject trickOrTreatItem = null;
            if (actor.OccultManager != null)
            {
                if ((actor.OccultManager.HasAnyOccultType() || actor.SimDescription.IsAlien) && RandomUtil.RandomChance(Tempest.Settings.mChanceOccultItemTrickOrTreat))
                {
                    List<OccultTypes> types = OccultTypeHelper.CreateList(actor.SimDescription);
                    OccultTypes pick = OccultTypes.None;
                    bool useAlien = true;
                    if (types.Count > 0)
                    {
                        pick = RandomUtil.GetRandomObjectFromList<OccultTypes>(types);
                        useAlien = actor.SimDescription.IsAlien && RandomUtil.CoinFlip();
                    }
                    trickOrTreatItem = FetchRandomOccultTreat(pick, useAlien);

                    if (trickOrTreatItem is FailureObject)
                    {
                        trickOrTreatItem = null;
                    }
                    else
                    {
                        if (RandomUtil.CoinFlip())
                        {
                            if (actor.OccultManager.HasOccultType(OccultTypes.PlantSim) && GameUtils.IsInstalled(ProductVersion.EP10) && Sim.MosquitoBeBitten.kChanceToKillMosquito != 100 && !target.BuffManager.HasAnyElement(new BuffNames[] { BuffNames.MosquitoBiteLow, BuffNames.MosquitoBiteMid, BuffNames.MosquitoBiteHigh }))
                            {
                                target.BuffManager.AddElement(BuffNames.MosquitoBiteLow, Origin.FromFallHoliday);
                            }
                            else if (actor.OccultManager.HasOccultType(OccultTypes.Werewolf) && GameUtils.IsInstalled(ProductVersion.EP5) && BuffGotFleasHuman.kPetToHumanSpreadFleasChance != 0 && !target.BuffManager.HasElement(BuffNames.GotFleasHuman))
                            {
                                target.BuffManager.AddElement(BuffNames.GotFleasHuman, Origin.FromFallHoliday);
                            }
                        }

                    }
                }                
            }

            if (trickOrTreatItem == null)
            {
                trickOrTreatItem = TrickOrTreatSituation.GetTrickOrTreatItem();
            }

            if (trickOrTreatItem != null)
            {
                if (!target.Inventory.TryToAdd(trickOrTreatItem))
                {
                    trickOrTreatItem.Destroy();
                }
                else if (!(trickOrTreatItem is Candy))
                {
                    target.ShowTNSIfSelectable(Localization.LocalizeString(target.IsFemale, "Gameplay/Situation/TrickorTreat:SpecialObjectTNS", new object[] { trickOrTreatItem }), StyledNotification.NotificationStyle.kSimTalking, target.ObjectId, trickOrTreatItem.ObjectId);
                    if (trickOrTreatItem is IMagicGnomeFall)
                    {
                        EventTracker.SendEvent(EventTypeId.kReceivedSeasonalGnome);
                    }
                }
            }
            EventTracker.SendEvent(EventTypeId.kWentTrickOrTreating, target);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:61,代码来源:CommonSocials.cs

示例7: JournalismRummage

        protected new void JournalismRummage(Sim rummager, IOutdoorAcceptsGarbage can)
        {
            Journalism job = OmniCareer.Career<Journalism>(rummager.Occupation);

            Common.DebugNotify("RummageEx:JournalismRummage");

            List<SimDescription> choices = new List<SimDescription>();
            foreach (SimDescription sim in Households.Humans(can.LotCurrent.Household))
            {
                if (sim.YoungAdultOrAbove && !job.SimsTrashScoped.Contains(sim))
                {
                    choices.Add(sim);
                }
            }
            if (choices.Count != 0x0)
            {
                SimDescription choice = RandomUtil.GetRandomObjectFromList(choices);

                Common.DebugNotify("JournalismRummage: " + choice.FullName);

                job.SimsTrashScoped.Add(choice);
                rummager.ShowTNSIfSelectable(Common.LocalizeEAString(rummager.IsFemale, "Gameplay/Objects/Miscellaneous/TrashcanOutside:RummageForInfo" + RandomUtil.GetInt(0x1, 0x3), new object[] { rummager, choice }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, rummager.ObjectId);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:24,代码来源:RummageEx.cs

示例8: OnStrayPetAdopted

        public static void OnStrayPetAdopted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                Household household = actor.Household;
                //if (household.CanAddSpeciesToHousehold(target.SimDescription.Species))
                {
                    if (TwoButtonDialog.Show(Localization.LocalizeString(actor.IsFemale, "Gameplay/Actors/Sim/StrayPets:AdoptionConfirmation", new object[] { actor, target }), LocalizationHelper.Yes, LocalizationHelper.No))
                    {
                        if (actor.IsSelectable)
                        {
                            string titleText = Localization.LocalizeString(target.IsFemale, "Gameplay/Actors/Sim/StrayPets:AdoptStrayNameTitle", new object[0x0]);
                            string promptText = Localization.LocalizeString(target.IsFemale, "Gameplay/Actors/Sim/StrayPets:AdoptStrayNameDescription", new object[0x0]);
                            target.SimDescription.FirstName = StringInputDialog.Show(titleText, promptText, target.SimDescription.FirstName, 256, StringInputDialog.Validation.SimNameText);
                        }

                        target.SimDescription.LastName = actor.SimDescription.LastName;
                        actor.ShowTNSAndPlayStingIfSelectable(Localization.LocalizeString("Gameplay/Actors/Sim/StrayPets:AdoptionAcceptedTNS", new object[] { target, actor.Household.Name }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, target.ObjectId, "sting_pet_adopt");
                        target.BuffManager.RemoveElement(BuffNames.StrayPet);

                        Relationships.CheckAddHumanParentFlagOnAdoption(actor.SimDescription, target.SimDescription);

                        if (actor.Partner != null)
                        {
                            Relationships.CheckAddHumanParentFlagOnAdoption(actor.Partner, target.SimDescription);
                        }

                        PetAdoption.PetAdoptionEnd(target, actor, true);
                        PetPoolManager.RemovePet(target.IsCat ? PetPoolType.StrayCat : PetPoolType.StrayDog, target.SimDescription, true);
                        household.AddSim(target);
                    }
                    else
                    {
                        actor.ShowTNSIfSelectable(Localization.LocalizeString("Gameplay/Actors/Sim/StrayPets:AdoptionDeclinedTNS", new object[] { target, actor.Household.Name }), StyledNotification.NotificationStyle.kGameMessageNegative, ObjectGuid.InvalidObjectGuid, target.ObjectId);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:42,代码来源:CommonSocials.cs

示例9: OnUnicornInviteAccept

 public static void OnUnicornInviteAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         if (target.IsUnicorn) //&& actor.Household.CanAddSpeciesToHousehold(target.SimDescription.Species))
         {
             SimDescription simDescription = target.SimDescription;
             ActiveTopic.RemoveTopicFromSim(target, "Wild Horse");
             PetPoolManager.RemovePet(PetPoolType.Unicorn, simDescription, true);
             actor.Household.Add(simDescription);
             PetAdoption.PetAdoptionEnd(target, actor, false);
             target.ShowTNSIfSelectable(Localization.LocalizeString(target.IsFemale, "Gameplay/Actors/Sim:UnicornGreeting", new object[] { actor }), StyledNotification.NotificationStyle.kSimTalking, target.ObjectId);
             Motive motive = target.Motives.GetMotive(CommodityKind.Energy);
             if (motive != null)
             {
                 motive.RestoreDecay();
             }
             target.BuffManager.RemoveElement(BuffNames.MoonlitUnicorn);
         }
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:CommonSocials.cs


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