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


C# Sim类代码示例

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


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

示例1: HandleCharacterCreate

        public static void HandleCharacterCreate(PacketStream P, ref LoginClient Client, 
            ref CityServerListener CServerListener)
        {
            byte PacketLength = (byte)P.ReadByte();
            //Length of the unencrypted data, excluding the header (ID, length, unencrypted length).
            byte UnencryptedLength = (byte)P.ReadByte();

            P.DecryptPacket(Client.EncKey, Client.CryptoService, UnencryptedLength);

            Logger.LogDebug("Received CharacterCreate!");

            string AccountName = P.ReadString();

            Sim Char = new Sim(P.ReadString());
            Char.Timestamp = P.ReadString();
            Char.Name = P.ReadString();
            Char.Sex = P.ReadString();
            Char.CreatedThisSession = true;

            Client.CurrentlyActiveSim = Char;

            switch (Character.CreateCharacter(Char))
            {
                case CharacterCreationStatus.NameAlreadyExisted:
                    //TODO: Send packet.
                    break;
                case CharacterCreationStatus.ExceededCharacterLimit:
                    //TODO: Send packet.
                    break;
            }
        }
开发者ID:nicefunfungirl,项目名称:Project-Dollhouse,代码行数:31,代码来源:PacketHandlers.cs

示例2: GetMotives

        public static CommodityKind[] GetMotives(Sim sim)
        {
            if (sim != null)
            {
                if (sim.IsPet)
                {
                    if (sim.IsADogSpecies)
                    {
                        return kDogMotives;
                    }

                    if (sim.IsCat)
                    {
                        return kCatMotives;
                    }

                    if (sim.IsHorse)
                    {
                        return kHorseMotives;
                    }
                }

                if (sim.SimDescription.YoungAdultOrAbove && sim.SimDescription.IsVampire)
                {
                    return kVampireMotives;
                }

                if (sim.SimDescription.IsAlienEvolved)
                {
                    return kAlienMotives;
                }
            }
            return kMotives;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:34,代码来源:HudModelEx.cs

示例3: CallbackTest

        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (target.Household == null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("No Household");
                    return false;
                }

                if (target.Household == actor.Household)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Same Household");
                    return false;
                }

                if (target.Household.IsSpecialHousehold)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Special Household");
                    return false;
                }

                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:30,代码来源:AskAboutFunds.cs

示例4: GetMana

        public override float GetMana(Sim sim)
        {
            OccultUnicorn unicorn = sim.OccultManager.GetOccultType(OccultTypes.Unicorn) as OccultUnicorn;
            if (unicorn == null) return 0;

            return unicorn.MagicPoints.mCurrentMagicPointValue;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:UnicornControl.cs

示例5: Test

            public override bool Test(Sim a, WeddingArch target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    SimDescription partner = a.Partner;
                    if (partner == null)
                    {
                        return false;
                    }
                    Sim createdSim = partner.CreatedSim;
                    if ((createdSim == null) || !a.IsEngaged)
                    {
                        return false;
                    }
                    if (createdSim.LotCurrent != target.LotCurrent)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WeddingArch.LocalizeString(a.IsFemale, "FianceNotOnLot", new object[] { createdSim }));
                        return false;
                    }

                    string reason;
                    if (!CommonSocials.CanGetRomantic(a, createdSim, false, false, true, ref greyedOutTooltipCallback, out reason))
                    {
                        return false;
                    }

                    return CommonSocials.CanGetMarriedNow(a, createdSim, isAutonomous, false, ref greyedOutTooltipCallback);
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return false;
                }
            }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:34,代码来源:GetMarriedEx.cs

示例6: ShowSimSelector

        /// <summary>
        /// 
        /// </summary>
        /// <param name="interactionName"></param>
        /// <returns></returns>
        public static List<IMiniSimDescription> ShowSimSelector(Sim actor, Household currentHousehold, string interactionName)
        {
            List<IMiniSimDescription> residents = new List<IMiniSimDescription>();
            string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]);

            List<PhoneSimPicker.SimPickerInfo> list = new List<PhoneSimPicker.SimPickerInfo>();

            List<object> list2;

            //Create list of sims
            foreach (Sim s in currentHousehold.Sims)
            {
                list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, s.SimDescription));
            }

            list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, currentHousehold.Sims.Count, false);

            if (list2 == null || list2.Count == 0)
            {
                return null;
            }
            foreach (var item in list2)
            {
                residents.Add(item as SimDescription);
            }

            return residents;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:33,代码来源:CommonMethods.cs

示例7: ReactToSkinnyDippers

        public static void ReactToSkinnyDippers(Sim sim, GameObject objectSkinnyDippedIn, InteractionDefinition skinnyDipInteraction, List<ulong> skinnyDipperList)
        {
            if (!sim.SimDescription.TeenOrBelow && ((skinnyDipperList != null) && (skinnyDipperList.Count != 0x0)))
            {
                List<ulong> skinnyDippers = new List<ulong>(skinnyDipperList);
                skinnyDippers.Remove(sim.SimDescription.SimDescriptionId);
                if (skinnyDippers.Count != 0x0)
                {
                    bool flag = Pool.ShouldReactPositiveToSkinnyDipper(sim, skinnyDippers);
                    bool flag2 = false;
                    if (flag && !sim.HasTrait(TraitNames.Hydrophobic))
                    {
                        flag2 = RandomUtil.RandomChance(Pool.kChancePositiveReactionSimsJoin);
                    }

                    SimDescription simDesc = SimDescription.Find(RandomUtil.GetRandomObjectFromList(skinnyDippers));
                    if (simDesc != null)
                    {
                        Sim createdSim = simDesc.CreatedSim;

                        Pool.ReactToSkinnyDipper instance = Pool.ReactToSkinnyDipper.Singleton.CreateInstance(createdSim, sim, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as Pool.ReactToSkinnyDipper;
                        instance.IsPositive = flag;
                        instance.ShouldJoin = flag2;
                        instance.DippingObject = objectSkinnyDippedIn;
                        instance.SkinnyDipInteraction = skinnyDipInteraction;
                        sim.InteractionQueue.AddNextIfPossible(instance);
                    }
                }
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:30,代码来源:PoolEx.cs

示例8: ApplyPostShowerEffects

        public static void ApplyPostShowerEffects(Sim actor, IShowerable shower)
        {
            BuffManager buffManager = actor.BuffManager;
            buffManager.RemoveElement(BuffNames.Singed);
            buffManager.RemoveElement(BuffNames.SingedElectricity);
            buffManager.RemoveElement(BuffNames.GarlicBreath);
            SimDescription simDescription = actor.SimDescription;
            simDescription.RemoveFacePaint();
            if (simDescription.IsMummy)
            {
                buffManager.AddElement(BuffNames.Soaked, Origin.FromShower);
            }

            if (RandomUtil.RandomChance((float)shower.TuningShower.ChanceOfExhileratingShowerBuff))
            {
                buffManager.AddElement(BuffNames.ExhilaratingShower, Origin.FromNiceShower);
            }

            if (actor.HasTrait(TraitNames.Hydrophobic))
            {
                actor.PlayReaction(ReactionTypes.Cry, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            else if (shower.ShouldGetColdShower)
            {
                actor.BuffManager.AddElement(BuffNames.ColdShower, Origin.FromCheapShower);
                EventTracker.SendEvent(EventTypeId.kGotColdShowerBuff, actor, shower);
            }
            // Custom
            else if ((shower.Cleanable != null) && (shower.Cleanable.NeedsToBeCleaned))
            {
                actor.PlayReaction(ReactionTypes.Retch, shower as GameObject, ReactionSpeed.AfterInteraction);
            }
            actor.Motives.SetMax(CommodityKind.Hygiene);
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:34,代码来源:ShowerEx.cs

示例9: PayForWorkOut

 public static void PayForWorkOut(Sim sim, Lot lot, int fee)
 {
     if (lot.IsCommunityLot)
     {
         //Pay if we don't own the lot
         Household lotOwner = ReturnLotOwner(lot);
         
         //If we don't own the lot
         if (lotOwner != null && lotOwner != sim.Household)
         {
             lotOwner.ModifyFamilyFunds(fee);
                               
             //pay if we have the money, if not add to next bill
             if (sim.FamilyFunds >= fee)
             {
                 sim.Household.ModifyFamilyFunds(-fee);
             }
             else
             {
                 sim.Household.UnpaidBills += fee;
             }                  
         }
         else
         {
             //if the lot has no owner, or we don't own the lot
             if (lotOwner == null || (lotOwner != null && lotOwner != sim.Household))
             {
                 sim.Household.ModifyFamilyFunds(-fee);
             }
         }
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:32,代码来源:CommonMethods.cs

示例10: Test

            public override bool Test(Sim a, VoucherCloneMe target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                target.TargetScienceLab = Voucher.FindNearestScienceLab(a);
                if (target.TargetScienceLab == null)
                {
                    return false;
                }

                /*
                if (!Household.ActiveHousehold.CanAddSpeciesToHousehold(a.SimDescription.Species))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/ScienceLab:HouseholdTooLarge", new object[0x0]));
                    return false;
                }

                if (a.OccultManager.HasAnyOccultType())
                {
                    return false;
                }

                if (a.SimDescription.IsGhost)
                {
                    return false;
                }
                */

                if (GameUtils.IsOnVacation())
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Ui/Tooltip/Vacation/GreyedoutTooltip:InteractionNotValidOnVacation", new object[0x0]));
                    return false;
                }

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

示例11: TryDeductFunds

 private bool TryDeductFunds(TattooChair ths, Sim giver, Sim receiver)
 {
     if (giver == receiver)
     {
         if (giver.FamilyFunds >= Tattooing.kCostTattooSelf)
         {
             receiver.ModifyFunds(-Tattooing.kCostTattooSelf);
             return true;
         }
         return false;
     }
     if (giver == ths.GetTattooArtist())
     {
         if (!CelebrityManager.TryModifyFundsWithCelebrityDiscount(receiver, giver, Tattooing.kCostTattooFromTattooArtist, true))
         {
             return false;
         }
         return true;
     }
     if (!CelebrityManager.TryModifyFundsWithCelebrityDiscount(receiver, giver, Tattooing.kCostTattooFromSim, true))
     {
         return false;
     }
     return true;
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:GiveTattooEx.cs

示例12: AddInteractions

            public override void AddInteractions(InteractionObjectPair iop, Sim actor, Sim target, List<InteractionObjectPair> results)
            {
                bool ungreeted = false;

                if (Skills.Assassination.StaticGuid != SkillNames.None)
                {
                    Relationship relationship = Relationship.Get(target, actor, false);
                    if ((relationship == null) || (relationship.LTR.CurrentLTR == LongTermRelationshipTypes.Stranger))
                    {
                        ungreeted = true;
                    }
                    else if (target.NeedsToBeGreeted(actor))
                    {
                        ungreeted = true;
                    }
                }

                if (ungreeted)
                {
                    foreach (SimDescription.DeathType type in Assassination.Types.Keys)
                    {
                        if (ActionData.Get("NRaas Assassin " + type) != null)
                        {
                            results.Add(new InteractionObjectPair(new Definition("NRaas Assassin " + type), target));
                        }
                    }
                }
            }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:28,代码来源:GreetKill.cs

示例13: OnAccept

        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                actor.Motives.SetDecay(CommodityKind.Fun, true);
                target.Motives.SetDecay(CommodityKind.Fun, true);
                actor.Motives.ChangeValue(CommodityKind.Fun, Jetpack.kFunGainJetPackWoohoo);
                target.Motives.ChangeValue(CommodityKind.Fun, Jetpack.kFunGainJetPackWoohoo);

                if (CommonPregnancy.IsSuccess(actor, target, i.Autonomous, CommonWoohoo.WoohooStyle.TryForBaby))
                {
                    CommonPregnancy.Impregnate(actor, target, i.Autonomous, CommonWoohoo.WoohooStyle.TryForBaby);
                }

                CommonWoohoo.RunPostWoohoo(actor, target, actor.GetActiveJetpack(), CommonWoohoo.WoohooStyle.TryForBaby, CommonWoohoo.WoohooLocation.Jetpack, true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:JetpackTryForBaby.cs

示例14: Test

            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    HotairBalloon.InBalloonPosture posture = actor.Posture as HotairBalloon.InBalloonPosture;
                    if (posture == null)
                    {
                        return false;
                    }

                    if (posture.Balloon.GetOtherSim(actor) == null)
                    {
                        return false;
                    }

                    // Custom
                    return HotAirBalloonProposal.ProposalTest(posture.Balloon, actor, target, isAutonomous, ref greyedOutTooltipCallback);
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(actor, target, e);
                    return false;
                }
            }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:28,代码来源:HotAirBalloonProposalSocial.cs

示例15: BeforeDiagnose

        public static void BeforeDiagnose(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                FreeClinicSessionSituation freeClinicSessionSituation = FreeClinicSessionSituation.GetFreeClinicSessionSituation(actor);
                if (freeClinicSessionSituation != null)
                {
                    freeClinicSessionSituation.NumVaccinations++;
                    freeClinicSessionSituation.AddToIgnoreList(target);
                    freeClinicSessionSituation.BringRandomSimsToSession(0x1);

                    /*
                    HealthManager healthManager = target.SimDescription.HealthManager;
                    if (healthManager != null)
                    {
                        healthManager.Vaccinate();
                    }
                    */
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:Vaccinate.cs


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