Ejemplo n.º 1
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);
            }
Ejemplo n.º 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);
            }