當前位置: 首頁>>代碼示例>>C#>>正文


C# ActiveTopic類代碼示例

本文整理匯總了C#中ActiveTopic的典型用法代碼示例。如果您正苦於以下問題:C# ActiveTopic類的具體用法?C# ActiveTopic怎麽用?C# ActiveTopic使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActiveTopic類屬於命名空間,在下文中一共展示了ActiveTopic類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: OnAccept

        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                int actorAge = (int)Aging.GetCurrentAgeInDays(actor.SimDescription);
                int targetAge = (int)Aging.GetCurrentAgeInDays(target.SimDescription);

                int difference = 0;
                string suffix = "SameResult";
                if (targetAge > actorAge)
                {
                    suffix = "OlderResult";
                    difference = targetAge - actorAge;
                }
                else if (targetAge < actorAge)
                {
                    suffix = "YoungerResult";
                    difference = actorAge - targetAge;
                }

                if (SimTypes.IsSelectable(actor))
                {
                    Common.Notify(Common.Localize("AskAboutAge:" + suffix, target.IsFemale, new object[] { difference }), target.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSimTalking);
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:30,代碼來源:AskAboutAge.cs

示例3: OnAccept

        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                // Reset the attraction so it is recalculated now
                RelationshipEx.CalculateAttractionScore(Relationship.Get(target.SimDescription, actor.SimDescription, false), true);

                int score = (int)RelationshipEx.GetAttractionScore(target.SimDescription, actor.SimDescription, true);

                int index = score / 10;
                if (index >= 10)
                {
                    index = 9;
                }
                else if (index < 0)
                {
                    index = 0;
                }

                Common.Notify(Common.Localize("CheckAttraction:Result" + index, actor.IsFemale, target.IsFemale, new object[] { actor, target }), actor.ObjectId, target.ObjectId, StyledNotification.NotificationStyle.kSimTalking);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:26,代碼來源:CheckAttraction.cs

示例4: 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

示例5: 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

示例6: OnFinishMakeoverFreestyle

        public static void OnFinishMakeoverFreestyle(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                bool tookSemaphore = false;
                Styling.MakeoverOutcome makeoverOutcome = Styling.GetMakeoverOutcome(target, actor, true);
                bool forceFailureOutfit = makeoverOutcome == Styling.MakeoverOutcome.EpicFailure;
                bool flag3 = false;
                try
                {
                    if (forceFailureOutfit)
                    {
                        Styling.LoadMakeoverEpicFailureOutfitForCasOverride(target);
                    }
                    flag3 = GetMakeoverEx.DisplayCAS(target, actor, ref tookSemaphore, forceFailureOutfit);
                }
                catch (Exception)
                {
                    throw;
                }
                finally
                {
                    if (tookSemaphore)
                    {
                        GameStates.ReleaseInteractionStateChangeSemaphore();
                    }
                }

                if (CASChangeReporter.Instance.GetPropertyChanged(CASChangeReporter.ChangeFlags.Any))
                {
                    SkillLevel customerReactionType = Styling.GetCustomerReactionType(target, actor, makeoverOutcome, false);
                    SkillLevel stylerReactionType = Styling.GetStylerReactionType(customerReactionType);
                    StateMachineClient client = StateMachineClient.Acquire(actor, "StylistActiveCareer");
                    client.SetActor("x", target);
                    client.SetActor("y", actor);
                    client.SetParameter("doClothesSpin", !flag3);
                    client.SetParameter("customerReactionType", customerReactionType);
                    client.SetParameter("stylistReactionType", stylerReactionType);
                    client.EnterState("x", "Enter");
                    client.EnterState("y", "Enter");
                    actor.LoopIdle();
                    client.RequestState("x", "Customer Reaction");
                    Styling.PostMakeover(target, actor, makeoverOutcome, false, customerReactionType, true, true, new Styling.OnMakeoverCompletedCallback(SocialCallback.OnMakeoverFreestyleCompleted));
                    client.RequestState(false, "x", "Exit");
                    client.RequestState("y", "Stylist Reaction");
                    client.RequestState("y", "Exit");
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:57,代碼來源:OnFinishMakeoverFreestyle.cs

示例7: OnAccepted

 public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         Kill.OnAccepted(actor, target, SimDescription.DeathType.Burn);
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:11,代碼來源:Burn.cs

示例8: CallbackTest

 public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return Assassination.Allow(actor, target, SimDescription.DeathType.Burn, isAutonomous, false, false, ref greyedOutTooltipCallback);
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:12,代碼來源:Burn.cs

示例9: OnScoreNeutral

 public static bool OnScoreNeutral(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return true;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:12,代碼來源:SimRiskyWoohoo.cs

示例10: OnGiveGiftReject

 public static void OnGiveGiftReject(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         Sim.GiveGift inst = i as Sim.GiveGift;
         DoAcceptReject(actor, target, inst);
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, interaction, e);
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:12,代碼來源:GiveGiftEx.cs

示例11: OnScoreInsulting

 public static bool OnScoreInsulting(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return WoohooScoring.ScoreInsulting(actor, target, Common.IsAutonomous(actor), "InterestInRisky");
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:12,代碼來源:SimRiskyWoohoo.cs

示例12: TestFight

        public static bool TestFight(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!CommonTest(actor, target)) return false;

                if (TestBarBrawl(actor, target, topic, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return false;
                }
                else if ((actor.SimDescription.ChildOrBelow) || (target.SimDescription.ChildOrBelow))
                {
                    if ((actor.SimDescription.YoungAdultOrAbove) || (target.SimDescription.YoungAdultOrAbove))
                    {
                        return false;
                    }
                }

                if (target.Service is Burglar)
                {
                    BurglarSituation situation = ServiceSituation.FindServiceSituationInvolving(target) as BurglarSituation;
                    if (((situation != null) && (situation.HasBeenApprehended || situation.HasBeenDefeated)) || (target.LotCurrent != Household.ActiveHousehold.LotHome))
                    {
                        return false;
                    }
                    else if ((!actor.IsBrave && !actor.BuffManager.HasElement(BuffNames.OddlyPowerful)) && !actor.TraitManager.HasElement(TraitNames.CanApprehendBurglar))
                    {
                        return false;
                    }
                    return true;
                }

                if ((actor.Genealogy == null) || (target.Genealogy == null))
                {
                    return false;
                }

                Relationship relationship = Relationship.Get(actor, target, false);
                if ((actor.HasTrait(TraitNames.MeanSpirited) && (relationship != null)) && ((relationship.AreFriendsOrRomantic() || (actor.Household.Contains(target.SimDescription) && (relationship.LTR.Liking >= 0f))) || target.Genealogy.IsParentOrStepParent(actor.Genealogy)))
                {
                    return false;
                }

                return (((relationship == null) || (relationship.LTR.Liking < SocialComponent.kFightLikingValue)) && !target.Genealogy.IsParentOrStepParent(actor.Genealogy));
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:51,代碼來源:FixTestBarBrawl.cs

示例13: OnAccepted

 public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         if ((actor.Household == Household.ActiveHousehold) || (target.Household == Household.ActiveHousehold))
         {
             Common.Notify(Common.Localize("AskAboutFunds:Result", target.IsFemale, new object[] { target, target.FamilyFunds }), target.ObjectId);
         }
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:14,代碼來源:AskAboutFunds.cs

示例14: OnTest

        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if ((actor != Sim.ActiveActor) && (target != Sim.ActiveActor)) return false;

                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:14,代碼來源:AskAboutAge.cs

示例15: CallbackTest

        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!GameUtils.IsInstalled(ProductVersion.EP1)) return false;

                return Assassination.Allow(actor, target, SimDescription.DeathType.MummyCurse, isAutonomous, false, false, ref greyedOutTooltipCallback);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
開發者ID:Robobeurre,項目名稱:NRaas,代碼行數:14,代碼來源:Curse.cs


注:本文中的ActiveTopic類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。