예제 #1
0
 public void Loop(StateMachineClient smc, InteractionInstance.LoopData data)
 {
     if (data.mLifeTime > 676)
     {
         this.Actor.AddExitReason(ExitReason.Finished);
     }
 }
예제 #2
0
            protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData)
            {
                if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates)
                {
                    if (RandomUtil.RandomChance(kGeologyClubCollectChance))
                    {
                        List <RockGemMetalBase> rocks = new List <RockGemMetalBase>(Sims3.Gameplay.Queries.GetObjects <RockGemMetalBase>());
                        if (rocks.Count > 0)
                        {
                            RockGemMetalBase rock = RandomUtil.GetRandomObjectFromList(rocks);

                            if (Inventories.TryToMove(rock, mInteraction.Actor))
                            {
                                rock.RegisterCollected(mInteraction.Actor, false);
                                rock.RemoveFromWorld();

                                string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, rock.GetLocalizedName() });

                                mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, rock.ObjectId);
                            }
                        }
                    }
                }

                mInteraction.AfterschoolActivityLoopDelegate(smc, loopData);
            }
예제 #3
0
            protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData)
            {
                if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates)
                {
                    if (RandomUtil.RandomChance(kExplorerClubCollectChance))
                    {
                        IGameObject huntable = GetHuntable();
                        if (huntable != null)
                        {
                            if (Inventories.TryToMove(huntable, mInteraction.Actor))
                            {
                                RockGemMetalBase rock = huntable as RockGemMetalBase;
                                if (rock != null)
                                {
                                    rock.RegisterCollected(mInteraction.Actor, false);
                                }

                                string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, huntable.GetLocalizedName() });

                                mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, huntable.ObjectId);
                            }
                            else
                            {
                                huntable.Destroy();
                            }
                        }
                    }
                }

                mInteraction.AfterschoolActivityLoopDelegate(smc, loopData);
            }
예제 #4
0
 private void LoopCallback(StateMachineClient smc, InteractionInstance.LoopData ld)
 {
     if (!JapLowDinnerTable.CheckIfHasFood(this.mServingContainer))
     {
         this.Actor.AddExitReason(ExitReason.Finished);
         return;
     }
     if (this.mServingContainer is ServingContainerSingle)
     {
         ServingContainerSingle servingContainerSingle = this.mServingContainer as ServingContainerSingle;
         servingContainerSingle.DecrementFoodUnits();
     }
     else if (this.mServingContainer is Snack)
     {
         Snack snack = this.mServingContainer as Snack;
         snack.DecrementFoodUnits();
     }
     this.Actor.Motives.ChangeValue(CommodityKind.Hunger, 10f);
     if (this.Actor.ShouldDoGroupTalk())
     {
         this.Actor.DoGroupTalk(new Sim.GroupTalkDelegate(this.PauseSim), new Sim.GroupTalkDelegate(this.UnpauseSim), true);
     }
     if (SimClock.ElapsedTime(TimeUnit.Minutes) - this.mLastReactionTime > this.mEatingDuration)
     {
         this.Actor.AddExitReason(ExitReason.Finished);
         if (this.mServingContainer is ServingContainerGroup)
         {
             ServingContainerGroup servingContainerGroup = this.mServingContainer as ServingContainerGroup;
             servingContainerGroup.DecrementServings();
         }
     }
 }
예제 #5
0
            protected override void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData)
            {
                if (SimClock.ElapsedTime(TimeUnit.Minutes, mInteraction.mLastLTRUpdateDateAndTime) >= GoToSchoolInRabbitHole.kSimMinutesBetweenLTRUpdates)
                {
                    if (RandomUtil.RandomChance(kBugClubCollectChance))
                    {
                        List <InsectJig> insects = new List <InsectJig>(Sims3.Gameplay.Queries.GetObjects <InsectJig>());

                        if (insects.Count > 0)
                        {
                            InsectJig insect = RandomUtil.GetRandomObjectFromList(insects);

                            Terrarium terrarium = InsectTerrarium.Create(insect, mInteraction.Actor);

                            if (terrarium != null)
                            {
                                string msg = Common.Localize("AfterschoolFoundObject:Notice", mInteraction.Actor.IsFemale, new object[] { mInteraction.Actor, terrarium.GetLocalizedName() });

                                mInteraction.Actor.ShowTNSIfSelectable(msg, StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, terrarium.ObjectId);
                            }
                        }
                    }
                }

                mInteraction.AfterschoolActivityLoopDelegate(smc, loopData);
            }
예제 #6
0
파일: SniffOutEx.cs 프로젝트: yakoder/NRaas
 public override void SniffLoop(StateMachineClient smc, InteractionInstance.LoopData data)
 {
     try
     {
         if (mInitialSkill == -1)
         {
             mInitialSkill = Actor.SkillManager.GetSkillLevel(SkillNames.DogHunting);
         }
         else if (mInitialSkill == Actor.SkillManager.GetSkillLevel(SkillNames.DogHunting))
         {
             base.SniffLoop(smc, data);
         }
         else
         {
             Actor.AddExitReason(ExitReason.RouteFailed);
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(Actor, Target, e);
     }
 }
예제 #7
0
 private void NapLoop(StateMachineClient smc, InteractionInstance.LoopData data)
 {
     if (data.mLifeTime > BuffTiredFromMoving.TimeToRemove * 60f)
     {
         this.Actor.BuffManager.RemoveElement(BuffNames.TiredFromMoving);
     }
     TraitFunctions.BedSnore(this.Actor, data.mLifeTime, ref this.NapSoundTime);
     TraitFunctions.CheckLightSleeperDisturbed(this.Actor);
 }
예제 #8
0
        protected void WatchLoopEx(StateMachineClient smc, InteractionInstance.LoopData ld)
        {
            try
            {
                PerformanceCareer occupationAsPerformanceCareer = Target.OccupationAsPerformanceCareer;
                if (occupationAsPerformanceCareer == null)
                {
                    return;
                }

                int mLifeTime = (int)ld.mLifeTime;
                if ((Actor.IsNPC && (mTippingStatus == Tipping.NoTip)) && (mLifeTime > mGoalTimeToTestTip))
                {
                    if (RandomUtil.RandomChance01(mTipChancePerCheck))
                    {
                        mTippingStatus = Tipping.WillTip;
                    }
                    mGoalTimeToTestTip = mLifeTime + occupationAsPerformanceCareer.Tuning.TimePerTipTest;
                }

                if (mShouldReactNow)
                {
                    ReactToPerformance();
                    mShouldReactNow = false;
                }

                if (mItsAGoodTimeToTip)
                {
                    if (mTippingStatus == Tipping.WillTip)
                    {
                        Vector3 position = Actor.Position;

                        // Custom
                        AttemptToGiveATipEx();

                        RouteBackToViewingPosition(position);
                    }
                    mItsAGoodTimeToTip = false;
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
예제 #9
0
 public void Perform(StateMachineClient smc, InteractionInstance.LoopData loopData)
 {
     try
     {
         PrivatePerform(smc, loopData);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(mInteraction.Actor, mInteraction.Target, e);
     }
 }
예제 #10
0
 private void LearnLoop(StateMachineClient smc, InteractionInstance.LoopData data)
 {
     try
     {
         if (data.mLifeTime > 30)
         {
             Actor.AddExitReason(ExitReason.Finished);
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception exception)
     {
         Common.Exception(Actor, Target, exception);
     }
 }
예제 #11
0
 private void WaitPeriodLoop(StateMachineClient smc, InteractionInstance.LoopData loopData)
 {
     if (mBegin)
     {
         Actor.AddExitReason(ExitReason.StageComplete);
     }
     else
     {
         Sim actor = LinkedInteractionInstance.InstanceActor;
         if ((actor == null) || (actor.HasBeenDestroyed))
         {
             Actor.AddExitReason(ExitReason.StageComplete);
         }
         else if (!actor.InteractionQueue.HasInteraction(LinkedInteractionInstance))
         {
             Actor.AddExitReason(ExitReason.StageComplete);
         }
     }
 }
예제 #12
0
        private new void GiveBirthLoopFunc(StateMachineClient smc, InteractionInstance.LoopData loopData)
        {
            try
            {
                if (!bHasSpawnedOffspring && (loopData.mLifeTime > kDistressLengthBeforeSpawnNewborns))
                {
                    bHasSpawnedOffspring = true;

                    // Custom call
                    SpawnOffspring();
                }
                if (loopData.mLifeTime > kDistressTotalLength)
                {
                    Actor.AddExitReason(ExitReason.Finished);
                }
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
예제 #13
0
 protected abstract void PrivatePerform(StateMachineClient smc, InteractionInstance.LoopData loopData);
예제 #14
0
        private new void LoopDel(StateMachineClient smc, InteractionInstance.LoopData loopData)
        {
            try
            {
                bool flag = false;
                if (simToChat == null)
                {
                    flag = true;
                }
                else
                {
                    SimDescription simDescription = simToChat.SimDescription;
                    if ((simDescription == null) || !simDescription.IsValidDescription)
                    {
                        flag = true;
                    }
                }

                if (flag)
                {
                    Actor.AddExitReason(ExitReason.Finished);
                }
                else
                {
                    int lifeTime = (int)loopData.mLifeTime;
                    if (Actor.HasTrait(TraitNames.AntiTV) && (lifeTime > Computer.kTechnophobeTraitMaximumChatTime))
                    {
                        Actor.AddExitReason(ExitReason.Finished);
                    }

                    int chatRelationshipIncreaseEveryXMinutes = Target.ComputerTuning.ChatRelationshipIncreaseEveryXMinutes;
                    if (chatRelationshipIncreaseEveryXMinutes != 0)
                    {
                        if ((lifeTime / Target.ComputerTuning.ChatRelationshipIncreaseEveryXMinutes) > RelationshipIncreases)
                        {
                            RelationshipIncreases++;
                            Target.ChatUpdate(Actor, simToChat, Target);
                        }
                    }

                    int cyberWoohooChanceToClimaxEveryXMinutes = KamaSimtra.Settings.mCyberWoohooChanceToClimaxEveryXMinutes;
                    if (cyberWoohooChanceToClimaxEveryXMinutes != 0)
                    {
                        if ((lifeTime / cyberWoohooChanceToClimaxEveryXMinutes) > mClimaxChances)
                        {
                            mClimaxChances++;

                            if (RandomUtil.RandomChance(KamaSimtra.Settings.mCyberWoohooChanceToClimax * mClimaxChances))
                            {
                                CommonWoohoo.RunPostWoohoo(Actor, simToChat, Target, CommonWoohoo.WoohooStyle.Safe, CommonWoohoo.WoohooLocation.Computer, false);

                                Actor.AddExitReason(ExitReason.Finished);
                            }
                        }
                    }

                    if (timeTillLearn < lifeTime)
                    {
                        Relationship relation = Relationship.Get(Actor, simToChat, true);
                        if (relation != null)
                        {
                            relation.ConsiderLearningAboutTargetSim(Actor, simToChat, Target.ComputerTuning.ChatIntimacylevel);
                        }

                        timeTillLearn = lifeTime + RandomUtil.RandomFloatGaussianDistribution(Target.ComputerTuning.ChatLearnSomethingFrequencyStart, Target.ComputerTuning.ChatLearnSomethingFrequencyEnd);
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                Actor.AddExitReason(ExitReason.Finished);
            }
        }