コード例 #1
0
ファイル: CollegeGraduationEx.cs プロジェクト: yakoder/NRaas
 public static void GraduateSim(SimDescription simDesc, AcademicDegree degree)
 {
     if ((simDesc != null) && (degree != null))
     {
         IHandleUniversityGraduation graduationRabbitHole = CollegeGraduation.GetGraduationRabbitHole() as IHandleUniversityGraduation;
         if (graduationRabbitHole != null)
         {
             Annex annex = graduationRabbitHole as Annex;
             if (annex != null)
             {
                 AnnexEx.AddSimToGraduationList(annex, simDesc, degree);
             }
             else
             {
                 graduationRabbitHole.AddSimToGraduationList(simDesc, degree);
             }
         }
         else if (simDesc.CreatedSim != null)
         {
             CollegeGraduation.GraduateInPlace entry = CollegeGraduation.GraduateInPlace.Singleton.CreateInstance(simDesc.CreatedSim, simDesc.CreatedSim, new InteractionPriority(InteractionPriorityLevel.High), false, false) as CollegeGraduation.GraduateInPlace;
             simDesc.CreatedSim.InteractionQueue.AddNext(entry);
             ActiveTopic.RemoveTopicFromSim(simDesc.CreatedSim, "University Graduation");
         }
     }
 }
コード例 #2
0
ファイル: FixActiveTopics.cs プロジェクト: yakoder/NRaas
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("FixActiveTopics");

            Dictionary <ulong, SimDescription> sims = SimListing.GetResidents(false);

            foreach (SimDescription sim in sims.Values)
            {
                if (sim.CreatedSim == null)
                {
                    continue;
                }
                if (sim.SkillManager == null)
                {
                    continue;
                }

                foreach (Skill skill in sim.SkillManager.List)
                {
                    if (skill.SkillLevel < 1)
                    {
                        continue;
                    }
                    switch (skill.Guid)
                    {
                    // Not sure why these don't work on their own, it may be the active
                    // topic limit. Either way readding them should troop the limit and fix
                    // them if they are truly broken
                    case SkillNames.Bartending:
                        ActiveTopic.AddToSim(sim.CreatedSim, "Bartending Skill");
                        Overwatch.Log("Readded Active Topic - Bartending Skill: " + sim.FullName);
                        break;

                    case SkillNames.Charisma:
                        ActiveTopic.AddToSim(sim.CreatedSim, "Smooth Recovery");
                        Overwatch.Log("Readded Active Topic - Charisma Skill: " + sim.FullName);
                        break;

                    case SkillNames.Logic:
                        if (skill.SkillLevel >= LogicSkill.kSkillLevelForSchoolTutor)
                        {
                            ActiveTopic.AddToSim(sim.CreatedSim, "Logic Skill");
                            Overwatch.Log("Readded Active Topic - Logic Skill: " + sim.FullName);
                        }
                        break;

                    case SkillNames.MartialArts:
                        ActiveTopic.AddToSim(sim.CreatedSim, "Martial Arts Skill");
                        Overwatch.Log("Readded Active Topic - Martial Arts Skill: " + sim.FullName);
                        break;

                    // hopelessly broken regardless
                    case SkillNames.Science:
                        ActiveTopic.AddToSim(sim.CreatedSim, "Science Skill");
                        Overwatch.Log("Readded Active Topic - Science Skill: " + sim.FullName);
                        break;
                    }
                }
            }
        }
コード例 #3
0
        public static void OnTermCompleted(AcademicCareer ths, float gradeAsPercentage)
        {
            if (ths.OwnerDescription == null)
            {
                throw new NullReferenceException("OwnerDescription");
            }
            else if (ths.OwnerDescription.CareerManager == null)
            {
                throw new NullReferenceException("CareerManager");
            }
            else if (ths.OwnerDescription.CareerManager.DegreeManager == null)
            {
                throw new NullReferenceException("DegreeManager");
            }
            else if (ths.DegreeInformation == null)
            {
                throw new NullReferenceException("DegreeInformation");
            }

            if (ths.OwnerDescription.CareerManager.DegreeManager.CommitAcademicProgressToDegree(ths.OwnerDescription, ths.DegreeInformation.AcademicDegreeName, (int)ths.mNumberOfCoursesPerDay, gradeAsPercentage, (uint)AcademicCareer.sTermLengthEx))
            {
                CollegeGraduationEx.GraduateSim(ths.OwnerDescription, ths.mDegree);
            }

            ActiveTopic.RemoveTopicFromSim(ths.OwnerSim, "During University");
            ths.LeaveJob(false, Career.LeaveJobReason.kNone);
        }
コード例 #4
0
ファイル: ShowAlienPregnancy.cs プロジェクト: Duglarogg/Sims3
        public override bool Run()
        {
            if (Actor.IsSelectable)
            {
                PlumbBob.SelectActor(Actor);
                Camera.FocusOnSim(Actor, Pregnancy.kShowPregnancyCameraLerp.Zoom, Pregnancy.kShowPregnancyCameraLerp.Pitch,
                                  Pregnancy.kShowPregnancyCameraLerp.Time, true, false);
                Audio.StartSound("sting_alien_visit");
            }

            Actor.SimDescription.ShowPregnancy();
            Actor.BuffManager.AddElement(AlienUtilsEx.sXenogenesis, Origin.FromPregnancy);
            ActiveTopic.AddToSim(Actor, "Announce Pregnancy");

            /* TODO------------------------------------------------ */
            /* Set alarm to give leave at start of third trimester! */
            /* ---------------------------------------------------- */

            Tutorialette.TriggerLesson(Lessons.Pregnancy, Actor);
            Actor.PlaySoloAnimation("a_alien_pregnancy_inspectStomach");

            /* TODO------------------------------ */
            /* Will not remove jobs at this time! */
            /* ---------------------------------- */

            return(true);
        }
コード例 #5
0
ファイル: AskAboutFunds.cs プロジェクト: Robobeurre/NRaas
        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;
            }
        }
コード例 #6
0
ファイル: SimWoohoo.cs プロジェクト: yakoder/NRaas
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                ScoringLookup.IncStat("OnAccept Woohoo");

                if (Common.kDebugging)
                {
                    Woohooer.DebugNotify("Woohoo" + Common.NewLine + actor.FullName + Common.NewLine + target.FullName, actor, target);
                }

                WooHooSocialInteraction woohooSocial = i as WooHooSocialInteraction;
                if (woohooSocial != null)
                {
                    woohooSocial.PushWooHoo(actor, target);
                }
                else
                {
                    new CommonWoohoo.PushWoohoo(actor, target, i.Autonomous, CommonWoohoo.WoohooStyle.Safe);
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #7
0
        public override Task OnTurn(ITurnContext turnContext)
        {
            if (turnContext.Activity.Type == ActivityTypes.Message)
            {
                // Check to see if there is an active topic.
                if (HasActiveTopic)
                {
                    // Let the active topic handle this turn by passing context to it's OnReceiveActivity().
                    return(ActiveTopic
                           .OnTurn(turnContext));
                }

                // If you don't have the state you need, prompt for it
                if (State.Name == null)
                {
                    return(SetActiveTopic("namePrompt")
                           .OnTurn(turnContext));
                }

                if (State.Age == null)
                {
                    return(SetActiveTopic("agePrompt")
                           .OnTurn(turnContext));
                }

                // Now that you have the state you need (age and name), use it!
                return(turnContext.SendActivity($"Hello { State.Name }! You are { State.Age } years old."));
            }

            return(Task.CompletedTask);
        }
コード例 #8
0
ファイル: ChitChatTopic.cs プロジェクト: NT-D/TravelBotv4
        public async override Task OnReceiveActivity(IBotContext context)
        {
            if (HasActiveTopic)
            {
                await ActiveTopic.OnReceiveActivity(context);

                //return Task.CompletedTask;
            }

            var options = new QnAMakerOptions()
            {
                KnowledgeBaseId = "",
                SubscriptionKey = "",
                ScoreThreshold  = 0.7f
            };

            qnAMaker = new QnAMaker(options);
            var results = await qnAMaker.GetAnswers(context.Request.Text);

            this.State.answer = results.First().Answer;
            //context.Set(ChitChatKey, results.First().Answer);

            await this.SetActiveTopic(ANSWER_PROMPT)
            .OnReceiveActivity(context);

            this.OnSuccess(context, this.State.answer);

            //return Task.CompletedTask;
        }
コード例 #9
0
            public void HourlyCallback()
            {
                if (GameUtils.IsOnVacation() || GameUtils.IsUniversityWorld())
                {
                    return;
                }

                Pregnancy.mHourOfPregnancy++;

                if (Pregnancy.mHourOfPregnancy >= Abductor.Settings.mHourToStartPregnantWalk)
                {
                    ActiveTopic.AddToSim(Abductee, "Pregnant", Abductee.SimDescription);

                    if (!Pregnancy.mHasRequestedWalkStyle)
                    {
                        Pregnancy.mHasRequestedWalkStyle = Abductee.RequestWalkStyle(Sim.WalkStyle.Pregnant);
                    }
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHourToStartLabor)
                {
                    for (int i = 0; i < Pregnancy.kNumberOfPuddlesForWaterBreak; i++)
                    {
                        PuddleManager.AddPuddle(Abductee.PositionOnFloor);
                    }

                    if (Abductee.IsSelectable)
                    {
                        StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/ActorSystems/Pregnancy:BabyIsComingTNS",
                                                                                                          new object[] { Abductee }), StyledNotification.NotificationStyle.kGameMessageNegative));
                    }

                    //Abductee.BuffManager.RemoveElement(AbductionBuffs.sXenogenesis);
                    Abductee.BuffManager.AddElement(BuffsAndTraits.sBabyIsComing, Origin.FromPregnancy);

                    if (Pregnancy.mContractionBroadcast != null)
                    {
                        Pregnancy.mContractionBroadcast.Dispose();
                    }

                    Pregnancy.mContractionBroadcast = new ReactionBroadcaster(Abductee, Pregnancy.kContractionBroadcasterParams,
                                                                              new ReactionBroadcaster.BroadcastCallback(StartReaction), new ReactionBroadcaster.BroadcastCallback(CancelReaction));

                    Abductee.AddInteraction(TakeToHospitalEx.Singleton);
                    InteractionInstance interaction = Pregnancy.HaveContraction.Singleton.CreateInstance(Abductee, Abductee,
                                                                                                         new InteractionPriority(InteractionPriorityLevel.High, 10f), false, false);
                    interaction.Hidden = true;
                    Abductee.InteractionQueue.Add(interaction);
                    Pregnancy.mContractionsAlarm = Abductee.AddAlarmRepeating(5f, TimeUnit.Minutes, new AlarmTimerCallback(Pregnancy.TriggerContraction),
                                                                              5f, TimeUnit.Minutes, "Alien Pregnancy Trigger Contractions Alarm", AlarmType.AlwaysPersisted);
                    EventTracker.SendEvent(EventTypeId.kPregnancyContractionsStarted, Abductee);
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHoursOfPregnancy)
                {
                    HaveTheBaby();
                }

                SetPregnancyMorph();
            }
コード例 #10
0
        public static bool TestBarBrawl(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!CommonTest(actor, target))
                {
                    return(false);
                }

                if ((actor.SimDescription.TeenOrBelow != target.SimDescription.TeenOrBelow) || target.Genealogy.IsParentOrStepParent(actor.Genealogy))
                {
                    return(false);
                }

                if (!Bartending.IsVenueNightlifeVenue(target.LotCurrent.GetMetaAutonomyType))
                {
                    return(false);
                }

                if (isAutonomous)
                {
                    return(Bartending.IsVenueDiveBar(target.LotCurrent.GetMetaAutonomyType));
                }
                return(true);
            }
            catch (Exception e)
            {
                Common.Exception("TestBarBrawl", e);
                return(false);
            }
        }
コード例 #11
0
ファイル: TrainSim.cs プロジェクト: yakoder/NRaas
 public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         AthleticGameObject[] objects = actor.LotCurrent.GetObjects <AthleticGameObject>();
         float maxValue          = float.MaxValue;
         AthleticGameObject obj2 = null;
         foreach (AthleticGameObject obj3 in objects)
         {
             if (!obj3.InUse && obj3.CanObjectTrainSim())
             {
                 float distanceToObject = obj3.GetDistanceToObject(actor);
                 if (distanceToObject < maxValue)
                 {
                     maxValue = distanceToObject;
                     obj2     = obj3;
                 }
             }
         }
         if (obj2 != null)
         {
             QueueUpTrainSim.Definition definition = new QueueUpTrainSim.Definition(target);
             actor.InteractionQueue.AddNext(definition.CreateInstance(obj2, actor, actor.InheritedPriority(), false, true));
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
コード例 #12
0
        public static bool GiveGiftProceduralTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            OccultImaginaryFriend friend;

            if (actor.GetRelationship(target, false) == null)
            {
                return(false);
            }
            if (SocialComponent.IsInServicePreventingSocialization(target))
            {
                return(false);
            }
            if (!SocialComponent.WouldShowMultiLevelSocialPieMenu(actor, target))
            {
                return(false);
            }
            if (OccultImaginaryFriend.TryGetOccultFromSim(target, out friend) && !friend.IsReal)
            {
                return(false);
            }

            /*
             * if (!Sim.GiveGift.Definition.DoesGiftForTargetSimExist(actor, target))
             * {
             *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Sim.GiveGift.GiveGiftLocalizeString(actor.IsFemale, "NoGiftsToGive", new object[0]));
             *  return false;
             * }
             */
            return(true);
        }
コード例 #13
0
ファイル: Shakedown.cs プロジェクト: yakoder/NRaas
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (NRaas.Careers.Settings.mMaxShakedown <= 0)
                {
                    return(false);
                }

                if (actor.Occupation is Criminal)
                {
                    return(true);
                }

                if (actor.Occupation is LawEnforcement)
                {
                    return(true);
                }

                OmniCareer actorCareer = actor.Occupation as OmniCareer;
                if (actorCareer != null)
                {
                    return(actorCareer.CanShakedown());
                }

                return(false);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #14
0
ファイル: CheckAttraction.cs プロジェクト: yakoder/NRaas
        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);
            }
        }
コード例 #15
0
ファイル: AddBandMember.cs プロジェクト: yakoder/NRaas
        protected void PrivateAddBandMember(RockBand ths, SimDescription otherSimDesc)
        {
            if (ths.mBandInfo == null)
            {
                ths.mBandInfo = new RockBandInfo();
                ths.mBandInfo.AddBandMember(ths.SkillOwner.SimDescriptionId);
                Sim createdSim = ths.SkillOwner.CreatedSim;
                if (createdSim != null)
                {
                    ActiveTopic.AddToSim(createdSim, "Rock Band");
                }
            }

            //if (ths.mBandInfo.NumBandMembers < 0x4)
            {
                ths.mBandInfo.AddBandMember(otherSimDesc.SimDescriptionId);
                Sim sim = otherSimDesc.CreatedSim;
                if (sim != null)
                {
                    ActiveTopic.AddToSim(sim, "Rock Band");
                }

                SkillManager skillManager = otherSimDesc.SkillManager;
                RockBand     skill        = skillManager.GetSkill <RockBand>(SkillNames.RockBand);
                if (skill == null)
                {
                    skillManager.AddAutomaticSkill(SkillNames.RockBand);
                    skill = skillManager.GetSkill <RockBand>(SkillNames.RockBand);
                }

                skill.mBandInfo = ths.mBandInfo;
                skill.BandNameUpdate(ths.mBandInfo.BandName);
            }
        }
コード例 #16
0
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                Career actorCareer  = actor.Occupation as Career;
                Career targetCareer = target.Occupation as Career;

                if (actorCareer == null)
                {
                    return(false);
                }

                if ((targetCareer != null) && (actorCareer.Guid == targetCareer.Guid))
                {
                    if (actorCareer.CurLevelBranchName == targetCareer.CurLevelBranchName)
                    {
                        return(false);
                    }
                }

                if (!actorCareer.CareerAgeTest(target.SimDescription))
                {
                    return(false);
                }

                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #17
0
ファイル: CommonSocials.cs プロジェクト: yakoder/NRaas
        public static bool TestMagicWandEquipped(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                MagicControl controlActor = MagicControl.GetBestControl(actor, SpellcastingDuelEx.Singleton as IMagicalDefinition);
                if (controlActor == null)
                {
                    return(false);
                }

                MagicControl controlTarget = MagicControl.GetBestControl(target, SpellcastingDuelEx.Singleton as IMagicalDefinition);
                if (controlTarget == null)
                {
                    return(false);
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #18
0
        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);
            }
        }
コード例 #19
0
ファイル: SparChallenge.cs プロジェクト: yakoder/NRaas
        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (GameUtils.GetCurrentWorld() == WorldName.China)
                {
                    return(false);
                }

                MartialArts skill = actor.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts);
                MartialArts arts2 = target.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts);
                if (((skill != null) && skill.CanParticipateInTournaments) && ((arts2 != null) && arts2.CanParticipateInTournaments))
                {
                    SimDescription tournamentChallenger = skill.TournamentChallenger;
                    if ((tournamentChallenger != null) && (tournamentChallenger == target.SimDescription))
                    {
                        if (MartialArts.IsSimsMotiveSparWorthy(actor))
                        {
                            return(true);
                        }
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Objects/HobbiesSkills/BoardBreaker:CannotBeFatigued", new object[] { actor }));
                    }
                }

                greyedOutTooltipCallback = Common.DebugTooltip("CanParticipateInTournaments fail");
                return(false);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #20
0
        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);
            }
        }
コード例 #21
0
        public override Task OnReceiveActivity(IBotContext context)
        {
            if (HasActiveTopic)
            {
                ActiveTopic.OnReceiveActivity(context);
                return(Task.CompletedTask);
            }

            if (this.State.Alarm.Title == null)
            {
                this.SetActiveTopic(TITLE_PROMPT)
                .OnReceiveActivity(context);
                return(Task.CompletedTask);
            }

            if (this.State.Alarm.Time == null)
            {
                this.SetActiveTopic(TIME_PROMPT)
                .OnReceiveActivity(context);
                return(Task.CompletedTask);
            }

            this.OnSuccess(context, this.State.Alarm);

            return(Task.CompletedTask);
        }
コード例 #22
0
ファイル: TrainSim.cs プロジェクト: yakoder/NRaas
        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!SocialTest.TestTrainSim(actor, target, topic, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return(false);
                }

                if (SkillBasedCareerBooter.GetSkillBasedCareer(actor, SkillNames.Athletic) == null)
                {
                    if (actor.SkillManager.GetSkillLevel(SkillNames.Athletic) < AthleticGameObject.TrainSim.kAthleticSkillLevelGate)
                    {
                        return(false);
                    }
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #23
0
        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);
            }
        }
コード例 #24
0
ファイル: GaugeAttraction.cs プロジェクト: yakoder/NRaas
        public static bool OnFriendlyTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (Woohooer.Settings.mInteractionsUnderRomance)
                {
                    return(false);
                }

                if ((actor != Sim.ActiveActor) && (target != Sim.ActiveActor))
                {
                    return(false);
                }

                string reason;
                if (!CommonSocials.CanGetRomantic(actor, target, isAutonomous, false, true, ref greyedOutTooltipCallback, out reason))
                {
                    return(false);
                }

                return(false);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #25
0
ファイル: AskAboutAge.cs プロジェクト: Robobeurre/NRaas
        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);
            }
        }
コード例 #26
0
        protected override DereferenceResult Perform(SimActiveTopics reference, FieldInfo field, List <ReferenceWrapper> objects)
        {
            if (Matches(reference, "mForgettableTopics", field, objects))
            {
                ActiveTopic topic = FindLast <ActiveTopic>(objects);
                if (topic != null)
                {
                    if (Performing)
                    {
                        reference.mForgettableTopics.Remove(topic);
                    }
                    return(DereferenceResult.End);
                }
            }

            if (Matches(reference, "mUnforgettableTopics", field, objects))
            {
                Remove(reference.mUnforgettableTopics, objects);
                return(DereferenceResult.End);
            }

            if (Matches(reference, "mActor", field, objects))
            {
                Remove(ref reference.mActor);
                return(DereferenceResult.Continue);
            }

            if (Matches(reference, "mTraits", field, objects))
            {
                Remove(reference.mTraits, objects);
                return(DereferenceResult.End);
            }

            return(DereferenceResult.Failure);
        }
コード例 #27
0
        public static bool OnScoreAwkward(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                bool witnessed = false;

                foreach (Sim sim in target.LotCurrent.GetSims())
                {
                    if (sim == actor)
                    {
                        continue;
                    }

                    if (sim == target)
                    {
                        continue;
                    }

                    if (sim.RoomId == actor.RoomId)
                    {
                        witnessed = true;
                        break;
                    }
                }

                return(witnessed);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #28
0
ファイル: GenderPreference.cs プロジェクト: yakoder/NRaas
        public static bool OnRomanceTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!Woohooer.Settings.mInteractionsUnderRomance)
                {
                    return(false);
                }

                if ((actor != Sim.ActiveActor) && (target != Sim.ActiveActor))
                {
                    return(false);
                }

                if (!CommonSocials.OnDefaultTest(actor, target, topic, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return(false);
                }

                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
コード例 #29
0
ファイル: JetpackTryForBaby.cs プロジェクト: Robobeurre/NRaas
        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);
            }
        }
コード例 #30
0
        public override bool Run()
        {
            Actor.SimDescription.Pregnancy.mHasShownPregnancy = true;

            if (Actor.IsSelectable)
            {
                PlumbBob.SelectActor(Actor);
                Camera.FocusOnSim(Actor, Pregnancy.kShowPregnancyCameraLerp.Zoom, Pregnancy.kShowPregnancyCameraLerp.Pitch,
                                  Pregnancy.kShowPregnancyCameraLerp.Time, true, false);
                Audio.StartSound("sting_alien_visit");
                //Audio.StartObjectSound(Actor.ObjectId, "sting_alien_visit", false);
            }

            Actor.SimDescription.ShowPregnancy();
            Actor.BuffManager.AddElement(BuffsAndTraits.sXenogenesis, Origin.FromPregnancy);

            if (Actor.BuffManager.HasElement(BuffNames.Nauseous))
            {
                Actor.BuffManager.GetElement(BuffNames.Nauseous).mBuffOrigin = Origin.FromPregnancy;
            }

            ActiveTopic.AddToSim(Actor, "Announce Pregnancy");
            Actor.SimDescription.Pregnancy.TryToGiveLeave();
            Tutorialette.TriggerLesson(Lessons.Pregnancy, Actor);
            Actor.PlaySoloAnimation("a_alien_pregnancy_inspectStomach", true);

            if (Actor.Occupation != null)
            {
                Actor.Occupation.RemoveAllJobs();
            }

            return(true);
        }
コード例 #31
0
ファイル: Vaccinate.cs プロジェクト: Robobeurre/NRaas
        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);
            }
        }
コード例 #32
0
        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);
            }
        }
コード例 #33
0
ファイル: CheckAttraction.cs プロジェクト: Robobeurre/NRaas
        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);
            }
        }
コード例 #34
0
        public override void HourlyCallback()
        {
            if (GameUtils.IsOnVacation() || GameUtils.IsUniversityWorld())
            {
                Common.DebugNotify(mMom.FullName + Common.NewLine + "RobotPregnancy.HourlyCallback" + Common.NewLine + " - Pregnancy Paused");
                return;
            }

            mHourOfPregnancy++;

            string msg = mMom.FullName + Common.NewLine + "RobotPregnancy.HourlyCallback" + Common.NewLine + " - Hour: " + mHourOfPregnancy + Common.NewLine;

            if (mMom.Household.IsTouristHousehold)
            {
                msg += " - Foreign Sim" + Common.NewLine;

                ForeignVisitorsSituation foreignVisitorsSituation = ForeignVisitorsSituation.TryGetForeignVisitorsSituation(mMom);

                if (mHourOfPregnancy == Woohooer.Settings.mForeignRobotDisplayTNS && foreignVisitorsSituation != null)
                {
                    StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/ActorSystems/Pregnancy:ForeignBabyIsComingTNS",
                                                                                                      new object[] { mMom }), StyledNotification.NotificationStyle.kGameMessagePositive), "glb_tns_baby_coming_r2");
                }

                if (mHourOfPregnancy == Woohooer.Settings.mForeignRobotLeavesWorld)
                {
                    if (foreignVisitorsSituation != null)
                    {
                        foreignVisitorsSituation.MakeGuestGoHome(mMom);
                    }
                    else if (mMom.SimDescription.AssignedRole != null)
                    {
                        mMom.SimDescription.AssignedRole.RemoveSimFromRole();
                    }
                }

                if (mHourOfPregnancy > Woohooer.Settings.mForeignRobotLeavesWorld)
                {
                    Common.DebugNotify(msg);

                    mHourOfPregnancy--;
                    return;
                }
            }

            if (mHourOfPregnancy >= Woohooer.Settings.mRobotHourToStartWalkingPregnant)
            {
                ActiveTopic.AddToSim(mMom, "Pregnant", mMom.SimDescription);
                RequestPregnantWalkStyle();
            }

            if (mHourOfPregnancy == Woohooer.Settings.mRobotHoursOfPregnancy)
            {
                msg += " - Having the Baby";
                HaveTheBaby();
            }

            Common.DebugNotify(msg);
        }
コード例 #35
0
ファイル: Xenogenesis.cs プロジェクト: Duglarogg/Sims3
            public void HaveTheBaby()
            {
                if (Pregnancy.mContractionBroadcast != null)
                {
                    Pregnancy.mContractionBroadcast.Dispose();
                }

                Abductee.RemoveAlarm(Pregnancy.PreggersAlarm);
                Abductee.RemoveAlarm(Pregnancy.mContractionsAlarm);
                bool flag = false;

                foreach (InteractionInstance current in Abductee.InteractionQueue.InteractionList)
                {
                    HaveAlienBabyHospital haveBabyHospital = current as HaveAlienBabyHospital;

                    if (haveBabyHospital != null)
                    {
                        haveBabyHospital.CancellableByPlayer = false;
                        haveBabyHospital.BabyShouldBeBorn    = true;
                        flag = true;
                        break;
                    }
                }

                if (!flag)
                {
                    List <RabbitHole> hospitals            = RabbitHole.GetRabbitHolesOfType(RabbitHoleType.Hospital);
                    float             distanceToBirthplace = Abductee.LotHome.GetDistanceToObject(Abductee);
                    RabbitHole        hospital             = null;

                    foreach (RabbitHole current in hospitals)
                    {
                        float distanceToHospital = current.RabbitHoleProxy.GetDistanceToObject(Abductee);

                        if (distanceToHospital < distanceToBirthplace)
                        {
                            distanceToBirthplace = distanceToHospital;
                            hospital             = current;
                        }
                    }

                    InteractionInstance instance;

                    if (hospital != null)
                    {
                        instance = HaveAlienBabyHospital.Singleton.CreateInstance(hospital, Abductee,
                                                                                  new InteractionPriority(InteractionPriorityLevel.Pregnancy), false, false);
                        (instance as HaveAlienBabyHospital).BabyShouldBeBorn = true;
                    }
                    else
                    {
                        instance = HaveAlienBabyHome.Singleton.CreateInstance(Abductee.LotHome, Abductee,
                                                                              new InteractionPriority(InteractionPriorityLevel.Pregnancy), false, false);
                    }

                    Abductee.InteractionQueue.Add(instance);
                    ActiveTopic.AddToSim(Abductee, "Recently Had Baby");
                }
            }
コード例 #36
0
        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);
            }
        }
コード例 #37
0
ファイル: Burn.cs プロジェクト: Robobeurre/NRaas
 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);
     }
 }
コード例 #38
0
ファイル: Burn.cs プロジェクト: Robobeurre/NRaas
 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;
     }
 }
コード例 #39
0
ファイル: GiveGiftEx.cs プロジェクト: Robobeurre/NRaas
 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);
     }
 }
コード例 #40
0
ファイル: SimRiskyWoohoo.cs プロジェクト: Robobeurre/NRaas
 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;
     }
 }
コード例 #41
0
ファイル: SimRiskyWoohoo.cs プロジェクト: Robobeurre/NRaas
 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;
     }
 }
コード例 #42
0
ファイル: FixTestBarBrawl.cs プロジェクト: Robobeurre/NRaas
        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;
            }
        }
コード例 #43
0
ファイル: Curse.cs プロジェクト: Robobeurre/NRaas
        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;
            }
        }
コード例 #44
0
ファイル: AskAboutAge.cs プロジェクト: Robobeurre/NRaas
        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;
            }
        }
コード例 #45
0
ファイル: AskAboutFunds.cs プロジェクト: Robobeurre/NRaas
 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);
     }
 }
コード例 #46
0
ファイル: SellPetSocial.cs プロジェクト: Robobeurre/NRaas
 public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         PetSale.DisplayDialog(actor.SimDescription, target.Household, true);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
コード例 #47
0
ファイル: MoochSocials.cs プロジェクト: Robobeurre/NRaas
 public static void AfterMoochSmallMoney(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         AfterMoochMoney(actor, target, TraitTuning.MoochTraitSmallMoneyMoochSkill, Math.Max(0x0, actor.SkillManager.GetSkillLevel(SkillNames.Mooch)));
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }
コード例 #48
0
ファイル: GenderPreference.cs プロジェクト: Robobeurre/NRaas
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                string suffix = null;

                if ((target.SimDescription.mGenderPreferenceMale > 0) && (target.SimDescription.mGenderPreferenceFemale > 0))
                {
                    suffix = "Bi";
                }
                else if ((target.SimDescription.mGenderPreferenceMale == 0) && (target.SimDescription.mGenderPreferenceFemale == 0))
                {
                    suffix = "Undefined";
                }
                else if ((target.SimDescription.mGenderPreferenceMale <= 0) && (target.SimDescription.mGenderPreferenceFemale <= 0))
                {
                    suffix = "Celibate";
                }
                else if (target.IsFemale)
                {
                    if (target.SimDescription.mGenderPreferenceMale > 0)
                    {
                        suffix = "Hetro";
                    }
                    else
                    {
                        suffix = "Same";
                    }
                }
                else
                {
                    if (target.SimDescription.mGenderPreferenceMale > 0)
                    {
                        suffix = "Same";
                    }
                    else
                    {
                        suffix = "Hetro";
                    }
                }

                Common.Notify(Common.Localize("GenderPreference:" + suffix, target.IsFemale, new object[] { target }), target.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSimTalking);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #49
0
ファイル: GenderPreference.cs プロジェクト: Robobeurre/NRaas
        public static bool OnFriendlyTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (Woohooer.Settings.mInteractionsUnderRomance) return false;

                if ((actor != Sim.ActiveActor) && (target != Sim.ActiveActor)) return false;

                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #50
0
ファイル: AskContagious.cs プロジェクト: Robobeurre/NRaas
        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                foreach (DiseaseVector vector in Vector.Settings.GetVectors(target))
                {
                    if (vector.ShowingSigns) return true;
                }

                return false;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #51
0
ファイル: GaugeAttraction.cs プロジェクト: Robobeurre/NRaas
        public static bool OnRomanceTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!Woohooer.Settings.mInteractionsUnderRomance) return false;

                if ((actor != Sim.ActiveActor) && (target != Sim.ActiveActor)) return false;

                string reason;
                if (!CommonSocials.CanGetRomantic(actor, target, isAutonomous, false, true, ref greyedOutTooltipCallback, out reason)) return false;

                return false;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #52
0
ファイル: JetpackTryForBaby.cs プロジェクト: Robobeurre/NRaas
        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!Jetpack.JetpackTestCommon(actor, target))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("TestCommon Denied");
                    return false;
                }

                if (actor.SkillManager.GetSkillLevel(SkillNames.Future) < SocialTest.kFutureSkillRequiredJetpackWoohoo)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Skill Denied");
                    return false;
                }

                SocialJig socialjig = null;
                if (!Jetpack.CheckSpaceForFlyAroundJig(actor, target, ref socialjig, true, true))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/Objects/EP11/Jetpack:NotEnoughSpace", new object[] { target }));
                    return false;
                }

                if (!Woohooer.Settings.mAutonomousJetPack)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Location Denied");
                    return false;
                }

                return CommonPregnancy.SatisfiesTryForBaby(actor, target, "JetPackTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #53
0
ファイル: CommonSocials.cs プロジェクト: Robobeurre/NRaas
        public static bool TestMagicWandEquipped(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                MagicControl controlActor = MagicControl.GetBestControl(actor, SpellcastingDuelEx.Singleton as IMagicalDefinition);
                if (controlActor == null) return false;

                MagicControl controlTarget = MagicControl.GetBestControl(target, SpellcastingDuelEx.Singleton as IMagicalDefinition);
                if (controlTarget == null) return false;

                return true;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #54
0
ファイル: Shakedown.cs プロジェクト: Robobeurre/NRaas
        public static void OnAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                int funds = RandomUtil.GetInt(NRaas.Careers.Settings.mMaxShakedown / 2, NRaas.Careers.Settings.mMaxShakedown);

                if (funds > target.FamilyFunds)
                {
                    funds = target.FamilyFunds;
                }

                if (funds <= 0) return;

                target.ModifyFunds(-funds);

                actor.ModifyFunds(funds);

                if (actor.IsSelectable)
                {
                    Common.Notify(actor, Common.Localize("Shakedown:Notice", actor.IsFemale, target.IsFemale, new object[] { actor, target, funds }));
                }

                Relationship relation = Relationship.Get(actor, target, true);
                if (relation != null)
                {
                    relation.LTR.UpdateLiking(NRaas.Careers.Settings.mShakedownRelationChange);
                }

                OmniCareer actorCareer = actor.Occupation as OmniCareer;
                if (actorCareer != null)
                {
                    actorCareer.AddShakedownFunds(funds);
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #55
0
ファイル: AskContagious.cs プロジェクト: Robobeurre/NRaas
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                foreach (DiseaseVector vector in Vector.Settings.GetVectors(target))
                {
                    if (vector.ShowingSigns)
                    {
                        if (vector.IsContagious)
                        {
                            Common.Notify(target, Common.Localize("AskContagious:Success", target.IsFemale, new object[] { target }));
                            return;
                        }
                    }
                }

                Common.Notify(target, Common.Localize("AskContagious:Failure", target.IsFemale, new object[] { target }));
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #56
0
ファイル: GaugeAttraction.cs プロジェクト: Robobeurre/NRaas
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                int score = (int)RelationshipEx.GetAttractionScore(actor.SimDescription, target.SimDescription, true);

                int index = score / 25;
                if (index >= 4)
                {
                    index = 3;
                }
                else if (index < 0)
                {
                    index = 0;
                }

                Common.Notify(Common.Localize("GaugeAttraction:Result" + index, target.IsFemale, actor.IsFemale, new object[] { target, actor }), actor.ObjectId, target.ObjectId, StyledNotification.NotificationStyle.kSimTalking);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #57
0
ファイル: Recruit.cs プロジェクト: Robobeurre/NRaas
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                Career actorCareer = actor.Occupation as Career;
                Career targetCareer = target.Occupation as Career;

                if (actorCareer == null) return false;

                if ((targetCareer != null) && (actorCareer.Guid == targetCareer.Guid))
                {
                    if (actorCareer.CurLevelBranchName == targetCareer.CurLevelBranchName) return false;
                }

                if (!actorCareer.CareerAgeTest(target.SimDescription)) return false;

                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #58
0
ファイル: SellPetSocial.cs プロジェクト: Robobeurre/NRaas
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (actor.Household == target.Household) return false;

                if (SimTypes.IsSpecial(target.Household)) return false;

                if (!target.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.Horse)) return false;

                if (target.FamilyFunds < Consigner.Settings.mSellPrice[1] * 2) return false;

                return (Households.NumPets(actor.Household) > 0);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #59
0
ファイル: Shakedown.cs プロジェクト: Robobeurre/NRaas
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (NRaas.Careers.Settings.mMaxShakedown <= 0) return false;

                if (actor.Occupation is Criminal) return true;

                if (actor.Occupation is LawEnforcement) return true;

                OmniCareer actorCareer = actor.Occupation as OmniCareer;
                if (actorCareer != null)
                {
                    return actorCareer.CanShakedown();
                }

                return false;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #60
0
ファイル: SimRiskyWoohoo.cs プロジェクト: Robobeurre/NRaas
        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (Woohooer.Settings.mEAStandardWoohoo)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("EA Ruleset Fail");
                    return false;
                }

                if (Woohooer.Settings.ReplaceWithRisky)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Replace With Risky Fail");
                    return false;
                }

                return Test(actor, target, topic, isAutonomous, ref greyedOutTooltipCallback);
            }
            catch (Exception exception)
            {
                Common.Exception(actor, target, exception);
                return false;
            }
        }